Comments (19)
Kay, here's a pull request that publishes webhooks for new questions: #3619
This has been deployed 🚀
from community-platform.
What does this deployment mean @pizzaisdavid?
Should notifications come in somewhere now, from dev or live?
But is it planned to support or possible to have multiple collaborators on a single Research Update?
Not planned. For now only multiple contributors on an entire research topic (like here). Not on one specific update.
from community-platform.
What does this deployment mean @pizzaisdavid?
Should notifications come in somewhere now, from dev or live?
It is possible I don't understand you correctly, but the next time a Question is asked on https://community.preciousplastic.com/questions there should be a corresponding bot post in the activitybot Discord channel.
Precious plastic is the only one with questions enabled, but in the future, if others projects have it enabled too, there would be notifications from them as well.
I thought about posting a test question on Precious Plastic, but I think it isn't possible to delete your own question, so I felt like it would be not nice.
Can I post a test question on production, to verify it works correctly? (or someone else can do it if they like.)
from community-platform.
I have addressed the Howto editing triggering a notification and need re-approval from admins (I think technically the notification happens only after the admin has re-approved.) #3613 the pull request is currently still open, but just so anyone else avoids doing that work.
from community-platform.
Thanks for the first part on this @pizzaisdavid !
Are you also up for doing the other bit of this?
from community-platform.
I might try but no promises.
Stop to trigger webhooks when content (map-pins + howtos) are edited
Moving the location of a pin does not trigger the need for re-approval but changing the "focus" of a profile does. And we want to disable that, correct?
In case anyone else wants to try, here is the related code: https://github.com/ONEARMY/community-platform/blob/master/src/stores/Maps/maps.store.ts#L187
from community-platform.
current state:
- Pins of type
member
do not need moderation. - Switching type in any way (except to
member
) requires moderation.
What I can adjust it to:
- NEW: Switching between different
non-member
types do not affect moderation status (already accepted entries stay as accepted.) - SLIGHT CHANGE: Switching from
member
to anon-member
type requires moderation, already happening indirectly. - Pins of type
member
do not need moderation (same as before.)
Example: if someone switches from member to collection point, they would need moderation. If they switch back to member, they don't need moderation. But if they switch back again to collection point (or any other non-member type) they need approval again.
Summary: any time switching from member to non-member, it would require moderation.
If the wish is they really only need to be approved once ever, then a new property could be introduced (or a different approach.) But I can't estimate the complexity of that.
Also to reiterate for those reading, whenever the moderation status of a pin is changed to accepted
it triggers the webhook.
Also, I could be wrong about any of this, anyone feel free to correct me.
from community-platform.
Thanks for the indepth look, very useful!
Your porposal sounds more complete then the original plan of no moderation at all.
To me this seems like a good path to take
EDIT: We might need a bit more thinking on this moderation flow so we can make it ready for the future.
Because at the moment "workspace" profiles (non members) dont have any moderation since this was not needed when introduced. So anyone can create one. Since the only way you could find them was on the map. Hence the Map moderation.
That said, features are added like comments and the Q&A etc that make it possible to discover a workspace account. In order to keep them legit we might need to bring moderation to the profile level, not map.
Will discuss with the team first to see whats the best way
from community-platform.
I see we want to push the questions module for precious plastic.. therefore, it would be good if we setup the webhook for that.
from community-platform.
I see we want to push the questions module for precious plastic.. therefore, it would be good if we setup the webhook for that.
Agree that would be a very nice/useful one
from community-platform.
Kay, here's a pull request that publishes webhooks for new questions: #3619
It depends on some refactoring I did to make development easier, so first that stuff needs to be merged 😈
Also, some technical things could be clarified but I've listed that in the pull request.
from community-platform.
Research Updates have a collaborators property, which is a list of usernames. I've only ever seen an Update written by one person, so a list of just one username.
But is it planned to support or possible to have multiple collaborators on a single Research Update?
I could build some more complicated logic in that case:
1 author:
📝 New update from [username1] in their research: ...
2 authors:
📝 New update from [username1] and [username2] in their research: ...
3 authors:
📝 New update from [username1], [username2], and [username3] in their research: ...
And so on..
Thoughts?
from community-platform.
yeh lets give it a try @pizzaisdavid! (I will delete for you)
from community-platform.
https://discord.com/channels/586676777334865928/599259846767935519/1251985417973006376
from community-platform.
Nice one! 💪
@goratt12 So what is the function of the new Discord Bot we recently setup up? -Since this seems to run on the original one.
from community-platform.
The function stayed in firebase-discord.ts
community-platform/functions/src/Integrations/firebase-discord.ts
Lines 18 to 25 in 7b84b82
The testing function is also in that file
community-platform/functions/src/Integrations/firebase-discord.ts
Lines 34 to 48 in 7b84b82
We are having issues with the testing in the CircleCI environment, currently moving the PR to Draft until we will figure out a solution
from community-platform.
Is there a way we could check on the cypress tests that a notification has been sent?
from community-platform.
Is there a way we could check on the cypress tests that a notification has been sent?
Option 1
The ideal: the cypress tests are ran in Docker, the backend functions are ran in the emulator inside docker, and the simple "simulated-webhook-receiver" is also started-up inside Docker.
https://github.com/ONEARMY/community-platform/tree/master/packages/simulated-webhook-receiver
They are all handled via Docker Compose, then everything is happening locally (either on the devs machine or in the CI.)
There is an endpoint in there to get the requests that have been made.
Pros:
- doesn't depend on an external service, Discord could have problems, we don't care.
- devs can run tests without internet access
- the tests would be more simple (compared to what I will propose next.)
Cons:
- Docker bro.
- Cannot be done until the backend functions for cypress tests are also ran locally.
Would be fine to implement if the tests were already running in docker.
Option 2
Achievable "today"-ish
Follow what @goratt12 has been trying to do. I guess Discord offers an API to check messages for a Discord channel.
Backend functions for cypress are configured to send to test channel.
Cypress test generates uniquely identifiable content (for example, a question with a title has is 24 random characters.)
In the assert section of the test, use their helper function posted above to check that there was a Discord message in that test channel that has the same random characters.
If static test data was used, it would pass even if it broke, due to old messages of the same static content.
Pros:
- could be done easier than "Dockerize everything"
Cons:
- Relies on an external service
- Devs who want to work on webhooks would then want access to this, another thing to keep in mind.
- A further ingraining less then ideal testing setup, but better than none, I guess?
from community-platform.
I have made an issue for cypress tests (#3694) and Guy's pull request should add unit tests #3636
from community-platform.
Related Issues (20)
- [bug] Comment count on research item out of sync HOT 1
- [bug] Profile Tips notice showing on mobile in PK's instance
- [bug] Some meta tags on ProjectKamp (and maybe FixingFashion) are wrong HOT 4
- [Cloud function]: Daily sync of research meta-data HOT 3
- [feature request] Adjusting the comment margins HOT 1
- [feature request] Improve the display of the edit and delete buttons next to user's own comment HOT 1
- [feature request] ButtonShowReplies minor adjustments HOT 1
- [feature request] Improving the display of the date HOT 1
- [bug] Adding a default avatar in CommentItem when userAvatar isn't present HOT 1
- [feature request] Update ButtonShowReplies component HOT 3
- [feature request] Improve CreateComment and CreateReply components HOT 1
- [feature request / bug] when a research module as no updates, it isn't possible to leave a comment. HOT 1
- [bug] Default sorting on research should be "latest updated" HOT 1
- [bug] changes to docuemtation are not going live HOT 3
- [feature] Cypress CircleCI- add cache browser on test_e2e jobs
- Use Nx HOT 2
- [bug] Trying to add a photo to a WIP Question submits it (confirmed on dev and local emulator) HOT 1
- [feature request] Enable Discord webhooks for Project Kamp HOT 2
- Test for webhook susccess in end-to-end tests
- Migrate Research Update collaborators property from a list with one string value to just a string.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from community-platform.