Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { By } from '@angular/platform-browser';
import { AppExtensionService, NodePermissionService } from '@alfresco/aca-shared';
import { Actions } from '@ngrx/effects';
import { of, Subject } from 'rxjs';
import { Store } from '@ngrx/store';
import { ContentActionType } from '@alfresco/adf-extensions';
import { CategoryService, ContentMetadataComponent, ContentMetadataService, TagService } from '@alfresco/adf-content-services';

Expand Down Expand Up @@ -244,6 +245,14 @@ describe('MetadataTabComponent', () => {
expect(getContentMetadata().displayTags).toBeFalse();
});
});

it('should set displayPredictions to true if HXIConnector is enabled', () => {
const store = TestBed.inject(Store);
spyOn(store, 'select').and.returnValue(of(true));
fixture.detectChanges();
expect(component.isHXIConnectorEnabled).toBeTrue();
expect(getContentMetadata().displayPredictions).toBeTrue();
});
});

describe('Custom metadata panels', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import { Component, Input, ViewEncapsulation, OnInit, OnDestroy } from '@angular/core';
import { Node } from '@alfresco/js-api';
import { NodePermissionService, isLocked, AppExtensionService } from '@alfresco/aca-shared';
import { AppStore, EditOfflineAction, NodeActionTypes, infoDrawerMetadataAspect } from '@alfresco/aca-shared/store';
import { AppStore, EditOfflineAction, NodeActionTypes, infoDrawerMetadataAspect, isHXIConnectorEnabled } from '@alfresco/aca-shared/store';
import { AppConfigService, NotificationService } from '@alfresco/adf-core';
import { Observable, Subject } from 'rxjs';
import {
Expand Down Expand Up @@ -53,6 +53,7 @@ import { Store } from '@ngrx/store';
[displayCategories]="displayCategories"
[displayTags]="displayTags"
[displayAspect]="metadataAspect"
[displayPredictions]="isHXIConnectorEnabled"
>
</adf-content-metadata>
`,
Expand All @@ -70,6 +71,7 @@ export class MetadataTabComponent implements OnInit, OnDestroy {
readOnly = false;
customPanels: Observable<ContentMetadataCustomPanel[]>;
metadataAspect: string;
isHXIConnectorEnabled = false;

get displayCategories(): boolean {
return this._displayCategories;
Expand Down Expand Up @@ -123,6 +125,12 @@ export class MetadataTabComponent implements OnInit, OnDestroy {
.select(infoDrawerMetadataAspect)
.pipe(takeUntil(this.onDestroy$))
.subscribe((metadataAspect) => (this.metadataAspect = metadataAspect));
this.store
.select(isHXIConnectorEnabled)
.pipe(takeUntil(this.onDestroy$))
.subscribe((isEnabled) => {
this.isHXIConnectorEnabled = isEnabled;
});
}

ngOnDestroy() {
Expand Down