File actions order & icons, assign dialog fixes
This commit is contained in:
parent
c513dd8e5d
commit
15adb8f26e
@ -4,9 +4,9 @@
|
||||
(action)="openDeleteFileDialog($event, fileStatus)"
|
||||
*ngIf="permissionsService.canDeleteFile(fileStatus)"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
tooltip="project-overview.delete.action"
|
||||
icon="red:trash"
|
||||
[type]="buttonType"
|
||||
icon="red:trash"
|
||||
tooltip="project-overview.delete.action"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
@ -14,50 +14,9 @@
|
||||
<redaction-circle-button
|
||||
(action)="assignReviewer($event, fileStatus)"
|
||||
*ngIf="permissionsService.canAssignReviewer(fileStatus) && screen === 'project-overview'"
|
||||
[icon]="permissionsService.isManagerAndOwner() ? 'red:assign' : 'red:assign-me'"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[tooltip]="permissionsService.isManagerAndOwner() ? 'project-overview.assign' : 'project-overview.assign-me'"
|
||||
[icon]="permissionsService.isManagerAndOwner() ? 'red:assign' : 'red:assign-me'"
|
||||
[type]="buttonType"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<!-- file state actions -->
|
||||
<redaction-circle-button
|
||||
(action)="setFileApproved($event, fileStatus)"
|
||||
*ngIf="permissionsService.canApprove(fileStatus)"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
tooltip="project-overview.approve"
|
||||
icon="red:check-alt"
|
||||
[type]="buttonType"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<redaction-circle-button
|
||||
(action)="setFileUnderApproval($event, fileStatus)"
|
||||
*ngIf="permissionsService.canSetUnderApproval(fileStatus)"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
tooltip="project-overview.under-approval"
|
||||
icon="red:check-alt"
|
||||
[type]="buttonType"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<redaction-circle-button
|
||||
(action)="setFileUnderApproval($event, fileStatus)"
|
||||
*ngIf="permissionsService.canUndoApproval(fileStatus)"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
tooltip="project-overview.under-approval"
|
||||
icon="red:undo"
|
||||
[type]="buttonType"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<redaction-circle-button
|
||||
(action)="setFileUnderReview($event, fileStatus)"
|
||||
*ngIf="permissionsService.canUndoUnderApproval(fileStatus)"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
tooltip="project-overview.under-review"
|
||||
icon="red:undo"
|
||||
[type]="buttonType"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
@ -66,12 +25,12 @@
|
||||
<redaction-circle-button
|
||||
(action)="downloadFileRedactionReport($event, fileStatus)"
|
||||
*ngIf="permissionsService.canShowRedactionReportDownloadBtn(fileStatus)"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[tooltipClass]="'small'"
|
||||
[tooltip]="fileStatus.isApproved ? 'report.action' : 'report.unavailable-single'"
|
||||
[disabled]="!fileStatus.isApproved"
|
||||
icon="red:report"
|
||||
[tooltipClass]="'small'"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[tooltip]="fileStatus.isApproved ? 'report.action' : 'report.unavailable-single'"
|
||||
[type]="buttonType"
|
||||
icon="red:report"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
@ -80,9 +39,55 @@
|
||||
(action)="downloadFile($event, fileStatus)"
|
||||
*ngIf="permissionsService.canDownloadRedactedFile(fileStatus)"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
tooltip="project-overview.download-redacted-file"
|
||||
icon="red:download"
|
||||
[type]="buttonType"
|
||||
icon="red:download"
|
||||
tooltip="project-overview.download-redacted-file"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<!-- file state actions -->
|
||||
|
||||
<!-- Ready for approval-->
|
||||
<redaction-circle-button
|
||||
(action)="setFileUnderApproval($event, fileStatus)"
|
||||
*ngIf="permissionsService.canSetUnderApproval(fileStatus)"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
icon="red:ready-for-approval"
|
||||
tooltip="project-overview.under-approval"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<!-- Back to review -->
|
||||
<redaction-circle-button
|
||||
(action)="setFileUnderReview($event, fileStatus, true)"
|
||||
*ngIf="permissionsService.canUndoUnderApproval(fileStatus)"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
icon="red:undo"
|
||||
tooltip="project-overview.under-review"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<!-- Approved-->
|
||||
<redaction-circle-button
|
||||
(action)="setFileApproved($event, fileStatus)"
|
||||
*ngIf="permissionsService.canApprove(fileStatus)"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
icon="red:approved"
|
||||
tooltip="project-overview.approve"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<!-- Back to approval -->
|
||||
<redaction-circle-button
|
||||
(action)="setFileUnderApproval($event, fileStatus)"
|
||||
*ngIf="permissionsService.canUndoApproval(fileStatus)"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
icon="red:undo"
|
||||
tooltip="project-overview.under-approval"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
@ -91,10 +96,10 @@
|
||||
(action)="reanalyseFile($event, fileStatus)"
|
||||
*ngIf="permissionsService.canReanalyseFile(fileStatus) && screen === 'file-preview'"
|
||||
[tooltipPosition]="'before'"
|
||||
tooltip="file-preview.reanalyse-notification"
|
||||
type="warn"
|
||||
tooltipClass="warn small"
|
||||
icon="red:refresh"
|
||||
tooltip="file-preview.reanalyse-notification"
|
||||
tooltipClass="warn small"
|
||||
type="warn"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
@ -103,8 +108,8 @@
|
||||
(action)="reanalyseFile($event, fileStatus)"
|
||||
*ngIf="permissionsService.canReanalyseFile(fileStatus) && screen === 'project-overview'"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
tooltip="project-overview.reanalyse.action"
|
||||
icon="red:refresh"
|
||||
tooltip="project-overview.reanalyse.action"
|
||||
type="dark-bg"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
@ -85,12 +85,12 @@ export class FileActionsComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
setFileUnderReview($event: MouseEvent, fileStatus: FileStatusWrapper) {
|
||||
setFileUnderReview($event: MouseEvent, fileStatus: FileStatusWrapper, ignoreDialogChanges = false) {
|
||||
$event.stopPropagation();
|
||||
// this._fileActionService.setFileUnderReview(fileStatus).subscribe(() => {
|
||||
// this.reloadProjects('set-review');
|
||||
// });
|
||||
this._fileActionService.assignProjectReviewer(fileStatus, () => this.actionPerformed.emit('assign-reviewer'));
|
||||
this._fileActionService.assignProjectReviewer(fileStatus, () => this.actionPerformed.emit('assign-reviewer'), ignoreDialogChanges);
|
||||
}
|
||||
|
||||
reloadProjects(action: string) {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<div [translate]="'assign-' + data.type + '-owner.dialog.title'" class="dialog-header heading-l"></div>
|
||||
|
||||
<form (submit)="saveUsers()" [formGroup]="usersForm">
|
||||
<div class="dialog-content">
|
||||
<div class="dialog-content" [class.no-padding-bottom]="data.type === 'project'">
|
||||
<div class="red-input-group">
|
||||
<mat-form-field floatLabel="always">
|
||||
<mat-label>{{ 'assign-' + data.type + '-owner.dialog.single-user' | translate }}</mat-label>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
@import '../../../assets/styles/red-mixins';
|
||||
|
||||
.dialog-content {
|
||||
.no-padding-bottom {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@ class DialogData {
|
||||
type: 'file' | 'project';
|
||||
project?: ProjectWrapper;
|
||||
files?: FileStatusWrapper[];
|
||||
ignoreChanged?: boolean;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -132,6 +133,10 @@ export class AssignOwnerDialogComponent {
|
||||
}
|
||||
|
||||
public get changed(): boolean {
|
||||
if (this.data.ignoreChanged) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.data.type === 'project') {
|
||||
if (this.data.project.ownerId !== this.selectedSingleUser) {
|
||||
return true;
|
||||
|
||||
@ -204,10 +204,10 @@ export class DialogService {
|
||||
return ref;
|
||||
}
|
||||
|
||||
public openAssignFileReviewerDialog(file: FileStatus, cb?: Function): MatDialogRef<AssignOwnerDialogComponent> {
|
||||
public openAssignFileReviewerDialog(file: FileStatus, cb?: Function, ignoreDialogChanges = false): MatDialogRef<AssignOwnerDialogComponent> {
|
||||
const ref = this._dialog.open(AssignOwnerDialogComponent, {
|
||||
...dialogConfig,
|
||||
data: { type: 'file', files: [file] }
|
||||
data: { type: 'file', files: [file], ignoreChanged: ignoreDialogChanges }
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe(() => {
|
||||
|
||||
@ -13,6 +13,7 @@ export class IconsModule {
|
||||
const icons = [
|
||||
'add',
|
||||
'analyse',
|
||||
'approved',
|
||||
'arrow-down',
|
||||
'arrow-up',
|
||||
'arrow-right',
|
||||
@ -49,6 +50,7 @@ export class IconsModule {
|
||||
'preview',
|
||||
'radio-indeterminate',
|
||||
'radio-selected',
|
||||
'ready-for-approval',
|
||||
'refresh',
|
||||
'report',
|
||||
'search',
|
||||
|
||||
@ -44,13 +44,17 @@ export class FileActionService {
|
||||
});
|
||||
}
|
||||
|
||||
public assignProjectReviewer(file?: FileStatus, callback?: Function) {
|
||||
this._dialogService.openAssignFileReviewerDialog(file ? file : this._appStateService.activeFile, async () => {
|
||||
await this._appStateService.reloadActiveProjectFiles();
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
public assignProjectReviewer(file?: FileStatus, callback?: Function, ignoreDialogChanges = false) {
|
||||
this._dialogService.openAssignFileReviewerDialog(
|
||||
file ? file : this._appStateService.activeFile,
|
||||
async () => {
|
||||
await this._appStateService.reloadActiveProjectFiles();
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
ignoreDialogChanges
|
||||
);
|
||||
}
|
||||
|
||||
public async assignToMe(file?: FileStatus, callback?: Function) {
|
||||
|
||||
13
apps/red-ui/src/assets/icons/general/approved.svg
Normal file
13
apps/red-ui/src/assets/icons/general/approved.svg
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>163F9A92-B60D-42FF-80C8-1135F4B95ECC</title>
|
||||
<g id="Styleguide" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Styleguide-Actions" transform="translate(-62.000000, -567.000000)" fill="currentColor" fill-rule="nonzero">
|
||||
<g id="Group-6" transform="translate(52.000000, 557.000000)">
|
||||
<g id="status" transform="translate(10.000000, 10.000000)">
|
||||
<path d="M14,0 L14,11.2 L11.2,11.2 L11.2,14 L0,14 L0,2.8 L2.8,2.8 L2.8,0 L14,0 Z M2.8,4.2 L1.4,4.2 L1.4,12.6 L9.8,12.6 L9.8,11.2 L2.8,11.2 L2.8,4.2 Z M12.6,1.4 L4.2,1.4 L4.2,9.8 L12.6,9.8 L12.6,1.4 Z M10.36,3.36 L11.34,4.34 L7.84,7.84 L5.74,5.74 L6.72,4.76 L7.84,5.88 L10.36,3.36 Z" id="approved"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 992 B |
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="100px" height="100px" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>ready_for_approval</title>
|
||||
<g id="ready_for_approval" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M50,0 C77.5,5.05166805e-15 100,22.5 100,50 C100,77.5 77.5,100 50,100 C22.5,100 -1.42108547e-14,77.5 -1.42108547e-14,50 C0,22.5 22.5,-5.05166805e-15 50,0 Z M50,10 C28,10 10,28 10,50 C10,72 28,90 50,90 C72,90 90,72 90,50 C90,28 72,10 50,10 Z M64,34 L71,41 L46,66 L31,51 L38,44 L46,52 L64,34 Z" fill="currentColor" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 694 B |
@ -1,20 +1,15 @@
|
||||
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
width="438.536px" height="438.536px" viewBox="0 0 438.536 438.536"
|
||||
style="enable-background:new 0 0 438.536 438.536;"
|
||||
xml:space="preserve">
|
||||
<g fill="currentColor">
|
||||
<path d="M421.125,134.191c-11.608-27.03-27.217-50.347-46.819-69.949C354.7,44.639,331.384,29.033,304.353,17.42
|
||||
C277.325,5.807,248.969,0.005,219.275,0.005c-27.978,0-55.052,5.277-81.227,15.843C111.879,26.412,88.61,41.305,68.243,60.531
|
||||
l-37.12-36.835c-5.711-5.901-12.275-7.232-19.701-3.999C3.807,22.937,0,28.554,0,36.547v127.907c0,4.948,1.809,9.231,5.426,12.847
|
||||
c3.619,3.617,7.902,5.426,12.85,5.426h127.907c7.996,0,13.61-3.807,16.846-11.421c3.234-7.423,1.903-13.988-3.999-19.701
|
||||
l-39.115-39.398c13.328-12.563,28.553-22.222,45.683-28.98c17.131-6.757,35.021-10.138,53.675-10.138
|
||||
c19.793,0,38.687,3.858,56.674,11.563c17.99,7.71,33.544,18.131,46.679,31.265c13.134,13.131,23.555,28.69,31.265,46.679
|
||||
c7.703,17.987,11.56,36.875,11.56,56.674c0,19.798-3.856,38.686-11.56,56.672c-7.71,17.987-18.131,33.544-31.265,46.679
|
||||
c-13.135,13.134-28.695,23.558-46.679,31.265c-17.987,7.707-36.881,11.561-56.674,11.561c-22.651,0-44.064-4.949-64.241-14.843
|
||||
c-20.174-9.894-37.209-23.883-51.104-41.973c-1.331-1.902-3.521-3.046-6.567-3.429c-2.856,0-5.236,0.855-7.139,2.566
|
||||
l-39.114,39.402c-1.521,1.53-2.33,3.478-2.426,5.853c-0.094,2.385,0.527,4.524,1.858,6.427
|
||||
c20.749,25.125,45.871,44.587,75.373,58.382c29.502,13.798,60.625,20.701,93.362,20.701c29.694,0,58.05-5.808,85.078-17.416
|
||||
c27.031-11.607,50.34-27.22,69.949-46.821c19.605-19.609,35.211-42.921,46.822-69.949s17.411-55.392,17.411-85.08
|
||||
C438.536,189.569,432.732,161.22,421.125,134.191z"/>
|
||||
</g>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>B3EA3E95-AC5D-4F73-ACEB-7F071103E161</title>
|
||||
<g id="Styleguide" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Styleguide-Actions" transform="translate(-62.000000, -609.000000)">
|
||||
<rect x="0" y="0" width="904" height="906"></rect>
|
||||
<g id="Group-6" transform="translate(52.000000, 599.000000)">
|
||||
<rect id="Rectangle" x="0" y="0" width="34" height="34" rx="17"></rect>
|
||||
<g id="status" transform="translate(10.000000, 10.000000)" fill="currentColor" fill-rule="nonzero">
|
||||
<path d="M7.7,2.38 L8.75,3.29 L6.86,5.18 L7.7,5.18 C11.2,5.18 14,8.05 14,11.48 L14,11.48 L12.6,11.48 C12.6,8.75 10.43,6.58 7.7,6.58 L7.7,6.58 L6.86,6.58 L8.75,8.47 L7.77,9.45 L4.2,5.88 L7.7,2.38 Z M3.5,2.38 L4.48,3.36 L1.96,5.88 L4.48,8.47 L3.5,9.45 L0,5.88 L3.5,2.38 Z" id="Back-to-review"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.1 KiB |
Loading…
x
Reference in New Issue
Block a user