fix lint and locales

This commit is contained in:
ogerly 2022-09-19 18:50:53 +02:00
parent 7d5205e08b
commit 57a6e74d10
10 changed files with 122 additions and 87 deletions

View File

@ -12,14 +12,14 @@
<ds-input
v-model="formData.name"
:label="$t('group.group-name')"
:placeholder="`${$t('group.group-name')}…` "
:placeholder="`${$t('group.group-name')}…`"
></ds-input>
<ds-input
v-if="update"
v-model="formData.slug"
:label="$t('users.table.columns.slug')"
:placeholder="`${$t('group.group-name')}…` "
:placeholder="`${$t('group.group-name')}…`"
></ds-input>
<ds-select
@ -30,7 +30,11 @@
placeholder="Status ..."
></ds-select>
<ds-input v-model="formData.about" :label="$t('group.short-description')" rows="3"></ds-input>
<ds-input
v-model="formData.about"
:label="$t('group.short-description')"
rows="3"
></ds-input>
<ds-input
v-model="formData.description"
@ -40,15 +44,15 @@
></ds-input>
<ds-space margin-top="large">
<ds-select
id="city"
v-model="formData.locationName"
icon="map-marker"
:options="cities"
:label="$t('settings.data.labelCity')"
:placeholder="$t('settings.data.labelCity')"
:loading="loadingGeo"
@input.native="handleCityInput"
/>
id="city"
v-model="formData.locationName"
icon="map-marker"
:options="cities"
:label="$t('settings.data.labelCity')"
:placeholder="$t('settings.data.labelCity')"
:loading="loadingGeo"
@input.native="handleCityInput"
/>
</ds-space>
<ds-space margin-top="large">
<ds-select
@ -80,7 +84,7 @@
</ds-space>
</ds-form>
<ds-space centered v-show="!update">
<nuxt-link to="/my-groups">{{$t('group.back')}}</nuxt-link>
<nuxt-link to="/my-groups">{{ $t('group.back') }}</nuxt-link>
</ds-space>
</ds-container>
</div>
@ -112,7 +116,8 @@ export default {
},
},
data() {
const { name, slug, groupType, about, description, actionRadius, locationName, categories } = this.group
const { name, slug, groupType, about, description, actionRadius, locationName, categories } =
this.group
return {
categoriesActive: this.$env.CATEGORIES_ACTIVE,
disabled: false,
@ -155,7 +160,8 @@ export default {
methods: {
submit() {
const { name, about, description, groupType, actionRadius, locationName, categoryIds } = this.formData
const { name, about, description, groupType, actionRadius, locationName, categoryIds } =
this.formData
const variables = {
name,
about,

View File

@ -1,17 +1,21 @@
<template>
<ds-container class="group-card">
<ds-space>
<div @click="onlyOwnerGroups(true)" ref="myGruops"><ds-button >{{$t('group.show-my-created-groups')}}</ds-button ></div>
<div @click="onlyOwnerGroups(false)" ref="allGruops" hidden><ds-button >{{$t('group.show-all-my-groups')}}</ds-button ></div>
</ds-space>
<ds-space margin-bottom="small" v-for="item in items" :key="item.id">
<ds-card :ref="item.myRole === null ? 'null' : item.myRole">
<ds-flex>
<ds-flex-item width="90%" centered>
<ds-space margin="large">
<ds-container class="group-card">
<ds-space>
<div @click="onlyOwnerGroups(true)" ref="myGruops">
<ds-button>{{ $t('group.show-my-created-groups') }}</ds-button>
</div>
<div @click="onlyOwnerGroups(false)" ref="allGruops" hidden>
<ds-button>{{ $t('group.show-all-my-groups') }}</ds-button>
</div>
</ds-space>
<ds-space margin-bottom="small" v-for="item in items" :key="item.id">
<ds-card :ref="item.myRole === null ? 'null' : item.myRole">
<ds-flex>
<ds-flex-item width="90%" centered>
<ds-space margin="large">
<nuxt-link :to="`/group/${item.id}`">
<ds-text size="x-large">{{ item.name }}</ds-text>
</nuxt-link>
</nuxt-link>
<ds-text size="small">
{{ item.groupType }}
<ds-chip v-if="item.myRole === 'owner'" color="inverse">{{ item.myRole }}</ds-chip>
@ -20,14 +24,14 @@
</ds-chip>
</ds-text>
<ds-space margin-top="small">
<ds-text bold>{{ item.about }}</ds-text>
<ds-text bold>{{ item.about }}</ds-text>
</ds-space>
<ds-space margin-top="small">
<div v-html="item.descriptionExcerpt"></div>
<div v-html="item.descriptionExcerpt"></div>
</ds-space>
<ds-space margin-top="small">
<ds-chip v-for="category in item.categories" :key="category.name">
<ds-icon :name="category.icon"></ds-icon>
<ds-icon :name="category.icon"></ds-icon>
{{ category.name }}
</ds-chip>
<ds-space margin="x-small">
@ -38,7 +42,13 @@
</ds-space>
</ds-flex-item>
<ds-flex-item width="10%" centered>
<group-menu v-if="item.myRole === 'owner'" resource-type="group" :resource="item" :isOwner="item.myRole" @joinGroup="joinGroup"/>
<group-menu
v-if="item.myRole === 'owner'"
resource-type="group"
:resource="item"
:isOwner="item.myRole"
@joinGroup="joinGroup"
/>
</ds-flex-item>
</ds-flex>
</ds-card>
@ -65,16 +75,16 @@ export default {
const { id } = value
const variables = { groupId: id, userId: this.$store.getters['auth/user'].id }
try {
await this.$apollo.mutate({
mutation: joinGroupMutation,
variables,
})
await this.$apollo.mutate({
mutation: joinGroupMutation,
variables,
})
this.$toast.success(this.$t('group.group-created'))
} catch (error) {
this.$toast.error(error.message)
}
},
onlyOwnerGroups(bool) {
this.$refs.myGruops.hidden = bool
this.$refs.allGruops.hidden = !bool

View File

@ -1,6 +1,8 @@
<template>
<div>
<ds-space><h3>{{$t('group.members')}}</h3></ds-space>
<ds-space>
<h3>{{ $t('group.members') }}</h3>
</ds-space>
<base-card>
<ds-table :data="responseGroupMembersQuery" :fields="tableFields" condensed>
<template slot="avatar">
@ -72,7 +74,7 @@ export default {
mutation: changeGroupMemberRoleMutation,
variables: { groupId: this.groupId, userId: id, roleInGroup: newRole },
})
this.$toast.success(this.$t('group.change-member-role', {role: newRole}))
this.$toast.success(this.$t('group.change-member-role', { role: newRole }))
} catch (error) {
this.$toast.error(error.message)
}

View File

@ -16,7 +16,7 @@
<div class="group-menu-popover">
<ds-menu :routes="routes">
<template #menuitem="item">
{{item.parents}}
{{ item.parents }}
<ds-menu-item
:route="item.route"
:parents="item.parents"
@ -59,14 +59,14 @@ export default {
if (this.resourceType === 'group') {
if (this.isOwner === 'owner') {
routes.push({
label: $t('admin.settings.name'),
label: this.$t('admin.settings.name'),
path: `/group/edit/${this.resource.id}`,
icon: 'edit',
})
}
if (this.isOwner === 'usual') {
routes.push({
label: $t('group.unfollowing'),
label: this.$t('group.unfollowing'),
callback: () => {
// this.$emit('join-group', this.resource)
},
@ -75,7 +75,7 @@ export default {
}
if (this.isOwner === 'pending') {
routes.push({
label: $t('group.unfollowing'),
label: this.$t('group.unfollowing'),
callback: () => {
// this.removePending(this.resource)
},
@ -84,9 +84,9 @@ export default {
}
if (this.isOwner === null) {
routes.push({
label: $t('group.follow'),
label: this.$t('group.follow'),
callback: () => {
this.$emit('joinGroup', this.resource)
this.$emit('joinGroup', this.resource)
},
icon: 'plus',
})

View File

@ -371,28 +371,28 @@
"following": "Folge Ich"
},
"group": {
"group-name":"Gruppenname",
"myGroups": "Meine Gruppen",
"back": "zurück",
"change-member-role": "Die Rolle wurde auf ({role}) geändert!",
"follow": "Folge",
"general": "Allgemein",
"group-created": "Die Gruppe wurde angelegt!",
"group-name": "Gruppenname",
"group-updated": "Die Gruppendaten wurden geändert!",
"long-description": "Beschreibung",
"members": "Mitglieder",
"myGroups": "Meine Gruppen",
"newGroup": "Erstelle eine neue Gruppe",
"radius": "Radius",
"remove-member": "Mitglied entfernen",
"reset-form": "Formular zurücksetzen",
"save": "Neue Gruppe anlegen",
"settings": "Gruppeneinstellungen",
"short-description": "Kurzbeschreibung",
"show-all-my-groups": "Alle meine Gruppen anzeigen",
"show-my-created-groups": "Meine angelegten Gruppen anzeigen",
"unfollowing": "Nicht mehr folgen",
"update": "Änderung speichern",
"show-my-created-groups":"Meine angelegten Gruppen anzeigen",
"show-all-my-groups":"Alle meine Gruppen anzeigen",
"visibility":"Sichtbarkeit",
"short-description":"Kurzbeschreibung",
"long-description":"Beschreibung",
"radius":"Radius",
"reset-form":"Formular zurücksetzen",
"back":"zurück",
"unfollowing":"Nicht mehr folgen",
"follow":"Folge",
"settings":"Gruppeneinstellungen",
"general":"Allgemein",
"members":"Mitglieder",
"removemember":"Mitglied entfernen",
"change-member-role":"Die Rolle wurde auf ({role}) geändert!"
"visibility": "Sichtbarkeit"
},
"hashtags-filter": {
"clearSearch": "Suche löschen",

View File

@ -371,27 +371,28 @@
"following": "Following"
},
"group": {
"group-name":"Group name",
"myGroups": "My Groups",
"back": "back",
"change-member-role": "The role has been changed to ({role})!",
"follow": "Follow",
"general": "General",
"group-created": "The group was created!",
"group-name": "Group name",
"group-updated": "The group data has been changed.",
"long-description": "Description",
"members": "Members",
"myGroups": "My Groups",
"newGroup": "Create a new Group",
"radius": "Radius",
"remove-member": "Remove member",
"reset-form": "Reset form",
"save": "Create new group",
"settings": "Group Settings",
"short-description": "Short description",
"show-all-my-groups": "show all groups",
"show-my-created-groups": "show only my groups",
"unfollowing": "unfollowing",
"update": "Save change",
"show-my-created-groups":"show only my groups",
"show-all-my-groups":"show all groups",
"visibility":"Visibility",
"short-description":"Short description",
"long-description":"Description",
"radius":"Radius",
"reset-form":"Reset form",
"back":"back",
"unfollowing":"unfollowing",
"follow":"Follow",
"settings":"Group Settings",
"general":"General",
"members":"Members",
"remove-member":"Remove member"
"visibility": "Visibility"
},
"hashtags-filter": {
"clearSearch": "Clear search",

View File

@ -1,7 +1,7 @@
<template>
<div>
<ds-section>
<h1 class="ds-heading ds-heading-h1">{{$t('group.newGroup')}}Create New Groupe</h1>
<h1 class="ds-heading ds-heading-h1">{{ $t('group.newGroup') }}Create New Groupe</h1>
</ds-section>
<ds-space margin="large">
<ds-flex :width="{ base: '100%' }" gutter="base">
@ -29,10 +29,16 @@ export default {
},
methods: {
async createGroup(value) {
console.log('createGroup')
console.log(value)
const { name, about, description, groupType, actionRadius, locationName, categoryIds } = value
const variables = { name, about, description, groupType, actionRadius, locationName, categoryIds }
const variables = {
name,
about,
description,
groupType,
actionRadius,
locationName,
categoryIds,
}
try {
await this.$apollo.mutate({
mutation: createGroupMutation,

View File

@ -2,7 +2,7 @@
<div>
<ds-section>
<h1 class="ds-heading ds-heading-h1">{{ group.name }}</h1>
<div class="">{{$t('group.settings')}}</div>
<div class="">{{ $t('group.settings') }}</div>
</ds-section>
<ds-space margin="large">
<ds-flex gutter="small">
@ -17,7 +17,7 @@
</ds-flex>
</ds-space>
<ds-space centered>
<nuxt-link to="/my-groups">{{$t('group.back')}}</nuxt-link>
<nuxt-link to="/my-groups">{{ $t('group.back') }}</nuxt-link>
</ds-space>
</div>
</template>
@ -34,11 +34,11 @@ export default {
routes() {
return [
{
name: $t('group.general'),
name: this.$t('group.general'),
path: `/group/edit/${this.group.id}`,
},
{
name: $t('group.members'),
name: this.$t('group.members'),
path: `/group/edit/${this.group.id}/members`,
},
]

View File

@ -23,8 +23,18 @@ export default {
},
methods: {
async updateGroup(value) {
const { id, name, about, description, groupType, actionRadius, locationName, categoryIds } = value
const variables = { id, name, about, description, groupType, actionRadius, locationName, categoryIds }
const { id, name, about, description, groupType, actionRadius, locationName, categoryIds } =
value
const variables = {
id,
name,
about,
description,
groupType,
actionRadius,
locationName,
categoryIds,
}
try {
await this.$apollo.mutate({
mutation: updateGroupMutation,

View File

@ -1,7 +1,7 @@
<template>
<div>
<ds-section>
<h1 class="ds-heading ds-heading-h1">{{$t('group.myGroups')}}</h1>
<h1 class="ds-heading ds-heading-h1">{{ $t('group.myGroups') }}</h1>
<nuxt-link :to="{ name: 'group-create' }">
<base-button
v-tooltip="{