diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl.jsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl.jsx index bad9bbacceb56c998c843fc69eb096173ef73487..2f8366be814c29fe1c47d670f66e7b8b60a7cf93 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl.jsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl.jsx @@ -96,11 +96,13 @@ class AdhocFilterControl extends React.Component { onRemoveFilter={() => this.onRemoveFilter(index)} onMoveLabel={this.moveLabel} onDropLabel={() => this.props.onChange(this.state.values)} + partitionColumn={this.state.partitionColumn} /> ); this.state = { values: filters, options: this.optionsForSelect(this.props), + partitionColumn: null, }; } @@ -128,18 +130,7 @@ class AdhocFilterControl extends React.Component { partitions.cols && Object.keys(partitions.cols).length === 1 ) { - const partitionColumn = partitions.cols[0]; - this.valueRenderer = (adhocFilter, index) => ( - this.onRemoveFilter(index)} - key={index} - /> - ); + this.setState({ partitionColumn: partitions.cols[0] }); } } }) @@ -323,6 +314,7 @@ class AdhocFilterControl extends React.Component { datasource={this.props.datasource} options={this.state.options} onFilterEdit={this.onNewFilter} + partitionColumn={this.state.partitionColumn} createNew > {trigger} diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx index df79f576ce6dd9027002284e1afc0c418f5a037f..06643699d5b51bc0ff99285fdaf787a329b542a1 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx @@ -304,7 +304,11 @@ export default class AdhocFilterEditPopoverSimpleTabContent extends React.Compon } const operatorSelectProps = { - placeholder: t('%s operators(s)', OPERATORS_OPTIONS.length), + placeholder: t( + '%s operator(s)', + OPERATORS_OPTIONS.filter(op => this.isOperatorRelevant(op, subject)) + .length, + ), // like AGGREGTES_OPTIONS, operator options are string value: operator, onChange: this.onOperatorChange, diff --git a/superset/translations/de/LC_MESSAGES/messages.json b/superset/translations/de/LC_MESSAGES/messages.json index 72de85be7761b02b201d6e6e83d7195ad76f61e5..fda247c2f9c84b5ceb95554ef82e22d8bfc49266 100644 --- a/superset/translations/de/LC_MESSAGES/messages.json +++ b/superset/translations/de/LC_MESSAGES/messages.json @@ -1706,7 +1706,7 @@ "%s column(s) and metric(s)": [""], "%s column(s)": ["Spalten auflisten"], "To filter on a metric, use Custom SQL tab.": [""], - "%s operators(s)": [""], + "%s operator(s)": [""], "Type a value here": [""], "Filter value (case sensitive)": [""], "choose WHERE or HAVING...": [""], diff --git a/superset/translations/de/LC_MESSAGES/messages.po b/superset/translations/de/LC_MESSAGES/messages.po index 8cd006f2cd94416cd55a19f7619fb08a6e1356ce..9eaa43d8cafc6beaef40af6ea1d5462976af306b 100644 --- a/superset/translations/de/LC_MESSAGES/messages.po +++ b/superset/translations/de/LC_MESSAGES/messages.po @@ -6082,7 +6082,7 @@ msgstr "" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:307 #, python-format -msgid "%s operators(s)" +msgid "%s operator(s)" msgstr "" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:326 diff --git a/superset/translations/en/LC_MESSAGES/messages.json b/superset/translations/en/LC_MESSAGES/messages.json index 28521e4d97f714132dfc68c46b0edf8ada9cdae9..2c6dfa3de8989a34758bff19d73d30aff8974592 100644 --- a/superset/translations/en/LC_MESSAGES/messages.json +++ b/superset/translations/en/LC_MESSAGES/messages.json @@ -1616,7 +1616,7 @@ "%s column(s) and metric(s)": [""], "%s column(s)": [""], "To filter on a metric, use Custom SQL tab.": [""], - "%s operators(s)": [""], + "%s operator(s)": [""], "Type a value here": [""], "Filter value (case sensitive)": [""], "choose WHERE or HAVING...": [""], diff --git a/superset/translations/en/LC_MESSAGES/messages.po b/superset/translations/en/LC_MESSAGES/messages.po index 86c784cdb7028d6909b419f669eab5e113b16a00..5237f0507b7128e2a8b63dd84d702e3462cbc066 100644 --- a/superset/translations/en/LC_MESSAGES/messages.po +++ b/superset/translations/en/LC_MESSAGES/messages.po @@ -6081,7 +6081,7 @@ msgstr "" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:307 #, python-format -msgid "%s operators(s)" +msgid "%s operator(s)" msgstr "" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:326 diff --git a/superset/translations/es/LC_MESSAGES/messages.json b/superset/translations/es/LC_MESSAGES/messages.json index 7ad0696a40468297b11779e3a9848483b0994ccd..3789e444858d960c3b0661536586a92b485a9066 100644 --- a/superset/translations/es/LC_MESSAGES/messages.json +++ b/superset/translations/es/LC_MESSAGES/messages.json @@ -1835,7 +1835,7 @@ "%s column(s) and metric(s)": [""], "%s column(s)": [""], "To filter on a metric, use Custom SQL tab.": [""], - "%s operators(s)": [""], + "%s operator(s)": [""], "Type a value here": [""], "Filter value (case sensitive)": [""], "choose WHERE or HAVING...": [""], diff --git a/superset/translations/es/LC_MESSAGES/messages.po b/superset/translations/es/LC_MESSAGES/messages.po index c916cc55ddcdf5968ddadb7be24ddbeb17b3f16f..9d9a94e8f6dd027db37c6efbed9f1801177fc090 100644 --- a/superset/translations/es/LC_MESSAGES/messages.po +++ b/superset/translations/es/LC_MESSAGES/messages.po @@ -6154,7 +6154,7 @@ msgstr "" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:307 #, python-format -msgid "%s operators(s)" +msgid "%s operator(s)" msgstr "" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:326 diff --git a/superset/translations/fr/LC_MESSAGES/messages.json b/superset/translations/fr/LC_MESSAGES/messages.json index 151f527b764ce11e0fc9e29e93ba5dc56de877c7..1756548a9abdb8aacde6c4f203cfe2c192b16d07 100644 --- a/superset/translations/fr/LC_MESSAGES/messages.json +++ b/superset/translations/fr/LC_MESSAGES/messages.json @@ -1955,7 +1955,7 @@ "To filter on a metric, use Custom SQL tab.": [ "À filtrer sur une métrique, utiliser l'onglet Custom SQL." ], - "%s operators(s)": ["%s opérateur(s)"], + "%s operator(s)": ["%s opérateur(s)"], "Type a value here": ["Saisir une valeur ici"], "Filter value (case sensitive)": [""], "choose WHERE or HAVING...": ["Choisir WHERE or HAVING..."], diff --git a/superset/translations/fr/LC_MESSAGES/messages.po b/superset/translations/fr/LC_MESSAGES/messages.po index 660cceb3c13c3911d7beb16229b42c864aa013fd..2f1f84e6ffee7a16c8e642f301f82a9d552ffa68 100644 --- a/superset/translations/fr/LC_MESSAGES/messages.po +++ b/superset/translations/fr/LC_MESSAGES/messages.po @@ -6228,7 +6228,7 @@ msgstr "À filtrer sur une métrique, utiliser l'onglet Custom SQL." #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:307 #, python-format -msgid "%s operators(s)" +msgid "%s operator(s)" msgstr "%s opérateur(s)" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:326 diff --git a/superset/translations/it/LC_MESSAGES/messages.json b/superset/translations/it/LC_MESSAGES/messages.json index da4561b43f0a6ec935c4e701c8cc004317c5ce06..025b06f977f3ed954d6f0edb1cbdd3775f5c6ff8 100644 --- a/superset/translations/it/LC_MESSAGES/messages.json +++ b/superset/translations/it/LC_MESSAGES/messages.json @@ -1727,7 +1727,7 @@ "%s column(s) and metric(s)": [""], "%s column(s)": ["Visualizza colonne"], "To filter on a metric, use Custom SQL tab.": [""], - "%s operators(s)": ["Seleziona operatore"], + "%s operator(s)": ["Seleziona operatore"], "Type a value here": [""], "Filter value (case sensitive)": [""], "choose WHERE or HAVING...": [""], diff --git a/superset/translations/it/LC_MESSAGES/messages.po b/superset/translations/it/LC_MESSAGES/messages.po index 1157574f3c50ec1d1108d4bd89585a733013ce2b..9a9cbac6c7862cb350aec4bfdc785bfa931743ac 100644 --- a/superset/translations/it/LC_MESSAGES/messages.po +++ b/superset/translations/it/LC_MESSAGES/messages.po @@ -6126,7 +6126,7 @@ msgstr "" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:307 #, python-format -msgid "%s operators(s)" +msgid "%s operator(s)" msgstr "Seleziona operatore" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:326 diff --git a/superset/translations/ja/LC_MESSAGES/messages.json b/superset/translations/ja/LC_MESSAGES/messages.json index 7f7284faa0a751b74417e0de81f0b6a1733485c4..35ffaac1c13be5e15926f252861a06f27d02433e 100644 --- a/superset/translations/ja/LC_MESSAGES/messages.json +++ b/superset/translations/ja/LC_MESSAGES/messages.json @@ -1643,7 +1643,7 @@ "%s column(s) and metric(s)": [""], "%s column(s)": [""], "To filter on a metric, use Custom SQL tab.": [""], - "%s operators(s)": ["オペレータを選択"], + "%s operator(s)": ["オペレータを選択"], "Type a value here": [""], "Filter value (case sensitive)": [""], "choose WHERE or HAVING...": [""], diff --git a/superset/translations/ja/LC_MESSAGES/messages.po b/superset/translations/ja/LC_MESSAGES/messages.po index 089826c792da68080c2f591f61ab520c495277d3..48a9a708531d5a19825bfeea5cbb165ab697d17b 100644 --- a/superset/translations/ja/LC_MESSAGES/messages.po +++ b/superset/translations/ja/LC_MESSAGES/messages.po @@ -6072,7 +6072,7 @@ msgstr "" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:307 #, python-format -msgid "%s operators(s)" +msgid "%s operator(s)" msgstr "オペレータを選択" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:326 diff --git a/superset/translations/ko/LC_MESSAGES/messages.json b/superset/translations/ko/LC_MESSAGES/messages.json index f756a7472cedb5eb8ba253a8647016c62e9d7cc4..03ebcdc97459fe205b0fb320f0fe78b30c44f738 100644 --- a/superset/translations/ko/LC_MESSAGES/messages.json +++ b/superset/translations/ko/LC_MESSAGES/messages.json @@ -1617,7 +1617,7 @@ "%s column(s) and metric(s)": [""], "%s column(s)": [""], "To filter on a metric, use Custom SQL tab.": [""], - "%s operators(s)": [""], + "%s operator(s)": [""], "Type a value here": [""], "Filter value (case sensitive)": [""], "choose WHERE or HAVING...": [""], diff --git a/superset/translations/ko/LC_MESSAGES/messages.po b/superset/translations/ko/LC_MESSAGES/messages.po index 7168410c21a29eb7507eb87f9049316b846bf288..befed3124c251390c28722367b1d7eea3fcdbc13 100644 --- a/superset/translations/ko/LC_MESSAGES/messages.po +++ b/superset/translations/ko/LC_MESSAGES/messages.po @@ -6072,7 +6072,7 @@ msgstr "" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:307 #, python-format -msgid "%s operators(s)" +msgid "%s operator(s)" msgstr "" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:326 diff --git a/superset/translations/messages.pot b/superset/translations/messages.pot index 4fd8fd09e188a732b77a4d878b811a59c56c96f3..d2ad8639ee8d4149f426daa4a17c78cbe8abdcbd 100644 --- a/superset/translations/messages.pot +++ b/superset/translations/messages.pot @@ -6081,7 +6081,7 @@ msgstr "" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:307 #, python-format -msgid "%s operators(s)" +msgid "%s operator(s)" msgstr "" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:326 diff --git a/superset/translations/pt/LC_MESSAGES/message.json b/superset/translations/pt/LC_MESSAGES/message.json index dd45b3e9582dada222113e0015474b2754eb7864..4ac7dd8411971180b5dbe613f1ca9333d0027015 100644 --- a/superset/translations/pt/LC_MESSAGES/message.json +++ b/superset/translations/pt/LC_MESSAGES/message.json @@ -1724,7 +1724,7 @@ "%s column(s) and metric(s)": [""], "%s column(s)": ["Lista de Colunas"], "To filter on a metric, use Custom SQL tab.": [""], - "%s operators(s)": ["Selecione operador"], + "%s operator(s)": ["Selecione operador"], "type a value here": [""], "Filter value (case sensitive)": [""], "choose WHERE or HAVING...": [""], diff --git a/superset/translations/pt/LC_MESSAGES/message.po b/superset/translations/pt/LC_MESSAGES/message.po index 6ceaeaf93daf11df123874b1e3a66e6c202d1d67..c05e5ceb10a5bba20aa8b02ac5e2e46f29087766 100644 --- a/superset/translations/pt/LC_MESSAGES/message.po +++ b/superset/translations/pt/LC_MESSAGES/message.po @@ -5723,7 +5723,7 @@ msgstr "" #: superset-frontend/src/explore/components/AdhocFilterEditPopoverSimpleTabContent.jsx:307 #, python-format -msgid "%s operators(s)" +msgid "%s operator(s)" msgstr "Selecione operador" #: superset-frontend/src/explore/components/AdhocFilterEditPopoverSimpleTabContent.jsx:326 diff --git a/superset/translations/pt_BR/LC_MESSAGES/messages.json b/superset/translations/pt_BR/LC_MESSAGES/messages.json index 669f13bae685f667050ad5b2521f6077d34d5f49..c492e211a6bd8c05e54cf6a645aed45113215c14 100644 --- a/superset/translations/pt_BR/LC_MESSAGES/messages.json +++ b/superset/translations/pt_BR/LC_MESSAGES/messages.json @@ -2244,7 +2244,7 @@ "To filter on a metric, use Custom SQL tab.": [ "Para filtrar uma métrica, use a aba SQL personalizado." ], - "%s operators(s)": ["%s operador(es)"], + "%s operator(s)": ["%s operador(es)"], "Type a value here": ["digite um valor aqui"], "Filter value (case sensitive)": [ "Filtrar valor (sensível a maiúscula/minúscula)" diff --git a/superset/translations/pt_BR/LC_MESSAGES/messages.po b/superset/translations/pt_BR/LC_MESSAGES/messages.po index 2a89d39ea1099db4355506c357ab6092ef328342..223c8a0051bc6a5e78b3ee21e26ea09bd9769640 100644 --- a/superset/translations/pt_BR/LC_MESSAGES/messages.po +++ b/superset/translations/pt_BR/LC_MESSAGES/messages.po @@ -6489,7 +6489,7 @@ msgstr "Para filtrar uma métrica, use a aba SQL personalizado." #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:307 #, python-format -msgid "%s operators(s)" +msgid "%s operator(s)" msgstr "%s operador(es)" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:326 diff --git a/superset/translations/ru/LC_MESSAGES/messages.json b/superset/translations/ru/LC_MESSAGES/messages.json index e3464512a2be38f369c5a3b478d1d1ebfc78804b..bd3938dd5c80a7948f0fcdac19ead9a3216eb535 100644 --- a/superset/translations/ru/LC_MESSAGES/messages.json +++ b/superset/translations/ru/LC_MESSAGES/messages.json @@ -1839,7 +1839,7 @@ "%s column(s) and metric(s)": [""], "%s column(s)": ["Список столбцов"], "To filter on a metric, use Custom SQL tab.": [""], - "%s operators(s)": ["%s параметр(ы)"], + "%s operator(s)": ["%s параметр(ы)"], "Type a value here": [""], "Filter value (case sensitive)": [""], "choose WHERE or HAVING...": [""], diff --git a/superset/translations/ru/LC_MESSAGES/messages.po b/superset/translations/ru/LC_MESSAGES/messages.po index 273175665e0396a1d6efc75e7ce68c8cfccca920..f726c40b9709f8780d0abea6fd2400ff9b841b37 100644 --- a/superset/translations/ru/LC_MESSAGES/messages.po +++ b/superset/translations/ru/LC_MESSAGES/messages.po @@ -6170,7 +6170,7 @@ msgstr "" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:307 #, python-format -msgid "%s operators(s)" +msgid "%s operator(s)" msgstr "%s параметр(ы)" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:326 diff --git a/superset/translations/zh/LC_MESSAGES/messages.json b/superset/translations/zh/LC_MESSAGES/messages.json index 231643fc817f7c54004c067409a992c33633e5ef..5b0edc0aeb13f71a09a8cbcb60f4a72823975db6 100644 --- a/superset/translations/zh/LC_MESSAGES/messages.json +++ b/superset/translations/zh/LC_MESSAGES/messages.json @@ -1731,7 +1731,7 @@ "To filter on a metric, use Custom SQL tab.": [ "若要在计量值上筛选,请使用自定义SQL选项卡。" ], - "%s operators(s)": ["%s 运算符"], + "%s operator(s)": ["%s 运算符"], "Type a value here": ["在这里键入一个值"], "Filter value (case sensitive)": [""], "choose WHERE or HAVING...": ["选择WHERE或HAVING子句..."], diff --git a/superset/translations/zh/LC_MESSAGES/messages.po b/superset/translations/zh/LC_MESSAGES/messages.po index 02f864f37aef4416c5d6a46b3de3e8e19530c34e..f431964912304440f3c1672773ae313fd9f2abe2 100644 --- a/superset/translations/zh/LC_MESSAGES/messages.po +++ b/superset/translations/zh/LC_MESSAGES/messages.po @@ -6134,7 +6134,7 @@ msgstr "若要在计量值上筛选,请使用自定义SQL选项卡。" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:307 #, python-format -msgid "%s operators(s)" +msgid "%s operator(s)" msgstr "%s 运算符" #: superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent.jsx:326