You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// also illustrate order of preference
/use/search/api/users?filter[countries][]=nepal&filter[countries][]=kenya&filter[full_name]=test
/use/search/api/users?q=
/use/search/api/users?sort_by=field&sort_order=asc
/use/search/api/users?page=1&per_page=20
Would one worker be associated with multiple countries? As in the example multiple countries are returned.
Since in the UI we are merging first_name and last_name fields and applying string trucation in email field we would create an UI assuming the fields first_name, last_name and email are always present and others can be dynamically added but would require a label field for the title in the table. Here thus role_id should also have a label associated with it.
A/C to custom attributes, YES, one user can be assigned in multiple countries.
In custom attributes, it's an array, so API will also return an array.
Regarding first_name and last_name, I also don't have an answer, cause our current custom attribute data architecture does not yet support this use-case. Custom attribute won;t be able to tell us, use Name field which is a combination of first_name and last_name. For now, we'll have to so something in the UI to join first_name and last_name and show it as a Name field. Long term solution would be, custom attribute will store info about this field and how to compute value of this field.
For sorting, I was thinking if UI could pass sort=first_name+last_name, both, the api could can do a sort by combination of two fields against ES.
In Custom Attribute Metadata Schema, we probably need to settle on a specific format on how options for list type attributes inside meta are returned as. In role attribute, options is returned as [ {id: 'xxx', name: 'Cloud Worker'}, {id: 'nnn', name: 'Employee'} ] which is understandable and needed. But for any other list type fields like countries just having an array of strings will create problems in the UI.
Our Select component currently accepts an array of this format [ label: 'Nepal', value: 'Nepal'], where label is whats shown in the UI.
For the UI all list type fields will behave the same, so having a proper format will make it easy for the front end to manipulate and use it.
So can we send the country options as [ {id: 'nepal', name: 'Nepal'}, {id: 'kenya', name: 'Kenya'} ] ?
A/C to custom attributes, YES, one user can be assigned in multiple countries.
In custom attributes, it's an array, so API will also return an array.
Regarding first_name and last_name, I also don't have an answer, cause our current custom attribute data architecture does not yet support this use-case. Custom attribute won;t be able to tell us, use
Name
field which is a combination offirst_name
andlast_name
. For now, we'll have to so something in the UI to join first_name and last_name and show it as aName
field. Long term solution would be, custom attribute will store info about this field and how to compute value of this field.For sorting, I was thinking if UI could pass
sort=first_name+last_name
, both, the api could can do a sort by combination of two fields against ES.