From 9b95f72c5cdea13848c058a130bef38fb1498417 Mon Sep 17 00:00:00 2001 From: Jens Pelzetter Date: Wed, 14 Jul 2021 20:29:21 +0200 Subject: [PATCH] Integrated sortable.js --- ccm-cms/package-lock.json | 11 + ccm-cms/package.json | 4 +- .../documents/RelatedInfoStep.java | 26 +- .../documents/relatedinfo.xhtml | 660 ++++++++++++------ .../ui/DefaultAuthoringStepsBundle.properties | 1 + .../DefaultAuthoringStepsBundle_de.properties | 1 + .../typescript/content-sections/cms-admin.ts | 4 +- .../content-sections/cms-attachment-lists.ts | 33 + ccm-cms/tsconfig.json | 1 + 9 files changed, 514 insertions(+), 227 deletions(-) create mode 100644 ccm-cms/src/main/typescript/content-sections/cms-attachment-lists.ts diff --git a/ccm-cms/package-lock.json b/ccm-cms/package-lock.json index e0a624857..9e0e437aa 100644 --- a/ccm-cms/package-lock.json +++ b/ccm-cms/package-lock.json @@ -3234,6 +3234,12 @@ "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==", "dev": true }, + "@types/sortablejs": { + "version": "1.10.7", + "resolved": "https://registry.npmjs.org/@types/sortablejs/-/sortablejs-1.10.7.tgz", + "integrity": "sha512-lGCwwgpj8zW/ZmaueoPVSP7nnc9t8VqVWXS+ASX3eoUUENmiazv0rlXyTRludXzuX9ALjPsMqBu85TgJNWbTOg==", + "dev": true + }, "abab": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", @@ -9378,6 +9384,11 @@ } } }, + "sortablejs": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.14.0.tgz", + "integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==" + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", diff --git a/ccm-cms/package.json b/ccm-cms/package.json index 7dc8578c2..7a968ecef 100644 --- a/ccm-cms/package.json +++ b/ccm-cms/package.json @@ -13,6 +13,7 @@ "license": "LGPL-3.0-or-later", "devDependencies": { "@parcel/transformer-typescript-tsc": "^2.0.0-beta.1", + "@types/sortablejs": "^1.10.7", "npm-run-all": "^4.1.5", "parcel": "^2.0.0-beta.2", "sass": "^1.32.12", @@ -24,7 +25,8 @@ "bootstrap": "^4.6.0", "bootstrap-icons": "^1.4.1", "jquery": "^3.6.0", - "popper.js": "^1.16.1" + "popper.js": "^1.16.1", + "sortablejs": "^1.14.0" }, "targets": { "main": false diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/RelatedInfoStep.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/RelatedInfoStep.java index ec0d1fb7a..d8eb9a5ab 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/RelatedInfoStep.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/RelatedInfoStep.java @@ -290,7 +290,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { if (permissionChecker.isPermitted( ItemPrivileges.EDIT, getDocument() )) { - return "org/librecms/ui/documents/relatedinfo.xhtml"; + return "org/librecms/ui/contentsection/documents/relatedinfo.xhtml"; } else { return documentUi.showAccessDenied( getContentSection(), @@ -727,7 +727,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { listDetailsModel.setAttachmentList(listResult.get()); - return "org/librecms/ui/documents/relatedinfo-attachmentlist-details.xhtml"; + return "org/librecms/ui/contentsection/documents/relatedinfo-attachmentlist-details.xhtml"; } else { return documentUi.showAccessDenied( getContentSection(), @@ -1256,7 +1256,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { models .put("section", getContentSection().getLabel()); models.put("assetUuid", assetUuid); - return "org/librecms/ui/documents/asset-not-found.xhtml"; + return "org/librecms/ui/contentsection/documents/asset-not-found.xhtml"; } final Asset asset = assetResult.get(); @@ -1315,7 +1315,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { final AttachmentList list = listResult.get(); models.put("attachmentList", list.getName()); - return "org/librecms/ui/documents/relatedinfo-create-internallink.xhtml"; + return "org/librecms/ui/contentsection/documents/relatedinfo-create-internallink.xhtml"; } else { return documentUi.showAccessDenied( getContentSection(), @@ -1380,7 +1380,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { ); if (!itemResult.isPresent()) { models.put("targetItemUuid", targetItemUuid); - return "org/librecms/ui/documents/target-item-not-found.xhtml"; + return "org/librecms/ui/contentsection/documents/target-item-not-found.xhtml"; } final RelatedLink relatedLink = new RelatedLink(); @@ -1461,14 +1461,14 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { models.put("contentItem", getDocumentPath()); models.put("listIdentifier", listIdentifierParam); models.put("internalLinkUuid", internalLinkUuid); - return "org/librecms/ui/documents/internal-link-asset-not-found.xhtml"; + return "org/librecms/ui/contentsection/documents/internal-link-asset-not-found.xhtml"; } final RelatedLink link = linkResult.get(); internalLinkDetailsModel.setListIdentifier(list.getName()); internalLinkDetailsModel.setInternalLink(link); - return "org/librecms/ui/documents/relatedinfo-internallink-details.xhtml"; + return "org/librecms/ui/contentsection/documents/relatedinfo-internallink-details.xhtml"; } else { return documentUi.showAccessDenied( getContentSection(), @@ -1531,7 +1531,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { ); if (!itemResult.isPresent()) { models.put("targetItemUuid", targetItemUuid); - return "org/librecms/ui/documents/target-item-not-found.xhtml"; + return "org/librecms/ui/contentsection/documents/target-item-not-found.xhtml"; } final Optional linkResult = list @@ -1547,7 +1547,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { models.put("contentItem", getDocumentPath()); models.put("listIdentifier", listIdentifierParam); models.put("internalLinkUuid", internalLinkUuid); - return "org/librecms/ui/documents/internal-link-asset-not-found.xhtml"; + return "org/librecms/ui/contentsection/documents/internal-link-asset-not-found.xhtml"; } final RelatedLink link = linkResult.get(); @@ -1629,7 +1629,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { models.put("contentItem", getDocumentPath()); models.put("listIdentifierParam", listIdentifierParam); models.put("internalLinkUuid", internalLinkUuid); - return "org/librecms/ui/documents/internal-link-asset-not-found.xhtml"; + return "org/librecms/ui/contentsection/documents/internal-link-asset-not-found.xhtml"; } final RelatedLink link = linkResult.get(); @@ -1712,7 +1712,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { models.put("contentItem", getDocumentPath()); models.put("listIdentifierParam", listIdentifierParam); models.put("internalLinkUuid", internalLinkUuid); - return "org/librecms/ui/documents/internal-link-asset-not-found.xhtml"; + return "org/librecms/ui/contentsection/documents/internal-link-asset-not-found.xhtml"; } final RelatedLink link = linkResult.get(); @@ -1793,7 +1793,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { models.put("contentItem", getDocumentPath()); models.put("listIdentifierParam", listIdentifierParam); models.put("internalLinkUuid", internalLinkUuid); - return "org/librecms/ui/documents/internal-link-asset-not-found.xhtml"; + return "org/librecms/ui/contentsection/documents/internal-link-asset-not-found.xhtml"; } final RelatedLink link = linkResult.get(); @@ -2185,7 +2185,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { private String showAttachmentListNotFound(final String listIdentifier) { models.put("contentItem", getDocumentPath()); models.put("listIdentifier", listIdentifier); - return "org/librecms/ui/documents/attachmentlist-not-found.xhtml"; + return "org/librecms/ui/contentsection/documents/attachmentlist-not-found.xhtml"; } private AttachmentListDto buildAttachmentListDto( diff --git a/ccm-cms/src/main/resources/WEB-INF/views/org/librecms/ui/contentsection/documents/relatedinfo.xhtml b/ccm-cms/src/main/resources/WEB-INF/views/org/librecms/ui/contentsection/documents/relatedinfo.xhtml index 8f2dc82fe..37b274494 100644 --- a/ccm-cms/src/main/resources/WEB-INF/views/org/librecms/ui/contentsection/documents/relatedinfo.xhtml +++ b/ccm-cms/src/main/resources/WEB-INF/views/org/librecms/ui/contentsection/documents/relatedinfo.xhtml @@ -4,32 +4,30 @@ xmlns:c="http://xmlns.jcp.org/jsp/jstl/core" xmlns:libreccm="http://xmlns.jcp.org/jsf/composite/components/libreccm" xmlns:ui="http://xmlns.jcp.org/jsf/facelets"> - - - - - - - - - +
+