-
Notifications
You must be signed in to change notification settings - Fork 8
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
add protocol for prediction_context display #49
Conversation
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.
whereby protocol is passed from Turing, all the way to xp/ui/src/turing/components/form/variables_config/components/FieldSourceFormLabel.js.
I wonder if using context will be good here. It seems a bit overkill though.
Other than that, LGTM!
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, thanks @leonlnj ! Curious - how did you generate these formatting changes? Are we not capturing them correctly in pre-commit linting step?
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.
Left one comment. The rest LGTM. Thanks!
ui/src/turing/components/form/variables_config/components/FieldSourceFormLabel.js
Outdated
Show resolved
Hide resolved
I was using vs code extension prettier which format on save (if it doesn't work i write prettier cli manually) |
}; | ||
|
||
export const capitalizeFirstLetter = (string) => { | ||
return string.replace(/(^\w|\s\w)/g, (m) => m.toUpperCase()); |
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.
Rather than the custom function, we could use this: https://lodash.com/docs#startCase
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.
wow thanks TIL. I was looking for ways to do with css/classname but just couldn't get all of it right with the nested context menu panel/item/dropdown. Ended up wit this custom func, didnt know lodash has such nifty one already.
What this PR does / why we need it:
UI enhancement to support UPI routers in Turing. Most code changes are due to formatting.
The only main change is from /
xp/ui/src/turing/components/form/EditExperimentEngineConfig.js
whereby protocol is passed from Turing, all the way toxp/ui/src/turing/components/form/variables_config/components/FieldSourceFormLabel.js
.The value of
Prediction Context
stays the same as payload, as XP only supports HTTP, it is the Turing router that parses the UPI proto and send it to XP. This is mainly for visual aid to be consistency with traffic rules which showsPrediction Context
too.If no protocol is passed in, the original
Payload
will be shown.