', 'element property']
- const arrayProp = parts[0];
- const elementId = parseInt(parts[1], 10);
- const prop = parts[2];
-
- const arrayToChange = editData[arrayProp].map((elem) => {
- if (elem.id === elementId) {
- return { ...elem, [prop]: value };
- }
- return elem;
- });
-
- const newEventData = { ...editData, [arrayProp]: arrayToChange };
- setEditData(newEventData);
- } else {
- const newEventData = { ...editData, [id]: value };
- setEditData(newEventData);
- }
- };
-
- const onRemoveOption = (rowId, id) => {
- const currentRow = selected.find((r) => r.id === row.id);
- const newOptions = currentRow[id].filter((s) => s.id !== rowId);
- const newEventData = { ...editData, [id]: newOptions };
- setEditData(newEventData);
- };
-
- return (
- <>
- |
- setChecked(!checked)}
- checked={checked}
- />
- |
- {row.id} |
- {selected.find((s) => s.id === row.id) && editEnabled && checked ? (
- <>
- {columns.map((col) => {
- if (col.columnKey === "id") {
- return null;
- }
- if (col.editableField === true) {
- // Default field as text
- return (
-
-
- |
- );
- }
- if (col.editableField) {
- return (
-
- {col.editableField({
- value:
- editData[col.columnKey]?.id ||
- editData[col.columnKey]?.value ||
- editData[col.columnKey],
- onChange: onRowChange,
- row: editData,
- rowData: editData[col.columnKey],
- onRemoveOption
- })}
- |
- );
- }
- return (
-
- {col.render
- ? col.render(row[col.columnKey], row)
- : formattedData[col.columnKey]}
- |
- );
- })}
- >
- ) : (
- columns.map(
- (col) =>
- col.columnKey !== "id" && (
-
- {col.render
- ? col.render(row[col.columnKey], row)
- : formattedData[col.columnKey]}
- |
- )
- )
- )}
- {(actions.edit || actions.delete) && (
-
-
- {actions.edit && (
-
- )}
- {actions.delete && (
-
- )}
-
- |
- )}
- >
- );
-}
-
-export default EditableTableRow;
diff --git a/src/components/tables/editable-table/index.module.less b/src/components/tables/editable-table/index.module.less
deleted file mode 100644
index 0af7345a4..000000000
--- a/src/components/tables/editable-table/index.module.less
+++ /dev/null
@@ -1,70 +0,0 @@
-.editableTableWrapper {
- width: 100%;
-
- tbody > tr:nth-of-type(even) {
- background-color: #ffffff;
- }
-
- .tableWrapper {
- width: 100%;
- overflow-x: auto;
- position: relative;
-
- td {
- max-width: 150px;
- text-overflow: ellipsis;
- vertical-align: middle;
-
- &.checkColumn {
- display: table-cell;
- text-align: center;
- position: sticky;
- z-index: 5;
- left: 0;
- background-color: inherit;
- min-width: auto;
- }
- &.idColumn {
- min-width: auto;
- }
-
- &:not([class]) {
- min-width: 150px;
- align-self: flex-start;
- }
- }
-
- .bulkEditRow {
- display: flex;
- flex-wrap: nowrap;
- gap: 0 30px;
- align-items: baseline;
- padding-bottom: 10px;
- }
-
- .bulkEditCol {
- min-width: 250px;
- align-self: flex-start;
- }
-
- .actionColumn {
- display: table-cell;
- padding: 0 20px;
- text-align: right;
- position: sticky;
- z-index: 5;
- right: 0;
- background-color: inherit;
-
- .editButtonWrapper {
- display: flex;
- }
-
- i {
- padding: 0 10px;
- display: inline;
- cursor: pointer;
- }
- }
- }
-}
diff --git a/src/pages/events/__tests__/summit-event-list-page.test.js b/src/pages/events/__tests__/summit-event-list-page.test.js
index e932bbb16..a9a6d8167 100644
--- a/src/pages/events/__tests__/summit-event-list-page.test.js
+++ b/src/pages/events/__tests__/summit-event-list-page.test.js
@@ -5,9 +5,9 @@ import { renderWithRedux } from "../../../utils/test-utils";
const mockEditableTableSpy = jest.fn(() => null);
jest.mock(
- "../../../components/tables/editable-table/EditableTable",
+ "../../../components/tables/BulkEditTable",
() =>
- function EditableTableMock(props) {
+ function BulkEditTableMock(props) {
mockEditableTableSpy(props);
return null;
}
diff --git a/src/pages/events/summit-event-list-page/index.js b/src/pages/events/summit-event-list-page/index.js
index 73c9a21ab..9131446f6 100644
--- a/src/pages/events/summit-event-list-page/index.js
+++ b/src/pages/events/summit-event-list-page/index.js
@@ -61,7 +61,7 @@ import {
saveFilterCriteria
} from "../../../actions/filter-criteria-actions";
import { CONTEXT_ACTIVITIES } from "../../../utils/filter-criteria-constants";
-import EditableTable from "../../../components/tables/editable-table/EditableTable";
+import BulkEditTable from "../../../components/tables/BulkEditTable";
import { buildNameIdDDL } from "../../../utils/events/summit-event-list-page.utils";
import ImportModal from "./components/ImportModal";
import ImportMUXModal from "./components/ImportMUXModal";
@@ -1405,7 +1405,7 @@ const SummitEventListPage = ({
{events.length > 0 && (