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

#2441 - proposal notifications should have 'you' when I am the creator #2444

Merged
merged 9 commits into from
Dec 16, 2024

Conversation

SebinSong
Copy link
Collaborator

@SebinSong SebinSong commented Dec 6, 2024

closes #2441

Made fixes for NEW_PROPOSAL and PROPOSAL_CLOSED notifications.
PROPOSAL_EXPIRING does not need this fix because it is emitted only to those who have not voted yet. (Creator always votes for 'yes') But please let me know if I have missed anything here.

@SebinSong SebinSong self-assigned this Dec 6, 2024
Copy link

cypress bot commented Dec 6, 2024

group-income    Run #3573

Run Properties:  status check passed Passed #3573  •  git commit 51247b8fd4 ℹ️: Merge 5d1b0136293db048b921ba0f48ee7c27535061e5 into e4e1f9b8bca3105bb6490dfabdce...
Project group-income
Branch Review sebin/task/#2441-notification-should-have-you
Run status status check passed Passed #3573
Run duration 11m 03s
Commit git commit 51247b8fd4 ℹ️: Merge 5d1b0136293db048b921ba0f48ee7c27535061e5 into e4e1f9b8bca3105bb6490dfabdce...
Committer Sebin Song
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 10
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 111
View all changes introduced in this branch ↗︎

@@ -702,6 +702,7 @@ sbp('chelonia/defineContract', {
createdDate: meta.createdDate,
groupID: contractID,
creatorID: innerSigningContractID,
isCreator: innerSigningContractID === loggedIn.identityContractID,
Copy link
Member

Choose a reason for hiding this comment

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

Instead of isCreator, I think it'd be better to leave this as is, and add the creatorID to the PROPOSAL_CLOSED notification. Then, we can check for creator when the notification text is created. (The reason for doing it this way is to keep the contract code as less reliant on external state as possible).

sbp('gi.notifications/emit', 'PROPOSAL_CLOSED', {
createdDate: meta.createdDate,
groupID: contractID,
isCreator: loggedIn.identityContractID === proposal.creatorID,
Copy link
Member

Choose a reason for hiding this comment

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

@SebinSong
Copy link
Collaborator Author

@taoeffect Updated the PR for Ricardo's feedbacks.

Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

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

Nice job @SebinSong!

Left some feedback!

Comment on lines 149 to 154
const args = isCreator
? null
: {
name: `${CHATROOM_MEMBER_MENTION_SPECIAL_CHAR}${data.creatorID}`,
...LTags('strong')
}
Copy link
Member

Choose a reason for hiding this comment

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

It's not like args is used if isCreator is true, so this ?: isn't needed here, these changes can be reverted.

REMOVE_MEMBER: L('{strong_}{name}{_strong} proposed to remove a member from the group. Vote now!', args),
GENERIC: L('{strong_}{name}{_strong} created a proposal. Vote now!', args)
ADD_MEMBER: isCreator
? L('you proposed to add a member to the group.')
Copy link
Member

Choose a reason for hiding this comment

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

Every sentence that starts with "you" needs to be replaced with "You" because sentences should start with an uppercase letter.

? L('your proposal to add {member} to the group was {strong_}{closedWith}{_strong}.', args)
: L("{strong_}{name}'s{_strong} proposal to add {member} to the group was {strong_}{closedWith}{_strong}.", args),
[PROPOSAL_REMOVE_MEMBER]: isCreator
? L('your proposal to remove {member} from the group was {strong_}{closedWith}{_strong}.', args)
Copy link
Member

Choose a reason for hiding this comment

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

Every sentence that starts with "your" needs to be replaced with "Your" because sentences should start with an uppercase letter.

@SebinSong
Copy link
Collaborator Author

@taoeffect updated the PR again for your feedbacks.

Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

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

Nice work @SebinSong!

@taoeffect taoeffect merged commit d4c870a into master Dec 16, 2024
4 checks passed
@taoeffect taoeffect deleted the sebin/task/#2441-notification-should-have-you branch December 16, 2024 17:56
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.

Notification should say "you" / "your" for user's own proposal
3 participants