Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Setup supersetText configuration to overwrite errors #14256

Merged
merged 17 commits into from
Apr 27, 2021

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Apr 20, 2021

SUMMARY

We want to create an interface to allow us to overwrite specific error messages in superset. So we've create a config that allow you to overwrite specific error message coming back from the API.

This is built on top of SIP-40 + SIP-41

By adding a superset_text.yaml with the following structure you'll be able to overwrite and error.

# superset_text.yaml
ERRORS:  
  GENERIC_BACKEND_ERROR: "We were unable to connect to your database. Please visit our documentation at docs.preset.io or reach out to [email protected] for assistance."

Screen Shot 2021-04-20 at 3 23 22 PM

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@hughhhh hughhhh force-pushed the hugh/overwrite-generic-errors branch from 8f5eacd to 5e19aa7 Compare April 20, 2021 22:27
@hughhhh hughhhh changed the title feat: Setup supersetText configuration to overwrite errors [WIP] feat: Setup supersetText configuration to overwrite errors Apr 20, 2021
@@ -18,14 +18,14 @@
*/
import React, { FunctionComponent, useState, useEffect } from 'react';
import { styled, t } from '@superset-ui/core';
import InfoTooltip from 'src/common/components/InfoTooltip';
import InfoTooltip from 'src/components/InfoTooltip';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should be able to rebase and get these changes in.

# to AES-128 under the covers using the app's SECRET_KEY as key material.
#
# pylint: disable=C0103
SQLALCHEMY_ENCRYPTED_FIELD_TYPE_ADAPTER = SQLAlchemyUtilsAdapter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to rebase

* specific language governing permissions and limitations
* under the License.
*/
import supersetText from '../../../superset_text.yaml';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to see about importing this in a different way in case the file doesn't exist so that there's no error.

@codecov
Copy link

codecov bot commented Apr 21, 2021

Codecov Report

Merging #14256 (4e2721f) into master (5d3191b) will increase coverage by 0.14%.
The diff coverage is 72.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14256      +/-   ##
==========================================
+ Coverage   76.93%   77.07%   +0.14%     
==========================================
  Files         954      957       +3     
  Lines       48070    48457     +387     
  Branches     5973     6141     +168     
==========================================
+ Hits        36982    37349     +367     
- Misses      10886    10910      +24     
+ Partials      202      198       -4     
Flag Coverage Δ
hive 80.44% <ø> (ø)
javascript 72.29% <72.22%> (+0.19%) ⬆️
mysql 80.73% <ø> (ø)
postgres 80.76% <ø> (+0.01%) ⬆️
presto 80.47% <ø> (?)
python 81.31% <ø> (+0.15%) ⬆️
sqlite 80.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset-frontend/src/views/CRUD/utils.tsx 58.71% <50.00%> (-0.89%) ⬇️
superset-frontend/src/utils/textUtils.ts 100.00% <100.00%> (ø)
...c/filters/components/Select/SelectFilterPlugin.tsx 86.95% <0.00%> (-2.18%) ⬇️
...d/src/explore/components/PropertiesModal/index.tsx 80.86% <0.00%> (-1.08%) ⬇️
...erset-frontend/src/SqlLab/components/ResultSet.tsx 69.54% <0.00%> (-0.33%) ⬇️
superset-frontend/src/profile/components/App.tsx 100.00% <0.00%> (ø)
superset-frontend/src/components/FormRow/index.jsx 100.00% <0.00%> (ø)
...end/src/SqlLab/components/RunQueryActionButton.tsx 64.28% <0.00%> (ø)
...d/src/filters/components/GroupBy/transformProps.ts 33.33% <0.00%> (ø)
...src/filters/components/TimeGrain/transformProps.ts 33.33% <0.00%> (ø)
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d3191b...4e2721f. Read the comment docs.

@hughhhh hughhhh changed the title [WIP] feat: Setup supersetText configuration to overwrite errors feat: Setup supersetText configuration to overwrite errors Apr 23, 2021
Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.. I added support for translations in #14237

@hughhhh hughhhh merged commit 44c09b5 into master Apr 27, 2021
@villebro villebro deleted the hugh/overwrite-generic-errors branch September 28, 2021 08:39
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
…14256)

* Setup error message overwrite config`

* fix

* bad reabse

* bad rebase 2

* remove unneeded comment

* working dynamic importing

* saveeee

* working textUtil file

* add ignore tslint

* fix linting

* fix linting

* import order

* setup guard statements

* linting again

* linting again

Co-authored-by: Elizabeth Thompson <[email protected]>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants