mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
fix lint
This commit is contained in:
parent
41955c5f56
commit
f1957c5fe7
@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<nuxt-link to="/my-groups"><base-button icon="users" circle ghost /></nuxt-link>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<div>
|
||||
<nuxt-link to="/my-groups"><base-button icon="users" circle ghost /></nuxt-link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -32,21 +32,21 @@
|
||||
></ds-input>
|
||||
|
||||
<ds-space margin-top="large">
|
||||
<ds-select
|
||||
icon="card"
|
||||
v-model="formData.actionRadius"
|
||||
label="Radius"
|
||||
:options="['regional', 'national', 'continental', 'global']"
|
||||
placeholder="Radius ..."
|
||||
></ds-select>
|
||||
</ds-space>
|
||||
<ds-select
|
||||
icon="card"
|
||||
v-model="formData.actionRadius"
|
||||
label="Radius"
|
||||
:options="['regional', 'national', 'continental', 'global']"
|
||||
placeholder="Radius ..."
|
||||
></ds-select>
|
||||
</ds-space>
|
||||
<ds-space margin-top="large">
|
||||
<categories-select
|
||||
v-if="categoriesActive"
|
||||
model="categoryIds"
|
||||
:existingCategoryIds="formData.categoryIds"
|
||||
/>
|
||||
</ds-space>
|
||||
<categories-select
|
||||
v-if="categoriesActive"
|
||||
model="categoryIds"
|
||||
:existingCategoryIds="formData.categoryIds"
|
||||
/>
|
||||
</ds-space>
|
||||
<ds-space margin-top="large">
|
||||
<ds-button @click.prevent="reset()">Reset form</ds-button>
|
||||
<ds-button
|
||||
@ -150,49 +150,48 @@ export default {
|
||||
computed: {
|
||||
submitDisable() {
|
||||
if (
|
||||
this.formData.name !== ''
|
||||
&& this.formData.groupType !== ''
|
||||
&& this.formData.about !== ''
|
||||
&& this.formData.description !== ''
|
||||
&& this.formData.actionRadius !== ''
|
||||
&& this.formData.categoryIds.length > 0
|
||||
) {
|
||||
this.formData.name !== '' &&
|
||||
this.formData.groupType !== '' &&
|
||||
this.formData.about !== '' &&
|
||||
this.formData.description !== '' &&
|
||||
this.formData.actionRadius !== '' &&
|
||||
this.formData.categoryIds.length > 0
|
||||
) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
submitDisableEdit() {
|
||||
|
||||
if (
|
||||
this.formData.name !== this.group.name
|
||||
|| this.formData.groupType !== this.group.groupType
|
||||
|| this.formData.about !== this.group.about
|
||||
|| this.formData.description !== this.group.description
|
||||
|| this.formData.actionRadius !== this.group.actionRadius
|
||||
|| this.formData.categoryIds.length === 0
|
||||
|| !this.sameCategories
|
||||
) {
|
||||
this.formData.name !== this.group.name ||
|
||||
this.formData.groupType !== this.group.groupType ||
|
||||
this.formData.about !== this.group.about ||
|
||||
this.formData.description !== this.group.description ||
|
||||
this.formData.actionRadius !== this.group.actionRadius ||
|
||||
this.formData.categoryIds.length === 0 ||
|
||||
!this.sameCategories
|
||||
) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
sameCategories(){
|
||||
let formDataCategories = this.formData.categoryIds.map((categoryIds) => categoryIds)
|
||||
let groupDataCategories = this.group.categories.map((category) => category.id)
|
||||
sameCategories() {
|
||||
const formDataCategories = this.formData.categoryIds.map((categoryIds) => categoryIds)
|
||||
const groupDataCategories = this.group.categories.map((category) => category.id)
|
||||
let result
|
||||
let each = true
|
||||
|
||||
if (formDataCategories.length !== groupDataCategories.length) return false
|
||||
|
||||
if (JSON.stringify(formDataCategories) !== JSON.stringify(groupDataCategories)) {
|
||||
formDataCategories.forEach(element => {
|
||||
result = groupDataCategories.filter(groupCategorieId => groupCategorieId === element)
|
||||
formDataCategories.forEach((element) => {
|
||||
result = groupDataCategories.filter((groupCategorieId) => groupCategorieId === element)
|
||||
if (result.length === 0) each = false
|
||||
})
|
||||
return each
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -1,47 +1,54 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<ds-container class="group-card">
|
||||
<ds-space>
|
||||
<div @click="onlyOwnerGroups(true)" ref="myGruops" >show only my groups</div>
|
||||
<div @click="onlyOwnerGroups(false)" ref="allGruops" hidden>show all groups</div>
|
||||
</ds-space>
|
||||
<ds-flex v-for="item in items" :key="item.id" class="border-bottom"
|
||||
:ref="item.myRole === null ? 'null' : item.myRole">
|
||||
<ds-flex-item width="90%" centered>
|
||||
{{item.myRole}}
|
||||
<ds-space margin="large">
|
||||
<nuxt-link :to="`/group/${item.id}`">
|
||||
<ds-text size="x-large">{{ item.name }}</ds-text>
|
||||
</nuxt-link>
|
||||
|
||||
<ds-chip v-if="item.groupType === 'public'" color="primary">{{item.groupType}}</ds-chip>
|
||||
<ds-chip v-if="item.groupType === 'hidden'" color="warning">{{item.groupType}}</ds-chip>
|
||||
<ds-chip v-if="item.groupType === 'closed'" color="danger">{{item.groupType}}</ds-chip>
|
||||
<ds-chip v-if="item.myRole === 'owner'" color="inverse">{{item.myRole}}</ds-chip>
|
||||
<ds-chip v-if="item.myRole === 'usual' || item.myRole === 'pending'">{{item.myRole}}</ds-chip>
|
||||
|
||||
<div>
|
||||
<ds-space margin-top="small">
|
||||
{{ item.about }}
|
||||
</ds-space>
|
||||
</div>
|
||||
<ds-space margin-top="small">
|
||||
<ds-chip v-for="category in item.categories" :key="category.name">
|
||||
<ds-icon :name="category.icon"></ds-icon>
|
||||
{{category.name}}
|
||||
<div @click="onlyOwnerGroups(true)" ref="myGruops">show only my groups</div>
|
||||
<div @click="onlyOwnerGroups(false)" ref="allGruops" hidden>show all groups</div>
|
||||
</ds-space>
|
||||
<ds-flex
|
||||
v-for="item in items"
|
||||
:key="item.id"
|
||||
class="border-bottom"
|
||||
:ref="item.myRole === null ? 'null' : item.myRole"
|
||||
>
|
||||
<ds-flex-item width="90%" centered>
|
||||
{{ item.myRole }}
|
||||
<ds-space margin="large">
|
||||
<nuxt-link :to="`/group/${item.id}`">
|
||||
<ds-text size="x-large">{{ item.name }}</ds-text>
|
||||
</nuxt-link>
|
||||
|
||||
<ds-chip v-if="item.groupType === 'public'" color="primary">
|
||||
{{ item.groupType }}
|
||||
</ds-chip>
|
||||
<ds-chip v-if="item.groupType === 'hidden'" color="warning">
|
||||
{{ item.groupType }}
|
||||
</ds-chip>
|
||||
<ds-chip v-if="item.groupType === 'closed'" color="danger">
|
||||
{{ item.groupType }}
|
||||
</ds-chip>
|
||||
<ds-chip v-if="item.myRole === 'owner'" color="inverse">{{ item.myRole }}</ds-chip>
|
||||
<ds-chip v-if="item.myRole === 'usual' || item.myRole === 'pending'">
|
||||
{{ item.myRole }}
|
||||
</ds-chip>
|
||||
|
||||
<div>
|
||||
<ds-space margin-top="small">
|
||||
{{ item.about }}
|
||||
</ds-space>
|
||||
</div>
|
||||
<ds-space margin-top="small">
|
||||
<ds-chip v-for="category in item.categories" :key="category.name">
|
||||
<ds-icon :name="category.icon"></ds-icon>
|
||||
{{ category.name }}
|
||||
</ds-chip>
|
||||
</ds-space>
|
||||
</ds-space>
|
||||
</ds-space>
|
||||
</ds-flex-item>
|
||||
<ds-flex-item width="10%" centered>
|
||||
<group-menu
|
||||
resource-type="group"
|
||||
:resource="item"
|
||||
:isOwner="item.myRole"
|
||||
/>
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
</ds-flex-item>
|
||||
<ds-flex-item width="10%" centered>
|
||||
<group-menu resource-type="group" :resource="item" :isOwner="item.myRole" />
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
</ds-container>
|
||||
</div>
|
||||
</template>
|
||||
@ -72,33 +79,28 @@ export default {
|
||||
addMemeberToGroup() {
|
||||
alert('addMemeberToGroup group')
|
||||
},
|
||||
onlyOwnerGroups(bool){
|
||||
console.log('bool', bool)
|
||||
console.log('this.$refs.usual', this.$refs.usual)
|
||||
console.log('this.$refs.pending', this.$refs.pending)
|
||||
console.log('this.$refs.null', this.$refs.null)
|
||||
|
||||
this.$refs.myGruops.hidden = bool
|
||||
this.$refs.allGruops.hidden = !bool
|
||||
|
||||
onlyOwnerGroups(bool) {
|
||||
this.$refs.myGruops.hidden = bool
|
||||
this.$refs.allGruops.hidden = !bool
|
||||
|
||||
if (this.$refs.usual) {
|
||||
this.$refs.usual.forEach(element => {
|
||||
element.$el.hidden = bool})
|
||||
}
|
||||
this.$refs.usual.forEach((element) => {
|
||||
element.$el.hidden = bool
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if (this.$refs.null) {
|
||||
this.$refs.null.forEach(element => {
|
||||
element.$el.hidden = bool})
|
||||
}
|
||||
if (this.$refs.null) {
|
||||
this.$refs.null.forEach((element) => {
|
||||
element.$el.hidden = bool
|
||||
})
|
||||
}
|
||||
|
||||
if (this.$refs.pending) {
|
||||
this.$refs.pending.forEach(element => {
|
||||
element.$el.hidden = bool})
|
||||
}
|
||||
|
||||
}
|
||||
if (this.$refs.pending) {
|
||||
this.$refs.pending.forEach((element) => {
|
||||
element.$el.hidden = bool
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -2,33 +2,33 @@
|
||||
<div>
|
||||
<ds-space><h3>Members</h3></ds-space>
|
||||
<base-card>
|
||||
<ds-table :data="responseGroupMembersQuery" :fields="tableFields" condensed>
|
||||
<template slot="avatar">
|
||||
<ds-avatar online size="small" :name="responseGroupMembersQuery.name"></ds-avatar>
|
||||
</template>
|
||||
<template slot="myRoleInGroup" slot-scope="scope">
|
||||
<select
|
||||
v-if="scope.row.myRoleInGroup !== 'owner'"
|
||||
:options="['usual', 'admin']"
|
||||
:value="`${scope.row.myRoleInGroup}`"
|
||||
v-on:change="changeMemberRole(scope.row.id, $event)"
|
||||
>
|
||||
<ds-table :data="responseGroupMembersQuery" :fields="tableFields" condensed>
|
||||
<template slot="avatar">
|
||||
<ds-avatar online size="small" :name="responseGroupMembersQuery.name"></ds-avatar>
|
||||
</template>
|
||||
<template slot="myRoleInGroup" slot-scope="scope">
|
||||
<select
|
||||
v-if="scope.row.myRoleInGroup !== 'owner'"
|
||||
:options="['usual', 'admin']"
|
||||
:value="`${scope.row.myRoleInGroup}`"
|
||||
v-on:change="changeMemberRole(scope.row.id, $event)"
|
||||
>
|
||||
<option v-for="value in ['usual', 'admin']" :key="value">
|
||||
{{ value }}
|
||||
{{ value }}
|
||||
</option>
|
||||
</select>
|
||||
</template>
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<ds-button
|
||||
v-if="scope.row.myRoleInGroup !== 'owner'"
|
||||
size="small"
|
||||
@click="openModal(scope.row)"
|
||||
>
|
||||
delete
|
||||
</ds-button>
|
||||
</template>
|
||||
</ds-table>
|
||||
</base-card>
|
||||
</select>
|
||||
</template>
|
||||
<template slot="edit" slot-scope="scope">
|
||||
<ds-button
|
||||
v-if="scope.row.myRoleInGroup !== 'owner'"
|
||||
size="small"
|
||||
@click="openModal(scope.row)"
|
||||
>
|
||||
delete
|
||||
</ds-button>
|
||||
</template>
|
||||
</ds-table>
|
||||
</base-card>
|
||||
<ds-modal
|
||||
v-if="isOpen"
|
||||
v-model="isOpen"
|
||||
@ -72,7 +72,7 @@ export default {
|
||||
mutation: changeGroupMemberRoleMutation,
|
||||
variables: { groupId: this.groupId, userId: id, roleInGroup: newRole },
|
||||
})
|
||||
this.$toast.success('Die Rolle wurde auf ('+newRole+') geändert!')
|
||||
this.$toast.success('Die Rolle wurde auf (' + newRole + ') geändert!')
|
||||
} catch (error) {
|
||||
this.$toast.error(error.message)
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ export default {
|
||||
props: {
|
||||
placement: { type: String, default: 'top-end' },
|
||||
resource: { type: Object, required: true },
|
||||
isOwner: { type: String, default: false },
|
||||
isOwner: { type: String, default: null },
|
||||
resourceType: {
|
||||
type: String,
|
||||
required: true,
|
||||
@ -54,42 +54,41 @@ export default {
|
||||
computed: {
|
||||
routes() {
|
||||
const routes = []
|
||||
|
||||
|
||||
|
||||
if (this.resourceType === 'group') {
|
||||
if (this.isOwner === 'owner') {
|
||||
routes.push({
|
||||
label: 'Settings',
|
||||
path: `/group/edit/${this.resource.id}`,
|
||||
icon: 'edit',
|
||||
})
|
||||
label: 'Settings',
|
||||
path: `/group/edit/${this.resource.id}`,
|
||||
icon: 'edit',
|
||||
})
|
||||
}
|
||||
if (this.isOwner === 'usual') {
|
||||
routes.push({
|
||||
label: 'Unfollowing',
|
||||
callback: () => {
|
||||
label: 'Unfollowing',
|
||||
callback: () => {
|
||||
this.unfollowGroup(this.resource)
|
||||
},
|
||||
icon: 'minus',
|
||||
})
|
||||
icon: 'minus',
|
||||
})
|
||||
}
|
||||
if (this.isOwner === 'pending') {
|
||||
routes.push({
|
||||
label: 'Unfollowing',
|
||||
callback: () => {
|
||||
label: 'Unfollowing',
|
||||
callback: () => {
|
||||
this.removePending(this.resource)
|
||||
},
|
||||
icon: 'minus',
|
||||
})
|
||||
icon: 'minus',
|
||||
})
|
||||
}
|
||||
if (this.isOwner === null) {
|
||||
routes.push({
|
||||
label: 'Following',
|
||||
callback: () => {
|
||||
label: 'Following',
|
||||
callback: () => {
|
||||
this.addMemeberToGroup(this.resource)
|
||||
},
|
||||
icon: 'plus',
|
||||
})
|
||||
icon: 'plus',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -105,7 +105,6 @@ import InviteButton from '~/components/InviteButton/InviteButton'
|
||||
import CategoriesMenu from '~/components/FilterMenu/CategoriesMenu.vue'
|
||||
import GroupButton from '~/components/Group/GroupButton.vue'
|
||||
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Logo,
|
||||
|
||||
@ -1,15 +1,16 @@
|
||||
<template>
|
||||
<div><ds-section>
|
||||
<h1 class="ds-heading ds-heading-h1">Create New Groupe</h1></ds-section>
|
||||
<ds-space margin="large" >
|
||||
<ds-flex :width="{ base: '100%' }" gutter="base">
|
||||
<ds-flex-item :width="{ base: '100%', md: 5 }">
|
||||
<group-form @createGroup="createGroup" />
|
||||
</ds-flex-item>
|
||||
<ds-flex-item :width="{ base: '100%', md: 1 }"> </ds-flex-item>
|
||||
</ds-flex>
|
||||
</ds-space>
|
||||
|
||||
<div>
|
||||
<ds-section>
|
||||
<h1 class="ds-heading ds-heading-h1">Create New Groupe</h1>
|
||||
</ds-section>
|
||||
<ds-space margin="large">
|
||||
<ds-flex :width="{ base: '100%' }" gutter="base">
|
||||
<ds-flex-item :width="{ base: '100%', md: 5 }">
|
||||
<group-form @createGroup="createGroup" />
|
||||
</ds-flex-item>
|
||||
<ds-flex-item :width="{ base: '100%', md: 1 }"> </ds-flex-item>
|
||||
</ds-flex>
|
||||
</ds-space>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@ -1,20 +1,21 @@
|
||||
<template>
|
||||
<div>
|
||||
<ds-section>
|
||||
<h1 class="ds-heading ds-heading-h1">{{group.name}}</h1>
|
||||
<div class="">Group Setting</div></ds-section>
|
||||
<ds-space margin="large" >
|
||||
<ds-flex gutter="small">
|
||||
<ds-flex-item :width="{ base: '100%', md: '200px' }">
|
||||
<ds-menu :routes="routes" :is-exact="() => true" />
|
||||
</ds-flex-item>
|
||||
<ds-flex-item :width="{ base: '100%', md: 1 }">
|
||||
<transition name="slide-up" appear>
|
||||
<nuxt-child :group="group" />
|
||||
</transition>
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
</ds-space>
|
||||
<ds-section>
|
||||
<h1 class="ds-heading ds-heading-h1">{{ group.name }}</h1>
|
||||
<div class="">Group Setting</div>
|
||||
</ds-section>
|
||||
<ds-space margin="large">
|
||||
<ds-flex gutter="small">
|
||||
<ds-flex-item :width="{ base: '100%', md: '200px' }">
|
||||
<ds-menu :routes="routes" :is-exact="() => true" />
|
||||
</ds-flex-item>
|
||||
<ds-flex-item :width="{ base: '100%', md: 1 }">
|
||||
<transition name="slide-up" appear>
|
||||
<nuxt-child :group="group" />
|
||||
</transition>
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
</ds-space>
|
||||
<ds-space centered>
|
||||
<nuxt-link to="/my-groups">zurück</nuxt-link>
|
||||
</ds-space>
|
||||
|
||||
@ -1,20 +1,22 @@
|
||||
<template>
|
||||
<div><ds-section>
|
||||
<h1 class="ds-heading ds-heading-h1">My Groups</h1>
|
||||
<nuxt-link :to="{ name: 'group-create' }">
|
||||
<base-button
|
||||
v-tooltip="{
|
||||
content: $t('group.newGroup'),
|
||||
placement: 'left',
|
||||
delay: { show: 500 },
|
||||
}"
|
||||
:path="{ name: 'group-create' }"
|
||||
class="profile-post-add-button"
|
||||
icon="plus"
|
||||
circle
|
||||
filled
|
||||
/>
|
||||
</nuxt-link></ds-section>
|
||||
<div>
|
||||
<ds-section>
|
||||
<h1 class="ds-heading ds-heading-h1">My Groups</h1>
|
||||
<nuxt-link :to="{ name: 'group-create' }">
|
||||
<base-button
|
||||
v-tooltip="{
|
||||
content: $t('group.newGroup'),
|
||||
placement: 'left',
|
||||
delay: { show: 500 },
|
||||
}"
|
||||
:path="{ name: 'group-create' }"
|
||||
class="profile-post-add-button"
|
||||
icon="plus"
|
||||
circle
|
||||
filled
|
||||
/>
|
||||
</nuxt-link>
|
||||
</ds-section>
|
||||
<br />
|
||||
<br />
|
||||
<group-list :items="responseGroupListQuery" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user