mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-17 14:21:14 +00:00
conditional Deleted By column (#435)
This commit is contained in:
committed by
Denys Vuika
parent
bf3c86f5f5
commit
ec2323b038
@@ -87,6 +87,7 @@
|
|||||||
</data-column>
|
</data-column>
|
||||||
|
|
||||||
<data-column
|
<data-column
|
||||||
|
*ngIf="userIsAdmin"
|
||||||
class="adf-data-table-cell--ellipsis"
|
class="adf-data-table-cell--ellipsis"
|
||||||
key="archivedByUser.displayName"
|
key="archivedByUser.displayName"
|
||||||
title="APP.DOCUMENT_LIST.COLUMNS.DELETED_BY">
|
title="APP.DOCUMENT_LIST.COLUMNS.DELETED_BY">
|
||||||
|
@@ -32,7 +32,7 @@ import {
|
|||||||
UserPreferencesService, LogService, AppConfigService,
|
UserPreferencesService, LogService, AppConfigService,
|
||||||
StorageService, CookieService, ThumbnailService,
|
StorageService, CookieService, ThumbnailService,
|
||||||
AuthenticationService, TimeAgoPipe, NodeNameTooltipPipe,
|
AuthenticationService, TimeAgoPipe, NodeNameTooltipPipe,
|
||||||
NodeFavoriteDirective, DataTableComponent, AppConfigPipe
|
NodeFavoriteDirective, DataTableComponent, AppConfigPipe, PeopleContentService
|
||||||
} from '@alfresco/adf-core';
|
} from '@alfresco/adf-core';
|
||||||
import { DocumentListComponent, CustomResourcesService } from '@alfresco/adf-content-services';
|
import { DocumentListComponent, CustomResourcesService } from '@alfresco/adf-content-services';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
@@ -86,6 +86,7 @@ describe('TrashcanComponent', () => {
|
|||||||
{ provide: TranslationService, useClass: TranslationMock },
|
{ provide: TranslationService, useClass: TranslationMock },
|
||||||
AuthenticationService,
|
AuthenticationService,
|
||||||
UserPreferencesService,
|
UserPreferencesService,
|
||||||
|
PeopleContentService,
|
||||||
AppConfigService, StorageService, CookieService,
|
AppConfigService, StorageService, CookieService,
|
||||||
AlfrescoApiService,
|
AlfrescoApiService,
|
||||||
LogService,
|
LogService,
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { Pagination } from 'alfresco-js-api';
|
import { Pagination } from 'alfresco-js-api';
|
||||||
import { UserPreferencesService } from '@alfresco/adf-core';
|
import { UserPreferencesService, PeopleContentService } from '@alfresco/adf-core';
|
||||||
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 { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
@@ -36,8 +36,10 @@ import { AppStore } from '../../store/states/app.state';
|
|||||||
templateUrl: './trashcan.component.html'
|
templateUrl: './trashcan.component.html'
|
||||||
})
|
})
|
||||||
export class TrashcanComponent extends PageComponent implements OnInit {
|
export class TrashcanComponent extends PageComponent implements OnInit {
|
||||||
|
userIsAdmin: boolean;
|
||||||
|
|
||||||
constructor(private contentManagementService: ContentManagementService,
|
constructor(private contentManagementService: ContentManagementService,
|
||||||
|
private peopleApi: PeopleContentService,
|
||||||
preferences: UserPreferencesService,
|
preferences: UserPreferencesService,
|
||||||
store: Store<AppStore>,
|
store: Store<AppStore>,
|
||||||
route: ActivatedRoute) {
|
route: ActivatedRoute) {
|
||||||
@@ -50,11 +52,20 @@ export class TrashcanComponent extends PageComponent implements OnInit {
|
|||||||
this.subscriptions.push(
|
this.subscriptions.push(
|
||||||
this.contentManagementService.nodesRestored.subscribe(() => this.reload()),
|
this.contentManagementService.nodesRestored.subscribe(() => this.reload()),
|
||||||
this.contentManagementService.nodesPurged.subscribe(() => this.reload()),
|
this.contentManagementService.nodesPurged.subscribe(() => this.reload()),
|
||||||
this.contentManagementService.nodesRestored.subscribe(() => this.reload())
|
this.contentManagementService.nodesRestored.subscribe(() => this.reload()),
|
||||||
|
this.peopleApi.getCurrentPerson().subscribe((user: any) => this.isUserAdmin(user))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onChangePageSize(event: Pagination): void {
|
onChangePageSize(event: Pagination): void {
|
||||||
this.preferences.paginationSize = event.maxItems;
|
this.preferences.paginationSize = event.maxItems;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
private isUserAdmin(user) {
|
||||||
|
if (user && user.capabilities) {
|
||||||
|
this.userIsAdmin = user.capabilities.isAdmin;
|
||||||
|
} else {
|
||||||
|
this.userIsAdmin = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user