Skip to content
Snippets Groups Projects
Commit 9ab5c596 authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

MST Message Activity import

parent dda6900d
No related branches found
No related tags found
No related merge requests found
Showing with 44 additions and 13 deletions
......@@ -4,4 +4,4 @@ import("system.result");
import("MSTeams_lib");
var isTeamsEnabled = vars.get("$param.ObjectId_param") in MSTeamsUtils.getTeamLinkContexts() && MSTeamsUtils.isTeamsEnabled();
result.string(/*isTeamsEnabled ? neon.COMPONENTSTATE_EDITABLE : */neon.COMPONENTSTATE_INVISIBLE);
\ No newline at end of file
result.string(isTeamsEnabled ? neon.COMPONENTSTATE_EDITABLE : neon.COMPONENTSTATE_INVISIBLE);
\ No newline at end of file
......@@ -78,9 +78,11 @@
<name>#PROVIDER_AGGREGATES</name>
<useAggregates v="true" />
</entityProvider>
<entityActionField>
<name>importMessages</name>
</entityActionField>
<entityField>
<name>TeamMessages</name>
<consumer>Messages</consumer>
<selectionMode>MULTI</selectionMode>
</entityField>
</entityFields>
<recordContainers>
<datalessRecordContainer>
......
......@@ -57,6 +57,20 @@
<name>#PROVIDER_AGGREGATES</name>
<useAggregates v="true" />
</entityProvider>
<entityActionField>
<name>importMessages</name>
<title>Import</title>
<onActionProcess>%aditoprj%/entity/MSTeamsMessage_entity/entityfields/importmessages/onActionProcess.js</onActionProcess>
</entityActionField>
<entityActionField>
<name>loadNext</name>
<title>Next</title>
<onActionProcess>%aditoprj%/entity/MSTeamsMessage_entity/entityfields/loadnext/onActionProcess.js</onActionProcess>
</entityActionField>
<entityActionField>
<name>loadPrevious</name>
<title>Prev</title>
</entityActionField>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......
import("system.neon");
import("system.logging");
import("Util_lib");
import("system.vars");
var messages = vars.get("$sys.selection");
var description = messages.map(function (id)
{
var [user, date, message] = JSON.parse(id);
return "[" + user + " " + date + "]\n" + message + "\n";
}).join("\n");
neon.openContext("Activity", "ActivityEdit_view", null, neon.OPERATINGSTATE_NEW, {
"Info_param": description
});
\ No newline at end of file
......@@ -31,7 +31,7 @@ else if (vars.get("$param.TeamId_param") && vars.get("$param.Channel_param"))
messages = messages.map(function (message)
{
return [
util.getNewUUID(),
JSON.stringify([message.author.userName, message.createdDateTime, message.message.message]),
message.author.userName,
message.message.message,
Date.parse(message.createdDateTime).toString()
......
......@@ -3,6 +3,7 @@
<name>MSTeamsMessage</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<filterView>MSTeamsMessageFilter_view</filterView>
<lookupView>MSTeamsMessageFilter_view</lookupView>
<entity>MSTeamsMessage_entity</entity>
<references>
<neonViewReference>
......
......@@ -22,16 +22,9 @@
</fields>
</genericViewTemplate>
<neonViewReference>
<name>e486a1bb-5deb-432a-aa28-c3872f0f88fc</name>
<name>59b3d882-d067-43eb-b19b-f52758c9d10b</name>
<entityField>Messages</entityField>
<view>MSTeamsMessageFilter_view</view>
</neonViewReference>
<actionsViewTemplate>
<name>Actions</name>
<actions>
<element>loadNextMessages</element>
</actions>
<entityField>#ENTITY</entityField>
</actionsViewTemplate>
</children>
</neonView>
......@@ -27,5 +27,11 @@
</neonTableColumn>
</columns>
</tableViewTemplate>
<actionsViewTemplate>
<name>ImportAction</name>
<actions>
<element>importMessages</element>
</actions>
</actionsViewTemplate>
</children>
</neonView>
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