RED-894 RED-958 RED-959 RED-973 RED-974 RED-978 RED-982
This commit is contained in:
parent
954f3f9074
commit
ccd8004321
@ -105,6 +105,7 @@ import { RuleSetViewSwitchComponent } from './components/rule-set-view-switch/ru
|
||||
import { MatSliderModule } from '@angular/material/slider';
|
||||
import { PendingChangesGuard } from './utils/can-deactivate.guard';
|
||||
import { OverwriteFilesDialogComponent } from './dialogs/overwrite-files-dialog/overwrite-files-dialog.component';
|
||||
import { KeycloakService } from 'keycloak-angular';
|
||||
|
||||
export function HttpLoaderFactory(httpClient: HttpClient) {
|
||||
return new TranslateHttpLoader(httpClient, '/assets/i18n/', '.json');
|
||||
@ -395,8 +396,12 @@ const matImports = [
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
export class AppModule {
|
||||
constructor(private router: Router, private route: ActivatedRoute) {
|
||||
route.queryParamMap.subscribe((queryParams) => {
|
||||
constructor(private router: Router, private route: ActivatedRoute, private _keyCloakService: KeycloakService) {
|
||||
this._configureKeyCloakRouteHandling();
|
||||
}
|
||||
|
||||
private _configureKeyCloakRouteHandling() {
|
||||
this.route.queryParamMap.subscribe((queryParams) => {
|
||||
if (queryParams.has('code') || queryParams.has('state') || queryParams.has('session_state')) {
|
||||
this.router.navigate([], {
|
||||
queryParams: {
|
||||
|
||||
@ -30,11 +30,17 @@ export function keycloakInitializer(keycloak: KeycloakService, appConfigService:
|
||||
},
|
||||
enableBearerInterceptor: true
|
||||
};
|
||||
return keycloak.init(options);
|
||||
return keycloak.init(options).then(() => configureAutomaticRedirectToLoginScreen(keycloak));
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function configureAutomaticRedirectToLoginScreen(keyCloakService: KeycloakService) {
|
||||
keyCloakService.getKeycloakInstance().onAuthRefreshError = () => {
|
||||
keyCloakService.logout();
|
||||
};
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [],
|
||||
imports: [CommonModule, HttpClientModule, KeycloakAngularModule, AppConfigModule],
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
<redaction-annotation-icon *ngIf="filter.key === 'redaction'" type="square" label="R" color="#283241"></redaction-annotation-icon>
|
||||
<redaction-annotation-icon *ngIf="filter.key === 'recommendation'" type="square" label="R" color="#c5d3eb"></redaction-annotation-icon>
|
||||
<redaction-annotation-icon *ngIf="filter.key === 'analysis'" type="square" label="A" [color]="dictionaryColor"></redaction-annotation-icon>
|
||||
<redaction-annotation-icon *ngIf="filter.key === 'hint'" type="circle" label="H" color="#9398a0"></redaction-annotation-icon>
|
||||
|
||||
<redaction-annotation-icon *ngIf="filter.key === 'manual'" type="square" label="M" [color]="dictionaryColor"></redaction-annotation-icon>
|
||||
<redaction-annotation-icon *ngIf="filter.key === 'manual-redaction'" type="square" label="M" [color]="dictionaryColor"></redaction-annotation-icon>
|
||||
|
||||
<redaction-annotation-icon *ngIf="filter.key === 'ignore'" type="square" label="I" [color]="dictionaryColor"></redaction-annotation-icon>
|
||||
<redaction-annotation-icon
|
||||
@ -28,5 +29,4 @@
|
||||
<redaction-annotation-icon *ngIf="filter.key === 'declined-suggestion'" type="rhombus" label="S" [color]="dictionaryColor"></redaction-annotation-icon>
|
||||
|
||||
<redaction-annotation-icon *ngIf="filter.key === 'none'" label="-" color="transparent" type="none"></redaction-annotation-icon>
|
||||
|
||||
{{ filter.label | translate }}
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
>
|
||||
</redaction-status-bar>
|
||||
<div class="all-caps-label mr-16 ml-8">
|
||||
{{ appStateService.activeFile.status.toLowerCase().replace('_', '-') | translate }}
|
||||
{{ appStateService.activeFile.status | translate }}
|
||||
<span *ngIf="appStateService.activeFile.status === 'UNDER_REVIEW' || appStateService.activeFile.status === 'UNDER_APPROVAL'"
|
||||
>{{ 'by' | translate }}:</span
|
||||
>
|
||||
|
||||
@ -50,14 +50,8 @@ export class AnnotationWrapper {
|
||||
);
|
||||
}
|
||||
|
||||
get isDictionaryBased() {
|
||||
return this.isHint || this.superType === 'redaction';
|
||||
}
|
||||
|
||||
get descriptor() {
|
||||
// TODO clarify: RED-894
|
||||
// return this.isDictionaryBased ? 'dictionary' : 'type';
|
||||
return 'type';
|
||||
return this.isModifyDictionary ? 'dictionary' : 'type';
|
||||
}
|
||||
|
||||
get hasTextAfter() {
|
||||
|
||||
@ -83,6 +83,7 @@ export class AnnotationDrawService {
|
||||
switch (superType) {
|
||||
case 'hint':
|
||||
case 'redaction':
|
||||
case 'recommendation':
|
||||
color = this._appStateService.getDictionaryColor(dictionary);
|
||||
break;
|
||||
case 'ignore':
|
||||
|
||||
@ -17,7 +17,7 @@ export class AnnotationProcessingService {
|
||||
const filters: FilterModel[] = [];
|
||||
|
||||
annotations?.forEach((a) => {
|
||||
const topLevelFilter = a.superType !== 'hint' && a.superType !== 'redaction';
|
||||
const topLevelFilter = a.superType !== 'hint' && a.superType !== 'redaction' && a.superType !== 'recommendation';
|
||||
const key = topLevelFilter ? a.superType : a.superType + a.dictionary;
|
||||
const filter = filterMap.get(key);
|
||||
if (filter) {
|
||||
|
||||
@ -205,7 +205,7 @@ export class ProjectListingScreenComponent implements OnInit, OnDestroy {
|
||||
allDistinctFileStatus.forEach((status) => {
|
||||
statusFilters.push({
|
||||
key: status,
|
||||
label: humanize(status)
|
||||
label: this._translateService.instant(status)
|
||||
});
|
||||
});
|
||||
statusFilters.sort((a, b) => StatusSorter[a.key] - StatusSorter[b.key]);
|
||||
|
||||
@ -278,7 +278,7 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
allDistinctFileStatusWrapper.forEach((status) => {
|
||||
statusFilters.push({
|
||||
key: status,
|
||||
label: humanize(status)
|
||||
label: this._translateService.instant(status)
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -488,6 +488,13 @@ export class AppStateService {
|
||||
type: 'manual',
|
||||
virtual: true
|
||||
};
|
||||
|
||||
// dictionary actions
|
||||
dictionaryData['recommendation'] = {
|
||||
hexColor: '#c5d3eb',
|
||||
type: 'recommendation',
|
||||
virtual: true
|
||||
};
|
||||
// dictionary actions
|
||||
dictionaryData['add-dictionary'] = {
|
||||
hexColor: '#dd4d50',
|
||||
@ -533,12 +540,6 @@ export class AppStateService {
|
||||
virtual: true
|
||||
};
|
||||
|
||||
dictionaryData['manual'] = {
|
||||
hexColor: colors.defaultColor,
|
||||
type: 'manual',
|
||||
virtual: true
|
||||
};
|
||||
|
||||
dictionaryData['ignore'] = {
|
||||
hexColor: colors.notRedacted,
|
||||
type: 'ignore',
|
||||
|
||||
@ -9,6 +9,6 @@ export class TranslateChartService {
|
||||
constructor(private readonly _translateService: TranslateService) {}
|
||||
|
||||
public translateStatus(config: DoughnutChartConfig[]): DoughnutChartConfig[] {
|
||||
return config.map((val) => ({ ...val, label: this._translateService.instant(val.label.toLowerCase().replace('_', '-')) }));
|
||||
return config.map((val) => ({ ...val, label: this._translateService.instant(val.label) }));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"OAUTH_URL": "https://redkc-staging.iqser.cloud/auth/realms/redaction",
|
||||
"OAUTH_URL": "https://redqa-auth.iqser.cloud/auth/realms/redaction",
|
||||
"OAUTH_CLIENT_ID": "redaction",
|
||||
"API_URL": "https://timo-redaction-dev.iqser.cloud"
|
||||
"API_URL": "https://redqa-api.iqser.cloud"
|
||||
}
|
||||
|
||||
@ -250,7 +250,7 @@
|
||||
"last-updated": "Last updated: {{lastUpdated}}",
|
||||
"file-pending": "Pending...",
|
||||
"file-processing": "Processing...",
|
||||
"file-error": "Scheduled for reanalysis."
|
||||
"file-error": "Re-processing required"
|
||||
}
|
||||
},
|
||||
"project-details": {
|
||||
@ -422,14 +422,18 @@
|
||||
"hide-comments": "Hide",
|
||||
"cancel": "Cancel"
|
||||
},
|
||||
"error": "Re-processing",
|
||||
"unassigned": "Unassigned",
|
||||
"under-review": "Under Review",
|
||||
"under-approval": "Under Approval",
|
||||
|
||||
"UNPROCESSED": "Unprocessed",
|
||||
"REPROCESS": "Processing",
|
||||
"PROCESSING": "Processing",
|
||||
"ERROR": "Re-processing required",
|
||||
"UNASSIGNED": "Unassigned",
|
||||
"UNDER_REVIEW": "Under Review",
|
||||
"UNDER_APPROVAL": "Under Approval",
|
||||
"APPROVED": "Approved",
|
||||
"by": "by",
|
||||
"efsa": "EFSA Approval",
|
||||
"finished": "Finished",
|
||||
"approved": "Approved",
|
||||
"submitted": "Submitted",
|
||||
"active": "Active",
|
||||
"archived": "Archived",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user