diff --git a/src/Umbraco.Web.UI.Client/src/packages/dictionary/dictionary/entity-actions/import/import-dictionary-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/dictionary/dictionary/entity-actions/import/import-dictionary-modal.element.ts index 6ba503db31..9e2bf1bc7f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/dictionary/dictionary/entity-actions/import/import-dictionary-modal.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/dictionary/dictionary/entity-actions/import/import-dictionary-modal.element.ts @@ -62,8 +62,8 @@ export class UmbImportDictionaryModalLayout extends UmbModalBaseElement< #dictionaryItemBuilder(htmlString: string) { const parser = new DOMParser(); - const doc = parser.parseFromString(htmlString, 'text/html'); - const elements = doc.body.childNodes; + const doc = parser.parseFromString(htmlString, 'text/xml'); + const elements = doc.childNodes; this.#fileContent = this.#makeDictionaryItems(elements); this.requestUpdate(); @@ -73,17 +73,18 @@ export class UmbImportDictionaryModalLayout extends UmbModalBaseElement< const items: Array = []; const list: Array = []; nodeList.forEach((node) => { - if (node.nodeType === Node.ELEMENT_NODE) { + if (node.nodeType === Node.ELEMENT_NODE && node.nodeName === 'DictionaryItem') { list.push(node as Element); } }); list.forEach((item) => { items.push({ - name: item.getAttribute('name') ?? '', + name: item.getAttribute('Name') ?? '', children: this.#makeDictionaryItems(item.childNodes) ?? undefined, }); }); + return items; } @@ -144,10 +145,14 @@ export class UmbImportDictionaryModalLayout extends UmbModalBaseElement<
Choose where to import: - + ${ + console.log('load') + // + // + }
${this.#renderNavigate()}