
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@aragon/apps-discussions
Advanced tools
This repository is the starting point of contextual aragon discussions, it's composed of a few core components that a developer wishing to incorporate discussions needs to be aware of:
This repository is the starting point of contextual aragon discussions, it's composed of a few core components that a developer wishing to incorporate discussions needs to be aware of:
DiscussionsWrapper component - a redux-like provider that provides discussion data through React context to all nested children and grandchildren.Discussion component - a discussion thread component that displays all the discussion posts of a specific discussion thread and allows the user to take specific actions like post, hide, and revise.The purpose of this readme is to document how all the moving parts are working together, how a developer could use this code in their own DAO, and what still needs to be done.
You first need to be running your contextual discussioned app + aragon client with a very specific version of aragon.js. You will need a version with the following 3 features:
We'd recommend running the latest master branch of the aragon client.
These features should be included by default in aragon.js and aragon client come October 2019.
If there is more demand for including contextual discussions in applications, we'll rip out the discussions app in this repo and publish it as a node module(s). For now, you should just copy and paste the /apps/discussions directory into your app, and look at the apps/planning-suite-kit as a reference for deploying it as a dependency for your own app.
Here's a function we use to install the discussion app within the DAO:
function createDiscussionApp(address root, ACL acl, Kernel dao) internal returns (DiscussionApp app) {
bytes32 appId = apmNamehash("discussions");
app = DiscussionApp(dao.newAppInstance(appId, latestVersionAppBase(appId)));
app.initialize();
acl.createPermission(ANY_ENTITY, app, app.DISCUSSION_POSTER_ROLE(), root);
}
Every action that gets forwarded through the discussions app creates a new discussion thread. So we need to add the discussions app to the forwarding chain of any action we want to trigger a discussion. In this example, we have a new discussion created before a new dot-vote gets created:
acl.createPermission(discussions, dotVoting, dotVoting.ROLE_CREATE_VOTES(), voting);
If discussions is the only app granted the ROLE_CREATE_VOTES permission, every new vote will have its own discussion thread.
When you send an intent to trigger the action that gets forwarded through the discussions app, you should see the appropriate radspec in the aragon client transaction confirmation panel.
You should first take the discussions/app/modules/Discussions.js component, and wrap your entire react tree inside of it. You need to pass your instance of AragonApp to it as well
import { useAragonApi } from '@aragon/api-react'
import Discussions from 'discussions/app/modules/Discussions'
const App = () => {
const { api } = useAragonApi()
return {
<Discussions app={api}>
{...}
</Discussions>
}
}
Then, wherever you want to render a contextual discussion thread, you render the Discussion component, passing in a discussionId and the ethereumAddress of the logged in user:
import Discussion from 'discussions/app/modules/Discussion'
const ComponentThatRendersDiscussionThread = ({ discussionId, ethereumAddress }) => {
return {
<Discussion discussionId={discussionId} ethereumAddress={ethereumAddress} />
}
}
Where does the discussionId come from? It's basically the unique identifier used by the Discussions App to keep track off all the threads it has created.
This id will be returned to your app context as a ForwardedActions event, similar to an external contract event, so it's important that it gets passed into the <Discussion /> component successfully.
The discussionId is a Number that represents the relative order in which this specific transaction intent was forwarded through the discussion app. For example, let's say you had 5 transactions that were forwarded through the discussion app - the discussionId relative to these 5 transactions is the order in which they occured. It could be:
1, 2, 3, 4, 5 or 14, 15, 16, 19, 20. The only thing that matters is the order the transactions occured. The discussion app will figure out the rest for you.
The discussions app generates a new discussion thread every time an action gets successfully forwarded. When the discussions app script loads, it uses the latest forwarder api to keep track of which discussion threads belong to which app.
On the frontend, the Discussions.js component senses when the handshake has been established between the front-end and client. Once it does, it initializes a new instance of the DiscussionApi.
The discussionApi is responsible for keeping track of all the discussion threads and posts for your app. Its also equipped with methods to post, hide, and revise Discussion Posts.
FAQs
This repository is the starting point of contextual aragon discussions, it's composed of a few core components that a developer wishing to incorporate discussions needs to be aware of:
The npm package @aragon/apps-discussions receives a total of 1 weekly downloads. As such, @aragon/apps-discussions popularity was classified as not popular.
We found that @aragon/apps-discussions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.