-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
#2441 - proposal notifications should have 'you' when I am the creator #2444
Conversation
group-income Run #3573
Run Properties:
|
Project |
group-income
|
Branch Review |
sebin/task/#2441-notification-should-have-you
|
Run status |
Passed #3573
|
Run duration | 11m 03s |
Commit |
51247b8fd4 ℹ️: Merge 5d1b0136293db048b921ba0f48ee7c27535061e5 into e4e1f9b8bca3105bb6490dfabdce...
|
Committer | Sebin Song |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
10
|
Skipped |
0
|
Passing |
111
|
View all changes introduced in this branch ↗︎ |
frontend/model/contracts/group.js
Outdated
@@ -702,6 +702,7 @@ sbp('chelonia/defineContract', { | |||
createdDate: meta.createdDate, | |||
groupID: contractID, | |||
creatorID: innerSigningContractID, | |||
isCreator: innerSigningContractID === loggedIn.identityContractID, |
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.
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).
frontend/model/contracts/group.js
Outdated
sbp('gi.notifications/emit', 'PROPOSAL_CLOSED', { | ||
createdDate: meta.createdDate, | ||
groupID: contractID, | ||
isCreator: loggedIn.identityContractID === proposal.creatorID, |
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.
@taoeffect Updated the PR for Ricardo's feedbacks. |
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.
Nice job @SebinSong!
Left some feedback!
const args = isCreator | ||
? null | ||
: { | ||
name: `${CHATROOM_MEMBER_MENTION_SPECIAL_CHAR}${data.creatorID}`, | ||
...LTags('strong') | ||
} |
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.
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.') |
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.
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) |
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.
Every sentence that starts with "your" needs to be replaced with "Your" because sentences should start with an uppercase letter.
@taoeffect updated the PR again for your feedbacks. |
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.
Nice work @SebinSong!
closes #2441
Made fixes for
NEW_PROPOSAL
andPROPOSAL_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.