From 570275e5bfc49e60064c7ae4a23778e0516f8994 Mon Sep 17 00:00:00 2001
From: sushidave
Date: Mon, 18 Oct 2021 21:09:39 +0200
Subject: [PATCH 01/99] Update README.md
Repo description copied from ocelot.social website. Non-existing demo network removed. Please check if the links before the description are still actual.
---
README.md | 24 ++++++++----------------
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/README.md b/README.md
index 67f94f94c..82bc4dfd6 100644
--- a/README.md
+++ b/README.md
@@ -6,28 +6,20 @@
[](https://discordapp.com/invite/DFSjPaX)
[](https://www.codetriage.com/human-connection/human-connection)
-ocelot.social is a nonprofit social, action and knowledge network that connects information to action and promotes positive local and global change in all areas of life.
+**ocelot.social** is open source program code that is freely available to run social networks. Its development is supported by a community of programmers and interested network operators.
-* **Social**: Interact with other people not just by commenting their posts, but by providing **Pro & Contra** arguments, give a **Versus** or ask them by integrated **Chat** or **Let's Talk**
-* **Knowledge**: Read articles about interesting topics and find related posts in the **More Info** tab or by **Filtering** based on **Categories** and **Tagging** or by using the **Fulltext Search**.
-* **Action**: Don't just read about how to make the world a better place, but come into **Action** by following provided suggestions on the **Action** tab provided by other people or **Organisations**.
+Our goal is to enable people to participate fairly and equally in online social networks. The equality of opportunity applies both to the fundamental equality of all people and to the possibility of letting their diverse voices be heard.
+
+We therefore consider it desirable that operators offer such networks so that people can choose where they want to be on the move.
+
+At the same time, it should be possible in the future to link these networks with each other (Fediverse), so that users can also connect with people from other networks - for example by making friends or following posts or other contributions.
+
+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.
-## Live demo
-
-__Try out our deployed [development environment](https://develop.human-connection.org/).__
-
-Logins:
-
-| email | password | role |
-| :--- | :--- | :--- |
-| `user@example.org` | 1234 | user |
-| `moderator@example.org` | 1234 | moderator |
-| `admin@example.org` | 1234 | admin |
-
## Directory Layout
There are four important directories:
From af5f2e52d2bd79a8da962934251e0d1d97fa6823 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 11:14:13 +0200
Subject: [PATCH 02/99] Add documentation hints
---
README.md | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 82bc4dfd6..6e3a85657 100644
--- a/README.md
+++ b/README.md
@@ -6,13 +6,13 @@
[](https://discordapp.com/invite/DFSjPaX)
[](https://www.codetriage.com/human-connection/human-connection)
-**ocelot.social** is open source program code that is freely available to run social networks. Its development is supported by a community of programmers and interested network operators.
+**ocelot.social** is free and open source software program code that is freely available to run social networks. Its development is supported by a community of programmers and interested network operators.
Our goal is to enable people to participate fairly and equally in online social networks. The equality of opportunity applies both to the fundamental equality of all people and to the possibility of letting their diverse voices be heard.
We therefore consider it desirable that operators offer such networks so that people can choose where they want to be on the move.
-At the same time, it should be possible in the future to link these networks with each other (Fediverse), so that users can also connect with people from other networks - for example by making friends or following posts or other contributions.
+At the same time, it should be possible in the future to link these networks with each other (ActivityPub, Fediverse), so that users can also connect with people from other networks - for example by making friends or following posts or other contributions.
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.
@@ -95,7 +95,11 @@ For Production:
$ docker-compose -f docker-compose.yml up
```
-This will start all required Docker containers
+This will start all required Docker containers.
+
+To prepare everything once frontup see [backend README.md](./backend/README.md).
+For a full documentation see [SUMMERY](./SUMMARY.md).
+
## Deployment
From 8b350c77721d0b57a981161d994d65f331d1f315 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 11:20:05 +0200
Subject: [PATCH 03/99] Add local installation
---
README.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/README.md b/README.md
index 6e3a85657..34a17b683 100644
--- a/README.md
+++ b/README.md
@@ -100,6 +100,9 @@ This will start all required Docker containers.
To prepare everything once frontup see [backend README.md](./backend/README.md).
For a full documentation see [SUMMERY](./SUMMARY.md).
+### Local Installation
+
+For a full documentation see [SUMMERY](./SUMMARY.md).
## Deployment
From 13aad9ef8f69d61bfee87d67af24bd4bb4e41a4c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 11:48:43 +0200
Subject: [PATCH 04/99] Add env and database setup
---
README.md | 33 ++++++++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 34a17b683..24f2a00cc 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# ocelot.social
+# Ocelot.Social
[](https://travis-ci.com/Human-Connection/Human-Connection)
[](https://codecov.io/gh/Human-Connection/Human-Connection/)
@@ -83,21 +83,48 @@ docker-compose version 1.23.2
#### Start Ocelot-Social via Docker-Compose
+Prepare ENVs once beforehand:
+
+```bash
+# in folder webapp/
+$ cp .env.template .env
+
+# in folder backend/
+$ cp .env.template .env
+```
+
For Development:
```bash
+# in main folder
$ docker-compose up
```
For Production:
```bash
+# in main folder
$ docker-compose -f docker-compose.yml up
```
-This will start all required Docker containers.
+This will start all required Docker containers.
+Make sure your database is running on `http://localhost:7474/browser/`.
-To prepare everything once frontup see [backend README.md](./backend/README.md).
+Prepare database once beforehand:
+
+```bash
+# in folder backend/
+yarn run db:migrate init
+```
+
+Then clear and seed database:
+
+```bash
+# in folder backend/
+$ yarn run db:reset && db:seed
+```
+
+For a closer description see [backend README.md](./backend/README.md).
For a full documentation see [SUMMERY](./SUMMARY.md).
### Local Installation
From 3a8982dfe1a39fb97f7bf28aa2fa2def4e9681eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 12:05:50 +0200
Subject: [PATCH 05/99] Fix workflow status badges
---
README.md | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 24f2a00cc..3b415faf9 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,11 @@
# Ocelot.Social
-[](https://travis-ci.com/Human-Connection/Human-Connection)
-[](https://codecov.io/gh/Human-Connection/Human-Connection/)
-[](https://github.com/Human-Connection/Nitro-Backend/blob/backend/LICENSE.md)
-[](https://discordapp.com/invite/DFSjPaX)
-[](https://www.codetriage.com/human-connection/human-connection)
+[](https://github.com/Ocelot-Social-Community/Ocelot-Social/actions)
+[](https://github.com/Ocelot-Social-Community/Ocelot-Social/actions)
+[](https://codecov.io/gh/Ocelot-Social-Community/Ocelot-Social/)
+[](https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/LICENSE.md)
+[](https://discord.gg/AJSX9DCSUA)
+[](https://www.codetriage.com/Ocelot-Social-Community/Ocelot-Social)
**ocelot.social** is free and open source software program code that is freely available to run social networks. Its development is supported by a community of programmers and interested network operators.
From 7429d39a5c735808ae0a2486285b6ae3754fd040 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 12:47:30 +0200
Subject: [PATCH 06/99] Fix badges for code triage and codecov
---
README.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 3b415faf9..0b3c81f0b 100644
--- a/README.md
+++ b/README.md
@@ -2,10 +2,11 @@
[](https://github.com/Ocelot-Social-Community/Ocelot-Social/actions)
[](https://github.com/Ocelot-Social-Community/Ocelot-Social/actions)
-[](https://codecov.io/gh/Ocelot-Social-Community/Ocelot-Social/)
+[](https://codecov.io/gh/Ocelot-Social-Community/Ocelot-Social)
[](https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/LICENSE.md)
[](https://discord.gg/AJSX9DCSUA)
-[](https://www.codetriage.com/Ocelot-Social-Community/Ocelot-Social)
+[](https://www.codetriage.com/ocelot-social-community/ocelot-social)
+[](https://www.codetriage.com/ocelot-social-community/ocelot-social-deploy-rebranding)
**ocelot.social** is free and open source software program code that is freely available to run social networks. Its development is supported by a community of programmers and interested network operators.
From 5db31069e24b72547f64d2959b1e9b6cb22e78c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 13:14:37 +0200
Subject: [PATCH 07/99] Change licence to Ocelot.Social Community
---
LICENSE.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/LICENSE.md b/LICENSE.md
index c0d3b6e18..bf54c386f 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -2,7 +2,7 @@
MIT License
-Copyright \(c\) 2018 Human-Connection gGmbH
+Copyright \(c\) 2018-2021 Ocelot.Social Community
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \(the "Software"\), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
From f122dbc93aee49f796cf968982f41ebd6786839f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 13:20:56 +0200
Subject: [PATCH 08/99] Change package.json description
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 1eef32b79..8e929d3c3 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "ocelot-social",
"version": "1.0.6",
- "description": "Fullstack and API tests with cypress and cucumber for ocelot.social",
+ "description": "Free and open source software program code available to run social networks.",
"author": "ocelot.social Community",
"license": "MIT",
"private": false,
From 57568e093d574a236fc69affd12af1c514cab9db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 13:52:01 +0200
Subject: [PATCH 09/99] Add contributing
---
README.md | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index 0b3c81f0b..0c810e6ab 100644
--- a/README.md
+++ b/README.md
@@ -133,21 +133,31 @@ For a full documentation see [SUMMERY](./SUMMARY.md).
For a full documentation see [SUMMERY](./SUMMARY.md).
+## Contributing
+
+We are happy if you fork our repository, but we don't recommend it for development. You do not need a fork.
+
+Clone this repository locally as [described above] (#clone-the-repository), create your branch named ``, add your code and push your branch to this repository. Then create a PR by comparing it to our `master`.
+
+Choose an issue and leave a comment there. We will then invite you to join our volunteer team.
+To have the necessary permission to push directly to this repository, please accept our invitation to join our volunteer team via the email we send you.
+
+Check out our [contribution guideline](./CONTRIBUTING.md), too!
+
+### 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 `@@Mentor` to get you onboard :neckbeard:
+
+We give write permissions to every developer who asks for it. Just text us on
+[Discord](https://discord.gg/AJSX9DCSUA).
+
## 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 is `docker-compose` for development purposes as described above.
-## 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 `@@Mentor` to get you onboard :neckbeard:
-Check out the [contribution guideline](./CONTRIBUTING.md), too!
-
-We give write permissions to every developer who asks for it. Just text us on
-[Discord](https://discord.gg/AJSX9DCSUA).
-
## Technology Stack
* [VueJS](https://vuejs.org/)
From c1fb38beb0502d7939712fbe5d497e8220374d64 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 13:54:01 +0200
Subject: [PATCH 10/99] Fix link
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 0c810e6ab..f1b8e092f 100644
--- a/README.md
+++ b/README.md
@@ -137,7 +137,7 @@ For a full documentation see [SUMMERY](./SUMMARY.md).
We are happy if you fork our repository, but we don't recommend it for development. You do not need a fork.
-Clone this repository locally as [described above] (#clone-the-repository), create your branch named ``, add your code and push your branch to this repository. Then create a PR by comparing it to our `master`.
+Clone this repository locally as [described above](#clone-the-repository), create your branch named ``, add your code and push your branch to this repository. Then create a PR by comparing it to our `master`.
Choose an issue and leave a comment there. We will then invite you to join our volunteer team.
To have the necessary permission to push directly to this repository, please accept our invitation to join our volunteer team via the email we send you.
From 023dd806e98de33bce76ff3749c5e9b0e0059483 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 13:56:01 +0200
Subject: [PATCH 11/99] Fix branch name template
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index f1b8e092f..aea5694ad 100644
--- a/README.md
+++ b/README.md
@@ -137,7 +137,7 @@ For a full documentation see [SUMMERY](./SUMMARY.md).
We are happy if you fork our repository, but we don't recommend it for development. You do not need a fork.
-Clone this repository locally as [described above](#clone-the-repository), create your branch named ``, add your code and push your branch to this repository. Then create a PR by comparing it to our `master`.
+Clone this repository locally as [described above](#clone-the-repository), create your branch named `-`, add your code and push your branch to this repository. Then create a PR by comparing it to our `master`.
Choose an issue and leave a comment there. We will then invite you to join our volunteer team.
To have the necessary permission to push directly to this repository, please accept our invitation to join our volunteer team via the email we send you.
From a356cc947677e9983358c1e429946ebd52d54ad8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 13:57:36 +0200
Subject: [PATCH 12/99] Change contributing content order
---
README.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index aea5694ad..099b45589 100644
--- a/README.md
+++ b/README.md
@@ -135,13 +135,13 @@ For a full documentation see [SUMMERY](./SUMMARY.md).
## Contributing
+Choose an issue and leave a comment there. We will then invite you to join our volunteer team.
+To have the necessary permission to push directly to this repository, please accept our invitation to join our volunteer team via the email we send you.
+
We are happy if you fork our repository, but we don't recommend it for development. You do not need a fork.
Clone this repository locally as [described above](#clone-the-repository), create your branch named `-`, add your code and push your branch to this repository. Then create a PR by comparing it to our `master`.
-Choose an issue and leave a comment there. We will then invite you to join our volunteer team.
-To have the necessary permission to push directly to this repository, please accept our invitation to join our volunteer team via the email we send you.
-
Check out our [contribution guideline](./CONTRIBUTING.md), too!
### Developer Chat
From 5c1b05d1274c0e3efc7d48eb10a1068cfe85c9a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 13:58:57 +0200
Subject: [PATCH 13/99] Fix `volunteers`
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 099b45589..6505d3040 100644
--- a/README.md
+++ b/README.md
@@ -135,8 +135,8 @@ For a full documentation see [SUMMERY](./SUMMARY.md).
## Contributing
-Choose an issue and leave a comment there. We will then invite you to join our volunteer team.
-To have the necessary permission to push directly to this repository, please accept our invitation to join our volunteer team via the email we send you.
+Choose an issue 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 via the email we send you.
We are happy if you fork our repository, but we don't recommend it for development. You do not need a fork.
From e7c458e5494e5959cfb4d6da808ec707aed63d1d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 14:37:45 +0200
Subject: [PATCH 14/99] Refactor CONTRIBUTING.md
---
CONTRIBUTING.md | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 50d3721d1..512d0d282 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,41 +1,43 @@
# CONTRIBUTING
-Thank you so much for thinking of contributing to the Human Connection project! It's awesome you're here, we really appreciate it. :-\)
+Thank you so much for thinking of contributing to the [ocelot.social](https://ocelot.social) project! It's awesome you're here, we really appreciate it. :-\)
## Getting Set Up
-Instructions for how to install all the necessary software and some code guidelines can be found in our main [Readme](/README.md) or in our [documentation](https://docs.human-connection.org/human-connection/).
+Instructions for how to install all the necessary software and some code guidelines can be found in our main [Readme](/README.md) or in our [documentation](/SUMMARY.md).
To get you started we recommend that you join forces with a regular contributor. Please join [our Discord instance](https://discord.gg/AJSX9DCSUA) to chat with developers or just get in touch directly on an issue on either [Github](https://github.com/Ocelot-Social-Community/Ocelot-Social/issues) or [Zenhub](https://app.zenhub.com/workspaces/ocelotsocial-5fb21ff922cb410015dd6535/board?filterLogic=any&repos=301151089):
-
-
-We also have regular pair programming sessions that you are very welcome to join! We feel this is often the best way to get to know both the project and the team. Most developers are also available for spontaneous sessions if the times listed below don't work for you – just ping us on Discord.
+We also can have pair programming sessions for you! We feel this is often the best way to get to know both the project and the team. Most developers are also available for spontaneous sessions.
## Development Flow
We operate in two week sprints that are planned, estimated and prioritised on [Zenhub](https://app.zenhub.com/workspaces/ocelotsocial-5fb21ff922cb410015dd6535/board?filterLogic=any&repos=301151089). All issues are also linked to and synced with [Github](https://github.com/Ocelot-Social-Community/Ocelot-Social/issues). Look for the `good first issue` label if you're not sure where to start!
-We try to discuss all questions directly related to a feature or bug in the respective issue, in order to preserve it for the future and for other developers. We use Discord for real-time communication.
+We try to discuss all questions directly related to a feature or bug in the respective issue, in order to preserve it for the future and for other developers. We use [Discord](https://discord.gg/AJSX9DCSUA) for real-time communication.
This is how we solve bugs and implement features, step by step:
1. We find an issue we want to work on, usually during the sprint planning but as an open source contributor this can happen at any time.
-2. We communicate with the team to see if the issue is still available. (When you comment on an issue but don't get an answer there within 1-2 days try to mention @Human-Connection/hc-dev-team to make sure we check in.)
+2. We communicate with the team to see if the issue is still available. (When you comment on an issue but don't get an answer there within 1-2 days try to mention @Ocelot-Social-Community/core-team to make sure we check in.)
3. We make sure we understand the issue in detail – what problem is it solving and how should it be implemented?
4. We assign ourselves to the issue and move it to `In Progress` on [Zenhub](https://app.zenhub.com/workspaces/ocelotsocial-5fb21ff922cb410015dd6535/board?filterLogic=any&repos=301151089).
5. We start working on it in a `new branch` and open a `pull request` prefixed with `[WIP]` (work in progress) to which we regularly push our changes.
6. When questions come up we clarify them with the team (directly in the issue on Github).
-7. When we are happy with our work and our PR is passing all tests we remove the `[WIP]` from the PR description and ask for reviews (if you're not sure who to ask there is @Human-Connection/hc-dev-team which pings all core developers).
+7. When we are happy with our work and our PR is passing all tests we remove the `[WIP]` from the PR description and ask for reviews (if you're not sure who to ask there is @Ocelot-Social-Community/core-team which pings all core developers).
8. We then incorporate the suggestions from the reviews into our work and once it has been approved it can be merged into master!
Every pull request needs to:
* fix an issue (if there is something you want to work on but there is no issue for it, create one first and discuss it with the team)
* include tests for the code that is added or changed
-* pass all tests (linter, backend, frontend, end-to-end)
+* pass all tests (linter, backend, webapp, code coverage, end-to-end)
* be approved by at least 1 developer who is not the owner of the PR (when more than 10 files were changed it needs 2 approvals)
+## Open Source Contribution Flow
+
+See [contributing in main README.md](/README.md#contributing)
+
## The Team
There are many volunteers all around the world helping us build this network and without their contributions we wouldn't be where we are today. Big thank you to all of you!
@@ -55,7 +57,7 @@ You can talk to our core team on [Discord](https://discord.gg/AJSX9DCSUA). And o
## Meetings and Pair Programming Sessions
-Times below refer to **German Time** – that's CET (GMT+1) in winter and CEST (GMT+2) in summer – because most Human Connection core team members are living in Germany.
+Times below refer to **German Time** – that's CET (GMT+1) in winter and CEST (GMT+2) in summer – because most ocelot.social Community core team members are living in Germany.
Daily standup
@@ -109,12 +111,13 @@ We practise [collective code ownership](http://www.extremeprogramming.org/rules/
* we avoid blocking because someone else isn't working, so we sometimes take over PRs from other developers
* everyone should always push their code to branches so others can see it
-We believe in open source contributions as a learning experience – everyone is welcome to join our team of volunteers and to contribute to the project, no matter their background or level of experience.
+We believe in open source contributions as a learning experience – everyone is welcome to join our team of volunteers and to contribute to the project, no matter their background or level of experience. To support your learning experience we founded the charity association [busFaktor() e.V.](https://www.busfaktor.org/en).
We use pair programming sessions as a tool for knowledge sharing. We can learn a lot from each other and only by sharing what we know and overcoming challenges together can we grow as a team and truly own this project collectively.
As a volunteeer you have no commitment except your own self development and your awesomeness by contributing to this free and open-source software project. Cheers to you!
+
From b7809df8069c15eb3169d54daebe7ca59800cc85 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 14:39:40 +0200
Subject: [PATCH 15/99] Add consideration of `good-first-issue`
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 6505d3040..a4fb8a9f7 100644
--- a/README.md
+++ b/README.md
@@ -135,7 +135,7 @@ For a full documentation see [SUMMERY](./SUMMARY.md).
## Contributing
-Choose an issue and leave a comment there. We will then invite you to join our volunteers team.
+Choose an issue (consider our label `good-first-issue`) 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 via the email we send you.
We are happy if you fork our repository, but we don't recommend it for development. You do not need a fork.
From ecafad71c7eaf325ae079d709c825ef4c5cf8c14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 14:44:24 +0200
Subject: [PATCH 16/99] Change contribution headline
---
CONTRIBUTING.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 512d0d282..27a4ed15a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -34,7 +34,7 @@ Every pull request needs to:
* pass all tests (linter, backend, webapp, code coverage, end-to-end)
* be approved by at least 1 developer who is not the owner of the PR (when more than 10 files were changed it needs 2 approvals)
-## Open Source Contribution Flow
+## Contribution Flow For Open Source Contributors
See [contributing in main README.md](/README.md#contributing)
From 01d44fdd9418c9f3380e05eb67f3d6e2586dc2f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 14:45:46 +0200
Subject: [PATCH 17/99] Change to three important directories
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index a4fb8a9f7..fed2316c1 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ In other words, we are interested in a network of networks and in keeping the da
## Directory Layout
-There are four important directories:
+There are three important directories:
* [Backend](./backend) runs on the server and is a middleware between database and frontend
* [Frontend](./webapp) is a server-side-rendered and client-side-rendered web frontend
From f3f76d20ebc3cb5f2350a4930657529bc2486a2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 14:49:08 +0200
Subject: [PATCH 18/99] Set links for local and docker installations
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index fed2316c1..45d451c11 100644
--- a/README.md
+++ b/README.md
@@ -35,8 +35,8 @@ setup **frontend** and **backend**.
There are two approaches:
-1. Local installation, which means you have to take care of dependencies yourself
-2. **Or** Install everything through Docker which takes care of dependencies for you
+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
From dfa728faedc99f727208b26b7afd0433f3e8b48f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Tue, 19 Oct 2021 14:52:09 +0200
Subject: [PATCH 19/99] Change deployment content
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 45d451c11..5b45ee55c 100644
--- a/README.md
+++ b/README.md
@@ -156,7 +156,7 @@ We give write permissions to every developer who asks for it. Just text us on
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 is `docker-compose` for development purposes as described above.
+The only deployment method in this repository for development purposes as described above is `docker-compose`.
## Technology Stack
From 1b35281c6b95b6acea0c5c2b0339d4b291fbc072 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Wed, 20 Oct 2021 08:31:06 +0200
Subject: [PATCH 20/99] Remove badges of codecov and Open Helper for deployment
- Set logo higher
- Set link on name of ocelot.social.
---
README.md | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index 5b45ee55c..1ef4c1efb 100644
--- a/README.md
+++ b/README.md
@@ -2,13 +2,15 @@
[](https://github.com/Ocelot-Social-Community/Ocelot-Social/actions)
[](https://github.com/Ocelot-Social-Community/Ocelot-Social/actions)
-[](https://codecov.io/gh/Ocelot-Social-Community/Ocelot-Social)
[](https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/LICENSE.md)
[](https://discord.gg/AJSX9DCSUA)
[](https://www.codetriage.com/ocelot-social-community/ocelot-social)
-[](https://www.codetriage.com/ocelot-social-community/ocelot-social-deploy-rebranding)
-**ocelot.social** is free and open source software program code that is freely available to run social networks. Its development is supported by a community of programmers and interested network operators.
+[ocelot.social](https://ocelot.social) is free and open source software program code that is freely available to run social networks. Its development is supported by a community of programmers and interested network operators.
+
+
+
+
Our goal is to enable people to participate fairly and equally in online social networks. The equality of opportunity applies both to the fundamental equality of all people and to the possibility of letting their diverse voices be heard.
@@ -18,10 +20,6 @@ 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.
-
-
-
-
## Directory Layout
There are three important directories:
From 133a72af45261dbeabff407532d9a0b32749db65 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Wed, 20 Oct 2021 08:37:41 +0200
Subject: [PATCH 21/99] Set a link on logo
---
README.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 1ef4c1efb..e731588c7 100644
--- a/README.md
+++ b/README.md
@@ -6,11 +6,11 @@
[](https://discord.gg/AJSX9DCSUA)
[](https://www.codetriage.com/ocelot-social-community/ocelot-social)
-[ocelot.social](https://ocelot.social) is free and open source software program code that is freely available to run social networks. Its development is supported by a community of programmers and interested network operators.
+[ocelot.social](https://ocelot.social) is free and open source software program code to run social networks. Its development is supported by a community of programmers and interested network operators.
-
+[!
-
+
](https://ocelot.social)
Our goal is to enable people to participate fairly and equally in online social networks. The equality of opportunity applies both to the fundamental equality of all people and to the possibility of letting their diverse voices be heard.
From b38e742847c428239850b0f50255240d668ff94e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Wed, 20 Oct 2021 08:38:37 +0200
Subject: [PATCH 22/99] Fix link on logo
---
README.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index e731588c7..012d970d3 100644
--- a/README.md
+++ b/README.md
@@ -8,9 +8,9 @@
[ocelot.social](https://ocelot.social) is free and open source software program code to run social networks. Its development is supported by a community of programmers and interested network operators.
-[!
-
-
](https://ocelot.social)
+
+
+
Our goal is to enable people to participate fairly and equally in online social networks. The equality of opportunity applies both to the fundamental equality of all people and to the possibility of letting their diverse voices be heard.
From 9c41d1bd19c5f2b6b00d32093161275e1739c8f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Wed, 20 Oct 2021 08:39:58 +0200
Subject: [PATCH 23/99] Put target blank on logo
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 012d970d3..48a25a950 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
[ocelot.social](https://ocelot.social) is free and open source software program code to run social networks. Its development is supported by a community of programmers and interested network operators.
-
+
Our goal is to enable people to participate fairly and equally in online social networks. The equality of opportunity applies both to the fundamental equality of all people and to the possibility of letting their diverse voices be heard.
From 334c36a87ac188c5c2d52558b8d20bcf9e286714 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Wed, 20 Oct 2021 09:15:31 +0200
Subject: [PATCH 24/99] Add link for Ocelot.Social Community to LICENSE.md
---
LICENSE.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/LICENSE.md b/LICENSE.md
index bf54c386f..cd085aca8 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -2,7 +2,7 @@
MIT License
-Copyright \(c\) 2018-2021 Ocelot.Social Community
+Copyright \(c\) 2018-2021 [Ocelot.Social Community](https://github.com/Ocelot-Social-Community)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \(the "Software"\), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
From 6e8db74cd8c1b01bf0d2b4f98565a63f169e7d9b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Wed, 20 Oct 2021 09:46:31 +0200
Subject: [PATCH 25/99] Add support page to footer
---
webapp/constants/links.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/webapp/constants/links.js b/webapp/constants/links.js
index 16d3d085f..db78869bb 100644
--- a/webapp/constants/links.js
+++ b/webapp/constants/links.js
@@ -130,7 +130,7 @@ export default {
DATA_PRIVACY,
FAQ,
DONATE,
+ SUPPORT,
IMPRINT,
- // SUPPORT,
],
}
From acad80c3c8262934dd2e38961c08c0fde769099a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Wed, 20 Oct 2021 10:14:27 +0200
Subject: [PATCH 26/99] Refactor internal pages to new CSS
- Make FAQ page internal.
---
webapp/constants/links.js | 2 +-
webapp/locales/html/de/code-of-conduct.html | 58 ++++++++++++++++-
webapp/locales/html/de/data-privacy.html | 58 ++++++++++++++++-
webapp/locales/html/de/donate.html | 58 ++++++++++++++++-
webapp/locales/html/de/faq.html | 65 ++++++++++++++++++-
webapp/locales/html/de/imprint.html | 58 ++++++++++++++++-
webapp/locales/html/de/organization.html | 58 ++++++++++++++++-
webapp/locales/html/de/support.html | 58 ++++++++++++++++-
.../locales/html/de/terms-and-conditions.html | 59 ++++++++++++++++-
webapp/locales/html/en/code-of-conduct.html | 58 ++++++++++++++++-
webapp/locales/html/en/data-privacy.html | 58 ++++++++++++++++-
webapp/locales/html/en/donate.html | 58 ++++++++++++++++-
webapp/locales/html/en/faq.html | 65 ++++++++++++++++++-
webapp/locales/html/en/imprint.html | 58 ++++++++++++++++-
webapp/locales/html/en/organization.html | 58 ++++++++++++++++-
webapp/locales/html/en/support.html | 58 ++++++++++++++++-
.../locales/html/en/terms-and-conditions.html | 58 ++++++++++++++++-
17 files changed, 928 insertions(+), 17 deletions(-)
diff --git a/webapp/constants/links.js b/webapp/constants/links.js
index db78869bb..c65c9be3c 100644
--- a/webapp/constants/links.js
+++ b/webapp/constants/links.js
@@ -83,7 +83,7 @@ const DATA_PRIVACY = defaultPageParamsPages.DATA_PRIVACY.overwrite({
},
})
const FAQ = defaultPageParamsPages.FAQ.overwrite({
- externalLink: 'https://ocelot.social', // if string is defined and not empty it's dominating
+ // externalLink: null, // if string is defined and not empty it's dominating
internalPage: {
// footerIdent: 'site.faq', // localized string identifier, if undefined default is used
diff --git a/webapp/locales/html/de/code-of-conduct.html b/webapp/locales/html/de/code-of-conduct.html
index bd0d41ba8..f40fd76f9 100644
--- a/webapp/locales/html/de/code-of-conduct.html
+++ b/webapp/locales/html/de/code-of-conduct.html
@@ -1,4 +1,60 @@
-Ich bin der Inhalt vom Verhaltenskodex.
+
+
+ Für das soziale Netzwerk Ocelot.Social für Entwickler
+
+
+ Präambel
+
+
+ Ich bin der Inhalt vom Verhaltenskodex.
+
+
+
+
diff --git a/webapp/locales/html/de/data-privacy.html b/webapp/locales/html/de/data-privacy.html
index a6fc04470..5ffaf5bc2 100644
--- a/webapp/locales/html/de/data-privacy.html
+++ b/webapp/locales/html/de/data-privacy.html
@@ -1,4 +1,60 @@
-Das hier wäre der Inhalt der Datenschutzbestimmungen.
+
+
+ Für das soziale Netzwerk Ocelot.Social für Entwickler
+
+
+ Information über die Erhebung personenbezogener Daten
+
+
+ Das hier wäre der Inhalt der Datenschutzbestimmungen.
+
+
+
+
diff --git a/webapp/locales/html/de/donate.html b/webapp/locales/html/de/donate.html
index 70cf6e0bb..7ac723202 100644
--- a/webapp/locales/html/de/donate.html
+++ b/webapp/locales/html/de/donate.html
@@ -1,4 +1,60 @@
-Hier steht was zu den Spenden.
+
+
+ Für das soziale Netzwerk Ocelot.Social für Entwickler
+
+
+ Wohin kann ich spenden?
+
+
+ Hier steht was zu den Spenden.
+
+
+
+
diff --git a/webapp/locales/html/de/faq.html b/webapp/locales/html/de/faq.html
index da3b2447a..aab0205a1 100644
--- a/webapp/locales/html/de/faq.html
+++ b/webapp/locales/html/de/faq.html
@@ -1,4 +1,67 @@
-Hier stehen die FAQs.
+
+
+ Für das soziale Netzwerk Ocelot.Social für Entwickler
+
+
+ Wie bediene ich dieses Netzwerk?
+
+
+ Hier findest Du die
+ Bedienungsanleitung.
+
+
+ Betreiberspezifische FAQs
+
+
+ Hier steht was zu den betreiberspezifischen FAQs.
+
+
+
+
diff --git a/webapp/locales/html/de/imprint.html b/webapp/locales/html/de/imprint.html
index 82450b370..818beaae9 100644
--- a/webapp/locales/html/de/imprint.html
+++ b/webapp/locales/html/de/imprint.html
@@ -1,4 +1,60 @@
-Ich bin das Impressum.
+
+
+ Für das soziale Netzwerk Ocelot.Social für Entwickler
+
+
+ Betreiber
+
+
+ Ich bin das Impressum.
+
+
+
+
diff --git a/webapp/locales/html/de/organization.html b/webapp/locales/html/de/organization.html
index 6abd63a6e..ad9c4ce49 100644
--- a/webapp/locales/html/de/organization.html
+++ b/webapp/locales/html/de/organization.html
@@ -1,4 +1,60 @@
-Hier wird das Netzwerk beschrieben.
+
+
+ Für das soziale Netzwerk Ocelot.Social für Entwickler
+
+
+ Das Entwicklernetzwerk
+
+
+ Hier wird das Netzwerk beschrieben.
+
+
+
+
diff --git a/webapp/locales/html/de/support.html b/webapp/locales/html/de/support.html
index 081b6dbfa..50490111f 100644
--- a/webapp/locales/html/de/support.html
+++ b/webapp/locales/html/de/support.html
@@ -1,4 +1,60 @@
-Ich bin der Inhalt vom Support.
+
+
+ Für das soziale Netzwerk Ocelot.Social für Entwickler
+
+
+ Ansprechpartner
+
+
+ Ich bin der Inhalt vom Support.
+
+
+
+
diff --git a/webapp/locales/html/de/terms-and-conditions.html b/webapp/locales/html/de/terms-and-conditions.html
index af6c023a3..c35fb92ac 100644
--- a/webapp/locales/html/de/terms-and-conditions.html
+++ b/webapp/locales/html/de/terms-and-conditions.html
@@ -1,4 +1,61 @@
-Ich bin der Inhalt der Seite "Nutzungsbedingungen".
+
+
+
+ Für das soziale Netzwerk Ocelot.Social für Entwickler
+
+
+ Nutzung und Lizenz
+
+
+ Ich bin der Inhalt der Seite "Nutzungsbedingungen".
+
+
+
+
diff --git a/webapp/locales/html/en/code-of-conduct.html b/webapp/locales/html/en/code-of-conduct.html
index d3a9d7078..a38d79365 100644
--- a/webapp/locales/html/en/code-of-conduct.html
+++ b/webapp/locales/html/en/code-of-conduct.html
@@ -1,4 +1,60 @@
-I am the content of the code of conduct.
+
+
+ For the social network Ocelot.Social for Developers
+
+
+ Präambel
+
+
+ I am the content of the code of conduct.
+
+
+
+
diff --git a/webapp/locales/html/en/data-privacy.html b/webapp/locales/html/en/data-privacy.html
index 5c38928c8..c21a83532 100644
--- a/webapp/locales/html/en/data-privacy.html
+++ b/webapp/locales/html/en/data-privacy.html
@@ -1,4 +1,60 @@
-This would be our data privacy section.
+
+
+ For the social network Ocelot.Social for Developers
+
+
+ Information about the collection of personal data
+
+
+ This would be our data privacy section.
+
+
+
+
diff --git a/webapp/locales/html/en/donate.html b/webapp/locales/html/en/donate.html
index 82abaff6a..e436c7900 100644
--- a/webapp/locales/html/en/donate.html
+++ b/webapp/locales/html/en/donate.html
@@ -1,4 +1,60 @@
-Here's what it says about donations.
+
+
+ For the social network Ocelot.Social for Developers
+
+
+ Where can I donate?
+
+
+ Here's what it says about donations.
+
+
+
+
diff --git a/webapp/locales/html/en/faq.html b/webapp/locales/html/en/faq.html
index e87174838..1356622aa 100644
--- a/webapp/locales/html/en/faq.html
+++ b/webapp/locales/html/en/faq.html
@@ -1,4 +1,67 @@
-Here are the FAQs.
+
+
+ For the social network Ocelot.Social for Developers
+
+
+ How do I operate this network?
+
+
+ Here you can find the
+ user manual.
+
+
+ Operator-Specific FAQs
+
+
+ Here are the operator-specific FAQs.
+
+
+
+
diff --git a/webapp/locales/html/en/imprint.html b/webapp/locales/html/en/imprint.html
index 5f1cdae19..2723cb3fa 100644
--- a/webapp/locales/html/en/imprint.html
+++ b/webapp/locales/html/en/imprint.html
@@ -1,4 +1,60 @@
-I am the imprint.
+
+
+ For the social network Ocelot.Social for Developers
+
+
+ Operator
+
+
+ I am the imprint.
+
+
+
+
diff --git a/webapp/locales/html/en/organization.html b/webapp/locales/html/en/organization.html
index 2be0dc833..a1f7684d4 100644
--- a/webapp/locales/html/en/organization.html
+++ b/webapp/locales/html/en/organization.html
@@ -1,4 +1,60 @@
-Here the network is described.
+
+
+ For the social network Ocelot.Social for Developers
+
+
+ The Developers Network
+
+
+ Here the network is described.
+
+
+
+
diff --git a/webapp/locales/html/en/support.html b/webapp/locales/html/en/support.html
index 44b519e1d..7905714b5 100644
--- a/webapp/locales/html/en/support.html
+++ b/webapp/locales/html/en/support.html
@@ -1,4 +1,60 @@
-I am the content of the support.
+
+
+ For the social network Ocelot.Social for Developers
+
+
+ Contact
+
+
+ I am the content of the support.
+
+
+
+
diff --git a/webapp/locales/html/en/terms-and-conditions.html b/webapp/locales/html/en/terms-and-conditions.html
index 746851607..0df6d1e32 100644
--- a/webapp/locales/html/en/terms-and-conditions.html
+++ b/webapp/locales/html/en/terms-and-conditions.html
@@ -1,4 +1,60 @@
-I am the content of the page "Terms And Conditions".
+
+
+ For the social network Ocelot.Social for Developers
+
+
+ Use and License
+
+
+ I am the content of the page "Terms And Conditions".
+
+
+
+
From 367936af3b832df81d8e0efaf40160f3a50473ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Wed, 20 Oct 2021 11:20:46 +0200
Subject: [PATCH 27/99] Fix page footer test
---
webapp/components/PageFooter/PageFooter.spec.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/webapp/components/PageFooter/PageFooter.spec.js b/webapp/components/PageFooter/PageFooter.spec.js
index 7b104add2..95be76630 100644
--- a/webapp/components/PageFooter/PageFooter.spec.js
+++ b/webapp/components/PageFooter/PageFooter.spec.js
@@ -33,8 +33,8 @@ describe('PageFooter.vue', () => {
expect(wrapper.findAll('a')).toHaveLength(5)
})
- it('renders three nuxt-links', () => {
- expect(wrapper.findAll('.nuxt-link')).toHaveLength(3)
+ it('renders four nuxt-links', () => {
+ expect(wrapper.findAll('.nuxt-link')).toHaveLength(4)
})
it('renders version', () => {
From 8444b5e9d144fc5c1cb7732da87b0a323684c4d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Wed, 20 Oct 2021 12:41:05 +0200
Subject: [PATCH 28/99] Change notification e-mails settings page link
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: Letícia Leal Moreira
---
backend/src/middleware/helpers/email/templateBuilder.js | 3 ++-
.../middleware/helpers/email/templates/de/notification.html | 2 +-
.../middleware/helpers/email/templates/en/notification.html | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/backend/src/middleware/helpers/email/templateBuilder.js b/backend/src/middleware/helpers/email/templateBuilder.js
index 8098b38fe..12624f5ac 100644
--- a/backend/src/middleware/helpers/email/templateBuilder.js
+++ b/backend/src/middleware/helpers/email/templateBuilder.js
@@ -98,7 +98,8 @@ export const wrongAccountTemplate = ({ email }) => {
export const notificationTemplate = ({ email, notification }) => {
const actionUrl = new URL('/notifications', CONFIG.CLIENT_URI)
- const renderParams = { ...defaultParams, name: notification.to.name, actionUrl }
+ const settingsUrl = new URL('/settings/notifications', CONFIG.CLIENT_URI)
+ const renderParams = { ...defaultParams, name: notification.to.name, settingsUrl, actionUrl }
let content
switch (notification.to.locale) {
case 'de':
diff --git a/backend/src/middleware/helpers/email/templates/de/notification.html b/backend/src/middleware/helpers/email/templates/de/notification.html
index b3c60b26e..d935424be 100644
--- a/backend/src/middleware/helpers/email/templates/de/notification.html
+++ b/backend/src/middleware/helpers/email/templates/de/notification.html
@@ -71,7 +71,7 @@
|
- PS: Möchtest du keine E-Mails mehr erhalten, dann ändere deine PS: Möchtest du keine E-Mails mehr erhalten, dann ändere deine Benachrichtigungseinstellungen.
|
diff --git a/backend/src/middleware/helpers/email/templates/en/notification.html b/backend/src/middleware/helpers/email/templates/en/notification.html
index 58cbffd6f..168b21864 100644
--- a/backend/src/middleware/helpers/email/templates/en/notification.html
+++ b/backend/src/middleware/helpers/email/templates/en/notification.html
@@ -70,7 +70,7 @@
|
- PS: If you don't want to receive e-mails anymore, change your PS: If you don't want to receive e-mails anymore, change your notification settings.
|
From c60b0e581d6f42028c11166c83dde4b860c684fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Wed, 20 Oct 2021 12:46:50 +0200
Subject: [PATCH 29/99] Add commands linting and test for contributing
---
README.md | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/README.md b/README.md
index 48a25a950..a65807930 100644
--- a/README.md
+++ b/README.md
@@ -140,6 +140,21 @@ We are happy if you fork our repository, but we don't recommend it for developme
Clone this repository locally as [described above](#clone-the-repository), create your branch named `-`, add your code and push your branch to this repository. Then create a PR by comparing it to our `master`.
+Please run the following commands before you push:
+
+```bash
+# in folder backend/
+$ yarn lint --fix
+$ yarn test
+```
+
+```bash
+# in folder webapp/
+$ yarn lint --fix
+$ yarn locales --fix
+$ yarn test
+```
+
Check out our [contribution guideline](./CONTRIBUTING.md), too!
### Developer Chat
From eee5e23fbbbecbb4623410bd41033adc4a46e4bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Thu, 21 Oct 2021 04:58:08 +0200
Subject: [PATCH 30/99] Correct english in README.md
Co-authored-by: Ulf Gebhardt
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index a65807930..514423d2f 100644
--- a/README.md
+++ b/README.md
@@ -110,7 +110,7 @@ $ docker-compose -f docker-compose.yml up
This will start all required Docker containers.
Make sure your database is running on `http://localhost:7474/browser/`.
-Prepare database once beforehand:
+Prepare database once before you start:
```bash
# in folder backend/
From 7f30c9143526000854668ae59e739ac1a37f13f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Thu, 21 Oct 2021 05:00:13 +0200
Subject: [PATCH 31/99] Correct misspelling in README.md
Co-authored-by: Ulf Gebhardt
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 514423d2f..0edb14790 100644
--- a/README.md
+++ b/README.md
@@ -125,7 +125,7 @@ $ yarn run db:reset && db:seed
```
For a closer description see [backend README.md](./backend/README.md).
-For a full documentation see [SUMMERY](./SUMMARY.md).
+For a full documentation see [SUMMARY](./SUMMARY.md).
### Local Installation
From aadc8dcbf504e4d3ab2ef5d1b009f7f1044b299a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Thu, 21 Oct 2021 05:00:40 +0200
Subject: [PATCH 32/99] Correct misspelling in README.md
Co-authored-by: Ulf Gebhardt
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 0edb14790..122284860 100644
--- a/README.md
+++ b/README.md
@@ -129,7 +129,7 @@ For a full documentation see [SUMMARY](./SUMMARY.md).
### Local Installation
-For a full documentation see [SUMMERY](./SUMMARY.md).
+For a full documentation see [SUMMARY](./SUMMARY.md).
## Contributing
From d54d8183aa2013bef11cd9de5eb9479a20e55125 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Thu, 21 Oct 2021 05:02:55 +0200
Subject: [PATCH 33/99] Change good-first-issue to a link in README.md
Co-authored-by: Ulf Gebhardt
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 122284860..458434f00 100644
--- a/README.md
+++ b/README.md
@@ -133,7 +133,7 @@ For a full documentation see [SUMMARY](./SUMMARY.md).
## Contributing
-Choose an issue (consider our label `good-first-issue`) and leave a comment there. We will then invite you to join our volunteers team.
+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 via the email we send you.
We are happy if you fork our repository, but we don't recommend it for development. You do not need a fork.
From 130f7cd5e8bb8700e5df252b16b4e0ff806b921b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Thu, 21 Oct 2021 05:04:56 +0200
Subject: [PATCH 34/99] Clarify volunteers invitation in README.md
Co-authored-by: Ulf Gebhardt
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 458434f00..3a9d91760 100644
--- a/README.md
+++ b/README.md
@@ -134,7 +134,7 @@ For a full documentation see [SUMMARY](./SUMMARY.md).
## 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 via the email we send you.
+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.
We are happy if you fork our repository, but we don't recommend it for development. You do not need a fork.
From 377b2e030fb4c1f51a1394df973ef6644bf8e4bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Thu, 21 Oct 2021 05:07:15 +0200
Subject: [PATCH 35/99] Correct mention in README.md
Co-authored-by: Ulf Gebhardt
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 3a9d91760..e7d9b2b72 100644
--- a/README.md
+++ b/README.md
@@ -160,7 +160,7 @@ Check out our [contribution guideline](./CONTRIBUTING.md), too!
### 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 `@@Mentor` to get you onboard :neckbeard:
+Just introduce yourself at `#introduce-yourself` and mention a mentor or `@@Mentors` to get you onboard :neckbeard:
We give write permissions to every developer who asks for it. Just text us on
[Discord](https://discord.gg/AJSX9DCSUA).
From 5bf755f4eb004af737b7cc60c42e9baef081d15d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Mon, 25 Oct 2021 20:15:53 +0200
Subject: [PATCH 36/99] Fix backend test
'src/schema/resolvers/users/location.spec.js'
---
backend/src/schema/resolvers/users/location.spec.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backend/src/schema/resolvers/users/location.spec.js b/backend/src/schema/resolvers/users/location.spec.js
index f4ff08fb0..e69b48f50 100644
--- a/backend/src/schema/resolvers/users/location.spec.js
+++ b/backend/src/schema/resolvers/users/location.spec.js
@@ -135,7 +135,7 @@ describe('Location Service', () => {
},
{
id: expect.stringMatching(/^place\.[0-9]+$/),
- place_name: 'Berlin Township, New Jersey, United States',
+ place_name: 'Berlin Heights, Ohio, United States',
},
])
})
From abc6998f20898d8cfa60db647af562ef0edc5402 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Mon, 25 Oct 2021 20:16:34 +0200
Subject: [PATCH 37/99] Update Neode to v0.4.7
---
backend/package.json | 2 +-
backend/yarn.lock | 51 +++++++++++++++++++++++++++++++-------------
2 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/backend/package.json b/backend/package.json
index 594761b47..6779c63ff 100644
--- a/backend/package.json
+++ b/backend/package.json
@@ -104,7 +104,7 @@
"mustache": "^4.2.0",
"neo4j-driver": "^4.0.2",
"neo4j-graphql-js": "^2.11.5",
- "neode": "^0.3.7",
+ "neode": "^0.4.7",
"node-fetch": "~2.6.1",
"nodemailer": "^6.4.4",
"nodemailer-html-to-text": "^3.2.0",
diff --git a/backend/yarn.lock b/backend/yarn.lock
index f2e4c7b16..117383e58 100644
--- a/backend/yarn.lock
+++ b/backend/yarn.lock
@@ -1023,7 +1023,7 @@
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.0.0.tgz#ba83436edfac1d1ffd0e94797d43419c20ad49b8"
integrity sha512-XxD4A5YMIH70ddjG7BJBUz7RWVQAwIP/36Eoyh0DsaWp92OAeXkrbtSEaYkynBPTsN9Uv2mZq9QWZYILl2Svrw==
-"@hapi/joi@^15.1.0":
+"@hapi/joi@^15.1.1":
version "15.1.1"
resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-15.1.1.tgz#c675b8a71296f02833f8d6d243b34c57b8ce19d7"
integrity sha512-entf8ZMOK8sc+8YfeOlM8pCfg3b5+WZIKBfUaaJT8UsjAAPjartzxIYm3TIbjvA4u+u++KbcXD38k682nVHDAQ==
@@ -7527,14 +7527,18 @@ negotiator@0.6.2:
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb"
integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==
-neo4j-driver@^1.7.6:
- version "1.7.6"
- resolved "https://registry.yarnpkg.com/neo4j-driver/-/neo4j-driver-1.7.6.tgz#eccb135a71eba9048c68717444593a6424cffc49"
- integrity sha512-6c3ALO3vYDfUqNoCy8OFzq+fQ7q/ab3LCuJrmm8P04M7RmyRCCnUtJ8IzSTGbiZvyhcehGK+azNDAEJhxPV/hA==
+neo4j-driver-bolt-connection@^4.3.4:
+ version "4.3.4"
+ resolved "https://registry.yarnpkg.com/neo4j-driver-bolt-connection/-/neo4j-driver-bolt-connection-4.3.4.tgz#de642bb6a62ffc6ae2e280dccf21395b4d1705a2"
+ integrity sha512-yxbvwGav+N7EYjcEAINqL6D3CZV+ee2qLInpAhx+iNurwbl3zqtBGiVP79SZ+7tU++y3Q1fW5ofikH06yc+LqQ==
dependencies:
- "@babel/runtime" "^7.5.5"
+ neo4j-driver-core "^4.3.4"
text-encoding-utf-8 "^1.0.2"
- uri-js "^4.2.2"
+
+neo4j-driver-core@^4.3.4:
+ version "4.3.4"
+ resolved "https://registry.yarnpkg.com/neo4j-driver-core/-/neo4j-driver-core-4.3.4.tgz#b445a4fbf94dce8441075099bd6ac3133c1cf5ee"
+ integrity sha512-3tn3j6IRUNlpXeehZ9Xv7dLTZPB4a7APaoJ+xhQyMmYQO3ujDM4RFHc0pZcG+GokmaltT5pUCIPTDYx6ODdhcA==
neo4j-driver@^4.0.1, neo4j-driver@^4.0.2:
version "4.0.2"
@@ -7546,6 +7550,16 @@ neo4j-driver@^4.0.1, neo4j-driver@^4.0.2:
text-encoding-utf-8 "^1.0.2"
uri-js "^4.2.2"
+neo4j-driver@^4.2.2:
+ version "4.3.4"
+ resolved "https://registry.yarnpkg.com/neo4j-driver/-/neo4j-driver-4.3.4.tgz#a54f0562f868ee94dff7509df74e3eb2c1f95a85"
+ integrity sha512-AGrsFFqnoZv4KhJdmKt4mOBV5mnxmV3+/t8KJTOM68jQuEWoy+RlmAaRRaCSU4eY586OFN/R8lg9MrJpZdSFjw==
+ dependencies:
+ "@babel/runtime" "^7.5.5"
+ neo4j-driver-bolt-connection "^4.3.4"
+ neo4j-driver-core "^4.3.4"
+ rxjs "^6.6.3"
+
neo4j-graphql-js@^2.11.5:
version "2.11.5"
resolved "https://registry.yarnpkg.com/neo4j-graphql-js/-/neo4j-graphql-js-2.11.5.tgz#4e887d727ec05b2c57ab81fad373fa3fcb734e39"
@@ -7559,15 +7573,15 @@ neo4j-graphql-js@^2.11.5:
lodash "^4.17.15"
neo4j-driver "^4.0.1"
-neode@^0.3.7:
- version "0.3.7"
- resolved "https://registry.yarnpkg.com/neode/-/neode-0.3.7.tgz#766105307e138b1212957aceba538e89e3d784cb"
- integrity sha512-XnRJyD6bZx4HyHBmnLHuVUKtSD3FhBPXYdh7/rqiFAwBDMOSySjMFjFCYmop+sF8IBZmliowDs8zkSHt27U1kw==
+neode@^0.4.7:
+ version "0.4.7"
+ resolved "https://registry.yarnpkg.com/neode/-/neode-0.4.7.tgz#033007b57a2ee167e9ee5537493086db08d005eb"
+ integrity sha512-YXlc187JRpeKCBcUIkY6nimXXG+Tvlopfe71/FPno2THrwmYt5mm0RPHZ+mXF2O1Xg6zvjKvOpCpDz2vHBfroQ==
dependencies:
- "@hapi/joi" "^15.1.0"
+ "@hapi/joi" "^15.1.1"
dotenv "^4.0.0"
- neo4j-driver "^1.7.6"
- uuid "^3.3.2"
+ neo4j-driver "^4.2.2"
+ uuid "^3.4.0"
next-tick@^1.0.0:
version "1.0.0"
@@ -8982,6 +8996,13 @@ rxjs@^6.4.0, rxjs@^6.5.2, rxjs@^6.5.4:
dependencies:
tslib "^1.9.0"
+rxjs@^6.6.3:
+ version "6.6.7"
+ resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9"
+ integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==
+ dependencies:
+ tslib "^1.9.0"
+
safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
@@ -10347,7 +10368,7 @@ uuid@3.3.2:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
-uuid@^3.1.0, uuid@^3.3.2:
+uuid@^3.1.0, uuid@^3.3.2, uuid@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
From ea23acc425faa9eb5a482cec8a603afe165d7594 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 25 Oct 2021 18:59:10 +0000
Subject: [PATCH 38/99] Bump neo4j-driver from 4.0.2 to 4.3.4
Bumps [neo4j-driver](https://github.com/neo4j/neo4j-javascript-driver) from 4.0.2 to 4.3.4.
- [Release notes](https://github.com/neo4j/neo4j-javascript-driver/releases)
- [Commits](https://github.com/neo4j/neo4j-javascript-driver/compare/4.0.2...4.3.4)
---
updated-dependencies:
- dependency-name: neo4j-driver
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
package.json | 2 +-
yarn.lock | 49 ++++++++++++++++---------------------------------
2 files changed, 17 insertions(+), 34 deletions(-)
diff --git a/package.json b/package.json
index 8e929d3c3..6e455d0e7 100644
--- a/package.json
+++ b/package.json
@@ -41,7 +41,7 @@
"import": "^0.0.6",
"jsonwebtoken": "^8.5.1",
"mock-socket": "^9.0.3",
- "neo4j-driver": "^4.0.2",
+ "neo4j-driver": "^4.3.4",
"neode": "^0.4.7",
"npm-run-all": "^4.1.5",
"rosie": "^2.0.1",
diff --git a/yarn.lock b/yarn.lock
index 337ce42bb..f61bfdc49 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4457,37 +4457,27 @@ neo-async@^2.6.0:
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c"
integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==
-neo4j-driver-bolt-connection@^4.3.1:
- version "4.3.1"
- resolved "https://registry.yarnpkg.com/neo4j-driver-bolt-connection/-/neo4j-driver-bolt-connection-4.3.1.tgz#bbaf0d2287d9be61a480397067c57e82e431fac9"
- integrity sha512-xE7tHgoqcHM1qlXKWWxcOag2F+5OgNVeKDW9W+DKLQ7g3YGvutxcUzp1WrAc8hpFGM2IWVSNEeUt5c5SIXlHCg==
+neo4j-driver-bolt-connection@^4.3.4:
+ version "4.3.4"
+ resolved "https://registry.yarnpkg.com/neo4j-driver-bolt-connection/-/neo4j-driver-bolt-connection-4.3.4.tgz#de642bb6a62ffc6ae2e280dccf21395b4d1705a2"
+ integrity sha512-yxbvwGav+N7EYjcEAINqL6D3CZV+ee2qLInpAhx+iNurwbl3zqtBGiVP79SZ+7tU++y3Q1fW5ofikH06yc+LqQ==
dependencies:
- neo4j-driver-core "^4.3.1"
+ neo4j-driver-core "^4.3.4"
text-encoding-utf-8 "^1.0.2"
-neo4j-driver-core@^4.3.1:
- version "4.3.1"
- resolved "https://registry.yarnpkg.com/neo4j-driver-core/-/neo4j-driver-core-4.3.1.tgz#5d92ae3f9ee48e3af2b4a085503368b15a195a98"
- integrity sha512-FV194GxpPvgNpettGUMit6hxbMOkBR42j1K6xwfLvm25XYaZJMJzE0ezqS0Vp0G6etUqhUQChh7WYLdTMIztpQ==
+neo4j-driver-core@^4.3.4:
+ version "4.3.4"
+ resolved "https://registry.yarnpkg.com/neo4j-driver-core/-/neo4j-driver-core-4.3.4.tgz#b445a4fbf94dce8441075099bd6ac3133c1cf5ee"
+ integrity sha512-3tn3j6IRUNlpXeehZ9Xv7dLTZPB4a7APaoJ+xhQyMmYQO3ujDM4RFHc0pZcG+GokmaltT5pUCIPTDYx6ODdhcA==
-neo4j-driver@^4.0.2:
- version "4.0.2"
- resolved "https://registry.yarnpkg.com/neo4j-driver/-/neo4j-driver-4.0.2.tgz#78de3b91e91572bcbd9d2e02554322fe1ab399ea"
- integrity sha512-xQN4BZZsweaNNac7FDYAV6f/JybghwY3lk4fwblS8V5KQ+DBMPe4Pthh672mp+wEYZGyzPalq5CfpcBrWaZ4Gw==
+neo4j-driver@^4.2.2, neo4j-driver@^4.3.4:
+ version "4.3.4"
+ resolved "https://registry.yarnpkg.com/neo4j-driver/-/neo4j-driver-4.3.4.tgz#a54f0562f868ee94dff7509df74e3eb2c1f95a85"
+ integrity sha512-AGrsFFqnoZv4KhJdmKt4mOBV5mnxmV3+/t8KJTOM68jQuEWoy+RlmAaRRaCSU4eY586OFN/R8lg9MrJpZdSFjw==
dependencies:
"@babel/runtime" "^7.5.5"
- rxjs "^6.5.2"
- text-encoding-utf-8 "^1.0.2"
- uri-js "^4.2.2"
-
-neo4j-driver@^4.2.2:
- version "4.3.1"
- resolved "https://registry.yarnpkg.com/neo4j-driver/-/neo4j-driver-4.3.1.tgz#897c812abf631b5a520162bb1d71d6a1b320d231"
- integrity sha512-7MguiDpGWoj10wfQvi7HRLBif39Sz67w5zOyhaDG8OcHfJbU+onlnGfE81AOlOlYSj/JSv196K1RcFXuJMZv8Q==
- dependencies:
- "@babel/runtime" "^7.5.5"
- neo4j-driver-bolt-connection "^4.3.1"
- neo4j-driver-core "^4.3.1"
+ neo4j-driver-bolt-connection "^4.3.4"
+ neo4j-driver-core "^4.3.4"
rxjs "^6.6.3"
neode@^0.4.7:
@@ -5289,14 +5279,7 @@ rosie@^2.0.1:
resolved "https://registry.yarnpkg.com/rosie/-/rosie-2.0.1.tgz#c250c4787ce450b72aa9eff26509f68589814fa2"
integrity sha1-wlDEeHzkULcqqe/yZQn2hYmBT6I=
-rxjs@^6.3.3, rxjs@^6.5.2:
- version "6.5.4"
- resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.4.tgz#e0777fe0d184cec7872df147f303572d414e211c"
- integrity sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==
- dependencies:
- tslib "^1.9.0"
-
-rxjs@^6.6.3:
+rxjs@^6.3.3, rxjs@^6.6.3:
version "6.6.7"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9"
integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==
From ad7581d8d23a41513ca26f83116d22660812083e Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 26 Oct 2021 03:57:39 +0000
Subject: [PATCH 39/99] Bump rosie from 2.0.1 to 2.1.0
Bumps [rosie](https://github.com/rosiejs/rosie) from 2.0.1 to 2.1.0.
- [Release notes](https://github.com/rosiejs/rosie/releases)
- [Commits](https://github.com/rosiejs/rosie/compare/v2.0.1...v2.1.0)
---
updated-dependencies:
- dependency-name: rosie
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
package.json | 2 +-
yarn.lock | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index 6e455d0e7..17a3a1135 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"neo4j-driver": "^4.3.4",
"neode": "^0.4.7",
"npm-run-all": "^4.1.5",
- "rosie": "^2.0.1",
+ "rosie": "^2.1.0",
"slug": "^5.1.0"
},
"resolutions": {
diff --git a/yarn.lock b/yarn.lock
index f61bfdc49..8c09a2fed 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5274,10 +5274,10 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
hash-base "^3.0.0"
inherits "^2.0.1"
-rosie@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/rosie/-/rosie-2.0.1.tgz#c250c4787ce450b72aa9eff26509f68589814fa2"
- integrity sha1-wlDEeHzkULcqqe/yZQn2hYmBT6I=
+rosie@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/rosie/-/rosie-2.1.0.tgz#0213a9d2b0401a2549cbce5f1cd914caffa22358"
+ integrity sha512-Dbzdc+prLXZuB/suRptDnBUY29SdGvND3bLg6cll8n7PNqzuyCxSlRfrkn8PqjS9n4QVsiM7RCvxCkKAkTQRjA==
rxjs@^6.3.3, rxjs@^6.6.3:
version "6.6.7"
From 8611c340b229874fcc86c8d6f1730aa5f877b78c Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 26 Oct 2021 04:00:11 +0000
Subject: [PATCH 40/99] Bump date-fns from 2.23.0 to 2.25.0
Bumps [date-fns](https://github.com/date-fns/date-fns) from 2.23.0 to 2.25.0.
- [Release notes](https://github.com/date-fns/date-fns/releases)
- [Changelog](https://github.com/date-fns/date-fns/blob/master/CHANGELOG.md)
- [Commits](https://github.com/date-fns/date-fns/compare/v2.23.0...v2.25.0)
---
updated-dependencies:
- dependency-name: date-fns
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
package.json | 4 ++--
yarn.lock | 57 ++++++++++++++++++----------------------------------
2 files changed, 22 insertions(+), 39 deletions(-)
diff --git a/package.json b/package.json
index 8e929d3c3..0fe64f55d 100644
--- a/package.json
+++ b/package.json
@@ -33,7 +33,7 @@
"cypress": "^7.0.1",
"cypress-cucumber-preprocessor": "^2.2.1",
"cypress-file-upload": "^3.5.3",
- "date-fns": "^2.23.0",
+ "date-fns": "^2.25.0",
"dotenv": "^8.2.0",
"expect": "^25.3.0",
"faker": "Marak/faker.js#master",
@@ -41,7 +41,7 @@
"import": "^0.0.6",
"jsonwebtoken": "^8.5.1",
"mock-socket": "^9.0.3",
- "neo4j-driver": "^4.0.2",
+ "neo4j-driver": "^4.3.4",
"neode": "^0.4.7",
"npm-run-all": "^4.1.5",
"rosie": "^2.0.1",
diff --git a/yarn.lock b/yarn.lock
index 337ce42bb..01666ca81 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2608,10 +2608,10 @@ date-fns@^1.27.2:
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c"
integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==
-date-fns@^2.23.0:
- version "2.23.0"
- resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.23.0.tgz#4e886c941659af0cf7b30fafdd1eaa37e88788a9"
- integrity sha512-5ycpauovVyAk0kXNZz6ZoB9AYMZB4DObse7P3BPWmyEjXNORTI8EJ6X0uaSAq4sCHzM1uajzrkr6HnsLQpxGXA==
+date-fns@^2.25.0:
+ version "2.25.0"
+ resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.25.0.tgz#8c5c8f1d958be3809a9a03f4b742eba894fc5680"
+ integrity sha512-ovYRFnTrbGPD4nqaEqescPEv1mNwvt+UTqI3Ay9SzNtey9NZnYu6E2qCcBBgJ6/2VF1zGGygpyTDITqpQQ5e+w==
date-now@^0.1.4:
version "0.1.4"
@@ -4457,37 +4457,27 @@ neo-async@^2.6.0:
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c"
integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==
-neo4j-driver-bolt-connection@^4.3.1:
- version "4.3.1"
- resolved "https://registry.yarnpkg.com/neo4j-driver-bolt-connection/-/neo4j-driver-bolt-connection-4.3.1.tgz#bbaf0d2287d9be61a480397067c57e82e431fac9"
- integrity sha512-xE7tHgoqcHM1qlXKWWxcOag2F+5OgNVeKDW9W+DKLQ7g3YGvutxcUzp1WrAc8hpFGM2IWVSNEeUt5c5SIXlHCg==
+neo4j-driver-bolt-connection@^4.3.4:
+ version "4.3.4"
+ resolved "https://registry.yarnpkg.com/neo4j-driver-bolt-connection/-/neo4j-driver-bolt-connection-4.3.4.tgz#de642bb6a62ffc6ae2e280dccf21395b4d1705a2"
+ integrity sha512-yxbvwGav+N7EYjcEAINqL6D3CZV+ee2qLInpAhx+iNurwbl3zqtBGiVP79SZ+7tU++y3Q1fW5ofikH06yc+LqQ==
dependencies:
- neo4j-driver-core "^4.3.1"
+ neo4j-driver-core "^4.3.4"
text-encoding-utf-8 "^1.0.2"
-neo4j-driver-core@^4.3.1:
- version "4.3.1"
- resolved "https://registry.yarnpkg.com/neo4j-driver-core/-/neo4j-driver-core-4.3.1.tgz#5d92ae3f9ee48e3af2b4a085503368b15a195a98"
- integrity sha512-FV194GxpPvgNpettGUMit6hxbMOkBR42j1K6xwfLvm25XYaZJMJzE0ezqS0Vp0G6etUqhUQChh7WYLdTMIztpQ==
+neo4j-driver-core@^4.3.4:
+ version "4.3.4"
+ resolved "https://registry.yarnpkg.com/neo4j-driver-core/-/neo4j-driver-core-4.3.4.tgz#b445a4fbf94dce8441075099bd6ac3133c1cf5ee"
+ integrity sha512-3tn3j6IRUNlpXeehZ9Xv7dLTZPB4a7APaoJ+xhQyMmYQO3ujDM4RFHc0pZcG+GokmaltT5pUCIPTDYx6ODdhcA==
-neo4j-driver@^4.0.2:
- version "4.0.2"
- resolved "https://registry.yarnpkg.com/neo4j-driver/-/neo4j-driver-4.0.2.tgz#78de3b91e91572bcbd9d2e02554322fe1ab399ea"
- integrity sha512-xQN4BZZsweaNNac7FDYAV6f/JybghwY3lk4fwblS8V5KQ+DBMPe4Pthh672mp+wEYZGyzPalq5CfpcBrWaZ4Gw==
+neo4j-driver@^4.2.2, neo4j-driver@^4.3.4:
+ version "4.3.4"
+ resolved "https://registry.yarnpkg.com/neo4j-driver/-/neo4j-driver-4.3.4.tgz#a54f0562f868ee94dff7509df74e3eb2c1f95a85"
+ integrity sha512-AGrsFFqnoZv4KhJdmKt4mOBV5mnxmV3+/t8KJTOM68jQuEWoy+RlmAaRRaCSU4eY586OFN/R8lg9MrJpZdSFjw==
dependencies:
"@babel/runtime" "^7.5.5"
- rxjs "^6.5.2"
- text-encoding-utf-8 "^1.0.2"
- uri-js "^4.2.2"
-
-neo4j-driver@^4.2.2:
- version "4.3.1"
- resolved "https://registry.yarnpkg.com/neo4j-driver/-/neo4j-driver-4.3.1.tgz#897c812abf631b5a520162bb1d71d6a1b320d231"
- integrity sha512-7MguiDpGWoj10wfQvi7HRLBif39Sz67w5zOyhaDG8OcHfJbU+onlnGfE81AOlOlYSj/JSv196K1RcFXuJMZv8Q==
- dependencies:
- "@babel/runtime" "^7.5.5"
- neo4j-driver-bolt-connection "^4.3.1"
- neo4j-driver-core "^4.3.1"
+ neo4j-driver-bolt-connection "^4.3.4"
+ neo4j-driver-core "^4.3.4"
rxjs "^6.6.3"
neode@^0.4.7:
@@ -5289,14 +5279,7 @@ rosie@^2.0.1:
resolved "https://registry.yarnpkg.com/rosie/-/rosie-2.0.1.tgz#c250c4787ce450b72aa9eff26509f68589814fa2"
integrity sha1-wlDEeHzkULcqqe/yZQn2hYmBT6I=
-rxjs@^6.3.3, rxjs@^6.5.2:
- version "6.5.4"
- resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.4.tgz#e0777fe0d184cec7872df147f303572d414e211c"
- integrity sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==
- dependencies:
- tslib "^1.9.0"
-
-rxjs@^6.6.3:
+rxjs@^6.3.3, rxjs@^6.6.3:
version "6.6.7"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9"
integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==
From f1d892facb1b3546b51435988370b508bc162452 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Mon, 1 Nov 2021 10:38:48 +0100
Subject: [PATCH 41/99] Change README.md db commands for docker
---
README.md | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index e7d9b2b72..4fcd9abd0 100644
--- a/README.md
+++ b/README.md
@@ -110,18 +110,19 @@ $ docker-compose -f docker-compose.yml up
This will start all required Docker containers.
Make sure your database is running on `http://localhost:7474/browser/`.
-Prepare database once before you start:
+Prepare database once before you start by running the following command in a second terminal:
```bash
-# in folder backend/
-yarn run db:migrate init
+# in main folder while docker-compose is up
+$ docker-compose exec backend yarn run db:migrate init
```
-Then clear and seed database:
+Then clear and seed database by running the following command as well in the second terminal:
```bash
-# in folder backend/
-$ yarn run db:reset && db:seed
+# in main folder while docker-compose is up
+$ docker-compose exec backend yarn run db:reset
+$ docker-compose exec backend yarn run db:seed
```
For a closer description see [backend README.md](./backend/README.md).
From ef3a765d3a56c85b5367343d7d83c5b456c7d590 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Mon, 1 Nov 2021 15:25:01 +0100
Subject: [PATCH 42/99] Add development logins again
---
README.md | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/README.md b/README.md
index 4fcd9abd0..603ea8178 100644
--- a/README.md
+++ b/README.md
@@ -60,6 +60,18 @@ Change into the new folder.
$ cd Ocelot-Social
```
+### Login
+
+
+
+Logins in the browser after the following installations:
+
+| email | password | role |
+| :--- | :--- | :--- |
+| `user@example.org` | 1234 | user |
+| `moderator@example.org` | 1234 | moderator |
+| `admin@example.org` | 1234 | admin |
+
### 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.
From d3cc49d37ba260f9a285c078c57e673a32a76732 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Wed, 3 Nov 2021 13:04:45 +0100
Subject: [PATCH 43/99] Implement MySomethingList for social media, use list
item slot
---
.../MySomethingList/MySomethingList.spec.js | 187 +++++++++++++
.../MySomethingList/MySomethingList.vue | 261 ++++++++++++++++++
.../SocialMedia/SocialMediaListItem.spec.js | 37 +++
.../SocialMedia/SocialMediaListItem.vue | 18 ++
webapp/pages/settings/my-social-media.spec.js | 230 +++++++--------
webapp/pages/settings/my-social-media.vue | 237 +---------------
6 files changed, 628 insertions(+), 342 deletions(-)
create mode 100644 webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
create mode 100644 webapp/components/_new/features/MySomethingList/MySomethingList.vue
create mode 100644 webapp/components/_new/features/SocialMedia/SocialMediaListItem.spec.js
create mode 100644 webapp/components/_new/features/SocialMedia/SocialMediaListItem.vue
diff --git a/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js b/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
new file mode 100644
index 000000000..7be290b3e
--- /dev/null
+++ b/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
@@ -0,0 +1,187 @@
+import { mount } from '@vue/test-utils'
+import flushPromises from 'flush-promises'
+import MySomethingList from './MySomethingList.vue'
+import Vuex from 'vuex'
+import Vue from 'vue'
+
+const localVue = global.localVue
+
+describe('MySomethingList.vue', () => {
+ let wrapper
+ let mocks
+ let getters
+ const socialMediaUrl = 'https://freeradical.zone/@mattwr18'
+ const newSocialMediaUrl = 'https://twitter.com/mattwr18'
+
+ beforeEach(() => {
+ mocks = {
+ $t: jest.fn(),
+ $apollo: {
+ mutate: jest.fn(),
+ },
+ $toast: {
+ error: jest.fn(),
+ success: jest.fn(),
+ },
+ }
+ getters = {
+ 'auth/user': () => {
+ return {}
+ },
+ }
+ })
+
+ describe('mount', () => {
+ let form, input, slots, submitButton
+ const Wrapper = () => {
+ const store = new Vuex.Store({
+ getters,
+ })
+ slots = { 'list-item': '' }
+ return mount(MySomethingList, { store, mocks, localVue, slots })
+ }
+
+ describe('adding social media link', () => {
+ beforeEach(() => {
+ wrapper = Wrapper()
+ form = wrapper.find('form')
+ input = wrapper.find('input#addSocialMedia')
+ submitButton = wrapper.find('button')
+ })
+
+ it('requires the link to be a valid url', async () => {
+ input.setValue('some value')
+ form.trigger('submit')
+ await Vue.nextTick()
+ expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
+ })
+
+ it('displays an error message when not saved successfully', async () => {
+ mocks.$apollo.mutate.mockRejectedValue({ message: 'Ouch!' })
+ input.setValue(newSocialMediaUrl)
+ form.trigger('submit')
+ await Vue.nextTick()
+ await flushPromises()
+ expect(mocks.$toast.error).toHaveBeenCalledTimes(1)
+ })
+
+ describe('success', () => {
+ beforeEach(async () => {
+ mocks.$apollo.mutate.mockResolvedValue({
+ data: { CreateSocialMedia: { id: 's2', url: newSocialMediaUrl } },
+ })
+ input.setValue(newSocialMediaUrl)
+ form.trigger('submit')
+ await Vue.nextTick()
+ })
+
+ it('sends the new url to the backend', () => {
+ const expected = expect.objectContaining({
+ variables: { url: newSocialMediaUrl },
+ })
+
+ expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
+ })
+
+ it('displays a success message', async () => {
+ await flushPromises()
+ expect(mocks.$toast.success).toHaveBeenCalledTimes(1)
+ })
+
+ it('clears the form', async () => {
+ await flushPromises()
+ expect(input.value).toBe(undefined)
+ expect(submitButton.vm.$attrs.disabled).toBe(true)
+ })
+ })
+ })
+
+ describe('given existing social media links', () => {
+ beforeEach(() => {
+ getters = {
+ 'auth/user': () => ({
+ socialMedia: [{ id: 's1', url: socialMediaUrl }],
+ }),
+ }
+
+ wrapper = Wrapper()
+ form = wrapper.find('form')
+ })
+
+ describe('for each item it', () => {
+ it('displays the item as slot "list-item"', () => {
+ expect(wrapper.find('.list-item').exists()).toBe(true)
+ })
+
+ it('displays the edit button', () => {
+ expect(wrapper.find('.base-button[data-test="edit-button"]').exists()).toBe(true)
+ })
+
+ it('displays the delete button', () => {
+ expect(wrapper.find('.base-button[data-test="delete-button"]').exists()).toBe(true)
+ })
+ })
+
+ it('does not accept a duplicate url', async () => {
+ wrapper.find('input#addSocialMedia').setValue(socialMediaUrl)
+ form.trigger('submit')
+ await Vue.nextTick()
+ expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
+ })
+
+ describe('editing social media link', () => {
+ beforeEach(async () => {
+ const editButton = wrapper.find('.base-button[data-test="edit-button"]')
+ editButton.trigger('click')
+ await Vue.nextTick()
+ input = wrapper.find('input#editSocialMedia')
+ })
+
+ it('disables adding new links while editing', () => {
+ const addInput = wrapper.find('input#addSocialMedia')
+
+ expect(addInput.exists()).toBe(false)
+ })
+
+ it('sends the new url to the backend', async () => {
+ const expected = expect.objectContaining({
+ variables: { id: 's1', url: newSocialMediaUrl },
+ })
+ input.setValue(newSocialMediaUrl)
+ form.trigger('submit')
+ await Vue.nextTick()
+ expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
+ })
+
+ it('allows the user to cancel editing', async () => {
+ const cancelButton = wrapper.find('button#cancel')
+ cancelButton.trigger('click')
+ await Vue.nextTick()
+ expect(wrapper.find('input#editSocialMedia').exists()).toBe(false)
+ })
+ })
+
+ describe('deleting social media link', () => {
+ beforeEach(async () => {
+ const deleteButton = wrapper.find('.base-button[data-test="delete-button"]')
+ deleteButton.trigger('click')
+ await Vue.nextTick()
+ })
+
+ it('sends the link id to the backend', () => {
+ const expected = expect.objectContaining({
+ variables: { id: 's1' },
+ })
+
+ expect(mocks.$apollo.mutate).toHaveBeenCalledTimes(1)
+ expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
+ })
+
+ it('displays a success message', async () => {
+ await flushPromises()
+ expect(mocks.$toast.success).toHaveBeenCalledTimes(1)
+ })
+ })
+ })
+ })
+})
diff --git a/webapp/components/_new/features/MySomethingList/MySomethingList.vue b/webapp/components/_new/features/MySomethingList/MySomethingList.vue
new file mode 100644
index 000000000..ef374066a
--- /dev/null
+++ b/webapp/components/_new/features/MySomethingList/MySomethingList.vue
@@ -0,0 +1,261 @@
+
+
+ {{ $t('settings.social-media.name') }}
+
+
+
+
+
+ {{ /* $t('settings.social-media.name') */ 'Edit "' + editingLink.url + '"' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ editingLink.id ? $t('actions.save') : $t('settings.social-media.submit') }}
+
+
+ {{ $t('actions.cancel') }}
+
+
+
+
+
+
+
+
+
+
diff --git a/webapp/components/_new/features/SocialMedia/SocialMediaListItem.spec.js b/webapp/components/_new/features/SocialMedia/SocialMediaListItem.spec.js
new file mode 100644
index 000000000..fca686dae
--- /dev/null
+++ b/webapp/components/_new/features/SocialMedia/SocialMediaListItem.spec.js
@@ -0,0 +1,37 @@
+import { shallowMount } from '@vue/test-utils'
+import SocialMediaListItem from './SocialMediaListItem.vue'
+
+describe('SocialMediaListItem.vue', () => {
+ let wrapper
+ let propsData
+ const socialMediaUrl = 'https://freeradical.zone/@mattwr18'
+ const faviconUrl = 'https://freeradical.zone/favicon.ico'
+
+ beforeEach(() => {
+ propsData = {}
+ })
+
+ describe('shallowMount', () => {
+ const Wrapper = () => {
+ return shallowMount(SocialMediaListItem, { propsData })
+ }
+
+ describe('given existing social media links', () => {
+ beforeEach(() => {
+ propsData = { link: { id: 's1', url: socialMediaUrl, favicon: faviconUrl } }
+
+ wrapper = Wrapper()
+ })
+
+ describe('for each link it', () => {
+ it('displays the favicon', () => {
+ expect(wrapper.find(`img[src="${faviconUrl}"]`).exists()).toBe(true)
+ })
+
+ it('displays the url', () => {
+ expect(wrapper.find(`a[href="${socialMediaUrl}"]`).exists()).toBe(true)
+ })
+ })
+ })
+ })
+})
diff --git a/webapp/components/_new/features/SocialMedia/SocialMediaListItem.vue b/webapp/components/_new/features/SocialMedia/SocialMediaListItem.vue
new file mode 100644
index 000000000..0f807fdcd
--- /dev/null
+++ b/webapp/components/_new/features/SocialMedia/SocialMediaListItem.vue
@@ -0,0 +1,18 @@
+
+
+
+ {{ link.url }}
+
+
+
+
diff --git a/webapp/pages/settings/my-social-media.spec.js b/webapp/pages/settings/my-social-media.spec.js
index 1aadbb750..13b507049 100644
--- a/webapp/pages/settings/my-social-media.spec.js
+++ b/webapp/pages/settings/my-social-media.spec.js
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'
-import flushPromises from 'flush-promises'
+// import flushPromises from 'flush-promises'
import MySocialMedia from './my-social-media.vue'
import Vuex from 'vuex'
import Vue from 'vue'
@@ -11,19 +11,19 @@ describe('my-social-media.vue', () => {
let mocks
let getters
const socialMediaUrl = 'https://freeradical.zone/@mattwr18'
- const newSocialMediaUrl = 'https://twitter.com/mattwr18'
+ // const newSocialMediaUrl = 'https://twitter.com/mattwr18'
const faviconUrl = 'https://freeradical.zone/favicon.ico'
beforeEach(() => {
mocks = {
$t: jest.fn(),
- $apollo: {
- mutate: jest.fn(),
- },
- $toast: {
- error: jest.fn(),
- success: jest.fn(),
- },
+ // $apollo: {
+ // mutate: jest.fn(),
+ // },
+ // $toast: {
+ // error: jest.fn(),
+ // success: jest.fn(),
+ // },
}
getters = {
'auth/user': () => {
@@ -33,7 +33,7 @@ describe('my-social-media.vue', () => {
})
describe('mount', () => {
- let form, input, submitButton
+ // let form, input, submitButton
const Wrapper = () => {
const store = new Vuex.Store({
getters,
@@ -41,60 +41,60 @@ describe('my-social-media.vue', () => {
return mount(MySocialMedia, { store, mocks, localVue })
}
- describe('adding social media link', () => {
- beforeEach(() => {
- wrapper = Wrapper()
- form = wrapper.find('form')
- input = wrapper.find('input#addSocialMedia')
- submitButton = wrapper.find('button')
- })
+ // describe('adding social media link', () => {
+ // beforeEach(() => {
+ // wrapper = Wrapper()
+ // form = wrapper.find('form')
+ // input = wrapper.find('input#addSocialMedia')
+ // submitButton = wrapper.find('button')
+ // })
- it('requires the link to be a valid url', async () => {
- input.setValue('some value')
- form.trigger('submit')
- await Vue.nextTick()
- expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
- })
+ // it('requires the link to be a valid url', async () => {
+ // input.setValue('some value')
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
+ // })
- it('displays an error message when not saved successfully', async () => {
- mocks.$apollo.mutate.mockRejectedValue({ message: 'Ouch!' })
- input.setValue(newSocialMediaUrl)
- form.trigger('submit')
- await Vue.nextTick()
- await flushPromises()
- expect(mocks.$toast.error).toHaveBeenCalledTimes(1)
- })
+ // it('displays an error message when not saved successfully', async () => {
+ // mocks.$apollo.mutate.mockRejectedValue({ message: 'Ouch!' })
+ // input.setValue(newSocialMediaUrl)
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // await flushPromises()
+ // expect(mocks.$toast.error).toHaveBeenCalledTimes(1)
+ // })
- describe('success', () => {
- beforeEach(async () => {
- mocks.$apollo.mutate.mockResolvedValue({
- data: { CreateSocialMedia: { id: 's2', url: newSocialMediaUrl } },
- })
- input.setValue(newSocialMediaUrl)
- form.trigger('submit')
- await Vue.nextTick()
- })
+ // describe('success', () => {
+ // beforeEach(async () => {
+ // mocks.$apollo.mutate.mockResolvedValue({
+ // data: { CreateSocialMedia: { id: 's2', url: newSocialMediaUrl } },
+ // })
+ // input.setValue(newSocialMediaUrl)
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // })
- it('sends the new url to the backend', () => {
- const expected = expect.objectContaining({
- variables: { url: newSocialMediaUrl },
- })
+ // it('sends the new url to the backend', () => {
+ // const expected = expect.objectContaining({
+ // variables: { url: newSocialMediaUrl },
+ // })
- expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
- })
+ // expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
+ // })
- it('displays a success message', async () => {
- await flushPromises()
- expect(mocks.$toast.success).toHaveBeenCalledTimes(1)
- })
+ // it('displays a success message', async () => {
+ // await flushPromises()
+ // expect(mocks.$toast.success).toHaveBeenCalledTimes(1)
+ // })
- it('clears the form', async () => {
- await flushPromises()
- expect(input.value).toBe(undefined)
- expect(submitButton.vm.$attrs.disabled).toBe(true)
- })
- })
- })
+ // it('clears the form', async () => {
+ // await flushPromises()
+ // expect(input.value).toBe(undefined)
+ // expect(submitButton.vm.$attrs.disabled).toBe(true)
+ // })
+ // })
+ // })
describe('given existing social media links', () => {
beforeEach(() => {
@@ -105,7 +105,7 @@ describe('my-social-media.vue', () => {
}
wrapper = Wrapper()
- form = wrapper.find('form')
+ // form = wrapper.find('form')
})
describe('for each link it', () => {
@@ -117,75 +117,75 @@ describe('my-social-media.vue', () => {
expect(wrapper.find(`a[href="${socialMediaUrl}"]`).exists()).toBe(true)
})
- it('displays the edit button', () => {
- expect(wrapper.find('.base-button[data-test="edit-button"]').exists()).toBe(true)
- })
+ // it('displays the edit button', () => {
+ // expect(wrapper.find('.base-button[data-test="edit-button"]').exists()).toBe(true)
+ // })
- it('displays the delete button', () => {
- expect(wrapper.find('.base-button[data-test="delete-button"]').exists()).toBe(true)
- })
+ // it('displays the delete button', () => {
+ // expect(wrapper.find('.base-button[data-test="delete-button"]').exists()).toBe(true)
+ // })
})
- it('does not accept a duplicate url', async () => {
- wrapper.find('input#addSocialMedia').setValue(socialMediaUrl)
- form.trigger('submit')
- await Vue.nextTick()
- expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
- })
+ // it('does not accept a duplicate url', async () => {
+ // wrapper.find('input#addSocialMedia').setValue(socialMediaUrl)
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
+ // })
- describe('editing social media link', () => {
- beforeEach(async () => {
- const editButton = wrapper.find('.base-button[data-test="edit-button"]')
- editButton.trigger('click')
- await Vue.nextTick()
- input = wrapper.find('input#editSocialMedia')
- })
+ // describe('editing social media link', () => {
+ // beforeEach(async () => {
+ // const editButton = wrapper.find('.base-button[data-test="edit-button"]')
+ // editButton.trigger('click')
+ // await Vue.nextTick()
+ // input = wrapper.find('input#editSocialMedia')
+ // })
- it('disables adding new links while editing', () => {
- const addInput = wrapper.find('input#addSocialMedia')
+ // it('disables adding new links while editing', () => {
+ // const addInput = wrapper.find('input#addSocialMedia')
- expect(addInput.exists()).toBe(false)
- })
+ // expect(addInput.exists()).toBe(false)
+ // })
- it('sends the new url to the backend', async () => {
- const expected = expect.objectContaining({
- variables: { id: 's1', url: newSocialMediaUrl },
- })
- input.setValue(newSocialMediaUrl)
- form.trigger('submit')
- await Vue.nextTick()
- expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
- })
+ // it('sends the new url to the backend', async () => {
+ // const expected = expect.objectContaining({
+ // variables: { id: 's1', url: newSocialMediaUrl },
+ // })
+ // input.setValue(newSocialMediaUrl)
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
+ // })
- it('allows the user to cancel editing', async () => {
- const cancelButton = wrapper.find('button#cancel')
- cancelButton.trigger('click')
- await Vue.nextTick()
- expect(wrapper.find('input#editSocialMedia').exists()).toBe(false)
- })
- })
+ // it('allows the user to cancel editing', async () => {
+ // const cancelButton = wrapper.find('button#cancel')
+ // cancelButton.trigger('click')
+ // await Vue.nextTick()
+ // expect(wrapper.find('input#editSocialMedia').exists()).toBe(false)
+ // })
+ // })
- describe('deleting social media link', () => {
- beforeEach(async () => {
- const deleteButton = wrapper.find('.base-button[data-test="delete-button"]')
- deleteButton.trigger('click')
- await Vue.nextTick()
- })
+ // describe('deleting social media link', () => {
+ // beforeEach(async () => {
+ // const deleteButton = wrapper.find('.base-button[data-test="delete-button"]')
+ // deleteButton.trigger('click')
+ // await Vue.nextTick()
+ // })
- it('sends the link id to the backend', () => {
- const expected = expect.objectContaining({
- variables: { id: 's1' },
- })
+ // it('sends the link id to the backend', () => {
+ // const expected = expect.objectContaining({
+ // variables: { id: 's1' },
+ // })
- expect(mocks.$apollo.mutate).toHaveBeenCalledTimes(1)
- expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
- })
+ // expect(mocks.$apollo.mutate).toHaveBeenCalledTimes(1)
+ // expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
+ // })
- it('displays a success message', async () => {
- await flushPromises()
- expect(mocks.$toast.success).toHaveBeenCalledTimes(1)
- })
- })
+ // it('displays a success message', async () => {
+ // await flushPromises()
+ // expect(mocks.$toast.success).toHaveBeenCalledTimes(1)
+ // })
+ // })
})
})
})
diff --git a/webapp/pages/settings/my-social-media.vue b/webapp/pages/settings/my-social-media.vue
index 5753fc405..57220ce17 100644
--- a/webapp/pages/settings/my-social-media.vue
+++ b/webapp/pages/settings/my-social-media.vue
@@ -1,236 +1,19 @@
-
-
- {{ $t('settings.social-media.name') }}
-
-
-
-
-
-
-
-
- {{ link.url }}
-
- |
-
-
-
-
-
-
-
-
-
-
-
- {{ editingLink.id ? $t('actions.save') : $t('settings.social-media.submit') }}
-
-
- {{ $t('actions.cancel') }}
-
-
-
-
-
+
+
+
+
+
-
-
From 433c5fd8836b2bf3719ab7f97a5dd68dccf5d51c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Wed, 3 Nov 2021 13:55:11 +0100
Subject: [PATCH 44/99] Implement MySomethingList for social media, use
edit-item slot
- Pass formData and formSchema by properties.
---
.../MySomethingList/MySomethingList.spec.js | 30 ++--
.../MySomethingList/MySomethingList.vue | 35 ++--
webapp/pages/settings/my-social-media.spec.js | 167 +++++++++---------
webapp/pages/settings/my-social-media.vue | 23 ++-
4 files changed, 145 insertions(+), 110 deletions(-)
diff --git a/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js b/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
index 7be290b3e..ea19bce8c 100644
--- a/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
+++ b/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
@@ -49,12 +49,12 @@ describe('MySomethingList.vue', () => {
submitButton = wrapper.find('button')
})
- it('requires the link to be a valid url', async () => {
- input.setValue('some value')
- form.trigger('submit')
- await Vue.nextTick()
- expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
- })
+ // Wolle it('requires the link to be a valid url', async () => {
+ // input.setValue('some value')
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
+ // })
it('displays an error message when not saved successfully', async () => {
mocks.$apollo.mutate.mockRejectedValue({ message: 'Ouch!' })
@@ -143,15 +143,15 @@ describe('MySomethingList.vue', () => {
expect(addInput.exists()).toBe(false)
})
- it('sends the new url to the backend', async () => {
- const expected = expect.objectContaining({
- variables: { id: 's1', url: newSocialMediaUrl },
- })
- input.setValue(newSocialMediaUrl)
- form.trigger('submit')
- await Vue.nextTick()
- expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
- })
+ // Wolle remove? or test here abstract? it('sends the new url to the backend', async () => {
+ // const expected = expect.objectContaining({
+ // variables: { id: 's1', url: newSocialMediaUrl },
+ // })
+ // input.setValue(newSocialMediaUrl)
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
+ // })
it('allows the user to cancel editing', async () => {
const cancelButton = wrapper.find('button#cancel')
diff --git a/webapp/components/_new/features/MySomethingList/MySomethingList.vue b/webapp/components/_new/features/MySomethingList/MySomethingList.vue
index ef374066a..55c9f0808 100644
--- a/webapp/components/_new/features/MySomethingList/MySomethingList.vue
+++ b/webapp/components/_new/features/MySomethingList/MySomethingList.vue
@@ -16,12 +16,13 @@
-
+ /> -->
+
@@ -87,17 +88,29 @@ import { mapGetters, mapMutations } from 'vuex'
export default {
name: 'MySomethingList',
+ props: {
+ useFormData: {
+ type: Object,
+ default: () => ({}),
+ },
+ useFormSchema: {
+ type: Object,
+ default: () => ({}),
+ },
+ },
data() {
return {
- formData: {
- socialMediaUrl: '',
- },
- formSchema: {
- socialMediaUrl: {
- type: 'url',
- message: this.$t('common.validations.url'),
- },
- },
+ // Wolle formData: {
+ // socialMediaUrl: '',
+ // },
+ // formSchema: {
+ // socialMediaUrl: {
+ // type: 'url',
+ // message: this.$t('common.validations.url'),
+ // },
+ // },
+ formData: this.useFormData,
+ formSchema: this.useFormSchema,
disabled: true,
editingLink: {},
}
diff --git a/webapp/pages/settings/my-social-media.spec.js b/webapp/pages/settings/my-social-media.spec.js
index 13b507049..a9d7a15d0 100644
--- a/webapp/pages/settings/my-social-media.spec.js
+++ b/webapp/pages/settings/my-social-media.spec.js
@@ -11,19 +11,19 @@ describe('my-social-media.vue', () => {
let mocks
let getters
const socialMediaUrl = 'https://freeradical.zone/@mattwr18'
- // const newSocialMediaUrl = 'https://twitter.com/mattwr18'
+ const newSocialMediaUrl = 'https://twitter.com/mattwr18'
const faviconUrl = 'https://freeradical.zone/favicon.ico'
beforeEach(() => {
mocks = {
$t: jest.fn(),
- // $apollo: {
- // mutate: jest.fn(),
- // },
- // $toast: {
- // error: jest.fn(),
- // success: jest.fn(),
- // },
+ $apollo: {
+ mutate: jest.fn(),
+ },
+ $toast: {
+ error: jest.fn(),
+ success: jest.fn(),
+ },
}
getters = {
'auth/user': () => {
@@ -34,6 +34,7 @@ describe('my-social-media.vue', () => {
describe('mount', () => {
// let form, input, submitButton
+ let form, input
const Wrapper = () => {
const store = new Vuex.Store({
getters,
@@ -41,60 +42,60 @@ describe('my-social-media.vue', () => {
return mount(MySocialMedia, { store, mocks, localVue })
}
- // describe('adding social media link', () => {
- // beforeEach(() => {
- // wrapper = Wrapper()
- // form = wrapper.find('form')
- // input = wrapper.find('input#addSocialMedia')
- // submitButton = wrapper.find('button')
- // })
+ describe('adding social media link', () => {
+ beforeEach(() => {
+ wrapper = Wrapper()
+ form = wrapper.find('form')
+ input = wrapper.find('input#addSocialMedia')
+ // submitButton = wrapper.find('button')
+ })
- // it('requires the link to be a valid url', async () => {
- // input.setValue('some value')
- // form.trigger('submit')
- // await Vue.nextTick()
- // expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
- // })
+ it('requires the link to be a valid url', async () => {
+ input.setValue('some value')
+ form.trigger('submit')
+ await Vue.nextTick()
+ expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
+ })
- // it('displays an error message when not saved successfully', async () => {
- // mocks.$apollo.mutate.mockRejectedValue({ message: 'Ouch!' })
- // input.setValue(newSocialMediaUrl)
- // form.trigger('submit')
- // await Vue.nextTick()
- // await flushPromises()
- // expect(mocks.$toast.error).toHaveBeenCalledTimes(1)
- // })
+ // it('displays an error message when not saved successfully', async () => {
+ // mocks.$apollo.mutate.mockRejectedValue({ message: 'Ouch!' })
+ // input.setValue(newSocialMediaUrl)
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // await flushPromises()
+ // expect(mocks.$toast.error).toHaveBeenCalledTimes(1)
+ // })
- // describe('success', () => {
- // beforeEach(async () => {
- // mocks.$apollo.mutate.mockResolvedValue({
- // data: { CreateSocialMedia: { id: 's2', url: newSocialMediaUrl } },
- // })
- // input.setValue(newSocialMediaUrl)
- // form.trigger('submit')
- // await Vue.nextTick()
- // })
+ // describe('success', () => {
+ // beforeEach(async () => {
+ // mocks.$apollo.mutate.mockResolvedValue({
+ // data: { CreateSocialMedia: { id: 's2', url: newSocialMediaUrl } },
+ // })
+ // input.setValue(newSocialMediaUrl)
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // })
- // it('sends the new url to the backend', () => {
- // const expected = expect.objectContaining({
- // variables: { url: newSocialMediaUrl },
- // })
+ // it('sends the new url to the backend', () => {
+ // const expected = expect.objectContaining({
+ // variables: { url: newSocialMediaUrl },
+ // })
- // expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
- // })
+ // expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
+ // })
- // it('displays a success message', async () => {
- // await flushPromises()
- // expect(mocks.$toast.success).toHaveBeenCalledTimes(1)
- // })
+ // it('displays a success message', async () => {
+ // await flushPromises()
+ // expect(mocks.$toast.success).toHaveBeenCalledTimes(1)
+ // })
- // it('clears the form', async () => {
- // await flushPromises()
- // expect(input.value).toBe(undefined)
- // expect(submitButton.vm.$attrs.disabled).toBe(true)
- // })
- // })
- // })
+ // it('clears the form', async () => {
+ // await flushPromises()
+ // expect(input.value).toBe(undefined)
+ // expect(submitButton.vm.$attrs.disabled).toBe(true)
+ // })
+ // })
+ })
describe('given existing social media links', () => {
beforeEach(() => {
@@ -105,7 +106,7 @@ describe('my-social-media.vue', () => {
}
wrapper = Wrapper()
- // form = wrapper.find('form')
+ form = wrapper.find('form')
})
describe('for each link it', () => {
@@ -133,37 +134,37 @@ describe('my-social-media.vue', () => {
// expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
// })
- // describe('editing social media link', () => {
- // beforeEach(async () => {
- // const editButton = wrapper.find('.base-button[data-test="edit-button"]')
- // editButton.trigger('click')
- // await Vue.nextTick()
- // input = wrapper.find('input#editSocialMedia')
- // })
+ describe('editing social media link', () => {
+ beforeEach(async () => {
+ const editButton = wrapper.find('.base-button[data-test="edit-button"]')
+ editButton.trigger('click')
+ await Vue.nextTick()
+ input = wrapper.find('input#editSocialMedia')
+ })
- // it('disables adding new links while editing', () => {
- // const addInput = wrapper.find('input#addSocialMedia')
+ // it('disables adding new links while editing', () => {
+ // const addInput = wrapper.find('input#addSocialMedia')
- // expect(addInput.exists()).toBe(false)
- // })
+ // expect(addInput.exists()).toBe(false)
+ // })
- // it('sends the new url to the backend', async () => {
- // const expected = expect.objectContaining({
- // variables: { id: 's1', url: newSocialMediaUrl },
- // })
- // input.setValue(newSocialMediaUrl)
- // form.trigger('submit')
- // await Vue.nextTick()
- // expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
- // })
+ it.only('sends the new url to the backend', async () => {
+ const expected = expect.objectContaining({
+ variables: { id: 's1', url: newSocialMediaUrl },
+ })
+ input.setValue(newSocialMediaUrl)
+ form.trigger('submit')
+ await Vue.nextTick()
+ expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
+ })
- // it('allows the user to cancel editing', async () => {
- // const cancelButton = wrapper.find('button#cancel')
- // cancelButton.trigger('click')
- // await Vue.nextTick()
- // expect(wrapper.find('input#editSocialMedia').exists()).toBe(false)
- // })
- // })
+ // it('allows the user to cancel editing', async () => {
+ // const cancelButton = wrapper.find('button#cancel')
+ // cancelButton.trigger('click')
+ // await Vue.nextTick()
+ // expect(wrapper.find('input#editSocialMedia').exists()).toBe(false)
+ // })
+ })
// describe('deleting social media link', () => {
// beforeEach(async () => {
diff --git a/webapp/pages/settings/my-social-media.vue b/webapp/pages/settings/my-social-media.vue
index 57220ce17..9c2bacfd8 100644
--- a/webapp/pages/settings/my-social-media.vue
+++ b/webapp/pages/settings/my-social-media.vue
@@ -1,8 +1,16 @@
-
+
+
+
+
@@ -15,5 +23,18 @@ export default {
MySomethingList,
SocialMediaListItem,
},
+ data() {
+ return {
+ useFormData: {
+ socialMediaUrl: '',
+ },
+ useFormSchema: {
+ socialMediaUrl: {
+ type: 'url',
+ message: this.$t('common.validations.url'),
+ },
+ },
+ }
+ },
}
From 58464fd53ef6aab52af1c2477c2615648ad889e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Thu, 4 Nov 2021 18:55:36 +0100
Subject: [PATCH 45/99] Remove input addSocialMedia
---
.../MySomethingList/MySomethingList.spec.js | 190 ++++++++++--------
.../MySomethingList/MySomethingList.vue | 137 ++++++++-----
webapp/pages/settings/my-social-media.spec.js | 113 ++++++-----
3 files changed, 248 insertions(+), 192 deletions(-)
diff --git a/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js b/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
index ea19bce8c..0cc99c467 100644
--- a/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
+++ b/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
@@ -8,12 +8,16 @@ const localVue = global.localVue
describe('MySomethingList.vue', () => {
let wrapper
+ let data
let mocks
let getters
const socialMediaUrl = 'https://freeradical.zone/@mattwr18'
- const newSocialMediaUrl = 'https://twitter.com/mattwr18'
+ // const newSocialMediaUrl = 'https://twitter.com/mattwr18'
beforeEach(() => {
+ data = () => {
+ return {}
+ }
mocks = {
$t: jest.fn(),
$apollo: {
@@ -32,69 +36,75 @@ describe('MySomethingList.vue', () => {
})
describe('mount', () => {
- let form, input, slots, submitButton
+ // Wolle let form, input, slots, submitButton
+ let slots
const Wrapper = () => {
const store = new Vuex.Store({
getters,
})
slots = { 'list-item': '' }
- return mount(MySomethingList, { store, mocks, localVue, slots })
+ return mount(MySomethingList, { data, store, mocks, localVue, slots })
}
- describe('adding social media link', () => {
- beforeEach(() => {
- wrapper = Wrapper()
- form = wrapper.find('form')
- input = wrapper.find('input#addSocialMedia')
- submitButton = wrapper.find('button')
- })
+ // describe('adding social media link', () => {
+ // beforeEach(async () => {
+ // wrapper = Wrapper()
+ // form = wrapper.find('form')
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // console.log(wrapper.html())
+ // console.log('wrapper.vm.socialMediaLinks: ', wrapper.vm.socialMediaLinks)
+ // input = wrapper.find('input#editSocialMedia')
+ // console.log('input: ', input)
+ // submitButton = wrapper.find('button')
+ // })
- // Wolle it('requires the link to be a valid url', async () => {
- // input.setValue('some value')
- // form.trigger('submit')
- // await Vue.nextTick()
- // expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
- // })
+ // Wolle it('requires the link to be a valid url', async () => {
+ // input.setValue('some value')
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
+ // })
- it('displays an error message when not saved successfully', async () => {
- mocks.$apollo.mutate.mockRejectedValue({ message: 'Ouch!' })
- input.setValue(newSocialMediaUrl)
- form.trigger('submit')
- await Vue.nextTick()
- await flushPromises()
- expect(mocks.$toast.error).toHaveBeenCalledTimes(1)
- })
+ // Wolle it('displays an error message when not saved successfully', async () => {
+ // mocks.$apollo.mutate.mockRejectedValue({ message: 'Ouch!' })
+ // input.setValue(newSocialMediaUrl)
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // await flushPromises()
+ // expect(mocks.$toast.error).toHaveBeenCalledTimes(1)
+ // })
- describe('success', () => {
- beforeEach(async () => {
- mocks.$apollo.mutate.mockResolvedValue({
- data: { CreateSocialMedia: { id: 's2', url: newSocialMediaUrl } },
- })
- input.setValue(newSocialMediaUrl)
- form.trigger('submit')
- await Vue.nextTick()
- })
+ // describe('success', () => {
+ // beforeEach(async () => {
+ // mocks.$apollo.mutate.mockResolvedValue({
+ // data: { CreateSocialMedia: { id: 's2', url: newSocialMediaUrl } },
+ // })
+ // input.setValue(newSocialMediaUrl)
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // })
- it('sends the new url to the backend', () => {
- const expected = expect.objectContaining({
- variables: { url: newSocialMediaUrl },
- })
+ // it('sends the new url to the backend', () => {
+ // const expected = expect.objectContaining({
+ // variables: { url: newSocialMediaUrl },
+ // })
- expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
- })
+ // expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
+ // })
- it('displays a success message', async () => {
- await flushPromises()
- expect(mocks.$toast.success).toHaveBeenCalledTimes(1)
- })
+ // it('displays a success message', async () => {
+ // await flushPromises()
+ // expect(mocks.$toast.success).toHaveBeenCalledTimes(1)
+ // })
- it('clears the form', async () => {
- await flushPromises()
- expect(input.value).toBe(undefined)
- expect(submitButton.vm.$attrs.disabled).toBe(true)
- })
- })
- })
+ // it('clears the form', async () => {
+ // await flushPromises()
+ // expect(input.value).toBe(undefined)
+ // expect(submitButton.vm.$attrs.disabled).toBe(true)
+ // })
+ // })
+ // })
describe('given existing social media links', () => {
beforeEach(() => {
@@ -103,9 +113,14 @@ describe('MySomethingList.vue', () => {
socialMedia: [{ id: 's1', url: socialMediaUrl }],
}),
}
-
+ // Wolle propsData = { editingLink: { id: 's1', url: socialMediaUrl } }
+ // data = () => {
+ // return {
+ // editingLink: { id: 's2', url: socialMediaUrl },
+ // }
+ // }
wrapper = Wrapper()
- form = wrapper.find('form')
+ // form = wrapper.find('form')
})
describe('for each item it', () => {
@@ -122,44 +137,47 @@ describe('MySomethingList.vue', () => {
})
})
- it('does not accept a duplicate url', async () => {
- wrapper.find('input#addSocialMedia').setValue(socialMediaUrl)
- form.trigger('submit')
- await Vue.nextTick()
- expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
- })
+ // Wolle it('does not accept a duplicate url', async () => {
+ // // wrapper.find('input#addSocialMedia').setValue(socialMediaUrl)
+ // wrapper.find('input#editSocialMedia').setValue(socialMediaUrl)
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
+ // })
- describe('editing social media link', () => {
- beforeEach(async () => {
- const editButton = wrapper.find('.base-button[data-test="edit-button"]')
- editButton.trigger('click')
- await Vue.nextTick()
- input = wrapper.find('input#editSocialMedia')
- })
+ // describe('editing social media link', () => {
+ // beforeEach(async () => {
+ // const editButton = wrapper.find('.base-button[data-test="edit-button"]')
+ // editButton.trigger('click')
+ // await Vue.nextTick()
+ // input = wrapper.find('input#editSocialMedia')
+ // })
- it('disables adding new links while editing', () => {
- const addInput = wrapper.find('input#addSocialMedia')
+ // it('disables adding new links while editing', () => {
+ // const addInput = wrapper.find('input#addSocialMedia')
+ // wrapper.find('.base-button[data-test="add-save-button"]').text().
+ // expect(addInput.exists()).toBe(false)
+ // const submitButton = wrapper.find('.base-button[data-test="add-save-button"]')
+ // expect(submitButton.text()).not.toContain('settings.social-media.submit')
+ // })
- expect(addInput.exists()).toBe(false)
- })
+ // Wolle remove? or test here abstract? it('sends the new url to the backend', async () => {
+ // const expected = expect.objectContaining({
+ // variables: { id: 's1', url: newSocialMediaUrl },
+ // })
+ // input.setValue(newSocialMediaUrl)
+ // form.trigger('submit')
+ // await Vue.nextTick()
+ // expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
+ // })
- // Wolle remove? or test here abstract? it('sends the new url to the backend', async () => {
- // const expected = expect.objectContaining({
- // variables: { id: 's1', url: newSocialMediaUrl },
- // })
- // input.setValue(newSocialMediaUrl)
- // form.trigger('submit')
- // await Vue.nextTick()
- // expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
- // })
-
- it('allows the user to cancel editing', async () => {
- const cancelButton = wrapper.find('button#cancel')
- cancelButton.trigger('click')
- await Vue.nextTick()
- expect(wrapper.find('input#editSocialMedia').exists()).toBe(false)
- })
- })
+ // it('allows the user to cancel editing', async () => {
+ // const cancelButton = wrapper.find('button#cancel')
+ // cancelButton.trigger('click')
+ // await Vue.nextTick()
+ // expect(wrapper.find('input#editSocialMedia').exists()).toBe(false)
+ // })
+ // })
describe('deleting social media link', () => {
beforeEach(async () => {
diff --git a/webapp/components/_new/features/MySomethingList/MySomethingList.vue b/webapp/components/_new/features/MySomethingList/MySomethingList.vue
index 55c9f0808..944ac41f3 100644
--- a/webapp/components/_new/features/MySomethingList/MySomethingList.vue
+++ b/webapp/components/_new/features/MySomethingList/MySomethingList.vue
@@ -8,11 +8,15 @@
@input-valid="handleInputValid"
@submit="handleSubmitSocialMedia"
>
-
+
- {{ /* $t('settings.social-media.name') */ 'Edit "' + editingLink.url + '"' }}
+ {{
+ /* $t('settings.social-media.name') */ editingLink.id === ''
+ ? 'Add new one'
+ : 'Edit "' + editingLink.url + '"'
+ }}
@@ -61,18 +65,23 @@
-
+ /> -->
-
- {{ editingLink.id ? $t('actions.save') : $t('settings.social-media.submit') }}
+
+ {{ isEditing ? $t('actions.save') : $t('settings.social-media.submit') }}
-
+
{{ $t('actions.cancel') }}
@@ -112,13 +121,19 @@ export default {
formData: this.useFormData,
formSchema: this.useFormSchema,
disabled: true,
- editingLink: {},
+ editingLink: null,
}
},
computed: {
...mapGetters({
currentUser: 'auth/user',
}),
+ isEditing() {
+ return this.editingLink !== null
+ },
+ isCreation() {
+ return this.editingLink !== null && this.editingLink.id === ''
+ },
socialMediaLinks() {
const domainRegex = /^(?:https?:\/\/)?(?:[^@\n])?(?:www\.)?([^:/\n?]+)/g
const { socialMedia = [] } = this.currentUser
@@ -134,7 +149,7 @@ export default {
setCurrentUser: 'auth/SET_USER',
}),
handleCancel() {
- this.editingLink = {}
+ this.editingLink = null
this.formData.socialMediaUrl = ''
this.disabled = true
},
@@ -183,57 +198,69 @@ export default {
}
},
async handleSubmitSocialMedia() {
- const isEditing = !!this.editingLink.id
- const url = this.formData.socialMediaUrl
+ // Wolle const isEditing = (this.editingLink !== null)
+ if (!this.isEditing) {
+ // Wolle this.editingLink = { id: '', url: '' }
+ this.handleEditSocialMedia({ id: '', url: '' })
+ } else {
+ // Wolle const url = this.formData.socialMediaUrl
+ this.editingLink.url = this.formData.socialMediaUrl
- const duplicateUrl = this.socialMediaLinks.find((link) => link.url === url)
- if (duplicateUrl && duplicateUrl.id !== this.editingLink.id) {
- return this.$toast.error(this.$t('settings.social-media.requireUnique'))
- }
-
- let mutation = gql`
- mutation($url: String!) {
- CreateSocialMedia(url: $url) {
- id
- url
- }
+ const duplicateUrl = this.socialMediaLinks.find((link) => link.url === this.editingLink.url)
+ // Wolle console.log('duplicateUrl: ', duplicateUrl)
+ // console.log('this.isEditing: ', this.isEditing)
+ // console.log('this.editingLink: ', this.editingLink)
+ if (duplicateUrl && this.isEditing && duplicateUrl.id !== this.editingLink.id) {
+ return this.$toast.error(this.$t('settings.social-media.requireUnique'))
}
- `
- const variables = { url }
- let successMessage = this.$t('settings.social-media.successAdd')
- if (isEditing) {
- mutation = gql`
- mutation($id: ID!, $url: String!) {
- UpdateSocialMedia(id: $id, url: $url) {
- id
- url
+ let mutation, variables, successMessage
+ if (this.isCreation) {
+ mutation = gql`
+ mutation($url: String!) {
+ CreateSocialMedia(url: $url) {
+ id
+ url
+ }
}
- }
- `
- variables.id = this.editingLink.id
- successMessage = this.$t('settings.data.success')
- }
+ `
+ variables = { url: this.editingLink.url }
+ successMessage = this.$t('settings.social-media.successAdd')
+ } else {
+ mutation = gql`
+ mutation($id: ID!, $url: String!) {
+ UpdateSocialMedia(id: $id, url: $url) {
+ id
+ url
+ }
+ }
+ `
+ variables = { id: this.editingLink.id, url: this.editingLink.url }
+ successMessage = this.$t('settings.data.success')
+ }
- try {
- await this.$apollo.mutate({
- mutation,
- variables,
- update: (store, { data }) => {
- const newSocialMedia = isEditing ? data.UpdateSocialMedia : data.CreateSocialMedia
- this.setCurrentUser({
- ...this.currentUser,
- socialMedia: unionBy([newSocialMedia], this.currentUser.socialMedia, 'id'),
- })
- },
- })
+ try {
+ await this.$apollo.mutate({
+ mutation,
+ variables,
+ update: (_store, { data }) => {
+ const newSocialMedia = !this.isCreation
+ ? data.UpdateSocialMedia
+ : data.CreateSocialMedia
+ this.setCurrentUser({
+ ...this.currentUser,
+ socialMedia: unionBy([newSocialMedia], this.currentUser.socialMedia, 'id'),
+ })
+ },
+ })
- this.$toast.success(successMessage)
- this.formData.socialMediaUrl = ''
- this.disabled = true
- this.editingLink = {}
- } catch (err) {
- this.$toast.error(err.message)
+ this.$toast.success(successMessage)
+ this.formData.socialMediaUrl = ''
+ this.disabled = true
+ this.editingLink = null
+ } catch (err) {
+ this.$toast.error(err.message)
+ }
}
},
},
diff --git a/webapp/pages/settings/my-social-media.spec.js b/webapp/pages/settings/my-social-media.spec.js
index a9d7a15d0..2da42b1d3 100644
--- a/webapp/pages/settings/my-social-media.spec.js
+++ b/webapp/pages/settings/my-social-media.spec.js
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'
-// import flushPromises from 'flush-promises'
+import flushPromises from 'flush-promises'
import MySocialMedia from './my-social-media.vue'
import Vuex from 'vuex'
import Vue from 'vue'
@@ -33,7 +33,7 @@ describe('my-social-media.vue', () => {
})
describe('mount', () => {
- // let form, input, submitButton
+ // Wolle let form, input, submitButton
let form, input
const Wrapper = () => {
const store = new Vuex.Store({
@@ -43,11 +43,13 @@ describe('my-social-media.vue', () => {
}
describe('adding social media link', () => {
- beforeEach(() => {
+ beforeEach(async () => {
wrapper = Wrapper()
form = wrapper.find('form')
- input = wrapper.find('input#addSocialMedia')
- // submitButton = wrapper.find('button')
+ form.trigger('submit')
+ await Vue.nextTick()
+ input = wrapper.find('input#editSocialMedia')
+ // Wolle submitButton = wrapper.find('button')
})
it('requires the link to be a valid url', async () => {
@@ -57,44 +59,50 @@ describe('my-social-media.vue', () => {
expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
})
- // it('displays an error message when not saved successfully', async () => {
- // mocks.$apollo.mutate.mockRejectedValue({ message: 'Ouch!' })
- // input.setValue(newSocialMediaUrl)
- // form.trigger('submit')
- // await Vue.nextTick()
- // await flushPromises()
- // expect(mocks.$toast.error).toHaveBeenCalledTimes(1)
- // })
+ it('displays an error message when not saved successfully', async () => {
+ mocks.$apollo.mutate.mockRejectedValue({ message: 'Ouch!' })
+ input.setValue(newSocialMediaUrl)
+ form.trigger('submit')
+ await Vue.nextTick()
+ await flushPromises()
+ expect(mocks.$toast.error).toHaveBeenCalledTimes(1)
+ })
- // describe('success', () => {
- // beforeEach(async () => {
- // mocks.$apollo.mutate.mockResolvedValue({
- // data: { CreateSocialMedia: { id: 's2', url: newSocialMediaUrl } },
- // })
- // input.setValue(newSocialMediaUrl)
- // form.trigger('submit')
- // await Vue.nextTick()
- // })
+ describe('success', () => {
+ beforeEach(async () => {
+ mocks.$apollo.mutate.mockResolvedValue({
+ data: { CreateSocialMedia: { id: 's2', url: newSocialMediaUrl } },
+ })
+ input.setValue(newSocialMediaUrl)
+ form.trigger('submit')
+ await Vue.nextTick()
+ })
- // it('sends the new url to the backend', () => {
- // const expected = expect.objectContaining({
- // variables: { url: newSocialMediaUrl },
- // })
+ it('sends the new url to the backend', () => {
+ const expected = expect.objectContaining({
+ variables: { url: newSocialMediaUrl },
+ })
+ expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
+ })
- // expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
- // })
+ it('displays a success message', async () => {
+ await flushPromises()
+ expect(mocks.$toast.success).toHaveBeenCalledTimes(1)
+ })
- // it('displays a success message', async () => {
- // await flushPromises()
- // expect(mocks.$toast.success).toHaveBeenCalledTimes(1)
- // })
-
- // it('clears the form', async () => {
- // await flushPromises()
- // expect(input.value).toBe(undefined)
- // expect(submitButton.vm.$attrs.disabled).toBe(true)
- // })
- // })
+ // Wolle it('clears the form', async () => {
+ // await flushPromises()
+ // expect(input.value).toBe(undefined)
+ // expect(submitButton.vm.$attrs.disabled).toBe(true)
+ // })
+ it('switches back to list', async () => {
+ await flushPromises()
+ // Wolle expect(input.value).toBe(undefined)
+ // expect(submitButton.vm.$attrs.disabled).toBe(true)
+ const submitButton = wrapper.find('.base-button[data-test="add-save-button"]')
+ expect(submitButton.text()).not.toContain('settings.social-media.submit')
+ })
+ })
})
describe('given existing social media links', () => {
@@ -127,12 +135,14 @@ describe('my-social-media.vue', () => {
// })
})
- // it('does not accept a duplicate url', async () => {
- // wrapper.find('input#addSocialMedia').setValue(socialMediaUrl)
- // form.trigger('submit')
- // await Vue.nextTick()
- // expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
- // })
+ it('does not accept a duplicate url', async () => {
+ form.trigger('submit')
+ await Vue.nextTick()
+ wrapper.find('input#editSocialMedia').setValue(socialMediaUrl)
+ form.trigger('submit')
+ await Vue.nextTick()
+ expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
+ })
describe('editing social media link', () => {
beforeEach(async () => {
@@ -142,13 +152,14 @@ describe('my-social-media.vue', () => {
input = wrapper.find('input#editSocialMedia')
})
- // it('disables adding new links while editing', () => {
- // const addInput = wrapper.find('input#addSocialMedia')
+ it('disables adding new links while editing', () => {
+ // Wolle const addInput = wrapper.find('input#addSocialMedia')
+ // expect(addInput.exists()).toBe(false)
+ const submitButton = wrapper.find('.base-button[data-test="add-save-button"]')
+ expect(submitButton.text()).not.toContain('settings.social-media.submit')
+ })
- // expect(addInput.exists()).toBe(false)
- // })
-
- it.only('sends the new url to the backend', async () => {
+ it('sends the new url to the backend', async () => {
const expected = expect.objectContaining({
variables: { id: 's1', url: newSocialMediaUrl },
})
From e818ef284f0523d008ba7bb133adc9ebc2178432 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Fri, 5 Nov 2021 10:25:15 +0100
Subject: [PATCH 46/99] Refine main README.md
- Add test technologies.
- Add introduction video link.
---
README.md | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/README.md b/README.md
index 603ea8178..45006581c 100644
--- a/README.md
+++ b/README.md
@@ -20,6 +20,11 @@ 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
+
+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
There are three important directories:
@@ -192,6 +197,14 @@ The only deployment method in this repository for development purposes as descri
* [NodeJS](https://nodejs.org/en/)
* [Neo4J](https://neo4j.com/)
+### For Testing
+
+* [Cypress](https://docs.cypress.io/)
+* [Storybook](https://storybook.js.org/)
+* [Jest](https://jestjs.io/)
+* [Vue Test Utils](https://vue-test-utils.vuejs.org/)
+* [ESLint](https://eslint.org/)
+
## 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/).
From 280f0f5a786b8efca6fccf3a83a37d313fbf371b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Mon, 8 Nov 2021 13:59:26 +0100
Subject: [PATCH 47/99] Implement edit callback, fist step
---
.../MySomethingList/MySomethingList.vue | 8 +++++++-
webapp/pages/settings/my-social-media.vue | 19 ++++++++++++++++++-
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/webapp/components/_new/features/MySomethingList/MySomethingList.vue b/webapp/components/_new/features/MySomethingList/MySomethingList.vue
index 944ac41f3..1017d3bd1 100644
--- a/webapp/components/_new/features/MySomethingList/MySomethingList.vue
+++ b/webapp/components/_new/features/MySomethingList/MySomethingList.vue
@@ -106,6 +106,10 @@ export default {
type: Object,
default: () => ({}),
},
+ callbackEdit: {
+ type: Function,
+ default: () => {},
+ },
},
data() {
return {
@@ -155,7 +159,9 @@ export default {
},
handleEditSocialMedia(link) {
this.editingLink = link
- this.formData.socialMediaUrl = link.url
+ // Wolle this.formData.socialMediaUrl = link.url
+ // Wolle this.$refs.socialMediaUrl.$el.focus()
+ this.callbackEdit(this, link)
},
handleInput(data) {
this.disabled = true
diff --git a/webapp/pages/settings/my-social-media.vue b/webapp/pages/settings/my-social-media.vue
index 9c2bacfd8..510bba55f 100644
--- a/webapp/pages/settings/my-social-media.vue
+++ b/webapp/pages/settings/my-social-media.vue
@@ -1,5 +1,9 @@
-
+
@@ -36,5 +40,18 @@ export default {
},
}
},
+ methods: {
+ callbackEditSocialMedia(thisMySomethingList, link) {
+ // Wolle this.editingLink = link
+ thisMySomethingList.formData.socialMediaUrl = link.url
+ // thisMySomethingList.$refs.socialMediaUrl.$el.focus()
+ // !!! Check for existenz
+ // this.$scopedSlots.default()[0].context.$refs
+ // thisMySomethingList.$scopedSlots['edit-item']()[0].$el.focus()
+ // console.log(thisMySomethingList.$scopedSlots['edit-item']()[0].context.$refs)
+ // console.log(thisMySomethingList.$scopedSlots['edit-item']()[0].context.$refs)
+ // console.log(thisMySomethingList.$refs)
+ },
+ },
}
From b7400339aba22d5fb5506dc3b25f082d7f09edfc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Thu, 11 Nov 2021 11:53:56 +0100
Subject: [PATCH 48/99] Split social media page and list component
- Rename variables.
- Implement callbacks.
- Fix tests.
---
.../MySomethingList/MySomethingList.spec.js | 157 +++----
.../MySomethingList/MySomethingList.vue | 412 ++++++++++--------
.../SocialMedia/SocialMediaListItem.vue | 8 +-
webapp/pages/settings/my-social-media.spec.js | 52 +--
webapp/pages/settings/my-social-media.vue | 174 +++++++-
5 files changed, 473 insertions(+), 330 deletions(-)
diff --git a/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js b/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
index 0cc99c467..86a5af52e 100644
--- a/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
+++ b/webapp/components/_new/features/MySomethingList/MySomethingList.spec.js
@@ -1,20 +1,26 @@
import { mount } from '@vue/test-utils'
-import flushPromises from 'flush-promises'
+// Wolle import flushPromises from 'flush-promises'
import MySomethingList from './MySomethingList.vue'
-import Vuex from 'vuex'
+// Wolle import Vuex from 'vuex'
import Vue from 'vue'
const localVue = global.localVue
describe('MySomethingList.vue', () => {
let wrapper
+ let propsData
let data
let mocks
- let getters
- const socialMediaUrl = 'https://freeradical.zone/@mattwr18'
+ // let getters
+ // Wolle const socialMediaUrl = 'https://freeradical.zone/@mattwr18'
// const newSocialMediaUrl = 'https://twitter.com/mattwr18'
beforeEach(() => {
+ propsData = {
+ useItems: [{ id: 'id', dummy: 'dummy' }],
+ namePropertyKey: 'dummy',
+ callbacks: { edit: jest.fn(), submit: jest.fn(), delete: jest.fn() },
+ }
data = () => {
return {}
}
@@ -28,22 +34,32 @@ describe('MySomethingList.vue', () => {
success: jest.fn(),
},
}
- getters = {
- 'auth/user': () => {
- return {}
- },
- }
+ // getters = {
+ // 'auth/user': () => {
+ // return {}
+ // },
+ // }
})
describe('mount', () => {
// Wolle let form, input, slots, submitButton
- let slots
+ let form, slots
const Wrapper = () => {
- const store = new Vuex.Store({
- getters,
+ // const store = new Vuex.Store({
+ // getters,
+ // })
+ slots = {
+ 'list-item': '',
+ 'edit-item': '',
+ }
+ return mount(MySomethingList, {
+ propsData,
+ data,
+ // store,
+ mocks,
+ localVue,
+ slots,
})
- slots = { 'list-item': '' }
- return mount(MySomethingList, { data, store, mocks, localVue, slots })
}
// describe('adding social media link', () => {
@@ -108,11 +124,11 @@ describe('MySomethingList.vue', () => {
describe('given existing social media links', () => {
beforeEach(() => {
- getters = {
- 'auth/user': () => ({
- socialMedia: [{ id: 's1', url: socialMediaUrl }],
- }),
- }
+ // getters = {
+ // 'auth/user': () => ({
+ // socialMedia: [{ id: 's1', url: socialMediaUrl }],
+ // }),
+ // }
// Wolle propsData = { editingLink: { id: 's1', url: socialMediaUrl } }
// data = () => {
// return {
@@ -137,67 +153,56 @@ describe('MySomethingList.vue', () => {
})
})
- // Wolle it('does not accept a duplicate url', async () => {
- // // wrapper.find('input#addSocialMedia').setValue(socialMediaUrl)
- // wrapper.find('input#editSocialMedia').setValue(socialMediaUrl)
- // form.trigger('submit')
- // await Vue.nextTick()
- // expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
- // })
-
- // describe('editing social media link', () => {
- // beforeEach(async () => {
- // const editButton = wrapper.find('.base-button[data-test="edit-button"]')
- // editButton.trigger('click')
- // await Vue.nextTick()
- // input = wrapper.find('input#editSocialMedia')
- // })
-
- // it('disables adding new links while editing', () => {
- // const addInput = wrapper.find('input#addSocialMedia')
- // wrapper.find('.base-button[data-test="add-save-button"]').text().
- // expect(addInput.exists()).toBe(false)
- // const submitButton = wrapper.find('.base-button[data-test="add-save-button"]')
- // expect(submitButton.text()).not.toContain('settings.social-media.submit')
- // })
-
- // Wolle remove? or test here abstract? it('sends the new url to the backend', async () => {
- // const expected = expect.objectContaining({
- // variables: { id: 's1', url: newSocialMediaUrl },
- // })
- // input.setValue(newSocialMediaUrl)
- // form.trigger('submit')
- // await Vue.nextTick()
- // expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
- // })
-
- // it('allows the user to cancel editing', async () => {
- // const cancelButton = wrapper.find('button#cancel')
- // cancelButton.trigger('click')
- // await Vue.nextTick()
- // expect(wrapper.find('input#editSocialMedia').exists()).toBe(false)
- // })
- // })
-
- describe('deleting social media link', () => {
+ describe('editing item', () => {
beforeEach(async () => {
+ const editButton = wrapper.find('.base-button[data-test="edit-button"]')
+ editButton.trigger('click')
+ await Vue.nextTick()
+ // Wolle input = wrapper.find('input#editSocialMedia')
+ })
+
+ it('disables adding items while editing', () => {
+ const submitButton = wrapper.find('.base-button[data-test="add-save-button"]')
+ expect(submitButton.text()).not.toContain('settings.social-media.submit')
+ })
+
+ it('allows the user to cancel editing', async () => {
+ expect(wrapper.find('.edit-item').exists()).toBeTruthy()
+ const cancelButton = wrapper.find('button#cancel')
+ cancelButton.trigger('click')
+ await Vue.nextTick()
+ expect(wrapper.find('.edit-item').exists()).not.toBeTruthy()
+ })
+ })
+
+ describe('calls callback functions', () => {
+ it('call edit', async () => {
+ const editButton = wrapper.find('.base-button[data-test="edit-button"]')
+ editButton.trigger('click')
+ await Vue.nextTick()
+ const expectedItem = expect.objectContaining({ id: 'id', dummy: 'dummy' })
+ expect(propsData.callbacks.edit).toHaveBeenCalledTimes(1)
+ expect(propsData.callbacks.edit).toHaveBeenCalledWith(expect.any(Object), expectedItem)
+ })
+
+ it('call edit', async () => {
+ form = wrapper.find('form')
+ form.trigger('submit')
+ await Vue.nextTick()
+ form.trigger('submit')
+ await Vue.nextTick()
+ const expectedItem = expect.objectContaining({ id: '' })
+ expect(propsData.callbacks.edit).toHaveBeenCalledTimes(1)
+ expect(propsData.callbacks.edit).toHaveBeenCalledWith(expect.any(Object), expectedItem)
+ })
+
+ it('call delete', async () => {
const deleteButton = wrapper.find('.base-button[data-test="delete-button"]')
deleteButton.trigger('click')
await Vue.nextTick()
- })
-
- it('sends the link id to the backend', () => {
- const expected = expect.objectContaining({
- variables: { id: 's1' },
- })
-
- expect(mocks.$apollo.mutate).toHaveBeenCalledTimes(1)
- expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
- })
-
- it('displays a success message', async () => {
- await flushPromises()
- expect(mocks.$toast.success).toHaveBeenCalledTimes(1)
+ const expectedItem = expect.objectContaining({ id: 'id', dummy: 'dummy' })
+ expect(propsData.callbacks.delete).toHaveBeenCalledTimes(1)
+ expect(propsData.callbacks.delete).toHaveBeenCalledWith(expect.any(Object), expectedItem)
})
})
})
diff --git a/webapp/components/_new/features/MySomethingList/MySomethingList.vue b/webapp/components/_new/features/MySomethingList/MySomethingList.vue
index 1017d3bd1..4eb18064b 100644
--- a/webapp/components/_new/features/MySomethingList/MySomethingList.vue
+++ b/webapp/components/_new/features/MySomethingList/MySomethingList.vue
@@ -1,99 +1,96 @@
-
- {{ $t('settings.social-media.name') }}
-
-
-
-
-
- {{
- /* $t('settings.social-media.name') */ editingLink.id === ''
- ? 'Add new one'
- : 'Edit "' + editingLink.url + '"'
- }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ {{
+ /* $t('settings.social-media.name') */ isCreation
+ ? 'Add new'
+ : 'Edit "' + editingItem[namePropertyKey] + '"'
+ }}
+
+
+
-
-
- {{ isEditing ? $t('actions.save') : $t('settings.social-media.submit') }}
-
-
- {{ $t('actions.cancel') }}
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ isEditing ? $t('actions.save') : $t('settings.social-media.submit') }}
+
+
+ {{ $t('actions.cancel') }}
+
+
+
+