do not error when removing columns from instance column filters w/ burnettk
This commit is contained in:
parent
840d2f0937
commit
bd96844caa
|
@ -774,7 +774,6 @@ export default function ProcessInstanceListTable({
|
||||||
setReportMetadata(reportMetadataCopy);
|
setReportMetadata(reportMetadataCopy);
|
||||||
setReportColumnToOperateOn(null);
|
setReportColumnToOperateOn(null);
|
||||||
setShowReportColumnForm(false);
|
setShowReportColumnForm(false);
|
||||||
setShowReportColumnForm(false);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -795,9 +794,12 @@ export default function ProcessInstanceListTable({
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateReportColumn = (event: any) => {
|
const updateReportColumn = (event: any) => {
|
||||||
const reportColumnForEditing = reportColumnToReportColumnForEditing(
|
let reportColumnForEditing = null;
|
||||||
event.selectedItem
|
if (event.selectedItem) {
|
||||||
);
|
reportColumnForEditing = reportColumnToReportColumnForEditing(
|
||||||
|
event.selectedItem
|
||||||
|
);
|
||||||
|
}
|
||||||
setReportColumnToOperateOn(reportColumnForEditing);
|
setReportColumnToOperateOn(reportColumnForEditing);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -827,7 +829,29 @@ export default function ProcessInstanceListTable({
|
||||||
if (reportColumnFormMode === '') {
|
if (reportColumnFormMode === '') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const formElements = [
|
const formElements = [];
|
||||||
|
if (reportColumnFormMode === 'new') {
|
||||||
|
formElements.push(
|
||||||
|
<ComboBox
|
||||||
|
onChange={updateReportColumn}
|
||||||
|
id="report-column-selection"
|
||||||
|
data-qa="report-column-selection"
|
||||||
|
data-modal-primary-focus
|
||||||
|
items={availableReportColumns}
|
||||||
|
itemToString={(reportColumn: ReportColumn) => {
|
||||||
|
if (reportColumn) {
|
||||||
|
return reportColumn.accessor;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}}
|
||||||
|
shouldFilterItem={shouldFilterReportColumn}
|
||||||
|
placeholder="Choose a column to show"
|
||||||
|
titleText="Column"
|
||||||
|
selectedItem={reportColumnToOperateOn}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
formElements.push([
|
||||||
<TextInput
|
<TextInput
|
||||||
id="report-column-display-name"
|
id="report-column-display-name"
|
||||||
name="report-column-display-name"
|
name="report-column-display-name"
|
||||||
|
@ -844,7 +868,7 @@ export default function ProcessInstanceListTable({
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>,
|
/>,
|
||||||
];
|
]);
|
||||||
if (reportColumnToOperateOn && reportColumnToOperateOn.filterable) {
|
if (reportColumnToOperateOn && reportColumnToOperateOn.filterable) {
|
||||||
formElements.push(
|
formElements.push(
|
||||||
<TextInput
|
<TextInput
|
||||||
|
@ -860,27 +884,9 @@ export default function ProcessInstanceListTable({
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (reportColumnFormMode === 'new') {
|
formElements.push(
|
||||||
formElements.push(
|
<div className="vertical-spacer-to-allow-combo-box-to-expand-in-modal" />
|
||||||
<ComboBox
|
);
|
||||||
onChange={updateReportColumn}
|
|
||||||
className="combo-box-in-modal"
|
|
||||||
id="report-column-selection"
|
|
||||||
data-qa="report-column-selection"
|
|
||||||
data-modal-primary-focus
|
|
||||||
items={availableReportColumns}
|
|
||||||
itemToString={(reportColumn: ReportColumn) => {
|
|
||||||
if (reportColumn) {
|
|
||||||
return reportColumn.accessor;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}}
|
|
||||||
shouldFilterItem={shouldFilterReportColumn}
|
|
||||||
placeholder="Choose a column to show"
|
|
||||||
titleText="Column"
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
const modalHeading =
|
const modalHeading =
|
||||||
reportColumnFormMode === 'new'
|
reportColumnFormMode === 'new'
|
||||||
? 'Add Column'
|
? 'Add Column'
|
||||||
|
|
|
@ -355,8 +355,8 @@ svg.notification-icon {
|
||||||
word-break: normal;
|
word-break: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.combo-box-in-modal {
|
.vertical-spacer-to-allow-combo-box-to-expand-in-modal {
|
||||||
height: 300px;
|
height: 250px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cds--btn.narrow-button {
|
.cds--btn.narrow-button {
|
||||||
|
|
Loading…
Reference in New Issue