This commit is contained in:
2021-10-05 23:51:43 +00:00
parent 918b0040f9
commit 38ccc858af
2 changed files with 34 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div>
<span class="text-caption">
<span class="text-caption" v-if="!noLabel">
{{ title }}
</span>
<v-autocomplete
@@ -9,7 +9,7 @@
:readonly="readonly"
:items="sourcetags"
:loading="tagSearchUnderway"
:placeholder="$ay.t('TypeToSearchOrAdd')"
:placeholder="placeHolderText"
:no-data-text="$ay.t('NoData')"
:search-input.sync="tagSearchEntry"
hide-selected
@@ -63,7 +63,13 @@ export default {
},
readonly: { type: Boolean, default: false },
rules: { type: Array, default: undefined },
errorMessages: { type: Array, default: null }
errorMessages: { type: Array, default: null },
selectOnly: { type: Boolean, default: false },
noLabel: { type: Boolean, default: false },
placeHolder: {
type: String,
default: null
}
},
watch: {
async tagSearchEntry(val) {
@@ -93,11 +99,21 @@ export default {
return this.label;
}
return this.$ay.t("Tags");
},
placeHolderText() {
if (this.placeHolder) {
return this.placeHolder;
}
return this.$ay.t("TypeToSearchOrAdd");
}
},
methods: {
offerAdd() {
if (this.tagSearchEntry == null || this.tagSearchEntry == "") {
if (
this.selectOnly ||
this.tagSearchEntry == null ||
this.tagSearchEntry == ""
) {
return false;
}
const searchTag = this.normalizeTag(this.tagSearchEntry);

View File

@@ -19,7 +19,16 @@
{{ $refs.calendar.title }}</v-btn
>
</v-toolbar-title>
<v-spacer v-if="!$vuetify.breakpoint.xs"></v-spacer>
<template v-if="!$vuetify.breakpoint.xs">
<gz-tag-picker
place-holder="ph filter users"
no-label
select-only
v-model="tags"
></gz-tag-picker>
</template>
<v-btn
class="mr-3"
fab
@@ -394,7 +403,8 @@ export default {
formUserOptions: {},
tempFirstTime: null,
availableUsers: [],
lastMouseDownMS: null
lastMouseDownMS: null,
tags: []
};
},
methods: {
@@ -994,18 +1004,19 @@ function getFormSettings(vm) {
let formSettings = window.$gz.form.getFormSettings(FORM_KEY);
if (!formSettings || !formSettings.temp || !formSettings.temp.viewType) {
//defaults
formSettings = { temp: { viewType: "month", focus: null } };
formSettings = { temp: { viewType: "month", focus: null, tags: [] } };
}
vm.viewType = formSettings.temp.viewType;
vm.focus = formSettings.temp.focus;
vm.tags = formSettings.temp.tags;
return formSettings;
}
function saveFormSettings(vm) {
const formSettings = window.$gz.form.getFormSettings(FORM_KEY);
formSettings.temp = { viewType: vm.viewType, focus: vm.focus };
formSettings.temp = { viewType: vm.viewType, focus: vm.focus, tags: vm.tags };
window.$gz.form.setFormSettings(FORM_KEY, formSettings);
}