You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/10/16 02:32:34 UTC

[GitHub] [incubator-superset] etr2460 commented on a change in pull request #11289: feat: keep placeholder on multiselect

etr2460 commented on a change in pull request #11289:
URL: https://github.com/apache/incubator-superset/pull/11289#discussion_r505996296



##########
File path: superset-frontend/src/explore/components/controls/MetricsControl.jsx
##########
@@ -337,7 +337,11 @@ export default class MetricsControl extends React.PureComponent {
         <OnPasteSelect
           isMulti={this.props.multi}
           name={`select-${this.props.name}`}
-          placeholder={t('choose a column or aggregate function')}
+          placeholder={
+            this.props.multi
+              ? t('choose one or more column or aggregate function')

Review comment:
       `columns or aggregate functions`?

##########
File path: superset-frontend/src/explore/components/controls/AdhocFilterControl.jsx
##########
@@ -267,7 +267,7 @@ export default class AdhocFilterControl extends React.Component {
         <OnPasteSelect
           isMulti
           name={`select-${this.props.name}`}
-          placeholder={t('choose a column or metric')}
+          placeholder={t('choose one or more column or metric')}

Review comment:
       `columns or metrics`?

##########
File path: superset-frontend/src/components/Select/styles.tsx
##########
@@ -241,9 +242,42 @@ export const DEFAULT_STYLES: PartialStylesConfig = {
   }),
 };
 
-const { ClearIndicator, DropdownIndicator, Option } = defaultComponents;
+const multiInputStyle = css`
+  padding: 0 6px;
+  vertical-align: middle;
+`;
 
-export const DEFAULT_COMPONENTS: SelectComponentsConfig<any> = {
+type SelectComponentsType = Omit<SelectComponentsConfig<any>, 'Input'> & {
+  Input: ComponentType<InputProps>;
+};
+
+// react-select is missing selectProps from their props type
+// so overwriting it here to avoid errors
+type InputProps = {
+  selectProps: {
+    isMulti: boolean;
+    value: {
+      length: number;
+    };
+    placeholder: string;
+  };
+  cx: (a: string | null, b: any, c: string) => string | void;

Review comment:
       i'd imagine we can pull `cx`, `className`, and `getStyles`attributes form a type in emotion or the superset styled library. Any thoughts @rusackas ?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org