This commit is contained in:
j3d1 2024-06-08 20:26:05 +02:00
parent 1c090458de
commit 8906c752ee

View file

@ -6,20 +6,21 @@
<FormatedText :value="template.message" :format="formatText" class="template-message" <FormatedText :value="template.message" :format="formatText" class="template-message"
@input="changeMessageTemplate(template.id, $event)"/> @input="changeMessageTemplate(template.id, $event)"/>
<br> <br>
<button class="btn btn-primary" <button class="btn btn-primary" @click="resetMessageTemplate(template.id)"
:disabled="true">Reset :disabled="true">Reset
</button> </button>
<button class="btn btn-success" <button class="btn btn-success" @click="saveMessageTemplate(template.id)"
:disabled="true">Save :disabled="true">Save
</button> </button>
</li> </li>
</ul> </ul>
<h3 class="text-center">Message Template Variables</h3> <h3 class="text-center">Message Template Variables</h3>
<ul> <p>
<li v-for="(variable, key) in messageTemplateVariables" :key="key"> <span v-for="(variable, key) in messageTemplateVariables" :key="key" class="badge badge-primary">
{{ variable }} {{ variable }}
</li> </span>
</ul> </p>
{{ messageTemplatesIntermediate }}
</template> </template>
<script> <script>
@ -30,6 +31,11 @@ import FormatedText from "@/components/inputs/FormatedText.vue";
export default { export default {
name: 'Settings', name: 'Settings',
components: {FormatedText, Table}, components: {FormatedText, Table},
data() {
return {
messageTemplatesIntermediate: [],
};
},
computed: mapState(['messageTemplates', 'messageTemplateVariables']), computed: mapState(['messageTemplates', 'messageTemplateVariables']),
methods: { methods: {
...mapActions(['fetchMessageTemplates', 'fetchMessageTemplateVariables']), ...mapActions(['fetchMessageTemplates', 'fetchMessageTemplateVariables']),
@ -45,10 +51,18 @@ export default {
template.message = message; template.message = message;
} }
}); });
} },
saveMessageTemplate(id) {
console.log(id);
},
resetMessageTemplate(id) {
console.log(id);
},
}, },
mounted() { mounted() {
this.fetchMessageTemplates(); this.fetchMessageTemplates().then(() => {
this.messageTemplatesIntermediate = this.messageTemplates;
});
this.fetchMessageTemplateVariables(); this.fetchMessageTemplateVariables();
}, },
}; };