Closed HasanSifat closed 1 year ago
@HasanSifat @T854236 Explore the below API to fetch employee details. https://analytics-testapi.psa.gov.bc.ca/apiserver/api.rst#Datamart_PECSF_employee_demo
question: Can we apply filer on name, first/last name here?
In this API we can apply filters as per below. Search is a query param, it applies search in all the text fields. like name, supervision name, email, city, position, etc. Let's see how it works, Request URL: https://analytics-testapi.psa.gov.bc.ca/apiserver/api.rsc/Datamart_Telework_employee_demo?$search='mark' Result: Mark L Bakusko, L. Darcy Houston, Wendy Knott Notes: Here, the first result(Mark L Bakusko) looks good. The second and 3rd names do not match with the keyword 'mark' still we see those in the result because their supervisor name is Mark Carter & Mark Van Tassel respectively.
question: Can we apply filter based on supervison_email? In this form ADM/Supervisors add details for employee who reports them. we can run API https://analytics-testapi.psa.gov.bc.ca/apiserver/api.rsc/Datamart_Telework_employee_demo?$filter=supervisor_email eq 'xxxxlda.xxxxxio@gov.bc.ca' to get employee whose supervisor email match with the provided. It helps to eliminate security risks like any user trying to access employees who are not reporting to them.
Using the $filter function of the API service allows better control on what fields to filter vs. the search function. As you have discovered, it will search for all fields and return records that matches the criteria.
@T854236 filter does not allow a LIKE kind of query on the string value. And if possible then I want to know that keyword(that search in the field as LIKE in SQL) it works with a short form like eq (equal), or gt (greater than). In employee search, we do not have a full name to match using eq. We have to pass a partial name and expect to autocomplete the result on it(LIKE query in SQL).
Please try this: https://analytics-testapi.psa.gov.bc.ca/apiserver/api.rsc/Datamart_Telework_employee_demographic?$search='insert partial name' This endpoint has two differences in comparison to Datamart_Telework_employee_demo:
If you have any other questions, please email me.
we've got the ok signal from the PIA people to hook up the end points & test
tested successfully in DEV. One issue I noticed, once a selection has been made, it's difficult to cut through to re-edit the field. There is a small cross button that needs to be clicked to remove that name and select a new one. Being able to press backspace would be more friendly from an accessibility point of view.
@HasanSifat For now, it enables you to start a new search without clicking on the x icon. When you click on the name again it will open a search popup and you can begin typing a new name.
The same control is not allowed in the selected name itself. It's a select component hence value cannot be changed. To enable backspace in the name, we must introduce a new component in which we will add a text box, and attach a search popup that connects with a remote API. It seems a little bit bigger task here as we are trying to replicate features from one to another component. @simensma-fresh @iman-jamali-fw Let's connect and see if its fesible and try to estimate efforts.
@bhumin-fw @HasanSifat Agreed! Making it into more of a textbox (with back button support) would be a fairly big effort as it's currently not supported by form.io
@bhumin-fw @simensma-fresh That makes sense. The team has agreed to stick with the drop-down field. Also I tested the feature to day this morning. It's not working right now
@EduardoRamirezBC @JodiLittle please review and confirm if this feature is working correctly and as per requirements for you.
@bhumin-fw the enter name field is still not working in Dev. Did you have a chance to look at it? the pre-population fields are also not filling out with that selected person's info
@HasanSifat I'm trying to generate the same scenario on dev or local, But no luck, It works fine for Simen, Iman, and mine login. I did check issues in the form-io library but no such issue logged so far. I'll keep you posted if I'll find anything that we can note down or fix in the form itself.
Meanwhile, could you please check with anyone else on your side if its working fine or not?
@bhumin-fw One bug I noticed, the search field does not refresh if someone made a typo. The search feature does not give out any options if I remove anything I typed before
@HasanSifat Fixed the issue of the typo and the search just stop loading new data. Now it will start searching as soon as you type minimum 3 characters in the search box.
Looks good in DEV. Ready to be transferred to TEST/PROD
confirming the endpoint used is deployed to PROD for the BI API service.
Okay to move test
After initial UX testing, we identified a bug with the search field where it stops giving options after users type in something wrong. @bhumin-fw i can debrief you on this on monday
Video recording to show the bug- https://images.zenhubusercontent.com/439477060/38ae53c1-a61f-4ec2-bdca-2ff2c710a7f6/recording_1665787283509.mp4
@HasanSifat This happens if you type special characters in the search field (the ' in O'leary), but works if you do not add any special characters. It's going to take a bit of effort to get this fixed, so it will not be fixed for the testing tomorrow
Thanks @simensma-fresh at least we now know what is causing the search feature to break. We can address this in our test tomorrow by informing the ADMs if needed and it looks like a refresh of the page makes the search work again.
Works fine except those special characters notes above - Bhumin working on this one.
@HasanSifat Fix the special character break search functionality issue. Also, handle errors so search functionality will not be blocked. It's available to test on DEV.
Tested successfully in DEV. Ready to be transferred to TEST/PROD
Approved
tested successfully in TEST
User Story As an ADM filling out the SL review form, I want to be able to search for anyone in the government with his/her name so that i cant easily select the person I want to nominate for the process
Tasks
[x] Hook API endpoints to ODS for idir/employee full name to a text field in the SL review form
[x] Any input to the field will have drop-down options to select from
[x] Access need to be restricted (separate ticket#549)
Acceptance Criteria