-
Notifications
You must be signed in to change notification settings - Fork 866
Can copy (or rename or delete) on ClassEditPage as well #13771
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
Can copy (or rename or delete) on ClassEditPage as well #13771
Conversation
Build Artifacts
|
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.
Thanks @nucleogenesis! Just a couple of nitpick comments :)
| return [ | ||
| { | ||
| label: this.copyClass$(), | ||
| value: 'COPY_CLASS', | ||
| id: 'copy', | ||
| }, | ||
| { | ||
| label: this.renameClassLabel$(), | ||
| value: 'EDIT_CLASS_NAME', | ||
| id: 'rename', | ||
| }, | ||
| { | ||
| label: this.deleteClass$(), | ||
| value: 'DELETE_CLASS', | ||
| id: '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.
I don't think we need the id property for KDropdownMenu options, and we would probably want to use the Modals.DELETE_CLASS constants instead of the magic strings.
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.
Admittedly I just copied this from the ManageClassPage component. I was fully under the impression that the ID was needed but then I look at KDS and there's no use of id in UiPopover or KDropdownMenu. Makes me think I'm mixing a couple things up.
| .title-and-options { | ||
| display: flex; | ||
| flex-direction: row; |
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.
Just noting that row is the deafult value for flex-direction, so we usually don't need to set it explicitly 😅.
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 used the Chrome devtools little flexbox helper thing to apply the styles til it looked right then copy-pasted the rules - was a little aggressive setting each option lol
| :callback="goToClassesPage" | ||
| @cancel="clearClassToDelete" | ||
| @success="clearClassToDelete" |
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.
Are there benefits of passing the goToClassPage callback as a prop, instead of using it in the @success event? I see that this callcback is always being called in the only place where the ClassDeleteModal component emits the @success event.
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.
Great catch - I did the callback first in the copy modal which didn't emit success then just quickly applied the same to the other modal where I needed it.
Just pushed a commit reverting the callback props and handling the "go back" stuff in the success event handler.
- Move ClassRenameModal, ClassCopyModal, and ClassDeleteModal to common folder - Move useDeleteClass composable to composables directory - Update all import references to point to new locations - Add deleteClass string to bulkUserManagementStrings and update imports - Fix copy class modal functionality on ClassEditPage - Add dropdown menu with copy, rename, and delete options to class edit page - Add callback support for navigation after modal operations where needed 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
b5500ed to
4c3feea
Compare
marcellamaki
left a comment
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.
Did a quick code re-review and some extra manual QA -- this is good to go, and we'll have the QA team take a closer look when testing beta0
Summary
Done w/ help of Claude Code, primarily for the tedious file moving & import renaming.
Addressing #13770 - this takes a very opinionated approach to the UX that will allow the user to copy. Basically, I went to figure out where I'd put a "Copy this class" button to trigger the modal and thought that if I'm putting a button somewhere I might as well make the UX consistent w/ the context dropdown on the classes table.
The thing I think might be a bit contentious is that I made both the "Assign Coaches" and the "Enroll Learners" buttons into Primary buttons to visually distinguish them from the secondary-style Options dropdown button.
References
Fixes #13770
Reviewer guidance
DESIGN & UX
CODE
QA