mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
Update branch for ADF 6.0.0-A.2-7992 and JS-API 5.4.0-561 [ci:force] (#2952)
* [ci:force][auto-commit] Update @alfresco/adf-extensions to 6.0.0-A.2-8156 for branch: update-alfresco-dependencies originated from @alfresco/adf-extensions PR: 37793 * [ci:force][auto-commit] Update @alfresco/adf-core to 6.0.0-A.2-7992 for branch: update-alfresco-dependencies originated from @alfresco/adf-core PR: 37793 * [ci:force][auto-commit] Update @alfresco/adf-content-services to 6.0.0-A.2-8156 for branch: update-alfresco-dependencies originated from @alfresco/adf-content-services PR: 37793 * [ci:force][auto-commit] Update @alfresco/adf-cli to 6.0.0-A.2-7992 for branch: update-alfresco-dependencies originated from @alfresco/adf-cli PR: 37793 * [ci:force][auto-commit] Update @alfresco/adf-testing to 6.0.0-A.2-7992 for branch: update-alfresco-dependencies originated from @alfresco/adf-testing PR: 37793 * [AAE-10778] Fix viewer BC: replace adf-viewer with adf-alfresco-viewer * Update @alfresco/adf-extensions and @alfresco/adf-content-services to 6.0.0-A.2-7992 * [AAE-10778] Fix viewer BC: fix Unit node effects unit tests, replace ViewUtilService with RenditionViewerService since method 'printFileGeneric' has been moved from ViewUtilService to RenditionViewerService * Fix comments-tab unit test: provide a mock onLogout value --------- Co-authored-by: Amedeo Lepore <amedeo.lepore@hyland.com>
This commit is contained in:
@@ -29,6 +29,8 @@ 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';
|
||||
|
||||
describe('CommentsTabComponent', () => {
|
||||
let component: CommentsTabComponent;
|
||||
@@ -39,7 +41,8 @@ describe('CommentsTabComponent', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AppTestingModule, NodeCommentsModule],
|
||||
declarations: [CommentsTabComponent]
|
||||
declarations: [CommentsTabComponent],
|
||||
providers: [{ provide: AuthenticationService, useValue: { onLogout: of({}) } }]
|
||||
});
|
||||
|
||||
nodePermissionService = TestBed.inject(NodePermissionService);
|
||||
|
@@ -95,7 +95,7 @@
|
||||
"
|
||||
*ngIf="infoDrawerOpened$ | async"
|
||||
>
|
||||
<adf-viewer
|
||||
<adf-alfresco-viewer
|
||||
class="adf-search-results--embedded_viewer"
|
||||
[nodeId]="selection.last.entry.id"
|
||||
*ngIf="infoDrawerPreview$ | async; else infoDrawerPanel"
|
||||
@@ -122,7 +122,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</adf-viewer-toolbar>
|
||||
</adf-viewer>
|
||||
</adf-alfresco-viewer>
|
||||
<ng-template #infoDrawerPanel>
|
||||
<div class="sidebar">
|
||||
<aca-info-drawer [node]="selection.last"></aca-info-drawer>
|
||||
|
@@ -1,9 +1,9 @@
|
||||
<ng-container *ngIf="sharedLinkId">
|
||||
<adf-viewer [allowPrint]="false" [allowDownload]="false" [allowFullScreen]="false" [sharedLinkId]="sharedLinkId" [allowGoBack]="false">
|
||||
<adf-alfresco-viewer [allowPrint]="false" [allowDownload]="false" [allowFullScreen]="false" [sharedLinkId]="sharedLinkId" [allowGoBack]="false">
|
||||
<adf-viewer-toolbar-actions>
|
||||
<ng-container *ngFor="let action of viewerToolbarActions; trackBy: trackByActionId">
|
||||
<aca-toolbar-action [actionRef]="action"></aca-toolbar-action>
|
||||
</ng-container>
|
||||
</adf-viewer-toolbar-actions>
|
||||
</adf-viewer>
|
||||
</adf-alfresco-viewer>
|
||||
</ng-container>
|
||||
|
@@ -32,6 +32,7 @@ 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';
|
||||
import { ContentModule } from '@alfresco/adf-content-services';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -41,7 +42,8 @@ import { CoreExtensionsModule } from '../../extensions/core.extensions.module';
|
||||
AppCommonModule,
|
||||
AppToolbarModule,
|
||||
CoreExtensionsModule.forChild(),
|
||||
AppInfoDrawerModule
|
||||
AppInfoDrawerModule,
|
||||
ContentModule
|
||||
],
|
||||
declarations: [SharedLinkViewComponent],
|
||||
exports: [SharedLinkViewComponent]
|
||||
|
@@ -50,7 +50,7 @@ import {
|
||||
ManagePermissionsAction,
|
||||
ShowLoaderAction
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { ViewUtilService } from '@alfresco/adf-core';
|
||||
import { RenditionViewerService } from '@alfresco/adf-content-services';
|
||||
import { ViewerEffects } from './viewer.effects';
|
||||
import { Router } from '@angular/router';
|
||||
import { of } from 'rxjs';
|
||||
@@ -58,19 +58,19 @@ import { of } from 'rxjs';
|
||||
describe('NodeEffects', () => {
|
||||
let store: Store<any>;
|
||||
let contentService: ContentManagementService;
|
||||
let viewUtilService: ViewUtilService;
|
||||
let renditionViewerService: RenditionViewerService;
|
||||
let viewerEffects: ViewerEffects;
|
||||
let router: Router;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AppTestingModule, SharedStoreModule, EffectsModule.forRoot([NodeEffects, ViewerEffects])],
|
||||
providers: [ViewUtilService]
|
||||
providers: [RenditionViewerService]
|
||||
});
|
||||
|
||||
store = TestBed.inject(Store);
|
||||
contentService = TestBed.inject(ContentManagementService);
|
||||
viewUtilService = TestBed.inject(ViewUtilService);
|
||||
renditionViewerService = TestBed.inject(RenditionViewerService);
|
||||
viewerEffects = TestBed.inject(ViewerEffects);
|
||||
router = TestBed.inject(Router);
|
||||
});
|
||||
@@ -406,18 +406,18 @@ describe('NodeEffects', () => {
|
||||
|
||||
describe('printFile$', () => {
|
||||
it('it should print node content from payload', () => {
|
||||
spyOn(viewUtilService, 'printFileGeneric').and.stub();
|
||||
spyOn(renditionViewerService, 'printFileGeneric').and.stub();
|
||||
const node: any = {
|
||||
entry: { id: 'node-id', content: { mimeType: 'text/json' } }
|
||||
};
|
||||
|
||||
store.dispatch(new PrintFileAction(node));
|
||||
|
||||
expect(viewUtilService.printFileGeneric).toHaveBeenCalledWith('node-id', 'text/json');
|
||||
expect(renditionViewerService.printFileGeneric).toHaveBeenCalledWith('node-id', 'text/json');
|
||||
});
|
||||
|
||||
it('it should print node content from store', fakeAsync(() => {
|
||||
spyOn(viewUtilService, 'printFileGeneric').and.stub();
|
||||
spyOn(renditionViewerService, 'printFileGeneric').and.stub();
|
||||
const node: any = {
|
||||
entry: {
|
||||
isFile: true,
|
||||
@@ -432,7 +432,7 @@ describe('NodeEffects', () => {
|
||||
|
||||
store.dispatch(new PrintFileAction(null));
|
||||
|
||||
expect(viewUtilService.printFileGeneric).toHaveBeenCalledWith('node-id', 'text/json');
|
||||
expect(renditionViewerService.printFileGeneric).toHaveBeenCalledWith('node-id', 'text/json');
|
||||
}));
|
||||
});
|
||||
|
||||
|
@@ -53,7 +53,7 @@ import {
|
||||
ShowLoaderAction
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { ViewUtilService } from '@alfresco/adf-core';
|
||||
import { RenditionViewerService } from '@alfresco/adf-content-services';
|
||||
|
||||
@Injectable()
|
||||
export class NodeEffects {
|
||||
@@ -61,7 +61,7 @@ export class NodeEffects {
|
||||
private store: Store<AppStore>,
|
||||
private actions$: Actions,
|
||||
private contentService: ContentManagementService,
|
||||
private viewUtils: ViewUtilService
|
||||
private renditionViewer: RenditionViewerService
|
||||
) {}
|
||||
|
||||
shareNode$ = createEffect(
|
||||
@@ -419,7 +419,7 @@ export class NodeEffects {
|
||||
const mimeType = node.entry.content.mimeType;
|
||||
|
||||
if (id) {
|
||||
this.viewUtils.printFileGeneric(id, mimeType);
|
||||
this.renditionViewer.printFileGeneric(id, mimeType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user