From 8664a7f602054b4787574f7113e14e9a44eee14a Mon Sep 17 00:00:00 2001 From: Liam Lynch Date: Fri, 13 Sep 2024 11:29:27 +0200 Subject: [PATCH 1/4] use a preset for excel encryption password [180306] --- .../recipe.json | 13 ++++++------- .../send-mails-from-contacts-dataset/recipe.py | 5 ++++- .../file-encryption/parameter-set.json | 17 +++++++++++++++++ 3 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 parameter-sets/file-encryption/parameter-set.json diff --git a/custom-recipes/send-mails-from-contacts-dataset/recipe.json b/custom-recipes/send-mails-from-contacts-dataset/recipe.json index 91534aa..6295e20 100644 --- a/custom-recipes/send-mails-from-contacts-dataset/recipe.json +++ b/custom-recipes/send-mails-from-contacts-dataset/recipe.json @@ -34,7 +34,6 @@ "label": "Mail Settings", "type": "SEPARATOR" }, - { "name": "mail_channel", "label" : "Channel", @@ -203,13 +202,13 @@ "getChoicesFromPython": true, "description" : "File format for attachments" }, - { - "name": "encryption_password_excel", - "label" : "Encryption password", - "type": "PASSWORD", - "description" : "(Optional) Password to encrypt excel files, requires DSS 13.0 or above", - "visibilityCondition" : "model.attachment_type == 'excel_can_ac'" + "name": "encryption_password_excel_params", + "label": "Encryption password", + "type": "PRESET", + "parameterSetId": "file-encryption", + "description" : "(Optional) Password to encrypt excel files, requires DSS 13.0 or above.", + "visibilityCondition" : "model.attachment_type == 'excel_can_ac'" }, { diff --git a/custom-recipes/send-mails-from-contacts-dataset/recipe.py b/custom-recipes/send-mails-from-contacts-dataset/recipe.py index eaceb9d..34b188e 100644 --- a/custom-recipes/send-mails-from-contacts-dataset/recipe.py +++ b/custom-recipes/send-mails-from-contacts-dataset/recipe.py @@ -73,7 +73,10 @@ def does_channel_have_sender(channel_id): channel_has_sender = does_channel_have_sender(mail_channel) attachment_type = config.get('attachment_type', "send_no_attachments") -encryption_password_excel = config.get('encryption_password_excel', None) +encryption_password_excel_params = config.get('encryption_password_excel_params', None) +encryption_password_excel = None +if encryption_password_excel_params: + encryption_password_excel = encryption_password_excel_params.get("password", None) # Validation part 1 - Check some kind of value/column exists for body, subject, sender and recipient diff --git a/parameter-sets/file-encryption/parameter-set.json b/parameter-sets/file-encryption/parameter-set.json new file mode 100644 index 0000000..3e40222 --- /dev/null +++ b/parameter-sets/file-encryption/parameter-set.json @@ -0,0 +1,17 @@ +{ + "meta" : { + "label": "Encryption password", + "description": "Encryption password for attachment files", + "icon": "icon-pi-system icon-cogs" + }, + "defaultDefinableInline": false, + "defaultDefinableAtProjectLevel": false, + "params": [ + { + "name": "password", + "label": "File encryption Password", + "type": "PASSWORD", + "description": "Password to encrypt attachment files. CAUTION: the password entered here is only stored encrypted when defined in a preset." + } + ] +} From 8efbaed8d11a66226346039a1bd995bb235da225 Mon Sep 17 00:00:00 2001 From: Liam Lynch Date: Fri, 13 Sep 2024 11:32:38 +0200 Subject: [PATCH 2/4] remove blank line changes --- custom-recipes/send-mails-from-contacts-dataset/recipe.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom-recipes/send-mails-from-contacts-dataset/recipe.json b/custom-recipes/send-mails-from-contacts-dataset/recipe.json index 6295e20..2316ec7 100644 --- a/custom-recipes/send-mails-from-contacts-dataset/recipe.json +++ b/custom-recipes/send-mails-from-contacts-dataset/recipe.json @@ -34,6 +34,7 @@ "label": "Mail Settings", "type": "SEPARATOR" }, + { "name": "mail_channel", "label" : "Channel", @@ -202,6 +203,7 @@ "getChoicesFromPython": true, "description" : "File format for attachments" }, + { "name": "encryption_password_excel_params", "label": "Encryption password", From 3753a0a7bd96dbee6dfddc4753bdf3e9ffb9a601 Mon Sep 17 00:00:00 2001 From: Liam Lynch Date: Fri, 13 Sep 2024 11:52:04 +0200 Subject: [PATCH 3/4] change version in excel password field desc --- custom-recipes/send-mails-from-contacts-dataset/recipe.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom-recipes/send-mails-from-contacts-dataset/recipe.json b/custom-recipes/send-mails-from-contacts-dataset/recipe.json index 2316ec7..c4ff6ce 100644 --- a/custom-recipes/send-mails-from-contacts-dataset/recipe.json +++ b/custom-recipes/send-mails-from-contacts-dataset/recipe.json @@ -203,13 +203,13 @@ "getChoicesFromPython": true, "description" : "File format for attachments" }, - + { "name": "encryption_password_excel_params", "label": "Encryption password", "type": "PRESET", "parameterSetId": "file-encryption", - "description" : "(Optional) Password to encrypt excel files, requires DSS 13.0 or above.", + "description" : "(Optional) Password to encrypt excel files, requires DSS 13.2 or above.", "visibilityCondition" : "model.attachment_type == 'excel_can_ac'" }, From 228169f599833b50d02ceee362420912e63edcc7 Mon Sep 17 00:00:00 2001 From: Liam Lynch Date: Fri, 13 Sep 2024 11:53:15 +0200 Subject: [PATCH 4/4] Password -> password in label --- parameter-sets/file-encryption/parameter-set.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parameter-sets/file-encryption/parameter-set.json b/parameter-sets/file-encryption/parameter-set.json index 3e40222..a351568 100644 --- a/parameter-sets/file-encryption/parameter-set.json +++ b/parameter-sets/file-encryption/parameter-set.json @@ -9,7 +9,7 @@ "params": [ { "name": "password", - "label": "File encryption Password", + "label": "File encryption password", "type": "PASSWORD", "description": "Password to encrypt attachment files. CAUTION: the password entered here is only stored encrypted when defined in a preset." }