Skip to content
Snippets Groups Projects
Commit 04a819b8 authored by Sebastian Pongratz's avatar Sebastian Pongratz :ping_pong:
Browse files

Merge branch 'sales_2001406_FixTopicTreeErrors' into '2021.2.1'

[Projekt: xRM-Sales][TicketNr.: 2001406][TopicTree: Zahlreiche Fehler]

See merge request xrm/basic!1399
parents 52bb0f1b ea11d9ea
No related branches found
No related tags found
No related merge requests found
......@@ -103,6 +103,7 @@
<name>first</name>
<title>First</title>
<onActionProcess>%aditoprj%/entity/TopicTree_entity/entityfields/more/children/first/onActionProcess.js</onActionProcess>
<isObjectAction v="false" />
<iconId>VAADIN:ANGLE_DOUBLE_UP</iconId>
<stateProcess>%aditoprj%/entity/TopicTree_entity/entityfields/more/children/first/stateProcess.js</stateProcess>
</entityActionField>
......@@ -110,6 +111,7 @@
<name>moveUp</name>
<title>Move Up</title>
<onActionProcess>%aditoprj%/entity/TopicTree_entity/entityfields/more/children/moveup/onActionProcess.js</onActionProcess>
<isObjectAction v="false" />
<iconId>VAADIN:ANGLE_UP</iconId>
<stateProcess>%aditoprj%/entity/TopicTree_entity/entityfields/more/children/moveup/stateProcess.js</stateProcess>
</entityActionField>
......@@ -117,6 +119,7 @@
<name>moveDown</name>
<title>Move Down</title>
<onActionProcess>%aditoprj%/entity/TopicTree_entity/entityfields/more/children/movedown/onActionProcess.js</onActionProcess>
<isObjectAction v="false" />
<iconId>VAADIN:ANGLE_DOWN</iconId>
<stateProcess>%aditoprj%/entity/TopicTree_entity/entityfields/more/children/movedown/stateProcess.js</stateProcess>
</entityActionField>
......@@ -124,6 +127,7 @@
<name>last</name>
<title>Last</title>
<onActionProcess>%aditoprj%/entity/TopicTree_entity/entityfields/more/children/last/onActionProcess.js</onActionProcess>
<isObjectAction v="false" />
<iconId>VAADIN:ANGLE_DOUBLE_DOWN</iconId>
<stateProcess>%aditoprj%/entity/TopicTree_entity/entityfields/more/children/last/stateProcess.js</stateProcess>
</entityActionField>
......@@ -146,6 +150,7 @@
<title>Paste as Top Topic</title>
<onActionProcess>%aditoprj%/entity/TopicTree_entity/entityfields/more/children/pasteastoptopic/onActionProcess.js</onActionProcess>
<iconId>VAADIN:PASTE</iconId>
<stateProcess>%aditoprj%/entity/TopicTree_entity/entityfields/more/children/pasteastoptopic/stateProcess.js</stateProcess>
</entityActionField>
<entityActionField>
<name>cut</name>
......@@ -168,6 +173,7 @@
<name>createChildTopic</name>
<title>Create Child Topic</title>
<onActionProcess>%aditoprj%/entity/TopicTree_entity/entityfields/createexpand/children/createchildtopic/onActionProcess.js</onActionProcess>
<selectionType>MULTI</selectionType>
<iconId>VAADIN:FILE_TREE_SMALL</iconId>
<stateProcess>%aditoprj%/entity/TopicTree_entity/entityfields/createexpand/children/createchildtopic/stateProcess.js</stateProcess>
</entityActionField>
......@@ -175,6 +181,7 @@
<name>expand</name>
<title>Expand</title>
<onActionProcess>%aditoprj%/entity/TopicTree_entity/entityfields/createexpand/children/expand/onActionProcess.js</onActionProcess>
<isObjectAction v="false" />
<iconId>VAADIN:EXPAND</iconId>
</entityActionField>
</children>
......@@ -296,6 +303,9 @@
<jDitoRecordFieldMapping>
<name>expanded.value</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>ACTIVE.displayValue</name>
</jDitoRecordFieldMapping>
</recordFieldMappings>
</jDitoRecordContainer>
</recordContainers>
......
import("system.neonFilter");
import("system.vars");
import("system.neon");
import("Attribute_lib");
var params = {};
if (vars.exists("$local.rows"))
if (vars.exists("$sys.selection"))
{
var row = vars.get("$local.rows");
var topicTreeId = row[0].UID;
var row = vars.get("$sys.selection");
var topicTreeId = row[0];
params["AssignedToId_param"] = topicTreeId;
}
neon.openContext("TopicTree", null, null, neon.OPERATINGSTATE_NEW, params);
\ No newline at end of file
neon.openContextWithRecipe("TopicTree", "TopicTreeEdit_view", neonFilter.createEntityRecordsRecipeBuilder().parameters(params).toString(), neon.OPERATINGSTATE_NEW);
\ No newline at end of file
......@@ -3,6 +3,6 @@ import("system.vars");
var topicDatSet = vars.get("$sys.selectionRows")[0];
vars.set("$context.Cut", null);
vars.set("$context.HasToBeCut", false);
vars.set("$context.Copied", JSON.stringify({dataset: topicDatSet
, amountOfLayers: TopicTreeUtils.getAmountOfLayers(topicDatSet)}));
\ No newline at end of file
......@@ -5,4 +5,4 @@ var topicDatSet = vars.get("$sys.selectionRows")[0];
vars.set("$context.Copied", JSON.stringify({dataset: topicDatSet
, amountOfLayers: TopicTreeUtils.getAmountOfLayers(topicDatSet)}));
vars.set("$context.Cut", true);
\ No newline at end of file
vars.set("$context.HasToBeCut", true);
\ No newline at end of file
......@@ -14,7 +14,7 @@ if(selection && vars.exists("$context.Copied"))
if(eMath.addInt(amountOfLayers, layer) <= TopicTreeUtils.getArrayLayers().length)//this tree doesn't work endlessly, so we can*t allow the user to create more layers than we allow
{
if(vars.get("$context.Cut"))
if(vars.get("$context.HasToBeCut"))
{
var copiedTopicTreeId = JSON.parse(vars.get("$context.Copied"))["dataset"];
var topicTreeIds = TopicTreeUtils.getSubTopicIds(copiedTopicTreeId);
......
import("system.result");
import("system.vars");
import("system.neon");
var state = neon.COMPONENTSTATE_DISABLED;
if(vars.exists("$context.Copied") && vars.get("$context.Copied"))
{
state = neon.COMPONENTSTATE_EDITABLE;
}
result.string(state);
\ No newline at end of file
......@@ -742,6 +742,8 @@ TopicTreeUtils.returnTopicTree = function (pIsRowCount)
treeElements[i][16] = treeElements[i][0]; //uid = TOPICTREEID needed for the tree
treeElements[i][17] = "NEON:DUE"; //icon (different colors depending on the state
treeElements[i][18] = expanded; //expanded
treeElements[i][19] = Utils.toBoolean(treeElements[i][2]) ? translate.text("Active") : translate.text("Inactive");//active displayValue
}
}
......@@ -793,7 +795,7 @@ TopicTreeUtils.paste = function (pIsTopTopic)
}
}
var isCut = vars.exists("$context.Cut") && vars.get("$context.Cut") != null;
var isCut = vars.exists("$context.HasToBeCut") && Utils.toBoolean(vars.get("$context.HasToBeCut"));
var copy = JSON.parse(vars.get("$context.Copied"))["dataset"]; //copied data
var cTopicTreeId = copy["#UID"];
var topicAndActive = newSelect("TOPICTREE.TOPIC, TOPICTREE.ACTIVE").from("TOPICTREE").where("TOPICTREE.TOPICTREEID", cTopicTreeId).arrayRow();
......@@ -829,6 +831,10 @@ TopicTreeUtils.paste = function (pIsTopTopic)
pLayerDeeper = TopicTreeUtils.getDeeperLayer(pSorting_Layer_1, pSorting_Layer_2, pSorting_Layer_3, pSorting_Layer_4, pSorting_Layer_5, pSorting_Layer_6);
cond = newWhere("TOPICTREE.ASSIGNEDTO", pTopicTreeId);
}
else
{
pLayerDeeper = pLayer;
}
var maxSortingOneLayerDeeper = newSelect("max(" + pLayerDeeper + ")")
......@@ -959,7 +965,7 @@ TopicTreeUtils.paste = function (pIsTopTopic)
}
}
if(isCut && subTopicsToDelete)
if(isCut && subTopicsToDelete && subTopicsToDelete.length > 0)
{
db.deletes([newWhere("TOPICTREE.TOPICTREEID", subTopicsToDelete, SqlBuilder.IN()).buildDeleteStatement()]);//delete before insert (duplicate id)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment