From cd087d9d90310ef6bf49e689190b3c3bd1f5d554 Mon Sep 17 00:00:00 2001 From: bmotevalli Date: Thu, 6 Jun 2024 10:23:11 +0800 Subject: [PATCH 1/8] auscope_theme: enforcing lower case email. --- .../ckanext/auscope_theme/logic/action.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/logic/action.py b/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/logic/action.py index d78b2b49..19e604e8 100644 --- a/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/logic/action.py +++ b/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/logic/action.py @@ -83,6 +83,8 @@ def package_search(next_action, context, data_dict): @tk.chained_action def user_create(next_action, context, data_dict): + email = data_dict.get('email', '').lower() + data_dict['email'] = email user = ckan_user_create(context, data_dict) # TODO: get from config org_name = 'auscope' @@ -106,9 +108,17 @@ def user_create(next_action, context, data_dict): return user +@tk.chained_action +def user_invite(next_action, context, data_dict): + email = data_dict.get('email', '').lower() + data_dict['email'] = email + return next_action(context, data_dict) + + def get_actions(): return { 'user_create': user_create, + 'user_invite': user_invite, 'auscope_theme_get_sum': auscope_theme_get_sum, 'organization_list_for_user': organization_list_for_user, 'package_create': package_create, From da3a56bedddf5ef9652a6be8e1b2b638eb48ff44 Mon Sep 17 00:00:00 2001 From: bmotevalli Date: Thu, 6 Jun 2024 17:58:34 +0800 Subject: [PATCH 2/8] CI/CD pipeline: adding appName as additional tag for PROD releases. --- .github/workflows/release-tag-based.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-tag-based.yml b/.github/workflows/release-tag-based.yml index db00fdb8..bb6d75c2 100644 --- a/.github/workflows/release-tag-based.yml +++ b/.github/workflows/release-tag-based.yml @@ -7,6 +7,10 @@ on: description: 'Release Type (patch/minor/major)' required: true default: 'patch' + appName: + description: 'Application Name (data/sample)' + required: true + default: 'data' branches: - master - release/* @@ -104,8 +108,8 @@ jobs: - name: Pull 'latest' Docker image run: docker pull ghcr.io/auscope/auscope-ckan:latest - - name: Tag Docker image with new version - run: docker tag ghcr.io/auscope/auscope-ckan:latest ghcr.io/auscope/auscope-ckan:${{ needs.prepare-release.outputs.new-version }} + - name: Tag Docker image with new version and AppName + run: docker tag ghcr.io/auscope/auscope-ckan:latest ghcr.io/auscope/auscope-ckan:${{ github.event.inputs.AppName }}-${{ needs.prepare-release.outputs.new-version }} - name: Push Docker image with new version - run: docker push ghcr.io/auscope/auscope-ckan:${{ needs.prepare-release.outputs.new-version }} + run: docker push ghcr.io/auscope/auscope-ckan:${{ github.event.inputs.AppName }}-${{ needs.prepare-release.outputs.new-version }} From 02435cc05f85526bacaf62a3608162eb41e96db4 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 6 Jun 2024 10:05:52 +0000 Subject: [PATCH 3/8] =?UTF-8?q?Bump=20version:=200.2.3=20=E2=86=92=200.2.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ckan/setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckan/setup.cfg b/ckan/setup.cfg index 7cf00bb5..653b0c73 100644 --- a/ckan/setup.cfg +++ b/ckan/setup.cfg @@ -1,4 +1,4 @@ [bumpversion] -current_version = 0.2.3 +current_version = 0.2.4 commit = True tag = True From 0751f537126e3ae3dc916a7fcfa8fe6ed9146b1b Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 6 Jun 2024 10:23:37 +0000 Subject: [PATCH 4/8] =?UTF-8?q?Bump=20version:=200.2.4=20=E2=86=92=200.2.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ckan/setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckan/setup.cfg b/ckan/setup.cfg index 653b0c73..0deccad2 100644 --- a/ckan/setup.cfg +++ b/ckan/setup.cfg @@ -1,4 +1,4 @@ [bumpversion] -current_version = 0.2.4 +current_version = 0.2.5 commit = True tag = True From c08afb1eee0103a21a13b40947de55ac21e512a4 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 6 Jun 2024 22:55:58 +0000 Subject: [PATCH 5/8] =?UTF-8?q?Bump=20version:=200.2.5=20=E2=86=92=200.2.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ckan/setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckan/setup.cfg b/ckan/setup.cfg index 0deccad2..b5c93f3c 100644 --- a/ckan/setup.cfg +++ b/ckan/setup.cfg @@ -1,4 +1,4 @@ [bumpversion] -current_version = 0.2.5 +current_version = 0.2.6 commit = True tag = True From 8668c87ba6246eca4baa0711f9af1d6d1dab8478 Mon Sep 17 00:00:00 2001 From: Neda Taherifar Date: Mon, 10 Jun 2024 11:19:07 +0800 Subject: [PATCH 6/8] Fixing help text contain incorrect url form - Author Identifier field and Project Identifier --- .../ckanext/auscope_theme/data_repository_schema.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/data_repository_schema.yaml b/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/data_repository_schema.yaml index 05fcd64e..aad5ee10 100644 --- a/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/data_repository_schema.yaml +++ b/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/data_repository_schema.yaml @@ -107,7 +107,7 @@ dataset_fields: - field_name: author_identifier label: Author Identifier display_snippet: URL - help_text: Uniquely identifies an individual or legal entity, according to identifier schemes. Please specify the absolute URL, e.g. https://://orcid.org/0000-0003-0870-3192 + help_text: Uniquely identifies an individual or legal entity, according to identifier schemes. Please specify the absolute URL, e.g. https://orcid.org/0000-0003-0870-3192 - field_name: author_email label: Author Email @@ -306,7 +306,7 @@ dataset_fields: - field_name: project_identifier label: Project Identifier display_snippet: URL - help_text: The code assigned by the funder to a sponsored grant or project of the dataset. Please specify the absolute URL, e.g. https://://dataportal.arc.gov.au/NCGP/Web/Grant/Grant/IM240100006 + help_text: The code assigned by the funder to a sponsored grant or project of the dataset. Please specify the absolute URL, e.g. https://dataportal.arc.gov.au/NCGP/Web/Grant/Grant/IM240100006 - field_name: project_name label: Project Name From df1e88e6aabe65ba60fc5cef65fc3d055d18fc42 Mon Sep 17 00:00:00 2001 From: Stuart Woodman Date: Tue, 11 Jun 2024 09:48:07 +1000 Subject: [PATCH 7/8] Removed hard-coded org ID from org_visibility validator --- .../templates/scheming/form_snippets/org_visibility.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/templates/scheming/form_snippets/org_visibility.html b/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/templates/scheming/form_snippets/org_visibility.html index ae025c32..de265dce 100644 --- a/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/templates/scheming/form_snippets/org_visibility.html +++ b/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/templates/scheming/form_snippets/org_visibility.html @@ -22,7 +22,7 @@ {% block package_metadata_fields_visibility %} From e8659a21d379083d9e7d2f0e26b725fcc3949678 Mon Sep 17 00:00:00 2001 From: Neda Taherifar Date: Tue, 11 Jun 2024 14:58:50 +0800 Subject: [PATCH 8/8] Fix bug: Displaying unclickable URL link in help_text --- .../auscope_theme/data_repository_schema.yaml | 14 +++++++++----- ckan/src/shared/public/shared_style.css | 9 ++++++++- .../subfield_snippets/composite_help_text.html | 16 ++++++++++++++++ 3 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 ckan/src/shared/templates/scheming/form_snippets/subfield_snippets/composite_help_text.html diff --git a/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/data_repository_schema.yaml b/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/data_repository_schema.yaml index aad5ee10..96994c10 100644 --- a/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/data_repository_schema.yaml +++ b/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/data_repository_schema.yaml @@ -63,7 +63,8 @@ dataset_fields: label: Author Affiliation Identifier required: true display_snippet: None - help_text: The persistent identifier of the affiliated entity. Please specify the absolute URL, e.g. https://ror.org/03qn8fb07 + help_text: "The persistent identifier of the affiliated entity. Please specify the absolute URL, e.g. https://ror.org/03qn8fb07" + help_allow_html: true - field_name: author_affiliation_identifier_type label: Author Affiliation Identifier Type @@ -107,8 +108,9 @@ dataset_fields: - field_name: author_identifier label: Author Identifier display_snippet: URL - help_text: Uniquely identifies an individual or legal entity, according to identifier schemes. Please specify the absolute URL, e.g. https://orcid.org/0000-0003-0870-3192 - + help_text: "Uniquely identifies an individual or legal entity, according to identifier schemes. Please specify the absolute URL, e.g. https://orcid.org/0000-0003-0870-3192" + help_allow_html: true + - field_name: author_email label: Author Email required: true @@ -279,7 +281,8 @@ dataset_fields: - field_name: funder_identifier label: Funder Identifier display_snippet: URL - help_text: 'Unique identifier of the funding entity. Please specify the absolute URL, e.g. http://dx.doi.org/10.13039/501100000923' + help_text: "Unique identifier of the funding entity. Please specify the absolute URL, e.g. http://dx.doi.org/10.13039/501100000923 " + help_allow_html: true - field_name: funder_identifier_type label: Funder Identifier Scheme @@ -306,7 +309,8 @@ dataset_fields: - field_name: project_identifier label: Project Identifier display_snippet: URL - help_text: The code assigned by the funder to a sponsored grant or project of the dataset. Please specify the absolute URL, e.g. https://dataportal.arc.gov.au/NCGP/Web/Grant/Grant/IM240100006 + help_text: "The code assigned by the funder to a sponsored grant or project of the dataset. Please specify the absolute URL, e.g. https://dataportal.arc.gov.au/NCGP/Web/Grant/Grant/IM240100006" + help_allow_html: true - field_name: project_name label: Project Name diff --git a/ckan/src/shared/public/shared_style.css b/ckan/src/shared/public/shared_style.css index 542c0c95..31efcb4c 100644 --- a/ckan/src/shared/public/shared_style.css +++ b/ckan/src/shared/public/shared_style.css @@ -810,4 +810,11 @@ body { height: 32.5px; margin: -14px 0 0 -14px; font: normal; -} \ No newline at end of file +} + +.form-group .info-block code { + font-size: 0.875em; + color: #6e6e6e; + word-wrap: break-word; +} + diff --git a/ckan/src/shared/templates/scheming/form_snippets/subfield_snippets/composite_help_text.html b/ckan/src/shared/templates/scheming/form_snippets/subfield_snippets/composite_help_text.html new file mode 100644 index 00000000..c765c6c7 --- /dev/null +++ b/ckan/src/shared/templates/scheming/form_snippets/subfield_snippets/composite_help_text.html @@ -0,0 +1,16 @@ +{% macro envidat_info(text='', inline=false, classes=[]) %} + {%- if text -%} +
+ + {{ text|safe if field.get('help_allow_html', false) else text|e }} +
+ {%- endif -%} +{% endmacro %} + +{%- if field.help_text -%} + {%- set text = h.scheming_language_text(field.help_text) %} + {{- envidat_info( + text=text, + inline=field.get('help_inline', false), classes=["composite-subfield-info"] + ) -}} +{%- endif -%}