-
Notifications
You must be signed in to change notification settings - Fork 61
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
feat: add parameter value origin field to parameters #1470
Changes from 9 commits
f9aca20
2fccfbe
8014121
94ea07f
2d51ba9
015f2a6
338ad07
4d3e5b1
2e9d8ba
6a6bc7c
81bf9da
4fa3f9b
284bd7c
a2cffce
52c8920
de1c86c
1c984a2
4adce20
c2d9574
fa0c238
f628c69
0e62504
ef8ce5c
56bbd8a
928c7ba
8cfc8de
adde885
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,10 +144,12 @@ def _construct_set_parameters_dict( | |
for param_id, param_dict in control_param_dict.items(): | ||
# if the param is in the full_param_dict, load its contents first and mark as profile-values | ||
display_name = '' | ||
param_value_origin = '' | ||
if param_id in profile_set_param_dict: | ||
# get the param from the profile set_param | ||
param = profile_set_param_dict[param_id] | ||
display_name, _ = CatalogInterface._get_display_name_and_ns(param) | ||
param_value_origin, _ = CatalogInterface._get_param_value_origin_and_ns(param) | ||
# assign its contents to the dict | ||
new_dict = ModelUtils.parameter_to_dict(param, True) | ||
if const.VALUES in new_dict: | ||
|
@@ -190,14 +192,21 @@ def _construct_set_parameters_dict( | |
# adds display name, if no display name then do not add to dict | ||
if display_name != '' and display_name is not None: | ||
new_dict[const.DISPLAY_NAME] = display_name | ||
# adds param_Value_origin | ||
if param_value_origin != '' and param_value_origin is not None: | ||
new_dict[const.PARAM_VALUE_ORIGIN] = param_value_origin | ||
else: | ||
# puts it empty for user to fill it out mandatorily | ||
new_dict[const.PARAM_VALUE_ORIGIN] = 'Added by Control Owner' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This value needs to be changed after Prashant confims which is the default value for the field. @vikas-agarwal76 . In the meantime I'm using a placeholder value There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it required to populate the value for param value origin? |
||
key_order = ( | ||
const.LABEL, | ||
const.GUIDELINES, | ||
const.VALUES, | ||
const.AGGREGATES, | ||
const.ALT_IDENTIFIER, | ||
const.DISPLAY_NAME, | ||
const.PROFILE_VALUES | ||
const.PROFILE_VALUES, | ||
const.PARAM_VALUE_ORIGIN | ||
) | ||
ordered_dict = {k: new_dict[k] for k in key_order if k in new_dict.keys()} | ||
set_param_dict[param_id] = ordered_dict | ||
|
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.
Test includes overwrite of the profile at the end to proof that the markdown gets modified after a profile json is modified as well for param_value_origin prop