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

changes for #15 #618

Merged
merged 7 commits into from
Jul 28, 2020
Merged

changes for #15 #618

merged 7 commits into from
Jul 28, 2020

Conversation

phongnt
Copy link
Collaborator

@phongnt phongnt commented Jul 27, 2020

#15

@phongnt phongnt requested a review from callmekatootie July 27, 2020 18:48
placeholder={"Search for a location"}
onSelect={addLocationToFilter}
purpose="locations"
companyAttrId={config.STANDARD_USER_ATTRIBUTES.location}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config.STANDARD_USER_ATTRIBUTES.location will have the value location and not the attribute id.

As mentioned here - #15 (comment)

Currently, on page load, after selecting org, we get the list of attributes located in that org (see the network requests made after org selection)
In this list, there will be an attribute with name "location" - case sensitive. Read it off the REACT_APP_ATTRIBUTE_ID_LOCATION environment variable which will have the value of location.
Note the id of this attribute - DO NOT hardcode the attribute id, as it is different for different orgs.

So the expectation is that AFTER we get the attributes on page load, we fetch the attribute id of the attribute named location - this name is being read from config.STANDARD_USER_ATTRIBUTES.location.

You will NOT get the id from that configuration - you will get the name, in this case, location. You need to get the id of this attribute from the list of attributes that are returned on page load (after org selection).

Copy link
Collaborator

@callmekatootie callmekatootie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code wise, it appears correct - except for the bit where you are using the name instead of the id - as mentioned above.

If it is easier to understand, then in your local setup, update the following env variable:

REACT_APP_ATTRIBUTE_ID_LOCATION='location'
REACT_APP_ATTRIBUTE_ID_COMPANY='company'
REACT_APP_ATTRIBUTE_ID_TITLE='title'
REACT_APP_ATTRIBUTE_ID_ISAVAILABLE='isAvailable'

These env vars will NO LONGER hold the id of the field, they will hold the name

@callmekatootie
Copy link
Collaborator

@phongnt I have pushed a fix where we are reading from the existing configuration in the same branch - please check it out.

That said, I do not see any suggestions in the dropdown for location.

It seems like you are fetching the id from something that does not have it (the api is passed undefined as the attribute id) - are you able to see suggestions from your side for location?

@phongnt
Copy link
Collaborator Author

phongnt commented Jul 28, 2020

@phongnt I have pushed a fix where we are reading from the existing configuration in the same branch - please check it out.

That said, I do not see any suggestions in the dropdown for location.

It seems like you are fetching the id from something that does not have it (the api is passed undefined as the attribute id) - are you able to see suggestions from your side for location?

I will test your push in my side again

@phongnt
Copy link
Collaborator Author

phongnt commented Jul 28, 2020

@callmekatootie I pushed new commit to fix undefined attribute id. Root cause is getCompanyAttribute() ignore primary attribute.

@callmekatootie
Copy link
Collaborator

@phongnt The latest changes are wrong. You removed the filtering of company attributes altogether. This causes the primary attributes to show up under custom attributes in the Filter modal:

image

@phongnt
Copy link
Collaborator Author

phongnt commented Jul 28, 2020

@phongnt The latest changes are wrong. You removed the filtering of company attributes altogether. This causes the primary attributes to show up under custom attributes in the Filter modal:

@callmekatootie I tested on develop branch, it'd same. It's not bug from my change maybe. Please check again

@callmekatootie
Copy link
Collaborator

Please check develop branch again - it's displaying correctly there.

FYI - https://skill-search.topcoder-dev.com/ - is the code from develop branch. You can verify it here too...

@phongnt
Copy link
Collaborator Author

phongnt commented Jul 28, 2020

Please check develop branch again - it's displaying correctly there.

FYI - https://skill-search.topcoder-dev.com/ - is the code from develop branch. You can verify it here too...

You are right. My bad, I used use config.js. I will fix again. Thanks

@callmekatootie callmekatootie merged commit 95e2750 into develop Jul 28, 2020
@cwdcwd cwdcwd deleted the issue-15 branch October 1, 2020 17:08
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