- {{ JSON.stringify(item.labelMapping, null, 4) }}
+
@@ -42,29 +27,51 @@
diff --git a/frontend/models/config/config-item-list.ts b/frontend/models/config/config-item-list.ts
new file mode 100644
index 00000000..1ad32d7a
--- /dev/null
+++ b/frontend/models/config/config-item-list.ts
@@ -0,0 +1,47 @@
+export class ConfigItemList {
+ constructor(public configItems: ConfigItem[]) {}
+
+ static valueOf(items: ConfigItem[]): ConfigItemList {
+ return new ConfigItemList(items)
+ }
+
+ toArray(): Object[] {
+ return this.configItems.map(item => item.toObject())
+ }
+}
+
+export class ConfigItem {
+ constructor(
+ public id: number,
+ public modelName: string,
+ public modelAttrs: object,
+ public template: string,
+ public labelMapping: object
+ ) {}
+
+ static valueOf(
+ { id, model_name, model_attrs, template, label_mapping }:
+ { id: number, model_name: string, model_attrs: object, template: string, label_mapping: object }
+ ): ConfigItem {
+ return new ConfigItem(id, model_name, model_attrs, template, label_mapping)
+ }
+
+ toObject(): Object {
+ return {
+ id: this.id,
+ modelName: this.modelName,
+ modelAttrs: this.modelAttrs,
+ template: this.template,
+ labelMapping: this.labelMapping
+ }
+ }
+}
+
+export const headers = [
+ {
+ text: 'Model name',
+ align: 'left',
+ value: 'modelName',
+ sortable: false
+ }
+]
diff --git a/frontend/repositories/config/api.ts b/frontend/repositories/config/api.ts
new file mode 100644
index 00000000..070975ad
--- /dev/null
+++ b/frontend/repositories/config/api.ts
@@ -0,0 +1,56 @@
+import ApiService from '@/services/api.service'
+import { ConfigItemListRepository } from '@/repositories/config/interface'
+import { ConfigItemList, ConfigItem } from '@/models/config/config-item-list'
+
+interface ConfigItemResponse {
+ id: number,
+ model_name: string,
+ model_attrs: object,
+ template: string,
+ label_mapping: object
+}
+
+export class FromApiConfigItemListRepository implements ConfigItemListRepository {
+ constructor(
+ private readonly request = ApiService
+ ) {}
+
+ async list(projectId: string): Promise