diff --git a/client/cypress/integration/frontend/portfolio/project-page.spec.js b/client/cypress/integration/frontend/portfolio/project-page.spec.js
index e3e469e3..fefaff9e 100644
--- a/client/cypress/integration/frontend/portfolio/project-page.spec.js
+++ b/client/cypress/integration/frontend/portfolio/project-page.spec.js
@@ -101,7 +101,6 @@ describe('Project Page', () => {
cy.getByDataCy('project-actions').click();
cy.getByDataCy('delete-project').should('exist');
cy.getByDataCy('edit-project').should('exist');
- cy.getByDataCy('share-project').should('exist');
});
describe('Project Entry', () => {
diff --git a/client/src/components/icons/ShareIcon.vue b/client/src/components/icons/ShareIcon.vue
new file mode 100644
index 00000000..0a04014f
--- /dev/null
+++ b/client/src/components/icons/ShareIcon.vue
@@ -0,0 +1,10 @@
+
+
+
diff --git a/client/src/components/portfolio/ProjectActions.vue b/client/src/components/portfolio/ProjectActions.vue
index a515cd2b..62a16ca2 100644
--- a/client/src/components/portfolio/ProjectActions.vue
+++ b/client/src/components/portfolio/ProjectActions.vue
@@ -23,14 +23,14 @@
Projekt teilen
+ @click="updateProjectShareState(id, true)">Projekt teilen
Projekt nicht mehr teilen
+ @click="updateProjectShareState(id, false)">Projekt nicht mehr teilen
@@ -42,12 +42,27 @@ import Ellipses from '@/components/icons/Ellipses.vue';
import WidgetPopover from '@/components/ui/WidgetPopover';
import DELETE_PROJECT_MUTATION from '@/graphql/gql/mutations/deleteProject.gql';
-import PROJECT_QUERY from '@/graphql/gql/queries/projectQuery.gql';
import PROJECTS_QUERY from '@/graphql/gql/queries/allProjects.gql';
-import UPDATE_PROJECT_SHARED_STATE_MUTATION from '@/graphql/gql/mutations/updateProjectSharedState.gql';
+
+import updateProjectShareState from '@/mixins/update-project-share-state';
export default {
- props: ['id', 'final'],
+ props: {
+ id: {
+ type: String,
+ default: '',
+ },
+ final: {
+ type: Boolean,
+ default: false,
+ },
+ shareButtons: {
+ type: Boolean,
+ default: true,
+ },
+ },
+
+ mixins: [updateProjectShareState],
components: {
Ellipses,
@@ -89,32 +104,6 @@ export default {
this.$router.push('/portfolio');
});
},
- updateShareState(id, state) {
- const project = this;
- this.$apollo.mutate({
- mutation: UPDATE_PROJECT_SHARED_STATE_MUTATION,
- variables: {
- input: {
- id: this.id,
- shared: state,
- },
- },
- update(store, {data: {updateProjectSharedState: {shared, errors}}}) {
- if (!errors) {
- const query = PROJECT_QUERY;
- const variables = {
- id: project.id,
- };
- const data = store.readQuery({query, variables});
-
- if (data) {
- data.project.final = shared;
- store.writeQuery({query, variables, data});
- }
- }
- },
- });
- },
},
};
diff --git a/client/src/components/portfolio/ShareLink.vue b/client/src/components/portfolio/ShareLink.vue
new file mode 100644
index 00000000..124f1c0b
--- /dev/null
+++ b/client/src/components/portfolio/ShareLink.vue
@@ -0,0 +1,43 @@
+
+
+
+
+ Mit Lehrperson teilen
+ Nicht mehr teilen
+
+
+
+
+
+
+
diff --git a/client/src/components/ui/WidgetPopover.vue b/client/src/components/ui/WidgetPopover.vue
index 340a5beb..93e3a1c0 100644
--- a/client/src/components/ui/WidgetPopover.vue
+++ b/client/src/components/ui/WidgetPopover.vue
@@ -11,7 +11,13 @@