From 8083abd46c66c7a3a039de11b1d6bb3e45747def Mon Sep 17 00:00:00 2001 From: Santi Date: Fri, 27 Feb 2026 12:08:48 -0300 Subject: [PATCH 1/6] adding header Added licensing information and copyright notice to the file. Signed-off-by: Santi --- .../add-sponsor-page-template-popup/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/pages/sponsors/sponsor-pages-tab/components/add-sponsor-page-template-popup/index.js b/src/pages/sponsors/sponsor-pages-tab/components/add-sponsor-page-template-popup/index.js index f9ac1046a..80ae664f6 100644 --- a/src/pages/sponsors/sponsor-pages-tab/components/add-sponsor-page-template-popup/index.js +++ b/src/pages/sponsors/sponsor-pages-tab/components/add-sponsor-page-template-popup/index.js @@ -1,3 +1,16 @@ +/** + * 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, useState } from "react"; import T from "i18n-react/dist/i18n-react"; import { connect } from "react-redux"; From 12d4de153bdb229df793b525fc3102f3b2566d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Castillo?= Date: Thu, 26 Feb 2026 15:20:23 -0300 Subject: [PATCH 2/6] feat: wip add sponsor custom page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Castillo --- src/actions/sponsor-pages-actions.js | 34 ++++++++++- src/components/mui/dropdown-checkbox.js | 2 +- .../page-template-popup/index.js | 37 ++++++++---- src/pages/sponsors/sponsor-pages-tab/index.js | 58 ++++++++++++++++--- .../sponsor-page-pages-list-reducer.js | 35 +++++++++++ src/utils/constants.js | 4 ++ 6 files changed, 148 insertions(+), 22 deletions(-) diff --git a/src/actions/sponsor-pages-actions.js b/src/actions/sponsor-pages-actions.js index 13667ace3..2d79416e3 100644 --- a/src/actions/sponsor-pages-actions.js +++ b/src/actions/sponsor-pages-actions.js @@ -39,6 +39,7 @@ export const REQUEST_SPONSOR_CUSTOMIZED_PAGES = "REQUEST_SPONSOR_CUSTOMIZED_PAGES"; export const RECEIVE_SPONSOR_CUSTOMIZED_PAGES = "RECEIVE_SPONSOR_CUSTOMIZED_PAGES"; +export const SPONSOR_CUSTOMIZED_PAGE_ADDED = "SPONSOR_CUSTOMIZED_PAGE_ADDED"; export const cloneGlobalPage = (pagesIds, sponsorIds, allSponsors) => async (dispatch, getState) => { @@ -151,7 +152,7 @@ export const saveSponsorManagedPage = dispatch(startLoading()); - const normalizedEntity = normalizeSponsorManagedPage(entity); + const normalizedEntity = normalizeSponsorPage(entity); const params = { access_token: accessToken, @@ -169,7 +170,7 @@ export const saveSponsorManagedPage = }); }; -const normalizeSponsorManagedPage = (entity) => { +const normalizeSponsorPage = (entity) => { const normalizedEntity = { show_page_ids: entity.pages, allowed_add_ons: entity.add_ons.map((a) => a.id), @@ -242,3 +243,32 @@ export const getSponsorCustomizedPages = dispatch(stopLoading()); }); }; + +export const saveSponsorCustomizedPage = + (entity) => async (dispatch, getState) => { + const { currentSummitState, currentSponsorState } = getState(); + const { currentSummit } = currentSummitState; + const { + entity: { id: sponsorId } + } = currentSponsorState; + const accessToken = await getAccessTokenSafely(); + + dispatch(startLoading()); + + const normalizedEntity = normalizeSponsorPage(entity); + + const params = { + access_token: accessToken, + fields: "id,code,name,kind,modules_count,allowed_add_ons" + }; + + return postRequest( + null, + createAction(SPONSOR_CUSTOMIZED_PAGE_ADDED), + `${window.SPONSOR_PAGES_API_URL}/api/v1/summits/${currentSummit.id}/sponsors/${sponsorId}/sponsor-pages`, + normalizedEntity, + snackbarErrorHandler + )(params)(dispatch).then(() => { + dispatch(stopLoading()); + }); + }; diff --git a/src/components/mui/dropdown-checkbox.js b/src/components/mui/dropdown-checkbox.js index 00b6ff461..2f7fdc1ae 100644 --- a/src/components/mui/dropdown-checkbox.js +++ b/src/components/mui/dropdown-checkbox.js @@ -38,7 +38,7 @@ const DropdownCheckbox = ({ }; return ( - + {label}