diff --git a/arches_lingo/pkg/graphs/resource_models/Scheme.json b/arches_lingo/pkg/graphs/resource_models/Scheme.json index eeb75ab8..50a6675b 100644 --- a/arches_lingo/pkg/graphs/resource_models/Scheme.json +++ b/arches_lingo/pkg/graphs/resource_models/Scheme.json @@ -1463,20 +1463,13 @@ { "card_id": "92c68f1f-423c-11ee-8a8d-11afefc4bff7", "config": { - "defaultValue": { - "en": { - "direction": "ltr", - "value": "" - } - }, + "defaultValue": "", "i18n_properties": [ "placeholder" ], "label": "Namespace Name", "maxLength": null, - "placeholder": { - "en": "Enter text" - }, + "placeholder":"Enter text", "uneditable": false, "width": "100%" }, @@ -1488,7 +1481,7 @@ "sortorder": 0, "source_identifier_id": null, "visible": true, - "widget_id": "10000000-0000-0000-0000-000000000001" + "widget_id": "46ef064b-2611-4708-9f52-60136bd8a65b" }, { "card_id": "87fac835-423c-11ee-8a8d-11afefc4bff7", @@ -3196,7 +3189,7 @@ { "alias": "namespace_name", "config": {}, - "datatype": "string", + "datatype": "non-localized-string", "description": null, "exportable": false, "fieldname": null, diff --git a/arches_lingo/pkg/graphs/resource_models/scheme_rdm_system.json b/arches_lingo/pkg/graphs/resource_models/scheme_rdm_system.json index e900b711..3a9b37c7 100644 --- a/arches_lingo/pkg/graphs/resource_models/scheme_rdm_system.json +++ b/arches_lingo/pkg/graphs/resource_models/scheme_rdm_system.json @@ -3393,20 +3393,13 @@ { "card_id": "5b8894b3-48aa-11ee-8a8d-11afefc4bff7", "config": { - "defaultValue": { - "en": { - "direction": "ltr", - "value": "" - } - }, + "defaultValue": "", "i18n_properties": [ "placeholder" ], "label": "Namespace Name", "maxLength": null, - "placeholder": { - "en": "Enter text" - }, + "placeholder": "Enter text", "uneditable": false, "width": "100%" }, @@ -3417,7 +3410,7 @@ "node_id": "5b8894c0-48aa-11ee-8a8d-11afefc4bff7", "sortorder": 0, "visible": true, - "widget_id": "10000000-0000-0000-0000-000000000001" + "widget_id": "46ef064b-2611-4708-9f52-60136bd8a65b" }, { "card_id": "5b8894b6-48aa-11ee-8a8d-11afefc4bff7", diff --git a/arches_lingo/serializers.py b/arches_lingo/serializers.py index 3fcd733c..07c2baba 100644 --- a/arches_lingo/serializers.py +++ b/arches_lingo/serializers.py @@ -18,6 +18,14 @@ class Meta: fields = "__all__" +class SchemeNamespaceSerializer(ArchesModelSerializer): + class Meta: + model = ResourceInstance + graph_slug = "scheme" + nodegroups = ["namespace"] + fields = "__all__" + + class ConceptStatementSerializer(ArchesTileSerializer): class Meta: model = TileModel diff --git a/arches_lingo/src/arches_lingo/api.ts b/arches_lingo/src/arches_lingo/api.ts index ac148ef9..a75131da 100644 --- a/arches_lingo/src/arches_lingo/api.ts +++ b/arches_lingo/src/arches_lingo/api.ts @@ -1,5 +1,6 @@ import arches from "arches"; import Cookies from "js-cookie"; +import type { SchemeNamespace } from "@/arches_lingo/types"; function getToken() { const token = Cookies.get("csrftoken"); @@ -37,6 +38,30 @@ export const fetchUser = async () => { return parsed; }; +export const fetchSchemeNamespace = async (schemeId: string) => { + const response = await fetch(arches.urls.api_uri_namespace(schemeId)); + const parsed = await response.json(); + if (!response.ok) throw new Error(parsed.message || response.statusText); + return parsed; +}; + +export const updateSchemeNamespace = async ( + schemeId: string, + schemeNamespace: SchemeNamespace, +) => { + const response = await fetch(arches.urls.api_uri_namespace(schemeId), { + method: "PATCH", + headers: { + "X-CSRFTOKEN": getToken(), + "Content-Type": "application/json", + }, + body: JSON.stringify(schemeNamespace), + }); + const parsed = await response.json(); + if (!response.ok) throw new Error(parsed.message || response.statusText); + return parsed; +}; + export const fetchSearchResults = async ( searchTerm: string, items: number, diff --git a/arches_lingo/src/arches_lingo/components/generic/ControlledListItem.vue b/arches_lingo/src/arches_lingo/components/generic/ControlledListItem.vue new file mode 100644 index 00000000..377063f0 --- /dev/null +++ b/arches_lingo/src/arches_lingo/components/generic/ControlledListItem.vue @@ -0,0 +1,22 @@ + + + diff --git a/arches_lingo/src/arches_lingo/components/generic/ControlledListItemViewer.vue b/arches_lingo/src/arches_lingo/components/generic/ControlledListItemViewer.vue new file mode 100644 index 00000000..063e6465 --- /dev/null +++ b/arches_lingo/src/arches_lingo/components/generic/ControlledListItemViewer.vue @@ -0,0 +1,8 @@ + + diff --git a/arches_lingo/src/arches_lingo/components/generic/NonLocalizedString.vue b/arches_lingo/src/arches_lingo/components/generic/NonLocalizedString.vue new file mode 100644 index 00000000..0dfe8c15 --- /dev/null +++ b/arches_lingo/src/arches_lingo/components/generic/NonLocalizedString.vue @@ -0,0 +1,27 @@ + + + diff --git a/arches_lingo/src/arches_lingo/components/generic/NonLocalizedStringEditor.vue b/arches_lingo/src/arches_lingo/components/generic/NonLocalizedStringEditor.vue new file mode 100644 index 00000000..164fdb91 --- /dev/null +++ b/arches_lingo/src/arches_lingo/components/generic/NonLocalizedStringEditor.vue @@ -0,0 +1,22 @@ + + diff --git a/arches_lingo/src/arches_lingo/components/generic/NonLocalizedStringViewer.vue b/arches_lingo/src/arches_lingo/components/generic/NonLocalizedStringViewer.vue new file mode 100644 index 00000000..b0570b45 --- /dev/null +++ b/arches_lingo/src/arches_lingo/components/generic/NonLocalizedStringViewer.vue @@ -0,0 +1,6 @@ + + diff --git a/arches_lingo/src/arches_lingo/components/scheme/editor/SchemeEditor.vue b/arches_lingo/src/arches_lingo/components/scheme/editor/SchemeEditor.vue index 6b37dc7e..a686c915 100644 --- a/arches_lingo/src/arches_lingo/components/scheme/editor/SchemeEditor.vue +++ b/arches_lingo/src/arches_lingo/components/scheme/editor/SchemeEditor.vue @@ -2,19 +2,47 @@ const MAXIMIZE = "maximize"; const SIDE = "side"; const CLOSE = "close"; +const UPDATED = "updated"