Skip to content
Snippets Groups Projects
Commit 37419563 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

adapt computed selected_colors_style to display label instead of name

parent 909de756
No related branches found
No related tags found
No related merge requests found
...@@ -98,8 +98,8 @@ ...@@ -98,8 +98,8 @@
</div> </div>
<div class="colors_selection" id="id_colors_selection" hidden> <div class="colors_selection" id="id_colors_selection" hidden>
<div <div
v-for="(value, key) in form.colors_style.value.colors" v-for="(value, key, index) in form.colors_style.value.colors"
:key="'colors_style-' + key" :key="'colors_style-' + index"
class="color-input" class="color-input"
> >
<label>{{ key }}</label <label>{{ key }}</label
...@@ -268,9 +268,14 @@ export default { ...@@ -268,9 +268,14 @@ export default {
}, },
selected_colors_style: { selected_colors_style: {
get() { get() {
return this.form.colors_style.value.custom_field_name; const value = this.form.colors_style.value.custom_field_name;
const customField = this.customForms.find((el) => el.name === value);
return customField && customField.length !== 0
? customField.label
: value;
}, },
set(newValue) { set(newValue) {
console.log(newValue);
const newColorsStyle = { const newColorsStyle = {
colors: { colors: {
[newValue.options[0]]: "#000000", [newValue.options[0]]: "#000000",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment