Fetch people search entries from ptime, else Skills fallback | PuzzleTime #6
Introduction At the moment the people search in Skills searches for people in the Skills Database. We want to rewrite this logic. We now want it to make an API call to the PuzzleTime API and load all employees from there.
The people should be fetched only when the dropdown is opened. This can happen by replacing the dropdown with another dropdown via a Turboframe.
Then the search only searches over the employees coming from the PuzzleTime API. The search also should only show active employees.
Important: If the Ptime API is not available, we still want to search over the people from PuzzleSkills.
When clicking on an employee, we still navigate to the detailed profile according to the id. Yet when an employee is clicked that has not been created, it navigates to person/new?ptime_employee_id={id}. After the data has been fetched and the person created, it automatically redirects to the newly created person.
- Make sure ptime employee search is only active when ptime employees is configured
- Make sure
person/new?ptime_employee_id={id}does not fail if person exists in the meantime - person#ptime_employee_id with unique validation, validate not null when ptime employees enabled
ToDo
- [x] Make the employee search fetch all entries and then search over them. Only search over active employees.
- [x] If Ptime API is not available, search over people from Skills
- [x] Rewrite the routing, make a new employee redirect to
/newand then to the profile after that - [ ] Tests
Approach on fallback: https://codimd.puzzle.ch/WTmNcP5bT3KfQQHC9vRv2A#
Stand 19.07.2024 Alle features wurden erfüllt, neue Tests sind geschrieben & alte Tests gefixt.
Falls ich Test cases vergessen habe bitte einfach kurz hinzufügen. Ich bin ab Morgen in den Ferien aber bin für Fragen entweder auf dem PuzzleChat oder auf meinem Handy allgemein erreichbar.
Has been implemented using a DJ in https://github.com/puzzle/skills/issues/746. Is completed.