From f50101db8a717ae97e736d8e0a2df99fd861fdd0 Mon Sep 17 00:00:00 2001
From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com>
Date: Sat, 16 Mar 2024 14:04:24 -0400
Subject: [PATCH] Add "Import" Tab

Add "Import" Tab
---
 scripts/system/create/qml/EditTabView.qml     | 19 +++++++++++++++++
 .../system/create/qml/EditToolsTabView.qml    | 21 ++++++++++++++++++-
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/scripts/system/create/qml/EditTabView.qml b/scripts/system/create/qml/EditTabView.qml
index 96e66c109e..2db23ec659 100644
--- a/scripts/system/create/qml/EditTabView.qml
+++ b/scripts/system/create/qml/EditTabView.qml
@@ -301,6 +301,22 @@ TabBar {
         }
     }
 
+    EditTabButton {
+        title: "IMPORT"
+        active: true
+        enabled: true
+        property string originalUrl: ""
+
+        property Component visualItem: Component {
+            WebView {
+                id: advancedImportWebView
+                url: Qt.resolvedUrl("../importEntities/html/importEntities.html")
+                enabled: true
+                blurOnCtrlShift: false
+            }
+        }
+    }
+
     function fromScript(message) {
         switch (message.method) {
             case 'selectTab':
@@ -333,6 +349,9 @@ TabBar {
                 case 'grid':
                     editTabView.currentIndex = 3;
                     break;
+                case 'import':
+                    editTabView.currentIndex = 4;
+                    break;
                 default:
                     console.warn('Attempt to switch to invalid tab:', id);
             }
diff --git a/scripts/system/create/qml/EditToolsTabView.qml b/scripts/system/create/qml/EditToolsTabView.qml
index 998c3a3aac..1000724458 100644
--- a/scripts/system/create/qml/EditToolsTabView.qml
+++ b/scripts/system/create/qml/EditToolsTabView.qml
@@ -291,6 +291,22 @@ TabBar {
         }
     }
 
+    EditTabButton {
+        title: "IMPORT"
+        active: true
+        enabled: true
+        property string originalUrl: ""
+
+        property Component visualItem: Component {
+            WebView {
+                id: advancedImportWebView
+                url: Qt.resolvedUrl("../importEntities/html/importEntities.html")
+                enabled: true
+                blurOnCtrlShift: false
+            }
+        }
+    }
+
     function fromScript(message) {
         switch (message.method) {
             case 'selectTab':
@@ -304,7 +320,7 @@ TabBar {
     // Changes the current tab based on tab index or title as input
     function selectTab(id) {
         if (typeof id === 'number') {
-            if (id >= tabIndex.create && id <= tabIndex.grid) {
+            if (id >= tabIndex.create && id <= tabIndex.import) {
                 editTabView.currentIndex = id;
             } else {
                 console.warn('Attempt to switch to invalid tab:', id);
@@ -320,6 +336,9 @@ TabBar {
                 case 'grid':
                     editTabView.currentIndex = tabIndex.grid;
                     break;
+                case 'import':
+                    editTabView.currentIndex = tabIndex.import;
+                    break;
                 default:
                     console.warn('Attempt to switch to invalid tab:', id);
             }