fix bug where drag&drop would not create new object versions

This commit is contained in:
marlon-erler
2024-07-13 11:56:15 +02:00
parent ea4d27ce64
commit 414ab87110
4 changed files with 35 additions and 13 deletions
+15 -7
View File
@@ -955,6 +955,14 @@
addObjectContent = (messageObject, content) => {
messageObject.contentVersions[content.id] = content;
};
updateObjectContent = (messageObject, content) => {
const latest = this.getMostRecentContent(messageObject);
Object.entries(content).forEach((entry) => {
const [key, value] = entry;
latest[key] = value;
});
this.addObjectContent(messageObject, latest);
};
addObject = (messageObject, ignoreIfUnchanged = false) => {
const existingObject = this.objects.value.get(messageObject.id);
if (existingObject) {
@@ -1167,8 +1175,6 @@
);
var currentAddress = restoreState("current-address", "");
var previousAddresses = restoreListState("previous-addresses");
previousAddresses.add("a", "a", "A");
previousAddresses.add("a", "a", "A");
var cannotDisonnect = createProxyState(
[isConnected],
() => isConnected.value == false
@@ -1648,8 +1654,9 @@
if (!id) return;
const messageObject = chat.objects.value.get(id);
if (!messageObject) return;
const latest = chat.getMostRecentContent(messageObject);
latest.categoryName = kanbanBoard.category;
const newContent = chat.createObjectContent();
newContent.categoryName = kanbanBoard.category;
chat.updateObjectContent(messageObject, newContent);
chat.addObjectAndSend(messageObject);
}
const itemToViewEntry = (kanbanBoardItem) => {
@@ -1976,9 +1983,10 @@
if (!id) return;
const messageObject = chat.objects.value.get(id);
if (!messageObject) return;
const latest = chat.getMostRecentContent(messageObject);
latest.status = status;
latest.categoryName = category;
const newContent = chat.createObjectContent();
newContent.categoryName = category;
newContent.status = status;
chat.updateObjectContent(messageObject, newContent);
chat.addObjectAndSend(messageObject);
}
const cellItemToEntryView = (cellItem) => ObjectEntryView(