From c812dea8eacf3a6bbc8341bbc2b2c6978423630d Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Wed, 15 Mar 2023 17:05:42 -0500 Subject: [PATCH] add handling for new filter link summary lines --- src/qqq/models/processes/ProcessSummaryLine.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/qqq/models/processes/ProcessSummaryLine.tsx b/src/qqq/models/processes/ProcessSummaryLine.tsx index 426a157..a7c898b 100644 --- a/src/qqq/models/processes/ProcessSummaryLine.tsx +++ b/src/qqq/models/processes/ProcessSummaryLine.tsx @@ -38,7 +38,6 @@ import ValueUtils from "qqq/utils/qqq/ValueUtils"; ** Entity that corresponds to qqq backend's ProcessSummaryLine - with methods ** to help display properly in a process review screen. *******************************************************************************/ -// eslint-disable-next-line import/prefer-default-export export class ProcessSummaryLine { status: "OK" | "INFO" | "WARNING" | "ERROR"; @@ -49,6 +48,7 @@ export class ProcessSummaryLine tableName: string; recordId: any; + filter: any; linkPreText: string; linkText: string; linkPostText: string; @@ -65,19 +65,21 @@ export class ProcessSummaryLine this.linkPreText = processSummaryLine.linkPreText; this.linkText = processSummaryLine.linkText; this.linkPostText = processSummaryLine.linkPostText; + + this.filter = processSummaryLine.filter; } getProcessSummaryListItem(i: number, table: QTableMetaData, qInstance: QInstance, isResultScreen: boolean = false): JSX.Element { - if (this.tableName != undefined && this.recordId != undefined) + if (this.tableName != undefined && (this.recordId != undefined || this.filter != undefined)) { - return (this.getProcessSummaryListItemForTableRecordLink(i, table, qInstance, isResultScreen)); + return (this.getProcessSummaryListItemForTableRecordOrFilterLink(i, table, qInstance, isResultScreen)); } return (this.getProcessSummaryListItemForCountAndMessage(i, table, qInstance, isResultScreen)); } - private getProcessSummaryListItemForTableRecordLink(i: number, table: QTableMetaData, qInstance: QInstance, isResultScreen: boolean = false): JSX.Element + private getProcessSummaryListItemForTableRecordOrFilterLink(i: number, table: QTableMetaData, qInstance: QInstance, isResultScreen: boolean = false): JSX.Element { const tablePath = qInstance.getTablePathByName(this.tableName); @@ -87,7 +89,11 @@ export class ProcessSummaryLine {this.getIcon(isResultScreen)} {this.linkPreText ?? ""} - {this.linkText} + { + this.recordId + ? {this.linkText} + : {this.linkText} + } {this.linkPostText ?? ""}