Skip to content

Commit 9cde3bb

Browse files
committed
add muted to MarkedRow status
1 parent e26b1e3 commit 9cde3bb

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

Signum.React.Extensions/Excel/Templates/ImportExcelModel.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,19 @@ export async function onImportFromExcel(sc: SearchControlLoaded) {
145145
var state = resport.results.filter(a => a.entity != null).toObject(a => liteKey(a.entity!), a => {
146146

147147
if (a.error) {
148-
return softCast<MarkedRow>({ message: `Error in Row ${a.rowIndex}: ${a.error}`, className: "text-danger" });
148+
return softCast<MarkedRow>({ message: `Error in Row ${a.rowIndex}: ${a.error}`, status: "Error" });
149149
}
150150

151151
if (a.action == "Updated") {
152-
return softCast<MarkedRow>({ message: `Updated from Row ${a.rowIndex}`, className: "text-warning" });
152+
return softCast<MarkedRow>({ message: `Updated from Row ${a.rowIndex}`, status: "Warning" });
153153
}
154154

155155
if (a.action == "Inserted") {
156-
return softCast<MarkedRow>({ message: `Inserted from Row ${a.rowIndex}`, className: "text-success" });
156+
return softCast<MarkedRow>({ message: `Inserted from Row ${a.rowIndex}`, status: "Success" });
157157
}
158158

159159
if (a.action == "NoChanges") {
160-
return softCast<MarkedRow>({ message: `No changes in row Row ${a.rowIndex}`, className: "text-muted" });
160+
return softCast<MarkedRow>({ message: `No changes in row Row ${a.rowIndex}`, status: "Muted" });
161161
}
162162

163163
throw new Error("Unexpected value " + a.action);

Signum.React/Scripts/SearchControl/ContextualItems.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface MarkedRowsDictionary {
2323
}
2424

2525
export interface MarkedRow {
26-
status: "Error" | "Warning" | "Success";
26+
status: "Error" | "Warning" | "Success" | "Muted";
2727
message?: string;
2828
}
2929

Signum.React/Scripts/SearchControl/SearchControlLoaded.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,9 @@ export default class SearchControlLoaded extends React.Component<SearchControlLo
16861686
const mark = this.getRowMarked(row);
16871687
const markClassName = mark?.status == "Success" ? "sf-entity-ctxmenu-success" :
16881688
mark?.status == "Warning" ? "table-warning" :
1689-
mark?.status == "Error" ? "table-danger" : undefined;
1689+
mark?.status == "Error" ? "table-danger" :
1690+
mark?.status == "Muted" ? "text-muted" :
1691+
undefined;
16901692

16911693
var ra = this.getRowAttributes(row);
16921694

@@ -1737,11 +1739,17 @@ export default class SearchControlLoaded extends React.Component<SearchControlLo
17371739
if (!mark)
17381740
return undefined;
17391741

1740-
const markIcon: IconProp = mark.status == "Success" ? "check-circle" :
1741-
mark.status == "Warning" ? "exclamation-circle" : "times-circle";
1742-
1743-
const markIconColor: string = mark.status == "Success" ? "green" :
1744-
mark.status == "Warning" ? "orange" : "red";
1742+
const markIcon: IconProp =
1743+
mark.status == "Success" ? "check-circle" :
1744+
mark.status == "Warning" ? "exclamation-circle" :
1745+
mark.status == "Error" ? "times-circle" :
1746+
mark.status == "Muted" ? "xmark" : null!;
1747+
1748+
const markIconColor: string =
1749+
mark.status == "Success" ? "green" :
1750+
mark.status == "Warning" ? "orange" :
1751+
mark.status == "Error" ? "red" :
1752+
mark.status == "Muted" ? "gray" : null!;
17451753

17461754
const icon = <span><FontAwesomeIcon icon={markIcon} color={markIconColor} /></span>;
17471755

0 commit comments

Comments
 (0)