Skip to content

Commit 1cf5cfa

Browse files
authored
Merge pull request #202 from Edgeryders-Participio/remove-loomio
Remove loomio integration
2 parents 5d9577c + e14f8e3 commit 1cf5cfa

10 files changed

Lines changed: 10 additions & 175 deletions

File tree

api/package-lock.json

Lines changed: 2 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"@sendgrid/mail": "^6.3.1",
3232
"apollo-server": "2.17.0",
3333
"apollo-server-express": "2.17.0",
34-
"axios": "^0.18.0",
3534
"better-npm-run": "^0.1.0",
3635
"body-parser": "^1.18.2",
3736
"concurrently": "^3.5.1",
@@ -51,7 +50,6 @@
5150
"mime": "^2.0.3",
5251
"mocha": "^4.0.1",
5352
"neo4j-driver": "4.1.1",
54-
"node-cron": "^2.0.3",
5553
"nodemon": "^1.12.4",
5654
"normalize-url": "^4.0.0",
5755
"path": "^0.12.7",

api/src/fetch/loomio.js

Lines changed: 0 additions & 102 deletions
This file was deleted.

api/src/graphql/connectors/index.js

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,12 @@ export function createResponsibility(driver, { title, needId }, { email, orgId }
158158
return runQueryAndGetRecord(driver.session(), query, queryParams);
159159
}
160160

161-
export function addRealityHasDeliberation(driver, { from, to }) {
161+
export function addRealityHasDeliberation(driver, { from, to, orgId }) {
162162
const queryParams = {
163163
realityId: from.nodeId,
164164
infoUrl: to.url,
165165
infoId: uuidv4(),
166+
orgId,
166167
};
167168
// Use cypher FOREACH hack to only set nodeId for info if it isn't already set
168169
const query = `
@@ -172,29 +173,14 @@ export function addRealityHasDeliberation(driver, { from, to }) {
172173
FOREACH (doThis IN CASE WHEN not(exists(info.nodeId)) THEN [1] ELSE [] END |
173174
SET info += {nodeId:$infoId, created:timestamp()})
174175
WITH reality, info
176+
MATCH (org:Org {orgId:$orgId})
175177
MERGE (reality)-[:HAS_DELIBERATION]->(info)
178+
MERGE (org)-[:HAS]->(info)
176179
RETURN reality as from, info as to
177180
`;
178181
return runQueryAndGetRecordWithFields(driver.session(), query, queryParams);
179182
}
180183

181-
export function createInfo(driver, { title }, infoUrl) {
182-
const queryParams = {
183-
title,
184-
url: infoUrl,
185-
infoId: uuidv4(),
186-
};
187-
// Use cypher FOREACH hack to only set nodeId for info if it isn't already set
188-
const query = `
189-
MERGE (info:Info {url: $url})
190-
FOREACH (doThis IN CASE WHEN not(exists(info.nodeId)) THEN [1] ELSE [] END |
191-
SET info += {nodeId:$infoId, created:timestamp(), title: $title})
192-
SET info.title = $title
193-
RETURN info
194-
`;
195-
return runQueryAndGetRecord(driver.session(), query, queryParams);
196-
}
197-
198184
export function createOrg(driver, { orgId }) {
199185
const query = `
200186
MERGE (org:Org {orgId:$orgId})

api/src/graphql/resolvers/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,9 @@ const resolvers = {
292292
),
293293
addRealityHasDeliberation: combineResolvers(
294294
isAuthenticated,
295-
(obj, { from, to }, { driver }) => {
295+
(obj, { from, to }, { driver, viewedOrg: { orgId } }) => {
296296
const normalizedTo = { url: NormalizeUrl(to.url, { stripHash: true }) };
297-
return addRealityHasDeliberation(driver, { from, to: normalizedTo });
297+
return addRealityHasDeliberation(driver, { from, to: normalizedTo, orgId });
298298
},
299299
),
300300
removeRealityHasDeliberation: combineResolvers(

api/src/graphql/typeDefs.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ const typeDefs = `
9090
from: _ResponsibilityInput!
9191
to: _ResponsibilityInput!
9292
): _ResponsibilityDependsOnResponsibilitiesPayload
93-
createInfo(
94-
title: String
95-
url: String!
96-
): Info
9793
updateInfo(
9894
url: String!
9995
title: String!

api/src/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import Keycloak from 'keycloak-connect';
66
import { KeycloakContext, KeycloakSubscriptionContext, KeycloakSubscriptionHandler } from 'keycloak-connect-graphql';
77
import createDriver from './db/neo4jDriver';
88
import schema from './graphql/schema';
9-
import startSchedulers from './services/scheduler';
109
import { getCoreModels, createOrgMembership } from './services/platoCore';
1110
import { createOrg } from './graphql/connectors';
1211

@@ -104,7 +103,4 @@ createDriver().then((neo4jDriver) => {
104103
console.log(`GraphQL Server is now running on http://localhost:${API_PORT}/graphql`);
105104
console.log(`View GraphQL Playground at http://localhost:${API_PORT}/graphql`);
106105
});
107-
108-
// Start the schedulers that download data from various APIs.
109-
startSchedulers();
110106
});

api/src/services/scheduler/index.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

ui/src/scenes/Home/components/DetailViewContainer/components/DetailView/components/DetailViewBody/DetailViewBody.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const DetailViewBody = ({ node }) => (
5959
</CardSection>
6060

6161
<CardSection>
62-
<LabelSpan>Discussions on Talk:</LabelSpan>
62+
<LabelSpan>Related discussions:</LabelSpan>
6363
<Deliberations
6464
nodeType={node.__typename}
6565
nodeId={node.nodeId}

ui/src/scenes/RealityDetails/components/FullscreenDetailViewContainer/components/FullscreenDetailView/components/FullscreenDetailViewBody/FullscreenDetailViewBody.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const FullscreenDetailViewBody = ({ node }) => (
6161
</CardSection>
6262

6363
<CardSection>
64-
<LabelSpan>Discussions on Talk:</LabelSpan>
64+
<LabelSpan>Related discussions:</LabelSpan>
6565
<Deliberations
6666
nodeType={node.__typename}
6767
nodeId={node.nodeId}

0 commit comments

Comments
 (0)