RED-10405: removed locked rules pending type and fixed pending count.

This commit is contained in:
Nicoleta Panaghiu 2024-11-18 11:39:35 +02:00
parent 2501bf5d56
commit c248f55fbd
8 changed files with 10 additions and 24 deletions

View File

@ -100,13 +100,17 @@ export class DossierDetailsComponent extends ContextComponent<DossierDetailsCont
super();
const dossier$ = _dossiersService.getEntityChanged$(this.#dossierId).pipe(shareLast());
const filesChanged$ = _filesMapService.watchChanged$(this.#dossierId).pipe(shareLast());
const files$ = _filesMapService.get$(this.#dossierId).pipe(shareLast());
const dossierStats$ = dossierStatsService.watch$(this.#dossierId).pipe(shareLast());
const dossierStatsWithEffects$ = dossierStats$.pipe(
combineLatestWith(filesChanged$),
tap(([stats]) => this.#calculateChartConfig(stats)),
map(([stats]) => stats),
);
const statusConfig$ = dossierStats$.pipe(map(stats => this.#calculateStatusConfig(stats)));
const statusConfig$ = dossierStats$.pipe(
combineLatestWith(files$),
map(([stats, files]) => this.#calculateStatusConfig(stats, files)),
);
super._initContext({
needsWorkFilters: filterService.getFilterModels$('needsWorkFilters'),
@ -155,9 +159,7 @@ export class DossierDetailsComponent extends ContextComponent<DossierDetailsCont
.reduce((sum: number, file: File) => sum + file.numberOfPages, 0);
}
#calculateStatusConfig(stats: DossierStats): ProgressBarConfigModel[] {
const files = this._filesMapService.get(this.#dossierId);
const numberOfRulesLockedFiles = files.filter(file => file.errorCode === FileErrorCodes.LOCKED_RULES).length;
#calculateStatusConfig(stats: DossierStats, files: File[]): ProgressBarConfigModel[] {
const numberOfTimeoutFiles = files.filter(file => file.errorCode === FileErrorCodes.RULES_EXECUTION_TIMEOUT).length;
return [
{
@ -167,13 +169,6 @@ export class DossierDetailsComponent extends ContextComponent<DossierDetailsCont
count: stats.processingStats.pending,
icon: 'red:reanalyse',
},
{
id: PendingTypes.lockedRules,
label: _('processing-status.pending-locked-rules'),
total: stats.numberOfFiles,
count: numberOfRulesLockedFiles,
icon: 'red:reanalyse',
},
{
id: PendingTypes.timeout,
label: _('processing-status.pending-timeout'),

View File

@ -55,7 +55,6 @@ export class FilesService extends EntitiesService<IFile, File> {
/** Reload dossier files + stats. */
loadAll(dossierId: string) {
console.log('loadAll');
const files$ = this.getFor(dossierId).pipe(
mapEach(file => new File(file, this._userService.getName(file.assignee))),
tap(file => this._logger.info('[FILE] Loaded', file)),

View File

@ -987,7 +987,7 @@
"download-file-disabled": "Download: Sie müssen Genehmiger im Dossier sein und die initiale Verarbeitung {count, plural, one{der Datei} other{der Dateien}} muss abgeschlossen sein.",
"file-listing": {
"file-entry": {
"file-error": "Reanalyse erforderlich {errorCode, select, RULES_EXECUTION_TIMEOUT{(Zeitlimit für Regeln)} LOCKED_RULES{(Regeln gesperrt)} other{}}",
"file-error": "Reanalyse erforderlich {errorCode, select, RULES_EXECUTION_TIMEOUT{(Zeitlimit für Regeln)} other{}}",
"file-pending": "Ausstehend ..."
}
},
@ -2102,7 +2102,6 @@
"processing-status": {
"ocr": "OCR",
"pending": "Ausstehend",
"pending-locked-rules": "Ausstehend (Regeln gesperrt)",
"pending-timeout": "Ausstehend (Zeitlimit für Regeln)",
"processed": "Verarbeitet",
"processing": "Verarbeitung läuft"

View File

@ -987,7 +987,7 @@
"download-file-disabled": "To download, ensure you are an approver in the dossier, and the {count, plural, one{file has undergone} other{files have undergone}} initial processing.",
"file-listing": {
"file-entry": {
"file-error": "Re-processing required {errorCode, select, RULES_EXECUTION_TIMEOUT{(Rules timeout)} LOCKED_RULES{(Rules locked)} other{}}",
"file-error": "Re-processing required {errorCode, select, RULES_EXECUTION_TIMEOUT{(Rules timeout)} other{}}",
"file-pending": "Pending..."
}
},
@ -2102,7 +2102,6 @@
"processing-status": {
"ocr": "OCR",
"pending": "Pending",
"pending-locked-rules": "Pending (Rules locked)",
"pending-timeout": "Pending (Rules timeout)",
"processed": "Processed",
"processing": "Processing"

View File

@ -987,7 +987,7 @@
"download-file-disabled": "Download: Sie müssen Genehmiger im Dossier sein und die initiale Verarbeitung {count, plural, one{der Datei} other{der Dateien}} muss abgeschlossen sein.",
"file-listing": {
"file-entry": {
"file-error": "Reanalyse erforderlich {errorCode, select, RULES_EXECUTION_TIMEOUT{(Zeitlimit für Regeln)} LOCKED_RULES{(Regeln gesperrt)} other{}}",
"file-error": "Reanalyse erforderlich {errorCode, select, RULES_EXECUTION_TIMEOUT{(Zeitlimit für Regeln)} other{}}",
"file-pending": "Ausstehend ..."
}
},
@ -2102,7 +2102,6 @@
"processing-status": {
"ocr": "OCR",
"pending": "Ausstehend",
"pending-locked-rules": "Ausstehend (Regeln gesperrt)",
"pending-timeout": "Ausstehend (Zeitlimit für Regeln)",
"processed": "Verarbeitet",
"processing": "Verarbeitung läuft"

View File

@ -987,7 +987,7 @@
"download-file-disabled": "To download, ensure you are an approver in the dossier, and the {count, plural, one{file has undergone} other{files have undergone}} initial processing.",
"file-listing": {
"file-entry": {
"file-error": "Re-processing required {errorCode, select, RULES_EXECUTION_TIMEOUT{(Rules timeout)} LOCKED_RULES{(Rules locked)} other{}}",
"file-error": "Re-processing required {errorCode, select, RULES_EXECUTION_TIMEOUT{(Rules timeout)} other{}}",
"file-pending": "Pending..."
}
},
@ -2102,7 +2102,6 @@
"processing-status": {
"ocr": "OCR",
"pending": "Pending",
"pending-locked-rules": "Pending (Rules locked)",
"pending-timeout": "Pending (Rules timeout)",
"processed": "Processed",
"processing": "Processing"

View File

@ -13,7 +13,6 @@ export const ProcessingTypes = {
export type ProcessingType = keyof typeof ProcessingTypes;
export const PendingTypes = {
lockedRules: 'lockedRules',
timeout: 'timeout',
} as const;

View File

@ -196,9 +196,6 @@ export class File extends Entity<IFile> implements IFile {
}
get #pendingType(): PendingType | undefined {
if (this.errorCode === FileErrorCodes.LOCKED_RULES) {
return PendingTypes.lockedRules;
}
if (this.errorCode === FileErrorCodes.RULES_EXECUTION_TIMEOUT) {
return PendingTypes.timeout;
}