Open TylerHendrickson opened 2 months ago
@greg-adams Just calling out this addition that I just made to this ticket's implementation notes, per https://github.com/usdigitalresponse/usdr-gost/issues/3407#issuecomment-2364259301:
- API responses that retrieve notes and their associated data currently do not provide user's email addresses or preferred avatar colors, both of which are required to properly represent users in the notes feed. To include this data in API responses, make the following modifications to the
getCurrentNoteRevisions()
function defined inpackages/server/src/lib/grantsCollaboration/notes.js
:
- Add
users.avatar_color as user_avatar_color
to the main database query'sSELECT
statement.- (Note: the query's
SELECT
statement already includesusers.email as user_email
.)- Update the function's return value so that the
user_avatar_color
value of each row in the query result set is mapped tonotes[].user.avatar_color
in the returned object.- Update the function's return value so that the
user_email
value of each row in the query result set is mapped tonotes[].user.email
in the returned object.
Note that we also need user_email
mapped here, in addition to the inclusion of user_avatar_color
.
So far this is looking really great! per slack discussion, designs are being updated to clarify how delete note should work - I will create a new ticket once that is clarified!
closing this out as there are no outstanding functionality issues. If we find any bugs or adjustment needed in future bug bashing for this feature, we will open up new issues!
Subtask of [STORY]: Update 'Status' to 'Follow + Note' feature #2960
Blocked by
3204
3205
3426
3406
Blocks
N/A
Definition of Done
See Figma Designs
GrantNote
component, which displays as the following:editable
slot)GrantNote
component, which displays an "Edit" link.GrantNote
component, none of which display an "Edit" linkImplementation details
followNotesEnabled
feature flag istrue
.getCurrentNoteRevisions()
function defined inpackages/server/src/lib/grantsCollaboration/notes.js
:users.avatar_color as user_avatar_color
to the main database query'sSELECT
statement.SELECT
statement already includesusers.email as user_email
.)user_avatar_color
value of each row in the query result set is mapped tonotes[].user.avatar_color
in the returned object.user_email
value of each row in the query result set is mapped tonotes[].user.email
in the returned object.GrantNote
component.GrantNote
component, so that email addresses are copied to clipboard when clicked.GET /api/organizations/:organizationId/grants/:grantId/notes/:userId
endpoint implemented in #3426, providing a query parameter oflimit=1
.notes
array, this will be the note that was last submitted by the identified user for the identified grant.notes
array, then the identified user has not yet submitted a note for the identified grant.GET /api/organizations/:organizationId/grants/:grantId
route implemented in #3205 supports requests to fetch (paginated) followers of a grant within the same organization as the currently-authenticated user.limit=3
.limit=10
andpaginateFrom={{ fromId }}
, where{{ fromId }}
is the.paginate.from
value provided by the response data in the previous request to this endpoint.PUT /api/organizations/:organizationId/grants/:grantId/notes/revision
endpoint (implemented in #3204) to save the note.