From 6238f21558bd7dac3755f6026edb2b0581f32d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Castillo?= Date: Thu, 3 Sep 2026 12:34:37 -0300 Subject: [PATCH 1/4] fix: add new is_public checkbox on sponsorship popup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Castillo --- src/i18n/en.json | 1 + src/pages/sponsors/popup/edit-tier-popup.js | 23 ++++++++++++++++++- .../sponsors/summit-sponsorship-reducer.js | 1 + 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/i18n/en.json b/src/i18n/en.json index c3c0e36b2..c01abeafd 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -3125,6 +3125,7 @@ "sponsor_page_use_banner_widget": "Display Banner Widget on Sponsor Page", "should_display_on_expo_hall_page": "Display on Expo Hall Page", "should_display_on_lobby_page": "Display on Lobby Page", + "is_public": "Is Public", "badge_image": "Badge Image", "badge_alt": "Badge Alt Text", "save": "Save", diff --git a/src/pages/sponsors/popup/edit-tier-popup.js b/src/pages/sponsors/popup/edit-tier-popup.js index 2d6800952..0c9461fb4 100644 --- a/src/pages/sponsors/popup/edit-tier-popup.js +++ b/src/pages/sponsors/popup/edit-tier-popup.js @@ -68,7 +68,8 @@ const EditTierDialog = ({ sponsor_page_use_live_event_widget: yup.bool( T.translate("validation.boolean") ), - should_display_on_lobby_page: yup.bool(T.translate("validation.boolean")) + should_display_on_lobby_page: yup.bool(T.translate("validation.boolean")), + is_public: yup.bool(T.translate("validation.boolean")) }), onSubmit: (values) => { if (isSaving) return; @@ -487,6 +488,26 @@ const EditTierDialog = ({ /> + + + + + {initialEntity.id > 0 && ( <> diff --git a/src/reducers/sponsors/summit-sponsorship-reducer.js b/src/reducers/sponsors/summit-sponsorship-reducer.js index 06a11271e..f7cec5b64 100644 --- a/src/reducers/sponsors/summit-sponsorship-reducer.js +++ b/src/reducers/sponsors/summit-sponsorship-reducer.js @@ -43,6 +43,7 @@ export const DEFAULT_ENTITY = { sponsor_page_use_banner_widget: false, should_display_on_expo_hall_page: false, should_display_on_lobby_page: false, + is_public: true, type: null, badge_image: "", badge_image_alt_text: "" From 889cc5a68a45e203e0eedf2ded1b0749a28f0d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Castillo?= Date: Thu, 3 Sep 2026 13:11:39 -0300 Subject: [PATCH 2/4] fix: keep missing is_public as true, remove dead component and route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Castillo --- .../forms/summit-sponsorship-form.js | 418 ------------------ src/layouts/summit-sponsorship-layout.js | 59 +-- .../sponsors/edit-summit-sponsorship-page.js | 110 ----- .../sponsors/summit-sponsorship-reducer.js | 3 + 4 files changed, 23 insertions(+), 567 deletions(-) delete mode 100644 src/components/forms/summit-sponsorship-form.js delete mode 100644 src/pages/sponsors/edit-summit-sponsorship-page.js diff --git a/src/components/forms/summit-sponsorship-form.js b/src/components/forms/summit-sponsorship-form.js deleted file mode 100644 index 31b7b3cdd..000000000 --- a/src/components/forms/summit-sponsorship-form.js +++ /dev/null @@ -1,418 +0,0 @@ -/** - * 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. - * 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 T from "i18n-react/dist/i18n-react"; -import "awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css"; -import Input from "openstack-uicore-foundation/lib/components/inputs/text-input" -import Dropdown from "openstack-uicore-foundation/lib/components/inputs/dropdown" -import UploadInput from "openstack-uicore-foundation/lib/components/inputs/upload-input"; -import { isEmpty, scrollToError, shallowEqual } from "../../utils/methods"; -import SponsorshipTypeInput from "../inputs/sponsorship-input"; - -class SummitSponsorshipForm extends React.Component { - constructor(props) { - super(props); - - this.state = { - entity: { ...props.entity }, - errors: props.errors - }; - - this.handleChange = this.handleChange.bind(this); - this.handleSubmit = this.handleSubmit.bind(this); - this.handleUploadBadgeImage = this.handleUploadBadgeImage.bind(this); - this.handleRemoveBadgeImage = this.handleRemoveBadgeImage.bind(this); - } - - componentDidUpdate(prevProps, prevState, snapshot) { - const state = {}; - scrollToError(this.props.errors); - - if (!shallowEqual(prevProps.entity, this.props.entity)) { - state.entity = { ...this.props.entity }; - state.errors = {}; - } - - if (!shallowEqual(prevProps.errors, this.props.errors)) { - state.errors = { ...this.props.errors }; - } - - if (!isEmpty(state)) { - this.setState({ ...this.state, ...state }); - } - } - - handleChange(ev) { - let entity = { ...this.state.entity }; - let errors = { ...this.state.errors }; - let { value, id } = ev.target; - - if (ev.target.type === "checkbox") { - value = ev.target.checked; - } - - if (ev.target.type === "datetime") { - value = value.valueOf() / 1000; - } - - errors[id] = ""; - entity[id] = value; - this.setState({ entity: entity, errors: errors }); - } - - handleSubmit(ev) { - let entity = { ...this.state.entity }; - ev.preventDefault(); - - this.props.onSubmit(this.state.entity); - } - - hasErrors(field) { - let { errors } = this.state; - if (field in errors) { - return errors[field]; - } - - return ""; - } - - handleUploadBadgeImage(file) { - const formData = new FormData(); - formData.append("file", file); - this.props.onBadgeImageAttach(this.state.entity, formData); - } - - handleRemoveBadgeImage() { - const entity = { ...this.state.entity }; - entity["badge_image"] = ""; - this.setState({ entity: entity }); - this.props.onBadgeImageRemove(entity.id); - } - - render() { - const { entity } = this.state; - const { sponsorships } = this.props; - - const sponsorship_ddl = sponsorships.map((s) => ({ - label: s.name, - value: s.id - })); - - const lobby_template_ddl = [ - { label: "Big Images", value: "big-images" }, - { label: "Small Images", value: "small-images" }, - { label: "Horizontal Images", value: "horizontal-images" }, - { label: "Carousel", value: "carousel" } - ]; - - const expo_hall_template_ddl = [ - { label: "Big Images", value: "big-images" }, - { label: "Medium Images", value: "medium-images" }, - { label: "Small Images", value: "small-images" } - ]; - - const sponsor_page_template_ddl = [ - { label: "Big Header", value: "big-header" }, - { label: "Small Header", value: "small-header" } - ]; - - const event_page_template_ddl = [ - { label: "Big Images", value: "big-images" }, - { label: "Small Images", value: "small-images" }, - { label: "Horizontal Images", value: "horizontal-images" } - ]; - - return ( -
- -
-
- - -
-
- -
-
- - -
-
- -
-
- - -
-
- - -
-
-
-
- - -
-
- -
-
- -
-
-
- - -
-
-
-
- - -
-
-
- -
-
-
- - -
-
-
-
- - -
-
-
- -
-
-
- - -
-
-
-
- - -
-
-
- - {entity.id !== 0 && ( - <> -
-
- - -
-
- -
-
- - -
-
- - )} - -
-
- -
-
-
- ); - } -} - -export default SummitSponsorshipForm; diff --git a/src/layouts/summit-sponsorship-layout.js b/src/layouts/summit-sponsorship-layout.js index 3562cfe62..0b9e59873 100644 --- a/src/layouts/summit-sponsorship-layout.js +++ b/src/layouts/summit-sponsorship-layout.js @@ -9,7 +9,7 @@ * 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 { Switch, Route, withRouter } from "react-router-dom"; @@ -18,45 +18,26 @@ import { Breadcrumb } from "react-breadcrumbs"; import Restrict from "../routes/restrict"; import SummitSponsorshipListPage from "../pages/sponsors/summit-sponsorship-list-page"; -import EditSummitSponsorshipPage from "../pages/sponsors/edit-summit-sponsorship-page"; import NoMatchPage from "../pages/no-match-page"; -class SummitSponsorshipLayout extends React.Component { - render() { - const { match } = this.props; - return ( -
- - - - - - - - -
- ); - } -} +const SummitSponsorshipLayout = ({ match }) => ( +
+ + + + + +
+); export default Restrict(withRouter(SummitSponsorshipLayout), "sponsors"); diff --git a/src/pages/sponsors/edit-summit-sponsorship-page.js b/src/pages/sponsors/edit-summit-sponsorship-page.js deleted file mode 100644 index 5e055519c..000000000 --- a/src/pages/sponsors/edit-summit-sponsorship-page.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright 2018 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 { connect } from "react-redux"; -import { Breadcrumb } from "react-breadcrumbs"; -import T from "i18n-react/dist/i18n-react"; -import SummitSponsorshipForm from "../../components/forms/summit-sponsorship-form"; -import { - getSummitSponsorship, - resetSummitSponsorshipForm, - saveSummitSponsorship, - uploadSponsorshipBadgeImage, - removeSponsorshipBadgeImage -} from "../../actions/sponsor-actions"; -import AddNewButton from "../../components/buttons/add-new-button"; - -class EditSummitSponsorshipPage extends React.Component { - constructor(props) { - const sponsorshipId = props.match.params.sponsorship_type_id; - super(props); - - if (!sponsorshipId) { - props.resetSummitSponsorshipForm(); - } else { - props.getSummitSponsorship(sponsorshipId); - } - } - - componentDidUpdate(prevProps, prevState, snapshot) { - const oldId = prevProps.match.params.sponsorship_type_id; - const newId = this.props.match.params.sponsorship_type_id; - - if (newId !== oldId) { - if (!newId) { - this.props.resetSummitSponsorshipForm(); - } else { - this.props.getSummitSponsorship(newId); - } - } - } - - render() { - const { - currentSummit, - entity, - errors, - match, - sponsorships, - uploadSponsorshipBadgeImage, - removeSponsorshipBadgeImage - } = this.props; - const title = entity.id - ? T.translate("general.edit") - : T.translate("general.add"); - const breadcrumb = entity.id - ? entity.type.name - : T.translate("general.new"); - - return ( -
- -

- {title} {T.translate("edit_summit_sponsorship.sponsorship")} - -

-
- {currentSummit && ( - - )} -
- ); - } -} - -const mapStateToProps = ({ - currentSummitState, - currentSummitSponsorshipState, - currentSponsorshipListState -}) => ({ - currentSummit: currentSummitState.currentSummit, - sponsorships: currentSponsorshipListState.sponsorships, - ...currentSummitSponsorshipState -}); - -export default connect(mapStateToProps, { - getSummitSponsorship, - resetSummitSponsorshipForm, - saveSummitSponsorship, - uploadSponsorshipBadgeImage, - removeSponsorshipBadgeImage -})(EditSummitSponsorshipPage); diff --git a/src/reducers/sponsors/summit-sponsorship-reducer.js b/src/reducers/sponsors/summit-sponsorship-reducer.js index f7cec5b64..a6c83b2e7 100644 --- a/src/reducers/sponsors/summit-sponsorship-reducer.js +++ b/src/reducers/sponsors/summit-sponsorship-reducer.js @@ -80,6 +80,9 @@ const summitSponsorshipReducer = (state = DEFAULT_STATE, action) => { } } + // keep is_public as true when is missing + entity.is_public = entity.is_public === "" ? true : !!entity.is_public; + return { ...state, entity: { ...DEFAULT_ENTITY, ...entity } }; } case SUMMIT_SPONSORSHIP_UPDATED: From cf1f53f7fcf439d280aa204ec1b5c6bad15c6330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Castillo?= Date: Thu, 3 Sep 2026 13:28:28 -0300 Subject: [PATCH 3/4] fix: simplify receive sponsorship MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Castillo --- src/reducers/sponsors/summit-sponsorship-reducer.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/reducers/sponsors/summit-sponsorship-reducer.js b/src/reducers/sponsors/summit-sponsorship-reducer.js index a6c83b2e7..f7cec5b64 100644 --- a/src/reducers/sponsors/summit-sponsorship-reducer.js +++ b/src/reducers/sponsors/summit-sponsorship-reducer.js @@ -80,9 +80,6 @@ const summitSponsorshipReducer = (state = DEFAULT_STATE, action) => { } } - // keep is_public as true when is missing - entity.is_public = entity.is_public === "" ? true : !!entity.is_public; - return { ...state, entity: { ...DEFAULT_ENTITY, ...entity } }; } case SUMMIT_SPONSORSHIP_UPDATED: From 6e6ad48ea30fb3a4c37e5650b8ad536f29fe7736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Castillo?= Date: Thu, 3 Sep 2026 13:49:22 -0300 Subject: [PATCH 4/4] fix: adjust missing is_public value on reducer, set to false MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Castillo --- src/reducers/sponsors/summit-sponsorship-reducer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/reducers/sponsors/summit-sponsorship-reducer.js b/src/reducers/sponsors/summit-sponsorship-reducer.js index f7cec5b64..a983af65d 100644 --- a/src/reducers/sponsors/summit-sponsorship-reducer.js +++ b/src/reducers/sponsors/summit-sponsorship-reducer.js @@ -79,6 +79,7 @@ const summitSponsorshipReducer = (state = DEFAULT_STATE, action) => { entity[key] = entity[key] == null ? "" : entity[key]; } } + entity.is_public = !!entity.is_public; return { ...state, entity: { ...DEFAULT_ENTITY, ...entity } }; }