diff --git a/force-app/cmsUtilities/cmsEdition/lwc/sfpegCmsPageEditor/sfpegCmsPageEditor.html b/force-app/cmsUtilities/cmsEdition/lwc/sfpegCmsPageEditor/sfpegCmsPageEditor.html
index 8d9df2a..3681b8a 100644
--- a/force-app/cmsUtilities/cmsEdition/lwc/sfpegCmsPageEditor/sfpegCmsPageEditor.html
+++ b/force-app/cmsUtilities/cmsEdition/lwc/sfpegCmsPageEditor/sfpegCmsPageEditor.html
@@ -241,7 +241,27 @@
-
+
+
+
+
+
+
@@ -268,6 +288,16 @@
onclick={handleMoveLinkUp} >
+
+
+
+
item.label == event.target.value);
+ console.log("handleEditLink: linkIndex found ",linkIndex);
+ this.isEditLinkModalOpen = !this.isEditLinkModalOpen;
+ console.log("handleEditLink: isEditLinkModalOpen Status: ",this.isEditLinkModalOpen);
+ console.log("handleEditLink: link params: ", JSON.stringify(this.links[linkIndex]));
+ this.selectedLink = {... this.links[linkIndex]};
+ this.selectedLinkIndex = linkIndex;
+ console.log("handleEditLink: END / links update requested");
+ }
handleRemoveLink(event){
console.log("handleRemoveLink: START with link ",event.target.value);
@@ -489,6 +503,42 @@ export default class SfpegCmsPageEditor extends LightningElement {
this.applyChanges();
console.log("handleAddLink: END / Links update requested");
}
+
+ closeEditLinkModal(event){
+ console.log("closeEditLinkModal: START with event",event);
+ this.isEditLinkModalOpen = !this.isEditLinkModalOpen;
+ console.log("closeEditLinkModal: isEditLinkModalOpen",this.isEditLinkModalOpen);
+ console.log("closeEditLinkModal: END ");
+ }
+
+ handleUpdateLink(event){
+ console.log("handleUpdateLink: START with event",event);
+ event.preventDefault();
+ console.log("handleUpdateLink: current links ",JSON.stringify(this.links));
+ let linkIndex = this.selectedLinkIndex;
+ console.log("handleUpdateLink: linkIndex: ",linkIndex);
+ let labelInput = this.refs.editModalLabel;
+ let titleInput = this.refs.editModalTitle;
+ let urlInput = this.refs.editModalURL;
+ // Sanity check: Guard against refs not being available
+ if (!labelInput || !titleInput || !urlInput) {
+ console.error('handleUpdateLink: Edit link Modal input references are not available.');
+ this.isEditLinkModalOpen = !this.isEditLinkModalOpen;
+ return;
+ }
+
+ let link2Update = {};
+ link2Update["label"] = labelInput.value;
+ link2Update["title"] = titleInput.value;
+ link2Update["url"] = urlInput.value;
+ link2Update["target"] = (urlInput.value.startsWith('http') ? '_blank' : '_self');
+ console.log("handleUpdateLink: link2Update: ",JSON.stringify(link2Update));
+ this.links[linkIndex] = link2Update;
+ console.log("handleUpdateLink: this.links after update: ",JSON.stringify(this.links));
+ this.applyChanges();
+ this.isEditLinkModalOpen = !this.isEditLinkModalOpen;
+ console.log("handleUpdateLink: END ");
+ }
//------------------------------------------------