mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-07 18:24:46 +00:00
replace and clean up methods (#352)
This commit is contained in:
parent
3ca63b8433
commit
5dee937cf0
@ -8,7 +8,7 @@
|
|||||||
<button
|
<button
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
color="primary"
|
color="primary"
|
||||||
*ngIf="canPreviewFile(documentList.selection)"
|
*ngIf="isFileSelected(documentList.selection)"
|
||||||
title="{{ 'APP.ACTIONS.VIEW' | translate }}"
|
title="{{ 'APP.ACTIONS.VIEW' | translate }}"
|
||||||
(click)="onNodeDoubleClick(documentList.selection[0]?.entry)">
|
(click)="onNodeDoubleClick(documentList.selection[0]?.entry)">
|
||||||
<mat-icon>open_in_browser</mat-icon>
|
<mat-icon>open_in_browser</mat-icon>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
<button mat-icon-button
|
<button mat-icon-button
|
||||||
[color]="infoDrawerOpened ? 'accent' : 'primary'"
|
[color]="infoDrawerOpened ? 'accent' : 'primary'"
|
||||||
*ngIf="documentList.selection.length"
|
*ngIf="hasSelection(documentList.selection)"
|
||||||
title="{{ 'APP.ACTIONS.DETAILS' | translate }}"
|
title="{{ 'APP.ACTIONS.DETAILS' | translate }}"
|
||||||
(click)="toggleSidebar()">
|
(click)="toggleSidebar()">
|
||||||
<mat-icon>info_outline</mat-icon>
|
<mat-icon>info_outline</mat-icon>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<button
|
<button
|
||||||
color="primary"
|
color="primary"
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
*ngIf="canPreviewFile(documentList.selection)"
|
*ngIf="isFileSelected(documentList.selection)"
|
||||||
title="{{ 'APP.ACTIONS.VIEW' | translate }}"
|
title="{{ 'APP.ACTIONS.VIEW' | translate }}"
|
||||||
(click)="showPreview(documentList.selection[0]?.entry)">
|
(click)="showPreview(documentList.selection[0]?.entry)">
|
||||||
<mat-icon>open_in_browser</mat-icon>
|
<mat-icon>open_in_browser</mat-icon>
|
||||||
@ -28,7 +28,8 @@
|
|||||||
<button
|
<button
|
||||||
color="primary"
|
color="primary"
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
*ngIf="canEditFolder(documentList.selection)"
|
*ngIf="isFolderSelected(documentList.selection)
|
||||||
|
&& permission.check(documentList.selection, ['update'])"
|
||||||
[attr.title]="'APP.ACTIONS.EDIT' | translate"
|
[attr.title]="'APP.ACTIONS.EDIT' | translate"
|
||||||
(error)="openSnackMessage($event)"
|
(error)="openSnackMessage($event)"
|
||||||
[adf-edit-folder]="documentList.selection[0]?.entry">
|
[adf-edit-folder]="documentList.selection[0]?.entry">
|
||||||
@ -37,7 +38,7 @@
|
|||||||
|
|
||||||
<button mat-icon-button
|
<button mat-icon-button
|
||||||
[color]="infoDrawerOpened ? 'accent' : 'primary'"
|
[color]="infoDrawerOpened ? 'accent' : 'primary'"
|
||||||
*ngIf="documentList.selection.length"
|
*ngIf="hasSelection(documentList.selection)"
|
||||||
title="{{ 'APP.ACTIONS.DETAILS' | translate }}"
|
title="{{ 'APP.ACTIONS.DETAILS' | translate }}"
|
||||||
(click)="toggleSidebar()">
|
(click)="toggleSidebar()">
|
||||||
<mat-icon>info_outline</mat-icon>
|
<mat-icon>info_outline</mat-icon>
|
||||||
@ -77,7 +78,7 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
mat-menu-item
|
mat-menu-item
|
||||||
*ngIf="canMove(documentList.selection)"
|
*ngIf="permission.check(documentList.selection, ['delete'])"
|
||||||
[acaMoveNode]="documentList.selection">
|
[acaMoveNode]="documentList.selection">
|
||||||
<mat-icon color="primary">library_books</mat-icon>
|
<mat-icon color="primary">library_books</mat-icon>
|
||||||
<span>{{ 'APP.ACTIONS.MOVE' | translate }}</span>
|
<span>{{ 'APP.ACTIONS.MOVE' | translate }}</span>
|
||||||
@ -85,7 +86,7 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
mat-menu-item
|
mat-menu-item
|
||||||
*ngIf="canDelete(documentList.selection)"
|
*ngIf="permission.check(documentList.selection, ['delete'])"
|
||||||
[acaDeleteNode]="documentList.selection">
|
[acaDeleteNode]="documentList.selection">
|
||||||
<mat-icon color="primary">delete</mat-icon>
|
<mat-icon color="primary">delete</mat-icon>
|
||||||
<span>{{ 'APP.ACTIONS.DELETE' | translate }}</span>
|
<span>{{ 'APP.ACTIONS.DELETE' | translate }}</span>
|
||||||
@ -190,8 +191,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<adf-content-metadata-card
|
<adf-content-metadata-card
|
||||||
[readOnly]="!canUpdate(documentList.selection)"
|
[readOnly]="!permission.check(nodeInfo.node, ['update'])"
|
||||||
[displayEmpty]="canUpdate(documentList.selection)"
|
[displayEmpty]="permission.check(nodeInfo.node, ['update'])"
|
||||||
[preset]="'custom'"
|
[preset]="'custom'"
|
||||||
[node]="infoInstance.node">
|
[node]="infoInstance.node">
|
||||||
</adf-content-metadata-card>
|
</adf-content-metadata-card>
|
||||||
|
@ -70,50 +70,6 @@ describe('PageComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('filesOnlySelected()', () => {
|
|
||||||
it('return true if only files are selected', () => {
|
|
||||||
const selected = [ { entry: { isFile: true } }, { entry: { isFile: true } } ];
|
|
||||||
expect(component.filesOnlySelected(selected)).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('return false if selection contains others types', () => {
|
|
||||||
const selected = [ { entry: { isFile: true } }, { entry: { isFolder: true } } ];
|
|
||||||
expect(component.filesOnlySelected(selected)).toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('return false if selection contains no files', () => {
|
|
||||||
const selected = [ { entry: { isFolder: true } } ];
|
|
||||||
expect(component.filesOnlySelected(selected)).toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('return false no selection', () => {
|
|
||||||
const selected = [];
|
|
||||||
expect(component.filesOnlySelected(selected)).toBe(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('foldersOnlySelected()', () => {
|
|
||||||
it('return true if only folders are selected', () => {
|
|
||||||
const selected = [ { entry: { isFolder: true } }, { entry: { isFolder: true } } ];
|
|
||||||
expect(component.foldersOnlySelected(selected)).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('return false if selection contains others types', () => {
|
|
||||||
const selected = [ { entry: { isFile: true } }, { entry: { isFolder: true } } ];
|
|
||||||
expect(component.foldersOnlySelected(selected)).toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('return false if selection contains no files', () => {
|
|
||||||
const selected = [ { entry: { isFile: true } } ];
|
|
||||||
expect(component.foldersOnlySelected(selected)).toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('return false no selection', () => {
|
|
||||||
const selected = [];
|
|
||||||
expect(component.foldersOnlySelected(selected)).toBe(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('isFileSelected()', () => {
|
describe('isFileSelected()', () => {
|
||||||
it('returns true if selected node is file', () => {
|
it('returns true if selected node is file', () => {
|
||||||
const selection = [ { entry: { isFile: true } } ];
|
const selection = [ { entry: { isFile: true } } ];
|
||||||
@ -131,135 +87,20 @@ describe('PageComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('canEditFolder()', () => {
|
describe('isFolderSelected()', () => {
|
||||||
it('returns true if selected node is folder', () => {
|
it('returns true if selected node is folder', () => {
|
||||||
const selection = [ { entry: { isFolder: true } } ];
|
const selection = [ { entry: { isFolder: true } } ];
|
||||||
spyOn(component, 'nodeHasPermission').and.returnValue(true);
|
expect(component.isFolderSelected(selection)).toBe(true);
|
||||||
|
|
||||||
expect(component.canEditFolder(selection)).toBe(true);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false if selected node is file', () => {
|
it('returns false if selected node is file', () => {
|
||||||
const selection = [ { entry: { isFile: true } } ];
|
const selection = [ { entry: { isFile: true } } ];
|
||||||
expect(component.canEditFolder(selection)).toBe(false);
|
expect(component.isFolderSelected(selection)).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false if there are more than one selections', () => {
|
it('returns false if there are more than one selections', () => {
|
||||||
const selection = [ { entry: { isFolder: true } }, { entry: { isFolder: true } } ];
|
const selection = [ { entry: { isFolder: true } }, { entry: { isFolder: true } } ];
|
||||||
expect(component.canEditFolder(selection)).toBe(false);
|
expect(component.isFolderSelected(selection)).toBe(false);
|
||||||
});
|
|
||||||
|
|
||||||
it('returns false folder dows not have edit permission', () => {
|
|
||||||
spyOn(component, 'nodeHasPermission').and.returnValue(false);
|
|
||||||
const selection = [ { entry: { isFolder: true } } ];
|
|
||||||
|
|
||||||
expect(component.canEditFolder(selection)).toBe(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('canDelete()', () => {
|
|
||||||
it('returns false if node has no delete permission', () => {
|
|
||||||
const selection = [ { entry: { } } ];
|
|
||||||
spyOn(component, 'nodeHasPermission').and.returnValue(false);
|
|
||||||
|
|
||||||
expect(component.canDelete(selection)).toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('returns true if node has delete permission', () => {
|
|
||||||
const selection = [ { entry: { } } ];
|
|
||||||
spyOn(component, 'nodeHasPermission').and.returnValue(true);
|
|
||||||
|
|
||||||
expect(component.canDelete(selection)).toBe(true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('canMove()', () => {
|
|
||||||
it('returns true if node can be deleted', () => {
|
|
||||||
const selection = [ { entry: { } } ];
|
|
||||||
spyOn(component, 'canDelete').and.returnValue(true);
|
|
||||||
|
|
||||||
expect(component.canMove(selection)).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('returns false if node can not be deleted', () => {
|
|
||||||
const selection = [ { entry: { } } ];
|
|
||||||
spyOn(component, 'canDelete').and.returnValue(false);
|
|
||||||
|
|
||||||
expect(component.canMove(selection)).toBe(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('canPreviewFile()', () => {
|
|
||||||
it('it returns true if node is file', () => {
|
|
||||||
const selection = [{ entry: { isFile: true } }];
|
|
||||||
|
|
||||||
expect(component.canPreviewFile(selection)).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('it returns false if node is folder', () => {
|
|
||||||
const selection = [{ entry: { isFolder: true } }];
|
|
||||||
|
|
||||||
expect(component.canPreviewFile(selection)).toBe(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('canShareFile()', () => {
|
|
||||||
it('it returns true if node is file', () => {
|
|
||||||
const selection = [{ entry: { isFile: true } }];
|
|
||||||
|
|
||||||
expect(component.canShareFile(selection)).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('it returns false if node is folder', () => {
|
|
||||||
const selection = [{ entry: { isFolder: true } }];
|
|
||||||
|
|
||||||
expect(component.canShareFile(selection)).toBe(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('canDownloadFile()', () => {
|
|
||||||
it('it returns true if node is file', () => {
|
|
||||||
const selection = [{ entry: { isFile: true } }];
|
|
||||||
|
|
||||||
expect(component.canDownloadFile(selection)).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('it returns false if node is folder', () => {
|
|
||||||
const selection = [{ entry: { isFolder: true } }];
|
|
||||||
|
|
||||||
expect(component.canDownloadFile(selection)).toBe(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('nodeHasPermission()', () => {
|
|
||||||
it('returns true is has permission', () => {
|
|
||||||
const node = { allowableOperations: ['some-operation'] };
|
|
||||||
|
|
||||||
expect(component.nodeHasPermission(node, 'some-operation')).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('returns true is has permission', () => {
|
|
||||||
const node = { allowableOperations: ['other-operation'] };
|
|
||||||
|
|
||||||
expect(component.nodeHasPermission(node, 'some-operation')).toBe(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('canUpdate()', () => {
|
|
||||||
it('should return true if node can be edited', () => {
|
|
||||||
const selection = [ { entry: {
|
|
||||||
allowableOperations: ['update']
|
|
||||||
} } ];
|
|
||||||
|
|
||||||
expect(component.canUpdate(selection)).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it(`should return false if node cannot be edited`, () => {
|
|
||||||
const selection = [ { entry: {
|
|
||||||
allowableOperations: ['other-permission']
|
|
||||||
} } ];
|
|
||||||
|
|
||||||
expect(component.canUpdate(selection)).toBe(false);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -49,20 +49,6 @@ export abstract class PageComponent {
|
|||||||
return selection && selection.length > 0;
|
return selection && selection.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
filesOnlySelected(selection: Array<MinimalNodeEntity>): boolean {
|
|
||||||
if (this.hasSelection(selection)) {
|
|
||||||
return selection.every(entity => entity.entry && entity.entry.isFile);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
foldersOnlySelected(selection: Array<MinimalNodeEntity>): boolean {
|
|
||||||
if (this.hasSelection(selection)) {
|
|
||||||
return selection.every(entity => entity.entry && entity.entry.isFolder);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
isFileSelected(selection: Array<MinimalNodeEntity>): boolean {
|
isFileSelected(selection: Array<MinimalNodeEntity>): boolean {
|
||||||
if (selection && selection.length === 1) {
|
if (selection && selection.length === 1) {
|
||||||
const entry = selection[0].entry;
|
const entry = selection[0].entry;
|
||||||
@ -74,58 +60,14 @@ export abstract class PageComponent {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
canEditFolder(selection: Array<MinimalNodeEntity>): boolean {
|
isFolderSelected(selection: Array<MinimalNodeEntity>): boolean {
|
||||||
if (selection && selection.length === 1) {
|
if (selection && selection.length === 1) {
|
||||||
const entry = selection[0].entry;
|
const entry = selection[0].entry;
|
||||||
|
|
||||||
if (entry && entry.isFolder) {
|
if (entry && entry.isFolder) {
|
||||||
return this.nodeHasPermission(entry, 'update');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
canDelete(selection: Array<MinimalNodeEntity> = []): boolean {
|
|
||||||
return selection.every(node => node.entry && this.nodeHasPermission(node.entry, 'delete'));
|
|
||||||
}
|
|
||||||
|
|
||||||
canMove(selection: Array<MinimalNodeEntity>): boolean {
|
|
||||||
return this.canDelete(selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
canUpdate(selection: Array<MinimalNodeEntity> = []): boolean {
|
|
||||||
return selection.every(node => node.entry && this.nodeHasPermission(node.entry, 'update'));
|
|
||||||
}
|
|
||||||
|
|
||||||
canPreviewFile(selection: Array<MinimalNodeEntity>): boolean {
|
|
||||||
return this.isFileSelected(selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
canShareFile(selection: Array<MinimalNodeEntity>): boolean {
|
|
||||||
return this.isFileSelected(selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
canDownloadFile(selection: Array<MinimalNodeEntity>): boolean {
|
|
||||||
return this.isFileSelected(selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
canUpdateFile(selection: Array<MinimalNodeEntity>): boolean {
|
|
||||||
return this.isFileSelected(selection) && this.nodeHasPermission(selection[0].entry, 'update');
|
|
||||||
}
|
|
||||||
|
|
||||||
canManageVersions(selection: Array<MinimalNodeEntity>): boolean {
|
|
||||||
return this.canUpdateFile(selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
nodeHasPermission(node: MinimalNodeEntryEntity, permission: string): boolean {
|
|
||||||
if (node && permission) {
|
|
||||||
const { allowableOperations = [] } = <any>(node || {});
|
|
||||||
|
|
||||||
if (allowableOperations.indexOf(permission) > -1) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<button
|
<button
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
color="primary"
|
color="primary"
|
||||||
*ngIf="canPreviewFile(documentList.selection)"
|
*ngIf="isFileSelected(documentList.selection)"
|
||||||
title="{{ 'APP.ACTIONS.VIEW' | translate }}"
|
title="{{ 'APP.ACTIONS.VIEW' | translate }}"
|
||||||
(click)="onNodeDoubleClick(documentList.selection[0]?.entry)">
|
(click)="onNodeDoubleClick(documentList.selection[0]?.entry)">
|
||||||
<mat-icon>open_in_browser</mat-icon>
|
<mat-icon>open_in_browser</mat-icon>
|
||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<button mat-icon-button
|
<button mat-icon-button
|
||||||
[color]="infoDrawerOpened ? 'accent' : 'primary'"
|
[color]="infoDrawerOpened ? 'accent' : 'primary'"
|
||||||
*ngIf="documentList.selection.length"
|
*ngIf="hasSelection(documentList.selection)"
|
||||||
title="{{ 'APP.ACTIONS.DETAILS' | translate }}"
|
title="{{ 'APP.ACTIONS.DETAILS' | translate }}"
|
||||||
(click)="toggleSidebar()">
|
(click)="toggleSidebar()">
|
||||||
<mat-icon>info_outline</mat-icon>
|
<mat-icon>info_outline</mat-icon>
|
||||||
@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
mat-menu-item
|
mat-menu-item
|
||||||
*ngIf="canMove(documentList.selection)"
|
*ngIf="permission.check(documentList.selection, ['delete'])"
|
||||||
[acaMoveNode]="documentList.selection">
|
[acaMoveNode]="documentList.selection">
|
||||||
<mat-icon color="primary">library_books</mat-icon>
|
<mat-icon color="primary">library_books</mat-icon>
|
||||||
<span>{{ 'APP.ACTIONS.MOVE' | translate }}</span>
|
<span>{{ 'APP.ACTIONS.MOVE' | translate }}</span>
|
||||||
@ -73,7 +73,7 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
mat-menu-item
|
mat-menu-item
|
||||||
*ngIf="canDelete(documentList.selection)"
|
*ngIf="permission.check(documentList.selection, ['delete'])"
|
||||||
[acaDeleteNode]="documentList.selection">
|
[acaDeleteNode]="documentList.selection">
|
||||||
<mat-icon color="primary">delete</mat-icon>
|
<mat-icon color="primary">delete</mat-icon>
|
||||||
<span>{{ 'APP.ACTIONS.DELETE' | translate }}</span>
|
<span>{{ 'APP.ACTIONS.DELETE' | translate }}</span>
|
||||||
@ -177,8 +177,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<adf-content-metadata-card
|
<adf-content-metadata-card
|
||||||
[readOnly]="!canUpdate(documentList.selection)"
|
[readOnly]="!permission.check(nodeInfo.node, ['update'])"
|
||||||
[displayEmpty]="canUpdate(documentList.selection)"
|
[displayEmpty]="permission.check(nodeInfo.node, ['update'])"
|
||||||
[preset]="'custom'"
|
[preset]="'custom'"
|
||||||
[node]="infoInstance.node">
|
[node]="infoInstance.node">
|
||||||
</adf-content-metadata-card>
|
</adf-content-metadata-card>
|
||||||
|
@ -43,6 +43,7 @@ import { DocumentListService } from '@alfresco/adf-content-services';
|
|||||||
import { ContentManagementService } from '../../common/services/content-management.service';
|
import { ContentManagementService } from '../../common/services/content-management.service';
|
||||||
import { NodeInfoDirective } from '../../common/directives/node-info.directive';
|
import { NodeInfoDirective } from '../../common/directives/node-info.directive';
|
||||||
import { AppConfigPipe } from '../../common/pipes/app-config.pipe';
|
import { AppConfigPipe } from '../../common/pipes/app-config.pipe';
|
||||||
|
import { NodePermissionService } from '../../common/services/node-permission.service';
|
||||||
|
|
||||||
import { RecentFilesComponent } from './recent-files.component';
|
import { RecentFilesComponent } from './recent-files.component';
|
||||||
|
|
||||||
@ -96,6 +97,7 @@ describe('RecentFiles Routed Component', () => {
|
|||||||
LogService,
|
LogService,
|
||||||
NotificationService,
|
NotificationService,
|
||||||
ContentManagementService,
|
ContentManagementService,
|
||||||
|
NodePermissionService,
|
||||||
ContentService,
|
ContentService,
|
||||||
NodesApiService,
|
NodesApiService,
|
||||||
DocumentListService,
|
DocumentListService,
|
||||||
|
@ -32,6 +32,7 @@ import { DocumentListComponent } from '@alfresco/adf-content-services';
|
|||||||
|
|
||||||
import { ContentManagementService } from '../../common/services/content-management.service';
|
import { ContentManagementService } from '../../common/services/content-management.service';
|
||||||
import { PageComponent } from '../page.component';
|
import { PageComponent } from '../page.component';
|
||||||
|
import { NodePermissionService } from '../../common/services/node-permission.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './recent-files.component.html'
|
templateUrl: './recent-files.component.html'
|
||||||
@ -49,6 +50,7 @@ export class RecentFilesComponent extends PageComponent implements OnInit, OnDes
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private content: ContentManagementService,
|
private content: ContentManagementService,
|
||||||
|
public permission: NodePermissionService,
|
||||||
preferences: UserPreferencesService) {
|
preferences: UserPreferencesService) {
|
||||||
super(preferences);
|
super(preferences);
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<button
|
<button
|
||||||
color="primary"
|
color="primary"
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
*ngIf="canPreviewFile(documentList.selection)"
|
*ngIf="isFileSelected(documentList.selection)"
|
||||||
title="{{ 'APP.ACTIONS.VIEW' | translate }}"
|
title="{{ 'APP.ACTIONS.VIEW' | translate }}"
|
||||||
(click)="onNodeDoubleClick(documentList.selection[0]?.entry)">
|
(click)="onNodeDoubleClick(documentList.selection[0]?.entry)">
|
||||||
<mat-icon>open_in_browser</mat-icon>
|
<mat-icon>open_in_browser</mat-icon>
|
||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
<button mat-icon-button
|
<button mat-icon-button
|
||||||
[color]="infoDrawerOpened ? 'accent' : 'primary'"
|
[color]="infoDrawerOpened ? 'accent' : 'primary'"
|
||||||
*ngIf="documentList.selection.length"
|
*ngIf="hasSelection(documentList.selection)"
|
||||||
title="{{ 'APP.ACTIONS.DETAILS' | translate }}"
|
title="{{ 'APP.ACTIONS.DETAILS' | translate }}"
|
||||||
(click)="toggleSidebar()">
|
(click)="toggleSidebar()">
|
||||||
<mat-icon>info_outline</mat-icon>
|
<mat-icon>info_outline</mat-icon>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user