Skip to content

fix(web): fixed incorrect banner showing when USV selected (A2-7805)#3591

Open
musabadam-pins wants to merge 1 commit intomainfrom
fix(web)-A2-7805-Add-site-visit-time-banner-displaying-incorrectly
Open

fix(web): fixed incorrect banner showing when USV selected (A2-7805)#3591
musabadam-pins wants to merge 1 commit intomainfrom
fix(web)-A2-7805-Add-site-visit-time-banner-displaying-incorrectly

Conversation

@musabadam-pins
Copy link
Copy Markdown
Collaborator

Describe your changes

  • Updated banner logic so it appears based on siteVisitType as well as the time and date values

Issue ticket number and link

Ticket

Copy link
Copy Markdown
Contributor

@zoebutterworth zoebutterworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there some tests which cover this area of the codebase which you could add to to cover this case?

actions.push('addSiteVisitTime');
if (siteVisit && siteVisit.visitType) {
switch (siteVisit.visitType.toLowerCase()) {
case 'unaccompanied':
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use the constants SITE_VISIT_TYPE_UNACCOMPANIED, SITE_VISIT_TYPE_ACCOMPANIED and SITE_VISIT_TYPE_ACCESS_REQUIRED instead of the string values here?

} else if (siteVisit && siteVisit.visitDate && !siteVisit.visitStartTime) {
actions.push('addSiteVisitTime');
if (siteVisit && siteVisit.visitType) {
switch (siteVisit.visitType.toLowerCase()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel that this switch is a bit unnecessary. There is quite a lot of repetition in each of the cases. I think you should be able to just add an extra statement to the if to check for unaccompanied

@musabadam-pins musabadam-pins force-pushed the fix(web)-A2-7805-Add-site-visit-time-banner-displaying-incorrectly branch from 63d119f to 57e3187 Compare April 13, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants