feat: supports contributors on research item #2006#2007
Conversation
4 flaky tests on run #3063 ↗︎Details:
|
|||||||||||||||||||||||||||||||||||||||
| Test | Artifacts | |
|---|---|---|
| [How To] > [Edit a how-to] > [By Authenticated] |
Output
Screenshots
|
|
notifications.spec.ts • 1 flaky test • ci-chrome
| Test | Artifacts | |
|---|---|---|
| [Notifications] > [are generated by adding comments to research] |
Output
Screenshots
|
|
settings.spec.ts • 1 flaky test • ci-chrome
| Test | Artifacts | |
|---|---|---|
| [Settings] > [Focus Machine Builder] > [Edit a new profile] |
Output
Screenshots
|
|
common.spec.ts • 1 flaky test • ci-chrome
| Test | Artifacts | |
|---|---|---|
| [Common] > [Page Navigation] |
Output
Screenshots
|
|
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.
664b175 to
1c78806
Compare
|
Visit the preview URL for this PR (updated for commit 3a59076): https://onearmy-next--pr2007-feat-support-contrib-pc452dqi.web.app (expires Fri, 21 Apr 2023 21:16:07 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 6d65e4f8fee2f6ab2da0c1c3b85b8797d66afa59 |
|
@davehakkens what do you think. Would it be worth continuing work on this item? |
|
For sure! I think this is a very useful PR. Specially later if it would also have notifications 🔥 |
|
what do you think about wrapping up this one @thisislawatts? |
|
How do we think Research contributors should interact with the Notifications behaviour? Would a Research contributor want any of the following messages:
|
Both of those are very interesting for contributors to receive. You trying to implement notifications in this PR as well? 🔥 |
|
I think let's raise a separate PR, integrating this with the notifications mechanism. This PR has been standing open for long enough. Edit: It looks like the Research notifications PR has not been merged yet. |
f326231 to
9e128ef
Compare
|
Would it be possible to start by adding it only in the new CTA for now? |
|
🤦🏻 Of course, thanks @davehakkens! I totally forgot about that. |
2a0e340 to
1b0d792
Compare
|
Oee is this one ready for review @thisislawatts? :) |
|
Nice! Works good here Could we either way change the text size to |
|
Also any suggestions or references to link to when writing a follow up issue? > |
|
Thanks for taking a look @davehakkens, I've updated the wording and increased the fontSize. |
1b0d792 to
9805425
Compare
|
You up for reviewing this one @asheerrizvi ? |
b5d89df to
0fb954e
Compare
|
@davehakkens sure |
0fb954e to
79338e1
Compare
Introduces an array item to Research articles which contains a list of usernames. This is a deliberately naive implementation as Research articles are currently only available on the Project Kamp instance. Future development here may involve aligning with the UserReference pattern used to persist @mention references. The UserReference convention is more robust as it uses IDs rather than usernames to identify users. The additional complexity is difficult to justify in this instance as the target user story here only covers a few Project Kamp contributors.
79338e1 to
5a242c1
Compare
5a242c1 to
5d66df0
Compare
chrismclarke
left a comment
There was a problem hiding this comment.
Many thanks @thisislawatts, all the functionality looks good to me and I really like the UI also.
I've added a couple general thoughts in-line, but nothing that blocks this PR so I'd say good to go.
Thanks for the contribution!
| </Label> | ||
| <Field | ||
| name="collaborators" | ||
| component={FieldInput} |
There was a problem hiding this comment.
nit(non-blocking)
I could imagine a nice feature in the future to have some sort of autofill/lookup as you start typing names, but given that would need some sort of aggregation for all usernames or other server-side mechanism definitely beyond scope of this PR.
|
|
||
| const collaborators = Array.isArray(item.collaborators) | ||
| ? item.collaborators | ||
| : ((item.collaborators as string) || '').split(',').filter(Boolean) |
There was a problem hiding this comment.
nit(non-blocking)
Do we need the catch for string-formatted collaborators? I think it's just this PR adding, so hopefully that means in production nothing should be malformed (unless it relates to the input field which I know is a string?). Happy to keep for now in either case
| {collaborators.length + | ||
| (collaborators.length === 1 | ||
| ? ' contributor' | ||
| : ' contributors')} |
There was a problem hiding this comment.
nit(non-blocking)
Not really related to this PR, but at some point it might be worth thinking how we can make a bit more consistent use of pluralization. Perhaps a utility function that takes inputs for base word and singular/plural modifiers? e.g. textPlural(collaborators.length,'contributor','contributors')?
I also quite like the syntax in https://www.npmjs.com/package/simplur as an option, and am aware of more heavyweight options like pluralize (but don't think we really need something as comprehensive)
Let me know if you think it's worth making a follow-up issue on this (I can flag on maintainer call and add to git), or if you think makes more sense just to stick to lightweight inline functions
There was a problem hiding this comment.
Good idea, I think it would be useful to introduce a helper method for this. I think either simplur or something like it would be very useful. Thanks for the link I had not seen these tagged functions before, very nice 💅🏻
There was a problem hiding this comment.
Perfect, I'll add it to next month's discussion and open an issue for it following.
Yeah a definitely blindspot for me too, been using things like graphql{....} , html<div>...</div> for years but never stopped to wonder why it worked (just naively assumed it was something to do with vscode extensions and intellisense, makes a lot more sense that it's a supported syntax)
| newItem._createdBy, | ||
| '/research/' + newItem.slug + '#update_' + existingUpdateIndex, | ||
| ) | ||
|
|
There was a problem hiding this comment.
Thanks for tidying this up, agree makes more sense to have the logic for this in the store
|
awesome. good to see this merged! Thanks @chrismclarke and @thisislawatts |
|
🎉 This PR is included in version 1.41.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |


Still to be done:
PR Checklist
PR Type
Git Issues
Closes #2006, #2143
Note on implementation
Introduces an array item to Research articles which contains a list
of usernames. This is a deliberately naive implementation as Research
articles are currently only available on the Project Kamp instance.
Future development here may involve aligning with the UserReference
pattern used to persist @mention references. The UserReference
convention is more robust as it uses IDs rather than usernames to
identify users. The additional complexity is difficult to justify
in this instance as the target user story here only covers a few
Project Kamp contributors.