diff --git a/.github/workflows/chromatic-master.yml b/.github/workflows/chromatic-master.yml new file mode 100644 index 0000000000000..6cdf10506f00f --- /dev/null +++ b/.github/workflows/chromatic-master.yml @@ -0,0 +1,55 @@ +# .github/workflows/chromatic.yml +# seee https://www.chromatic.com/docs/github-actions +# +# 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. +# + +# Workflow name +name: 'Chromatic Storybook Master' + +# Event for the workflow +# Only run if changes were made in superset-frontend folder of repo on merge to Master +on: + # This will trigger when a branch merges to master when the PR has changes in the frontend folder updating the chromatic baseline + push: + branches: + - master + paths: + - "superset-frontend/**" + +# List of jobs +jobs: + chromatic-deployment: + # Operating System + runs-on: ubuntu-latest + # Job steps + steps: + - uses: actions/checkout@v1 + - name: Install dependencies + run: npm ci + working-directory: superset-frontend + # 👇 Build and publish Storybook to Chromatic + - name: Build and publish Storybook to Chromatic + id: chromatic-master + uses: chromaui/action@v1 + # Required options for the Chromatic GitHub Action + with: + # 👇 Location of package.json from root of mono-repo + workingDir: superset-frontend + # 👇 Chromatic projectToken, refer to the manage page to obtain it. + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + exitZeroOnChanges: true # 👈 Option to prevent the workflow from failing + autoAcceptChanges: true # 👈 Option to accept all changes when merging to master diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic-pr.yml similarity index 55% rename from .github/workflows/chromatic.yml rename to .github/workflows/chromatic-pr.yml index 66afc24290206..09d57083f1255 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic-pr.yml @@ -18,28 +18,22 @@ # # Workflow name -name: 'Chromatic' +name: 'Chromatic Pull Request' -# Event for the workflow -# Only run if changes were made in superset-frontend folder of repo +# This will allow us to see how the Storybook builds when a PR has been created that has changes in the frontend folder +# NOTE: pull_request_target actions will always run the version of this action on master branch +# you will not see changes in the action behavior until this action's changes have been merged to master. +# This is a security precaution so that PR coming from a fork cannot access a Github secret without a repo +# committer aproving and merging the PR declaring the action safe. on: - # This will trigger when a branch merges to master when the PR has changes in the frontend folder updating the chromatic baseline - push: - branches: - - master - paths: - - "superset-frontend/**" - # this will allow us to see how the Storybook builds when a PR has been created that has changes in the frontend folder - # NOTE: pull_request_target actions will always run the version of this action on master branch - # you will not see changes in the action behavior until this action's changes have been merged to master. - # This is a security precaution so that PR coming from a fork cannot access a Github secret without a repo - # committer aproving and merging the PR declaring the action safe. pull_request_target: + # We want this action to run under specific pull request changes # opened: pull request is created # synchronize: commit(s) pushed to the pull request # reopened: closed pull request is reopened types: [opened, synchronize, reopened] + # This action will only run if one or more files have changes under the superset-frontend folder paths: - "superset-frontend/**" @@ -48,28 +42,20 @@ jobs: chromatic-deployment: # Operating System runs-on: ubuntu-latest + # define outputs that can be used in the storybook-link-comment job + outputs: + storybookUrl: ${{ steps.chromatic-deploy.outputs.storybookUrl }} + buildUrl: ${{ steps.chromatic-deploy.outputs.buildUrl }} # Job steps steps: + - id: chromatic-deploy - uses: actions/checkout@v1 - name: Install dependencies run: npm ci working-directory: superset-frontend - # 👇 Checks if the branch is not master and runs Chromatic - - name: Publish to Chromatic - id: chromatic-pr - if: github.ref != 'refs/heads/master' - uses: chromaui/action@v1 - # Required options for the Chromatic GitHub Action - with: - # 👇 Location of package.json from root of mono-repo - workingDir: superset-frontend - # 👇 Chromatic projectToken, refer to the Chromatic manage page to obtain it. - projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - exitZeroOnChanges: true # 👈 Option to prevent the workflow from failing - # 👇 Checks if the branch is master and accepts all changes in Chromatic - - name: Publish to Chromatic and auto accept changes - id: chromatic-master - if: github.ref == 'refs/heads/master' + # 👇 Build and publish Storybook to Chromatic + - name: Build and publish Storybook to Chromatic + id: chromatic-deploy uses: chromaui/action@v1 # Required options for the Chromatic GitHub Action with: @@ -77,10 +63,16 @@ jobs: workingDir: superset-frontend # 👇 Chromatic projectToken, refer to the manage page to obtain it. projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - autoAcceptChanges: true # 👈 Option to accept all changes when merging to master - exitZeroOnChanges: true # 👈 Option to prevent the workflow from failing + exitZeroOnChanges: true # 👈 Option to prevent the workflow from failing when changes are detected + + # Put a comment on the PR with link to latest build of the Storybook for this branch + storybook-link-comment: + # Operating System + runs-on: ubuntu-latest + # job steps + needs: chromatic-deployment + steps: - name: Echo Storybook build link - if: ${{ success() }} uses: actions/github-script@v6 with: github-token: ${{secrets.GITHUB_TOKEN}} @@ -89,5 +81,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'Storybook has completed and can be viewed at ${{ steps.chromatic-pr.outputs.storybookUrl }}' + body: 'Storybook has completed and can be viewed at ${{ needs.chromatic-deployment.outputs.storybookUrl }} Chromatic visual test results can be viewed at ${{ needs.chromatic-deployment.outputs.buildUrl }}' }) diff --git a/README.md b/README.md index 2ad9a66166375..b547030669480 100644 --- a/README.md +++ b/README.md @@ -117,8 +117,8 @@ Here are some of the major database solutions that are supported:
-**A more comprehensive list of supported databases** along with the configuration instructions can be found -[here](https://superset.apache.org/docs/databases/installing-database-drivers). + +**A more comprehensive list of supported databases** along with the configuration instructions can be found [here](https://superset.apache.org/docs/databases/installing-database-drivers). Want to add support for your datastore or data engine? Read more [here](https://superset.apache.org/docs/frequently-asked-questions#does-superset-work-with-insert-database-engine-here) about the technical requirements. diff --git a/docs/static/resources/openapi.json b/docs/static/resources/openapi.json index 9020e4ba7d289..9082e94dc5aa2 100644 --- a/docs/static/resources/openapi.json +++ b/docs/static/resources/openapi.json @@ -93,6 +93,31 @@ } }, "schemas": { + "AdvancedDataTypeSchema": { + "properties": { + "display_value": { + "description": "The string representation of the parsed values", + "type": "string" + }, + "error_message": { + "type": "string" + }, + "valid_filter_operators": { + "items": { + "type": "string" + }, + "type": "array" + }, + "values": { + "items": { + "description": "parsed value (can be any value)", + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "AnnotationLayer": { "properties": { "annotationType": { @@ -232,7 +257,7 @@ "AnnotationLayerRestApi.get_list": { "properties": { "changed_by": { - "$ref": "#/components/schemas/AnnotationLayerRestApi.get_list.User" + "$ref": "#/components/schemas/AnnotationLayerRestApi.get_list.User1" }, "changed_on": { "format": "date-time", @@ -243,7 +268,7 @@ "readOnly": true }, "created_by": { - "$ref": "#/components/schemas/AnnotationLayerRestApi.get_list.User1" + "$ref": "#/components/schemas/AnnotationLayerRestApi.get_list.User" }, "created_on": { "format": "date-time", @@ -389,13 +414,13 @@ "AnnotationRestApi.get_list": { "properties": { "changed_by": { - "$ref": "#/components/schemas/AnnotationRestApi.get_list.User" + "$ref": "#/components/schemas/AnnotationRestApi.get_list.User1" }, "changed_on_delta_humanized": { "readOnly": true }, "created_by": { - "$ref": "#/components/schemas/AnnotationRestApi.get_list.User1" + "$ref": "#/components/schemas/AnnotationRestApi.get_list.User" }, "end_dttm": { "format": "date-time", @@ -780,8 +805,12 @@ "type": { "description": "Datasource type", "enum": [ - "druid", - "table" + "sl_table", + "table", + "dataset", + "query", + "saved_query", + "view" ], "type": "string" } @@ -1031,22 +1060,24 @@ "operation": { "description": "Post processing operation type", "enum": [ + "_flatten_column_after_pivot", "aggregate", "boxplot", + "compare", "contribution", "cum", + "diff", + "flatten", "geodetic_parse", "geohash_decode", "geohash_encode", "pivot", "prophet", + "rename", + "resample", "rolling", "select", - "sort", - "diff", - "compare", - "resample", - "flatten" + "sort" ], "example": "aggregate", "type": "string" @@ -1533,6 +1564,9 @@ "nullable": true, "type": "string" }, + "is_managed_externally": { + "type": "boolean" + }, "owners": { "$ref": "#/components/schemas/ChartDataRestApi.get.User" }, @@ -1617,7 +1651,7 @@ "type": "string" }, "changed_by": { - "$ref": "#/components/schemas/ChartDataRestApi.get_list.User1" + "$ref": "#/components/schemas/ChartDataRestApi.get_list.User" }, "changed_by_name": { "readOnly": true @@ -1632,7 +1666,7 @@ "readOnly": true }, "created_by": { - "$ref": "#/components/schemas/ChartDataRestApi.get_list.User2" + "$ref": "#/components/schemas/ChartDataRestApi.get_list.User1" }, "datasource_id": { "format": "int32", @@ -1664,13 +1698,16 @@ "format": "int32", "type": "integer" }, + "is_managed_externally": { + "type": "boolean" + }, "last_saved_at": { "format": "date-time", "nullable": true, "type": "string" }, "last_saved_by": { - "$ref": "#/components/schemas/ChartDataRestApi.get_list.User" + "$ref": "#/components/schemas/ChartDataRestApi.get_list.User2" }, "owners": { "$ref": "#/components/schemas/ChartDataRestApi.get_list.User3" @@ -1723,10 +1760,6 @@ "maxLength": 64, "type": "string" }, - "id": { - "format": "int32", - "type": "integer" - }, "last_name": { "maxLength": 64, "type": "string" @@ -1744,6 +1777,10 @@ "maxLength": 64, "type": "string" }, + "id": { + "format": "int32", + "type": "integer" + }, "last_name": { "maxLength": 64, "type": "string" @@ -1841,8 +1878,11 @@ "datasource_type": { "description": "The type of dataset/datasource identified on `datasource_id`.", "enum": [ - "druid", + "sl_table", "table", + "dataset", + "query", + "saved_query", "view" ], "type": "string" @@ -1944,8 +1984,11 @@ "datasource_type": { "description": "The type of dataset/datasource identified on `datasource_id`.", "enum": [ - "druid", + "sl_table", "table", + "dataset", + "query", + "saved_query", "view" ], "nullable": true, @@ -2188,9 +2231,6 @@ "description": "Form data from the Explore controls used to form the chart's data query.", "type": "object" }, - "modified": { - "type": "string" - }, "slice_id": { "format": "int32", "type": "integer" @@ -2282,6 +2322,9 @@ "nullable": true, "type": "string" }, + "is_managed_externally": { + "type": "boolean" + }, "owners": { "$ref": "#/components/schemas/ChartRestApi.get.User" }, @@ -2366,7 +2409,7 @@ "type": "string" }, "changed_by": { - "$ref": "#/components/schemas/ChartRestApi.get_list.User1" + "$ref": "#/components/schemas/ChartRestApi.get_list.User" }, "changed_by_name": { "readOnly": true @@ -2381,7 +2424,7 @@ "readOnly": true }, "created_by": { - "$ref": "#/components/schemas/ChartRestApi.get_list.User2" + "$ref": "#/components/schemas/ChartRestApi.get_list.User1" }, "datasource_id": { "format": "int32", @@ -2413,13 +2456,16 @@ "format": "int32", "type": "integer" }, + "is_managed_externally": { + "type": "boolean" + }, "last_saved_at": { "format": "date-time", "nullable": true, "type": "string" }, "last_saved_by": { - "$ref": "#/components/schemas/ChartRestApi.get_list.User" + "$ref": "#/components/schemas/ChartRestApi.get_list.User2" }, "owners": { "$ref": "#/components/schemas/ChartRestApi.get_list.User3" @@ -2472,10 +2518,6 @@ "maxLength": 64, "type": "string" }, - "id": { - "format": "int32", - "type": "integer" - }, "last_name": { "maxLength": 64, "type": "string" @@ -2493,6 +2535,10 @@ "maxLength": 64, "type": "string" }, + "id": { + "format": "int32", + "type": "integer" + }, "last_name": { "maxLength": 64, "type": "string" @@ -2590,8 +2636,11 @@ "datasource_type": { "description": "The type of dataset/datasource identified on `datasource_id`.", "enum": [ - "druid", + "sl_table", "table", + "dataset", + "query", + "saved_query", "view" ], "type": "string" @@ -2693,8 +2742,11 @@ "datasource_type": { "description": "The type of dataset/datasource identified on `datasource_id`.", "enum": [ - "druid", + "sl_table", "table", + "dataset", + "query", + "saved_query", "view" ], "nullable": true, @@ -2804,13 +2856,13 @@ "CssTemplateRestApi.get_list": { "properties": { "changed_by": { - "$ref": "#/components/schemas/CssTemplateRestApi.get_list.User" + "$ref": "#/components/schemas/CssTemplateRestApi.get_list.User1" }, "changed_on_delta_humanized": { "readOnly": true }, "created_by": { - "$ref": "#/components/schemas/CssTemplateRestApi.get_list.User1" + "$ref": "#/components/schemas/CssTemplateRestApi.get_list.User" }, "created_on": { "format": "date-time", @@ -3087,6 +3139,10 @@ "format": "int32", "type": "integer" }, + "is_managed_externally": { + "nullable": true, + "type": "boolean" + }, "json_metadata": { "description": "This JSON object is generated dynamically when clicking the save or overwrite button in the dashboard view. It is exposed here for reference and for power users who may want to alter specific parameters.", "type": "string" @@ -3126,6 +3182,7 @@ "properties": { "filterState": { "description": "Native filter state", + "nullable": true, "type": "object" }, "hash": { @@ -3143,9 +3200,6 @@ "type": "array" } }, - "required": [ - "filterState" - ], "type": "object" }, "DashboardRestApi.get": { @@ -3185,6 +3239,9 @@ "created_by": { "$ref": "#/components/schemas/DashboardRestApi.get_list.User1" }, + "created_on_delta_humanized": { + "readOnly": true + }, "css": { "nullable": true, "type": "string" @@ -3198,6 +3255,9 @@ "format": "int32", "type": "integer" }, + "is_managed_externally": { + "type": "boolean" + }, "json_metadata": { "nullable": true, "type": "string" @@ -3205,12 +3265,6 @@ "owners": { "$ref": "#/components/schemas/DashboardRestApi.get_list.User2" }, - "advanced_data_type": { - "maxLength": 255, - "minLength": 1, - "nullable": true, - "type": "string" - }, "position_json": { "nullable": true, "type": "string" @@ -3510,6 +3564,14 @@ }, "type": "object" }, + "Database1": { + "properties": { + "database_name": { + "type": "string" + } + }, + "type": "object" + }, "DatabaseFunctionNamesResponse": { "properties": { "function_names": { @@ -3667,6 +3729,9 @@ "nullable": true, "type": "boolean" }, + "is_managed_externally": { + "type": "boolean" + }, "parameters": { "readOnly": true }, @@ -4087,6 +4152,12 @@ }, "DatasetColumnsPut": { "properties": { + "advanced_data_type": { + "maxLength": 255, + "minLength": 1, + "nullable": true, + "type": "string" + }, "column_name": { "maxLength": 255, "minLength": 1, @@ -4181,6 +4252,24 @@ }, "type": "object" }, + "DatasetDuplicateSchema": { + "properties": { + "base_model_id": { + "format": "int32", + "type": "integer" + }, + "table_name": { + "maxLength": 250, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "base_model_id", + "table_name" + ], + "type": "object" + }, "DatasetMetricRestApi.get": { "properties": { "id": { @@ -4251,12 +4340,6 @@ "nullable": true, "type": "string" }, - "advanced_data_type": { - "maxLength": 255, - "minLength": 1, - "nullable": true, - "type": "string" - }, "uuid": { "format": "uuid", "nullable": true, @@ -4395,6 +4478,9 @@ "format": "int32", "type": "integer" }, + "is_managed_externally": { + "type": "boolean" + }, "is_sqllab_view": { "nullable": true, "type": "boolean" @@ -4530,6 +4616,11 @@ }, "DatasetRestApi.get.TableColumn": { "properties": { + "advanced_data_type": { + "maxLength": 255, + "nullable": true, + "type": "string" + }, "changed_on": { "format": "date-time", "nullable": true, @@ -4633,7 +4724,7 @@ "DatasetRestApi.get_list": { "properties": { "changed_by": { - "$ref": "#/components/schemas/DatasetRestApi.get_list.User" + "$ref": "#/components/schemas/DatasetRestApi.get_list.User1" }, "changed_by_name": { "readOnly": true @@ -4676,7 +4767,7 @@ "readOnly": true }, "owners": { - "$ref": "#/components/schemas/DatasetRestApi.get_list.User1" + "$ref": "#/components/schemas/DatasetRestApi.get_list.User" }, "schema": { "maxLength": 255, @@ -4720,6 +4811,14 @@ "maxLength": 64, "type": "string" }, + "id": { + "format": "int32", + "type": "integer" + }, + "last_name": { + "maxLength": 64, + "type": "string" + }, "username": { "maxLength": 64, "type": "string" @@ -4727,6 +4826,7 @@ }, "required": [ "first_name", + "last_name", "username" ], "type": "object" @@ -4737,14 +4837,6 @@ "maxLength": 64, "type": "string" }, - "id": { - "format": "int32", - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - }, "username": { "maxLength": 64, "type": "string" @@ -4752,7 +4844,6 @@ }, "required": [ "first_name", - "last_name", "username" ], "type": "object" @@ -4904,8 +4995,11 @@ "datasource_type": { "description": "The type of dataset/datasource identified on `datasource_id`.", "enum": [ - "druid", + "sl_table", "table", + "dataset", + "query", + "saved_query", "view" ], "type": "string" @@ -4945,6 +5039,80 @@ }, "type": "object" }, + "EmbeddedDashboardConfig": { + "properties": { + "allowed_domains": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "allowed_domains" + ], + "type": "object" + }, + "EmbeddedDashboardResponseSchema": { + "properties": { + "allowed_domains": { + "items": { + "type": "string" + }, + "type": "array" + }, + "changed_by": { + "$ref": "#/components/schemas/User" + }, + "changed_on": { + "format": "date-time", + "type": "string" + }, + "dashboard_id": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "type": "object" + }, + "EmbeddedDashboardRestApi.get": { + "properties": { + "uuid": { + "format": "uuid", + "type": "string" + } + }, + "type": "object" + }, + "EmbeddedDashboardRestApi.get_list": { + "properties": { + "uuid": { + "format": "uuid", + "type": "string" + } + }, + "type": "object" + }, + "EmbeddedDashboardRestApi.post": { + "properties": { + "uuid": { + "format": "uuid", + "type": "string" + } + }, + "type": "object" + }, + "EmbeddedDashboardRestApi.put": { + "properties": { + "uuid": { + "format": "uuid", + "type": "string" + } + }, + "type": "object" + }, "ExplorePermalinkPostSchema": { "properties": { "formData": { @@ -5128,18 +5296,31 @@ "format": "int32", "type": "integer" }, - "dataset_id": { - "description": "The dataset ID", + "datasource_id": { + "description": "The datasource ID", "format": "int32", "type": "integer" }, + "datasource_type": { + "description": "The datasource type", + "enum": [ + "sl_table", + "table", + "dataset", + "query", + "saved_query", + "view" + ], + "type": "string" + }, "form_data": { "description": "Any type of JSON supported text.", "type": "string" } }, "required": [ - "dataset_id", + "datasource_id", + "datasource_type", "form_data" ], "type": "object" @@ -5151,18 +5332,31 @@ "format": "int32", "type": "integer" }, - "dataset_id": { - "description": "The dataset ID", + "datasource_id": { + "description": "The datasource ID", "format": "int32", "type": "integer" }, + "datasource_type": { + "description": "The datasource type", + "enum": [ + "sl_table", + "table", + "dataset", + "query", + "saved_query", + "view" + ], + "type": "string" + }, "form_data": { "description": "Any type of JSON supported text.", "type": "string" } }, "required": [ - "dataset_id", + "datasource_id", + "datasource_type", "form_data" ], "type": "object" @@ -5484,18 +5678,16 @@ "properties": { "changed_on": { "format": "date-time", - "nullable": true, "type": "string" }, "database": { - "$ref": "#/components/schemas/QueryRestApi.get_list.Database" + "$ref": "#/components/schemas/Database1" }, "end_time": { - "nullable": true, + "format": "float", "type": "number" }, "executed_sql": { - "nullable": true, "type": "string" }, "id": { @@ -5504,89 +5696,37 @@ }, "rows": { "format": "int32", - "nullable": true, "type": "integer" }, "schema": { - "maxLength": 256, - "nullable": true, "type": "string" }, "sql": { - "nullable": true, "type": "string" }, "sql_tables": { "readOnly": true }, "start_time": { - "nullable": true, + "format": "float", "type": "number" }, "status": { - "maxLength": 16, - "nullable": true, "type": "string" }, "tab_name": { - "maxLength": 256, - "nullable": true, "type": "string" }, "tmp_table_name": { - "maxLength": 256, - "nullable": true, "type": "string" }, "tracking_url": { - "nullable": true, "type": "string" }, "user": { - "$ref": "#/components/schemas/QueryRestApi.get_list.User" - } - }, - "required": [ - "database" - ], - "type": "object" - }, - "QueryRestApi.get_list.Database": { - "properties": { - "database_name": { - "maxLength": 250, - "type": "string" - } - }, - "required": [ - "database_name" - ], - "type": "object" - }, - "QueryRestApi.get_list.User": { - "properties": { - "first_name": { - "maxLength": 64, - "type": "string" - }, - "id": { - "format": "int32", - "type": "integer" - }, - "last_name": { - "maxLength": 64, - "type": "string" - }, - "username": { - "maxLength": 64, - "type": "string" + "$ref": "#/components/schemas/User" } }, - "required": [ - "first_name", - "last_name", - "username" - ], "type": "object" }, "QueryRestApi.post": { @@ -6006,6 +6146,11 @@ "changed_on_delta_humanized": { "readOnly": true }, + "chart_id": { + "format": "int32", + "nullable": true, + "type": "integer" + }, "created_by": { "$ref": "#/components/schemas/ReportScheduleRestApi.get_list.User1" }, @@ -6026,6 +6171,11 @@ "crontab_humanized": { "readOnly": true }, + "dashboard_id": { + "format": "int32", + "nullable": true, + "type": "integer" + }, "description": { "nullable": true, "type": "string" @@ -6790,6 +6940,7 @@ "Pacific/Guam", "Pacific/Honolulu", "Pacific/Johnston", + "Pacific/Kanton", "Pacific/Kiritimati", "Pacific/Kosrae", "Pacific/Kwajalein", @@ -7514,6 +7665,7 @@ "Pacific/Guam", "Pacific/Honolulu", "Pacific/Johnston", + "Pacific/Kanton", "Pacific/Kiritimati", "Pacific/Kosrae", "Pacific/Kwajalein", @@ -7885,6 +8037,20 @@ }, "type": "object" }, + "TableExtraMetadataResponseSchema": { + "properties": { + "clustering": { + "type": "object" + }, + "metadata": { + "type": "object" + }, + "partitions": { + "type": "object" + } + }, + "type": "object" + }, "TableMetadataColumnsResponse": { "properties": { "duplicates_constraint": { @@ -8110,6 +8276,46 @@ }, "type": "object" }, + "ValidateSQLRequest": { + "properties": { + "schema": { + "nullable": true, + "type": "string" + }, + "sql": { + "description": "SQL statement to validate", + "type": "string" + }, + "template_params": { + "nullable": true, + "type": "object" + } + }, + "required": [ + "sql" + ], + "type": "object" + }, + "ValidateSQLResponse": { + "properties": { + "end_column": { + "format": "int32", + "type": "integer" + }, + "line_number": { + "format": "int32", + "type": "integer" + }, + "message": { + "type": "string" + }, + "start_column": { + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, "ValidatorConfigJSON": { "properties": { "op": { @@ -8131,6 +8337,26 @@ }, "type": "object" }, + "advanced_data_type_convert_schema": { + "properties": { + "type": { + "default": "port", + "type": "string" + }, + "values": { + "items": { + "default": "http" + }, + "minItems": 1, + "type": "array" + } + }, + "required": [ + "type", + "values" + ], + "type": "object" + }, "database_schemas_query_schema": { "properties": { "force": { @@ -8374,6 +8600,98 @@ }, "openapi": "3.0.2", "paths": { + "/api/v1/advanced_data_type/convert": { + "get": { + "parameters": [ + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/advanced_data_type_convert_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdvancedDataTypeSchema" + } + } + }, + "description": "AdvancedDataTypeResponse object has been returned." + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Returns a AdvancedDataTypeResponse object populated with the passed in args.", + "tags": [ + "Advanced Data Type" + ] + } + }, + "/api/v1/advanced_data_type/types": { + "get": { + "description": "Returns a list of available advanced data types.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "a successful return of the available advanced data types has taken place." + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Advanced Data Type" + ] + } + }, "/api/v1/annotation_layer/": { "delete": { "description": "Deletes multiple annotation layers in a bulk operation.", @@ -9380,9 +9698,6 @@ }, "description": "ZIP file" }, - "400": { - "$ref": "#/components/responses/400" - }, "401": { "$ref": "#/components/responses/401" }, @@ -9440,7 +9755,7 @@ } } }, - "description": "Dashboard import result" + "description": "Assets import result" }, "400": { "$ref": "#/components/responses/400" @@ -10460,7 +10775,7 @@ } ], "responses": { - "200": { + "202": { "content": { "application/json": { "schema": { @@ -10470,9 +10785,6 @@ }, "description": "Chart async result" }, - "302": { - "description": "Redirects to the current digest" - }, "400": { "$ref": "#/components/responses/400" }, @@ -10600,9 +10912,6 @@ }, "description": "Chart thumbnail image" }, - "302": { - "description": "Redirects to the current digest" - }, "400": { "$ref": "#/components/responses/400" }, @@ -11453,9 +11762,6 @@ }, "description": "Dashboard added" }, - "302": { - "description": "Redirects to the current digest" - }, "400": { "$ref": "#/components/responses/400" }, @@ -12163,9 +12469,6 @@ }, "description": "Dashboard" }, - "302": { - "description": "Redirects to the current digest" - }, "400": { "$ref": "#/components/responses/400" }, @@ -12221,9 +12524,6 @@ }, "description": "Dashboard chart definitions" }, - "302": { - "description": "Redirects to the current digest" - }, "400": { "$ref": "#/components/responses/400" }, @@ -12280,9 +12580,6 @@ }, "description": "Dashboard dataset definitions" }, - "302": { - "description": "Redirects to the current digest" - }, "400": { "$ref": "#/components/responses/400" }, @@ -12306,16 +12603,17 @@ ] } }, - "/api/v1/dashboard/{pk}": { + "/api/v1/dashboard/{id_or_slug}/embedded": { "delete": { - "description": "Deletes a Dashboard.", + "description": "Removes a dashboard's embedded configuration.", "parameters": [ { + "description": "The dashboard id or slug", "in": "path", - "name": "pk", + "name": "id_or_slug", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -12333,20 +12631,11 @@ } } }, - "description": "Dashboard deleted" + "description": "Successfully removed the configuration" }, "401": { "$ref": "#/components/responses/401" }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - }, "500": { "$ref": "#/components/responses/500" } @@ -12360,25 +12649,237 @@ "Dashboards" ] }, - "put": { - "description": "Changes a Dashboard.", + "get": { + "description": "Returns the dashboard's embedded configuration", "parameters": [ { + "description": "The dashboard id or slug", "in": "path", - "name": "pk", + "name": "id_or_slug", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DashboardRestApi.put" - } - } + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/EmbeddedDashboardResponseSchema" + } + }, + "type": "object" + } + } + }, + "description": "Result contains the embedded dashboard config" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Dashboards" + ] + }, + "post": { + "description": "Sets a dashboard's embedded configuration.", + "parameters": [ + { + "description": "The dashboard id or slug", + "in": "path", + "name": "id_or_slug", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmbeddedDashboardConfig" + } + } + }, + "description": "The embedded configuration to set", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/EmbeddedDashboardResponseSchema" + } + }, + "type": "object" + } + } + }, + "description": "Successfully set the configuration" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Dashboards" + ] + }, + "put": { + "description": "Sets a dashboard's embedded configuration.", + "parameters": [ + { + "description": "The dashboard id or slug", + "in": "path", + "name": "id_or_slug", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmbeddedDashboardConfig" + } + } + }, + "description": "The embedded configuration to set", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/EmbeddedDashboardResponseSchema" + } + }, + "type": "object" + } + } + }, + "description": "Successfully set the configuration" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Dashboards" + ] + } + }, + "/api/v1/dashboard/{pk}": { + "delete": { + "description": "Deletes a Dashboard.", + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Dashboard deleted" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Dashboards" + ] + }, + "put": { + "description": "Changes a Dashboard.", + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DashboardRestApi.put" + } + } }, "description": "Dashboard schema", "required": true @@ -12837,6 +13338,9 @@ }, "description": "Thumbnail does not exist on cache, fired async to compute" }, + "302": { + "description": "Redirects to the current digest" + }, "401": { "$ref": "#/components/responses/401" }, @@ -13000,9 +13504,6 @@ }, "description": "Database added" }, - "302": { - "description": "Redirects to the current digest" - }, "400": { "$ref": "#/components/responses/400" }, @@ -13767,7 +14268,145 @@ }, "/api/v1/database/{pk}/select_star/{table_name}/": { "get": { - "description": "Get database select star for table", + "description": "Get database select star for table", + "parameters": [ + { + "description": "The database id", + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "Table name", + "in": "path", + "name": "table_name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Table schema", + "in": "path", + "name": "schema_name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SelectStarResponseSchema" + } + } + }, + "description": "SQL statement for a select star for table" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Database" + ] + } + }, + "/api/v1/database/{pk}/select_star/{table_name}/{schema_name}/": { + "get": { + "description": "Get database select star for table", + "parameters": [ + { + "description": "The database id", + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "Table name", + "in": "path", + "name": "table_name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Table schema", + "in": "path", + "name": "schema_name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SelectStarResponseSchema" + } + } + }, + "description": "SQL statement for a select star for table" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Database" + ] + } + }, + "/api/v1/database/{pk}/table/{table_name}/{schema_name}/": { + "get": { + "description": "Get database table metadata", "parameters": [ { "description": "The database id", @@ -13802,11 +14441,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SelectStarResponseSchema" + "$ref": "#/components/schemas/TableMetadataResponseSchema" } } }, - "description": "SQL statement for a select star for table" + "description": "Table metadata information" }, "400": { "$ref": "#/components/responses/400" @@ -13834,9 +14473,9 @@ ] } }, - "/api/v1/database/{pk}/select_star/{table_name}/{schema_name}/": { + "/api/v1/database/{pk}/table_extra/{table_name}/{schema_name}/": { "get": { - "description": "Get database select star for table", + "description": "Response depends on each DB engine spec normally focused on partitions", "parameters": [ { "description": "The database id", @@ -13871,11 +14510,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SelectStarResponseSchema" + "$ref": "#/components/schemas/TableExtraMetadataResponseSchema" } } }, - "description": "SQL statement for a select star for table" + "description": "Table extra metadata information" }, "400": { "$ref": "#/components/responses/400" @@ -13898,53 +14537,55 @@ "jwt": [] } ], + "summary": "Get table extra metadata", "tags": [ "Database" ] } }, - "/api/v1/database/{pk}/table/{table_name}/{schema_name}/": { - "get": { - "description": "Get database table metadata", + "/api/v1/database/{pk}/validate_sql": { + "post": { + "description": "Validates arbitrary SQL.", "parameters": [ { - "description": "The database id", "in": "path", "name": "pk", "required": true, "schema": { "type": "integer" } - }, - { - "description": "Table name", - "in": "path", - "name": "table_name", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Table schema", - "in": "path", - "name": "schema_name", - "required": true, - "schema": { - "type": "string" - } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidateSQLRequest" + } + } + }, + "description": "Validate SQL request", + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TableMetadataResponseSchema" + "properties": { + "result": { + "description": "A List of SQL errors found on the statement", + "items": { + "$ref": "#/components/schemas/ValidateSQLResponse" + }, + "type": "array" + } + }, + "type": "object" } } }, - "description": "Table metadata information" + "description": "Validation result" }, "400": { "$ref": "#/components/responses/400" @@ -13955,9 +14596,6 @@ "404": { "$ref": "#/components/responses/404" }, - "422": { - "$ref": "#/components/responses/422" - }, "500": { "$ref": "#/components/responses/500" } @@ -13967,6 +14605,7 @@ "jwt": [] } ], + "summary": "Validates that arbitrary sql is acceptable for the given database", "tags": [ "Database" ] @@ -14337,6 +14976,75 @@ ] } }, + "/api/v1/dataset/duplicate": { + "post": { + "description": "Duplicates a Dataset", + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DatasetDuplicateSchema" + } + } + }, + "description": "Dataset schema", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Dataset duplicate" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Datasets" + ] + } + }, "/api/v1/dataset/export/": { "get": { "description": "Exports multiple datasets and downloads them as YAML files", @@ -14971,6 +15679,118 @@ ] } }, + "/api/v1/dataset/{pk}/samples": { + "get": { + "description": "get samples from a Dataset", + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "force", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/ChartDataResponseResult" + } + }, + "type": "object" + } + } + }, + "description": "Dataset samples" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Datasets" + ] + } + }, + "/api/v1/embedded_dashboard/{uuid}": { + "get": { + "description": "Get a report schedule log", + "parameters": [ + { + "description": "The embedded configuration uuid", + "in": "path", + "name": "uuid", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/EmbeddedDashboardResponseSchema" + } + }, + "type": "object" + } + } + }, + "description": "Result contains the embedded dashboard configuration" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Embedded Dashboard" + ] + } + }, "/api/v1/explore/form_data": { "post": { "description": "Stores a new form_data.", @@ -15620,6 +16440,34 @@ ] } }, + "/api/v1/me/roles/": { + "get": { + "description": "Returns the user roles corresponding to the agent making the request, or returns a 401 error if the user is unauthenticated.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/UserResponseSchema" + } + }, + "type": "object" + } + } + }, + "description": "The current user" + }, + "401": { + "$ref": "#/components/responses/401" + } + }, + "tags": [ + "Current User" + ] + } + }, "/api/v1/menu/": { "get": { "description": "Get the menu data structure. Returns a forest like structure with the menu the user has access to", @@ -16211,6 +17059,9 @@ "404": { "$ref": "#/components/responses/404" }, + "422": { + "$ref": "#/components/responses/422" + }, "500": { "$ref": "#/components/responses/500" } @@ -16575,6 +17426,9 @@ "404": { "$ref": "#/components/responses/404" }, + "422": { + "$ref": "#/components/responses/422" + }, "500": { "$ref": "#/components/responses/500" } @@ -17560,6 +18414,9 @@ }, "description": "Result contains the guest token" }, + "400": { + "$ref": "#/components/responses/400" + }, "401": { "$ref": "#/components/responses/401" }, diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/edit_properties.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/edit_properties.test.ts index 0bb83fa414a84..57839ebc2cf76 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/edit_properties.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/edit_properties.test.ts @@ -190,7 +190,7 @@ describe('Dashboard edit action', () => { }); }); }); - describe('the color scheme affects the chart colors', () => { + describe.skip('the color scheme affects the chart colors', () => { it('should change the chart colors', () => { openAdvancedProperties().then(() => { clear('#json_metadata'); diff --git a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js index 195255687ee4c..0be1e6b49ffb1 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js +++ b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js @@ -108,14 +108,13 @@ function WorldMap(element, props) { const handleContextMenu = source => { const pointerEvent = d3.event; pointerEvent.preventDefault(); - const val = source.id || source.country; - const formattedVal = mapData[val].name; + const val = mapData[source.id || source.country].name; const filters = [ { col: entity, op: '==', val, - formattedVal, + formattedVal: val, }, ]; onContextMenu(filters, pointerEvent.clientX, pointerEvent.clientY); diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx index 924470559fb8d..4d740148f7238 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx @@ -365,8 +365,8 @@ export default function PivotTableChart(props: PivotTableProps) { const handleContextMenu = useCallback( ( e: MouseEvent, - colKey: DataRecordValue[] | undefined, - rowKey: DataRecordValue[] | undefined, + colKey: (string | number | boolean)[] | undefined, + rowKey: (string | number | boolean)[] | undefined, ) => { if (onContextMenu) { e.preventDefault(); diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx index 85580e7b63a3d..d107f2e5e16d9 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx @@ -23,6 +23,7 @@ import React, { HTMLProps, MutableRefObject, CSSProperties, + MouseEvent, } from 'react'; import { useTable, @@ -66,6 +67,7 @@ export interface DataTableProps