diff --git a/README.md b/README.md
index f0688f820..8ddf97fe5 100644
--- a/README.md
+++ b/README.md
@@ -20,12 +20,71 @@ At the same time, it should be possible in the future to link these networks wit
In other words, we are interested in a network of networks and in keeping the data as close as possible to the user and the operator they trusts.
-## Introduction
+## Screenshots
+
+
+
+Check out more screenshots [here](/wiki/en:Screenshots).
+
+## Features
+
+Ocelot.social networks feature:
+* user accounts
+* user roles
+* posts and comments
+* groups
+* maps
+* search
+* filters
+* and more …
+
+Check out the [full feature list](/wiki/en:FAQ#what-are-the-features).
+
+## User Guide and Frequently Asked Questions
+
+In the [wiki](/wiki) you can find more information.
+
+* [User Guide](/wiki/en:User-Guide)
+* [Frequently Asked Questions](/wiki/en:FAQ)
+
+## Demo
+
+Try out our live demo network, see [here](#live-demo-and-developer-logins).
+
+## Help us
+
+If you're wondering how you could help, there are plenty of ways, e.g.:
+
+* Spread the good word about ocelot.social to make it more popular:
+ * Add the link [ocelot.social](https://ocelot.social) to your website.
+ * Give ocelot.social a Like at https://alternativeto.net/software/ocelot-social/.
+ * Star our project on GitHub at https://github.com/Ocelot-Social-Community/Ocelot-Social/.
+ * Promote it on your social networks.
+ * Tell your friends about it by word-of-mouth.
+ * Write a press article on ocelot.social or contact the editorial office of your local newspage or radio station.
+* Take a [good first issue](https://github.com/Ocelot-Social-Community/Ocelot-Social/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) or issues that need help. Make sure to read [CONTRIBUTING.md](/CONTRIBUTING.md) first though.
+* Testing and [reporting](/issues/new/choose) bugs.
+* Translating: Please [contact us](#contact).
+* Reviewing and testing pull requests.
+
+## Donate
+
+Your donation is very welcome and helps to enhance and improve the network. This software is mostly developped and maintained by the association [busFaktor() e.V.](https://www.busfaktor.org/en). Please support us with a [donation](https://www.busfaktor.org/en/donations) to busFaktor() e.V.. Thanks a lot! ❤️
+
+## Contact
+
+Are you interested in operating your own ocelot.social network or becoming a user? Please contact us here:
+* [hello@ocelot.social](mailto:hello@ocelot.social)
+* [Discord](https://discord.com/invite/DFSjPaX)
+
+## For Developers and Contributors
+
+### Introduction
Have a look into our short video:
[ocelot.social - GitHub - Developer Welcome - Tutorial (english)](https://www.youtube.com/watch?v=gZSL6KvBIiY&list=PLFMD5liPP01kbuReHxYXxv_1fI5rIgS1f&index=1)
-## Directory Layout
+### Directory Layout
There are three important directories:
@@ -41,9 +100,9 @@ There are two approaches:
1. [Local](#local-installation) installation, which means you have to take care of dependencies yourself.
2. **Or** Install everything through [Docker](#docker-installation) which takes care of dependencies for you.
-## Installation
+### Installation
-### Clone the Repository
+#### Clone the Repository
Clone the repository, this will create a new folder called `Ocelot-Social`:
@@ -65,7 +124,7 @@ Change into the new folder.
$ cd Ocelot-Social
```
-## Live Demo And Developer Logins
+### Live Demo And Developer Logins
**Try out our deployed [development environment](https://stage.ocelot.social).**
@@ -74,7 +133,7 @@ Visit our staging networks:
* central staging network: [stage.ocelot.social](https://stage.ocelot.social)
-### Login
+#### Login
Logins for the live demos and developers (local developers after the following installations) in the browser:
@@ -84,11 +143,11 @@ Logins for the live demos and developers (local developers after the following i
| `moderator@example.org` | 1234 | moderator |
| `admin@example.org` | 1234 | admin |
-### Docker Installation
+#### Docker Installation
Docker is a software development container tool that combines software and its dependencies into one standardized unit that contains everything needed to run it. This helps us to avoid problems with dependencies and makes installation easier.
-#### General Installation of Docker
+##### General Installation of Docker
There are [several ways to install Docker CE](https://docs.docker.com/install/) on your computer or server.
@@ -105,7 +164,7 @@ $ docker-compose --version
docker-compose version 1.23.2
```
-#### Start Ocelot-Social via Docker-Compose
+##### Start Ocelot-Social via Docker-Compose
Prepare ENVs once beforehand:
@@ -152,11 +211,11 @@ $ docker-compose exec backend yarn run db:seed
For a closer description see [backend README.md](./backend/README.md).
For a full documentation see [SUMMARY](./SUMMARY.md).
-### Local Installation
+#### Local Installation
For a full documentation see [SUMMARY](./SUMMARY.md).
-## Contributing
+### Contributing
Choose an issue (consider our label [good-first-issue](https://github.com/Ocelot-Social-Community/Ocelot-Social/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)) and leave a comment there. We will then invite you to join our volunteers team.
To have the necessary permission to push directly to this repository, please accept our invitation to join our volunteers team, you will receive via the email, Github will send you, once invited. If we did not invite you yet, please request an invitation via Discord.
@@ -182,7 +241,7 @@ $ yarn test
Check out our [contribution guideline](./CONTRIBUTING.md), too!
-### Developer Chat
+#### Developer Chat
Join our friendly open-source community on [Discord](https://discord.gg/AJSX9DCSUA) :heart_eyes_cat:
Just introduce yourself at `#introduce-yourself` and mention a mentor or `@@Mentors` to get you onboard :neckbeard:
@@ -190,13 +249,13 @@ Just introduce yourself at `#introduce-yourself` and mention a mentor or `@@Ment
We give write permissions to every developer who asks for it. Just text us on
[Discord](https://discord.gg/AJSX9DCSUA).
-## Deployment
+### Deployment
Deployment methods can be found in the [Ocelot-Social-Deploy-Rebranding](https://github.com/Ocelot-Social-Community/Ocelot-Social-Deploy-Rebranding) repository.
The only deployment method in this repository for development purposes as described above is `docker-compose`.
-## Technology Stack
+### Technology Stack
* [VueJS](https://vuejs.org/)
* [NuxtJS](https://nuxtjs.org/)
@@ -204,7 +263,7 @@ The only deployment method in this repository for development purposes as descri
* [NodeJS](https://nodejs.org/en/)
* [Neo4J](https://neo4j.com/)
-### For Testing
+#### For Testing
* [Cypress](https://docs.cypress.io/)
* [Storybook](https://storybook.js.org/)
@@ -212,7 +271,7 @@ The only deployment method in this repository for development purposes as descri
* [Vue Test Utils](https://vue-test-utils.vuejs.org/)
* [ESLint](https://eslint.org/)
-## Attributions
+### Attributions
Locale Icons made by [Freepik](http://www.freepik.com/) from [www.flaticon.com](https://www.flaticon.com/) is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/).
@@ -220,6 +279,6 @@ Browser compatibility testing with [BrowserStack](https://www.browserstack.com/)
-## License
+### License
See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).
diff --git a/backend/src/helpers/jest.js b/backend/src/helpers/jest.js
index e3f6a3c84..09744e9f2 100644
--- a/backend/src/helpers/jest.js
+++ b/backend/src/helpers/jest.js
@@ -1,13 +1,3 @@
-// TODO: can be replaced with: (which is no a fake)
-// import gql from 'graphql-tag'
-// See issue: https://github.com/Ocelot-Social-Community/Ocelot-Social/issues/5152
-
-//* This is a fake ES2015 template string, just to benefit of syntax
-// highlighting of `gql` template strings in certain editors.
-export function gql(strings) {
- return strings.join('')
-}
-
// sometime we have to wait to check a db state by having a look into the db in a certain moment
// or we wait a bit to check if we missed to set an await somewhere
// see: https://www.sitepoint.com/delay-sleep-pause-wait/
diff --git a/backend/src/middleware/hashtags/hashtagsMiddleware.spec.js b/backend/src/middleware/hashtags/hashtagsMiddleware.spec.js
index bcecee73b..10d53ab7b 100644
--- a/backend/src/middleware/hashtags/hashtagsMiddleware.spec.js
+++ b/backend/src/middleware/hashtags/hashtagsMiddleware.spec.js
@@ -1,4 +1,4 @@
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { cleanDatabase } from '../../db/factories'
import { createTestClient } from 'apollo-server-testing'
import { getNeode, getDriver } from '../../db/neo4j'
diff --git a/backend/src/middleware/languages/languages.spec.js b/backend/src/middleware/languages/languages.spec.js
index 99e87152e..f4f57adc4 100644
--- a/backend/src/middleware/languages/languages.spec.js
+++ b/backend/src/middleware/languages/languages.spec.js
@@ -1,5 +1,5 @@
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../db/neo4j'
import createServer from '../../server'
import { createTestClient } from 'apollo-server-testing'
diff --git a/backend/src/middleware/notifications/notificationsMiddleware.spec.js b/backend/src/middleware/notifications/notificationsMiddleware.spec.js
index ad7fd3f8c..a8a5d396b 100644
--- a/backend/src/middleware/notifications/notificationsMiddleware.spec.js
+++ b/backend/src/middleware/notifications/notificationsMiddleware.spec.js
@@ -1,4 +1,4 @@
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { cleanDatabase } from '../../db/factories'
import { createTestClient } from 'apollo-server-testing'
import { getNeode, getDriver } from '../../db/neo4j'
diff --git a/backend/src/middleware/orderByMiddleware.spec.js b/backend/src/middleware/orderByMiddleware.spec.js
index 1aef1c52a..7453cf301 100644
--- a/backend/src/middleware/orderByMiddleware.spec.js
+++ b/backend/src/middleware/orderByMiddleware.spec.js
@@ -1,4 +1,4 @@
-import { gql } from '../helpers/jest'
+import gql from 'graphql-tag'
import { cleanDatabase } from '../db/factories'
import { getNeode, getDriver } from '../db/neo4j'
import { createTestClient } from 'apollo-server-testing'
diff --git a/backend/src/middleware/permissionsMiddleware.spec.js b/backend/src/middleware/permissionsMiddleware.spec.js
index 35a2ab82b..667e74164 100644
--- a/backend/src/middleware/permissionsMiddleware.spec.js
+++ b/backend/src/middleware/permissionsMiddleware.spec.js
@@ -1,7 +1,7 @@
import { createTestClient } from 'apollo-server-testing'
import createServer from '../server'
import Factory, { cleanDatabase } from '../db/factories'
-import { gql } from '../helpers/jest'
+import gql from 'graphql-tag'
import { getDriver, getNeode } from '../db/neo4j'
import CONFIG from '../config'
diff --git a/backend/src/middleware/softDelete/softDeleteMiddleware.spec.js b/backend/src/middleware/softDelete/softDeleteMiddleware.spec.js
index 7e14cad1f..88d46a1c7 100644
--- a/backend/src/middleware/softDelete/softDeleteMiddleware.spec.js
+++ b/backend/src/middleware/softDelete/softDeleteMiddleware.spec.js
@@ -1,5 +1,5 @@
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../db/neo4j'
import createServer from '../../server'
import { createTestClient } from 'apollo-server-testing'
diff --git a/backend/src/middleware/userInteractions.spec.js b/backend/src/middleware/userInteractions.spec.js
index 2f97bda5a..94d1ff274 100644
--- a/backend/src/middleware/userInteractions.spec.js
+++ b/backend/src/middleware/userInteractions.spec.js
@@ -1,5 +1,5 @@
import Factory, { cleanDatabase } from '../db/factories'
-import { gql } from '../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../db/neo4j'
import createServer from '../server'
import { createTestClient } from 'apollo-server-testing'
diff --git a/backend/src/middleware/validation/validationMiddleware.spec.js b/backend/src/middleware/validation/validationMiddleware.spec.js
index a887832c1..2e1cd6fa7 100644
--- a/backend/src/middleware/validation/validationMiddleware.spec.js
+++ b/backend/src/middleware/validation/validationMiddleware.spec.js
@@ -1,4 +1,4 @@
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import Factory, { cleanDatabase } from '../../db/factories'
import { getNeode, getDriver } from '../../db/neo4j'
import { createTestClient } from 'apollo-server-testing'
diff --git a/backend/src/schema/resolvers/comments.spec.js b/backend/src/schema/resolvers/comments.spec.js
index 09487082e..b2730dad4 100644
--- a/backend/src/schema/resolvers/comments.spec.js
+++ b/backend/src/schema/resolvers/comments.spec.js
@@ -1,5 +1,5 @@
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { createTestClient } from 'apollo-server-testing'
import createServer from '../../server'
import { getNeode, getDriver } from '../../db/neo4j'
diff --git a/backend/src/schema/resolvers/donations.spec.js b/backend/src/schema/resolvers/donations.spec.js
index 5a2bcfd7b..9fc010eca 100644
--- a/backend/src/schema/resolvers/donations.spec.js
+++ b/backend/src/schema/resolvers/donations.spec.js
@@ -1,6 +1,6 @@
import { createTestClient } from 'apollo-server-testing'
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../db/neo4j'
import createServer from '../../server'
diff --git a/backend/src/schema/resolvers/emails.spec.js b/backend/src/schema/resolvers/emails.spec.js
index 4778e3fcf..02a631495 100644
--- a/backend/src/schema/resolvers/emails.spec.js
+++ b/backend/src/schema/resolvers/emails.spec.js
@@ -1,5 +1,5 @@
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getDriver, getNeode } from '../../db/neo4j'
import createServer from '../../server'
import { createTestClient } from 'apollo-server-testing'
diff --git a/backend/src/schema/resolvers/embeds.spec.js b/backend/src/schema/resolvers/embeds.spec.js
index 347825f3a..0f0d41357 100644
--- a/backend/src/schema/resolvers/embeds.spec.js
+++ b/backend/src/schema/resolvers/embeds.spec.js
@@ -3,7 +3,7 @@ import fs from 'fs'
import path from 'path'
import { createTestClient } from 'apollo-server-testing'
import createServer from '../../server'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
jest.mock('node-fetch')
const { Response } = jest.requireActual('node-fetch')
diff --git a/backend/src/schema/resolvers/follow.spec.js b/backend/src/schema/resolvers/follow.spec.js
index 14d8a366d..0d9d524ff 100644
--- a/backend/src/schema/resolvers/follow.spec.js
+++ b/backend/src/schema/resolvers/follow.spec.js
@@ -2,7 +2,7 @@ import { createTestClient } from 'apollo-server-testing'
import Factory, { cleanDatabase } from '../../db/factories'
import { getDriver, getNeode } from '../../db/neo4j'
import createServer from '../../server'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
const driver = getDriver()
const neode = getNeode()
diff --git a/backend/src/schema/resolvers/helpers/filterPostsOfMyGroups.js b/backend/src/schema/resolvers/helpers/filterPostsOfMyGroups.js
new file mode 100644
index 000000000..a808a5582
--- /dev/null
+++ b/backend/src/schema/resolvers/helpers/filterPostsOfMyGroups.js
@@ -0,0 +1,40 @@
+import { mergeWith, isArray } from 'lodash'
+
+const getMyGroupIds = async (context) => {
+ const { user } = context
+ if (!(user && user.id)) return []
+ const session = context.driver.session()
+
+ const readTxResultPromise = await session.readTransaction(async (transaction) => {
+ const cypher = `
+ MATCH (group:Group)<-[membership:MEMBER_OF]-(:User { id: $userId })
+ WHERE membership.role IN ['usual', 'admin', 'owner']
+ RETURN collect(group.id) AS myGroupIds`
+ const getMyGroupIdsResponse = await transaction.run(cypher, { userId: user.id })
+ return getMyGroupIdsResponse.records.map((record) => record.get('myGroupIds'))
+ })
+ try {
+ const [myGroupIds] = readTxResultPromise
+ return myGroupIds
+ } finally {
+ session.close()
+ }
+}
+
+export const filterPostsOfMyGroups = async (params, context) => {
+ if (!(params.filter && params.filter.postsInMyGroups)) return params
+ delete params.filter.postsInMyGroups
+ const myGroupIds = await getMyGroupIds(context)
+ params.filter = mergeWith(
+ params.filter,
+ {
+ group: { id_in: myGroupIds },
+ },
+ (objValue, srcValue) => {
+ if (isArray(objValue)) {
+ return objValue.concat(srcValue)
+ }
+ },
+ )
+ return params
+}
diff --git a/backend/src/schema/resolvers/inviteCodes.spec.js b/backend/src/schema/resolvers/inviteCodes.spec.js
index b55ab079b..1df791ba6 100644
--- a/backend/src/schema/resolvers/inviteCodes.spec.js
+++ b/backend/src/schema/resolvers/inviteCodes.spec.js
@@ -1,6 +1,6 @@
import Factory, { cleanDatabase } from '../../db/factories'
import { getDriver } from '../../db/neo4j'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import createServer from '../../server'
import { createTestClient } from 'apollo-server-testing'
import CONSTANTS_REGISTRATION from './../../constants/registration'
diff --git a/backend/src/schema/resolvers/locations.spec.js b/backend/src/schema/resolvers/locations.spec.js
index 87542cf6d..82aebd441 100644
--- a/backend/src/schema/resolvers/locations.spec.js
+++ b/backend/src/schema/resolvers/locations.spec.js
@@ -1,5 +1,5 @@
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../db/neo4j'
import createServer from '../../server'
import { createTestClient } from 'apollo-server-testing'
diff --git a/backend/src/schema/resolvers/moderation.spec.js b/backend/src/schema/resolvers/moderation.spec.js
index 9f5014756..1665e9446 100644
--- a/backend/src/schema/resolvers/moderation.spec.js
+++ b/backend/src/schema/resolvers/moderation.spec.js
@@ -1,6 +1,6 @@
import { createTestClient } from 'apollo-server-testing'
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../db/neo4j'
import createServer from '../../server'
diff --git a/backend/src/schema/resolvers/notifications.spec.js b/backend/src/schema/resolvers/notifications.spec.js
index 82d6e6371..36bd530eb 100644
--- a/backend/src/schema/resolvers/notifications.spec.js
+++ b/backend/src/schema/resolvers/notifications.spec.js
@@ -1,5 +1,5 @@
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getDriver } from '../../db/neo4j'
import { createTestClient } from 'apollo-server-testing'
import createServer from '../.././server'
diff --git a/backend/src/schema/resolvers/passwordReset.spec.js b/backend/src/schema/resolvers/passwordReset.spec.js
index 90c570f5a..fa5f26e58 100644
--- a/backend/src/schema/resolvers/passwordReset.spec.js
+++ b/backend/src/schema/resolvers/passwordReset.spec.js
@@ -1,5 +1,5 @@
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../db/neo4j'
import CONSTANTS_REGISTRATION from './../../constants/registration'
import createPasswordReset from './helpers/createPasswordReset'
diff --git a/backend/src/schema/resolvers/posts.js b/backend/src/schema/resolvers/posts.js
index 78515e641..d806f3803 100644
--- a/backend/src/schema/resolvers/posts.js
+++ b/backend/src/schema/resolvers/posts.js
@@ -6,6 +6,7 @@ import { mergeImage, deleteImage } from './images/images'
import Resolver from './helpers/Resolver'
import { filterForMutedUsers } from './helpers/filterForMutedUsers'
import { filterInvisiblePosts } from './helpers/filterInvisiblePosts'
+import { filterPostsOfMyGroups } from './helpers/filterPostsOfMyGroups'
import CONFIG from '../../config'
const maintainPinnedPosts = (params) => {
@@ -21,12 +22,14 @@ const maintainPinnedPosts = (params) => {
export default {
Query: {
Post: async (object, params, context, resolveInfo) => {
+ params = await filterPostsOfMyGroups(params, context)
params = await filterInvisiblePosts(params, context)
params = await filterForMutedUsers(params, context)
params = await maintainPinnedPosts(params)
return neo4jgraphql(object, params, context, resolveInfo)
},
profilePagePosts: async (object, params, context, resolveInfo) => {
+ params = await filterPostsOfMyGroups(params, context)
params = await filterInvisiblePosts(params, context)
params = await filterForMutedUsers(params, context)
return neo4jgraphql(object, params, context, resolveInfo)
diff --git a/backend/src/schema/resolvers/posts.spec.js b/backend/src/schema/resolvers/posts.spec.js
index 7a0dc0176..9335c1313 100644
--- a/backend/src/schema/resolvers/posts.spec.js
+++ b/backend/src/schema/resolvers/posts.spec.js
@@ -1,6 +1,6 @@
import { createTestClient } from 'apollo-server-testing'
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../db/neo4j'
import createServer from '../../server'
diff --git a/backend/src/schema/resolvers/postsInGroups.spec.js b/backend/src/schema/resolvers/postsInGroups.spec.js
index 5bf5820f0..1eaf7a708 100644
--- a/backend/src/schema/resolvers/postsInGroups.spec.js
+++ b/backend/src/schema/resolvers/postsInGroups.spec.js
@@ -1678,5 +1678,59 @@ describe('Posts in Groups', () => {
})
})
})
+
+ describe('filter posts in my groups', () => {
+ describe('without any posts in groups', () => {
+ beforeAll(async () => {
+ authenticatedUser = await anyUser.toJson()
+ })
+
+ it('finds no posts', async () => {
+ const result = await query({
+ query: filterPosts(),
+ variables: { filter: { postsInMyGroups: true } },
+ })
+ expect(result.data.Post).toHaveLength(0)
+ expect(result).toMatchObject({
+ data: {
+ Post: [],
+ },
+ errors: undefined,
+ })
+ })
+ })
+
+ describe('with posts in groups', () => {
+ beforeAll(async () => {
+ // member of hidden-group and closed-group
+ authenticatedUser = await allGroupsUser.toJson()
+ })
+
+ it('finds two posts', async () => {
+ const result = await query({
+ query: filterPosts(),
+ variables: { filter: { postsInMyGroups: true } },
+ })
+ expect(result.data.Post).toHaveLength(2)
+ expect(result).toMatchObject({
+ data: {
+ Post: expect.arrayContaining([
+ {
+ id: 'post-to-closed-group',
+ title: 'A post to a closed group',
+ content: 'I am posting into a closed group as a member of the group',
+ },
+ {
+ id: 'post-to-hidden-group',
+ title: 'A post to a hidden group',
+ content: 'I am posting into a hidden group as a member of the group',
+ },
+ ]),
+ },
+ errors: undefined,
+ })
+ })
+ })
+ })
})
})
diff --git a/backend/src/schema/resolvers/registration.spec.js b/backend/src/schema/resolvers/registration.spec.js
index ae6bcb7d7..bfc6a5fa6 100644
--- a/backend/src/schema/resolvers/registration.spec.js
+++ b/backend/src/schema/resolvers/registration.spec.js
@@ -1,5 +1,5 @@
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getDriver, getNeode } from '../../db/neo4j'
import createServer from '../../server'
import { createTestClient } from 'apollo-server-testing'
diff --git a/backend/src/schema/resolvers/reports.spec.js b/backend/src/schema/resolvers/reports.spec.js
index 449bdb3a7..96ef07d03 100644
--- a/backend/src/schema/resolvers/reports.spec.js
+++ b/backend/src/schema/resolvers/reports.spec.js
@@ -1,7 +1,7 @@
import { createTestClient } from 'apollo-server-testing'
import createServer from '../.././server'
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getDriver, getNeode } from '../../db/neo4j'
const instance = getNeode()
diff --git a/backend/src/schema/resolvers/rewards.spec.js b/backend/src/schema/resolvers/rewards.spec.js
index 108973c9c..06fe87ec0 100644
--- a/backend/src/schema/resolvers/rewards.spec.js
+++ b/backend/src/schema/resolvers/rewards.spec.js
@@ -1,6 +1,6 @@
import { createTestClient } from 'apollo-server-testing'
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../db/neo4j'
import createServer from '../../server'
diff --git a/backend/src/schema/resolvers/searches.spec.js b/backend/src/schema/resolvers/searches.spec.js
index 7c1a5a254..f889c2ac8 100644
--- a/backend/src/schema/resolvers/searches.spec.js
+++ b/backend/src/schema/resolvers/searches.spec.js
@@ -1,5 +1,5 @@
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../db/neo4j'
import createServer from '../../server'
import { createTestClient } from 'apollo-server-testing'
diff --git a/backend/src/schema/resolvers/shout.spec.js b/backend/src/schema/resolvers/shout.spec.js
index f774d7d0b..294a28a76 100644
--- a/backend/src/schema/resolvers/shout.spec.js
+++ b/backend/src/schema/resolvers/shout.spec.js
@@ -1,6 +1,6 @@
import { createTestClient } from 'apollo-server-testing'
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../db/neo4j'
import createServer from '../../server'
diff --git a/backend/src/schema/resolvers/socialMedia.spec.js b/backend/src/schema/resolvers/socialMedia.spec.js
index dafbed6d6..8265e8376 100644
--- a/backend/src/schema/resolvers/socialMedia.spec.js
+++ b/backend/src/schema/resolvers/socialMedia.spec.js
@@ -1,7 +1,7 @@
import { createTestClient } from 'apollo-server-testing'
import createServer from '../../server'
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getDriver } from '../../db/neo4j'
const driver = getDriver()
diff --git a/backend/src/schema/resolvers/statistics.spec.js b/backend/src/schema/resolvers/statistics.spec.js
index 46330ef9a..15aa2d449 100644
--- a/backend/src/schema/resolvers/statistics.spec.js
+++ b/backend/src/schema/resolvers/statistics.spec.js
@@ -1,6 +1,6 @@
import { createTestClient } from 'apollo-server-testing'
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../db/neo4j'
import createServer from '../../server'
diff --git a/backend/src/schema/resolvers/userData.spec.js b/backend/src/schema/resolvers/userData.spec.js
index ee4901f0a..3c521a4f1 100644
--- a/backend/src/schema/resolvers/userData.spec.js
+++ b/backend/src/schema/resolvers/userData.spec.js
@@ -1,5 +1,5 @@
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../db/neo4j'
import createServer from '../../server'
import { createTestClient } from 'apollo-server-testing'
diff --git a/backend/src/schema/resolvers/user_management.spec.js b/backend/src/schema/resolvers/user_management.spec.js
index a249d7500..546c7a748 100644
--- a/backend/src/schema/resolvers/user_management.spec.js
+++ b/backend/src/schema/resolvers/user_management.spec.js
@@ -1,7 +1,7 @@
import jwt from 'jsonwebtoken'
import CONFIG from './../../config'
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { loginMutation } from '../../graphql/userManagement'
import { createTestClient } from 'apollo-server-testing'
import createServer, { context } from '../../server'
diff --git a/backend/src/schema/resolvers/users.spec.js b/backend/src/schema/resolvers/users.spec.js
index 9b7699dc1..f256c6363 100644
--- a/backend/src/schema/resolvers/users.spec.js
+++ b/backend/src/schema/resolvers/users.spec.js
@@ -1,5 +1,5 @@
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../db/neo4j'
import createServer from '../../server'
import { createTestClient } from 'apollo-server-testing'
diff --git a/backend/src/schema/resolvers/users/location.spec.js b/backend/src/schema/resolvers/users/location.spec.js
index 73938c41a..7097002da 100644
--- a/backend/src/schema/resolvers/users/location.spec.js
+++ b/backend/src/schema/resolvers/users/location.spec.js
@@ -1,4 +1,4 @@
-import { gql } from '../../../helpers/jest'
+import gql from 'graphql-tag'
import Factory, { cleanDatabase } from '../../../db/factories'
import { getNeode, getDriver } from '../../../db/neo4j'
import { createTestClient } from 'apollo-server-testing'
diff --git a/backend/src/schema/resolvers/users/mutedUsers.spec.js b/backend/src/schema/resolvers/users/mutedUsers.spec.js
index 5c1a7dd5d..20e37f627 100644
--- a/backend/src/schema/resolvers/users/mutedUsers.spec.js
+++ b/backend/src/schema/resolvers/users/mutedUsers.spec.js
@@ -1,7 +1,7 @@
import { createTestClient } from 'apollo-server-testing'
import createServer from '../../../server'
import { cleanDatabase } from '../../../db/factories'
-import { gql } from '../../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../../db/neo4j'
const driver = getDriver()
diff --git a/backend/src/schema/resolvers/viewedTeaserCount.spec.js b/backend/src/schema/resolvers/viewedTeaserCount.spec.js
index d7437646b..ee90d1a08 100644
--- a/backend/src/schema/resolvers/viewedTeaserCount.spec.js
+++ b/backend/src/schema/resolvers/viewedTeaserCount.spec.js
@@ -1,6 +1,6 @@
import { createTestClient } from 'apollo-server-testing'
import Factory, { cleanDatabase } from '../../db/factories'
-import { gql } from '../../helpers/jest'
+import gql from 'graphql-tag'
import { getNeode, getDriver } from '../../db/neo4j'
import createServer from '../../server'
diff --git a/backend/src/schema/types/type/Post.gql b/backend/src/schema/types/type/Post.gql
index 9eac00b0b..6fc7a3215 100644
--- a/backend/src/schema/types/type/Post.gql
+++ b/backend/src/schema/types/type/Post.gql
@@ -82,6 +82,7 @@ input _PostFilter {
emotions_single: _PostEMOTEDFilter
emotions_every: _PostEMOTEDFilter
group: _GroupFilter
+ postsInMyGroups: Boolean
}
enum _PostOrdering {
diff --git a/cypress/integration/Moderation.ReportContent/somebody_reported_the_following_posts.js b/cypress/integration/Moderation.ReportContent/somebody_reported_the_following_posts.js
index ce876a081..3ca39e6e6 100644
--- a/cypress/integration/Moderation.ReportContent/somebody_reported_the_following_posts.js
+++ b/cypress/integration/Moderation.ReportContent/somebody_reported_the_following_posts.js
@@ -1,5 +1,4 @@
import { Given } from "cypress-cucumber-preprocessor/steps";
-import { gql } from '../../../backend/src/helpers/jest'
Given('somebody reported the following posts:', table => {
table.hashes().forEach(({ submitterEmail, resourceId, reasonCategory, reasonDescription }) => {
@@ -10,7 +9,7 @@ Given('somebody reported the following posts:', table => {
cy.factory()
.build('user', {}, submitter)
.authenticateAs(submitter)
- .mutate(gql`mutation($resourceId: ID!, $reasonCategory: ReasonCategory!, $reasonDescription: String!) {
+ .mutate(`mutation($resourceId: ID!, $reasonCategory: ReasonCategory!, $reasonDescription: String!) {
fileReport(resourceId: $resourceId, reasonCategory: $reasonCategory, reasonDescription: $reasonDescription) {
reportId
}
diff --git a/cypress/support/commands.js b/cypress/support/commands.js
index 335e00390..7d3738a3d 100644
--- a/cypress/support/commands.js
+++ b/cypress/support/commands.js
@@ -15,11 +15,10 @@
/* globals Cypress cy */
import "cypress-file-upload";
import { GraphQLClient, request } from 'graphql-request'
-import { gql } from '../../backend/src/helpers/jest'
import config from '../../backend/src/config'
const authenticatedHeaders = (variables) => {
- const mutation = gql`
+ const mutation = `
mutation($email: String!, $password: String!) {
login(email: $email, password: $password)
}
diff --git a/webapp/assets/_new/styles/tokens.scss b/webapp/assets/_new/styles/tokens.scss
index 770a1a9c9..66bd03ecc 100644
--- a/webapp/assets/_new/styles/tokens.scss
+++ b/webapp/assets/_new/styles/tokens.scss
@@ -375,4 +375,21 @@ $color-footer-link: $color-primary;
* @tokens Locale Menu Color
*/
-$color-locale-menu: $text-color-soft;
\ No newline at end of file
+$color-locale-menu: $text-color-soft;
+
+/**
+ * @tokens Donation Bar Color
+ */
+
+$color-donation-bar: $color-primary;
+$color-donation-bar-light: $color-primary-light;
+
+/**
+ * @tokens Toast Color
+ */
+
+$color-toast-red: $color-danger;
+$color-toast-orange: $color-warning;
+$color-toast-yellow: $color-yellow;
+$color-toast-blue: $color-secondary;
+$color-toast-green: $color-success;
diff --git a/webapp/assets/styles/imports/_toast.scss b/webapp/assets/styles/imports/_toast.scss
index 0ef81a5b2..eb593dd6a 100644
--- a/webapp/assets/styles/imports/_toast.scss
+++ b/webapp/assets/styles/imports/_toast.scss
@@ -11,22 +11,22 @@
}
.iziToast.iziToast-color-red {
- background: $color-danger !important;
- border-color: $color-danger !important;
+ background: $color-toast-red !important;
+ border-color: $color-toast-red !important;
}
.iziToast.iziToast-color-orange {
- background: $color-warning !important;
- border-color: $color-warning !important;
+ background: $color-toast-orange !important;
+ border-color: $color-toast-orange !important;
}
.iziToast.iziToast-color-yellow {
- background: $color-yellow !important;
- border-color: $color-yellow !important;
+ background: $color-toast-yellow !important;
+ border-color: $color-toast-yellow !important;
}
.iziToast.iziToast-color-blue {
- background: $color-secondary !important;
- border-color: $color-secondary !important;
+ background: $color-toast-blue !important;
+ border-color: $color-toast-blue !important;
}
.iziToast.iziToast-color-green {
- background: $color-success !important;
- border-color: $color-success !important;
+ background: $color-toast-green !important;
+ border-color: $color-toast-green !important;
}
diff --git a/webapp/components/FilterMenu/FollowingFilter.spec.js b/webapp/components/FilterMenu/FollowingFilter.spec.js
index 4d4a827e5..0f51b305c 100644
--- a/webapp/components/FilterMenu/FollowingFilter.spec.js
+++ b/webapp/components/FilterMenu/FollowingFilter.spec.js
@@ -9,12 +9,14 @@ let wrapper
describe('FollowingFilter', () => {
const mutations = {
'posts/TOGGLE_FILTER_BY_FOLLOWED': jest.fn(),
+ 'posts/TOGGLE_FILTER_BY_MY_GROUPS': jest.fn(),
}
const getters = {
'auth/user': () => {
return { id: 'u34' }
},
'posts/filteredByUsersFollowed': jest.fn(),
+ 'posts/filteredByPostsInMyGroups': jest.fn(),
}
const mocks = {
@@ -34,12 +36,18 @@ describe('FollowingFilter', () => {
describe('mount', () => {
it('sets "filter-by-followed" button attribute `filled`', () => {
getters['posts/filteredByUsersFollowed'] = jest.fn(() => true)
+ getters['posts/filteredByPostsInMyGroups'] = jest.fn(() => true)
const wrapper = Wrapper()
expect(
wrapper
.find('.following-filter .filter-list .follower-item .base-button')
.classes('--filled'),
).toBe(true)
+ expect(
+ wrapper
+ .find('.following-filter .filter-list .posts-in-my-groups-item .base-button')
+ .classes('--filled'),
+ ).toBe(true)
})
describe('click "filter-by-followed" button', () => {
@@ -48,5 +56,14 @@ describe('FollowingFilter', () => {
expect(mutations['posts/TOGGLE_FILTER_BY_FOLLOWED']).toHaveBeenCalledWith({}, 'u34')
})
})
+
+ describe('click "filter-by-my-groups" button', () => {
+ it('calls TOGGLE_FILTER_BY_MY_GROUPS', () => {
+ wrapper
+ .find('.following-filter .filter-list .posts-in-my-groups-item .base-button')
+ .trigger('click')
+ expect(mutations['posts/TOGGLE_FILTER_BY_MY_GROUPS']).toHaveBeenCalled()
+ })
+ })
})
})
diff --git a/webapp/components/FilterMenu/FollowingFilter.vue b/webapp/components/FilterMenu/FollowingFilter.vue
index 7c2c2a282..9a488acd6 100644
--- a/webapp/components/FilterMenu/FollowingFilter.vue
+++ b/webapp/components/FilterMenu/FollowingFilter.vue
@@ -10,6 +10,15 @@
@click="toggleFilteredByFollowed(currentUser.id)"
/>
+