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

MC-1656: adding edit & remove section item actions #1231

Merged
merged 5 commits into from
Mar 4, 2025

Conversation

katerinachinnappan
Copy link
Contributor

@katerinachinnappan katerinachinnappan commented Feb 27, 2025

Goal

Wiring up actions for editing corpus metadata on a SectionItem & removing a SectionItem.

  • Added new onRemove callback to CardActionButtonRow to differentiate between the onReject callback. Using the ClearIcon (X) for the remove button.
  • Updated SectionDetails component tests.

Todos

  • deploy to dev

Reference

Demo

Screen.Recording.2025-02-27.at.13.37.45.mov

Tickets:

@katerinachinnappan katerinachinnappan requested a review from a team as a code owner February 27, 2025 21:38
jpetto
jpetto previously approved these changes Mar 3, 2025
Copy link
Collaborator

@jpetto jpetto left a comment

Choose a reason for hiding this comment

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

one nit about a test name, but this looks really good!

suggestion to have a curator or two test on dev before merging, but i'll leave that up to you. (we don't have any data in prod yet so i don't think it's too risky to merge now.)

onMoveToBottom,
onReject,
onRemove,
} = props;
Copy link
Collaborator

Choose a reason for hiding this comment

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

not needed yet, but a potential thought for the future - would it make sense to abstract the actions a bit more, so this component doesn't need to know about all available actions across all card implementations?

a consideration for if/when we expand the available card actions...

Copy link
Contributor Author

@katerinachinnappan katerinachinnappan Mar 4, 2025

Choose a reason for hiding this comment

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

@jpetto yeah good thought! I was thinking about it, we could potentially introduce a new generic type:

interface CardAction {
  actionName: string;
  icon: React.ReactNode;
  onClick: VoidFunction;
}

and maybe update CardActionButtonRowProps:

interface CardActionButtonRowProps {
  cardActionButtonsRight?: CardAction[]; // action buttons aligned to bottom right
  cardActionButtonsLeft?: CardAction[];  // action buttons aligned to bottom left
}

I can make a chore ticket to do this!

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, i think that's a good ticket to file. thanks!

@katerinachinnappan katerinachinnappan merged commit 24ea24e into main Mar 4, 2025
10 checks passed
@katerinachinnappan katerinachinnappan deleted the katerina/MC-1656-edit-remove-sectionItems branch March 4, 2025 21:44
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