Fixed most UI issues discussed

This commit is contained in:
Timo 2021-04-13 22:19:56 +03:00
parent ab8312c8db
commit 7ca20f19d7
5 changed files with 11 additions and 18 deletions

View File

@ -72,14 +72,9 @@
<redaction-notifications class="mr-8" *ngIf="userPreferenceService.areDevFeaturesEnabled"></redaction-notifications>
<redaction-user-button [user]="user" [matMenuTriggerFor]="userMenu" [showDot]="showPendingDownloadsDot"></redaction-user-button>
<mat-menu #userMenu="matMenu" class="user-menu" xPosition="before">
<button [routerLink]="'/ui/my-profile'" mat-menu-item translate="top-bar.navigation-items.my-account.children.my-profile"></button>
<button
*ngIf="permissionsService.isUser()"
[routerLink]="'/ui/my-profile'"
mat-menu-item
translate="top-bar.navigation-items.my-account.children.my-profile"
></button>
<button
*ngIf="permissionsService.isManager()"
*ngIf="permissionsService.isManager() || permissionsService.isUserAdmin()"
(click)="appStateService.reset()"
[routerLink]="'/ui/admin'"
mat-menu-item

View File

@ -93,13 +93,9 @@ export class UserProfileScreenComponent implements OnInit {
delete value.language;
await this._userControllerService
.updateProfile(
{
...value,
roles: this._user.roles
},
this._user.userId
)
.updateMyProfile({
...value
})
.toPromise();
}

View File

@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { PermissionsService } from '../../../../services/permissions.service';
import { UserService } from '../../../../services/user.service';
import { RuleSetModel, User, UserControllerService } from '@redaction/red-ui-http';
import { User, UserControllerService } from '@redaction/red-ui-http';
import { FormBuilder, FormGroup } from '@angular/forms';
import { debounce } from '../../../../utils/debounce';
import { AdminDialogService } from '../../services/admin-dialog.service';
@ -77,7 +77,7 @@ export class UserListingScreenComponent implements OnInit {
}
private async _loadData() {
this.users = (await this._userControllerService.getAllUsers({}).toPromise()).users;
this.users = (await this._userControllerService.getAllUsers({ requestId: new Date().toISOString() }).toPromise()).users;
this._executeSearch();
this._computeStats();
this.viewReady = true;

View File

@ -109,6 +109,7 @@ export class FileActionsComponent implements OnInit {
$event.stopPropagation();
await this._fileActionService.toggleAnalysis(this.fileStatus).toPromise();
await this.appStateService.getFiles();
this.actionPerformed.emit(this.fileStatus.isExcluded ? 'enable-analysis' : 'disable-analysis');
}
get toggleTooltip(): string {

View File

@ -111,11 +111,11 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
}
get canSwitchToRedactedView() {
return !this.permissionsService.fileRequiresReanalysis();
return !this.permissionsService.fileRequiresReanalysis() && !this.fileData.fileStatus.isExcluded;
}
get canSwitchToDeltaView() {
return this.fileData?.redactionChangeLog?.redactionLogEntry?.length > 0;
return this.fileData?.redactionChangeLog?.redactionLogEntry?.length > 0 && !this.fileData.fileStatus.isExcluded;
}
get displayData() {
@ -335,6 +335,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
await this._router.navigate([`/ui/projects/${this.projectId}`]);
return;
case 'enable-analysis':
case 'reanalyse':
this.viewReady = false;
this._startAnalysisTimer();