Skip to content

Conversation

@nucleogenesis
Copy link
Member

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.

image

References

Fixes #13770

Reviewer guidance

DESIGN & UX

  • Does the user need to be able to do all of this here like this?
  • After copy, should the user go to the all classes page?
  • After delete, there doesn't seem to be any other place to go to, eh?

CODE

  • I moved things around a bit - anything that I might have missed?
  • Whaddya think about how I just kinda slapped a callback prop on those modals to get the redirection working?

QA

  • Regression test the rename, copy and delete actions on the "All classes" page
  • Test the "Class edit page" (aka, the page you see when you click the class title on the "All classes" page).
  • Do you see snackbars for copy & delete after being redirected to the All classes page?

@github-actions github-actions bot added APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) DEV: frontend SIZE: medium labels Sep 23, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 23, 2025

@nucleogenesis nucleogenesis added the TODO: needs decisions Design or specifications are necessary label Sep 23, 2025
Copy link
Member

@AlexVelezLl AlexVelezLl left a 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 :)

Comment on lines +214 to +229
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',
},
];
Copy link
Member

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.

Copy link
Member Author

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;
Copy link
Member

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 😅.

Copy link
Member Author

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

Comment on lines 63 to 65
:callback="goToClassesPage"
@cancel="clearClassToDelete"
@success="clearClassToDelete"
Copy link
Member

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.

Copy link
Member Author

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.

nucleogenesis and others added 2 commits September 23, 2025 11:42
- 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>
@nucleogenesis nucleogenesis force-pushed the fix--copy-class-on-edit-page branch from b5500ed to 4c3feea Compare September 23, 2025 18:42
Copy link
Member

@marcellamaki marcellamaki left a 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

@marcellamaki marcellamaki merged commit 1e954b3 into learningequality:develop Sep 23, 2025
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) DEV: frontend SIZE: medium TODO: needs decisions Design or specifications are necessary

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Copy a class] Why can't I do this from the class details page?

3 participants