From fe869b392b473bf11f63fb12bf1240cd5b039abe Mon Sep 17 00:00:00 2001 From: Santiago Palenque Date: Mon, 15 Jun 2026 15:43:30 -0300 Subject: [PATCH 1/6] chore: col display control base - WIP --- src/i18n/en.json | 4 + .../GridDisplayControl/GridDisplayControl.jsx | 105 ++++++++++++++++++ .../actions/display-control-actions.js | 10 ++ .../components/DisplayButton.jsx | 38 +++++++ .../hooks/useGridDisplayControl.jsx | 17 +++ .../components/GridDisplayControl/index.js | 1 + .../reducers/all-display-controls-reducer.js | 44 ++++++++ .../reducers/display-control-reducer.js | 27 +++++ .../index.js} | 4 +- 9 files changed, 247 insertions(+), 3 deletions(-) create mode 100644 src/pages/events/summit-event-list-page/components/GridDisplayControl/GridDisplayControl.jsx create mode 100644 src/pages/events/summit-event-list-page/components/GridDisplayControl/actions/display-control-actions.js create mode 100644 src/pages/events/summit-event-list-page/components/GridDisplayControl/components/DisplayButton.jsx create mode 100644 src/pages/events/summit-event-list-page/components/GridDisplayControl/hooks/useGridDisplayControl.jsx create mode 100644 src/pages/events/summit-event-list-page/components/GridDisplayControl/index.js create mode 100644 src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/all-display-controls-reducer.js create mode 100644 src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/display-control-reducer.js rename src/pages/events/{summit-event-list-page.js => summit-event-list-page/index.js} (99%) diff --git a/src/i18n/en.json b/src/i18n/en.json index eda7913d2..5bc32f8e8 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -4246,5 +4246,9 @@ "preview_modal": { "file_name": "File name", "uploaded": "Uploaded" + }, + "grid_display_control": { + "show_hide": "Show / Hide All", + "reset": "Reset" } } diff --git a/src/pages/events/summit-event-list-page/components/GridDisplayControl/GridDisplayControl.jsx b/src/pages/events/summit-event-list-page/components/GridDisplayControl/GridDisplayControl.jsx new file mode 100644 index 000000000..01869b4d4 --- /dev/null +++ b/src/pages/events/summit-event-list-page/components/GridDisplayControl/GridDisplayControl.jsx @@ -0,0 +1,105 @@ +/** + * Copyright 2026 OpenStack Foundation + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * */ + +import React, { useEffect, useMemo, useState } from "react"; +import PropTypes from "prop-types"; +import { connect } from "react-redux"; +import T from "i18n-react/dist/i18n-react"; +import { + Menu, + MenuItem, + Box, + Button, + Typography, + Checkbox +} from "@mui/material"; +import DisplayButton from "./components/DisplayButton"; +import { saveColumns } from "./actions/display-control-actions"; + + +const GridDisplayControl = ({ id, columns, selected, saveColumns }) => { + const [anchorEl, setAnchorEl] = useState(null); + const allChecked = useMemo(() => columns.every((col) => selected.find(s => s === col.key)), [columns, selected]); + const someChecked = useMemo(() => columns.some((col) => selected.find(s => s === col.key)), [columns, selected]); + + const handleClose = () => { + setAnchorEl(null); + }; + + const onReset = () => {} + + const toggleAll = () => {} + + + return ( + <> + setAnchorEl(ev.currentTarget)} + /> + + { columns.map((col) => ( + + s === col.key)} size="small" sx={{ p: 0, mr: 1 }} /> + {col.label} + + ))} + + + + + + {T.translate("grid_display_control.show_hide")} + + + + + + + ); +}; + +GridDisplayControl.propTypes = { + id: PropTypes.string.isRequired, + columns: PropTypes.arrayOf( + PropTypes.shape({ + key: PropTypes.string.isRequired, + label: PropTypes.string.isRequired + }) + ).isRequired, + selected: PropTypes.arrayOf(PropTypes.string).isRequired, + saveColumns: PropTypes.func.isRequired, +}; + +export default connect(null, { saveColumns })(GridDisplayControl); diff --git a/src/pages/events/summit-event-list-page/components/GridDisplayControl/actions/display-control-actions.js b/src/pages/events/summit-event-list-page/components/GridDisplayControl/actions/display-control-actions.js new file mode 100644 index 000000000..77a4c18e2 --- /dev/null +++ b/src/pages/events/summit-event-list-page/components/GridDisplayControl/actions/display-control-actions.js @@ -0,0 +1,10 @@ +// import { createAction } from "../../../../utils/actions"; +import { createAction } from "openstack-uicore-foundation/lib/utils/actions"; + +export const SAVE_COLUMNS = "SAVE_COLUMNS"; + +export const saveColumns = + (id, selectedColumns = []) => + (dispatch) => { + dispatch(createAction(SAVE_COLUMNS)({ id, selectedColumns })); + }; diff --git a/src/pages/events/summit-event-list-page/components/GridDisplayControl/components/DisplayButton.jsx b/src/pages/events/summit-event-list-page/components/GridDisplayControl/components/DisplayButton.jsx new file mode 100644 index 000000000..357df4b07 --- /dev/null +++ b/src/pages/events/summit-event-list-page/components/GridDisplayControl/components/DisplayButton.jsx @@ -0,0 +1,38 @@ +/** + * Copyright 2026 OpenStack Foundation + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * */ + +import React from "react"; +import PropTypes from "prop-types"; +import { Badge, IconButton } from "@mui/material"; +import VisibilityIcon from "@mui/icons-material/Visibility"; +import T from "i18n-react/dist/i18n-react"; + +const DisplayButton = ({ showDot, onClick }) => ( + + + + + +); + +DisplayButton.propTypes = { + showDot: PropTypes.bool.isRequired, + onClick: PropTypes.func.isRequired +}; + +export default DisplayButton; diff --git a/src/pages/events/summit-event-list-page/components/GridDisplayControl/hooks/useGridDisplayControl.jsx b/src/pages/events/summit-event-list-page/components/GridDisplayControl/hooks/useGridDisplayControl.jsx new file mode 100644 index 000000000..fa888ae40 --- /dev/null +++ b/src/pages/events/summit-event-list-page/components/GridDisplayControl/hooks/useGridDisplayControl.jsx @@ -0,0 +1,17 @@ +import { useSelector } from "react-redux"; + +const useGridDisplayControl = (id) => { + const allControls = useSelector( + (state) => state.allGridDisplayControlsState?.allControls ?? [] + ); + const control = allControls.find((c) => c.id === id) || {}; + const { + selectedColumns = [], + } = control; + + return { + selectedColumns + }; +}; + +export default useGridDisplayControl; diff --git a/src/pages/events/summit-event-list-page/components/GridDisplayControl/index.js b/src/pages/events/summit-event-list-page/components/GridDisplayControl/index.js new file mode 100644 index 000000000..1b4d28f78 --- /dev/null +++ b/src/pages/events/summit-event-list-page/components/GridDisplayControl/index.js @@ -0,0 +1 @@ +export { default as GridDisplayControl } from "./GridDisplayControl"; diff --git a/src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/all-display-controls-reducer.js b/src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/all-display-controls-reducer.js new file mode 100644 index 000000000..222c5fb90 --- /dev/null +++ b/src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/all-display-controls-reducer.js @@ -0,0 +1,44 @@ +// import { LOGOUT_USER } from "../../../security/actions"; +import { LOGOUT_USER } from "openstack-uicore-foundation/lib/security/actions"; +import displayControlReducer from "./display-control-reducer"; +import { SAVE_COLUMNS } from "../actions/display-control-actions"; + +const DEFAULT_STATE = { + allControls: [] +}; + +const allDisplayControlsReducer = (state = DEFAULT_STATE, action) => { + const { type, payload } = action; + + switch (type) { + case LOGOUT_USER: + return DEFAULT_STATE; + + case SAVE_COLUMNS: { + const { id } = payload; + const { allControls } = state; + const controlExists = allControls.find((c) => c.id === id); + let newControls; + + if (controlExists) { + newControls = allControls.map((f) => { + if (f.id === id) { + return displayControlReducer(f, { ...action, type: `DISCTRL_${type}` }); + } + return f; + }); + } else { + newControls = [ + ...allControls, + displayControlReducer(null, { ...action, type: `DISCTRL_${type}` }) + ]; + } + + return { ...state, allControls: newControls }; + } + default: + return state; + } +}; + +export default allDisplayControlsReducer; diff --git a/src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/display-control-reducer.js b/src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/display-control-reducer.js new file mode 100644 index 000000000..1f0536125 --- /dev/null +++ b/src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/display-control-reducer.js @@ -0,0 +1,27 @@ +import { SAVE_COLUMNS } from "../actions/display-control-actions"; + +const INITIAL_STATE = { + id: null, + selectedColumns: [], +}; + +const displayControlReducer = (state = INITIAL_STATE, action) => { + const { type, payload } = action; + + switch (type) { + case `DISCTRL_${SAVE_COLUMNS}`: { + const { id, columns } = payload; + const safeColumns = Array.isArray(columns) ? columns : []; + + return { + ...state, + id, + selectedColumns: safeColumns, + }; + } + default: + return state; + } +}; + +export default displayControlReducer; diff --git a/src/pages/events/summit-event-list-page.js b/src/pages/events/summit-event-list-page/index.js similarity index 99% rename from src/pages/events/summit-event-list-page.js rename to src/pages/events/summit-event-list-page/index.js index 058754b88..b435c366b 100644 --- a/src/pages/events/summit-event-list-page.js +++ b/src/pages/events/summit-event-list-page/index.js @@ -79,7 +79,7 @@ const fieldNames = ( customStyle: { minWidth: "350px" }, editableField: (extraProps) => { const useSpeakers = extraProps.row.type?.use_speakers; - return useSpeakers ? ( + return useSpeakers && ( - ) : ( - false ); } }, From 4865507cfc893cf3f368a02e1fb596782129a2a9 Mon Sep 17 00:00:00 2001 From: Santiago Palenque Date: Tue, 16 Jun 2026 16:59:26 -0300 Subject: [PATCH 2/6] chore: refactor event list --- .../filters/select-filter-criteria/index.js | 23 +- .../select-filter-criteria/index.module.less | 3 - src/i18n/en.json | 4 - .../GridDisplayControl/GridDisplayControl.jsx | 105 - .../actions/display-control-actions.js | 10 - .../components/DisplayButton.jsx | 38 - .../hooks/useGridDisplayControl.jsx | 17 - .../components/GridDisplayControl/index.js | 1 - .../reducers/all-display-controls-reducer.js | 44 - .../reducers/display-control-reducer.js | 27 - .../components/ImportMUXModal/index.jsx | 102 + .../components/ImportModal/index.jsx | 92 + .../events/summit-event-list-page/index.js | 2716 ++++++----------- 13 files changed, 1218 insertions(+), 1964 deletions(-) delete mode 100644 src/components/filters/select-filter-criteria/index.module.less delete mode 100644 src/pages/events/summit-event-list-page/components/GridDisplayControl/GridDisplayControl.jsx delete mode 100644 src/pages/events/summit-event-list-page/components/GridDisplayControl/actions/display-control-actions.js delete mode 100644 src/pages/events/summit-event-list-page/components/GridDisplayControl/components/DisplayButton.jsx delete mode 100644 src/pages/events/summit-event-list-page/components/GridDisplayControl/hooks/useGridDisplayControl.jsx delete mode 100644 src/pages/events/summit-event-list-page/components/GridDisplayControl/index.js delete mode 100644 src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/all-display-controls-reducer.js delete mode 100644 src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/display-control-reducer.js create mode 100644 src/pages/events/summit-event-list-page/components/ImportMUXModal/index.jsx create mode 100644 src/pages/events/summit-event-list-page/components/ImportModal/index.jsx diff --git a/src/components/filters/select-filter-criteria/index.js b/src/components/filters/select-filter-criteria/index.js index 06c7c4a04..f4d8c9420 100644 --- a/src/components/filters/select-filter-criteria/index.js +++ b/src/components/filters/select-filter-criteria/index.js @@ -1,4 +1,4 @@ -/** +/* * * Copyright 2019 OpenStack Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -9,15 +9,13 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - **/ + * */ import React, { useEffect, useState } from "react"; import PropTypes from "prop-types"; import T from "i18n-react/dist/i18n-react"; import Swal from "sweetalert2"; import AsyncSelect from "react-select/lib/Async"; - -import styles from "./index.module.less"; import { queryFilterCriterias } from "../../../actions/filter-criteria-actions"; const SelectFilterCriteria = ({ @@ -30,7 +28,6 @@ const SelectFilterCriteria = ({ }) => { const [selectedFilter, setSelectedFilter] = useState(null); const [defaultOptions, setDefaultOptions] = useState([]); - const [isLoading, setIsLoading] = useState(false); useEffect(() => { if (!selectedFilterCriteria) setSelectedFilter(null); @@ -44,9 +41,9 @@ const SelectFilterCriteria = ({ const handleFilterDelete = () => { Swal.fire({ title: T.translate("general.are_you_sure"), - text: - T.translate("select_filter_criteria.remove_filter_criteria_warning") + - `"${selectedFilter.label}"`, + text: `${T.translate( + "select_filter_criteria.remove_filter_criteria_warning" + )}"${selectedFilter.label}"`, type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", @@ -59,7 +56,6 @@ const SelectFilterCriteria = ({ }; const getCriterias = (input, callback) => { - setIsLoading(true); // we need to map into value/label because of a bug in react-select 2 // https://github.com/JedWatson/react-select/issues/2998 @@ -69,7 +65,6 @@ const SelectFilterCriteria = ({ label: c.name, ...c })); - setIsLoading(false); callback(newOptions); }; @@ -88,18 +83,18 @@ const SelectFilterCriteria = ({ }; return ( -
+
diff --git a/src/components/filters/select-filter-criteria/index.module.less b/src/components/filters/select-filter-criteria/index.module.less deleted file mode 100644 index c9a629fe6..000000000 --- a/src/components/filters/select-filter-criteria/index.module.less +++ /dev/null @@ -1,3 +0,0 @@ -.selectFilterWrapper { - margin-bottom: 20px; -} diff --git a/src/i18n/en.json b/src/i18n/en.json index 5bc32f8e8..eda7913d2 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -4246,9 +4246,5 @@ "preview_modal": { "file_name": "File name", "uploaded": "Uploaded" - }, - "grid_display_control": { - "show_hide": "Show / Hide All", - "reset": "Reset" } } diff --git a/src/pages/events/summit-event-list-page/components/GridDisplayControl/GridDisplayControl.jsx b/src/pages/events/summit-event-list-page/components/GridDisplayControl/GridDisplayControl.jsx deleted file mode 100644 index 01869b4d4..000000000 --- a/src/pages/events/summit-event-list-page/components/GridDisplayControl/GridDisplayControl.jsx +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Copyright 2026 OpenStack Foundation - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * */ - -import React, { useEffect, useMemo, useState } from "react"; -import PropTypes from "prop-types"; -import { connect } from "react-redux"; -import T from "i18n-react/dist/i18n-react"; -import { - Menu, - MenuItem, - Box, - Button, - Typography, - Checkbox -} from "@mui/material"; -import DisplayButton from "./components/DisplayButton"; -import { saveColumns } from "./actions/display-control-actions"; - - -const GridDisplayControl = ({ id, columns, selected, saveColumns }) => { - const [anchorEl, setAnchorEl] = useState(null); - const allChecked = useMemo(() => columns.every((col) => selected.find(s => s === col.key)), [columns, selected]); - const someChecked = useMemo(() => columns.some((col) => selected.find(s => s === col.key)), [columns, selected]); - - const handleClose = () => { - setAnchorEl(null); - }; - - const onReset = () => {} - - const toggleAll = () => {} - - - return ( - <> - setAnchorEl(ev.currentTarget)} - /> - - { columns.map((col) => ( - - s === col.key)} size="small" sx={{ p: 0, mr: 1 }} /> - {col.label} - - ))} - - - - - - {T.translate("grid_display_control.show_hide")} - - - - - - - ); -}; - -GridDisplayControl.propTypes = { - id: PropTypes.string.isRequired, - columns: PropTypes.arrayOf( - PropTypes.shape({ - key: PropTypes.string.isRequired, - label: PropTypes.string.isRequired - }) - ).isRequired, - selected: PropTypes.arrayOf(PropTypes.string).isRequired, - saveColumns: PropTypes.func.isRequired, -}; - -export default connect(null, { saveColumns })(GridDisplayControl); diff --git a/src/pages/events/summit-event-list-page/components/GridDisplayControl/actions/display-control-actions.js b/src/pages/events/summit-event-list-page/components/GridDisplayControl/actions/display-control-actions.js deleted file mode 100644 index 77a4c18e2..000000000 --- a/src/pages/events/summit-event-list-page/components/GridDisplayControl/actions/display-control-actions.js +++ /dev/null @@ -1,10 +0,0 @@ -// import { createAction } from "../../../../utils/actions"; -import { createAction } from "openstack-uicore-foundation/lib/utils/actions"; - -export const SAVE_COLUMNS = "SAVE_COLUMNS"; - -export const saveColumns = - (id, selectedColumns = []) => - (dispatch) => { - dispatch(createAction(SAVE_COLUMNS)({ id, selectedColumns })); - }; diff --git a/src/pages/events/summit-event-list-page/components/GridDisplayControl/components/DisplayButton.jsx b/src/pages/events/summit-event-list-page/components/GridDisplayControl/components/DisplayButton.jsx deleted file mode 100644 index 357df4b07..000000000 --- a/src/pages/events/summit-event-list-page/components/GridDisplayControl/components/DisplayButton.jsx +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright 2026 OpenStack Foundation - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * */ - -import React from "react"; -import PropTypes from "prop-types"; -import { Badge, IconButton } from "@mui/material"; -import VisibilityIcon from "@mui/icons-material/Visibility"; -import T from "i18n-react/dist/i18n-react"; - -const DisplayButton = ({ showDot, onClick }) => ( - - - - - -); - -DisplayButton.propTypes = { - showDot: PropTypes.bool.isRequired, - onClick: PropTypes.func.isRequired -}; - -export default DisplayButton; diff --git a/src/pages/events/summit-event-list-page/components/GridDisplayControl/hooks/useGridDisplayControl.jsx b/src/pages/events/summit-event-list-page/components/GridDisplayControl/hooks/useGridDisplayControl.jsx deleted file mode 100644 index fa888ae40..000000000 --- a/src/pages/events/summit-event-list-page/components/GridDisplayControl/hooks/useGridDisplayControl.jsx +++ /dev/null @@ -1,17 +0,0 @@ -import { useSelector } from "react-redux"; - -const useGridDisplayControl = (id) => { - const allControls = useSelector( - (state) => state.allGridDisplayControlsState?.allControls ?? [] - ); - const control = allControls.find((c) => c.id === id) || {}; - const { - selectedColumns = [], - } = control; - - return { - selectedColumns - }; -}; - -export default useGridDisplayControl; diff --git a/src/pages/events/summit-event-list-page/components/GridDisplayControl/index.js b/src/pages/events/summit-event-list-page/components/GridDisplayControl/index.js deleted file mode 100644 index 1b4d28f78..000000000 --- a/src/pages/events/summit-event-list-page/components/GridDisplayControl/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default as GridDisplayControl } from "./GridDisplayControl"; diff --git a/src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/all-display-controls-reducer.js b/src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/all-display-controls-reducer.js deleted file mode 100644 index 222c5fb90..000000000 --- a/src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/all-display-controls-reducer.js +++ /dev/null @@ -1,44 +0,0 @@ -// import { LOGOUT_USER } from "../../../security/actions"; -import { LOGOUT_USER } from "openstack-uicore-foundation/lib/security/actions"; -import displayControlReducer from "./display-control-reducer"; -import { SAVE_COLUMNS } from "../actions/display-control-actions"; - -const DEFAULT_STATE = { - allControls: [] -}; - -const allDisplayControlsReducer = (state = DEFAULT_STATE, action) => { - const { type, payload } = action; - - switch (type) { - case LOGOUT_USER: - return DEFAULT_STATE; - - case SAVE_COLUMNS: { - const { id } = payload; - const { allControls } = state; - const controlExists = allControls.find((c) => c.id === id); - let newControls; - - if (controlExists) { - newControls = allControls.map((f) => { - if (f.id === id) { - return displayControlReducer(f, { ...action, type: `DISCTRL_${type}` }); - } - return f; - }); - } else { - newControls = [ - ...allControls, - displayControlReducer(null, { ...action, type: `DISCTRL_${type}` }) - ]; - } - - return { ...state, allControls: newControls }; - } - default: - return state; - } -}; - -export default allDisplayControlsReducer; diff --git a/src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/display-control-reducer.js b/src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/display-control-reducer.js deleted file mode 100644 index 1f0536125..000000000 --- a/src/pages/events/summit-event-list-page/components/GridDisplayControl/reducers/display-control-reducer.js +++ /dev/null @@ -1,27 +0,0 @@ -import { SAVE_COLUMNS } from "../actions/display-control-actions"; - -const INITIAL_STATE = { - id: null, - selectedColumns: [], -}; - -const displayControlReducer = (state = INITIAL_STATE, action) => { - const { type, payload } = action; - - switch (type) { - case `DISCTRL_${SAVE_COLUMNS}`: { - const { id, columns } = payload; - const safeColumns = Array.isArray(columns) ? columns : []; - - return { - ...state, - id, - selectedColumns: safeColumns, - }; - } - default: - return state; - } -}; - -export default displayControlReducer; diff --git a/src/pages/events/summit-event-list-page/components/ImportMUXModal/index.jsx b/src/pages/events/summit-event-list-page/components/ImportMUXModal/index.jsx new file mode 100644 index 000000000..6ab2af527 --- /dev/null +++ b/src/pages/events/summit-event-list-page/components/ImportMUXModal/index.jsx @@ -0,0 +1,102 @@ +import React, { useState } from "react"; +import { Modal } from "react-bootstrap"; +import T from "i18n-react"; +import { Input } from "@mui/material"; + +const ImportMUXModal = ({ show, onClose, onImport }) => { + const [tokenId, setTokenId] = useState(""); + const [tokenSecret, setTokenSecret] = useState(""); + const [emailTo, setEmailTo] = useState(""); + + const handleClose = () => { + setTokenId(""); + setTokenSecret(""); + setEmailTo(""); + onClose(); + }; + + const handleImport = (ev) => { + ev.preventDefault(); + onImport(tokenId, tokenSecret, emailTo).then(() => { + handleClose(); + }); + }; + + return ( + + + {T.translate("event_list.mux_import")} + + +
+
+ +   +