diff --git a/frontend/components/label/FormCreate.vue b/frontend/components/label/FormCreate.vue
index d6cf4754..b0f756e0 100644
--- a/frontend/components/label/FormCreate.vue
+++ b/frontend/components/label/FormCreate.vue
@@ -10,27 +10,30 @@
@@ -47,9 +50,18 @@ export default Vue.extend({
},
props: {
- value: {
- type: Object,
- default: () => {},
+ text: {
+ type: String,
+ default: '',
+ required: true
+ },
+ suffixKey: {
+ type: String,
+ default: null,
+ },
+ backgroundColor: {
+ type: String,
+ default: '#ffffff',
required: true
},
usedNames: {
@@ -82,16 +94,12 @@ export default Vue.extend({
computed: {
shortkeys() {
return '0123456789abcdefghijklmnopqrstuvwxyz'.split('')
- },
- item: {
- get() {
- // @ts-ignore
- return this.value
- },
- set(val) {
- // @ts-ignore
- this.$emit('input', val)
- }
+ }
+ },
+
+ methods: {
+ updateValue(key: string, value: string) {
+ this.$emit(`update:${key}`, value);
}
}
})
diff --git a/frontend/components/label/LabelList.vue b/frontend/components/label/LabelList.vue
index caffb0d3..f408f831 100644
--- a/frontend/components/label/LabelList.vue
+++ b/frontend/components/label/LabelList.vue
@@ -27,10 +27,10 @@
filled
/>
-
+
{{ props.item.background_color }}
@@ -79,8 +79,8 @@ export default Vue.extend({
headers() {
return [
{ text: this.$t('generic.name'), value: 'text' },
- { text: this.$t('labels.shortkey'), value: 'suffix_key' },
- { text: this.$t('labels.color'), value: 'background_color' },
+ { text: this.$t('labels.shortkey'), value: 'suffixKey' },
+ { text: this.$t('labels.color'), value: 'backgroundColor' },
{ text: 'Actions', value: 'actions', sortable: false },
]
}
diff --git a/frontend/pages/projects/_id/labels/index.vue b/frontend/pages/projects/_id/labels/index.vue
index 36d9f232..c5726074 100644
--- a/frontend/pages/projects/_id/labels/index.vue
+++ b/frontend/pages/projects/_id/labels/index.vue
@@ -16,7 +16,7 @@
_ !== item).map(item => item.suffix_key)
+ return this.items.filter(_ => _ !== item).map(item => item.suffixKey)
.filter(item => item !==null) as string[]
}
},
diff --git a/frontend/services/application/label.service.ts b/frontend/services/application/label.service.ts
index a03e7930..fe272441 100644
--- a/frontend/services/application/label.service.ts
+++ b/frontend/services/application/label.service.ts
@@ -4,18 +4,18 @@ import { LabelItemListRepository } from '@/repositories/label/interface'
export class LabelDTO {
id: number
text: string
- prefix_key: string | null
- suffix_key: string | null
- background_color: string
- text_color: string
+ prefixKey: string | null
+ suffixKey: string | null
+ backgroundColor: string
+ textColor: string
constructor(item: LabelItem) {
this.id = item.id
this.text = item.text
- this.prefix_key = item.prefixKey
- this.suffix_key = item.suffixKey
- this.background_color = item.backgroundColor
- this.text_color = '#ffffff'
+ this.prefixKey = item.prefixKey
+ this.suffixKey = item.suffixKey
+ this.backgroundColor = item.backgroundColor
+ this.textColor = '#ffffff'
}
}
@@ -30,12 +30,12 @@ export class LabelApplicationService {
}
public create(projectId: string, item: LabelDTO): void {
- const label = new LabelItem(0, item.text, item.prefix_key, item.suffix_key, item.background_color, item.text_color)
+ const label = new LabelItem(0, item.text, item.prefixKey, item.suffixKey, item.backgroundColor, item.textColor)
this.repository.create(projectId, label)
}
public update(projectId: string, item: LabelDTO): void {
- const label = new LabelItem(item.id, item.text, item.prefix_key, item.suffix_key, item.background_color, item.text_color)
+ const label = new LabelItem(item.id, item.text, item.prefixKey, item.suffixKey, item.backgroundColor, item.textColor)
this.repository.update(projectId, label)
}