Some fixes & improvements

This commit is contained in:
Adina Țeudan 2021-09-16 00:37:59 +03:00
parent f078724567
commit 340b06c7ba
8 changed files with 40 additions and 76 deletions

View File

@ -15,6 +15,7 @@
[noDataText]="'trash.no-data.title' | translate"
[noMatchText]="'trash.no-match.title' | translate"
[selectionEnabled]="true"
[tableItemClasses]="{ disabled: disabledFn }"
noDataIcon="red:template"
></iqser-table>
</div>
@ -22,23 +23,21 @@
</section>
<ng-template #bulkActions>
<div class="bulk-actions">
<iqser-circle-button
(action)="restore()"
*ngIf="canRestoreSelected$ | async"
[tooltip]="'trash.bulk.restore' | translate"
[type]="circleButtonTypes.dark"
icon="red:put-back"
></iqser-circle-button>
<iqser-circle-button
(action)="restore()"
*ngIf="canRestoreSelected$ | async"
[tooltip]="'trash.bulk.restore' | translate"
[type]="circleButtonTypes.dark"
icon="red:put-back"
></iqser-circle-button>
<iqser-circle-button
(action)="hardDelete()"
*ngIf="entitiesService.areSomeSelected$ | async"
[tooltip]="'trash.bulk.delete' | translate"
[type]="circleButtonTypes.dark"
icon="red:trash"
></iqser-circle-button>
</div>
<iqser-circle-button
(action)="hardDelete()"
*ngIf="entitiesService.areSomeSelected$ | async"
[tooltip]="'trash.bulk.delete' | translate"
[type]="circleButtonTypes.dark"
icon="red:trash"
></iqser-circle-button>
</ng-template>
<ng-template #filenameTemplate let-entity="entity">
@ -70,8 +69,10 @@
</ng-template>
<ng-template #deletedTimeTemplate let-entity="entity">
<div class="cell small-label">
{{ entity.softDeletedTime | date: 'd MMM. yyyy, hh:mm a' }}
<div class="cell">
<span class="small-label">
{{ entity.softDeletedTime | date: 'd MMM. yyyy, hh:mm a' }}
</span>
</div>
</ng-template>

View File

@ -1,17 +0,0 @@
@import '../../../../../assets/styles/variables';
.bulk-actions {
display: flex;
align-items: center;
> *:not(:last-child) {
margin-right: 2px;
}
}
.disabled {
> div {
background-color: $grey-2;
color: $grey-7;
}
}

View File

@ -3,11 +3,11 @@ import { Dossier } from '@redaction/red-ui-http';
import {
CircleButtonTypes,
DefaultListingServices,
Listable,
ListingComponent,
LoadingService,
Listable,
TableColumnConfig,
SortingOrders
SortingOrders,
TableColumnConfig
} from '@iqser/common-ui';
import { AppConfigKey, AppConfigService } from '@app-config/app-config.service';
import * as moment from 'moment';
@ -65,6 +65,8 @@ export class TrashScreenComponent extends ListingComponent<DossierListItem> impl
);
}
disabledFn = (dossier: DossierListItem) => !dossier.canRestore;
async ngOnInit(): Promise<void> {
this._configureTableColumns();
this._loadingService.start();

View File

@ -16,23 +16,21 @@
</ng-template>
<ng-template #bulkActions>
<div class="bulk-actions">
<iqser-circle-button
(action)="restore()"
*ngIf="canRestoreSelected$ | async"
[tooltip]="'edit-dossier-dialog.deleted-documents.bulk.restore' | translate"
[type]="circleButtonTypes.dark"
icon="red:put-back"
></iqser-circle-button>
<iqser-circle-button
(action)="restore()"
*ngIf="canRestoreSelected$ | async"
[tooltip]="'edit-dossier-dialog.deleted-documents.bulk.restore' | translate"
[type]="circleButtonTypes.dark"
icon="red:put-back"
></iqser-circle-button>
<iqser-circle-button
(action)="hardDelete()"
*ngIf="entitiesService.areSomeSelected$ | async"
[tooltip]="'edit-dossier-dialog.deleted-documents.bulk.delete' | translate"
[type]="circleButtonTypes.dark"
icon="red:trash"
></iqser-circle-button>
</div>
<iqser-circle-button
(action)="hardDelete()"
*ngIf="entitiesService.areSomeSelected$ | async"
[tooltip]="'edit-dossier-dialog.deleted-documents.bulk.delete' | translate"
[type]="circleButtonTypes.dark"
icon="red:trash"
></iqser-circle-button>
</ng-template>
<ng-template #filenameTemplate let-file="entity">

View File

@ -14,12 +14,3 @@
@include line-clamp(1);
}
}
.bulk-actions {
display: flex;
align-items: center;
> *:not(:last-child) {
margin-right: 2px;
}
}

View File

@ -5,17 +5,6 @@
}
:host ::ng-deep iqser-table cdk-virtual-scroll-viewport .cdk-virtual-scroll-content-wrapper .table-item {
&.disabled {
> div {
background-color: $grey-2;
color: $grey-7;
}
redaction-file-actions {
color: initial;
}
}
&.last-opened {
> .selection-column {
padding-left: 6px !important;

View File

@ -28,7 +28,7 @@ export class PermissionsService {
}
canToggleAnalysis(fileStatus: FileStatusWrapper): boolean {
return this._userService.currentUser.isManager && ['UNASSIGNED', 'UNDER_REVIEW', 'UNDER_APPROVAL'].includes(fileStatus.status);
return this.isReviewerOrApprover(fileStatus) && ['UNASSIGNED', 'UNDER_REVIEW', 'UNDER_APPROVAL'].includes(fileStatus.status);
}
canReanalyseFile(fileStatus = this._activeFile): boolean {

@ -1 +1 @@
Subproject commit 35f1a8d19f78e6be0e54de67735228ba7fc7b883
Subproject commit 6c0f123bd97148f8696038f63c9951c241b71990