- Reduce tooltip delay to 750ms.
This commit is contained in:
Wolfgang Huß 2022-09-26 11:39:14 +02:00
parent 7b11122bea
commit 0d44d8ae04
9 changed files with 27 additions and 82 deletions

View File

@ -42,7 +42,7 @@ export default {
props: { props: {
placement: { type: String, default: 'bottom-end' }, placement: { type: String, default: 'bottom-end' },
resource: { type: Object, required: true }, resource: { type: Object, required: true },
isOwner: { type: String, default: null }, group: { type: Object, required: true },
resourceType: { resourceType: {
type: String, type: String,
required: true, required: true,
@ -56,40 +56,19 @@ export default {
const routes = [] const routes = []
if (this.resourceType === 'group') { if (this.resourceType === 'group') {
if (this.isOwner === 'owner') { routes.push({
label: this.$t('group.contentMenu.visitGroupPage'),
icon: 'home',
name: 'group-id-slug',
params: { id: this.group.id, slug: this.group.slug },
})
if (this.group.myRole === 'owner') {
routes.push({ routes.push({
label: this.$t('admin.settings.name'), label: this.$t('admin.settings.name'),
path: `/group/edit/${this.resource.id}`, path: `/group/edit/${this.resource.id}`,
icon: 'edit', icon: 'edit',
}) })
} }
if (this.isOwner === 'usual') {
routes.push({
label: this.$t('group.unfollowing'),
callback: () => {
// this.$emit('join-group', this.resource)
},
icon: 'minus',
})
}
if (this.isOwner === 'pending') {
routes.push({
label: this.$t('group.unfollowing'),
callback: () => {
// this.removePending(this.resource)
},
icon: 'minus',
})
}
if (this.isOwner === null) {
routes.push({
label: this.$t('group.follow'),
callback: () => {
this.$emit('joinGroup', this.resource)
},
icon: 'plus',
})
}
} }
return routes return routes

View File

@ -46,11 +46,18 @@
{{ $t(`group.types.${groupType}`) }} {{ $t(`group.types.${groupType}`) }}
</option> </option>
</select> </select>
<!-- goal -->
<ds-input
:label="$t('group.goal')"
v-model="formData.about"
:placeholder="$t('group.goal') + ' …'"
rows="3"
></ds-input>
<!-- description --> <!-- description -->
<ds-input v-model="formData.about" :label="$t('group.goal')" rows="3"></ds-input>
<ds-input <ds-input
:label="$t('group.description')" :label="$t('group.description')"
v-model="formData.description" v-model="formData.description"
:placeholder="$t('group.description') + ' …'"
type="textarea" type="textarea"
rows="3" rows="3"
></ds-input> ></ds-input>
@ -120,10 +127,6 @@
</ds-button> </ds-button>
</ds-space> </ds-space>
</ds-form> </ds-form>
<!-- Wolle: <ds-space centered v-show="!update">
<nuxt-link to="/my-groups">{{ $t('group.back') }}</nuxt-link>
</ds-space> -->
<!-- Wolle: </ds-container> -->
</div> </div>
</template> </template>

View File

@ -58,13 +58,7 @@
<div v-else class="categories-placeholder"></div> <div v-else class="categories-placeholder"></div>
<!-- group context menu --> <!-- group context menu -->
<client-only> <client-only>
<group-content-menu <group-content-menu resource-type="group" :resource="group" :group="group" />
v-if="group.myRole === 'owner'"
resource-type="group"
:resource="group"
:isOwner="group.myRole"
@joinGroup="joinGroup"
/>
</client-only> </client-only>
</footer> </footer>
<footer class="footer"> <footer class="footer">
@ -85,7 +79,6 @@
<script> <script>
import Category from '~/components/Category' import Category from '~/components/Category'
import GroupContentMenu from '~/components/Group/GroupContentMenu' import GroupContentMenu from '~/components/Group/GroupContentMenu'
import { joinGroupMutation } from '~/graphql/groups.js'
export default { export default {
name: 'GroupTeaser', name: 'GroupTeaser',
@ -113,24 +106,6 @@ export default {
return this.$filters.removeLinks(this.group.descriptionExcerpt) return this.$filters.removeLinks(this.group.descriptionExcerpt)
}, },
}, },
methods: {
editGroup(group) {
this.$router.push({ path: `/group/edit/${group.id}` })
},
async joinGroup(value) {
const { id } = value
const variables = { groupId: id, userId: this.$store.getters['auth/user'].id }
try {
await this.$apollo.mutate({
mutation: joinGroupMutation(),
variables,
})
this.$toast.success(this.$t('group.groupCreated'))
} catch (error) {
this.$toast.error(error.message)
}
},
},
} }
</script> </script>

View File

@ -404,9 +404,11 @@
"regional": "Regionale Gruppe" "regional": "Regionale Gruppe"
}, },
"actionRadius": "Aktionsradius", "actionRadius": "Aktionsradius",
"back": "zurück",
"categories": "Thema ::: Themen", "categories": "Thema ::: Themen",
"changeMemberRole": "Die Rolle wurde auf „{role}“ geändert!", "changeMemberRole": "Die Rolle wurde auf „{role}“ geändert!",
"contentMenu": {
"visitGroupPage": "Gruppe anzeigen"
},
"createNewGroup": { "createNewGroup": {
"title": "Erstelle eine neue Gruppe", "title": "Erstelle eine neue Gruppe",
"tooltip": "Erstelle eine neue Gruppe" "tooltip": "Erstelle eine neue Gruppe"
@ -420,7 +422,6 @@
"foundation": "Gründung", "foundation": "Gründung",
"general": "Allgemein", "general": "Allgemein",
"goal": "Ziel der Gruppe", "goal": "Ziel der Gruppe",
"group-updated": "Die Gruppendaten wurden geändert!",
"groupCreated": "Die Gruppe wurde angelegt!", "groupCreated": "Die Gruppe wurde angelegt!",
"joinLeaveButton": { "joinLeaveButton": {
"iAmMember": "Bin Mitglied", "iAmMember": "Bin Mitglied",
@ -455,17 +456,14 @@
"usual": "Einfaches Mitglied" "usual": "Einfaches Mitglied"
}, },
"save": "Neue Gruppe anlegen", "save": "Neue Gruppe anlegen",
"showAllMyGroups": "Alle meine Gruppen anzeigen",
"showMyCreatedGroups": "Meine angelegten Gruppen anzeigen",
"type": "Gruppentyp", "type": "Gruppentyp",
"types": { "types": {
"closed": "Geschlossene Gruppe", "closed": "Geschlossene Gruppe",
"hidden": "Versteckte Gruppe", "hidden": "Versteckte Gruppe",
"public": "Öffentliche Gruppe" "public": "Öffentliche Gruppe"
}, },
"unfollowing": "Nicht mehr folgen",
"update": "Änderung speichern", "update": "Änderung speichern",
"visibility": "Sichtbarkeit" "updatedGroup": "Die Gruppendaten wurden geändert!"
}, },
"hashtags-filter": { "hashtags-filter": {
"clearSearch": "Suche löschen", "clearSearch": "Suche löschen",

View File

@ -404,9 +404,11 @@
"regional": "Regional Group" "regional": "Regional Group"
}, },
"actionRadius": "Action radius", "actionRadius": "Action radius",
"back": "back",
"categories": "Topic ::: Topics", "categories": "Topic ::: Topics",
"changeMemberRole": "The role has been changed to “{role}”!", "changeMemberRole": "The role has been changed to “{role}”!",
"contentMenu": {
"visitGroupPage": "Show group"
},
"createNewGroup": { "createNewGroup": {
"title": "Create A New Group", "title": "Create A New Group",
"tooltip": "Create a new group" "tooltip": "Create a new group"
@ -420,7 +422,6 @@
"foundation": "Foundation", "foundation": "Foundation",
"general": "General", "general": "General",
"goal": "Goal of group", "goal": "Goal of group",
"group-updated": "The group data has been changed.",
"groupCreated": "The group was created!", "groupCreated": "The group was created!",
"joinLeaveButton": { "joinLeaveButton": {
"iAmMember": "I'm a member", "iAmMember": "I'm a member",
@ -455,17 +456,14 @@
"usual": "Simple Member" "usual": "Simple Member"
}, },
"save": "Create new group", "save": "Create new group",
"showAllMyGroups": "show all groups",
"showMyCreatedGroups": "show only my groups",
"type": "Group type", "type": "Group type",
"types": { "types": {
"closed": "Closed Group", "closed": "Closed Group",
"hidden": "Hidden Group", "hidden": "Hidden Group",
"public": "Public Group" "public": "Public Group"
}, },
"unfollowing": "unfollowing",
"update": "Save change", "update": "Save change",
"visibility": "Visibility" "updatedGroup": "The group data has been changed."
}, },
"hashtags-filter": { "hashtags-filter": {
"clearSearch": "Clear search", "clearSearch": "Clear search",

View File

@ -17,10 +17,6 @@
</transition> </transition>
</ds-flex-item> </ds-flex-item>
</ds-flex> </ds-flex>
<!-- Wolle: </ds-space> -->
<!-- Wolle: <ds-space centered>
<nuxt-link to="/my-groups">{{ $t('group.back') }}</nuxt-link>
</ds-space> -->
</div> </div>
</template> </template>

View File

@ -58,7 +58,7 @@ export default {
responseSlug = groupSlug responseSlug = groupSlug
}, },
}) })
this.$toast.success(this.$t('group.group-updated')) this.$toast.success(this.$t('group.updatedGroup'))
this.$router.history.push({ this.$router.history.push({
name: 'group-id-slug', name: 'group-id-slug',
params: { id: responseId, slug: responseSlug }, params: { id: responseId, slug: responseSlug },

View File

@ -42,10 +42,6 @@ export default {
name: this.$t('settings.social-media.name'), name: this.$t('settings.social-media.name'),
path: `/settings/my-social-media`, path: `/settings/my-social-media`,
}, },
// Wolle: {
// name: this.$t('settings.myGroups'),
// path: `/my-groups`,
// },
{ {
name: this.$t('settings.muted-users.name'), name: this.$t('settings.muted-users.name'),
path: `/settings/muted-users`, path: `/settings/muted-users`,

View File

@ -3,7 +3,7 @@ import VTooltip from 'v-tooltip'
Vue.use(VTooltip, { Vue.use(VTooltip, {
defaultDelay: { defaultDelay: {
show: 1500, show: 750,
hide: 50, hide: 50,
}, },
defaultOffset: 2, defaultOffset: 2,