mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Working type checking & folder state, need to optimize.
This commit is contained in:
parent
705c3dd404
commit
79851c801a
1 changed files with 34 additions and 35 deletions
|
@ -149,7 +149,8 @@
|
||||||
@click="
|
@click="
|
||||||
editDialog.show = true;
|
editDialog.show = true;
|
||||||
editDialog.uuid = item.uuid;
|
editDialog.uuid = item.uuid;
|
||||||
editDialog.data.type = item.type;
|
editDialog.data.type = item.type.toUpperCase();
|
||||||
|
editDialog.data.folder = null;
|
||||||
editDialog.data.name = item.name;
|
editDialog.data.name = item.name;
|
||||||
editDialog.data.url = item.url;
|
editDialog.data.url = item.url;
|
||||||
getFolderList();
|
getFolderList();
|
||||||
|
@ -289,7 +290,8 @@
|
||||||
@click="
|
@click="
|
||||||
editDialog.show = true;
|
editDialog.show = true;
|
||||||
editDialog.uuid = item.uuid;
|
editDialog.uuid = item.uuid;
|
||||||
editDialog.data.type = item.type;
|
editDialog.data.type = item.type.toUpperCase();
|
||||||
|
editDialog.data.folder = null;
|
||||||
editDialog.data.name = item.name;
|
editDialog.data.name = item.name;
|
||||||
editDialog.data.url = item.url;
|
editDialog.data.url = item.url;
|
||||||
getFolderList();
|
getFolderList();
|
||||||
|
@ -418,14 +420,15 @@
|
||||||
v-model="editDialog.valid"
|
v-model="editDialog.valid"
|
||||||
:lazy-validation="false"
|
:lazy-validation="false"
|
||||||
>
|
>
|
||||||
|
|
||||||
<v-text-field
|
<v-select
|
||||||
class="px-2"
|
:items="supportedItemTypes"
|
||||||
label="Type"
|
class="my-2"
|
||||||
v-model="editDialog.data.type"
|
v-model="editDialog.data.type"
|
||||||
:rules="[v => !!v || 'Type is required.']"
|
:rules="[v => !!v || 'Type is required.']"
|
||||||
required
|
label="Item Type"
|
||||||
></v-text-field>
|
outlined
|
||||||
|
></v-select>
|
||||||
|
|
||||||
<v-text-field
|
<v-text-field
|
||||||
class="px-2"
|
class="px-2"
|
||||||
|
@ -987,7 +990,14 @@ export default {
|
||||||
"color": "grey",
|
"color": "grey",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// The URL is the key (to finding the item we want) so we want to keep track of that.
|
supportedItemTypes: [
|
||||||
|
"SCRIPT",
|
||||||
|
"MODEL",
|
||||||
|
"AVATAR",
|
||||||
|
"PLACE",
|
||||||
|
"JSON",
|
||||||
|
"UNKNOWN",
|
||||||
|
],
|
||||||
removeDialog: {
|
removeDialog: {
|
||||||
show: false,
|
show: false,
|
||||||
uuid: null,
|
uuid: null,
|
||||||
|
@ -1104,7 +1114,7 @@ export default {
|
||||||
},
|
},
|
||||||
pushToItems: function(type, name, folder, url, uuid) {
|
pushToItems: function(type, name, folder, url, uuid) {
|
||||||
var uuidToUse;
|
var uuidToUse;
|
||||||
|
|
||||||
if (uuid != null) {
|
if (uuid != null) {
|
||||||
uuidToUse = uuid;
|
uuidToUse = uuid;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1122,7 +1132,7 @@ export default {
|
||||||
|
|
||||||
this.items.push(itemToPush);
|
this.items.push(itemToPush);
|
||||||
|
|
||||||
if (folder !== null) {
|
if (folder !== null && folder !== "No Folder") {
|
||||||
this.moveItemToFolder(uuidToUse, folder);
|
this.moveItemToFolder(uuidToUse, folder);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1172,23 +1182,12 @@ export default {
|
||||||
checkItemType: function(itemType) {
|
checkItemType: function(itemType) {
|
||||||
var detectedItemType = null;
|
var detectedItemType = null;
|
||||||
itemType = itemType.toUpperCase();
|
itemType = itemType.toUpperCase();
|
||||||
switch (itemType) {
|
|
||||||
case "MODEL":
|
this.supportedItemTypes.forEach(function(itemTypeInList) {
|
||||||
detectedItemType = "MODEL";
|
if (itemTypeInList == itemType) {
|
||||||
break;
|
detectedItemType = itemTypeInList;
|
||||||
case "AVATAR":
|
}
|
||||||
detectedItemType = "AVATAR";
|
});
|
||||||
break;
|
|
||||||
case "SCRIPT":
|
|
||||||
detectedItemType = "SCRIPT";
|
|
||||||
break;
|
|
||||||
case "PLACE":
|
|
||||||
detectedItemType = "PLACE";
|
|
||||||
break;
|
|
||||||
case "JSON":
|
|
||||||
detectedItemType = "JSON";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (detectedItemType == null) {
|
if (detectedItemType == null) {
|
||||||
// This is not a known item type...
|
// This is not a known item type...
|
||||||
|
@ -1266,17 +1265,17 @@ export default {
|
||||||
folderName = this.folderList[i].name;
|
folderName = this.folderList[i].name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (folderName !== this.editDialog.data.folder && this.editDialog.data.folder !== null) {
|
|
||||||
this.moveItemToFolder(uuid, this.editDialog.data.folder);
|
|
||||||
} else if (folderName == "No Folder") {
|
|
||||||
this.moveItemToTop(uuid);
|
|
||||||
}
|
|
||||||
|
|
||||||
findItem.returnedItem.type = this.checkItemType(this.editDialog.data.type);
|
findItem.returnedItem.type = this.checkItemType(this.editDialog.data.type);
|
||||||
findItem.returnedItem.name = this.editDialog.data.name;
|
findItem.returnedItem.name = this.editDialog.data.name;
|
||||||
findItem.returnedItem.folder = this.editDialog.data.folder;
|
findItem.returnedItem.folder = this.editDialog.data.folder;
|
||||||
findItem.returnedItem.url = this.editDialog.data.url;
|
findItem.returnedItem.url = this.editDialog.data.url;
|
||||||
|
|
||||||
|
if (folderName !== this.editDialog.data.folder && this.editDialog.data.folder !== null) {
|
||||||
|
this.moveItemToFolder(uuid, this.editDialog.data.folder);
|
||||||
|
} else if (folderName === "No Folder" && folderName !== findItem.returnedItem.folder) {
|
||||||
|
this.moveItemToTop(uuid);
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
receivingItem: function(data) {
|
receivingItem: function(data) {
|
||||||
|
|
Loading…
Reference in a new issue