mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
shared library (#1080)
* shared project scaffold * rules package * move evaluators to shared lib * add rxjs peer dependency * use dedicated material namespaces * create store package, move actions * move selectors to shared library * move generic effects to shared lib * move routing extensions * minor code reorg * fix unit tests * move content-api service * move permission service * update tests * update plint config * move page layout * css variables * use dedicated css property * move generic error component to shared lib * fix test
This commit is contained in:
@@ -35,7 +35,10 @@ import {
|
||||
import { SearchInputComponent } from './search-input.component';
|
||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||
import { Actions, ofType } from '@ngrx/effects';
|
||||
import { SEARCH_BY_TERM, SearchByTermAction } from '../../../store/actions';
|
||||
import {
|
||||
SearchByTermAction,
|
||||
SearchActionTypes
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
||||
import { SearchLibrariesQueryBuilderService } from '../search-libraries-results/search-libraries-query-builder.service';
|
||||
@@ -90,7 +93,7 @@ describe('SearchInputComponent', () => {
|
||||
const searchedTerm = 's';
|
||||
const currentSearchOptions = [{ key: 'test' }];
|
||||
actions$.pipe(
|
||||
ofType<SearchByTermAction>(SEARCH_BY_TERM),
|
||||
ofType<SearchByTermAction>(SearchActionTypes.SearchByTerm),
|
||||
map(action => {
|
||||
expect(action.searchOptions[0].key).toBe(currentSearchOptions[0].key);
|
||||
done();
|
||||
@@ -103,7 +106,7 @@ describe('SearchInputComponent', () => {
|
||||
it('should call search action with correct searched term', fakeAsync(done => {
|
||||
const searchedTerm = 's';
|
||||
actions$.pipe(
|
||||
ofType<SearchByTermAction>(SEARCH_BY_TERM),
|
||||
ofType<SearchByTermAction>(SearchActionTypes.SearchByTerm),
|
||||
map(action => {
|
||||
expect(action.payload).toBe(searchedTerm);
|
||||
done();
|
||||
@@ -119,7 +122,7 @@ describe('SearchInputComponent', () => {
|
||||
const searchedTerm = 's';
|
||||
const currentSearchOptions = [{ key: 'test' }];
|
||||
actions$.pipe(
|
||||
ofType<SearchByTermAction>(SEARCH_BY_TERM),
|
||||
ofType<SearchByTermAction>(SearchActionTypes.SearchByTerm),
|
||||
map(action => {
|
||||
expect(action.searchOptions[0].key).toBe(currentSearchOptions[0].key);
|
||||
done();
|
||||
@@ -132,7 +135,7 @@ describe('SearchInputComponent', () => {
|
||||
it('should call search action with correct searched term', fakeAsync(done => {
|
||||
const searchedTerm = 's';
|
||||
actions$.pipe(
|
||||
ofType<SearchByTermAction>(SEARCH_BY_TERM),
|
||||
ofType<SearchByTermAction>(SearchActionTypes.SearchByTerm),
|
||||
map(action => {
|
||||
expect(action.payload).toBe(searchedTerm);
|
||||
done();
|
||||
|
@@ -23,6 +23,14 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
AppStore,
|
||||
SearchByTermAction,
|
||||
SearchOptionIds,
|
||||
SearchOptionModel
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import {
|
||||
Component,
|
||||
OnDestroy,
|
||||
@@ -30,6 +38,7 @@ import {
|
||||
ViewChild,
|
||||
ViewEncapsulation
|
||||
} from '@angular/core';
|
||||
import { MatMenuTrigger } from '@angular/material/menu';
|
||||
import {
|
||||
NavigationEnd,
|
||||
PRIMARY_OUTLET,
|
||||
@@ -39,21 +48,12 @@ import {
|
||||
UrlSegmentGroup,
|
||||
UrlTree
|
||||
} from '@angular/router';
|
||||
import { SearchInputControlComponent } from '../search-input-control/search-input-control.component';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AppStore } from '../../../store/states/app.state';
|
||||
import { SearchByTermAction } from '../../../store/actions';
|
||||
import { filter, takeUntil } from 'rxjs/operators';
|
||||
import { SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
||||
import { ContentManagementService } from '../../../services/content-management.service';
|
||||
import { Subject } from 'rxjs';
|
||||
import { filter, takeUntil } from 'rxjs/operators';
|
||||
import { ContentManagementService } from '../../../services/content-management.service';
|
||||
import { SearchInputControlComponent } from '../search-input-control/search-input-control.component';
|
||||
import { SearchLibrariesQueryBuilderService } from '../search-libraries-results/search-libraries-query-builder.service';
|
||||
import { MatMenuTrigger } from '@angular/material';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import {
|
||||
SearchOptionModel,
|
||||
SearchOptionIds
|
||||
} from '../../../store/models/searchOption.model';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-search-input',
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<app-page-layout>
|
||||
<app-page-layout-header>
|
||||
<aca-page-layout>
|
||||
<aca-page-layout-header>
|
||||
<adf-breadcrumb root="APP.BROWSE.SEARCH_LIBRARIES.TITLE"> </adf-breadcrumb>
|
||||
<adf-toolbar class="adf-toolbar--inline">
|
||||
<ng-container *ngFor="let entry of actions; trackBy: trackByActionId">
|
||||
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
|
||||
</ng-container>
|
||||
</adf-toolbar>
|
||||
</app-page-layout-header>
|
||||
</aca-page-layout-header>
|
||||
|
||||
<app-page-layout-content>
|
||||
<aca-page-layout-content>
|
||||
<div class="main-content">
|
||||
<div class="adf-search-results">
|
||||
<div class="adf-search-results__content">
|
||||
@@ -123,5 +123,5 @@
|
||||
<div class="sidebar" *ngIf="(infoDrawerOpened$ | async)">
|
||||
<aca-info-drawer [node]="selection.last"></aca-info-drawer>
|
||||
</div>
|
||||
</app-page-layout-content>
|
||||
</app-page-layout>
|
||||
</aca-page-layout-content>
|
||||
</aca-page-layout>
|
||||
|
@@ -23,17 +23,17 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NavigateLibraryAction } from '@alfresco/aca-shared/store';
|
||||
import { NodePaging, Pagination, SiteEntry } from '@alfresco/js-api';
|
||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { PageComponent } from '../../page.component';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AppStore } from '../../../store/states/app.state';
|
||||
import { NavigateLibraryAction } from '../../../store/actions';
|
||||
import { AppExtensionService } from '../../../extensions/extension.service';
|
||||
import { ContentManagementService } from '../../../services/content-management.service';
|
||||
import { AppStore } from '@alfresco/aca-shared/store';
|
||||
import { PageComponent } from '../../page.component';
|
||||
import { SearchLibrariesQueryBuilderService } from './search-libraries-query-builder.service';
|
||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-search-results',
|
||||
|
@@ -32,9 +32,8 @@ import {
|
||||
OnDestroy
|
||||
} from '@angular/core';
|
||||
import { MinimalNodeEntity } from '@alfresco/js-api';
|
||||
import { ViewFileAction } from '../../../store/actions';
|
||||
import { ViewFileAction, NavigateToFolder } from '@alfresco/aca-shared/store';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { NavigateToFolder } from '../../../store/actions';
|
||||
import { BehaviorSubject, Subject } from 'rxjs';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<app-page-layout>
|
||||
<app-page-layout-header>
|
||||
<aca-page-layout>
|
||||
<aca-page-layout-header>
|
||||
<adf-breadcrumb root="APP.BROWSE.SEARCH.TITLE"> </adf-breadcrumb>
|
||||
<adf-toolbar class="adf-toolbar--inline">
|
||||
<ng-container *ngFor="let entry of actions; trackBy: trackByActionId">
|
||||
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
|
||||
</ng-container>
|
||||
</adf-toolbar>
|
||||
</app-page-layout-header>
|
||||
</aca-page-layout-header>
|
||||
|
||||
<app-page-layout-content>
|
||||
<aca-page-layout-content>
|
||||
<div class="main-content">
|
||||
<div class="adf-search-results">
|
||||
<adf-search-filter
|
||||
@@ -114,5 +114,5 @@
|
||||
<div class="sidebar" *ngIf="(infoDrawerOpened$ | async)">
|
||||
<aca-info-drawer [node]="selection.last"></aca-info-drawer>
|
||||
</div>
|
||||
</app-page-layout-content>
|
||||
</app-page-layout>
|
||||
</aca-page-layout-content>
|
||||
</aca-page-layout>
|
||||
|
@@ -16,7 +16,10 @@ import {
|
||||
TranslationService
|
||||
} from '@alfresco/adf-core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { NavigateToFolder, SnackbarErrorAction } from '../../../store/actions';
|
||||
import {
|
||||
NavigateToFolder,
|
||||
SnackbarErrorAction
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { Pagination } from '@alfresco/js-api';
|
||||
import { SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
@@ -32,14 +32,16 @@ import {
|
||||
} from '@alfresco/adf-content-services';
|
||||
import { PageComponent } from '../../page.component';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AppStore } from '../../../store/states/app.state';
|
||||
import { NavigateToFolder } from '../../../store/actions';
|
||||
import {
|
||||
AppStore,
|
||||
NavigateToFolder,
|
||||
SnackbarErrorAction,
|
||||
showFacetFilter
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { AppExtensionService } from '../../../extensions/extension.service';
|
||||
import { ContentManagementService } from '../../../services/content-management.service';
|
||||
import { AppConfigService, TranslationService } from '@alfresco/adf-core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { showFacetFilter } from '../../../store/selectors/app.selectors';
|
||||
import { SnackbarErrorAction } from '../../../store/actions';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-search-results',
|
||||
|
Reference in New Issue
Block a user