stephenLYZ commented on code in PR #20589:
URL: https://github.com/apache/superset/pull/20589#discussion_r916588224
##########
superset-frontend/src/explore/actions/hydrateExplore.ts:
##########
@@ -67,6 +71,29 @@ export const hydrateExplore =
initialExploreState,
initialFormData,
) as ControlStateMapping;
+ const colorSchemeKey = initialControls.color_scheme && 'color_scheme';
+ const linearColorSchemeKey =
+ initialControls.linear_color_scheme && 'linear_color_scheme';
+ // if the color scheme does not exist anymore
+ // fallbacks to the available default key
+ const verifyColorScheme = (type: 'CATEGORICAL' | 'SEQUENTIAL') => {
Review Comment:
Can we use an enum type here?
```typescript
enum ColorSchemeType = {
CATEGORICAL = 'CATEGORICAL',
SEQUENTIAL = 'SEQUENTIAL'
}
```
##########
superset-frontend/src/dashboard/components/PropertiesModal/index.tsx:
##########
@@ -288,6 +293,7 @@ const PropertiesModal = ({
const onFinish = () => {
const { title, slug, certifiedBy, certificationDetails } =
form.getFieldsValue();
+ const categoricalSchemeRegistry = getCategoricalSchemeRegistry();
Review Comment:
Call the function again looks no sense 🤔
--
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]