feat: add product interaction mode selector with three scenarios

- Add ItemToggleButton component for 3-way toggle in admin panel
- Add product_interaction_mode setting with options: order, manager, browser
- Add manager_username setting for Telegram manager contact
- Remove store_enabled setting, replaced with product_interaction_mode
- Create migration to automatically migrate store_enabled to product_interaction_mode
- Update Product.vue to handle all three interaction modes
- Update Dock.vue to show cart button only when product_interaction_mode is 'order'
- Rename 'Магазин' tab to 'Витрина' in admin panel
- Remove 'Разрешить покупки' option (now controlled via product_interaction_mode)
- Set default product_interaction_mode to 'browser'
- Update StoreDTO to remove enableStore field
- Update SettingsHandler to return product_interaction_mode instead of store_enabled
This commit is contained in:
2025-12-25 18:02:38 +03:00
parent 22ddc3043d
commit ecf4df363d
13 changed files with 228 additions and 29 deletions

View File

@@ -0,0 +1,51 @@
<template>
<SettingsItem :label="label">
<template #default>
<SelectButton
:modelValue="model"
:options="options"
optionLabel="label"
optionValue="value"
:allowEmpty="false"
@update:modelValue="updateValue"
/>
</template>
<template #help>
<slot/>
</template>
</SettingsItem>
</template>
<script setup>
import {computed} from "vue";
import SettingsItem from "@/components/SettingsItem.vue";
import SelectButton from "primevue/selectbutton";
const model = defineModel();
const props = defineProps({
items: {
type: Object,
default: {},
},
label: {
type: String,
default: '',
},
});
const options = computed(() => {
return Object.entries(props.items).map(([value, label]) => ({
value,
label,
}));
});
function updateValue(newValue) {
model.value = newValue;
}
</script>
<style scoped>
</style>