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>
|
||||
@ -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)
|
||||
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,13 +1,16 @@
|
||||
<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
|
||||
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">
|
||||
@ -15,11 +18,19 @@
|
||||
<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.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>
|
||||
<ds-chip v-if="item.myRole === 'usual' || item.myRole === 'pending'">
|
||||
{{ item.myRole }}
|
||||
</ds-chip>
|
||||
|
||||
<div>
|
||||
<ds-space margin-top="small">
|
||||
@ -35,11 +46,7 @@
|
||||
</ds-space>
|
||||
</ds-flex-item>
|
||||
<ds-flex-item width="10%" centered>
|
||||
<group-menu
|
||||
resource-type="group"
|
||||
:resource="item"
|
||||
:isOwner="item.myRole"
|
||||
/>
|
||||
<group-menu resource-type="group" :resource="item" :isOwner="item.myRole" />
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
</ds-container>
|
||||
@ -73,33 +80,28 @@ export default {
|
||||
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
|
||||
|
||||
|
||||
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})
|
||||
this.$refs.null.forEach((element) => {
|
||||
element.$el.hidden = bool
|
||||
})
|
||||
}
|
||||
|
||||
if (this.$refs.pending) {
|
||||
this.$refs.pending.forEach(element => {
|
||||
element.$el.hidden = bool})
|
||||
}
|
||||
|
||||
this.$refs.pending.forEach((element) => {
|
||||
element.$el.hidden = bool
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
@ -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,
|
||||
@ -55,7 +55,6 @@ export default {
|
||||
routes() {
|
||||
const routes = []
|
||||
|
||||
|
||||
if (this.resourceType === 'group') {
|
||||
if (this.isOwner === 'owner') {
|
||||
routes.push({
|
||||
|
||||
@ -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,6 +1,8 @@
|
||||
<template>
|
||||
<div><ds-section>
|
||||
<h1 class="ds-heading ds-heading-h1">Create New Groupe</h1></ds-section>
|
||||
<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 }">
|
||||
@ -9,7 +11,6 @@
|
||||
<ds-flex-item :width="{ base: '100%', md: 1 }"> </ds-flex-item>
|
||||
</ds-flex>
|
||||
</ds-space>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
<div>
|
||||
<ds-section>
|
||||
<h1 class="ds-heading ds-heading-h1">{{ group.name }}</h1>
|
||||
<div class="">Group Setting</div></ds-section>
|
||||
<div class="">Group Setting</div>
|
||||
</ds-section>
|
||||
<ds-space margin="large">
|
||||
<ds-flex gutter="small">
|
||||
<ds-flex-item :width="{ base: '100%', md: '200px' }">
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div><ds-section>
|
||||
<div>
|
||||
<ds-section>
|
||||
<h1 class="ds-heading ds-heading-h1">My Groups</h1>
|
||||
<nuxt-link :to="{ name: 'group-create' }">
|
||||
<base-button
|
||||
@ -14,7 +15,8 @@
|
||||
circle
|
||||
filled
|
||||
/>
|
||||
</nuxt-link></ds-section>
|
||||
</nuxt-link>
|
||||
</ds-section>
|
||||
<br />
|
||||
<br />
|
||||
<group-list :items="responseGroupListQuery" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user