@@ -57,12 +57,23 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<v-popover v-if="!saveRequest">
|
<v-popover v-if="!saveRequest">
|
||||||
<button class="tooltip-target icon" v-tooltip.left="$t('more')">
|
<button
|
||||||
|
v-if="
|
||||||
|
collectionsType.type == 'team-collections' &&
|
||||||
|
collectionsType.selectedTeam.myRole !== 'VIEWER'
|
||||||
|
"
|
||||||
|
class="tooltip-target icon"
|
||||||
|
v-tooltip.left="$t('more')"
|
||||||
|
>
|
||||||
<i class="material-icons">more_vert</i>
|
<i class="material-icons">more_vert</i>
|
||||||
</button>
|
</button>
|
||||||
<template slot="popover">
|
<template slot="popover">
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
|
v-if="
|
||||||
|
collectionsType.type == 'team-collections' &&
|
||||||
|
collectionsType.selectedTeam.myRole !== 'VIEWER'
|
||||||
|
"
|
||||||
class="icon"
|
class="icon"
|
||||||
@click="$emit('add-folder', { folder: collection, path: `${collectionIndex}` })"
|
@click="$emit('add-folder', { folder: collection, path: `${collectionIndex}` })"
|
||||||
v-close-popover
|
v-close-popover
|
||||||
@@ -75,7 +86,7 @@
|
|||||||
<button
|
<button
|
||||||
v-if="
|
v-if="
|
||||||
collectionsType.type == 'team-collections' &&
|
collectionsType.type == 'team-collections' &&
|
||||||
collectionsType.selectedTeam.myRole == 'VIEWER'
|
collectionsType.selectedTeam.myRole !== 'VIEWER'
|
||||||
"
|
"
|
||||||
class="icon"
|
class="icon"
|
||||||
@click="$emit('edit-collection')"
|
@click="$emit('edit-collection')"
|
||||||
@@ -96,7 +107,7 @@
|
|||||||
<button
|
<button
|
||||||
v-if="
|
v-if="
|
||||||
collectionsType.type == 'team-collections' &&
|
collectionsType.type == 'team-collections' &&
|
||||||
collectionsType.selectedTeam.myRole == 'VIEWER'
|
collectionsType.selectedTeam.myRole !== 'VIEWER'
|
||||||
"
|
"
|
||||||
class="icon"
|
class="icon"
|
||||||
@click="confirmRemove = true"
|
@click="confirmRemove = true"
|
||||||
@@ -382,7 +393,10 @@ export default {
|
|||||||
return this.$props.collectionsType.selectedTeam === undefined
|
return this.$props.collectionsType.selectedTeam === undefined
|
||||||
},
|
},
|
||||||
updateQuery(previousResult, { subscriptionData }) {
|
updateQuery(previousResult, { subscriptionData }) {
|
||||||
if (subscriptionData.data.teamCollectionAdded.parent.id === this.$props.collection.id) {
|
if (
|
||||||
|
subscriptionData.data.teamCollectionAdded.parent &&
|
||||||
|
subscriptionData.data.teamCollectionAdded.parent.id === this.$props.collection.id
|
||||||
|
) {
|
||||||
previousResult.collection.children.push({
|
previousResult.collection.children.push({
|
||||||
id: subscriptionData.data.teamCollectionAdded.id,
|
id: subscriptionData.data.teamCollectionAdded.id,
|
||||||
title: subscriptionData.data.teamCollectionAdded.title,
|
title: subscriptionData.data.teamCollectionAdded.title,
|
||||||
@@ -413,6 +427,7 @@ export default {
|
|||||||
},
|
},
|
||||||
updateQuery(previousResult, { subscriptionData }) {
|
updateQuery(previousResult, { subscriptionData }) {
|
||||||
if (
|
if (
|
||||||
|
subscriptionData.data.teamCollectionUpdated.parent &&
|
||||||
subscriptionData.data.teamCollectionUpdated.parent.id === this.$props.collection.id
|
subscriptionData.data.teamCollectionUpdated.parent.id === this.$props.collection.id
|
||||||
) {
|
) {
|
||||||
const index = previousResult.collection.children.findIndex(
|
const index = previousResult.collection.children.findIndex(
|
||||||
|
|||||||
@@ -48,6 +48,10 @@
|
|||||||
<template slot="popover">
|
<template slot="popover">
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
|
v-if="
|
||||||
|
collectionsType.type == 'team-collections' &&
|
||||||
|
collectionsType.selectedTeam.myRole !== 'VIEWER'
|
||||||
|
"
|
||||||
class="icon"
|
class="icon"
|
||||||
@click="$emit('add-folder', { folder, path: folderPath })"
|
@click="$emit('add-folder', { folder, path: folderPath })"
|
||||||
v-close-popover
|
v-close-popover
|
||||||
@@ -58,6 +62,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
|
v-if="
|
||||||
|
collectionsType.type == 'team-collections' &&
|
||||||
|
collectionsType.selectedTeam.myRole !== 'VIEWER'
|
||||||
|
"
|
||||||
class="icon"
|
class="icon"
|
||||||
@click="$emit('edit-folder', { folder, folderIndex, collectionIndex })"
|
@click="$emit('edit-folder', { folder, folderIndex, collectionIndex })"
|
||||||
v-close-popover
|
v-close-popover
|
||||||
|
|||||||
@@ -197,6 +197,88 @@ export default {
|
|||||||
`,
|
`,
|
||||||
pollInterval: 10000,
|
pollInterval: 10000,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
$subscribe: {
|
||||||
|
teamsCollectionAdded: {
|
||||||
|
query: gql`
|
||||||
|
subscription teamCollectionAdded($teamID: String!) {
|
||||||
|
teamCollectionAdded(teamID: $teamID) {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
parent {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
variables() {
|
||||||
|
return {
|
||||||
|
teamID: this.collectionsType.selectedTeam.id,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
skip() {
|
||||||
|
return this.collectionsType.selectedTeam == undefined
|
||||||
|
},
|
||||||
|
result({ data }) {
|
||||||
|
this.teamCollections[this.collectionsType.selectedTeam.id].push({
|
||||||
|
id: data.teamCollectionAdded.id,
|
||||||
|
title: data.teamCollectionAdded.title,
|
||||||
|
__typename: data.teamCollectionAdded.__typename,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
teamsCollectionUpdated: {
|
||||||
|
query: gql`
|
||||||
|
subscription teamCollectionUpdated($teamID: String!) {
|
||||||
|
teamCollectionUpdated(teamID: $teamID) {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
parent {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
variables() {
|
||||||
|
return {
|
||||||
|
teamID: this.collectionsType.selectedTeam.id,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
skip() {
|
||||||
|
return this.collectionsType.selectedTeam == undefined
|
||||||
|
},
|
||||||
|
result({ data }) {
|
||||||
|
const current = this.teamCollections[this.collectionsType.selectedTeam.id]
|
||||||
|
const index = current.findIndex((x) => x.id === data.teamCollectionUpdated.id)
|
||||||
|
if (index >= 0) {
|
||||||
|
current[index].title = data.teamCollectionUpdated.title
|
||||||
|
}
|
||||||
|
this.teamCollections[this.collectionsType.selectedTeam.id] = current
|
||||||
|
},
|
||||||
|
},
|
||||||
|
teamsCollectionRemoved: {
|
||||||
|
query: gql`
|
||||||
|
subscription teamCollectionRemoved($teamID: String!) {
|
||||||
|
teamCollectionRemoved(teamID: $teamID)
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
variables() {
|
||||||
|
return {
|
||||||
|
teamID: this.collectionsType.selectedTeam.id,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
skip() {
|
||||||
|
return this.collectionsType.selectedTeam == undefined
|
||||||
|
},
|
||||||
|
result({ data }) {
|
||||||
|
this.teamCollections[this.collectionsType.selectedTeam.id] = this.teamCollections[
|
||||||
|
this.collectionsType.selectedTeam.id
|
||||||
|
].filter((x) => x.id !== data.teamCollectionRemoved)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
"collectionsType.type": function emitstuff() {
|
"collectionsType.type": function emitstuff() {
|
||||||
|
|||||||
31670
package-lock.json
generated
31670
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user