diff --git a/.github/workflows/image-tests.yml b/.github/workflows/image-tests.yml index 1239d5ab..bdb258fe 100644 --- a/.github/workflows/image-tests.yml +++ b/.github/workflows/image-tests.yml @@ -50,16 +50,16 @@ jobs: source .env # Launch the database container - docker-compose up -d db + docker compose up -d db # Hacky method of waiting for postgres to be up and running sleep 10 # Allow Django to create databases for the testing - docker-compose exec -T db psql -v ON_ERROR_STOP=1 --username postgres -c 'ALTER USER '"$DB_USERNAME"' CREATEDB;' + docker compose exec -T db psql -v ON_ERROR_STOP=1 --username postgres -c 'ALTER USER '"$DB_USERNAME"' CREATEDB;' # Run the backend tests - docker-compose run --rm --entrypoint npm backend run test:pytest + docker compose run --rm --entrypoint npm backend run test:pytest # Run the frontend tests - docker-compose run --rm --entrypoint npm backend run test:frontend + docker compose run --rm --entrypoint npm backend run test:frontend diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e3ca6cf..6e0129e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,18 @@ docker compose run --rm -it pgbackups /backup.sh (or `docker-compose` if your version of Docker does not support compose v2). +## [2.3.0] 2024-11-04 + +### Added +- Ability to label radio and checkbox options with HTML rather than just plain text ([#412](https://github.com/GateNLP/gate-teamware/pull/412)), allowing customizations like: + - coloured labels + - use of bold and italic within the label + - adding visual spacing between groups of related options + - making clickable links to a knowledge base for entity linking tasks, etc. + +### Fixed +- Upgraded various third-party dependencies ([#413](https://github.com/GateNLP/gate-teamware/pull/413)) + ## [2.2.0] 2024-05-08 ### Changed diff --git a/CITATION.cff b/CITATION.cff index 262b417f..6496aa55 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -78,4 +78,4 @@ repository-code: https://github.com/GateNLP/gate-teamware title: GATE Teamware type: software url: https://gatenlp.github.io/gate-teamware/ -version: 2.2.0 +version: 2.3.0 diff --git a/VERSION b/VERSION index e3a4f193..cc6612c3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.0 \ No newline at end of file +2.3.0 \ No newline at end of file diff --git a/cypress/support/commands.js b/cypress/support/commands.js index aa9212a5..fb6b5054 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -72,10 +72,18 @@ Cypress.Commands.add("logout", () => { //Migrate integration db Cypress.Commands.add("migrate_integration_db", (fixtureName) => { - if (Cypress.env('TESTENV') == 'container') { - cy.exec(`docker-compose exec -T backend ./migrate-integration.sh -n=${fixtureName}`) - } else if (Cypress.env('TESTENV') == 'ci') { - cy.exec(`DJANGO_SETTINGS_MODULE=teamware.settings.deployment docker-compose exec -T backend ./migrate-integration.sh -n=${fixtureName}`) + + const testenv = Cypress.env('TESTENV'); + if (testenv === 'container' || testenv === 'ci') { + // find the right docker compose command + cy.exec("docker compose").then(({code}) => { + const compose = (code === 0 ? 'docker compose' : 'docker-compose') + if (testenv === 'container') { + cy.exec(`${compose} exec -T backend ./migrate-integration.sh -n=${fixtureName}`) + } else if (testenv === 'ci') { + cy.exec(`DJANGO_SETTINGS_MODULE=teamware.settings.deployment ${compose} exec -T backend ./migrate-integration.sh -n=${fixtureName}`) + } + }); } else{ cy.exec(`npm run migrate:integration -- -n=${fixtureName}`, {log:true}) diff --git a/deploy.sh b/deploy.sh index c72704df..ab7e1031 100755 --- a/deploy.sh +++ b/deploy.sh @@ -29,4 +29,18 @@ case $DEPLOY_ENV in ;; esac -docker-compose up -d +# Find a working docker compose +declare -a COMPOSE +if docker compose >/dev/null 2>&1 ; then + # We have compose v2 + COMPOSE[0]="docker" + COMPOSE[1]="compose" +elif which docker-compose > /dev/null 2>&1 ; then + # We have compose v1 + COMPOSE[0]="docker-compose" +else + echo "Could not find 'docker compose' or 'docker-compose'" + exit 1 +fi + +exec "${COMPOSE[@]}" up -d diff --git a/docs/docs/.vuepress/enhanceApp.js b/docs/docs/.vuepress/enhanceApp.js index e7aadadf..318471f2 100644 --- a/docs/docs/.vuepress/enhanceApp.js +++ b/docs/docs/.vuepress/enhanceApp.js @@ -1,7 +1,7 @@ import Vue from 'vue' import {BootstrapVue, BootstrapVueIcons, IconsPlugin} from 'bootstrap-vue' -import 'bootstrap/dist/css/bootstrap.css' +import '@/assets/sass/app.scss' import 'bootstrap-vue/dist/bootstrap-vue.css' Vue.use(BootstrapVue) diff --git a/docs/docs/.vuepress/versions.json b/docs/docs/.vuepress/versions.json index 0623e26d..f6e8dc41 100644 --- a/docs/docs/.vuepress/versions.json +++ b/docs/docs/.vuepress/versions.json @@ -26,6 +26,10 @@ "text": "2.2.0", "value": "/gate-teamware/2.2.0/" }, + { + "text": "2.3.0", + "value": "/gate-teamware/2.3.0/" + }, { "text": "development", "value": "/gate-teamware/development/" diff --git a/docs/docs/manageradminguide/config_examples.js b/docs/docs/manageradminguide/config_examples.js index d6e40454..b5b232ff 100644 --- a/docs/docs/manageradminguide/config_examples.js +++ b/docs/docs/manageradminguide/config_examples.js @@ -145,6 +145,20 @@ export default { "valError": "Error message when field fails is validation" //Optional } ], + configHtmlLabels: [ + { + "name": "sentiment", + "type": "radio", + "title": "Sentiment", + "orientation": "vertical", + "options": [ + {"value": "positive", "htmlLabel": "Positive"}, + {"value": "neutral", "htmlLabel": "Neutral"}, + {"value": "negative", "htmlLabel": "Negative"}, + {"value": "unknown", "htmlLabel": "Cannot be determined"} + ] + }, + ], configSelector: [ { "name": "mylabel", diff --git a/docs/docs/manageradminguide/project_config.md b/docs/docs/manageradminguide/project_config.md index d3d4ea3d..3a098291 100644 --- a/docs/docs/manageradminguide/project_config.md +++ b/docs/docs/manageradminguide/project_config.md @@ -348,6 +348,43 @@ If your documents are plain text and include line breaks that need to be preserv +### Richer labels for radios & checkboxes + +The `label` of radio and checkbox inputs is normally plain text, however both input types support an `htmlLabel` property as an alternative to `label`, which allows for HTML tags within the option label. The `htmlLabel` is rendered within a `` inside the `