Merge branch 'RED-7067' into 'master'

RED-7067, keep disabled state in case initial processing finishes before ocr queue

Closes RED-7067

See merge request redactmanager/red-ui!73
This commit is contained in:
George Balanesc 2023-09-13 12:14:39 +02:00
commit 51ccc63d34
4 changed files with 41 additions and 12 deletions

View File

@ -1,10 +1,10 @@
<ng-container *ngIf="componentContext$ | async as ctx"> <ng-container *ngIf="componentContext$ | async as ctx">
<div> <div>
<div <div
[class.error]="file.isError"
[class.initial-processing]="file.isInitialProcessing"
[matTooltip]="file.filename"
[attr.help-mode-key]="'document_in_editor'" [attr.help-mode-key]="'document_in_editor'"
[class.error]="file.isError"
[class.initial-processing]="file.isInitialProcessing || (ctx.ocrByDefault && !file.lastOCRTime)"
[matTooltip]="file.filename"
class="table-item-title" class="table-item-title"
matTooltipPosition="above" matTooltipPosition="above"
> >

View File

@ -4,6 +4,7 @@ import { FileAttributes } from '@red/domain';
import { FileAttributesService } from '@services/entity-services/file-attributes.service'; import { FileAttributesService } from '@services/entity-services/file-attributes.service';
import { combineLatest, map, ReplaySubject } from 'rxjs'; import { combineLatest, map, ReplaySubject } from 'rxjs';
import { ContextComponent } from '@iqser/common-ui/lib/utils'; import { ContextComponent } from '@iqser/common-ui/lib/utils';
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
interface PartialFile { interface PartialFile {
readonly isError: boolean; readonly isError: boolean;
@ -18,6 +19,7 @@ interface PartialFile {
interface FileNameColumnContext { interface FileNameColumnContext {
primaryAttribute: string; primaryAttribute: string;
ocrByDefault: boolean;
} }
@Component({ @Component({
@ -27,13 +29,14 @@ interface FileNameColumnContext {
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
}) })
export class FileNameColumnComponent extends ContextComponent<FileNameColumnContext> implements OnInit, OnChanges { export class FileNameColumnComponent extends ContextComponent<FileNameColumnContext> implements OnInit, OnChanges {
readonly #reloadAttribute = new ReplaySubject<void>(1);
@Input() file: PartialFile; @Input() file: PartialFile;
@Input() dossierTemplateId: string; @Input() dossierTemplateId: string;
readonly #reloadAttribute = new ReplaySubject<void>(1);
constructor( constructor(
private readonly _fileAttributeService: FileAttributesService, private readonly _fileAttributeService: FileAttributesService,
private readonly _primaryFileAttributeService: PrimaryFileAttributeService, private readonly _primaryFileAttributeService: PrimaryFileAttributeService,
private readonly _dossierTemplateService: DossierTemplatesService,
) { ) {
super(); super();
} }
@ -42,8 +45,10 @@ export class FileNameColumnComponent extends ContextComponent<FileNameColumnCont
const primaryAttribute$ = combineLatest([this._fileAttributeService.fileAttributesConfig$, this.#reloadAttribute]).pipe( const primaryAttribute$ = combineLatest([this._fileAttributeService.fileAttributesConfig$, this.#reloadAttribute]).pipe(
map(() => this._primaryFileAttributeService.getPrimaryFileAttributeValue(this.file, this.dossierTemplateId)), map(() => this._primaryFileAttributeService.getPrimaryFileAttributeValue(this.file, this.dossierTemplateId)),
); );
const ocrByDefault$ = this._dossierTemplateService.get(this.dossierTemplateId).pipe(map(template => template.ocrByDefault));
super._initContext({ super._initContext({
primaryAttribute: primaryAttribute$, primaryAttribute: primaryAttribute$,
ocrByDefault: ocrByDefault$,
}); });
} }

View File

@ -3,7 +3,7 @@
"ADMIN_CONTACT_URL": null, "ADMIN_CONTACT_URL": null,
"API_URL": "https://dan.iqser.cloud", "API_URL": "https://dan.iqser.cloud",
"APP_NAME": "RedactManager", "APP_NAME": "RedactManager",
"IS_DOCUMINE": true, "IS_DOCUMINE": false,
"RULE_EDITOR_DEV_ONLY": false, "RULE_EDITOR_DEV_ONLY": false,
"AUTO_READ_TIME": 3, "AUTO_READ_TIME": 3,
"BACKEND_APP_VERSION": "4.4.40", "BACKEND_APP_VERSION": "4.4.40",
@ -18,8 +18,8 @@
"SELECTION_MODE": "structural", "SELECTION_MODE": "structural",
"MANUAL_BASE_URL": "https://docs.redactmanager.com/preview", "MANUAL_BASE_URL": "https://docs.redactmanager.com/preview",
"ANNOTATIONS_THRESHOLD": 1000, "ANNOTATIONS_THRESHOLD": 1000,
"THEME": "scm", "THEME": "redact",
"BASE_TRANSLATIONS_DIRECTORY": "/assets/i18n/scm/", "BASE_TRANSLATIONS_DIRECTORY": "/assets/i18n/redact/",
"AVAILABLE_NOTIFICATIONS_DAYS": 30, "AVAILABLE_NOTIFICATIONS_DAYS": 30,
"AVAILABLE_OLD_NOTIFICATIONS_MINUTES": 60, "AVAILABLE_OLD_NOTIFICATIONS_MINUTES": 60,
"NOTIFICATIONS_THRESHOLD": 1000, "NOTIFICATIONS_THRESHOLD": 1000,

View File

@ -234,6 +234,7 @@
}, },
"admin-side-nav": { "admin-side-nav": {
"audit": "Audit", "audit": "Audit",
"component-rule-editor": "",
"configurations": "Configurations", "configurations": "Configurations",
"default-colors": "Default Colors", "default-colors": "Default Colors",
"dictionary": "Dictionary", "dictionary": "Dictionary",
@ -557,6 +558,19 @@
"title": "Aktion bestätigen" "title": "Aktion bestätigen"
} }
}, },
"component-rules-screen": {
"error": {
"generic": ""
},
"errors-found": "",
"revert-changes": "",
"save-changes": "",
"success": {
"generic": ""
},
"title": "",
"warning-text": ""
},
"configurations": "Einstellungen", "configurations": "Einstellungen",
"confirm-archive-dossier": { "confirm-archive-dossier": {
"archive": "Archive Dossier", "archive": "Archive Dossier",
@ -1237,7 +1251,8 @@
"reason": "Reason", "reason": "Reason",
"redacted-text": "Redacted text", "redacted-text": "Redacted text",
"section": "Paragraph / Location", "section": "Paragraph / Location",
"type": "Type" "type": "Type",
"unchanged": "Unchanged"
}, },
"title": "Edit {type, select, image{Image} hint{Hint} other{Redaction}}" "title": "Edit {type, select, image{Image} hint{Hint} other{Redaction}}"
} }
@ -1732,7 +1747,7 @@
"unused": "Unused Storage" "unused": "Unused Storage"
}, },
"capacity-details": "Capacity Details", "capacity-details": "Capacity Details",
"copyright-claim-text": "Copyright © 2020 - {currentYear} knecon AG (powered by IQSER)", "copyright-claim-text": "Copyright © 2020 - {currentYear} knecon",
"copyright-claim-title": "Copyright", "copyright-claim-title": "Copyright",
"current-analyzed-pages": "In aktuellem Lizenzzeitraum analysierte Seiten", "current-analyzed-pages": "In aktuellem Lizenzzeitraum analysierte Seiten",
"current-volume-analyzed": "Data Volume Analyzed in Licensing Period", "current-volume-analyzed": "Data Volume Analyzed in Licensing Period",
@ -2021,22 +2036,29 @@
"content": { "content": {
"comment": "Comment", "comment": "Comment",
"comment-placeholder": "Add remarks or mentions ...", "comment-placeholder": "Add remarks or mentions ...",
"list-item": "",
"list-item-false-positive": "",
"options": { "options": {
"false-positive": { "false-positive": {
"description": "\"{value}\" is not a \"{type}\" in this context: \"{context}\".", "description": "\"{value}\" is not a \"{type}\" in this context: \"{context}\".",
"description-bulk": "",
"label": "False positive" "label": "False positive"
}, },
"in-dossier": { "in-dossier": {
"description": "Do not annotate \"{value}\" as \"{type}\" in any dossier.", "description": "Do not annotate \"{value}\" as \"{type}\" in any dossier.",
"label": "No longer annotate as \"{type}\"" "description-bulk": "",
"label": "No longer annotate as \"{type}\"",
"label-bulk": ""
}, },
"only-here": { "only-here": {
"description": "Do not annotate \"{value}\" at this position in the current document.", "description": "Do not annotate \"{value}\" at this position in the current document.",
"description-bulk": "",
"label": "Remove here" "label": "Remove here"
} }
} },
"redacted-text": ""
}, },
"title": "Remove annotation" "title": "Remove {count, plural, one{annotation} other {annotations}}"
} }
}, },
"remove-redaction": { "remove-redaction": {
@ -2051,6 +2073,7 @@
"options": { "options": {
"do-not-recommend": { "do-not-recommend": {
"description": "Do not recommend \"{value}\" as {type} in any document of the current dossier.", "description": "Do not recommend \"{value}\" as {type} in any document of the current dossier.",
"description-bulk": "",
"extraOptionLabel": "Apply to all dossiers", "extraOptionLabel": "Apply to all dossiers",
"label": "Remove from dossier" "label": "Remove from dossier"
}, },
@ -2212,6 +2235,7 @@
"error": { "error": {
"generic": "Es ist ein Fehler aufgetreten ... Die Regeln konnten nicht aktualisiert werden!" "generic": "Es ist ein Fehler aufgetreten ... Die Regeln konnten nicht aktualisiert werden!"
}, },
"errors-found": "{errors, plural, one{An error} other{{errors} errors}} found in rules",
"revert-changes": "Anmeldedaten speichern", "revert-changes": "Anmeldedaten speichern",
"save-changes": "Änderungen speichern", "save-changes": "Änderungen speichern",
"success": { "success": {