diff --git a/projects/aca-content/src/lib/components/info-drawer/metadata-tab/metadata-tab.component.spec.ts b/projects/aca-content/src/lib/components/info-drawer/metadata-tab/metadata-tab.component.spec.ts index e275493e3d..284b8375d0 100644 --- a/projects/aca-content/src/lib/components/info-drawer/metadata-tab/metadata-tab.component.spec.ts +++ b/projects/aca-content/src/lib/components/info-drawer/metadata-tab/metadata-tab.component.spec.ts @@ -198,60 +198,6 @@ describe('MetadataTabComponent', () => { }); }); - describe('editable', () => { - let editOfflineAction: EditOfflineAction; - - beforeEach(() => { - fixture = TestBed.createComponent(MetadataTabComponent); - component = fixture.componentInstance; - component.node = { - id: 'some id', - allowableOperations: [] - } as Node; - component.ngOnInit(); - editOfflineAction = new EditOfflineAction({ - entry: { - isLocked: false, - allowableOperations: ['update'], - id: component.node.id - } as Node - }); - component.editable = true; - }); - - it('should not have set false if node is not locked and has update permission', () => { - actions$.next(editOfflineAction); - expect(component.editable).toBeTrue(); - }); - - it('should not have set false if changed node has different id than original', () => { - editOfflineAction.payload.entry.id = 'some other id'; - editOfflineAction.payload.entry.isLocked = true; - actions$.next(editOfflineAction); - expect(component.editable).toBeTrue(); - }); - - it('should have set false if node is locked', () => { - editOfflineAction.payload.entry.isLocked = true; - actions$.next(editOfflineAction); - expect(component.editable).toBeFalse(); - }); - - it('should have set false if node has no update permission', () => { - editOfflineAction.payload.entry.allowableOperations = ['other']; - actions$.next(editOfflineAction); - expect(component.editable).toBeFalse(); - }); - - it('should have set false if node has read only property', () => { - editOfflineAction.payload.entry.properties = { - 'cm:lockType': 'WRITE_LOCK' - }; - actions$.next(editOfflineAction); - expect(component.editable).toBeFalse(); - }); - }); - describe('ContentMetadataCardComponent', () => { const getContentMetadataCard = (): ContentMetadataCardComponent => fixture.debugElement.query(By.directive(ContentMetadataCardComponent)).componentInstance; diff --git a/projects/aca-content/src/lib/components/info-drawer/metadata-tab/metadata-tab.component.ts b/projects/aca-content/src/lib/components/info-drawer/metadata-tab/metadata-tab.component.ts index 026662557e..3d11602427 100644 --- a/projects/aca-content/src/lib/components/info-drawer/metadata-tab/metadata-tab.component.ts +++ b/projects/aca-content/src/lib/components/info-drawer/metadata-tab/metadata-tab.component.ts @@ -29,13 +29,7 @@ import { AppStore, EditOfflineAction, infoDrawerMetadataAspect, NodeActionTypes import { AppConfigService, NotificationService } from '@alfresco/adf-core'; import { Observable, Subject } from 'rxjs'; import { Store } from '@ngrx/store'; -import { - ContentMetadataModule, - ContentMetadataService, - ContentMetadataCustomPanel, - TagService, - CategoryService -} from '@alfresco/adf-content-services'; +import { ContentMetadataModule, ContentMetadataService, ContentMetadataCustomPanel } from '@alfresco/adf-content-services'; import { filter, map, takeUntil } from 'rxjs/operators'; import { CommonModule } from '@angular/common'; import { Actions, ofType } from '@ngrx/effects'; @@ -51,11 +45,6 @@ import { Actions, ofType } from '@ngrx/effects'; [node]="node" [displayAspect]="displayAspect$ | async" [customPanels]="customPanels | async" - [displayTags]="true" - [displayCategories]="true" - [(editable)]="editable" - [displayCategories]="displayCategories" - [displayTags]="displayTags" > `, @@ -64,9 +53,6 @@ import { Actions, ofType } from '@ngrx/effects'; }) export class MetadataTabComponent implements OnInit, OnDestroy { protected onDestroy$ = new Subject(); - private _displayCategories = true; - private _displayTags = true; - @Input() node: Node; @@ -74,14 +60,6 @@ export class MetadataTabComponent implements OnInit, OnDestroy { readOnly = false; customPanels: Observable; - get displayCategories(): boolean { - return this._displayCategories; - } - - get displayTags(): boolean { - return this._displayTags; - } - constructor( private permission: NodePermissionService, protected extensions: AppExtensionService, @@ -89,9 +67,7 @@ export class MetadataTabComponent implements OnInit, OnDestroy { private store: Store, private notificationService: NotificationService, private contentMetadataService: ContentMetadataService, - private actions$: Actions, - private tagService: TagService, - private categoryService: CategoryService + private actions$: Actions ) { if (this.extensions.contentMetadata) { this.appConfig.config['content-metadata'].presets = this.extensions.contentMetadata.presets; @@ -100,8 +76,6 @@ export class MetadataTabComponent implements OnInit, OnDestroy { } ngOnInit() { - this._displayTags = this.tagService.areTagsEnabled(); - this._displayCategories = this.categoryService.areCategoriesEnabled(); this.contentMetadataService.error.pipe(takeUntil(this.onDestroy$)).subscribe((err: { message: string }) => { this.notificationService.showError(err.message); });