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

#169/message item deleted #226

Merged
merged 14 commits into from
Jun 14, 2024
Merged

#169/message item deleted #226

merged 14 commits into from
Jun 14, 2024

Conversation

camelPhonso
Copy link
Contributor

Description

Closes #169

If an item is deleted all conversations related to that item will now receive a notification informing that it is no longer available. Conversations no longer get automatically deleted.

Files changed

  • DeleteButton.tsx - edited the handler to call insertSystemMessage before deleting the item
  • markAsRead.ts has been renamed to markMessageAsRead.ts since we also have a markConversationAsRead.ts in the works. This change touched a few other files where we import the function
  • SystemMessageCard.tsx - was re-styled slightly because it was sitting flat against the bottom of the wrapper at the start of conversations
  • new migration file - this PR includes a change to the database that removes the item_id foreign key from user_conversations table
  • selectConversationsByItemId.ts - new util that returns all active conversations that relate to an item
  • insertSystemMessage.ts - added documentation to this util because I kept needing to check whether it need an id from conversations or user_conversations

UI changes

Conversations now get a new SystemMessageCard.tsx added when the relevant item is deleted from the database

Screenshot 2024-05-26 at 08 20 00

Changes to Documentation

This PR did not require any additional documentation.

Tests

No new tests 😓 - testability for our components is yet again being worked on in another issue

Copy link

netlify bot commented May 26, 2024

Deploy Preview for cool-creponne-3e1272 ready!

Name Link
🔨 Latest commit 56b296a
🔍 Latest deploy log https://app.netlify.com/sites/cool-creponne-3e1272/deploys/666858599be4e100077694be
😎 Deploy Preview https://deploy-preview-226--cool-creponne-3e1272.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@nichgalzin nichgalzin left a comment

Choose a reason for hiding this comment

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

Besides that one naming suggestion I commented on below this is some hot stuff! Love it, and neatly done. Good job babes!

components/DeleteButton.tsx Outdated Show resolved Hide resolved
@eliazzo eliazzo merged commit ed8dc43 into dev Jun 14, 2024
6 checks passed
@eliazzo eliazzo deleted the #169/message-item-deleted branch June 14, 2024 09:43
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.

Update conversation when item is no longer available
3 participants