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

Retain validations from asset func on regeneration #4042

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Conversation

nickgerace
Copy link
Contributor

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.

Comment on lines +308 to +310
if let Some(validation_format) = &self.validation_format {
builder.validation_format(validation_format);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the bug.

Comment on lines +232 to +233
/// Extracts the value and validation from a raw property edtior value.
pub fn extract_value_and_validation(
Copy link
Contributor Author

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"
Copy link
Contributor Author

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]>
@nickgerace
Copy link
Contributor Author

bors merge

@si-bors-ng
Copy link
Contributor

si-bors-ng bot commented Jun 25, 2024

Build succeeded:

@si-bors-ng si-bors-ng bot merged commit 4e6f01c into main Jun 25, 2024
9 checks passed
@si-bors-ng si-bors-ng bot deleted the nick/bug-328 branch June 25, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant