made admin pages work for admin, fixed some bugs
This commit is contained in:
parent
4d7204a26d
commit
fe7c272137
@ -39,17 +39,9 @@
|
|||||||
<label translate="manual-annotation.dialog.content.dictionary"></label>
|
<label translate="manual-annotation.dialog.content.dictionary"></label>
|
||||||
|
|
||||||
<mat-select formControlName="dictionary">
|
<mat-select formControlName="dictionary">
|
||||||
<mat-optgroup [label]="'group.redactions' | translate">
|
<mat-option *ngFor="let dictionary of redactionDictionaries" [value]="dictionary.type">
|
||||||
<mat-option *ngFor="let dictionary of redactionDictionaries" [value]="dictionary.type">
|
{{ dictionary.label }}
|
||||||
{{ dictionary.label }}
|
</mat-option>
|
||||||
</mat-option>
|
|
||||||
</mat-optgroup>
|
|
||||||
|
|
||||||
<mat-optgroup [label]="'group.hints' | translate">
|
|
||||||
<mat-option *ngFor="let dictionary of hintDictionaries" [value]="dictionary.type">
|
|
||||||
{{ dictionary.label }}
|
|
||||||
</mat-option>
|
|
||||||
</mat-optgroup>
|
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -40,7 +40,13 @@
|
|||||||
<div class="flex red-content-inner">
|
<div class="flex red-content-inner">
|
||||||
<div class="left-container">
|
<div class="left-container">
|
||||||
<div class="red-input-group">
|
<div class="red-input-group">
|
||||||
<input type="text" (keyup)="searchChanged(inputElement.value)" #inputElement placeholder="{{ 'dictionary-overview.search' | translate }}" />
|
<input
|
||||||
|
[class.with-matches]="searchText.length > 0"
|
||||||
|
type="text"
|
||||||
|
(keyup)="searchChanged(inputElement.value)"
|
||||||
|
#inputElement
|
||||||
|
placeholder="{{ 'dictionary-overview.search' | translate }}"
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="input-icons">
|
<div class="input-icons">
|
||||||
<div class="no-input" *ngIf="searchText.length === 0">
|
<div class="no-input" *ngIf="searchText.length === 0">
|
||||||
@ -50,8 +56,8 @@
|
|||||||
<div class="search-match-text">
|
<div class="search-match-text">
|
||||||
{{ currentMatch + '/' + searchPositions.length }}
|
{{ currentMatch + '/' + searchPositions.length }}
|
||||||
</div>
|
</div>
|
||||||
<mat-icon svgIcon="red:arrow-down" class="transform-180 pointer" (click)="nextSearchMatch()"></mat-icon>
|
<mat-icon svgIcon="red:arrow-down" class="transform-180 pointer" (click)="previousSearchMatch()"></mat-icon>
|
||||||
<mat-icon svgIcon="red:arrow-down" class="pointer" (click)="previousSearchMatch()"></mat-icon>
|
<mat-icon svgIcon="red:arrow-down" class="pointer" (click)="nextSearchMatch()"></mat-icon>
|
||||||
<mat-icon svgIcon="red:close" (click)="searchChanged(''); inputElement.value = ''; inputElement.focus()" class="pointer"></mat-icon>
|
<mat-icon svgIcon="red:close" (click)="searchChanged(''); inputElement.value = ''; inputElement.focus()" class="pointer"></mat-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -74,6 +74,10 @@ ace-editor {
|
|||||||
|
|
||||||
input {
|
input {
|
||||||
padding-right: 32px;
|
padding-right: 32px;
|
||||||
|
|
||||||
|
&.with-matches {
|
||||||
|
padding-right: 108px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-icons {
|
.input-icons {
|
||||||
|
|||||||
@ -173,6 +173,7 @@ export class DictionaryOverviewScreenComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nextSearchMatch() {
|
nextSearchMatch() {
|
||||||
|
// length = 3
|
||||||
if (this.searchPositions.length > 0) {
|
if (this.searchPositions.length > 0) {
|
||||||
this.currentMatch = this.currentMatch < this.searchPositions.length ? this.currentMatch + 1 : 1;
|
this.currentMatch = this.currentMatch < this.searchPositions.length ? this.currentMatch + 1 : 1;
|
||||||
this._gotoLine();
|
this._gotoLine();
|
||||||
@ -181,7 +182,7 @@ export class DictionaryOverviewScreenComponent {
|
|||||||
|
|
||||||
previousSearchMatch() {
|
previousSearchMatch() {
|
||||||
if (this.searchPositions.length > 0) {
|
if (this.searchPositions.length > 0) {
|
||||||
this.currentMatch = this.currentMatch > 1 ? this.currentMatch - 1 : this.searchPositions.length - 1;
|
this.currentMatch = this.currentMatch > 1 ? this.currentMatch - 1 : this.searchPositions.length;
|
||||||
this._gotoLine();
|
this._gotoLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,12 +109,14 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
|||||||
|
|
||||||
instance.docViewer.on('keyUp', ($event) => {
|
instance.docViewer.on('keyUp', ($event) => {
|
||||||
// arrows and full-screen
|
// arrows and full-screen
|
||||||
if ($event.key.startsWith('Arrow') || $event.key === 'f') {
|
if ($event.target?.tagName?.toLowerCase() !== 'input') {
|
||||||
this._ngZone.run(() => {
|
if ($event.key.startsWith('Arrow') || $event.key === 'f') {
|
||||||
this.keyUp.emit($event);
|
this._ngZone.run(() => {
|
||||||
});
|
this.keyUp.emit($event);
|
||||||
$event.preventDefault();
|
});
|
||||||
$event.stopPropagation();
|
$event.preventDefault();
|
||||||
|
$event.stopPropagation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._allowedKeyboardShortcuts.indexOf($event.key) < 0) {
|
if (this._allowedKeyboardShortcuts.indexOf($event.key) < 0) {
|
||||||
|
|||||||
@ -11,14 +11,13 @@ export class AppStateGuard implements CanActivate {
|
|||||||
|
|
||||||
async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean> {
|
async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean> {
|
||||||
await this._userService.loadAllUsersIfNecessary();
|
await this._userService.loadAllUsersIfNecessary();
|
||||||
|
await this._appStateService.loadDictionaryDataIfNecessary();
|
||||||
|
await this._appStateService.updateDictionaryVersion();
|
||||||
|
|
||||||
if (this._userService.isUser()) {
|
if (this._userService.isUser()) {
|
||||||
await this._appStateService.loadAllProjectsIfNecessary();
|
await this._appStateService.loadAllProjectsIfNecessary();
|
||||||
}
|
}
|
||||||
|
|
||||||
await this._appStateService.loadDictionaryDataIfNecessary();
|
|
||||||
await this._appStateService.updateDictionaryVersion();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user