-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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: add modal to import dashboards #11924
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11924 +/- ##
=======================================
Coverage 67.69% 67.70%
=======================================
Files 940 941 +1
Lines 45586 45658 +72
Branches 4378 4388 +10
=======================================
+ Hits 30861 30911 +50
- Misses 14622 14644 +22
Partials 103 103
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
* under the License. | ||
*/ | ||
import React from 'react'; | ||
import thunk from 'redux-thunk'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove in #11936
} | ||
|
||
importResource(uploadFile, passwords).then(result => { | ||
if (result) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit, but you could also check the passwordFields state here, right, instead of returning it in the result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually no, if there's a validation error other than password needed the importResource
will
- show a danger toast
- not set
passwordFields
- return
false
So having an empty passwordFields
does not guarantee success. This is because there's 3 states:
- Upload OK (returns
true
andpasswordFields
is empty) - File validated but needs password (returns
false
andpasswordFields
is set) - Validation failed in other ways (returns
false
andpasswordFields
is empty)
</div> | ||
<input | ||
name={`password-${fileName}`} | ||
autoComplete="off" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may not work for Chrome. You may want to try something like autoComplete="new-password"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, #TIL. I'll fix it in #11936
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
export type DashboardObject = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just as an fyi, there are also some types in src/types
. We may want to move everything there eventually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I feel we should have a way of automatically generating these and schema.py
from a single source of truth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mostly left some notes, but looks good.
b934e6e
to
990ca8a
Compare
fc34750
to
b2fee54
Compare
b2fee54
to
89bbdcf
Compare
SUMMARY
Identical to https://github.com/apache/incubator-superset/pull/11923/files, but for charts.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
Tested importing dashboard to an existing database/chart, as well as a dashboard to a new database, works as expected.
Also added tests.
ADDITIONAL INFORMATION