michael-s-molina commented on code in PR #21560:
URL: https://github.com/apache/superset/pull/21560#discussion_r978119311
##########
superset-frontend/src/explore/components/ExploreChartHeader/index.jsx:
##########
@@ -75,51 +77,51 @@ export const ExploreChartHeader = ({
sliceName,
onSaveChart,
saveDisabled,
+ metadata,
}) => {
const { latestQueryFormData, sliceFormData } = chart;
const [isPropertiesModalOpen, setIsPropertiesModalOpen] = useState(false);
- const fetchChartDashboardData = async () => {
- await SupersetClient.get({
- endpoint: `/api/v1/chart/${slice.slice_id}`,
- })
- .then(res => {
- const response = res?.json?.result;
- if (response && response.dashboards && response.dashboards.length) {
- const { dashboards } = response;
- const dashboard =
- dashboardId &&
- dashboards.length &&
- dashboards.find(d => d.id === dashboardId);
-
- if (dashboard && dashboard.json_metadata) {
- // setting the chart to use the dashboard custom label colors if
any
- const metadata = JSON.parse(dashboard.json_metadata);
- const sharedLabelColors = metadata.shared_label_colors || {};
- const customLabelColors = metadata.label_colors || {};
- const mergedLabelColors = {
- ...sharedLabelColors,
- ...customLabelColors,
- };
-
- const categoricalNamespace =
- CategoricalColorNamespace.getNamespace();
-
- Object.keys(mergedLabelColors).forEach(label => {
- categoricalNamespace.setColor(
- label,
- mergedLabelColors[label],
- metadata.color_scheme,
- );
- });
- }
- }
- })
- .catch(() => {});
+ const updateCategoricalNamespace = async () => {
Review Comment:
@geido Can you please check if I didn't break anything here?
--
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]