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

fix: removed err as a default value for schema type and enum variants #426

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

ShubhranshuSanjeev
Copy link
Collaborator

Problem

Describe the problem you are trying to solve here

Solution

Provide a brief summary of your solution so that reviewers can understand your code

Environment variable changes

What ENVs need to be added or changed

Pre-deployment activity

Things needed to be done before deploying this change (if any)

Post-deployment activity

Things needed to be done after deploying this change (if any)

API changes

Endpoint Method Request body Response Body
API GET/POST, etc request response

Possible Issues in the future

Describe any possible issues that could occur because of this change

@ShubhranshuSanjeev ShubhranshuSanjeev requested a review from a team as a code owner February 20, 2025 08:28
Comment on lines +61 to +68
let schema_type_s = Signal::derive(move || {
SchemaType::try_from(config_schema_rs.get())
.map_err(|err| format!("Failed to get schema type: {}", err))
});
let enum_variants_s = Signal::derive(move || {
EnumVariants::try_from(config_schema_rs.get())
.map_err(|err| format!("Failed to get enum variants: {}", err))
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

So these signals are read-only?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes

@ShubhranshuSanjeev ShubhranshuSanjeev force-pushed the fix/default-value-autofill branch from 1b7dd87 to c89ddac Compare February 20, 2025 09:42
Comment on lines +312 to +333
if schema_type.is_err() || enum_variants.is_err() {
let tooltip_txt = if config_schema_rs.get().is_null() {
"Please select a schema type".to_string()
} else {
schema_type_s.get().unwrap_err()
};
return view! {
<div class="form-control">
<label class="label">
<span class="label-text">Default Value</span>
</label>
<div class="tooltip text-left w-full max-w-md" data-tip=tooltip_txt>
<textarea
type="text"
placeholder="Value"
class="input input-bordered w-full pt-3"
disabled=true
>
{config_value_rs.get().html_display()}
</textarea>
</div>
</div>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Rendering a disabled field until SchemaType is figured out for the default config.

@Datron Datron merged commit 3a01314 into main Feb 21, 2025
4 checks passed
@Datron Datron deleted the fix/default-value-autofill branch February 21, 2025 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants