Skip to content

Commit

Permalink
Merge pull request #101 from qld-gov-au/develop
Browse files Browse the repository at this point in the history
Develop to master - fix organisation activity stream for CKAN 2.10
  • Loading branch information
ThrawnCA committed Feb 1, 2024
2 parents 8bd5bd1 + 945cb09 commit b10a8d4
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 5 deletions.
8 changes: 5 additions & 3 deletions .ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ commands:

logs:
usage: Show Docker logs.
cmd: sh bin/docker-compose.sh logs "$@"
cmd: |
ahoy title "Output logs"
sh bin/docker-compose.sh logs "$@"
pull:
usage: Pull latest docker images.
Expand Down Expand Up @@ -126,7 +128,7 @@ commands:
cmd: |
docker cp . $(sh bin/docker-compose.sh ps -q ckan):/srv/app/
docker cp bin/ckan_cli $(sh bin/docker-compose.sh ps -q ckan):/usr/bin/
ahoy cli 'chmod -v u+x /usr/bin/ckan_cli $APP_DIR/bin/*; cp -v .docker/test.ini $CKAN_INI'
ahoy cli 'chmod -v u+x /usr/bin/ckan_cli $APP_DIR/bin/*; cp -v .docker/test.ini $CKAN_INI; $APP_DIR/bin/process-config.sh'
test-unit:
usage: Run unit tests.
Expand All @@ -142,7 +144,7 @@ commands:
ahoy cli "rm -f test/screenshots/*"
ahoy start-ckan-job-worker
ahoy start-mailmock &
sleep 5 &&
sleep 5
if [ "$BEHAVE_TAG" = "" ]; then
(ahoy cli "behave -k ${*:-test/features} --tags=smoke" \
&& ahoy cli "behave -k ${*:-test/features} --tags=-smoke" \
Expand Down
1 change: 1 addition & 0 deletions bin/init-ext.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ installed_name=$(grep '^\s*name=' setup.py |sed "s|[^']*'\([-a-zA-Z0-9]*\)'.*|\1
# Validate that the extension was installed correctly.
if ! pip list | grep "$installed_name" > /dev/null; then echo "Unable to find the extension in the list"; exit 1; fi

. $APP_DIR/bin/process-config.sh
. ${APP_DIR}/bin/deactivate
4 changes: 4 additions & 0 deletions bin/process-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if [ -d "$SRC_DIR/ckan/ckanext/activity" ]; then
sed -i 's|^ckan.plugins =|ckan.plugins = activity|' $CKAN_INI .docker/test*.ini
fi

3 changes: 2 additions & 1 deletion ckanext/datarequests/templates/organization/read_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

{% block content_primary_nav %}
{{ super() }}
{{ h.build_nav_icon('datarequest.organization', _('Data Requests'), id=c.group_dict.name, icon=h.get_question_icon())}}
{% set group_dict = group_dict or c.group_dict %}
{{ h.build_nav_icon('datarequest.organization', _('Data Requests'), id=group_dict.name, icon=h.get_question_icon())}}
{% endblock %}
2 changes: 1 addition & 1 deletion test/features/datarequest_circumstances.feature
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Feature: Datarequest-circumstances
And I wait for 1 seconds
And I take a debugging screenshot
# Have to use JS to change the selected value as the behaving framework does not work with autocomplete dropdown
Then I execute the script "$('#field-accepted_dataset_id').val($('#field-accepted_dataset_id option:eq(1)').attr('value'))"
And I execute the script "$('#field-accepted_dataset_id').val($('#field-accepted_dataset_id option:eq(1)').attr('value'))"
And I press the element with xpath "//button[contains(@class, 'btn-danger') and @name='close' and contains(string(), 'Close Data Request')]"
Then I should see "Accepted dataset" within 1 seconds
And I should see "A Wonderful Story" within 1 seconds
Expand Down
17 changes: 17 additions & 0 deletions test/features/organisations.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@users
Feature: Organization APIs

@unauthenticated
Scenario: Organisation overview is accessible to everyone
Given "Unauthenticated" as the persona
When I go to organisation page
Then I should see "Test Organisation"
And I should not see an element with xpath "//a[contains(@href, '?action=read')]"
And I should see an element with xpath "//a[contains(@href, '/organization/test-organisation')]"
When I press "Test Organisation"
And I press "Activity Stream"
Then I should see "created the organization"

When I view the "test-organisation" organisation API "not including" users
Then I should see an element with xpath "//*[contains(string(), '"success": true') and contains(string(), '"name": "test-organisation"')]"

0 comments on commit b10a8d4

Please sign in to comment.