diff --git a/.github/ISSUE_TEMPLATE/1-feature-request.yml b/.github/ISSUE_TEMPLATE/1-feature-request.yml new file mode 100644 index 00000000..c473a94b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1-feature-request.yml @@ -0,0 +1,51 @@ +name: Feature request +description: Suggest an idea for this project +title: "[Feature]: " +body: + - type: textarea + id: summary + attributes: + label: General Summary + description: Please provide a general summary of the problem + placeholder: e.g. "The main issue is that..." + validations: + required: true + - type: textarea + id: change + attributes: + label: Suggested Change + description: Provide details on the suggested change + placeholder: e.g. "This new feature will allow users to update..." + validations: + required: true + - type: dropdown + id: breaking + attributes: + label: Is this Breaking? + description: Explain the behavior expected in this case + options: + - "Yes" + - "No" + validations: + required: true + - type: textarea + id: current_behavior + attributes: + label: Current Behavior + description: Explain what the current behavior is + validations: + required: true + - type: textarea + id: new_behavior + attributes: + label: New Behavior + description: Propose what the new behavior would be + validations: + required: true + - type: textarea + id: description + attributes: + label: Detailed Description + description: Please provide a more detailed description + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/2-bug-report.yml b/.github/ISSUE_TEMPLATE/2-bug-report.yml new file mode 100644 index 00000000..39e45073 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2-bug-report.yml @@ -0,0 +1,58 @@ +name: Bug Report +description: Report a bug to improve Lens +title: "[Bug]: " +body: + - type: textarea + id: summary + attributes: + label: General Summary + description: Please provide a general summary of the problem + placeholder: e.g. "The main issue is that..." + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected Behavior + description: Explain the behavior expected + placeholder: e.g. "The feature should do a, then b when you click c." + validations: + required: true + - type: textarea + id: current + attributes: + label: Current Behavior + description: Explain what the actual behavior is + placeholder: e.g. "The feature actually does x, y and shows error z." + validations: + required: true + - type: textarea + id: possible_solution + attributes: + label: Possible Solution + description: Suggest a possible fix for the bug + validations: + required: false + - type: textarea + id: reproduce + attributes: + label: Steps to Reproduce + description: Explain how to reproduce the problem + placeholder: e.g. "1. The first step to reproduce this error is to access the members area..." + validations: + required: true + - type: textarea + id: context + attributes: + label: Context (Environment) + description: Provide context on the setting and environment + placeholder: e.g. "This bug happened on a Windows 10 PC running the newest Google Chrome." + validations: + required: false + - type: textarea + id: description + attributes: + label: Detailed Description + description: Please provide a more detailed description + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/3-vulnerability-report.yml b/.github/ISSUE_TEMPLATE/3-vulnerability-report.yml new file mode 100644 index 00000000..d07737d5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/3-vulnerability-report.yml @@ -0,0 +1,48 @@ +name: Vulnerability Report +description: Report a potential software vulnerability +title: "[Vulnerability]: " +body: + - type: textarea + id: summary + attributes: + label: General Summary + description: Please provide a general summary of the problem + placeholder: e.g. "An unsafe deserialization vulnerability allows any unauthenticated user to execute arbitrary code on the server." + validations: + required: true + - type: textarea + id: component + attributes: + label: Effected Component(s) + description: List the components effected by this vulnerability + validations: + required: true + - type: textarea + id: impact + attributes: + label: Impact of Vulnerability + description: Describe the scope of the vulnerability's impact + validations: + required: true + - type: textarea + id: remediation + attributes: + label: Possible Remediation + description: Propose a remediation suggestion if you have one. + validations: + required: false + - type: textarea + id: reproduce + attributes: + label: Steps to Reproduce + description: Explain how to reproduce the problem + placeholder: e.g. "1. The first step to reproduce this error is to access the members area..." + validations: + required: true + - type: textarea + id: description + attributes: + label: Detailed Description + description: Please provide a more detailed description + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..0086358d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: true diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..804a788c --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,24 @@ +### General Summary + +### Description + + +### Related Issue + + +--- + +### Motivation and Context + +### How Has This Been Tested? + + + +### Screenshots (if appropriate): + +--- + + +- [ ] The commit message follows guidelines +- [ ] Tests for the changes have been added +- [ ] Documentation has been added/ updated diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 30744741..3cb1f423 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,13 +8,16 @@ jobs: build-and-publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - name: "Checkout Code" + uses: actions/checkout@v3 + - name: "Setup NodeJS with cache (if available)" + uses: actions/setup-node@v3 with: node-version: 20 registry-url: 'https://registry.npmjs.org' cache: 'npm' - - run: npm ci + - name: "Download dependencies" + run: npm ci - name: "Build @samply/lens" run: npm run build - name: "Publish @samply/lens" @@ -22,3 +25,43 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + release: + needs: build-and-publish + runs-on: ubuntu-latest + steps: + - name: "Checkout Code" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: "Update CHANGELOG" + id: changelog + uses: requarks/changelog-action@v1 + with: + token: ${{ github.token }} + tag: ${{ github.ref_name }} + + - name: "Create Release" + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + draft: false + makeLatest: true + name: ${{ github.ref_name }} + body: ${{ steps.changelog.outputs.changes }} + token: ${{ github.token }} + + - name: "Commit CHANGELOG.md" + uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: main + commit_message: 'docs: added changelog for ${{ github.ref_name }} [skip ci]' + file_pattern: CHANGELOG.md + + - name: "Create PR for syncing back changelog" + uses: peter-evans/create-pull-request@v6 + with: + title: "Sync develop with main" + body: "For easy synchronisation of main with develop, triggered by the [release workflow](./.github/workflows/release.yml). Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action." + branch: "automated-pr/sync-main-to-develop" + base: "develop" diff --git a/docker-compose.yml b/docker-compose.yml index fdd306d8..1c06385d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,11 +6,8 @@ services: command: - --entrypoints.web.address=:80 - --entrypoints.websecure.address=:443 - - --entrypoints.web.http.redirections.entrypoint.to=websecure - - --entrypoints.web.http.redirections.entrypoint.scheme=https - --providers.docker=true - --providers.docker.exposedbydefault=false - - --providers.file.directory=/conf/ - --accesslog=true ports: - "80:80" diff --git a/docs/GIT_FLOW.md b/docs/GIT_FLOW.md index 385db7e6..44bf7eb3 100644 --- a/docs/GIT_FLOW.md +++ b/docs/GIT_FLOW.md @@ -42,104 +42,3 @@ Please see **[Semantic Versioning](https://semver.org/)** **SemVer** -> fix type commits should be translated to PATCH releases. feat type commits should be translated to MINOR releases. Commits with BREAKING CHANGE in the commits, regardless of type, should be translated to MAJOR releases. See more: [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#specification) - -## Issues Templates: - -### Bug report - -``` -## General Summary - -## Expected Behavior - -## Current Behavior - -## Possible Solution - - -## Steps to Reproduce - -1. -2. -3. -4. - -## Context (Environment) - -## Detailed Description - -## Possible Implementation -``` - -### Feature request - -``` -## Suggested Change - - -## Is This Breaking? - - -## Current Behavior - -## New Behavior - -## Detailed Description - -``` - -### Vulnerability report - -``` -# Vulnerability Report - -I identified potential security vulnerabilities in [Component]. - -## Summary - - -## Component - -## Impact - -## Remediation - - -## Steps to Reproduce - -1. -2. -3. -4. - -## Detailed Description - - -``` - -## PR Template -``` - -- [ ] The commit message follows guidelines -- [ ] Tests for the changes have been added -- [ ] Documentation has been added/ updated - -## General Summary - -## Description - - -## Related Issue - - -## Motivation and Context - -## How Has This Been Tested? - - - -## Screenshots (if appropriate): -``` - -For reference: *[Using templates](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository)* - diff --git a/package-lock.json b/package-lock.json index 7409a08e..174d0715 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@samply/lens", - "version": "0.0.3", + "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@samply/lens", - "version": "0.0.3", + "version": "0.1.0", "license": "MIT", "dependencies": { "chart.js": "^4.4.0", diff --git a/package.json b/package.json index 555212e4..a3da007d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@samply/lens", "description": "A web component library for clinical data search and visualisation", - "version": "0.0.3", + "version": "0.1.0", "type": "module", "module": "dist/lens.js", "main": "dist/lens.umd.js", @@ -10,6 +10,13 @@ "files": [ "dist" ], + "publishConfig": { + "registry": "https://registry.npmjs.org" + }, + "repository": { + "type": "git", + "url": "https://github.com/samply/lens.git" + }, "exports": { ".": { "import": "./dist/lens.js", diff --git a/packages/demo/public/catalogues/catalogue-dktk.json b/packages/demo/public/catalogues/catalogue-dktk.json index 489432e9..fcf31fb5 100644 --- a/packages/demo/public/catalogues/catalogue-dktk.json +++ b/packages/demo/public/catalogues/catalogue-dktk.json @@ -19017,52 +19017,173 @@ { "key": "(sn)(mol+)", "name": "(sn)(mol+)", - "description": "(sn)(mol+)" + "description": "(sn)(mol+)", + "aggregatedValue": [ + [ + { + "value": "21906-3", + "name": "(sn)(mol+)" + }, + { + "value": "21900-6", + "name": "(sn)(mol+)" + } + ] + ] }, { "key": "(sn)(mol-)", "name": "(sn)(mol-)", - "description": "(sn)(mol-)" + "description": "(sn)(mol-)", + "aggregatedValue": [ + [ + { + "value": "21906-3", + "name": "(sn)(mol-)" + }, + { + "value": "21900-6", + "name": "(sn)(mol-)" + } + ] + ] }, { "key": "(sn)(i+)", "name": "(sn)(i+)", - "description": "(sn)(i+)" + "description": "(sn)(i+)", + "aggregatedValue": [ + [ + { + "value": "21906-3", + "name": "(sn)(i+)" + }, + { + "value": "21900-6", + "name": "(sn)(i+)" + } + ] + ] }, { "key": "(sn)(i-)", "name": "(sn)(i-)", - "description": "(sn)(i-)" + "description": "(sn)(i-)", + "aggregatedValue": [ + [ + { + "value": "21906-3", + "name": "(sn)(i-)" + }, + { + "value": "21900-6", + "name": "(sn)(i-)" + } + ] + ] }, { "key": "(mol+)", "name": "(mol+)", - "description": "(mol+)" + "description": "(mol+)", + "aggregatedValue": [ + [ + { + "value": "21906-3", + "name": "(mol+)" + }, + { + "value": "21900-6", + "name": "(mol+)" + } + ] + ] }, { "key": "(mol-)", "name": "(mol-)", - "description": "(mol-)" + "description": "(mol-)", + "aggregatedValue": [ + [ + { + "value": "21906-3", + "name": "(mol-)" + }, + { + "value": "21900-6", + "name": "(mol-)" + } + ] + ] }, { "key": "(i+)", "name": "(i+)", - "description": "(i+)" + "description": "(i+)", + "aggregatedValue": [ + [ + { + "value": "21906-3", + "name": "(i+)" + }, + { + "value": "21900-6", + "name": "(i+)" + } + ] + ] }, { "key": "(i-)", "name": "(i-)", - "description": "(i-)" + "description": "(i-)", + "aggregatedValue": [ + [ + { + "value": "21906-3", + "name": "(i-)" + }, + { + "value": "21900-6", + "name": "(i-)" + } + ] + ] }, { "key": "X", "name": "X", - "description": "X" + "description": "X", + "aggregatedValue": [ + [ + { + "value": "21906-3", + "name": "X" + }, + { + "value": "21900-6", + "name": "X" + } + ] + ] }, { "key": "X(sn)", "name": "X(sn)", "description": "X(sn)" + , + "aggregatedValue": [ + [ + { + "value": "21906-3", + "name": "X(sn)" + }, + { + "value": "21900-6", + "name": "X(sn)" + } + ] + ] }, { "key": "0", @@ -19084,7 +19205,19 @@ { "key": "0(sn)", "name": "0(sn)", - "description": "0(sn)" + "description": "0(sn)", + "aggregatedValue": [ + [ + { + "value": "21906-3", + "name": "0(sn)" + }, + { + "value": "21900-6", + "name": "0(sn)" + } + ] + ] }, { "key": "0(i+)", @@ -19604,11 +19737,11 @@ "aggregatedValue": [ [ { - "value": "59479-6", + "value": "42030-7", "name": "m" }, { - "value": "59479-6", + "value": "42030-7", "name": "m" } ] @@ -19625,7 +19758,7 @@ "name": "2" }, { - "value": "59479-6", + "value": "42030-7", "name": "2" } ] @@ -19638,11 +19771,11 @@ "aggregatedValue": [ [ { - "value": "59479-6", + "value": "42030-7", "name": "3" }, { - "value": "59479-6", + "value": "42030-7", "name": "3" } ] @@ -19655,11 +19788,11 @@ "aggregatedValue": [ [ { - "value": "59479-6", + "value": "42030-7", "name": "4" }, { - "value": "59479-6", + "value": "42030-7", "name": "4" } ] @@ -19672,11 +19805,11 @@ "aggregatedValue": [ [ { - "value": "59479-6", + "value": "42030-7", "name": "5" }, { - "value": "59479-6", + "value": "42030-7", "name": "5" } ] @@ -19689,11 +19822,11 @@ "aggregatedValue": [ [ { - "value": "59479-6", + "value": "42030-7", "name": "6" }, { - "value": "59479-6", + "value": "42030-7", "name": "6" } ] @@ -19706,11 +19839,11 @@ "aggregatedValue": [ [ { - "value": "59479-6", + "value": "42030-7", "name": "7" }, { - "value": "59479-6", + "value": "42030-7", "name": "7" } ] @@ -19723,11 +19856,11 @@ "aggregatedValue": [ [ { - "value": "59479-6", + "value": "42030-7", "name": "8" }, { - "value": "59479-6", + "value": "42030-7", "name": "8" } ] @@ -19740,11 +19873,11 @@ "aggregatedValue": [ [ { - "value": "59479-6", + "value": "42030-7", "name": "9" }, { - "value": "59479-6", + "value": "42030-7", "name": "9" } ] @@ -19766,11 +19899,11 @@ "aggregatedValue": [ [ { - "value": "21983-2", + "value": "59479-6", "name": "y" }, { - "value": "21983-2", + "value": "59479-6", "name": "y" } ] diff --git a/packages/demo/public/options.json b/packages/demo/public/options.json index b80e871a..d5e74d62 100644 --- a/packages/demo/public/options.json +++ b/packages/demo/public/options.json @@ -1,7 +1,10 @@ { "iconOptions": { "deleteUrl": "delete_icon.svg", - "infoUrl": "info-circle-svgrepo-com.svg" + "infoUrl": "info-circle-svgrepo-com.svg", + "selectAll": { + "text": "Add all" + } }, "chartOptions": { "patients": { @@ -167,7 +170,7 @@ "groupCode": "specimen" }, { - "stratifierCode": "Histlogoies", + "stratifierCode": "Histologies", "stratumCode": "1" }, { diff --git a/packages/demo/src/measures.ts b/packages/demo/src/measures.ts index af7cd135..ab5acc7d 100644 --- a/packages/demo/src/measures.ts +++ b/packages/demo/src/measures.ts @@ -1034,11 +1034,11 @@ export const dktkHistologyMeasure = { stratifier: [ { code: { - text: "Histlogoies", + text: "Histologies", }, criteria: { language: "text/cql-identifier", - expression: "Histlogoy", + expression: "Histology", }, }, ], diff --git a/packages/lib/src/components/Options.wc.svelte b/packages/lib/src/components/Options.wc.svelte index fa005b05..85da93a3 100644 --- a/packages/lib/src/components/Options.wc.svelte +++ b/packages/lib/src/components/Options.wc.svelte @@ -41,6 +41,22 @@ ) { store.set("deleteUrl", options.iconOptions.deleteUrl); } + if ( + "selectAll" in options.iconOptions && + typeof options.iconOptions["selectAll"] === "object" && + options.iconOptions.selectAll + ) { + // Allow for future possibility of iconUrl instead of text + if ( + "text" in options.iconOptions.selectAll && + typeof options.iconOptions.selectAll["text"] === + "string" + ) + store.set( + "selectAllText", + options.iconOptions.selectAll.text, + ); + } } } diff --git a/packages/lib/src/components/catalogue/DataTreeElement.svelte b/packages/lib/src/components/catalogue/DataTreeElement.svelte index 9c14d7f9..a70438dd 100644 --- a/packages/lib/src/components/catalogue/DataTreeElement.svelte +++ b/packages/lib/src/components/catalogue/DataTreeElement.svelte @@ -1,4 +1,5 @@