-
Notifications
You must be signed in to change notification settings - Fork 24
Conversation
@maxceem please review |
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.
@yoution looks good. Can we just make the option labels same capitalized format like here. Please, don't make it lowercase.
One more thing @yoution. When we view the job, it should show the not the value, but the label: it should be |
@maxceem please review |
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.
Thanks @yoution.
There is one more place where we have to show the label for the Resource Type instead of the value.
When we view Job:
@maxceem please review |
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.
@yoution in some cases we might have a value here which is not listed in the Options.
In such cases we are showing like this:
This already works good for edit form, you can test it with this job http://localhost:8080/taas/myteams/16873/positions/0fffade4-6610-4f20-9c43-bd151b2ed122/edit
But in View mode, it showing nothing
But actually, we have a value there, it is just not supported by select.
We already have a reusable method https://github.com/topcoder-platform/taas-app/blob/dev/src/components/TCForm/utils.js#L7-L26 that can return option, and it also supports showing unsupported value. So this code:
{_.get(
_.find(
RESOURCE_TYPE_OPTIONS,
(t) => t.value === job.resourceType
),
"label"
)}
Could be replaced with something like:
_.get(getSelectOptionByValue(job.resourceType, RESOURCE_TYPE_OPTIONS), 'label')
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.
Everything works perfectly now. Thank you for the updates @yoution.
No description provided.