-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Disable saving models without up-to-date result_metadata #40087
Conversation
|
@@ -82,13 +81,6 @@ const Tables = createEntity({ | |||
// loads `query_metadata` for a single table | |||
fetchMetadata: compose( | |||
withAction(FETCH_METADATA), | |||
withForceReload((state, { id }) => { |
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 hack is no longer needed. Introduced here #39311
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.
lgtm
ButtonsS.ButtonSmall, | ||
)} | ||
/>, | ||
saveButtonTooltipLabel ? ( |
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.
Instead of conditionally rendering the Tooltip
we could pass disabled={!saveButtonTooltipLabel}
prop to it.
This way we could inline the ActionButton
back here and remove key
prop from it.
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.
Didn't know about about disabled
, thanks!
fields.every(field => field.display_name); | ||
|
||
const saveButtonTooltipLabel = | ||
!isEmpty && isDirty && isNative && isResultDirty |
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.
Why only native models?
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.
Because for MBQL queries result_metadata
can be computed by the BE without running the query
disabled={!saveButtonTooltipLabel} | ||
> | ||
<ActionButton | ||
key="save" |
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.
Redundant now
key="save" |
@ranquild Did you forget to add a milestone to the issue for this PR? When and where should I add a milestone? |
Fixes #37009
Disables creating new and updating existing models without
result_metadata
. That means that if the query was changed, the user would have to run the query first and wait for results.How to verify: