Skip to content

Commit

Permalink
#25125 updating card status if is in
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofBrylski committed Aug 12, 2024
1 parent 35f5abb commit 1850e36
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/kanban-board/components/KanbanContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ const getCardValueFromConfig = (
return contentObject[objectKey];
};

const updateCardStatusInAdditionalFields = (card, selectedField, newStatus) => {
card.additionalFields = card.additionalFields?.map((additionalField) => {
if (additionalField.key === selectedField) {
additionalField.data = newStatus;
}
return additionalField;
});
};

const getImageFromCo = (configKey, contentObject, config, client) => {
const objectKey = config[configKey];
const image = contentObject[objectKey]?.[0];
Expand Down Expand Up @@ -211,6 +220,12 @@ const KanbanContainer = ({
[selectedField]: targetColumnId,
};

updateCardStatusInAdditionalFields(
activeCard.card,
selectedField,
targetColumnId,
);

cardsCopy[targetColumnId] = cards[targetColumnId].filter(
({ contentObject }) => contentObject.id !== activeId,
);
Expand Down
2 changes: 1 addition & 1 deletion src/plugin-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "flotiq.kanban-view",
"name": "Kanban view",
"description": "This plugin will change Content Objects grid into kanban board for selected Content Definition. ",
"version": "1.0.3",
"version": "1.0.4",
"repository": "https://github.com/flotiq/flotiq-ui-react-plugin-kanban-board",
"url": "https://localhost:3050/static/js/bundle.js",
"permissions": [
Expand Down

0 comments on commit 1850e36

Please sign in to comment.