[ACS-5308] cleanup content common module and move to standalone components (#3234)

* language picker

* location link

* logout component

* logout: fix tests

* toggle shared component

* user info component

* cleanup common module

* migrate generic error to standalone

* thumbnail column component

* name column component

* tags column component

* locked by component

* cleanup module dependencies

* comments tab component

* info drawer and details

* cleanup infodrawer module

* remove useless test

* reduce useless imports

* info drawer module

* context menu component
This commit is contained in:
Denys Vuika 2023-05-29 10:28:26 +01:00 committed by GitHub
parent 40c4740b3a
commit 251b6a0ec7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 291 additions and 384 deletions

View File

@ -88,7 +88,7 @@ registerLocaleData(localeSv);
BrowserModule,
TranslateModule.forRoot(),
CoreModule.forRoot(),
SharedModule.forRoot(),
SharedModule,
CoreExtensionsModule.forRoot(),
AppLoginModule,
environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule,

View File

@ -64,7 +64,7 @@ module.exports = () => {
statements: 75,
branches: 67,
functions: 73,
lines: 75
lines: 74
}
}
},

View File

@ -34,7 +34,7 @@ import {
LibraryStatusColumnComponent,
TrashcanNameColumnComponent
} from '@alfresco/adf-content-services';
import { DocumentBasePageService, ExtensionsDataLoaderGuard, PageLayoutModule, SharedModule } from '@alfresco/aca-shared';
import { DocumentBasePageService, ExtensionsDataLoaderGuard, PageLayoutModule, SharedModule, GenericErrorComponent } from '@alfresco/aca-shared';
import * as rules from '@alfresco/aca-shared/rules';
import { FilesComponent } from './components/files/files.component';
@ -47,11 +47,10 @@ import { MaterialModule } from './material.module';
import { CoreExtensionsModule } from './extensions/core.extensions.module';
import { AppInfoDrawerModule } from './components/info-drawer/info.drawer.module';
import { DirectivesModule } from './directives/directives.module';
import { ContextMenuModule } from './components/context-menu/context-menu.module';
import { ExtensionService, ExtensionsModule } from '@alfresco/adf-extensions';
import { AppToolbarModule } from './components/toolbar/toolbar.module';
import { AppSidenavModule } from './components/sidenav/sidenav.module';
import { AppCommonModule } from './components/common/common.module';
import { APP_COMMON_DIRECTIVES } from './components/common/common.module';
import { AppSearchInputModule } from './components/search/search-input.module';
import { DocumentListCustomComponentsModule } from './components/dl-custom-components/document-list-custom-components.module';
import { AppSearchResultsModule } from './components/search/search-results.module';
@ -93,6 +92,7 @@ import { SidenavComponent } from './components/sidenav/sidenav.component';
import { ContentManagementService } from './services/content-management.service';
import { ShellLayoutComponent, SHELL_NAVBAR_MIN_WIDTH } from '@alfresco/adf-core/shell';
import { UserMenuComponent } from './components/sidenav/user-menu/user-menu.component';
import { ContextMenuComponent } from './components/context-menu/context-menu.component';
@NgModule({
imports: [
@ -107,10 +107,10 @@ import { UserMenuComponent } from './components/sidenav/user-menu/user-menu.comp
SharedModule,
MaterialModule,
AppStoreModule,
AppCommonModule,
...APP_COMMON_DIRECTIVES,
PageLayoutModule,
DirectivesModule,
ContextMenuModule,
ContextMenuComponent,
AppInfoDrawerModule,
AppToolbarModule,
AppSidenavModule,
@ -121,11 +121,12 @@ import { UserMenuComponent } from './components/sidenav/user-menu/user-menu.comp
ViewProfileModule,
AppTrashcanModule,
AppSharedLinkViewModule,
AcaFolderRulesModule
AcaFolderRulesModule,
GenericErrorComponent,
DetailsComponent
],
declarations: [
FilesComponent,
DetailsComponent,
LibrariesComponent,
FavoriteLibrariesComponent,
FavoritesComponent,

View File

@ -22,30 +22,25 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { CoreModule } from '@alfresco/adf-core';
import { ExtensionsModule } from '@alfresco/adf-extensions';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { GenericErrorModule } from '@alfresco/aca-shared';
import { LocationLinkComponent } from './location-link/location-link.component';
import { ToggleSharedComponent } from './toggle-shared/toggle-shared.component';
import { LanguagePickerComponent } from './language-picker/language-picker.component';
import { LogoutComponent } from './logout/logout.component';
import { ContentModule } from '@alfresco/adf-content-services';
import { UserInfoComponent } from './user-info/user-info.component';
import { RouterModule } from '@angular/router';
/**
* @deprecated Use `APP_COMMON_DIRECTIVES` instead
*/
@NgModule({
imports: [CommonModule, CoreModule.forChild(), ContentModule.forChild(), ExtensionsModule, GenericErrorModule, RouterModule],
declarations: [LocationLinkComponent, ToggleSharedComponent, LanguagePickerComponent, LogoutComponent, UserInfoComponent],
exports: [
ExtensionsModule,
LocationLinkComponent,
GenericErrorModule,
ToggleSharedComponent,
LanguagePickerComponent,
LogoutComponent,
UserInfoComponent
]
imports: [LanguagePickerComponent, LocationLinkComponent, LogoutComponent, ToggleSharedComponent, UserInfoComponent]
})
export class AppCommonModule {}
export const APP_COMMON_DIRECTIVES = [
LanguagePickerComponent,
LocationLinkComponent,
LogoutComponent,
ToggleSharedComponent,
UserInfoComponent
] as const;

View File

@ -22,9 +22,15 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { LanguageMenuModule } from '@alfresco/adf-core';
import { Component } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { MatMenuModule } from '@angular/material/menu';
import { TranslateModule } from '@ngx-translate/core';
@Component({
standalone: true,
imports: [TranslateModule, MatIconModule, MatMenuModule, LanguageMenuModule],
selector: 'aca-language-picker',
template: `
<button mat-menu-item [matMenuTriggerFor]="langMenu">

View File

@ -22,16 +22,19 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Component, Input, ChangeDetectionStrategy, OnInit, ViewEncapsulation, HostListener } from '@angular/core';
import { Component, Input, ChangeDetectionStrategy, OnInit, ViewEncapsulation, HostListener, inject } from '@angular/core';
import { PathInfo, MinimalNodeEntity } from '@alfresco/js-api';
import { Observable, BehaviorSubject, of } from 'rxjs';
import { Store } from '@ngrx/store';
import { AppStore, NavigateToParentFolder } from '@alfresco/aca-shared/store';
import { NavigateToParentFolder } from '@alfresco/aca-shared/store';
import { ContentApiService } from '@alfresco/aca-shared';
import { TranslationService } from '@alfresco/adf-core';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
@Component({
standalone: true,
imports: [CommonModule, TranslateModule],
selector: 'aca-location-link',
template: `
<a
@ -50,6 +53,10 @@ import { TranslationService } from '@alfresco/adf-core';
}
})
export class LocationLinkComponent implements OnInit {
private store = inject(Store);
private contentApi = inject(ContentApiService);
private translationService = inject(TranslationService);
private _path: PathInfo;
nodeLocation$ = new BehaviorSubject(this.translationService.instant('APP.BROWSE.SEARCH.UNKNOWN_LOCATION'));
@ -66,8 +73,6 @@ export class LocationLinkComponent implements OnInit {
this.getTooltip(this._path);
}
constructor(private store: Store<AppStore>, private contentApi: ContentApiService, private translationService: TranslationService) {}
goToLocation() {
if (this.context) {
const node: MinimalNodeEntity = this.context.row.node;

View File

@ -31,12 +31,11 @@ import { SetSelectedNodesAction } from '@alfresco/aca-shared/store';
describe('LogoutComponent', () => {
let fixture: ComponentFixture<LogoutComponent>;
let component: LogoutComponent;
let store;
let store: Store;
beforeEach(() => {
TestBed.configureTestingModule({
imports: [AppTestingModule],
declarations: [LogoutComponent],
imports: [AppTestingModule, LogoutComponent],
providers: [
{
provide: Store,

View File

@ -24,9 +24,14 @@
import { Component } from '@angular/core';
import { Store } from '@ngrx/store';
import { AppStore, SetSelectedNodesAction } from '@alfresco/aca-shared/store';
import { SetSelectedNodesAction } from '@alfresco/aca-shared/store';
import { TranslateModule } from '@ngx-translate/core';
import { MatIconModule } from '@angular/material/icon';
import { MatMenuModule } from '@angular/material/menu';
@Component({
standalone: true,
imports: [TranslateModule, MatIconModule, MatMenuModule],
selector: 'aca-logout',
template: `
<button mat-menu-item (click)="onLogoutEvent()" adf-logout>
@ -36,7 +41,7 @@ import { AppStore, SetSelectedNodesAction } from '@alfresco/aca-shared/store';
`
})
export class LogoutComponent {
constructor(private store: Store<AppStore>) {}
constructor(private store: Store) {}
onLogoutEvent() {
this.store.dispatch(new SetSelectedNodesAction([]));

View File

@ -27,8 +27,15 @@ import { Observable } from 'rxjs';
import { Store } from '@ngrx/store';
import { SelectionState } from '@alfresco/adf-extensions';
import { AppStore, ShareNodeAction, getAppSelection } from '@alfresco/aca-shared/store';
import { CommonModule } from '@angular/common';
import { MatMenuModule } from '@angular/material/menu';
import { MatIconModule } from '@angular/material/icon';
import { TranslateModule } from '@ngx-translate/core';
import { MatButtonModule } from '@angular/material/button';
@Component({
standalone: true,
imports: [CommonModule, MatMenuModule, MatIconModule, TranslateModule, MatButtonModule],
selector: 'app-toggle-shared',
templateUrl: './toggle-shared.component.html'
})

View File

@ -87,8 +87,7 @@ describe('UserInfoComponent', () => {
};
TestBed.configureTestingModule({
imports: [AppTestingModule],
declarations: [UserInfoComponent],
imports: [AppTestingModule, UserInfoComponent],
providers: [
{ provide: AuthenticationService, useValue: authServiceStub },
{ provide: PeopleContentService, useValue: peopleContentServiceStub },

View File

@ -27,8 +27,14 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { Observable, of } from 'rxjs';
import { PeopleContentService } from '@alfresco/adf-content-services';
import { map } from 'rxjs/operators';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { MatMenuModule } from '@angular/material/menu';
import { TranslateModule } from '@ngx-translate/core';
@Component({
standalone: true,
imports: [CommonModule, RouterModule, MatMenuModule, TranslateModule],
selector: 'app-user-info',
templateUrl: './user-info.component.html',
styleUrls: ['./user-info.component.scss'],

View File

@ -25,8 +25,8 @@
import { TestBed, ComponentFixture } from '@angular/core/testing';
import { AppTestingModule } from '../../testing/app-testing.module';
import { ContextMenuItemComponent } from './context-menu-item.component';
import { ContextMenuModule } from './context-menu.module';
import { AppExtensionService } from '@alfresco/aca-shared';
import { ContextMenuComponent } from './context-menu.component';
describe('ContextMenuComponent', () => {
let fixture: ComponentFixture<ContextMenuItemComponent>;
@ -36,8 +36,7 @@ describe('ContextMenuComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [AppTestingModule, ContextMenuModule],
providers: [AppExtensionService]
imports: [AppTestingModule, ContextMenuComponent]
});
fixture = TestBed.createComponent(ContextMenuItemComponent);

View File

@ -23,10 +23,17 @@
*/
import { Component, Input, ViewEncapsulation } from '@angular/core';
import { ContentActionRef } from '@alfresco/adf-extensions';
import { ContentActionRef, ExtensionsModule } from '@alfresco/adf-extensions';
import { AppExtensionService } from '@alfresco/aca-shared';
import { CommonModule } from '@angular/common';
import { MatMenuModule } from '@angular/material/menu';
import { TranslateModule } from '@ngx-translate/core';
import { IconModule } from '@alfresco/adf-core';
import { MatDividerModule } from '@angular/material/divider';
@Component({
standalone: true,
imports: [CommonModule, TranslateModule, MatMenuModule, IconModule, MatDividerModule, ExtensionsModule],
selector: 'app-context-menu-item',
templateUrl: './context-menu-item.component.html',
encapsulation: ViewEncapsulation.None,

View File

@ -27,6 +27,7 @@ import { fromEvent, Subscription } from 'rxjs';
import { filter } from 'rxjs/operators';
@Directive({
standalone: true,
selector: '[acaContextMenuOutsideEvent]'
})
export class OutsideEventDirective implements OnInit, OnDestroy {

View File

@ -25,7 +25,6 @@
import { TestBed, ComponentFixture } from '@angular/core/testing';
import { AppTestingModule } from '../../testing/app-testing.module';
import { ContextMenuComponent } from './context-menu.component';
import { ContextMenuModule } from './context-menu.module';
import { ContextMenuOverlayRef } from './context-menu-overlay';
import { ContentActionType } from '@alfresco/adf-extensions';
@ -50,7 +49,7 @@ describe('ContextMenuComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ContextMenuModule, AppTestingModule],
imports: [ContextMenuComponent, AppTestingModule],
providers: [
{
provide: ContextMenuOverlayRef,

View File

@ -23,16 +23,33 @@
*/
import { Component, ViewEncapsulation, OnInit, OnDestroy, HostListener, ViewChild, AfterViewInit, Inject } from '@angular/core';
import { MatMenuTrigger } from '@angular/material/menu';
import { MatMenuModule, MatMenuTrigger } from '@angular/material/menu';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { ContentActionRef } from '@alfresco/adf-extensions';
import { ContentActionRef, ExtensionsModule } from '@alfresco/adf-extensions';
import { ContextMenuOverlayRef } from './context-menu-overlay';
import { CONTEXT_MENU_DIRECTION } from './direction.token';
import { Direction } from '@angular/cdk/bidi';
import { AppExtensionService } from '@alfresco/aca-shared';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { MatDividerModule } from '@angular/material/divider';
import { IconModule } from '@alfresco/adf-core';
import { ContextMenuItemComponent } from './context-menu-item.component';
import { OutsideEventDirective } from './context-menu-outside-event.directive';
@Component({
standalone: true,
imports: [
CommonModule,
TranslateModule,
MatMenuModule,
MatDividerModule,
IconModule,
ContextMenuItemComponent,
ExtensionsModule,
OutsideEventDirective
],
selector: 'aca-context-menu',
templateUrl: './context-menu.component.html',
host: {

View File

@ -1,54 +0,0 @@
/*!
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Alfresco Example Content Application
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { CoreModule } from '@alfresco/adf-core';
import { ExtensionsModule } from '@alfresco/adf-extensions';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatListModule } from '@angular/material/list';
import { MatMenuModule } from '@angular/material/menu';
import { CoreExtensionsModule } from '../../extensions/core.extensions.module';
import { AppCommonModule } from '../common/common.module';
import { ContextMenuItemComponent } from './context-menu-item.component';
import { OutsideEventDirective } from './context-menu-outside-event.directive';
import { ContextMenuComponent } from './context-menu.component';
import { ContextActionsModule } from '@alfresco/aca-shared';
@NgModule({
imports: [
MatMenuModule,
MatListModule,
MatIconModule,
MatButtonModule,
CoreExtensionsModule.forChild(),
CoreModule.forChild(),
AppCommonModule,
ExtensionsModule,
ContextActionsModule
],
declarations: [ContextMenuComponent, ContextMenuItemComponent, OutsideEventDirective],
exports: [OutsideEventDirective, ContextMenuComponent, ContextMenuItemComponent, ContextActionsModule]
})
export class ContextMenuModule {}

View File

@ -29,27 +29,29 @@ import { Store } from '@ngrx/store';
import { of } from 'rxjs';
import { CoreModule, UserPreferencesService } from '@alfresco/adf-core';
import { ContextMenuService } from './context-menu.service';
import { ContextMenuModule } from './context-menu.module';
import { TranslateModule } from '@ngx-translate/core';
import { ContextMenuComponent } from './context-menu.component';
import { ContextmenuOverlayConfig } from './interfaces';
describe('ContextMenuService', () => {
let contextMenuService;
let overlay;
let injector;
let userPreferencesService;
const overlayConfig = {
let contextMenuService: ContextMenuService;
let overlay: Overlay;
let injector: Injector;
let userPreferencesService: UserPreferencesService;
const overlayConfig: ContextmenuOverlayConfig = {
hasBackdrop: false,
backdropClass: '',
panelClass: 'test-panel',
source: {
x: 1,
y: 1
}
} as any
};
beforeEach(() => {
TestBed.configureTestingModule({
imports: [TranslateModule.forRoot(), CoreModule.forRoot(), ContextMenuModule],
imports: [TranslateModule.forRoot(), CoreModule.forRoot(), ContextMenuComponent],
providers: [Overlay, { provide: Store, useValue: { select: () => of() } }, UserPreferencesService]
});

View File

@ -25,24 +25,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AppTestingModule } from '../../testing/app-testing.module';
import { DetailsComponent } from './details.component';
import { MetadataTabComponent } from '../info-drawer/metadata-tab/metadata-tab.component';
import { CommentsTabComponent } from '../info-drawer/comments-tab/comments-tab.component';
import { ActivatedRoute } from '@angular/router';
import { of, Subject } from 'rxjs';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { Store } from '@ngrx/store';
import { ContentManagementService } from '../../services/content-management.service';
import { AppExtensionService } from '@alfresco/adf-extensions';
import { ContentApiService } from '@alfresco/aca-shared';
import { SetSelectedNodesAction } from '@alfresco/aca-shared/store';
import { STORE_INITIAL_APP_DATA, SetSelectedNodesAction } from '@alfresco/aca-shared/store';
import { NodeEntry } from '@alfresco/js-api';
import { RouterTestingModule } from '@angular/router/testing';
import { AuthenticationService, PageTitleService } from '@alfresco/adf-core';
import { SearchQueryBuilderService } from '@alfresco/adf-content-services';
describe('DetailsComponent', () => {
let component: DetailsComponent;
let fixture: ComponentFixture<DetailsComponent>;
let contentApiService: ContentApiService;
let store: Store;
let node: NodeEntry;
const mockStream = new Subject();
const storeMock = {
@ -52,12 +51,10 @@ describe('DetailsComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [AppTestingModule],
declarations: [DetailsComponent, CommentsTabComponent, MetadataTabComponent],
imports: [AppTestingModule, DetailsComponent],
providers: [
ContentManagementService,
AppExtensionService,
RouterTestingModule,
SearchQueryBuilderService,
{ provide: Store, useValue: storeMock },
{
provide: ActivatedRoute,
@ -65,6 +62,22 @@ describe('DetailsComponent', () => {
snapshot: { data: { preferencePrefix: 'prefix' } },
params: of({ nodeId: 'someId', activeTab: 'permissions' })
}
},
{
provide: PageTitleService,
useValue: {}
},
{
provide: STORE_INITIAL_APP_DATA,
useValue: {}
},
{
provide: AuthenticationService,
useValue: {
onLogin: new Subject<any>(),
onLogout: new Subject<any>(),
isLoggedIn: () => true
}
}
],
schemas: [NO_ERRORS_SCHEMA]
@ -74,7 +87,22 @@ describe('DetailsComponent', () => {
component = fixture.componentInstance;
contentApiService = TestBed.inject(ContentApiService);
store = TestBed.inject(Store);
spyOn(contentApiService, 'getNode').and.returnValue(of({ entry: { id: 'libraryId' } } as NodeEntry));
node = {
entry: {
id: 'libraryId',
name: 'my library',
isFile: false,
isFolder: false,
modifiedAt: new Date(),
createdAt: new Date(),
nodeType: '',
createdByUser: { id: '', displayName: '' },
modifiedByUser: { id: '', displayName: '' },
aspectNames: []
}
};
spyOn(contentApiService, 'getNode').and.returnValue(of(node));
});
afterEach(() => {
@ -98,6 +126,6 @@ describe('DetailsComponent', () => {
it('should dispatch node selection', () => {
fixture.detectChanges();
expect(store.dispatch).toHaveBeenCalledWith(new SetSelectedNodesAction([{ entry: { id: 'libraryId' } } as NodeEntry]));
expect(store.dispatch).toHaveBeenCalledWith(new SetSelectedNodesAction([node]));
});
});

View File

@ -24,11 +24,37 @@
import { Component, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ContentApiService, PageComponent } from '@alfresco/aca-shared';
import { ContentApiService, PageComponent, PageLayoutModule, SharedToolbarModule } from '@alfresco/aca-shared';
import { NavigateToPreviousPage, SetSelectedNodesAction } from '@alfresco/aca-shared/store';
import { Subject } from 'rxjs';
import { BreadcrumbModule, PermissionManagerModule } from '@alfresco/adf-content-services';
import { ToolbarModule } from '@alfresco/adf-core';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { MatIconModule } from '@angular/material/icon';
import { MatTabsModule } from '@angular/material/tabs';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { MatButtonModule } from '@angular/material/button';
import { MetadataTabComponent } from '../info-drawer/metadata-tab/metadata-tab.component';
import { CommentsTabComponent } from '../info-drawer/comments-tab/comments-tab.component';
@Component({
standalone: true,
imports: [
CommonModule,
TranslateModule,
PageLayoutModule,
PermissionManagerModule,
BreadcrumbModule,
ToolbarModule,
SharedToolbarModule,
MatIconModule,
MatTabsModule,
MatProgressBarModule,
MatButtonModule,
MetadataTabComponent,
CommentsTabComponent
],
selector: 'app-details-manager',
templateUrl: './details.component.html',
styleUrls: ['./details.component.scss'],

View File

@ -22,19 +22,13 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { CustomNameColumnComponent } from './name-column/name-column.component';
import { LockedByModule } from '@alfresco/aca-shared';
import { ContentModule } from '@alfresco/adf-content-services';
import { MaterialModule } from '../../material.module';
import { CoreModule } from '@alfresco/adf-core';
import { LockedByComponent } from '@alfresco/aca-shared';
import { ThumbnailColumnComponent } from './thumbnail-column/thumbnail-column.component';
import { TagsColumnComponent } from './tags-column/tags-column.component';
@NgModule({
imports: [BrowserModule, CoreModule.forChild(), ContentModule.forChild(), MaterialModule, LockedByModule],
declarations: [CustomNameColumnComponent, ThumbnailColumnComponent, TagsColumnComponent],
exports: [CustomNameColumnComponent, ThumbnailColumnComponent, TagsColumnComponent]
imports: [LockedByComponent, ThumbnailColumnComponent, CustomNameColumnComponent, TagsColumnComponent]
})
export class DocumentListCustomComponentsModule {}

View File

@ -23,7 +23,6 @@
*/
import { CustomNameColumnComponent } from './name-column.component';
import { DocumentListCustomComponentsModule } from '../document-list-custom-components.module';
import { Actions } from '@ngrx/effects';
import { StoreModule } from '@ngrx/store';
import { ComponentFixture, TestBed } from '@angular/core/testing';
@ -39,7 +38,7 @@ describe('CustomNameColumnComponent', () => {
imports: [
TranslateModule.forRoot(),
CoreModule.forRoot(),
DocumentListCustomComponentsModule,
CustomNameColumnComponent,
StoreModule.forRoot({ app: () => {} }, { initialState: {} })
],
providers: [Actions]

View File

@ -22,15 +22,19 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { NameColumnComponent, NodesApiService } from '@alfresco/adf-content-services';
import { ContentPipeModule, NameColumnComponent, NodesApiService } from '@alfresco/adf-content-services';
import { ChangeDetectorRef, Component, ElementRef, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { Actions, ofType } from '@ngrx/effects';
import { Subject } from 'rxjs';
import { filter, takeUntil } from 'rxjs/operators';
import { NodeActionTypes } from '@alfresco/aca-shared/store';
import { isLocked } from '@alfresco/aca-shared';
import { LockedByComponent, isLocked } from '@alfresco/aca-shared';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
@Component({
standalone: true,
imports: [CommonModule, TranslateModule, LockedByComponent, ContentPipeModule],
selector: 'aca-custom-name-column',
templateUrl: './name-column.component.html',
styleUrls: ['./name-column.component.scss'],

View File

@ -1,57 +0,0 @@
/*!
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Alfresco Example Content Application
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { TagsColumnComponent } from './tags-column.component';
import { ChangeDetectorRef } from '@angular/core';
describe('TagsColumnComponent', () => {
let fixture: ComponentFixture<TagsColumnComponent>;
let component: TagsColumnComponent;
let changeDetector: ChangeDetectorRef;
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [TagsColumnComponent],
providers: [{ provide: ChangeDetectorRef, useValue: { detectChanges() {} } }]
});
changeDetector = TestBed.inject(ChangeDetectorRef);
fixture = TestBed.createComponent(TagsColumnComponent);
component = fixture.componentInstance;
component.context = { row: { id: '0' } };
});
it('should return nodeId from the row', () => {
const row: any = { id: 'test1' };
expect(component.getNodeId(row)).toBe('test1');
});
it('should force change detection on tags loading', () => {
spyOn(changeDetector, 'detectChanges');
component = new TagsColumnComponent(changeDetector);
component.onTagsLoaded();
expect(changeDetector.detectChanges).toHaveBeenCalled();
});
});

View File

@ -22,10 +22,12 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { ShareDataRow } from '@alfresco/adf-content-services';
import { ShareDataRow, TagModule } from '@alfresco/adf-content-services';
import { ChangeDetectorRef, Component, Input, ViewEncapsulation } from '@angular/core';
@Component({
standalone: true,
imports: [TagModule],
selector: 'aca-tags-column',
template: `
<adf-tag-node-list [showDelete]="false" [limitTagsDisplayed]="true" [nodeId]="getNodeId(context.row)" (results)="onTagsLoaded()">

View File

@ -24,8 +24,13 @@
import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation, inject } from '@angular/core';
import { TranslationService } from '@alfresco/adf-core';
import { NgIf } from '@angular/common';
import { MatIconModule } from '@angular/material/icon';
import { MatTooltipModule } from '@angular/material/tooltip';
@Component({
standalone: true,
imports: [NgIf, MatIconModule, MatTooltipModule],
selector: 'aca-custom-thumbnail-column',
templateUrl: './thumbnail-column.component.html',
encapsulation: ViewEncapsulation.None

View File

@ -27,7 +27,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AppTestingModule } from '../../../testing/app-testing.module';
import { NodePermissionService } from '@alfresco/aca-shared';
import { Node } from '@alfresco/js-api';
import { NodeCommentsModule } from '@alfresco/adf-content-services';
import { of } from 'rxjs';
import { AuthenticationService } from '@alfresco/adf-core';
@ -39,8 +38,7 @@ describe('CommentsTabComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [AppTestingModule, NodeCommentsModule],
declarations: [CommentsTabComponent],
imports: [AppTestingModule, CommentsTabComponent],
providers: [{ provide: AuthenticationService, useValue: { onLogout: of({}) } }]
});

View File

@ -25,8 +25,12 @@
import { Component, Input } from '@angular/core';
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
import { NodePermissionService, isLocked } from '@alfresco/aca-shared';
import { MatCardModule } from '@angular/material/card';
import { NodeCommentsModule } from '@alfresco/adf-content-services';
@Component({
standalone: true,
imports: [MatCardModule, NodeCommentsModule],
selector: 'app-comments-tab',
template: `<mat-card><adf-node-comments [readOnly]="!canUpdateNode" [nodeId]="node?.id"></adf-node-comments></mat-card>`
})

View File

@ -22,42 +22,30 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { ContentMetadataModule, ContentModule, VersionManagerModule } from '@alfresco/adf-content-services';
import { CoreModule } from '@alfresco/adf-core';
import { ExtensionsModule } from '@alfresco/adf-extensions';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { DirectivesModule } from '../../directives/directives.module';
import { MaterialModule } from '../../material.module';
import { CommentsTabComponent } from './comments-tab/comments-tab.component';
import { MetadataTabComponent } from './metadata-tab/metadata-tab.component';
import { LibraryMetadataTabComponent } from './library-metadata-tab/library-metadata-tab.component';
import { LibraryMetadataFormComponent } from './library-metadata-tab/library-metadata-form.component';
import { VersionsTabComponent } from './versions-tab/versions-tab.component';
import { A11yModule } from '@angular/cdk/a11y';
import { SharedInfoDrawerModule } from '@alfresco/aca-shared';
import { InfoDrawerComponent } from '@alfresco/aca-shared';
@NgModule({
imports: [
CommonModule,
MaterialModule,
CoreModule.forChild(),
ContentModule.forChild(),
ExtensionsModule,
ContentMetadataModule,
VersionManagerModule,
DirectivesModule,
A11yModule,
SharedInfoDrawerModule
],
declarations: [MetadataTabComponent, CommentsTabComponent, VersionsTabComponent, LibraryMetadataTabComponent, LibraryMetadataFormComponent],
exports: [
MetadataTabComponent,
InfoDrawerComponent,
CommentsTabComponent,
VersionsTabComponent,
LibraryMetadataTabComponent,
LibraryMetadataFormComponent,
SharedInfoDrawerModule
LibraryMetadataTabComponent,
MetadataTabComponent,
VersionsTabComponent
],
exports: [
InfoDrawerComponent,
CommentsTabComponent,
LibraryMetadataFormComponent,
LibraryMetadataTabComponent,
MetadataTabComponent,
VersionsTabComponent
]
})
export class AppInfoDrawerModule {}

View File

@ -37,8 +37,7 @@ describe('LibraryMetadataFormComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [AppTestingModule],
declarations: [LibraryMetadataFormComponent],
imports: [AppTestingModule, LibraryMetadataFormComponent],
providers: [
{
provide: Store,

View File

@ -23,14 +23,22 @@
*/
import { Component, Input, OnInit, OnChanges, OnDestroy } from '@angular/core';
import { UntypedFormGroup, UntypedFormControl, Validators, FormGroupDirective, NgForm } from '@angular/forms';
import { UntypedFormGroup, UntypedFormControl, Validators, FormGroupDirective, NgForm, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { QueriesApi, SiteEntry, SitePaging } from '@alfresco/js-api';
import { Store } from '@ngrx/store';
import { AppStore, UpdateLibraryAction } from '@alfresco/aca-shared/store';
import { debounceTime, mergeMap, takeUntil } from 'rxjs/operators';
import { AlfrescoApiService } from '@alfresco/adf-core';
import { Observable, from, Subject } from 'rxjs';
import { ErrorStateMatcher } from '@angular/material/core';
import { ErrorStateMatcher, MatOptionModule } from '@angular/material/core';
import { CommonModule } from '@angular/common';
import { MatCardModule } from '@angular/material/card';
import { TranslateModule } from '@ngx-translate/core';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSelectModule } from '@angular/material/select';
import { MatInputModule } from '@angular/material/input';
import { A11yModule } from '@angular/cdk/a11y';
import { MatButtonModule } from '@angular/material/button';
export class InstantErrorStateMatcher implements ErrorStateMatcher {
isErrorState(control: UntypedFormControl | null, form: FormGroupDirective | NgForm | null): boolean {
@ -40,11 +48,25 @@ export class InstantErrorStateMatcher implements ErrorStateMatcher {
}
@Component({
standalone: true,
imports: [
CommonModule,
MatCardModule,
TranslateModule,
MatFormFieldModule,
FormsModule,
ReactiveFormsModule,
MatSelectModule,
MatOptionModule,
MatInputModule,
A11yModule,
MatButtonModule
],
selector: 'app-library-metadata-form',
templateUrl: './library-metadata-form.component.html'
})
export class LibraryMetadataFormComponent implements OnInit, OnChanges, OnDestroy {
_queriesApi: QueriesApi;
private _queriesApi: QueriesApi;
get queriesApi(): QueriesApi {
this._queriesApi = this._queriesApi ?? new QueriesApi(this.alfrescoApiService.getInstance());
return this._queriesApi;

View File

@ -24,8 +24,11 @@
import { Component, Input } from '@angular/core';
import { SiteEntry } from '@alfresco/js-api';
import { LibraryMetadataFormComponent } from './library-metadata-form.component';
@Component({
standalone: true,
imports: [LibraryMetadataFormComponent],
selector: 'app-library-metadata-tab',
template: '<app-library-metadata-form [node]="node"></app-library-metadata-form>',
host: { class: 'app-metadata-tab' }

View File

@ -27,7 +27,6 @@ import { Node } from '@alfresco/js-api';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AppTestingModule } from '../../../testing/app-testing.module';
import { AppConfigService, CoreModule } from '@alfresco/adf-core';
import { ContentMetadataModule } from '@alfresco/adf-content-services';
import { Store } from '@ngrx/store';
import { AppState, SetInfoDrawerMetadataAspectAction } from '@alfresco/aca-shared/store';
import { By } from '@angular/platform-browser';
@ -48,8 +47,7 @@ describe('MetadataTabComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [CoreModule, AppTestingModule, ContentMetadataModule],
declarations: [MetadataTabComponent]
imports: [CoreModule, AppTestingModule, MetadataTabComponent]
});
});

View File

@ -29,10 +29,13 @@ import { AppStore, infoDrawerMetadataAspect } from '@alfresco/aca-shared/store';
import { AppConfigService, NotificationService } from '@alfresco/adf-core';
import { Observable, Subject } from 'rxjs';
import { Store } from '@ngrx/store';
import { ContentMetadataService } from '@alfresco/adf-content-services';
import { ContentMetadataModule, ContentMetadataService } from '@alfresco/adf-content-services';
import { takeUntil } from 'rxjs/operators';
import { CommonModule } from '@angular/common';
@Component({
standalone: true,
imports: [CommonModule, ContentMetadataModule],
selector: 'app-metadata-tab',
template: `
<adf-content-metadata-card [readOnly]="!canUpdateNode" [preset]="'custom'" [node]="node" [displayAspect]="displayAspect$ | async">

View File

@ -24,8 +24,15 @@
import { Component, Input, OnChanges, OnInit } from '@angular/core';
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
import { CommonModule } from '@angular/common';
import { VersionManagerModule } from '@alfresco/adf-content-services';
import { AppConfigModule } from '@alfresco/adf-core';
import { MatIconModule } from '@angular/material/icon';
import { TranslateModule } from '@ngx-translate/core';
@Component({
standalone: true,
imports: [CommonModule, VersionManagerModule, AppConfigModule, MatIconModule, TranslateModule],
selector: 'app-versions-tab',
template: `
<ng-container *ngIf="isFileSelected; else empty">

View File

@ -26,33 +26,37 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CoreModule } from '@alfresco/adf-core';
import { ContentModule } from '@alfresco/adf-content-services';
import { LockedByModule, PageLayoutModule } from '@alfresco/aca-shared';
import { ExtensionsModule } from '@alfresco/adf-extensions';
import { LockedByComponent, PageLayoutModule } from '@alfresco/aca-shared';
import { SearchResultsComponent } from './search-results/search-results.component';
import { SearchResultsRowComponent } from './search-results-row/search-results-row.component';
import { SearchLibrariesResultsComponent } from './search-libraries-results/search-libraries-results.component';
import { AppInfoDrawerModule } from '../info-drawer/info.drawer.module';
import { AppToolbarModule } from '../toolbar/toolbar.module';
import { AppCommonModule } from '../common/common.module';
import { DirectivesModule } from '../../directives/directives.module';
import { ContextMenuModule } from '../context-menu/context-menu.module';
import { SearchActionMenuComponent } from './search-action-menu/search-action-menu.component';
import { DocumentListCustomComponentsModule } from '../dl-custom-components/document-list-custom-components.module';
import { AppSearchInputModule } from './search-input.module';
import { LocationLinkComponent } from '../common/location-link/location-link.component';
import { ThumbnailColumnComponent } from '../dl-custom-components/thumbnail-column/thumbnail-column.component';
import { TagsColumnComponent } from '../dl-custom-components/tags-column/tags-column.component';
import { ContextMenuComponent } from '../context-menu/context-menu.component';
@NgModule({
imports: [
CommonModule,
CoreModule.forChild(),
ContentModule.forChild(),
AppCommonModule,
ExtensionsModule,
AppInfoDrawerModule,
AppToolbarModule,
DirectivesModule,
PageLayoutModule,
ContextMenuModule,
LockedByModule,
DocumentListCustomComponentsModule,
AppSearchInputModule
ContextMenuComponent,
LockedByComponent,
AppSearchInputModule,
LocationLinkComponent,
ThumbnailColumnComponent,
TagsColumnComponent
],
declarations: [SearchResultsComponent, SearchLibrariesResultsComponent, SearchResultsRowComponent, SearchActionMenuComponent],
exports: [SearchResultsComponent, SearchLibrariesResultsComponent, SearchResultsRowComponent, SearchActionMenuComponent]

View File

@ -27,7 +27,6 @@ import { SharedLinkViewComponent } from './shared-link-view.component';
import { CommonModule } from '@angular/common';
import { CoreModule } from '@alfresco/adf-core';
import { DirectivesModule } from '../../directives/directives.module';
import { AppCommonModule } from '../common/common.module';
import { AppToolbarModule } from '../toolbar/toolbar.module';
import { AppInfoDrawerModule } from '../info-drawer/info.drawer.module';
import { CoreExtensionsModule } from '../../extensions/core.extensions.module';
@ -38,7 +37,6 @@ import { ContentModule } from '@alfresco/adf-content-services';
CommonModule,
CoreModule.forChild(),
DirectivesModule,
AppCommonModule,
AppToolbarModule,
CoreExtensionsModule.forChild(),
AppInfoDrawerModule,

View File

@ -35,11 +35,10 @@ import { DirectivesModule } from '../../directives/directives.module';
import { ToggleFavoriteLibraryComponent } from './toggle-favorite-library/toggle-favorite-library.component';
import { ToggleEditOfflineComponent } from './toggle-edit-offline/toggle-edit-offline.component';
import { ViewNodeComponent } from './view-node/view-node.component';
import { AppCommonModule } from '../common/common.module';
import { SharedToolbarModule } from '@alfresco/aca-shared';
@NgModule({
imports: [CommonModule, CoreModule.forChild(), AppCommonModule, ExtensionsModule, SharedToolbarModule, DirectivesModule],
imports: [CommonModule, CoreModule.forChild(), ExtensionsModule, SharedToolbarModule, DirectivesModule],
declarations: [
DocumentDisplayModeComponent,
ToggleFavoriteComponent,

View File

@ -27,12 +27,12 @@ import { CommonModule } from '@angular/common';
import { CoreModule } from '@alfresco/adf-core';
import { TrashcanComponent } from './trashcan.component';
import { ContentModule } from '@alfresco/adf-content-services';
import { AppCommonModule } from '../common/common.module';
import { AppToolbarModule } from '../toolbar/toolbar.module';
import { DirectivesModule } from '../../directives/directives.module';
import { ContextMenuModule } from '../context-menu/context-menu.module';
import { AppSearchInputModule } from '../search/search-input.module';
import { PageLayoutModule } from '@alfresco/aca-shared';
import { ExtensionsModule } from '@alfresco/adf-extensions';
import { ContextMenuComponent } from '../context-menu/context-menu.component';
@NgModule({
imports: [
@ -40,11 +40,11 @@ import { PageLayoutModule } from '@alfresco/aca-shared';
CoreModule.forChild(),
ContentModule.forChild(),
DirectivesModule,
AppCommonModule,
AppToolbarModule,
ContextMenuModule,
ContextMenuComponent,
PageLayoutModule,
AppSearchInputModule
AppSearchInputModule,
ExtensionsModule
],
declarations: [TrashcanComponent],
exports: [TrashcanComponent]

View File

@ -33,7 +33,7 @@ import { ManageRulesSmartComponent } from './manage-rules/manage-rules.smart-com
import { RuleCompositeConditionUiComponent } from './rule-details/conditions/rule-composite-condition.ui-component';
import { RuleDetailsUiComponent } from './rule-details/rule-details.ui-component';
import { RuleSimpleConditionUiComponent } from './rule-details/conditions/rule-simple-condition.ui-component';
import { GenericErrorModule, PageLayoutModule } from '@alfresco/aca-shared';
import { GenericErrorComponent, PageLayoutModule } from '@alfresco/aca-shared';
import { BreadcrumbModule, ContentNodeSelectorModule, DocumentListModule } from '@alfresco/adf-content-services';
import { RuleListItemUiComponent } from './rule-list/rule-list-item/rule-list-item.ui-component';
import { RuleListGroupingUiComponent } from './rule-list/rule-list-grouping/rule-list-grouping.ui-component';
@ -61,8 +61,8 @@ const routes: Routes = [
BreadcrumbModule,
DocumentListModule,
ExtensionsModule,
GenericErrorModule,
ContentNodeSelectorModule
ContentNodeSelectorModule,
GenericErrorComponent
],
declarations: [
EditRuleDialogUiComponent,

View File

@ -27,7 +27,7 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ContentDirectiveModule, ContentModule } from '@alfresco/adf-content-services';
import { SharedDirectivesModule, SharedToolbarModule, SharedInfoDrawerModule } from '@alfresco/aca-shared';
import { SharedDirectivesModule, SharedToolbarModule, InfoDrawerComponent } from '@alfresco/aca-shared';
import { ExtensionsModule } from '@alfresco/adf-extensions';
import { PreviewComponent } from './components/preview.component';
@ -52,8 +52,8 @@ const routes: Routes = [
ContentDirectiveModule,
SharedDirectivesModule,
ContentDirectiveModule,
SharedInfoDrawerModule,
SharedToolbarModule
SharedToolbarModule,
InfoDrawerComponent
],
declarations: [PreviewComponent],
exports: [PreviewComponent]

View File

@ -23,8 +23,12 @@
*/
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { TranslateModule } from '@ngx-translate/core';
@Component({
standalone: true,
imports: [MatIconModule, TranslateModule],
selector: 'aca-generic-error',
templateUrl: './generic-error.component.html',
styleUrls: ['./generic-error.component.scss'],

View File

@ -1,36 +0,0 @@
/*!
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Alfresco Example Content Application
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { NgModule } from '@angular/core';
import { GenericErrorComponent } from './generic-error.component';
import { MatIconModule } from '@angular/material/icon';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
@NgModule({
imports: [CommonModule, MatIconModule, TranslateModule.forChild()],
declarations: [GenericErrorComponent],
exports: [GenericErrorComponent]
})
export class GenericErrorModule {}

View File

@ -60,8 +60,7 @@ describe('InfoDrawerComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [LibTestingModule, SharedToolbarModule],
declarations: [InfoDrawerComponent],
imports: [LibTestingModule, SharedToolbarModule, InfoDrawerComponent],
providers: [
{ provide: AppExtensionService, useValue: extensionServiceMock },
{ provide: Store, useValue: storeMock }

View File

@ -24,7 +24,7 @@
import { Component, HostListener, Input, OnChanges, OnDestroy, OnInit } from '@angular/core';
import { MinimalNodeEntity, MinimalNodeEntryEntity, SiteEntry } from '@alfresco/js-api';
import { ContentActionRef, SidebarTabRef } from '@alfresco/adf-extensions';
import { ContentActionRef, ExtensionsModule, SidebarTabRef } from '@alfresco/adf-extensions';
import { Store } from '@ngrx/store';
import { SetInfoDrawerStateAction, ToggleInfoDrawerAction, infoDrawerPreview } from '@alfresco/aca-shared/store';
import { AppExtensionService } from '../../services/app.extension.service';
@ -32,7 +32,14 @@ import { ContentApiService } from '../../services/content-api.service';
import { takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs';
import { ThemePalette } from '@angular/material/core';
import { CommonModule } from '@angular/common';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { InfoDrawerModule, ToolbarModule } from '@alfresco/adf-core';
import { SharedToolbarModule } from '../tool-bar/shared-toolbar.module';
import { TranslateModule } from '@ngx-translate/core';
@Component({
standalone: true,
imports: [CommonModule, TranslateModule, MatProgressBarModule, InfoDrawerModule, SharedToolbarModule, ExtensionsModule, ToolbarModule],
selector: 'aca-info-drawer',
templateUrl: './info-drawer.component.html'
})

View File

@ -1,40 +0,0 @@
/*!
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Alfresco Example Content Application
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { InfoDrawerComponent } from './info-drawer.component';
import { InfoDrawerModule, ToolbarModule } from '@alfresco/adf-core';
import { ExtensionsModule } from '@alfresco/adf-extensions';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { SharedToolbarModule } from '../tool-bar/shared-toolbar.module';
import { TranslateModule } from '@ngx-translate/core';
import { A11yModule } from '@angular/cdk/a11y';
@NgModule({
imports: [CommonModule, InfoDrawerModule, MatProgressBarModule, ExtensionsModule, ToolbarModule, SharedToolbarModule, TranslateModule, A11yModule],
declarations: [InfoDrawerComponent],
exports: [InfoDrawerComponent]
})
export class SharedInfoDrawerModule {}

View File

@ -24,8 +24,12 @@
import { Component, Input, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
import { NodeEntry } from '@alfresco/js-api';
import { TranslateModule } from '@ngx-translate/core';
import { MatIconModule } from '@angular/material/icon';
@Component({
standalone: true,
imports: [TranslateModule, MatIconModule],
selector: 'aca-locked-by',
template: `
<mat-icon class="locked_by--icon">lock</mat-icon>

View File

@ -1,36 +0,0 @@
/*!
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Alfresco Example Content Application
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { NgModule } from '@angular/core';
import { LockedByComponent } from './locked-by.component';
import { MatIconModule } from '@angular/material/icon';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
@NgModule({
imports: [CommonModule, MatIconModule, TranslateModule.forChild()],
declarations: [LockedByComponent],
exports: [LockedByComponent]
})
export class LockedByModule {}

View File

@ -42,7 +42,7 @@ describe('OpenInAppComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [LibTestingModule, SharedModule.forRoot(), MatIconTestingModule],
imports: [LibTestingModule, SharedModule, MatIconTestingModule],
providers: [
provideMockStore({ initialState }),
{ provide: MAT_DIALOG_DATA, useValue: { redirectUrl: 'mockRedirectUrl', appStoreUrl: 'mockAppStoreUrl' } },

View File

@ -22,10 +22,7 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { ModuleWithProviders, NgModule } from '@angular/core';
import { ContentApiService } from './services/content-api.service';
import { NodePermissionService } from './services/node-permission.service';
import { AppService } from './services/app.service';
import { NgModule } from '@angular/core';
import { ContextActionsModule } from './directives/contextmenu/contextmenu.module';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
@ -36,11 +33,4 @@ import { TranslateModule } from '@ngx-translate/core';
imports: [ContextActionsModule, MatButtonModule, MatIconModule, MatDialogModule, TranslateModule],
exports: [ContextActionsModule, MatButtonModule, MatIconModule, MatDialogModule, TranslateModule]
})
export class SharedModule {
static forRoot(): ModuleWithProviders<SharedModule> {
return {
ngModule: SharedModule,
providers: [ContentApiService, NodePermissionService, AppService]
};
}
}
export class SharedModule {}

View File

@ -29,16 +29,13 @@ export * from './lib/components/page-layout/page-layout-header.component';
export * from './lib/components/page-layout/page-layout.component';
export * from './lib/components/page-layout/page-layout.module';
export * from './lib/components/locked-by/locked-by.component';
export * from './lib/components/locked-by/locked-by.module';
export * from './lib/components/generic-error/generic-error.component';
export * from './lib/components/generic-error/generic-error.module';
export * from './lib/components/tool-bar/shared-toolbar.module';
export * from './lib/components/tool-bar/toolbar-action/toolbar-action.component';
export * from './lib/components/tool-bar/toolbar-button/toolbar-button.component';
export * from './lib/components/tool-bar/toolbar-menu/toolbar-menu.component';
export * from './lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component';
export * from './lib/components/info-drawer/info-drawer.component';
export * from './lib/components/info-drawer/shared-info-drawer.module';
export * from './lib/components/document-base-page/document-base-page.component';
export * from './lib/components/document-base-page/document-base-page.service';
export * from './lib/components/open-in-app/open-in-app.component';

View File

@ -26,7 +26,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CoreModule } from '@alfresco/adf-core';
import { ContentDirectiveModule, ContentModule } from '@alfresco/adf-content-services';
import { SharedDirectivesModule, SharedInfoDrawerModule, SharedToolbarModule } from '@alfresco/aca-shared';
import { SharedDirectivesModule, InfoDrawerComponent, SharedToolbarModule } from '@alfresco/aca-shared';
import { ExtensionsModule } from '@alfresco/adf-extensions';
import { AcaViewerComponent } from './components/viewer/viewer.component';
import { RouterModule, Routes } from '@angular/router';
@ -51,7 +51,7 @@ const routes: Routes = [
ContentModule,
ContentDirectiveModule,
SharedDirectivesModule,
SharedInfoDrawerModule,
InfoDrawerComponent,
SharedToolbarModule
],
declarations: [AcaViewerComponent],