-
Notifications
You must be signed in to change notification settings - Fork 16
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: JSONSchema generated forms for contexts #257
base: main
Are you sure you want to change the base?
Conversation
25de1f1
to
d86f41d
Compare
impl Operand { | ||
pub fn from_operand_json(value: Value) -> Self { | ||
match value { | ||
Value::Object(ref o) if o.contains_key("var") => Operand::Dimension(value), |
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.
If ref required here ?
Can we remove 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.
I want a reference.
0cca50a
to
5346aa1
Compare
641186c
to
90f420a
Compare
0b7248b
to
533787b
Compare
533787b
to
f6a3529
Compare
Operands( | ||
iter.into_iter() | ||
.map(Operand::from_operand_json) | ||
.collect::<Vec<Operand>>(), |
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.
Can we make a type for Vec as Operands as we made for Conditions ?
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 really understand the point.
let on_context_edit = Callback::new(move |data: (Context, Map<String, Value>)| { | ||
let (context, overrides) = data; | ||
let conditions = | ||
Conditions::from_context_json(&context.condition.into()).unwrap(); |
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.
Can we avoid using plain unwrap here ?
let on_context_clone = Callback::new(move |data: (Context, Map<String, Value>)| { | ||
let (context, overrides) = data; | ||
let conditions = | ||
Conditions::from_context_json(&context.condition.into()).unwrap(); |
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.
Same here
|
||
open_drawer("context_and_override_drawer"); | ||
}); | ||
open_drawer("context_and_override_drawer"); |
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.
Can we create ENUMs for these strings , it's a little dangerous to keep it as strings
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.
Drawers are going away in my next PR, so this will be redundant work.
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
Possible Issues in the future
Describe any possible issues that could occur because of this change