Closed samschlicht closed 2 months ago
Re bug no.1, cv-icon component makes no distinction between attachments — that'll be why it DLs any file when clicked.
This block runs whenever a candidate row in search results is loaded — when the icon is clicked, the user receives whatever's in the resulting array:
That's why the user receives files that aren't CVs at times when clicking the icon from search results.
On the other hand, this component is also used on the candidate 'additional info' tab, where it receives the optional @Input of a single attachment, which has already been identified as a CV. In that case it works fine, DLing the right attachment.
So, what, I've done to fix this is add a condition check as an else block on the getAttachments() method:
I've also addressed a smaller UX bug: clicking the CV icon was opening the candidate profile search card, which is probably not what the user intended — I've ended that by adding event.stopPropagation() to the on-click method.
On to bug #2, where I've started by fixing a small display niggle whereby the list divider appears at the end of the menu, even when there isn't an item after it:
Another little niggle: no divider when the reviewable option shows:
I've fixed that with another if statement.
The first part of the larger bug is that the option to DL CV is appearing on the dropdown irrespective of whether the candidate has a CV.
Just a note that while working on these bugs, I surfaced one in my link preview code. I've fixed that in a separate commit.
The issue causing #2 is that the DownloadCvRequest is not being filled. There's also a redundant candidate ID included in the URL, not needed since it's in the request.
On a separate note, one thing I'm going to suggest is that we add a label or change the title of this dropdown item to 'Download Generated CV' - we need to signpost the difference between that and the clickable CV icon, which downloads uploaded CVs.
Slightly amended the attendant method names, icon/dropdown item labels and component doc so that the difference between the CV DL options is clearer to devs and admins.