RED-10405: removed locked rules pending type and fixed pending count.
This commit is contained in:
parent
2501bf5d56
commit
c248f55fbd
@ -100,13 +100,17 @@ export class DossierDetailsComponent extends ContextComponent<DossierDetailsCont
|
|||||||
super();
|
super();
|
||||||
const dossier$ = _dossiersService.getEntityChanged$(this.#dossierId).pipe(shareLast());
|
const dossier$ = _dossiersService.getEntityChanged$(this.#dossierId).pipe(shareLast());
|
||||||
const filesChanged$ = _filesMapService.watchChanged$(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 dossierStats$ = dossierStatsService.watch$(this.#dossierId).pipe(shareLast());
|
||||||
const dossierStatsWithEffects$ = dossierStats$.pipe(
|
const dossierStatsWithEffects$ = dossierStats$.pipe(
|
||||||
combineLatestWith(filesChanged$),
|
combineLatestWith(filesChanged$),
|
||||||
tap(([stats]) => this.#calculateChartConfig(stats)),
|
tap(([stats]) => this.#calculateChartConfig(stats)),
|
||||||
map(([stats]) => 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({
|
super._initContext({
|
||||||
needsWorkFilters: filterService.getFilterModels$('needsWorkFilters'),
|
needsWorkFilters: filterService.getFilterModels$('needsWorkFilters'),
|
||||||
@ -155,9 +159,7 @@ export class DossierDetailsComponent extends ContextComponent<DossierDetailsCont
|
|||||||
.reduce((sum: number, file: File) => sum + file.numberOfPages, 0);
|
.reduce((sum: number, file: File) => sum + file.numberOfPages, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#calculateStatusConfig(stats: DossierStats): ProgressBarConfigModel[] {
|
#calculateStatusConfig(stats: DossierStats, files: File[]): ProgressBarConfigModel[] {
|
||||||
const files = this._filesMapService.get(this.#dossierId);
|
|
||||||
const numberOfRulesLockedFiles = files.filter(file => file.errorCode === FileErrorCodes.LOCKED_RULES).length;
|
|
||||||
const numberOfTimeoutFiles = files.filter(file => file.errorCode === FileErrorCodes.RULES_EXECUTION_TIMEOUT).length;
|
const numberOfTimeoutFiles = files.filter(file => file.errorCode === FileErrorCodes.RULES_EXECUTION_TIMEOUT).length;
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@ -167,13 +169,6 @@ export class DossierDetailsComponent extends ContextComponent<DossierDetailsCont
|
|||||||
count: stats.processingStats.pending,
|
count: stats.processingStats.pending,
|
||||||
icon: 'red:reanalyse',
|
icon: 'red:reanalyse',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: PendingTypes.lockedRules,
|
|
||||||
label: _('processing-status.pending-locked-rules'),
|
|
||||||
total: stats.numberOfFiles,
|
|
||||||
count: numberOfRulesLockedFiles,
|
|
||||||
icon: 'red:reanalyse',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: PendingTypes.timeout,
|
id: PendingTypes.timeout,
|
||||||
label: _('processing-status.pending-timeout'),
|
label: _('processing-status.pending-timeout'),
|
||||||
|
|||||||
@ -55,7 +55,6 @@ export class FilesService extends EntitiesService<IFile, File> {
|
|||||||
|
|
||||||
/** Reload dossier files + stats. */
|
/** Reload dossier files + stats. */
|
||||||
loadAll(dossierId: string) {
|
loadAll(dossierId: string) {
|
||||||
console.log('loadAll');
|
|
||||||
const files$ = this.getFor(dossierId).pipe(
|
const files$ = this.getFor(dossierId).pipe(
|
||||||
mapEach(file => new File(file, this._userService.getName(file.assignee))),
|
mapEach(file => new File(file, this._userService.getName(file.assignee))),
|
||||||
tap(file => this._logger.info('[FILE] Loaded', file)),
|
tap(file => this._logger.info('[FILE] Loaded', 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.",
|
"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-listing": {
|
||||||
"file-entry": {
|
"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 ..."
|
"file-pending": "Ausstehend ..."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2102,7 +2102,6 @@
|
|||||||
"processing-status": {
|
"processing-status": {
|
||||||
"ocr": "OCR",
|
"ocr": "OCR",
|
||||||
"pending": "Ausstehend",
|
"pending": "Ausstehend",
|
||||||
"pending-locked-rules": "Ausstehend (Regeln gesperrt)",
|
|
||||||
"pending-timeout": "Ausstehend (Zeitlimit für Regeln)",
|
"pending-timeout": "Ausstehend (Zeitlimit für Regeln)",
|
||||||
"processed": "Verarbeitet",
|
"processed": "Verarbeitet",
|
||||||
"processing": "Verarbeitung läuft"
|
"processing": "Verarbeitung läuft"
|
||||||
|
|||||||
@ -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.",
|
"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-listing": {
|
||||||
"file-entry": {
|
"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..."
|
"file-pending": "Pending..."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2102,7 +2102,6 @@
|
|||||||
"processing-status": {
|
"processing-status": {
|
||||||
"ocr": "OCR",
|
"ocr": "OCR",
|
||||||
"pending": "Pending",
|
"pending": "Pending",
|
||||||
"pending-locked-rules": "Pending (Rules locked)",
|
|
||||||
"pending-timeout": "Pending (Rules timeout)",
|
"pending-timeout": "Pending (Rules timeout)",
|
||||||
"processed": "Processed",
|
"processed": "Processed",
|
||||||
"processing": "Processing"
|
"processing": "Processing"
|
||||||
|
|||||||
@ -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.",
|
"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-listing": {
|
||||||
"file-entry": {
|
"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 ..."
|
"file-pending": "Ausstehend ..."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2102,7 +2102,6 @@
|
|||||||
"processing-status": {
|
"processing-status": {
|
||||||
"ocr": "OCR",
|
"ocr": "OCR",
|
||||||
"pending": "Ausstehend",
|
"pending": "Ausstehend",
|
||||||
"pending-locked-rules": "Ausstehend (Regeln gesperrt)",
|
|
||||||
"pending-timeout": "Ausstehend (Zeitlimit für Regeln)",
|
"pending-timeout": "Ausstehend (Zeitlimit für Regeln)",
|
||||||
"processed": "Verarbeitet",
|
"processed": "Verarbeitet",
|
||||||
"processing": "Verarbeitung läuft"
|
"processing": "Verarbeitung läuft"
|
||||||
|
|||||||
@ -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.",
|
"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-listing": {
|
||||||
"file-entry": {
|
"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..."
|
"file-pending": "Pending..."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2102,7 +2102,6 @@
|
|||||||
"processing-status": {
|
"processing-status": {
|
||||||
"ocr": "OCR",
|
"ocr": "OCR",
|
||||||
"pending": "Pending",
|
"pending": "Pending",
|
||||||
"pending-locked-rules": "Pending (Rules locked)",
|
|
||||||
"pending-timeout": "Pending (Rules timeout)",
|
"pending-timeout": "Pending (Rules timeout)",
|
||||||
"processed": "Processed",
|
"processed": "Processed",
|
||||||
"processing": "Processing"
|
"processing": "Processing"
|
||||||
|
|||||||
@ -13,7 +13,6 @@ export const ProcessingTypes = {
|
|||||||
export type ProcessingType = keyof typeof ProcessingTypes;
|
export type ProcessingType = keyof typeof ProcessingTypes;
|
||||||
|
|
||||||
export const PendingTypes = {
|
export const PendingTypes = {
|
||||||
lockedRules: 'lockedRules',
|
|
||||||
timeout: 'timeout',
|
timeout: 'timeout',
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
|||||||
@ -196,9 +196,6 @@ export class File extends Entity<IFile> implements IFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get #pendingType(): PendingType | undefined {
|
get #pendingType(): PendingType | undefined {
|
||||||
if (this.errorCode === FileErrorCodes.LOCKED_RULES) {
|
|
||||||
return PendingTypes.lockedRules;
|
|
||||||
}
|
|
||||||
if (this.errorCode === FileErrorCodes.RULES_EXECUTION_TIMEOUT) {
|
if (this.errorCode === FileErrorCodes.RULES_EXECUTION_TIMEOUT) {
|
||||||
return PendingTypes.timeout;
|
return PendingTypes.timeout;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user