-
Notifications
You must be signed in to change notification settings - Fork 321
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
Retain validations from asset func on regeneration #4042
Conversation
if let Some(validation_format) = &self.validation_format { | ||
builder.validation_format(validation_format); | ||
} |
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 was the bug.
/// Extracts the value and validation from a raw property edtior value. | ||
pub fn extract_value_and_validation( |
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.
Moved while authoring a test that I used to find the bug. The test was discarded, but this should be useful for bubbling up errors.
@@ -474,7 +474,7 @@ | |||
<div | |||
v-if="showValidationDetails && validation" | |||
:style="{ marginLeft: indentPx }" | |||
class="text-red-400 flex flex-col bg-black pl-3 border-y border-red-400 pb-1 my-1" | |||
class="flex flex-col pl-3 border pb-1 m-2 text-destructive-500 border-destructive-500 bg-destructive-100 dark:text-destructive-900 dark:border-destructive-900 dark:bg-destructive-500" |
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 is likely not the final turn here, but what was there was definitely incorrect.
This commit retains validations from asset funcs upon regeneration. Currently, we successfully execute the asset func when regenerating an asset. We see the validations in the resulting definition. However, when exporting using the definition and converting it into a spec, the validations are dropped. This commit ensures that are no longer dropped. This commit also contains minor changes to how validations appear in the attribute panel. The existing classes relied on colors outside of our asset panel and neither matcher our light nor our dark theme. While the current colors are not likely the final ones, they are closer to our design language (even if only a little). Disclaimer: this will require all affected assets to be regenerated and re-exported, as applicable. Signed-off-by: Nick Gerace <[email protected]>
bors merge |
Build succeeded: |
Description
This PR retains validations from asset funcs upon regeneration. Currently, we successfully execute the asset func when regenerating an asset. We see the validations in the resulting definition. However, when exporting using the definition and converting it into a spec, the validations are dropped. This PR ensures that are no longer dropped.
This PR also contains minor changes to how validations appear in the attribute panel. The existing classes relied on colors outside of our asset panel and neither matcher our light nor our dark theme. While the current colors are not likely the final ones, they are closer to our design language (even if only a little).
Disclaimer
This will require all affected assets to be regenerated and re-exported, as applicable.