-
Notifications
You must be signed in to change notification settings - Fork 5
Conversation
placeholder={"Search for a location"} | ||
onSelect={addLocationToFilter} | ||
purpose="locations" | ||
companyAttrId={config.STANDARD_USER_ATTRIBUTES.location} |
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.
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 oflocation.
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).
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.
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
@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 |
I will test your push in my side again |
@callmekatootie I pushed new commit to fix undefined attribute id. Root cause is getCompanyAttribute() ignore primary attribute. |
@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 |
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 |
#15