Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trip sharing #1304

Merged
merged 37 commits into from
Dec 23, 2024
Merged

Trip sharing #1304

merged 37 commits into from
Dec 23, 2024

Conversation

binh-dam-ibigroup
Copy link
Collaborator

@binh-dam-ibigroup binh-dam-ibigroup commented Nov 21, 2024

Description

Works with ibi-group/otp-middleware#271, needs #1302.

This PR adds trip sharing in monitored trips: A user saving a trip (whether for themselves or a dependent) can assign confirmed companions as trip companions or observers. Someone assigned as a primary traveler, companion, or dependent has read-only access to the trip (they can view trip details but cannot make changes).

PR Checklist

  • [?] Does the code follow accessibility standards (WCAG 2.1 AA Compliant)? => May need feedback about the use of disabled inputs.
  • Are all languages supported (Internationalization/Localization)?
  • Are appropriate Typescript types implemented?

Screenshot:

read-only trip companions

@binh-dam-ibigroup binh-dam-ibigroup changed the base branch from dev to plan-trip-on-behalf-of November 21, 2024 14:34
@binh-dam-ibigroup binh-dam-ibigroup marked this pull request as ready for review December 11, 2024 17:24
@binh-dam-ibigroup binh-dam-ibigroup changed the base branch from plan-trip-on-behalf-of to dev December 11, 2024 17:33
Copy link
Contributor

@josh-willis-arcadis josh-willis-arcadis left a comment

Choose a reason for hiding this comment

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

Trip notifications are working for observers and dependents!

Copy link
Contributor

@amy-corson-ibigroup amy-corson-ibigroup left a comment

Choose a reason for hiding this comment

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

Instead of passing the disabled prop so many times, could we use a fieldset and pass it once? https://www.w3schools.com/tags/att_fieldset_disabled.asp

Otherwise code looks good! Just a few suggestions.

@@ -639,6 +639,10 @@ components:
tripNotAvailableOnDay: Trip not available on {repeatedDay}
unsavedChangesExistingTrip: You haven't saved your trip yet. If you leave, changes will be lost.
unsavedChangesNewTrip: You haven't saved your new trip yet. If you leave, it will be lost.
TripCompanionsPane:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the issue stems from this PR but I am seeing an issue with i18n strings in the wizard when it comes to the travel companion field
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is indeed a separate issue, see #1331.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thoughts on adding an informational alert on this page if it's isReadOnly letting users know why everything is disabled? We can use the Alert component from building blocks. Happy to suggest some language if this is the direction we want to go in

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I do like the idea, looking at a banner that says " has added you to this trip. Therefore, you cannot make changes.". The Alert component in building-blocks is not quite usable for this purpose without restyling it (tricky to import, excess padding/margins even without the icon), so I'll use the react-bootstrap one for the time being.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@amy-corson-ibigroup Let me know what you think of 5cc84f0.

Comment on lines +155 to +157
if (isReadOnly) {
return <MonitoredDays days={dayFieldsToArray(monitoredTrip)} />
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Smart!

@binh-dam-ibigroup
Copy link
Collaborator Author

Instead of passing the disabled prop so many times, could we use a fieldset and pass it once? https://www.w3schools.com/tags/att_fieldset_disabled.asp

Good catch! Updated in bcba926.

@amy-corson-ibigroup
Copy link
Contributor

Looks great!! Only nitpick is that the alert and its parent div both have margin-bottoms that are creating a pretty significant gap, I would maybe remove one instance so the spacing is even
image

@binh-dam-ibigroup
Copy link
Collaborator Author

Looks great!! Only nitpick is that the alert and its parent div both have margin-bottoms that are creating a pretty significant gap, I would maybe remove one instance so the spacing is even

Good idea, addressed in 55ed3b7.

@binh-dam-ibigroup binh-dam-ibigroup merged commit 576b26b into dev Dec 23, 2024
9 checks passed
@binh-dam-ibigroup binh-dam-ibigroup deleted the trip-sharing branch December 23, 2024 21:52
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.

3 participants