This commit is contained in:
j3d1 2024-06-08 20:26:05 +02:00
parent 0239b68c11
commit 33a7423fef

View file

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