From 2c7e77b124c675e62d96a6ff585d4040a12b87c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Bedi?= Date: Fri, 12 Aug 2022 09:36:13 +0200 Subject: [PATCH] Revert SQL data sources migration for 9.1 (#53510) * Revert "Core code editor/builder components (#52421)" This reverts commit de956fc3d8956fc663807c120097f0b010de0bdc. * Revert "Chore: typos in MySQL/PostgreSQL ConfigurationEditor (#52735)" This reverts commit 7eabd7c83a4e594b07e4d822fcea6acf410a66c5. * Revert "mysql query editor - angular to react (#50343)" This reverts commit 53933972b6602d5f5294f51d13a669c0aa759242. * Revert "MSSQL: Migrate to React (#51765)" This reverts commit 35d98104ad4ea4fed2f8c2a9a56d476ea9616fee. * Revert "SQL: Migrate (MS/My/Postgres)SQL configuration pages from Angular to React (#51891)" This reverts commit 9498ee3d541f5bf3901fbc2adbcc16a437b02b33. * Revert "SQL: Fix couple of issues in SQLDatasource (#52080)" This reverts commit 4155dc8ecaf0f9704615df3987a648cd7f3d6831. * Revert "sql plugins - angular to react - base sql datasource (#51655)" This reverts commit fa560d96b6768596d430f3f1d5ed966b06452237. * These changes are okay * These should also be fine + betterer update * Change these back --- .betterer.results | 211 ++++- package.json | 4 +- .../QueryEditor/AccessoryButton.tsx | 23 - .../components/QueryEditor/EditorField.tsx | 79 -- .../QueryEditor/EditorFieldGroup.tsx | 9 - .../components/QueryEditor/EditorHeader.tsx | 25 - .../src/components/QueryEditor/EditorList.tsx | 49 - .../src/components/QueryEditor/EditorRow.tsx | 30 - .../src/components/QueryEditor/EditorRows.tsx | 13 - .../components/QueryEditor/EditorSwitch.tsx | 25 - .../src/components/QueryEditor/FlexItem.tsx | 10 - .../components/QueryEditor/InlineSelect.tsx | 89 -- .../src/components/QueryEditor/InputGroup.tsx | 54 -- .../src/components/QueryEditor/Space.tsx | 40 - .../src/components/QueryEditor/Stack.tsx | 30 - .../src/components/QueryEditor/index.ts | 13 - packages/grafana-ui/src/components/index.ts | 1 - .../alerting/unified/AlertsFolderView.tsx | 3 +- .../components/alert-groups/MatcherFilter.tsx | 3 +- .../components/rule-editor/DetailsStep.tsx | 3 +- .../rule-editor/rule-types/RuleTypePicker.tsx | 3 +- .../unified/components/rules/RulesFilter.tsx | 3 +- .../unified/components/rules/StateHistory.tsx | 3 +- .../components/silences/SilencesFilter.tsx | 3 +- .../components/silences/SilencesTable.tsx | 3 +- .../SaveDashboard/forms/SaveDashboardForm.tsx | 3 +- .../forms/SaveProvisionedDashboardForm.tsx | 3 +- .../SaveDashboard/forms/SaveToStorageForm.tsx | 2 +- .../features/expressions/components/Math.tsx | 3 +- .../app/features/inspector/QueryInspector.tsx | 3 +- public/app/features/org/UserInviteForm.tsx | 14 +- .../plugins/sql/components/ConfirmModal.tsx | 51 - .../sql/components/DatasetSelector.tsx | 61 -- .../plugins/sql/components/ErrorBoundary.tsx | 25 - .../plugins/sql/components/QueryEditor.tsx | 119 --- .../plugins/sql/components/QueryHeader.tsx | 257 ----- .../plugins/sql/components/TableSelector.tsx | 39 - .../configuration/ConnectionLimits.tsx | 75 -- .../configuration/TLSSecretsConfig.tsx | 77 -- .../features/plugins/sql/components/index.ts | 2 - .../query-editor-raw/QueryEditorRaw.tsx | 47 - .../query-editor-raw/QueryToolbox.tsx | 91 -- .../query-editor-raw/QueryValidator.tsx | 110 --- .../sql/components/query-editor-raw/README.md | 135 --- .../components/query-editor-raw/RawEditor.tsx | 121 --- .../components/query-editor-raw/SQLEditor.tsx | 405 -------- .../sql/components/query-editor-raw/index.ts | 1 - .../AwesomeQueryBuilder.tsx | 259 ------ .../visual-query-builder/GroupByRow.tsx | 58 -- .../visual-query-builder/OrderByRow.tsx | 91 -- .../visual-query-builder/Preview.tsx | 46 - .../visual-query-builder/SQLGroupByRow.tsx | 22 - .../visual-query-builder/SQLOrderByRow.tsx | 42 - .../visual-query-builder/SQLSelectRow.tsx | 28 - .../visual-query-builder/SQLWhereRow.tsx | 51 - .../visual-query-builder/SelectRow.tsx | 141 --- .../visual-query-builder/VisualEditor.tsx | 68 -- .../visual-query-builder/WhereRow.tsx | 92 -- .../components/visual-query-builder/index.ts | 1 - public/app/features/plugins/sql/constants.ts | 128 --- .../plugins/sql/datasource/SqlDatasource.ts | 210 ----- public/app/features/plugins/sql/defaults.ts | 28 - .../app/features/plugins/sql/expressions.ts | 66 -- public/app/features/plugins/sql/index.ts | 22 - .../app/features/plugins/sql/mocks/Monaco.ts | 26 - .../features/plugins/sql/mocks/TextModel.ts | 21 - .../sql/mocks/queries/multiLineFullQuery.ts | 214 ----- .../multiLineFullQueryWithAggregation.ts | 229 ----- .../mocks/queries/multiLineMultipleColumns.ts | 269 ------ .../sql/mocks/queries/singleLineEmptyQuery.ts | 6 - .../sql/mocks/queries/singleLineFullQuery.ts | 196 ---- .../singleLineFullQueryWithAggregation.ts | 209 ----- .../queries/singleLineMultipleColumns.ts | 250 ----- .../sql/mocks/queries/singleLineTwoQueries.ts | 385 -------- .../singleLineTwoQueriesWithAggregation.ts | 415 --------- .../features/plugins/sql/mocks/testData.ts | 9 - .../plugins/sql/standardSql/definition.ts | 24 - .../getStandardSuggestions.test.ts | 273 ------ .../sql/standardSql/getStandardSuggestions.ts | 34 - .../standardSql/getStatementPosition.test.ts | 184 ---- .../sql/standardSql/getStatementPosition.ts | 31 - .../plugins/sql/standardSql/language.ts | 880 ------------------ .../plugins/sql/standardSql/macros.ts | 67 -- .../standardSuggestionsRegistry.ts | 425 --------- .../statementPositionResolversRegistry.ts | 244 ----- .../standardSql/suggestionsKindRegistry.ts | 146 --- .../features/plugins/sql/standardSql/types.ts | 52 -- .../features/plugins/sql/test-utils/index.ts | 11 - .../sql/test-utils/statementPosition.ts | 63 -- .../plugins/sql/test-utils/testQueries.txt | 21 - .../features/plugins/sql/test-utils/types.ts | 11 - public/app/features/plugins/sql/types.ts | 430 --------- .../features/plugins/sql/utils/LinkedToken.ts | 176 ---- .../features/plugins/sql/utils/commands.ts | 4 - .../features/plugins/sql/utils/debugger.ts | 12 - .../features/plugins/sql/utils/formatSQL.ts | 8 - .../sql/utils/getSuggestionKind.test.ts | 31 - .../plugins/sql/utils/getSuggestionKind.ts | 22 - .../sql/utils/linkedTokenBuilder.test.ts | 72 -- .../plugins/sql/utils/linkedTokenBuilder.ts | 56 -- .../features/plugins/sql/utils/sql.utils.ts | 105 --- .../plugins/sql/utils/toCompletionItem.ts | 19 - .../features/plugins/sql/utils/tokenUtils.ts | 57 -- .../app/features/plugins/sql/utils/types.ts | 14 - .../plugins/sql/utils/useSqlChange.ts | 25 - public/app/features/scenes/SceneListPage.tsx | 3 +- .../scenes/components/NestedScene.tsx | 3 +- .../LabelsToFieldsTransformerEditor.tsx | 3 +- public/app/features/variables/utils.ts | 6 +- .../components/AnnotationQueryEditor.tsx | 3 +- .../components/Experimental/Aggregation.tsx | 3 +- .../components/Experimental/AliasBy.tsx | 3 +- .../components/Experimental/Alignment.tsx | 2 +- .../components/Experimental/GraphPeriod.tsx | 3 +- .../components/Experimental/GroupBy.tsx | 3 +- .../components/Experimental/LabelFilter.tsx | 3 +- .../Experimental/MetricQueryEditor.tsx | 2 +- .../components/Experimental/Metrics.tsx | 3 +- .../components/Experimental/Preprocessor.tsx | 3 +- .../components/Experimental/Project.tsx | 3 +- .../components/Experimental/QueryHeader.tsx | 3 +- .../components/Experimental/SLO.tsx | 3 +- .../Experimental/SLOQueryEditor.tsx | 2 +- .../components/Experimental/Selector.tsx | 3 +- .../components/Experimental/Service.tsx | 3 +- .../Experimental/VisualMetricQueryEditor.tsx | 2 +- .../components/QueryEditor.tsx | 3 +- .../components/AnnotationQueryEditor.tsx | 3 +- .../components/Dimensions/Dimensions.tsx | 2 +- .../components/Dimensions/FilterItem.tsx | 3 +- .../MetricStatEditor/MetricStatEditor.tsx | 3 +- .../MetricsQueryEditor/MetricsQueryEditor.tsx | 3 +- .../MetricsQueryEditor/MetricsQueryHeader.tsx | 3 +- .../cloudwatch/components/QueryHeader.tsx | 2 +- .../SQLBuilderEditor/SQLBuilderEditor.tsx | 3 +- .../SQLBuilderEditor/SQLBuilderSelectRow.tsx | 3 +- .../components/SQLBuilderEditor/SQLFilter.tsx | 3 +- .../SQLBuilderEditor/SQLGroupBy.tsx | 3 +- .../SQLBuilderEditor/SQLOrderByGroup.tsx | 3 +- .../VariableQueryEditor/MultiFilter.tsx | 2 +- .../VariableQueryEditor/MultiFilterItem.tsx | 3 +- .../CompletionItemProvider.test.ts | 2 +- .../QueryEditor/AnnotationQueryEditor.tsx | 3 +- .../ArgQueryEditor/ArgQueryEditor.tsx | 2 +- .../components/Field.tsx | 3 +- .../LogsQueryEditor/LogsQueryEditor.tsx | 3 +- .../MetricsQueryEditor/DimensionFields.tsx | 3 +- .../MetricsQueryEditor/MetricsQueryEditor.tsx | 2 +- .../components/QueryHeader.tsx | 2 +- .../components/AnnotationsQueryEditor.tsx | 3 +- .../components/LokiQueryBuilder.tsx | 2 +- .../components/LokiQueryBuilderExplained.tsx | 2 +- .../components/LokiQueryBuilderOptions.tsx | 3 +- .../components/LokiQueryEditorSelector.tsx | 3 +- .../querybuilder/components/NestedQuery.tsx | 3 +- .../components/NestedQueryList.tsx | 2 +- .../querybuilder/components/QueryPreview.tsx | 2 +- .../datasource/mssql/MSSqlMetaQuery.ts | 15 - .../datasource/mssql/MSSqlQueryModel.ts | 25 - .../plugins/datasource/mssql/config_ctrl.ts | 47 + .../configuration/ConfigurationEditor.tsx | 262 ------ .../plugins/datasource/mssql/datasource.ts | 269 ++++-- public/app/plugins/datasource/mssql/module.ts | 37 +- .../datasource/mssql/partials/config.html | 161 ++++ .../mssql/partials/query.editor.html | 90 ++ .../plugins/datasource/mssql/query_ctrl.ts | 65 ++ .../datasource/mssql/response_parser.ts | 53 +- .../mssql/{ => specs}/datasource.test.ts | 125 ++- .../datasource/mssql/sqlCompletionProvider.ts | 137 --- .../app/plugins/datasource/mssql/sqlUtil.ts | 131 --- public/app/plugins/datasource/mssql/types.ts | 29 +- .../datasource/mysql/MySqlDatasource.ts | 117 --- .../datasource/mysql/MySqlQueryModel.ts | 61 -- .../datasource/mysql/MySqlResponseParser.ts | 27 - .../configuration/ConfigurationEditor.tsx | 181 ---- .../plugins/datasource/mysql/datasource.ts | 212 +++++ public/app/plugins/datasource/mysql/fields.ts | 91 -- .../app/plugins/datasource/mysql/functions.ts | 20 - .../plugins/datasource/mysql/meta_query.ts | 142 +++ public/app/plugins/datasource/mysql/module.ts | 63 +- .../datasource/mysql/mySqlMetaQuery.ts | 60 -- .../datasource/mysql/mysql_query_model.ts | 236 +++++ .../mysql/partials/annotations.editor.html | 54 ++ .../datasource/mysql/partials/config.html | 132 +++ .../mysql/partials/query.editor.html | 190 ++++ .../plugins/datasource/mysql/query_ctrl.ts | 647 +++++++++++++ .../datasource/mysql/response_parser.ts | 77 ++ .../datasource/mysql/specs/datasource.test.ts | 64 +- .../datasource/mysql/sqlCompletionProvider.ts | 284 ------ .../app/plugins/datasource/mysql/sql_part.ts | 86 ++ public/app/plugins/datasource/mysql/types.ts | 15 +- .../datasource/postgres/config_ctrl.ts | 94 ++ .../configuration/ConfigurationEditor.tsx | 281 ------ .../configuration/useAutoDetectFeatures.ts | 87 -- .../plugins/datasource/postgres/datasource.ts | 21 +- .../app/plugins/datasource/postgres/module.ts | 10 +- .../datasource/postgres/partials/config.html | 196 ++++ .../app/plugins/datasource/postgres/types.ts | 49 +- .../components/AnnotationQueryEditor.tsx | 3 +- .../querybuilder/components/MetricSelect.tsx | 3 +- .../querybuilder/components/NestedQuery.tsx | 3 +- .../components/NestedQueryList.tsx | 2 +- .../components/PromQueryBuilder.tsx | 2 +- .../components/PromQueryBuilderExplained.tsx | 2 +- .../components/PromQueryBuilderOptions.tsx | 3 +- .../components/PromQueryEditorSelector.tsx | 3 +- .../components/PromQueryLegendEditor.tsx | 3 +- .../querybuilder/components/QueryPreview.tsx | 2 +- .../querybuilder/shared/FeedbackLink.tsx | 3 +- .../querybuilder/shared/LabelFilterItem.tsx | 3 +- .../querybuilder/shared/LabelFilters.tsx | 2 +- .../querybuilder/shared/OperationEditor.tsx | 3 +- .../querybuilder/shared/OperationHeader.tsx | 3 +- .../shared/OperationInfoButton.tsx | 3 +- .../querybuilder/shared/OperationList.tsx | 3 +- .../shared/OperationParamEditor.tsx | 3 +- .../shared/OperationsEditorRow.tsx | 3 +- .../querybuilder/shared/QueryHeaderSwitch.tsx | 3 +- .../querybuilder/shared/QueryOptionGroup.tsx | 3 +- yarn.lock | 159 +--- 220 files changed, 3274 insertions(+), 11482 deletions(-) delete mode 100644 packages/grafana-ui/src/components/QueryEditor/AccessoryButton.tsx delete mode 100644 packages/grafana-ui/src/components/QueryEditor/EditorField.tsx delete mode 100644 packages/grafana-ui/src/components/QueryEditor/EditorFieldGroup.tsx delete mode 100644 packages/grafana-ui/src/components/QueryEditor/EditorHeader.tsx delete mode 100644 packages/grafana-ui/src/components/QueryEditor/EditorList.tsx delete mode 100644 packages/grafana-ui/src/components/QueryEditor/EditorRow.tsx delete mode 100644 packages/grafana-ui/src/components/QueryEditor/EditorRows.tsx delete mode 100644 packages/grafana-ui/src/components/QueryEditor/EditorSwitch.tsx delete mode 100644 packages/grafana-ui/src/components/QueryEditor/FlexItem.tsx delete mode 100644 packages/grafana-ui/src/components/QueryEditor/InlineSelect.tsx delete mode 100644 packages/grafana-ui/src/components/QueryEditor/InputGroup.tsx delete mode 100644 packages/grafana-ui/src/components/QueryEditor/Space.tsx delete mode 100644 packages/grafana-ui/src/components/QueryEditor/Stack.tsx delete mode 100644 packages/grafana-ui/src/components/QueryEditor/index.ts delete mode 100644 public/app/features/plugins/sql/components/ConfirmModal.tsx delete mode 100644 public/app/features/plugins/sql/components/DatasetSelector.tsx delete mode 100644 public/app/features/plugins/sql/components/ErrorBoundary.tsx delete mode 100644 public/app/features/plugins/sql/components/QueryEditor.tsx delete mode 100644 public/app/features/plugins/sql/components/QueryHeader.tsx delete mode 100644 public/app/features/plugins/sql/components/TableSelector.tsx delete mode 100644 public/app/features/plugins/sql/components/configuration/ConnectionLimits.tsx delete mode 100644 public/app/features/plugins/sql/components/configuration/TLSSecretsConfig.tsx delete mode 100644 public/app/features/plugins/sql/components/index.ts delete mode 100644 public/app/features/plugins/sql/components/query-editor-raw/QueryEditorRaw.tsx delete mode 100644 public/app/features/plugins/sql/components/query-editor-raw/QueryToolbox.tsx delete mode 100644 public/app/features/plugins/sql/components/query-editor-raw/QueryValidator.tsx delete mode 100644 public/app/features/plugins/sql/components/query-editor-raw/README.md delete mode 100644 public/app/features/plugins/sql/components/query-editor-raw/RawEditor.tsx delete mode 100644 public/app/features/plugins/sql/components/query-editor-raw/SQLEditor.tsx delete mode 100644 public/app/features/plugins/sql/components/query-editor-raw/index.ts delete mode 100644 public/app/features/plugins/sql/components/visual-query-builder/AwesomeQueryBuilder.tsx delete mode 100644 public/app/features/plugins/sql/components/visual-query-builder/GroupByRow.tsx delete mode 100644 public/app/features/plugins/sql/components/visual-query-builder/OrderByRow.tsx delete mode 100644 public/app/features/plugins/sql/components/visual-query-builder/Preview.tsx delete mode 100644 public/app/features/plugins/sql/components/visual-query-builder/SQLGroupByRow.tsx delete mode 100644 public/app/features/plugins/sql/components/visual-query-builder/SQLOrderByRow.tsx delete mode 100644 public/app/features/plugins/sql/components/visual-query-builder/SQLSelectRow.tsx delete mode 100644 public/app/features/plugins/sql/components/visual-query-builder/SQLWhereRow.tsx delete mode 100644 public/app/features/plugins/sql/components/visual-query-builder/SelectRow.tsx delete mode 100644 public/app/features/plugins/sql/components/visual-query-builder/VisualEditor.tsx delete mode 100644 public/app/features/plugins/sql/components/visual-query-builder/WhereRow.tsx delete mode 100644 public/app/features/plugins/sql/components/visual-query-builder/index.ts delete mode 100644 public/app/features/plugins/sql/constants.ts delete mode 100644 public/app/features/plugins/sql/datasource/SqlDatasource.ts delete mode 100644 public/app/features/plugins/sql/defaults.ts delete mode 100644 public/app/features/plugins/sql/expressions.ts delete mode 100644 public/app/features/plugins/sql/index.ts delete mode 100644 public/app/features/plugins/sql/mocks/Monaco.ts delete mode 100644 public/app/features/plugins/sql/mocks/TextModel.ts delete mode 100644 public/app/features/plugins/sql/mocks/queries/multiLineFullQuery.ts delete mode 100644 public/app/features/plugins/sql/mocks/queries/multiLineFullQueryWithAggregation.ts delete mode 100644 public/app/features/plugins/sql/mocks/queries/multiLineMultipleColumns.ts delete mode 100644 public/app/features/plugins/sql/mocks/queries/singleLineEmptyQuery.ts delete mode 100644 public/app/features/plugins/sql/mocks/queries/singleLineFullQuery.ts delete mode 100644 public/app/features/plugins/sql/mocks/queries/singleLineFullQueryWithAggregation.ts delete mode 100644 public/app/features/plugins/sql/mocks/queries/singleLineMultipleColumns.ts delete mode 100644 public/app/features/plugins/sql/mocks/queries/singleLineTwoQueries.ts delete mode 100644 public/app/features/plugins/sql/mocks/queries/singleLineTwoQueriesWithAggregation.ts delete mode 100644 public/app/features/plugins/sql/mocks/testData.ts delete mode 100644 public/app/features/plugins/sql/standardSql/definition.ts delete mode 100644 public/app/features/plugins/sql/standardSql/getStandardSuggestions.test.ts delete mode 100644 public/app/features/plugins/sql/standardSql/getStandardSuggestions.ts delete mode 100644 public/app/features/plugins/sql/standardSql/getStatementPosition.test.ts delete mode 100644 public/app/features/plugins/sql/standardSql/getStatementPosition.ts delete mode 100644 public/app/features/plugins/sql/standardSql/language.ts delete mode 100644 public/app/features/plugins/sql/standardSql/macros.ts delete mode 100644 public/app/features/plugins/sql/standardSql/standardSuggestionsRegistry.ts delete mode 100644 public/app/features/plugins/sql/standardSql/statementPositionResolversRegistry.ts delete mode 100644 public/app/features/plugins/sql/standardSql/suggestionsKindRegistry.ts delete mode 100644 public/app/features/plugins/sql/standardSql/types.ts delete mode 100644 public/app/features/plugins/sql/test-utils/index.ts delete mode 100644 public/app/features/plugins/sql/test-utils/statementPosition.ts delete mode 100644 public/app/features/plugins/sql/test-utils/testQueries.txt delete mode 100644 public/app/features/plugins/sql/test-utils/types.ts delete mode 100644 public/app/features/plugins/sql/types.ts delete mode 100644 public/app/features/plugins/sql/utils/LinkedToken.ts delete mode 100644 public/app/features/plugins/sql/utils/commands.ts delete mode 100644 public/app/features/plugins/sql/utils/debugger.ts delete mode 100644 public/app/features/plugins/sql/utils/formatSQL.ts delete mode 100644 public/app/features/plugins/sql/utils/getSuggestionKind.test.ts delete mode 100644 public/app/features/plugins/sql/utils/getSuggestionKind.ts delete mode 100644 public/app/features/plugins/sql/utils/linkedTokenBuilder.test.ts delete mode 100644 public/app/features/plugins/sql/utils/linkedTokenBuilder.ts delete mode 100644 public/app/features/plugins/sql/utils/sql.utils.ts delete mode 100644 public/app/features/plugins/sql/utils/toCompletionItem.ts delete mode 100644 public/app/features/plugins/sql/utils/tokenUtils.ts delete mode 100644 public/app/features/plugins/sql/utils/types.ts delete mode 100644 public/app/features/plugins/sql/utils/useSqlChange.ts delete mode 100644 public/app/plugins/datasource/mssql/MSSqlMetaQuery.ts delete mode 100644 public/app/plugins/datasource/mssql/MSSqlQueryModel.ts create mode 100644 public/app/plugins/datasource/mssql/config_ctrl.ts delete mode 100644 public/app/plugins/datasource/mssql/configuration/ConfigurationEditor.tsx create mode 100644 public/app/plugins/datasource/mssql/partials/config.html create mode 100644 public/app/plugins/datasource/mssql/partials/query.editor.html create mode 100644 public/app/plugins/datasource/mssql/query_ctrl.ts rename public/app/plugins/datasource/mssql/{ => specs}/datasource.test.ts (76%) delete mode 100644 public/app/plugins/datasource/mssql/sqlCompletionProvider.ts delete mode 100644 public/app/plugins/datasource/mssql/sqlUtil.ts delete mode 100644 public/app/plugins/datasource/mysql/MySqlDatasource.ts delete mode 100644 public/app/plugins/datasource/mysql/MySqlQueryModel.ts delete mode 100644 public/app/plugins/datasource/mysql/MySqlResponseParser.ts delete mode 100644 public/app/plugins/datasource/mysql/configuration/ConfigurationEditor.tsx create mode 100644 public/app/plugins/datasource/mysql/datasource.ts delete mode 100644 public/app/plugins/datasource/mysql/fields.ts delete mode 100644 public/app/plugins/datasource/mysql/functions.ts create mode 100644 public/app/plugins/datasource/mysql/meta_query.ts delete mode 100644 public/app/plugins/datasource/mysql/mySqlMetaQuery.ts create mode 100644 public/app/plugins/datasource/mysql/mysql_query_model.ts create mode 100644 public/app/plugins/datasource/mysql/partials/annotations.editor.html create mode 100644 public/app/plugins/datasource/mysql/partials/config.html create mode 100644 public/app/plugins/datasource/mysql/partials/query.editor.html create mode 100644 public/app/plugins/datasource/mysql/query_ctrl.ts create mode 100644 public/app/plugins/datasource/mysql/response_parser.ts delete mode 100644 public/app/plugins/datasource/mysql/sqlCompletionProvider.ts create mode 100644 public/app/plugins/datasource/mysql/sql_part.ts create mode 100644 public/app/plugins/datasource/postgres/config_ctrl.ts delete mode 100644 public/app/plugins/datasource/postgres/configuration/ConfigurationEditor.tsx delete mode 100644 public/app/plugins/datasource/postgres/configuration/useAutoDetectFeatures.ts create mode 100644 public/app/plugins/datasource/postgres/partials/config.html diff --git a/.betterer.results b/.betterer.results index 103fa0be511..98aa9416f8a 100644 --- a/.betterer.results +++ b/.betterer.results @@ -5376,39 +5376,6 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "7"], [0, 0, 0, "Do not use any type assertions.", "8"] ], - "public/app/features/plugins/sql/components/query-editor-raw/SQLEditor.tsx:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "Do not use any type assertions.", "2"], - [0, 0, 0, "Do not use any type assertions.", "3"], - [0, 0, 0, "Do not use any type assertions.", "4"], - [0, 0, 0, "Do not use any type assertions.", "5"] - ], - "public/app/features/plugins/sql/components/visual-query-builder/AwesomeQueryBuilder.tsx:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"] - ], - "public/app/features/plugins/sql/mocks/Monaco.ts:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"] - ], - "public/app/features/plugins/sql/mocks/queries/singleLineFullQuery.ts:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"] - ], - "public/app/features/plugins/sql/standardSql/definition.ts:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"] - ], - "public/app/features/plugins/sql/test-utils/statementPosition.ts:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"], - [0, 0, 0, "Do not use any type assertions.", "3"] - ], - "public/app/features/plugins/sql/utils/debugger.ts:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"] - ], "public/app/features/plugins/tests/datasource_srv.test.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"], @@ -7613,15 +7580,176 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "1"], [0, 0, 0, "Do not use any type assertions.", "2"] ], + "public/app/plugins/datasource/mssql/config_ctrl.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"] + ], + "public/app/plugins/datasource/mssql/datasource.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"], + [0, 0, 0, "Do not use any type assertions.", "2"], + [0, 0, 0, "Unexpected any. Specify a different type.", "3"], + [0, 0, 0, "Unexpected any. Specify a different type.", "4"], + [0, 0, 0, "Unexpected any. Specify a different type.", "5"], + [0, 0, 0, "Unexpected any. Specify a different type.", "6"], + [0, 0, 0, "Unexpected any. Specify a different type.", "7"], + [0, 0, 0, "Do not use any type assertions.", "8"], + [0, 0, 0, "Unexpected any. Specify a different type.", "9"] + ], + "public/app/plugins/datasource/mssql/module.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"] + ], + "public/app/plugins/datasource/mssql/query_ctrl.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"], + [0, 0, 0, "Unexpected any. Specify a different type.", "2"], + [0, 0, 0, "Unexpected any. Specify a different type.", "3"] + ], + "public/app/plugins/datasource/mssql/response_parser.ts:5381": [ + [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"], + [0, 0, 0, "Do not use any type assertions.", "2"] + ], + "public/app/plugins/datasource/mssql/specs/datasource.test.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"], + [0, 0, 0, "Unexpected any. Specify a different type.", "2"], + [0, 0, 0, "Unexpected any. Specify a different type.", "3"], + [0, 0, 0, "Unexpected any. Specify a different type.", "4"], + [0, 0, 0, "Unexpected any. Specify a different type.", "5"], + [0, 0, 0, "Unexpected any. Specify a different type.", "6"], + [0, 0, 0, "Unexpected any. Specify a different type.", "7"], + [0, 0, 0, "Unexpected any. Specify a different type.", "8"] + ], + "public/app/plugins/datasource/mssql/types.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"], + [0, 0, 0, "Unexpected any. Specify a different type.", "2"], + [0, 0, 0, "Unexpected any. Specify a different type.", "3"], + [0, 0, 0, "Unexpected any. Specify a different type.", "4"], + [0, 0, 0, "Unexpected any. Specify a different type.", "5"] + ], + "public/app/plugins/datasource/mysql/datasource.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"], + [0, 0, 0, "Do not use any type assertions.", "2"], + [0, 0, 0, "Unexpected any. Specify a different type.", "3"], + [0, 0, 0, "Unexpected any. Specify a different type.", "4"], + [0, 0, 0, "Unexpected any. Specify a different type.", "5"], + [0, 0, 0, "Do not use any type assertions.", "6"], + [0, 0, 0, "Unexpected any. Specify a different type.", "7"], + [0, 0, 0, "Unexpected any. Specify a different type.", "8"], + [0, 0, 0, "Unexpected any. Specify a different type.", "9"], + [0, 0, 0, "Unexpected any. Specify a different type.", "10"], + [0, 0, 0, "Unexpected any. Specify a different type.", "11"] + ], + "public/app/plugins/datasource/mysql/meta_query.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"] + ], + "public/app/plugins/datasource/mysql/module.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"], + [0, 0, 0, "Unexpected any. Specify a different type.", "2"] + ], + "public/app/plugins/datasource/mysql/mysql_query_model.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"], + [0, 0, 0, "Unexpected any. Specify a different type.", "2"], + [0, 0, 0, "Unexpected any. Specify a different type.", "3"], + [0, 0, 0, "Unexpected any. Specify a different type.", "4"], + [0, 0, 0, "Unexpected any. Specify a different type.", "5"], + [0, 0, 0, "Unexpected any. Specify a different type.", "6"], + [0, 0, 0, "Unexpected any. Specify a different type.", "7"], + [0, 0, 0, "Unexpected any. Specify a different type.", "8"], + [0, 0, 0, "Unexpected any. Specify a different type.", "9"], + [0, 0, 0, "Unexpected any. Specify a different type.", "10"], + [0, 0, 0, "Unexpected any. Specify a different type.", "11"], + [0, 0, 0, "Unexpected any. Specify a different type.", "12"], + [0, 0, 0, "Unexpected any. Specify a different type.", "13"], + [0, 0, 0, "Unexpected any. Specify a different type.", "14"], + [0, 0, 0, "Unexpected any. Specify a different type.", "15"] + ], + "public/app/plugins/datasource/mysql/query_ctrl.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"], + [0, 0, 0, "Unexpected any. Specify a different type.", "2"], + [0, 0, 0, "Unexpected any. Specify a different type.", "3"], + [0, 0, 0, "Unexpected any. Specify a different type.", "4"], + [0, 0, 0, "Unexpected any. Specify a different type.", "5"], + [0, 0, 0, "Unexpected any. Specify a different type.", "6"], + [0, 0, 0, "Unexpected any. Specify a different type.", "7"], + [0, 0, 0, "Unexpected any. Specify a different type.", "8"], + [0, 0, 0, "Unexpected any. Specify a different type.", "9"], + [0, 0, 0, "Unexpected any. Specify a different type.", "10"], + [0, 0, 0, "Unexpected any. Specify a different type.", "11"], + [0, 0, 0, "Unexpected any. Specify a different type.", "12"], + [0, 0, 0, "Unexpected any. Specify a different type.", "13"], + [0, 0, 0, "Unexpected any. Specify a different type.", "14"], + [0, 0, 0, "Unexpected any. Specify a different type.", "15"], + [0, 0, 0, "Unexpected any. Specify a different type.", "16"], + [0, 0, 0, "Unexpected any. Specify a different type.", "17"], + [0, 0, 0, "Unexpected any. Specify a different type.", "18"], + [0, 0, 0, "Unexpected any. Specify a different type.", "19"], + [0, 0, 0, "Unexpected any. Specify a different type.", "20"], + [0, 0, 0, "Unexpected any. Specify a different type.", "21"], + [0, 0, 0, "Unexpected any. Specify a different type.", "22"], + [0, 0, 0, "Unexpected any. Specify a different type.", "23"], + [0, 0, 0, "Do not use any type assertions.", "24"], + [0, 0, 0, "Do not use any type assertions.", "25"], + [0, 0, 0, "Unexpected any. Specify a different type.", "26"], + [0, 0, 0, "Unexpected any. Specify a different type.", "27"], + [0, 0, 0, "Unexpected any. Specify a different type.", "28"], + [0, 0, 0, "Unexpected any. Specify a different type.", "29"], + [0, 0, 0, "Unexpected any. Specify a different type.", "30"], + [0, 0, 0, "Unexpected any. Specify a different type.", "31"], + [0, 0, 0, "Unexpected any. Specify a different type.", "32"], + [0, 0, 0, "Unexpected any. Specify a different type.", "33"], + [0, 0, 0, "Unexpected any. Specify a different type.", "34"], + [0, 0, 0, "Unexpected any. Specify a different type.", "35"], + [0, 0, 0, "Unexpected any. Specify a different type.", "36"], + [0, 0, 0, "Unexpected any. Specify a different type.", "37"], + [0, 0, 0, "Unexpected any. Specify a different type.", "38"], + [0, 0, 0, "Unexpected any. Specify a different type.", "39"], + [0, 0, 0, "Unexpected any. Specify a different type.", "40"], + [0, 0, 0, "Unexpected any. Specify a different type.", "41"], + [0, 0, 0, "Unexpected any. Specify a different type.", "42"], + [0, 0, 0, "Unexpected any. Specify a different type.", "43"], + [0, 0, 0, "Unexpected any. Specify a different type.", "44"], + [0, 0, 0, "Unexpected any. Specify a different type.", "45"], + [0, 0, 0, "Unexpected any. Specify a different type.", "46"], + [0, 0, 0, "Unexpected any. Specify a different type.", "47"], + [0, 0, 0, "Unexpected any. Specify a different type.", "48"], + [0, 0, 0, "Unexpected any. Specify a different type.", "49"], + [0, 0, 0, "Unexpected any. Specify a different type.", "50"], + [0, 0, 0, "Unexpected any. Specify a different type.", "51"], + [0, 0, 0, "Unexpected any. Specify a different type.", "52"], + [0, 0, 0, "Unexpected any. Specify a different type.", "53"], + [0, 0, 0, "Unexpected any. Specify a different type.", "54"] + ], + "public/app/plugins/datasource/mysql/response_parser.ts:5381": [ + [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"], + [0, 0, 0, "Do not use any type assertions.", "2"] + ], "public/app/plugins/datasource/mysql/specs/datasource.test.ts:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"] + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"] + ], + "public/app/plugins/datasource/mysql/sql_part.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"], + [0, 0, 0, "Unexpected any. Specify a different type.", "2"], + [0, 0, 0, "Unexpected any. Specify a different type.", "3"] ], "public/app/plugins/datasource/mysql/types.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"], [0, 0, 0, "Unexpected any. Specify a different type.", "2"], [0, 0, 0, "Unexpected any. Specify a different type.", "3"], - [0, 0, 0, "Unexpected any. Specify a different type.", "4"] + [0, 0, 0, "Unexpected any. Specify a different type.", "4"], + [0, 0, 0, "Unexpected any. Specify a different type.", "5"] ], "public/app/plugins/datasource/opentsdb/datasource.d.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] @@ -7726,6 +7854,15 @@ exports[`better eslint`] = { "public/app/plugins/datasource/opentsdb/types.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], + "public/app/plugins/datasource/postgres/config_ctrl.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"], + [0, 0, 0, "Unexpected any. Specify a different type.", "2"], + [0, 0, 0, "Unexpected any. Specify a different type.", "3"], + [0, 0, 0, "Unexpected any. Specify a different type.", "4"], + [0, 0, 0, "Unexpected any. Specify a different type.", "5"], + [0, 0, 0, "Unexpected any. Specify a different type.", "6"] + ], "public/app/plugins/datasource/postgres/datasource.test.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"], @@ -7746,7 +7883,9 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "11"], [0, 0, 0, "Unexpected any. Specify a different type.", "12"], [0, 0, 0, "Unexpected any. Specify a different type.", "13"], - [0, 0, 0, "Unexpected any. Specify a different type.", "14"] + [0, 0, 0, "Unexpected any. Specify a different type.", "14"], + [0, 0, 0, "Unexpected any. Specify a different type.", "15"], + [0, 0, 0, "Unexpected any. Specify a different type.", "16"] ], "public/app/plugins/datasource/postgres/module.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], diff --git a/package.json b/package.json index 1bdc36968a3..b8f5ff1cd7f 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,6 @@ "@babel/preset-env": "7.18.9", "@babel/preset-react": "7.18.6", "@babel/preset-typescript": "7.18.6", - "@babel/runtime": "7.18.9", "@betterer/betterer": "5.3.7", "@betterer/cli": "5.3.7", "@betterer/eslint": "5.3.7", @@ -254,6 +253,7 @@ "@grafana/aws-sdk": "0.0.37", "@grafana/data": "workspace:*", "@grafana/e2e-selectors": "workspace:*", + "@grafana/experimental": "^0.0.2-canary.32", "@grafana/google-sdk": "0.0.3", "@grafana/lezer-logql": "0.0.14", "@grafana/runtime": "workspace:*", @@ -352,7 +352,6 @@ "rc-tree": "5.6.6", "re-resizable": "6.9.9", "react": "17.0.2", - "react-awesome-query-builder": "^5.1.2", "react-beautiful-dnd": "13.1.0", "react-diff-viewer": "^3.1.1", "react-dom": "17.0.2", @@ -388,7 +387,6 @@ "semver": "7.3.7", "slate": "0.47.8", "slate-plain-serializer": "0.7.10", - "sql-formatter-plus": "^1.3.6", "symbol-observable": "4.0.0", "test": "link:./public/test", "tether-drop": "https://github.com/torkelo/drop", diff --git a/packages/grafana-ui/src/components/QueryEditor/AccessoryButton.tsx b/packages/grafana-ui/src/components/QueryEditor/AccessoryButton.tsx deleted file mode 100644 index 07f8c2c8a53..00000000000 --- a/packages/grafana-ui/src/components/QueryEditor/AccessoryButton.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { css, cx } from '@emotion/css'; -import React from 'react'; - -import { GrafanaTheme2 } from '@grafana/data'; - -import { useTheme2, stylesFactory } from '../../themes'; -import { Button, ButtonProps } from '../Button'; - -interface AccessoryButtonProps extends ButtonProps {} - -export const AccessoryButton: React.FC = ({ className, ...props }) => { - const theme = useTheme2(); - const styles = getButtonStyles(theme); - - return