Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

fix: issue #120 #127

Merged
merged 4 commits into from
Mar 3, 2021
Merged

fix: issue #120 #127

merged 4 commits into from
Mar 3, 2021

Conversation

yoution
Copy link
Contributor

@yoution yoution commented Feb 25, 2021

No description provided.

@yoution
Copy link
Contributor Author

yoution commented Feb 25, 2021

@maxceem please review

Copy link
Contributor

@maxceem maxceem left a 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.

image

@maxceem
Copy link
Contributor

maxceem commented Mar 2, 2021

One more thing @yoution. When we view the job, it should show the not the value, but the label:

image

it should be Software Developer - label here.

@yoution
Copy link
Contributor Author

yoution commented Mar 2, 2021

@maxceem please review

Copy link
Contributor

@maxceem maxceem left a 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:

image

@yoution
Copy link
Contributor Author

yoution commented Mar 2, 2021

@maxceem please review

Copy link
Contributor

@maxceem maxceem left a 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:

image

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

image

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')

@yoution yoution requested a review from maxceem March 2, 2021 23:52
Copy link
Contributor

@maxceem maxceem left a 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.

@maxceem maxceem merged commit e021dc7 into topcoder-archive:dev Mar 3, 2021
@yoution yoution deleted the issue-120 branch June 22, 2021 09:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants