From 4f0a2603b77c602b48f8258b34d956711b058dd0 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Wed, 9 Apr 2025 19:26:28 -0400 Subject: [PATCH 1/2] FOUR-23805 --- .../settings/components/ModalWhiteList.vue | 25 ++++++++++++++++--- resources/lang/en.json | 2 ++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/resources/js/admin/settings/components/ModalWhiteList.vue b/resources/js/admin/settings/components/ModalWhiteList.vue index 889585520d..6efcb3aa78 100644 --- a/resources/js/admin/settings/components/ModalWhiteList.vue +++ b/resources/js/admin/settings/components/ModalWhiteList.vue @@ -6,10 +6,10 @@ >
@@ -31,16 +31,19 @@
+
+ {{ urlError }} +
@@ -68,6 +71,7 @@ export default { stateURL: null, groupName: "", group_id: 3, + urlError: "", }; }, methods: { @@ -79,6 +83,11 @@ export default { clear() { this.siteName = ""; this.url = ""; + this.urlError = ""; + }, + validateURL(url) { + const pattern = /^(https?:\/\/)?(\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(:\d+)?(\/.*)?$/; + return pattern.test(url); }, addWhiteListURL() { if (!this.siteName) { @@ -89,6 +98,14 @@ export default { this.stateURL = false; return; } + // Validate the URL using the regex pattern + if (!this.validateURL(this.url)) { + this.stateURL = false; + this.urlError = __("Please enter a valid URL."); + return; + } else { + this.urlError = ""; + } const site = this.siteName.toLocaleLowerCase().trim().replaceAll(" ", "_"); const data = { key: `white_list.${site}`, diff --git a/resources/lang/en.json b/resources/lang/en.json index 01be7b7ec0..95ae00ab3d 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -444,6 +444,7 @@ "Configure Script": "Configure Script", "Configure Template": "Configure Template", "Configure the authenticator app": "Configure the authenticator app", + "Configure URL Parents for Embedding": "Configure URL Parents for Embedding", "Configure": "Configure", "Confirm and Save": "Confirm and Save", "Confirm New Password": "Confirm New Password", @@ -1549,6 +1550,7 @@ "Please choose the tasks in your inbox that this new rule should apply to. Use the column filters to achieve this.": "Please choose the tasks in your inbox that this new rule should apply to. Use the column filters to achieve this.", "Please contact your administrator to get started.": "Please contact your administrator to get started.", "Please enter Tab Name": "Please enter Tab Name", + "Please provide a valid URL (e.g., https://example.com ) to specify the allowed origin(s) permitted to embed ProcessMaker.": "Please provide a valid URL (e.g., https://example.com ) to specify the allowed origin(s) permitted to embed ProcessMaker.", "Please log in to continue your work on this page.": "Please log in to continue your work on this page.", "Please select a Saved Search": "Please select a Saved Search", "Please take a look at it in the 'Rules' section located within your Inbox.": "Please take a look at it in the 'Rules' section located within your Inbox.", From 83d55966d5f43f5b36603f81e4c9dd9c5269b263 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Thu, 10 Apr 2025 10:15:05 -0400 Subject: [PATCH 2/2] solvin obs about remove the else --- resources/js/admin/settings/components/ModalWhiteList.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/js/admin/settings/components/ModalWhiteList.vue b/resources/js/admin/settings/components/ModalWhiteList.vue index 6efcb3aa78..96e7f54688 100644 --- a/resources/js/admin/settings/components/ModalWhiteList.vue +++ b/resources/js/admin/settings/components/ModalWhiteList.vue @@ -103,8 +103,6 @@ export default { this.stateURL = false; this.urlError = __("Please enter a valid URL."); return; - } else { - this.urlError = ""; } const site = this.siteName.toLocaleLowerCase().trim().replaceAll(" ", "_"); const data = {