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
[GH-4476] Bug: No card delete confirmation status for some cards #4612
base: main
Are you sure you want to change the base?
[GH-4476] Bug: No card delete confirmation status for some cards #4612
Conversation
Hello @JesusMurguia, Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here. |
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, @JesusMurguia Let's create a common function for these to call to ensure consistency. It appears that the same changes are also necessary in galleryCard.tsx
and fullCalendar.tsx
Hello @sbishel, I noticed the |
Hi @JesusMurguia, sure I can try to provide some guidance. If you dig in to why the I think the best (and probably easiest) way to handle this would be to create a similar component to A further enhancement would then be to create a common |
webapp/src/store/cards.ts
Outdated
return getCards(state)[cardId]?.title === '' && getCards(state)[cardId]?.fields.contentOrder.length === 0 && Object.keys(getCards(state)[cardId]?.fields?.properties).length === 0 && !state.comments.commentsByCard[cardId] && !state.attachments.attachmentsByCard[cardId] | ||
} | ||
} | ||
|
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.
Suggest using existing selectors to retrieve data vs accessing state directly.
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 moved the isCardEmpty
function into a hook and used the selectors there in my latest commit, please let me know if this is okay
Got it, thank you. I will work on 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.
Very nice...code looks good. Can you add unit tests where appropriate?
I added the unit tests for the new component |
Please create a PR in mattermost server repo so I can create a test server to test this on? Thank you :) |
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 @JesusMurguia. Nice work.
@lindy65 - I created a cloud server and uploaded the plugin built here (since we are back in plugin mode.) Normal cloud logins. |
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 @JesusMurguia - this issue is fixed. I tested on the server Scott spun up and tested according to steps on #4476. Delete confirmation modal is present.
cc @sbishel
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
/update-branch |
Summary
I added checks for any content on the card (title, properties, comments, attachments, description).
Ticket Link
Fixes #4476