diff --git a/licenses.yaml b/licenses.yaml index e48dcf1fb8fc..940e7cf2a49e 100644 --- a/licenses.yaml +++ b/licenses.yaml @@ -5056,7 +5056,7 @@ license_category: binary module: web-console license_name: Apache License version 2.0 copyright: Imply Data -version: 0.21.4 +version: 0.21.9 --- diff --git a/web-console/assets/delta.png b/web-console/assets/delta.png index db535506c7b9..1dc3c072dad0 100644 Binary files a/web-console/assets/delta.png and b/web-console/assets/delta.png differ diff --git a/web-console/package-lock.json b/web-console/package-lock.json index b43bed228017..0424bc138dea 100644 --- a/web-console/package-lock.json +++ b/web-console/package-lock.json @@ -14,7 +14,7 @@ "@blueprintjs/datetime2": "^0.9.35", "@blueprintjs/icons": "^4.16.0", "@blueprintjs/popover2": "^1.14.9", - "@druid-toolkit/query": "^0.21.4", + "@druid-toolkit/query": "^0.21.9", "@druid-toolkit/visuals-core": "^0.3.3", "@druid-toolkit/visuals-react": "^0.3.3", "ace-builds": "~1.4.14", @@ -1074,9 +1074,9 @@ } }, "node_modules/@druid-toolkit/query": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@druid-toolkit/query/-/query-0.21.4.tgz", - "integrity": "sha512-rZYRrtahy68ZMp3XDWa2Z3Pa28yiQMgDVHbB7ZAqynNFbKOgqS1j08LS122CRmNrvpAUyzwCnMj3Og4BvWeq1Q==", + "version": "0.21.9", + "resolved": "https://registry.npmjs.org/@druid-toolkit/query/-/query-0.21.9.tgz", + "integrity": "sha512-g8bs9cOqyrxPzf1qdvO4FAG0rv7aBR2le+OLbF/n/KC3YXq49CUifPUYIHVfVx/jwoXKrJd1w1jVLES8OusnTg==", "dependencies": { "tslib": "^2.5.2" } @@ -20702,9 +20702,9 @@ "dev": true }, "@druid-toolkit/query": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@druid-toolkit/query/-/query-0.21.4.tgz", - "integrity": "sha512-rZYRrtahy68ZMp3XDWa2Z3Pa28yiQMgDVHbB7ZAqynNFbKOgqS1j08LS122CRmNrvpAUyzwCnMj3Og4BvWeq1Q==", + "version": "0.21.9", + "resolved": "https://registry.npmjs.org/@druid-toolkit/query/-/query-0.21.9.tgz", + "integrity": "sha512-g8bs9cOqyrxPzf1qdvO4FAG0rv7aBR2le+OLbF/n/KC3YXq49CUifPUYIHVfVx/jwoXKrJd1w1jVLES8OusnTg==", "requires": { "tslib": "^2.5.2" } diff --git a/web-console/package.json b/web-console/package.json index 230b4d8dc9f0..f885fff75017 100644 --- a/web-console/package.json +++ b/web-console/package.json @@ -68,7 +68,7 @@ "@blueprintjs/datetime2": "^0.9.35", "@blueprintjs/icons": "^4.16.0", "@blueprintjs/popover2": "^1.14.9", - "@druid-toolkit/query": "^0.21.4", + "@druid-toolkit/query": "^0.21.9", "@druid-toolkit/visuals-core": "^0.3.3", "@druid-toolkit/visuals-react": "^0.3.3", "ace-builds": "~1.4.14", diff --git a/web-console/script/create-sql-docs.js b/web-console/script/create-sql-docs.js index 794afb06e556..82328fd74b57 100755 --- a/web-console/script/create-sql-docs.js +++ b/web-console/script/create-sql-docs.js @@ -29,7 +29,15 @@ const MINIMUM_EXPECTED_NUMBER_OF_DATA_TYPES = 14; const initialFunctionDocs = { TABLE: [['external', convertMarkdownToHtml('Defines a logical table from an external.')]], EXTERN: [ - ['inputSource, inputFormat, rowSignature?', convertMarkdownToHtml('Reads external data')], + ['inputSource, inputFormat, rowSignature?', convertMarkdownToHtml('Reads external data.')], + ], + TYPE: [ + [ + 'nativeType', + convertMarkdownToHtml( + 'A purely type system modification function what wraps a Druid native type to make it into a SQL type.', + ), + ], ], }; @@ -70,7 +78,7 @@ const readDoc = async () => { await fs.readFile('../docs/querying/sql-array-functions.md', 'utf-8'), await fs.readFile('../docs/querying/sql-multivalue-string-functions.md', 'utf-8'), await fs.readFile('../docs/querying/sql-json-functions.md', 'utf-8'), - await fs.readFile('../docs/querying/sql-operators.md', 'utf-8') + await fs.readFile('../docs/querying/sql-operators.md', 'utf-8'), ].join('\n'); const lines = data.split('\n'); diff --git a/web-console/src/blueprint-overrides/_index.scss b/web-console/src/blueprint-overrides/_index.scss index faffe22bbb94..c345d815b80d 100644 --- a/web-console/src/blueprint-overrides/_index.scss +++ b/web-console/src/blueprint-overrides/_index.scss @@ -24,3 +24,4 @@ @import 'components/forms/common'; @import 'components/navbar/navbar'; @import 'components/card/card'; +@import 'special-switch-modes'; diff --git a/web-console/src/blueprint-overrides/_special-switch-modes.scss b/web-console/src/blueprint-overrides/_special-switch-modes.scss new file mode 100644 index 000000000000..267ac4a27260 --- /dev/null +++ b/web-console/src/blueprint-overrides/_special-switch-modes.scss @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.bp4-dark .bp4-switch.bp4-control { + &.legacy-switch { + input:checked ~ .bp4-control-indicator { + background: $orange5; + } + + &:hover input:checked ~ .bp4-control-indicator { + background: $orange2; + } + } + + &.danger-switch { + input:checked ~ .bp4-control-indicator { + background: $red5; + } + + &:hover input:checked ~ .bp4-control-indicator { + background: $red2; + } + } +} diff --git a/web-console/src/components/array-mode-switch/__snapshots__/array-mode-swtich.spec.tsx.snap b/web-console/src/components/array-mode-switch/__snapshots__/array-mode-swtich.spec.tsx.snap new file mode 100644 index 000000000000..88d7564823a6 --- /dev/null +++ b/web-console/src/components/array-mode-switch/__snapshots__/array-mode-swtich.spec.tsx.snap @@ -0,0 +1,47 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ArrayModeSwitch matches snapshot 1`] = ` +
+
+ + + + +
+
+`; diff --git a/web-console/src/components/array-mode-switch/array-mode-switch.tsx b/web-console/src/components/array-mode-switch/array-mode-switch.tsx new file mode 100644 index 000000000000..4d9de1274b91 --- /dev/null +++ b/web-console/src/components/array-mode-switch/array-mode-switch.tsx @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Switch } from '@blueprintjs/core'; +import React from 'react'; + +import type { ArrayMode } from '../../druid-models'; +import { getLink } from '../../links'; +import { ExternalLink } from '../external-link/external-link'; +import { FormGroupWithInfo } from '../form-group-with-info/form-group-with-info'; +import { PopoverText } from '../popover-text/popover-text'; + +export interface ArrayModeSwitchProps { + arrayMode: ArrayMode; + changeArrayMode(newArrayMode: ArrayMode): void; +} + +export const ArrayModeSwitch = React.memo(function ArrayModeSwitch(props: ArrayModeSwitchProps) { + const { arrayMode, changeArrayMode } = props; + + return ( + +

+ Store arrays as multi-value string columns instead of arrays. Note that all detected + array elements will be coerced to strings if you choose this option, and data will + behave more like a string than an array at query time. See{' '} + array docs and{' '} + + mvd docs + {' '} + for more details about the differences between arrays and multi-value strings. +

+ + } + > + changeArrayMode(arrayMode === 'arrays' ? 'multi-values' : 'arrays')} + /> +
+ ); +}); diff --git a/web-console/src/components/array-mode-switch/array-mode-swtich.spec.tsx b/web-console/src/components/array-mode-switch/array-mode-swtich.spec.tsx new file mode 100644 index 000000000000..4e738c38842b --- /dev/null +++ b/web-console/src/components/array-mode-switch/array-mode-swtich.spec.tsx @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { render } from '@testing-library/react'; +import React from 'react'; + +import { ArrayModeSwitch } from './array-mode-switch'; + +describe('ArrayModeSwitch', () => { + it('matches snapshot', () => { + const arrayInput = {}} />; + + const { container } = render(arrayInput); + expect(container.firstChild).toMatchSnapshot(); + }); +}); diff --git a/web-console/src/components/index.ts b/web-console/src/components/index.ts index a84dc063f8d3..8e43f9ec94f1 100644 --- a/web-console/src/components/index.ts +++ b/web-console/src/components/index.ts @@ -19,6 +19,7 @@ export * from './action-cell/action-cell'; export * from './action-icon/action-icon'; export * from './array-input/array-input'; +export * from './array-mode-switch/array-mode-switch'; export * from './auto-form/auto-form'; export * from './braced-text/braced-text'; export * from './center-message/center-message'; diff --git a/web-console/src/components/warning-checklist/__snapshots__/warning-checklist.spec.tsx.snap b/web-console/src/components/warning-checklist/__snapshots__/warning-checklist.spec.tsx.snap index 4112eb45841c..f3228aac108d 100644 --- a/web-console/src/components/warning-checklist/__snapshots__/warning-checklist.spec.tsx.snap +++ b/web-console/src/components/warning-checklist/__snapshots__/warning-checklist.spec.tsx.snap @@ -5,7 +5,7 @@ exports[`WarningChecklist matches snapshot 1`] = ` class="warning-checklist" >