lilykuang commented on a change in pull request #13145:
URL: https://github.com/apache/superset/pull/13145#discussion_r578795167
##########
File path: superset-frontend/src/dashboard/components/PropertiesModal.jsx
##########
@@ -276,12 +304,109 @@ class PropertiesModal extends React.PureComponent {
jsonMetadata: result.json_metadata,
ownerIds: result.owners,
colorScheme: metadataColorScheme || colorScheme,
+ ...moreResultProps,
});
this.props.onHide();
}, handleErrorResponse);
}
}
+ getRowsWithoutRoles() {
+ const { values, isDashboardLoaded } = this.state;
+ return (
+ <Row>
+ <Col md={6}>
+ <h3 style={{ marginTop: '1em' }}>{t('Access')}</h3>
+ <FormLabel htmlFor="owners">{t('Owners')}</FormLabel>
+ <AsyncSelect
+ name="owners"
+ isMulti
+ value={values.owners}
+ loadOptions={loadAccessOptions('owners')}
+ defaultOptions // load options on render
+ cacheOptions
+ onChange={this.onOwnersChange}
+ disabled={!isDashboardLoaded}
+ filterOption={null} // options are filtered at the api
+ />
+ <p className="help-block">
+ {t(
+ 'Owners is a list of users who can alter the dashboard.
Searchable by name or username.',
+ )}
+ </p>
+ </Col>
+ <Col md={6}>
+ <h3 style={{ marginTop: '1em' }}>{t('Colors')}</h3>
+ <ColorSchemeControlWrapper
+ onChange={this.onColorSchemeChange}
+ colorScheme={values.colorScheme}
+ />
+ </Col>
+ </Row>
+ );
+ }
+
+ getRowsWithRoles() {
Review comment:
`getRowsWithoutRoles ` and `getRowsWithRoles ` are very similar. Maybe
the two functions could combine into one and use `DASHBOARD_RBAC` feature flag
to determine `AsyncSelect` with role show or hidden.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]