-
Notifications
You must be signed in to change notification settings - Fork 2
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
Update coaching sessions #96
Conversation
<form onSubmit={handleSubmit} className="space-y-4"> | ||
<div className="space-y-2"> | ||
<Label htmlFor="session-date">Session Date</Label> | ||
<Calendar | ||
mode="single" | ||
selected={sessionDate} | ||
onSelect={(date) => setSessionDate(date)} | ||
/> | ||
</div> | ||
<div className="space-y-2"> | ||
<Label htmlFor="session-time">Session Time</Label> | ||
<input | ||
type="time" | ||
id="session-time" | ||
value={sessionTime} | ||
onChange={(e) => setSessionTime(e.target.value)} | ||
className="w-full border rounded p-2" | ||
required | ||
/> | ||
</div> | ||
<Button type="submit" disabled={!sessionDate || !sessionTime}> | ||
{mode === "create" ? "Create Session" : "Update Session"} | ||
</Button> | ||
</form> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want the form itself (and its submit logic) moved into it's own react component and then composed into the dialog component. Separates concerns of the dialog UI vs the form pretty nicely that way.
<CoachingSessionDialog ...props >
<CoachingSessionForm ...props />
</CoachingSessionDialog>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a sensible suggestion Zach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes total sense. This is my pass at separating the two dea2db8
src/lib/api/actions.ts
Outdated
* @param actionId The ID of the action to delete | ||
* @returns Promise resolving to the deleted Action object | ||
*/ | ||
deleteNested: async (_entityId: Id, _actionId: Id): Promise<Action> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgive me I just haven't noticed this until now - what are the underscore prefixes on the params? Just acknowledging the api method isn't implemented yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a convention that I see in other languages that just means that the arguments aren't actually going to be used in the function (because, like you said, it's not implemented)
src/lib/api/coaching-sessions.ts
Outdated
*/ | ||
deleteNested: async ( | ||
_entityId: Id, | ||
coachingSessionId: Id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this need the underscore?
@calebbourg Thanks for this, it's nice to see this functionality in place!! Can you move the "Join Session" back out into a primary button that sits just to the left of the new vertical "..." menu and change the text to "Join"? And then change "Edit Session" and "Delete Session" to "Edit" and "Delete"? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great, a few inline suggestions.
coachingSession: { | ||
id: Id; | ||
date: string; | ||
coaching_relationship_id: Id; | ||
created_at: DateTime; | ||
updated_at: DateTime; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to use the type defined in src/types/coaching-session.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup e0074c6
onOpenChange={setUpdateDialogOpen} | ||
onCoachingSessionUpdated={() => { | ||
// Refresh the list of coaching sessions | ||
window.location.reload(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a hook for the coaching sessions that we can call refresh()
on instead of this? I may be confused on what this is for otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this was something that AI added that I didn't see. Good catch! dea2db8
<form onSubmit={handleSubmit} className="space-y-4"> | ||
<div className="space-y-2"> | ||
<Label htmlFor="session-date">Session Date</Label> | ||
<Calendar | ||
mode="single" | ||
selected={sessionDate} | ||
onSelect={(date) => setSessionDate(date)} | ||
/> | ||
</div> | ||
<div className="space-y-2"> | ||
<Label htmlFor="session-time">Session Time</Label> | ||
<input | ||
type="time" | ||
id="session-time" | ||
value={sessionTime} | ||
onChange={(e) => setSessionTime(e.target.value)} | ||
className="w-full border rounded p-2" | ||
required | ||
/> | ||
</div> | ||
<Button type="submit" disabled={!sessionDate || !sessionTime}> | ||
{mode === "create" ? "Create Session" : "Update Session"} | ||
</Button> | ||
</form> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a sensible suggestion Zach.
accebcf
to
dfa4cb3
Compare
e5142b5
to
e0074c6
Compare
e18bfed
to
f18b415
Compare
@calebbourg Your latest changes also seem to degrade the AddEntity component up top on the Dashboard page as well: ![]() |
@jhodapp oh haha for some reason I thought that had something to do with changes you were making on the dashboard being in an in between state.. I see now that that would be really weird :) I'll fix it |
Not yet, I haven't made any changes yet. Thanks brother! |
@jhodapp @zgavin1 I took another crack at this. I realized that we were using the Another spin-off of this was that I removed the "Create Coaching Session" button from the actual list of coaching sessions as It seemed redundant given the |
@calebbourg this is awesome, it was something I was going to do anyway when I moved the coaching sessions list down in the page for exactly the reason you mentioned. Thanks for doing this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such an awesome change set, thank you Caleb. Just a few more suggestions and I'll be ready to approve.
<AddEntities onCreateSession={() => handleOpenDialog()} /> | ||
</div> | ||
</div> | ||
<DashboardContainer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to suggest that we should merge DashboardContainer
and DashboardContent
and I suggest DashboardContainer
as the name since we have precedence for this already. Unless I'm misunderstanding things, I don't see any value or requirement to have the extra div layer.
I do think you did take the right approach though in making the Dashboard page as simple as possible and trying to keep it rendered on the server side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some updating here, but not all of what I suggested. But you'll want to check it out so we don't step on each other directly: https://github.com/refactor-group/refactor-platform-fe/pull/102/files#diff-1b7538b3757a933d976e1a796af3bbf3bc3895ae83f60d5a0562db4d2f6bbc02
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jhodapp thanks for the heads up! It looks like that branch is based off of this one right? Do you have a preference of making this change in this branch vs yours?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@calebbourg It is based off of this one indeed. I'm good either way. Maybe it makes the most sense to retarget my PR to merge into yours instead of into main?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok made this change e3ef1f5
<AddCoachingSessionButton | ||
disabled={!isCoach || !currentOrganizationId} | ||
onClick={onCreateSession} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!! This fulfills my TODO item, so thank you for refactoring this to match the style of AddMemberButton. What a pleasant surprise to discover. :)
</Link> | ||
</DropdownMenuItem> | ||
<DropdownMenuItem onClick={() => setUpdateDialogOpen(true)}> | ||
<DropdownMenuItem onClick={onUpdate}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be consistent with Agreements and Actions, can you update the drop down menu item text to be "Edit" and "Delete" instead of "Update Session" and "Delete Session"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated 536a763
Delete coaching sessions.
…age. Moves CoachingSessionList left. Adds a tab bar splitting sessions out by upcoming/previous sessions.
…or the layout of this component on the Dashboard page, and make logout more robust.
…rer and nicer to read.
…ors_and_enhance_sessions_list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome set of changes, thanks Caleb!
Description
This PR adds the ability to update an existing Coaching Session.
It also adds a new type of menu to the coaching session component. Open to suggestion on if this is what we want.
Changes
add-new-coaching-session
dialog component to be re-usable for creating new coaching session and updating existing coaching sessionsScreenshots / Videos Showing UI Changes (if applicable)
Testing Strategy
tested locally
Concerns
describe any concerns that might be worth mentioning or discussing