add ignore_shopping && additional help

This commit is contained in:
Chris Scoggins
2022-01-26 12:57:29 -06:00
parent 2e2080d8d1
commit 47823132f0
14 changed files with 309 additions and 259 deletions

View File

@@ -0,0 +1,58 @@
<template>
<span><i class="mx-1 far fa-question-circle text-muted" @click="this_help.show = !this_help.show" /></span>
</template>
<script>
import Vue from "vue"
import VueCookies from "vue-cookies"
Vue.use(VueCookies)
let HELP_COOKIE_NAME = "help_settings"
export default {
name: "HelpBadge",
props: {
component: { type: String, required: true },
},
data() {
return {
help: {},
default: {
show: true,
},
this_help: undefined,
}
},
mounted() {
this.$nextTick(function () {
if (this.$cookies.isKey(HELP_COOKIE_NAME)) {
this.help = Object.assign({}, this.help, this.$cookies.get(HELP_COOKIE_NAME))
}
this.this_help = Object.assign({}, this.default, this.help?.[this.component])
})
},
watch: {
help: {
handler() {
this.$cookies.set(HELP_COOKIE_NAME, this.help)
},
deep: true,
},
this_help: {
handler() {
this.help[this.component] = Object.assign({}, this.this_help)
this.$cookies.set(HELP_COOKIE_NAME, this.help)
},
deep: true,
},
"this_help.show": function () {
if (this.this_help.show) {
this.$emit("show")
} else {
this.$emit("hide")
}
},
},
methods: {},
}
</script>

View File

@@ -1,5 +1,5 @@
<template>
<span>
<span v-if="!item.ignore_shopping">
<b-button class="btn text-decoration-none px-1 border-0" variant="link" :id="`shopping${item.id}`" @click="addShopping()">
<i
class="fas"