yousoph commented on code in PR #42404: URL: https://github.com/apache/superset/pull/42404#discussion_r3827081742
########## UPDATING.md: ########## @@ -24,6 +24,35 @@ assists people when migrating to a new version. ## Next +### Themes support per-theme editors + +Themes now carry a list of **editors** (users, roles, or groups). A new +`theme_editors` junction table is created by the migration +`f7e8d9c0b1a2_add_theme_editors_table`. On upgrade, each existing non-system +theme's creator is backfilled as an editor so authors keep edit access (an +empty editors list means admin-only). System themes are left with no editors Review Comment: Fixed — the migration does backfill each existing non-system theme's creator as an editor (added after review feedback). Updated the PR description to match `UPDATING.md`; both now describe the creator backfill (system/null-creator themes stay admin-only). ########## superset/migrations/versions/2026-07-24_00-00_f7e8d9c0b1a2_add_theme_editors_table.py: ########## @@ -0,0 +1,142 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +"""add theme_editors table + +Revision ID: f7e8d9c0b1a2 +Revises: e5f6a7b8c9d0 +Create Date: 2026-07-24 00:00:00.000000 Review Comment: Fixed in 00d5d7e — updated the `Revises:` header to match `down_revision = "1072de5ed955"` (it had drifted when the migration was rebased onto the current head). ########## superset-frontend/src/features/themes/ThemeModal.tsx: ########## @@ -139,13 +160,41 @@ const ThemeModal: FunctionComponent<ThemeModalProps> = ({ const supersetTheme = useTheme(); const { setTemporaryTheme } = useThemeContext(); const [disableSave, setDisableSave] = useState<boolean>(true); - const [currentTheme, setCurrentTheme] = useState<ThemeObject | null>(null); - const [initialTheme, setInitialTheme] = useState<ThemeObject | null>(null); + const [currentTheme, setCurrentTheme] = useState<ThemeModalObject | null>( + null, + ); + const [initialTheme, setInitialTheme] = useState<ThemeModalObject | null>( + null, + ); const [isHidden, setIsHidden] = useState<boolean>(true); const [showConfirmAlert, setShowConfirmAlert] = useState<boolean>(false); const isEditMode = theme !== null; const isSystemTheme = currentTheme?.is_system === true; - const isReadOnly = isSystemTheme; + + const currentUser = useSelector<any, UserWithPermissionsAndRoles>( + state => state.user, + ); Review Comment: Kept as-is intentionally: this matches the established pattern for the current-user selector in the sibling list pages this code mirrors — `ChartList` and `DashboardList` both use `useSelector<any, UserWithPermissionsAndRoles>(state => state.user)`. Switching only these files to a different typing would diverge from the surrounding convention; happy to follow up separately if the team wants to retype these selectors repo-wide. ########## superset-frontend/src/pages/ThemeList/index.tsx: ########## @@ -113,6 +117,9 @@ function ThemesList({ refreshData, toggleBulkSelect, } = useListViewResource<ThemeObject>('theme', t('Themes'), addDangerToast); + const currentUser = useSelector<any, UserWithPermissionsAndRoles>( + state => state.user, + ); Review Comment: Same as the ThemeModal thread — matches the existing `ChartList`/`DashboardList` convention for the user selector; leaving consistent with surrounding code. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
