mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-10 14:11:17 +00:00
[ACS-8001] display AI preditcions
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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', () => {
|
||||
|
@@ -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 {
|
||||
@@ -53,6 +53,7 @@ import { Store } from '@ngrx/store';
|
||||
[displayCategories]="displayCategories"
|
||||
[displayTags]="displayTags"
|
||||
[displayAspect]="metadataAspect"
|
||||
[displayPredictions]="isHXIConnectorEnabled"
|
||||
>
|
||||
</adf-content-metadata>
|
||||
`,
|
||||
@@ -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;
|
||||
@@ -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() {
|
||||
|
Reference in New Issue
Block a user