-
Notifications
You must be signed in to change notification settings - Fork 41
feat: 🍰 My Groups Page #5148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: 🍰 My Groups Page #5148
Changes from 30 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
cf31f3c
preparation for creating a new group
ogerly fd36da6
Merge branch 'make-categories-optional' into 5140-My-Groups-Page
ogerly f183166
add my-groups page and setting link
ogerly 25a64a0
prework for group form
ogerly fbf1ced
Merge branch '5059-groups/5131-implement-group-gql-model-and-crud' in…
ogerly dc2f5f2
Merge branch '5059-groups/5131-implement-group-gql-model-and-crud' in…
ogerly d50ae27
prework for group list
ogerly addfc39
add groupe site id und slug
ogerly 46d26a0
add graphql groups, add createGroup mutation
ogerly c2a769f
add CategoriesSelect in GroupForm.vue
ogerly 267534e
Merge branch '5059-groups/5131-implement-group-gql-model-and-crud' in…
ogerly 936ecf2
add mutation createGroup and query GroupList
ogerly bfe6605
list upgrade database datas
ogerly 9715243
Merge branch '5059-epic-groups' into 5140-My-Groups-Page
ogerly 5f7b1c9
new group mutation with correct data
ogerly 74b679c
Merge branch '5059-groups/5131-implement-update-group-resolver' into …
ogerly dbb8006
Merge branch '5059-groups/5131-implement-update-group-resolver' into …
ogerly 228a676
fix locales
ogerly 99d2ce9
update group data funktion
ogerly fe6ad2c
add better seed for group myRole
ogerly fb9cf75
fix updateGroup function
ogerly f6de01e
resolve conflicts
ogerly 571e8fb
resolve conflicts 2
ogerly e5a969b
group settings add sidemenu
ogerly a9a2097
Merge branch '5059-epic-groups' into 5140-My-Groups-Page
ogerly 46f9813
fix lint
ogerly 362aae3
add router in group settings
ogerly 109a5f5
fix lint
ogerly a32a2d0
Update webapp/locales/de.json
ogerly b312ce4
Update webapp/locales/de.json
ogerly ca80471
Update webapp/locales/en.json
ogerly 3d5f29c
change page structure for groupe settings
ogerly 07b3857
Update webapp/pages/group/edit/_id/index.vue
ogerly a5d5dd7
import GroupMembers component in group settings
ogerly ad02924
Update webapp/components/Group/GroupForm.vue
ogerly 62f5768
Update webapp/pages/group/edit/_id.vue
ogerly 7cb965e
Update webapp/pages/group/edit/_id.vue
ogerly a1da04e
change components add constants
ogerly 80940ae
fix lint
ogerly 26cf8f1
resolve conflicts
ogerly c155555
Fix locales
Tirokk 1796a04
Update webapp/components/Group/GroupForm.vue
Tirokk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# GraphQL Playground | ||
|
||
To use GraphQL Playground, we need to know some basics: | ||
|
||
## How To Login? | ||
|
||
First, we need to have a user from ocelot.social to log in as. | ||
The user can be created by seeding the Neo4j database from the backend or by multiple GraphQL mutations. | ||
|
||
### Seed The Neo4j Database | ||
|
||
In your browser you can reach the GraphQL Playground under `http://localhost:4000/`, if the database and the backend are running, see [backend](../../README.md). | ||
There you will also find instructions on how to seed the database. | ||
|
||
### Use GraphQL Mutations To Create A User | ||
|
||
TODO: Describe how to create a user using GraphQL mutations! | ||
|
||
### Login Via GraphQL | ||
|
||
You can register a user by sending the query: | ||
|
||
```gql | ||
mutation { | ||
login(email: "[email protected]", password: "1234") | ||
} | ||
``` | ||
|
||
Or use `"[email protected]"` or `"[email protected]"` for the roll you need. | ||
|
||
If all goes well, you will receive a QGL response like: | ||
|
||
```json | ||
{ | ||
"data": { | ||
"login": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InUzIiwibmFtZSI6Ikplbm55IFJvc3RvY2siLCJzbHVnIjoiamVubnktcm9zdG9jayIsImlhdCI6MTY2MjAyMzMwNSwiZXhwIjoxNzI1MTM4NTA1LCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjMwMDAiLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjQwMDAiLCJzdWIiOiJ1MyJ9.atBS-SOeS784HPeFl_5s8sRWehEAU1BkgcOZFD8d4bU" | ||
} | ||
} | ||
``` | ||
|
||
You can use this response to set an HTTP header when you click `HTTP HEADERS` in the footer. | ||
Just set it with the login token you received in response: | ||
|
||
```json | ||
{ | ||
"Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InUzIiwibmFtZSI6Ikplbm55IFJvc3RvY2siLCJzbHVnIjoiamVubnktcm9zdG9jayIsImlhdCI6MTY2MjAyMzMwNSwiZXhwIjoxNzI1MTM4NTA1LCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjMwMDAiLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjQwMDAiLCJzdWIiOiJ1MyJ9.atBS-SOeS784HPeFl_5s8sRWehEAU1BkgcOZFD8d4bU" | ||
} | ||
``` | ||
|
||
This token is used for all other queries and mutations you send to the backend. | ||
|
||
## Query And Mutate | ||
|
||
When you are logged in and open a new playground tab by clicking "+", you can create a new group by sending the following mutation: | ||
|
||
```gql | ||
mutation { | ||
CreateGroup( | ||
# id: "" | ||
name: "My Group" | ||
# slug: "" | ||
about: "We will save the world" | ||
description: "<p class=\"\"><em>English:</em></p><p class=\"\">This group is hidden.</p><h3>What is our group for?</h3><p>This group was created to allow investigative journalists to share and collaborate.</p><h3>How does it work?</h3><p>Here you can internally share posts and comments about them.</p><p><br></p><p><em>Deutsch:</em></p><p class=\"\">Diese Gruppe ist verborgen.</p><h3>Wofür ist unsere Gruppe?</h3><p class=\"\">Diese Gruppe wurde geschaffen, um investigativen Journalisten den Austausch und die Zusammenarbeit zu ermöglichen.</p><h3>Wie funktioniert das?</h3><p class=\"\">Hier könnt ihr euch intern über Beiträge und Kommentare zu ihnen austauschen.</p>" | ||
groupType: hidden | ||
actionRadius: interplanetary | ||
categoryIds: ["cat12"] | ||
) { | ||
id | ||
name | ||
slug | ||
createdAt | ||
updatedAt | ||
disabled | ||
deleted | ||
about | ||
description | ||
groupType | ||
actionRadius | ||
myRole | ||
} | ||
} | ||
``` | ||
|
||
You will receive the answer: | ||
|
||
```json | ||
{ | ||
"data": { | ||
"CreateGroup": { | ||
"id": "2e3bbadb-804b-4ebc-a673-2d7c7f05e827", | ||
"name": "My Group", | ||
"slug": "my-group", | ||
"createdAt": "2022-09-01T09:44:47.969Z", | ||
"updatedAt": "2022-09-01T09:44:47.969Z", | ||
"disabled": false, | ||
"deleted": false, | ||
"about": "We will save the world", | ||
"description": "<p class=\"\"><em>English:</em></p><p class=\"\">This group is hidden.</p><h3>What is our group for?</h3><p>This group was created to allow investigative journalists to share and collaborate.</p><h3>How does it work?</h3><p>Here you can internally share posts and comments about them.</p><p><br></p><p><em>Deutsch:</em></p><p class=\"\">Diese Gruppe ist verborgen.</p><h3>Wofür ist unsere Gruppe?</h3><p class=\"\">Diese Gruppe wurde geschaffen, um investigativen Journalisten den Austausch und die Zusammenarbeit zu ermöglichen.</p><h3>Wie funktioniert das?</h3><p class=\"\">Hier könnt ihr euch intern über Beiträge und Kommentare zu ihnen austauschen.</p>", | ||
"groupType": "hidden", | ||
"actionRadius": "interplanetary", | ||
"myRole": "owner" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
If you look into the Neo4j database with your browser and search the groups, you will now also find your new group. | ||
For more details about our Neo4j database read [here](../../../neo4j/README.md). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<template> | ||
<div> | ||
<ds-container class="group-card"> | ||
<ds-page-title heading="Groups"></ds-page-title> | ||
<ds-card v-for="item in items" :key="item.id" space="xx-small"> | ||
<nuxt-link to="/group/g1/testgruppe">{{ item.name }}</nuxt-link> | ||
{{ item.categories ? item.categories.map((category) => category.name) : [] }} | ||
<div>{{ item }}</div> | ||
<ds-space> | ||
<base-button | ||
v-if="item.myRole === 'owner'" | ||
icon="trash" | ||
@click="deleteGroup(item)" | ||
></base-button> | ||
<base-button | ||
v-if="item.myRole === 'pending'" | ||
icon="question-circle" | ||
@click="removePending(item)" | ||
></base-button> | ||
<base-button | ||
v-if="item.myRole === 'owner'" | ||
icon="edit" | ||
@click="editGroup(item)" | ||
></base-button> | ||
<base-button | ||
v-if="item.myRole === 'usual'" | ||
icon="close" | ||
@click="unfollowGroup(item)" | ||
></base-button> | ||
<base-button | ||
v-if="item.myRole === null" | ||
icon="plus" | ||
@click="addMemeberToGroup(item)" | ||
></base-button> | ||
</ds-space> | ||
</ds-card> | ||
</ds-container> | ||
</div> | ||
</template> | ||
<script lang="ts"> | ||
export default { | ||
name: 'GroupList', | ||
props: { | ||
items: { type: Array, default: () => [] }, | ||
}, | ||
methods: { | ||
removePending() { | ||
alert('removePending group') | ||
}, | ||
editGroup(item) { | ||
this.$router.push({ path: `/group/edit/${item.id}` }) | ||
}, | ||
deleteGroup() { | ||
alert('delete group') | ||
}, | ||
unfollowGroup() { | ||
alert('unfollow group') | ||
}, | ||
addMemeberToGroup() { | ||
alert('addMemeberToGroup group') | ||
}, | ||
}, | ||
} | ||
</script> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.