Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #204 from qld-gov-au/QOL-7811-ckan-2.9-routing
Browse files Browse the repository at this point in the history
QOL-7811 update more routes to handle Flask
  • Loading branch information
ThrawnCA authored Mar 2, 2022
2 parents fa6ea73 + 8ea9ca0 commit ecfbf41
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 15 deletions.
11 changes: 11 additions & 0 deletions .docker/scripts/create-test-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ curl -LsH "Authorization: ${API_KEY}" \
--data "title=Test Request&description=This is an example&organization_id=${TEST_ORG_ID}" \
${CKAN_ACTION_URL}/create_datarequest

##
# END.
#

##
# BEGIN: Create a Reporting organisation with test users
#

REPORT_ORG_NAME=reporting
REPORT_ORG_TITLE=Reporting

Expand Down Expand Up @@ -184,6 +192,9 @@ curl -LsH "Authorization: ${API_KEY}" \
--data "title=Reporting Request&description=Data Request for reporting&organization_id=${REPORT_ORG_ID}" \
${CKAN_ACTION_URL}/create_datarequest

##
# END.
#

echo "Creating config value for resource formats:"

Expand Down
1 change: 1 addition & 0 deletions .docker/scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if [ "$VENV_DIR" != "" ]; then
fi
CLICK_ARGS="--yes" ckan_cli db clean
ckan_cli db init
ckan_cli db upgrade

# Initialise validation tables
PASTER_PLUGIN=ckanext-validation ckan_cli validation init-db
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ckanext-data-qld-theme
======================
# ckanext-data-qld-theme
A custom CKAN extension for Data.Qld

[![CircleCI](https://circleci.com/gh/qld-gov-au/ckanext-data-qld-theme/tree/develop.svg?style=shield)](https://circleci.com/gh/qld-gov-au/ckanext-data-qld-theme/tree/develop)
Expand Down
4 changes: 2 additions & 2 deletions ckanext/data_qld_theme/templates/datarequests/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
{% endblock %}

{% block content_primary_nav %}
{{ h.build_nav_icon('show_datarequest', _('Data request'), id=datarequest_id) }}
{{ h.build_nav_icon('datarequest.show', _('Data request'), id=datarequest_id) }}

{% if h.show_comments_tab() and h.ytp_comments_enabled() %}
{{ h.build_nav_icon('comment_datarequest', _('Comments') + ' ' + h.get_content_type_comments_badge(datarequest_id, 'datarequest'), id=datarequest_id) }}
{{ h.build_nav_icon('datarequest.comment', _('Comments') + ' ' + h.get_content_type_comments_badge(datarequest_id, 'datarequest'), id=datarequest_id) }}
{% endif %}
{% endblock %}
7 changes: 6 additions & 1 deletion ckanext/data_qld_theme/templates/scheming/package/read.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{% ckan_extends %}

{% block breadcrumb_content %}
{% set route_name = 'organization_read' %}
{% if h.ckan_version() > '2.9' %}
{% set route_name = h.map_pylons_to_flask_route_name(route_name) %}
{% endif %}
<li>{% link_for _('Organizations'), named_route='organization.index' %}</li>
<li>{% link_for pkg.organization.title, named_route='organization_read', id=pkg.organization.name %}</li>
<li>{% link_for pkg.organization.title, named_route=route_name, id=pkg.organization.name %}</li>

<li class="active"><a href="{{ h.url_for('dataset_read', id=pkg.name) }}">{{ pkg.title }}</a></li>
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion test/features/config.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@config
Feature: Config

Scenario: Assert that configuration values are available
Scenario: Assert that CSS configuration values are removed
Given "SysAdmin" as the persona
When I log in
And I visit "ckan-admin/config"
Expand Down
6 changes: 3 additions & 3 deletions test/features/dataset_deletion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ Feature: Dataset deletion
Then I press the element with xpath "//a[@data-module='confirm-action']"
And I wait for 5 seconds
Then I should see "Briefly describe the reason for deleting this dataset"
Then I should see an element with xpath "//div[@class='modal-footer']//button[@class='btn btn-primary' and @disabled='disabled']"
When I type "it should be longer than 10 character" to "deletion_reason"
And I should see an element with xpath "//div[@class='modal-footer']//button[@class='btn btn-primary' and @disabled='disabled']"
When I type "it should be longer than 10 characters" to "deletion_reason"
Then I should not see an element with xpath "//div[@class='modal-footer']//button[@class='btn btn-primary' and @disabled='disabled']"
Then I press the element with xpath "//div[@class='modal-footer']//button[@class='btn btn-primary']"
And I wait for 10 seconds
And I wait for 5 seconds
Then I should see "Dataset has been deleted"
And I should not see "Dataset deletion"
When I go to "/ckan-admin/trash"
Expand Down
26 changes: 20 additions & 6 deletions test/features/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ def go_to_organisation_page(context):
when_i_visit_url(context, '/organization')


@step(u'I set persona var "{key}" to "{value}"')
def set_persona_var(context, key, value):
context.persona[key] = value


@step(u'I log in and go to the data requests page')
def log_in_go_to_datarequest_page(context):
assert context.persona
Expand Down Expand Up @@ -155,11 +160,6 @@ def go_to_data_request_comments(context, subject):
""" % (subject))


@step(u'I set persona var "{key}" to "{value}"')
def set_persona_var(context, key, value):
context.persona[key] = value


@step(u'I submit a comment with subject "{subject}" and comment "{comment}"')
def submit_comment_with_subject_and_comment(context, subject, comment):
"""
Expand Down Expand Up @@ -219,7 +219,7 @@ def create_dataset(context, license, file_format, file):


# The default behaving step does not convert base64 emails
# Modifed the default step to decode the payload from base64
# Modified the default step to decode the payload from base64
@step(u'I should receive a base64 email at "{address}" containing "{text}"')
def should_receive_base64_email_containing_text(context, address, text):
def filter_contents(mail):
Expand All @@ -234,3 +234,17 @@ def filter_contents(mail):
return text in decoded_payload

assert context.mail.user_messages(address, filter_contents)


@step('I log in and go to admin config page')
def log_in_go_to_admin_config(context):
assert context.persona
context.execute_steps(u"""
When I log in
And I go to admin config page
""")


@step('I go to admin config page')
def go_to_admin_config(context):
when_i_visit_url(context, '/ckan-admin/config')

0 comments on commit ecfbf41

Please sign in to comment.