diff --git a/orga/app/components/participant/assessment/results.gjs b/orga/app/components/participant/assessment/results.gjs new file mode 100644 index 00000000000..c09f077cf3a --- /dev/null +++ b/orga/app/components/participant/assessment/results.gjs @@ -0,0 +1,67 @@ +import PixProgressBar from '@1024pix/pix-ui/components/pix-progress-bar'; +import { t } from 'ember-intl'; + +import multiply from '../../../helpers/multiply'; +import TableHeader from '../../table/header'; + +function sortedCompetenceResults(results) { + return results.sort((a, b) => { + return a.index.localeCompare(b.index); + }); +} + +function displayResults(results) { + return results.length > 0; +} + +function competenceCount(results) { + return results.length; +} + + diff --git a/orga/app/components/participant/assessment/results.hbs b/orga/app/components/participant/assessment/results.hbs deleted file mode 100644 index 8db9584b9ad..00000000000 --- a/orga/app/components/participant/assessment/results.hbs +++ /dev/null @@ -1,47 +0,0 @@ -
-

{{t "pages.assessment-individual-results.table.title"}}

- - - - - {{t - "pages.assessment-individual-results.table.column.competences" - count=@results.sortedCompetenceResults.length - }} - {{t - "pages.assessment-individual-results.table.column.results.label" - }} - - - - {{#if @displayResults}} - - {{#each @results.sortedCompetenceResults as |competenceResult|}} - - - - - {{/each}} - - {{/if}} -
- - - {{competenceResult.name}} - - - -
- - {{#unless @displayResults}} -

{{t "pages.assessment-individual-results.table.empty"}}

- {{/unless}} -
\ No newline at end of file diff --git a/orga/app/components/tube/list.js b/orga/app/components/tube/list.js index 7129d7029e0..4d4ff2fa573 100644 --- a/orga/app/components/tube/list.js +++ b/orga/app/components/tube/list.js @@ -24,14 +24,16 @@ export default class TubeList extends Component { @action selectTube(tube) { if (this.isTubeSelected(tube)) return; - this.selectedTubeIds.pushObject(tube.id); + this.selectedTubeIds = [...this.selectedTubeIds, tube.id]; } @action unselectTube(tube) { const index = this.selectedTubeIds.indexOf(tube.id); if (index === -1) return; - this.selectedTubeIds.removeAt(index); + this.selectedTubeIds.splice(index, 1); + + this.selectedTubeIds = [...this.selectedTubeIds]; } getThematicState = (thematic) => { diff --git a/orga/app/models/campaign-assessment-participation-result.js b/orga/app/models/campaign-assessment-participation-result.js index 4dac0d9a2a9..7ce24292cec 100644 --- a/orga/app/models/campaign-assessment-participation-result.js +++ b/orga/app/models/campaign-assessment-participation-result.js @@ -10,8 +10,4 @@ export default class CampaignAssessmentParticipationResult extends Model { inverse: 'campaignAssessmentParticipationResult', }) competenceResults; - - get sortedCompetenceResults() { - return this.hasMany('competenceResults').value().sortBy('index'); - } } diff --git a/orga/app/routes/authenticated/campaigns/participant-assessment/results.js b/orga/app/routes/authenticated/campaigns/participant-assessment/results.js index a5f69f1f7b2..423325eb01a 100644 --- a/orga/app/routes/authenticated/campaigns/participant-assessment/results.js +++ b/orga/app/routes/authenticated/campaigns/participant-assessment/results.js @@ -1,8 +1,12 @@ import Route from '@ember/routing/route'; export default class ResultsRoute extends Route { - model() { + async model() { const { campaignAssessmentParticipation } = this.modelFor('authenticated.campaigns.participant-assessment'); - return campaignAssessmentParticipation; + const campaignAssessmentParticipationResult = + await campaignAssessmentParticipation.campaignAssessmentParticipationResult; + const competenceResults = await campaignAssessmentParticipationResult.competenceResults; + + return competenceResults.slice(0); } } diff --git a/orga/app/templates/authenticated/campaigns/participant-assessment/results.hbs b/orga/app/templates/authenticated/campaigns/participant-assessment/results.hbs index a844860e7fe..db2fde7e1b7 100644 --- a/orga/app/templates/authenticated/campaigns/participant-assessment/results.hbs +++ b/orga/app/templates/authenticated/campaigns/participant-assessment/results.hbs @@ -1,7 +1,3 @@ {{page-title this.pageTitle}} - \ No newline at end of file + \ No newline at end of file diff --git a/orga/config/environment.js b/orga/config/environment.js index 5384c8fdb69..b92ace0b942 100644 --- a/orga/config/environment.js +++ b/orga/config/environment.js @@ -27,10 +27,6 @@ module.exports = function (environment) { // Here you can enable experimental features on an ember canary build // e.g. 'with-controller': true }, - EXTEND_PROTOTYPES: { - // Prevent Ember Data from overriding Date.parse. - Date: false, - }, }, APP: { diff --git a/orga/package-lock.json b/orga/package-lock.json index 7b4b4a9d698..1c8bfdcde2c 100644 --- a/orga/package-lock.json +++ b/orga/package-lock.json @@ -19,9 +19,8 @@ "@babel/eslint-parser": "^7.19.1", "@babel/plugin-proposal-decorators": "^7.20.13", "@ember/optional-features": "^2.0.0", - "@ember/render-modifiers": "^2.0.5", "@ember/string": "^3.1.1", - "@ember/test-helpers": "^3.0.0", + "@ember/test-helpers": "^4.0.4", "@embroider/compat": "^3.4.4", "@embroider/core": "^3.4.4", "@embroider/macros": "^1.13.5", @@ -56,7 +55,7 @@ "ember-qunit": "^8.1.0", "ember-resolver": "^13.0.0", "ember-simple-auth": "^6.1.0", - "ember-source": "^5.9.0", + "ember-source": "^6.0.1", "ember-template-imports": "^4.1.3", "ember-template-lint": "^6.0.0", "ember-template-lint-plugin-prettier": "^5.0.0", @@ -4257,706 +4256,6 @@ "node": "10.* || 12.* || >= 14" } }, - "node_modules/@ember/render-modifiers": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@ember/render-modifiers/-/render-modifiers-2.1.0.tgz", - "integrity": "sha512-LruhfoDv2itpk0fA0IC76Sxjcnq/7BC6txpQo40hOko8Dn6OxwQfxkPIbZGV0Cz7df+iX+VJrcYzNIvlc3w2EQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@embroider/macros": "^1.0.0", - "ember-cli-babel": "^7.26.11", - "ember-modifier-manager-polyfill": "^1.2.0" - }, - "engines": { - "node": "12.* || 14.* || >= 16" - }, - "peerDependencies": { - "@glint/template": "^1.0.2", - "ember-source": "^3.8 || ^4.0.0 || ^5.0.0" - }, - "peerDependenciesMeta": { - "@glint/template": { - "optional": true - } - } - }, - "node_modules/@ember/render-modifiers/node_modules/@babel/plugin-proposal-private-property-in-object": { - "version": "7.21.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.11.tgz", - "integrity": "sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-create-class-features-plugin": "^7.21.0", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@ember/render-modifiers/node_modules/@babel/runtime": { - "version": "7.12.18", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.18.tgz", - "integrity": "sha512-BogPQ7ciE6SYAUPtlm9tWbgI9+2AgqSam6QivMgXgAT+fKbgppaj4ZX15MHeLC1PVF5sNk70huBu20XxWOs8Cg==", - "dev": true, - "license": "MIT", - "dependencies": { - "regenerator-runtime": "^0.13.4" - } - }, - "node_modules/@ember/render-modifiers/node_modules/@types/fs-extra": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.1.0.tgz", - "integrity": "sha512-AInn5+UBFIK9FK5xc9yP5e3TQSPNNgjHByqYcj9g5elVBnDQcQL7PlO1CIRy2gWlbwK7UPYqi7vRvFA44dCmYQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@ember/render-modifiers/node_modules/async-disk-cache": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/async-disk-cache/-/async-disk-cache-1.3.5.tgz", - "integrity": "sha512-VZpqfR0R7CEOJZ/0FOTgWq70lCrZyS1rkI8PXugDUkTKyyAUgZ2zQ09gLhMkEn+wN8LYeUTPxZdXtlX/kmbXKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^2.1.3", - "heimdalljs": "^0.2.3", - "istextorbinary": "2.1.0", - "mkdirp": "^0.5.0", - "rimraf": "^2.5.3", - "rsvp": "^3.0.18", - "username-sync": "^1.0.2" - } - }, - "node_modules/@ember/render-modifiers/node_modules/async-disk-cache/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/@ember/render-modifiers/node_modules/async-disk-cache/node_modules/rsvp": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz", - "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "0.12.* || 4.* || 6.* || >= 7.*" - } - }, - "node_modules/@ember/render-modifiers/node_modules/babel-plugin-module-resolver": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-module-resolver/-/babel-plugin-module-resolver-3.2.0.tgz", - "integrity": "sha512-tjR0GvSndzPew/Iayf4uICWZqjBwnlMWjSx6brryfQ81F9rxBVqwDJtFCV8oOs0+vJeefK9TmdZtkIFdFe1UnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "find-babel-config": "^1.1.0", - "glob": "^7.1.2", - "pkg-up": "^2.0.0", - "reselect": "^3.0.1", - "resolve": "^1.4.0" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/@ember/render-modifiers/node_modules/broccoli-babel-transpiler": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/broccoli-babel-transpiler/-/broccoli-babel-transpiler-7.8.1.tgz", - "integrity": "sha512-6IXBgfRt7HZ61g67ssBc6lBb3Smw3DPZ9dEYirgtvXWpRZ2A9M22nxy6opEwJDgDJzlu/bB7ToppW33OFkA1gA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.12.0", - "@babel/polyfill": "^7.11.5", - "broccoli-funnel": "^2.0.2", - "broccoli-merge-trees": "^3.0.2", - "broccoli-persistent-filter": "^2.2.1", - "clone": "^2.1.2", - "hash-for-dep": "^1.4.7", - "heimdalljs": "^0.2.1", - "heimdalljs-logger": "^0.1.9", - "json-stable-stringify": "^1.0.1", - "rsvp": "^4.8.4", - "workerpool": "^3.1.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/@ember/render-modifiers/node_modules/broccoli-funnel": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/broccoli-funnel/-/broccoli-funnel-2.0.2.tgz", - "integrity": "sha512-/vDTqtv7ipjEZQOVqO4vGDVAOZyuYzQ/EgGoyewfOgh1M7IQAToBKZI0oAQPgMBeFPPlIbfMuAngk+ohPBuaHQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-equal": "^1.0.0", - "blank-object": "^1.0.1", - "broccoli-plugin": "^1.3.0", - "debug": "^2.2.0", - "fast-ordered-set": "^1.0.0", - "fs-tree-diff": "^0.5.3", - "heimdalljs": "^0.2.0", - "minimatch": "^3.0.0", - "mkdirp": "^0.5.0", - "path-posix": "^1.0.0", - "rimraf": "^2.4.3", - "symlink-or-copy": "^1.0.0", - "walk-sync": "^0.3.1" - }, - "engines": { - "node": "^4.5 || 6.* || >= 7.*" - } - }, - "node_modules/@ember/render-modifiers/node_modules/broccoli-funnel/node_modules/fs-tree-diff": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/fs-tree-diff/-/fs-tree-diff-0.5.9.tgz", - "integrity": "sha512-872G8ax0kHh01m9n/2KDzgYwouKza0Ad9iFltBpNykvROvf2AGtoOzPJgGx125aolGPER3JuC7uZFrQ7bG1AZw==", - "dev": true, - "license": "MIT", - "dependencies": { - "heimdalljs-logger": "^0.1.7", - "object-assign": "^4.1.0", - "path-posix": "^1.0.0", - "symlink-or-copy": "^1.1.8" - } - }, - "node_modules/@ember/render-modifiers/node_modules/broccoli-funnel/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/@ember/render-modifiers/node_modules/broccoli-merge-trees": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/broccoli-merge-trees/-/broccoli-merge-trees-3.0.2.tgz", - "integrity": "sha512-ZyPAwrOdlCddduFbsMyyFzJUrvW6b04pMvDiAQZrCwghlvgowJDY+EfoXn+eR1RRA5nmGHJ+B68T63VnpRiT1A==", - "dev": true, - "license": "MIT", - "dependencies": { - "broccoli-plugin": "^1.3.0", - "merge-trees": "^2.0.0" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@ember/render-modifiers/node_modules/broccoli-persistent-filter": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/broccoli-persistent-filter/-/broccoli-persistent-filter-2.3.1.tgz", - "integrity": "sha512-hVsmIgCDrl2NFM+3Gs4Cr2TA6UPaIZip99hN8mtkaUPgM8UeVnCbxelCvBjUBHo0oaaqP5jzqqnRVvb568Yu5g==", - "dev": true, - "license": "MIT", - "dependencies": { - "async-disk-cache": "^1.2.1", - "async-promise-queue": "^1.0.3", - "broccoli-plugin": "^1.0.0", - "fs-tree-diff": "^2.0.0", - "hash-for-dep": "^1.5.0", - "heimdalljs": "^0.2.1", - "heimdalljs-logger": "^0.1.7", - "mkdirp": "^0.5.1", - "promise-map-series": "^0.2.1", - "rimraf": "^2.6.1", - "rsvp": "^4.7.0", - "symlink-or-copy": "^1.0.1", - "sync-disk-cache": "^1.3.3", - "walk-sync": "^1.0.0" - }, - "engines": { - "node": "6.* || >= 8.*" - } - }, - "node_modules/@ember/render-modifiers/node_modules/broccoli-persistent-filter/node_modules/matcher-collection": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/matcher-collection/-/matcher-collection-1.1.2.tgz", - "integrity": "sha512-YQ/teqaOIIfUHedRam08PB3NK7Mjct6BvzRnJmpGDm8uFXpNr1sbY4yuflI5JcEs6COpYA0FpRQhSDBf1tT95g==", - "dev": true, - "license": "ISC", - "dependencies": { - "minimatch": "^3.0.2" - } - }, - "node_modules/@ember/render-modifiers/node_modules/broccoli-persistent-filter/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/@ember/render-modifiers/node_modules/broccoli-persistent-filter/node_modules/walk-sync": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/walk-sync/-/walk-sync-1.1.4.tgz", - "integrity": "sha512-nowc9thB/Jg0KW4TgxoRjLLYRPvl3DB/98S89r4ZcJqq2B0alNcKDh6pzLkBSkPMzRSMsJghJHQi79qw0YWEkA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/minimatch": "^3.0.3", - "ensure-posix-path": "^1.1.0", - "matcher-collection": "^1.1.1" - } - }, - "node_modules/@ember/render-modifiers/node_modules/broccoli-plugin": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/broccoli-plugin/-/broccoli-plugin-1.3.1.tgz", - "integrity": "sha512-DW8XASZkmorp+q7J4EeDEZz+LoyKLAd2XZULXyD9l4m9/hAKV3vjHmB1kiUshcWAYMgTP1m2i4NnqCE/23h6AQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "promise-map-series": "^0.2.1", - "quick-temp": "^0.1.3", - "rimraf": "^2.3.4", - "symlink-or-copy": "^1.1.8" - } - }, - "node_modules/@ember/render-modifiers/node_modules/broccoli-plugin/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/@ember/render-modifiers/node_modules/broccoli-source": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/broccoli-source/-/broccoli-source-2.1.2.tgz", - "integrity": "sha512-1lLayO4wfS0c0Sj50VfHJXNWf94FYY0WUhxj0R77thbs6uWI7USiOWFqQV5dRmhAJnoKaGN4WyLGQbgjgiYFwQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/@ember/render-modifiers/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/@ember/render-modifiers/node_modules/editions": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/editions/-/editions-1.3.4.tgz", - "integrity": "sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/@ember/render-modifiers/node_modules/ember-cli-babel": { - "version": "7.26.11", - "resolved": "https://registry.npmjs.org/ember-cli-babel/-/ember-cli-babel-7.26.11.tgz", - "integrity": "sha512-JJYeYjiz/JTn34q7F5DSOjkkZqy8qwFOOxXfE6pe9yEJqWGu4qErKxlz8I22JoVEQ/aBUO+OcKTpmctvykM9YA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.12.0", - "@babel/helper-compilation-targets": "^7.12.0", - "@babel/plugin-proposal-class-properties": "^7.16.5", - "@babel/plugin-proposal-decorators": "^7.13.5", - "@babel/plugin-proposal-private-methods": "^7.16.5", - "@babel/plugin-proposal-private-property-in-object": "^7.16.5", - "@babel/plugin-transform-modules-amd": "^7.13.0", - "@babel/plugin-transform-runtime": "^7.13.9", - "@babel/plugin-transform-typescript": "^7.13.0", - "@babel/polyfill": "^7.11.5", - "@babel/preset-env": "^7.16.5", - "@babel/runtime": "7.12.18", - "amd-name-resolver": "^1.3.1", - "babel-plugin-debug-macros": "^0.3.4", - "babel-plugin-ember-data-packages-polyfill": "^0.1.2", - "babel-plugin-ember-modules-api-polyfill": "^3.5.0", - "babel-plugin-module-resolver": "^3.2.0", - "broccoli-babel-transpiler": "^7.8.0", - "broccoli-debug": "^0.6.4", - "broccoli-funnel": "^2.0.2", - "broccoli-source": "^2.1.2", - "calculate-cache-key-for-tree": "^2.0.0", - "clone": "^2.1.2", - "ember-cli-babel-plugin-helpers": "^1.1.1", - "ember-cli-version-checker": "^4.1.0", - "ensure-posix-path": "^1.0.2", - "fixturify-project": "^1.10.0", - "resolve-package-path": "^3.1.0", - "rimraf": "^3.0.1", - "semver": "^5.5.0" - }, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/@ember/render-modifiers/node_modules/ember-cli-babel/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/@ember/render-modifiers/node_modules/ember-cli-version-checker": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ember-cli-version-checker/-/ember-cli-version-checker-4.1.1.tgz", - "integrity": "sha512-bzEWsTMXUGEJfxcAGWPe6kI7oHEGD3jaxUWDYPTqzqGhNkgPwXTBgoWs9zG1RaSMaOPFnloWuxRcoHi4TrYS3Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "resolve-package-path": "^2.0.0", - "semver": "^6.3.0", - "silent-error": "^1.1.1" - }, - "engines": { - "node": "8.* || 10.* || >= 12.*" - } - }, - "node_modules/@ember/render-modifiers/node_modules/ember-cli-version-checker/node_modules/resolve-package-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-package-path/-/resolve-package-path-2.0.0.tgz", - "integrity": "sha512-/CLuzodHO2wyyHTzls5Qr+EFeG6RcW4u6//gjYvUfcfyuplIX1SSccU+A5A9A78Gmezkl3NBkFAMxLbzTY9TJA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-root": "^0.1.1", - "resolve": "^1.13.1" - }, - "engines": { - "node": "8.* || 10.* || >= 12" - } - }, - "node_modules/@ember/render-modifiers/node_modules/find-babel-config": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-1.2.2.tgz", - "integrity": "sha512-oK59njMyw2y3yxto1BCfVK7MQp/OYf4FleHu0RgosH3riFJ1aOuo/7naLDLAObfrgn3ueFhw5sAT/cp0QuJI3Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "json5": "^1.0.2", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/@ember/render-modifiers/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@ember/render-modifiers/node_modules/fixturify": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/fixturify/-/fixturify-1.3.0.tgz", - "integrity": "sha512-tL0svlOy56pIMMUQ4bU1xRe6NZbFSa/ABTWMxW2mH38lFGc9TrNAKWcMBQ7eIjo3wqSS8f2ICabFaatFyFmrVQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/fs-extra": "^5.0.5", - "@types/minimatch": "^3.0.3", - "@types/rimraf": "^2.0.2", - "fs-extra": "^7.0.1", - "matcher-collection": "^2.0.0" - }, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/@ember/render-modifiers/node_modules/fixturify-project": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/fixturify-project/-/fixturify-project-1.10.0.tgz", - "integrity": "sha512-L1k9uiBQuN0Yr8tA9Noy2VSQ0dfg0B8qMdvT7Wb5WQKc7f3dn3bzCbSrqlb+etLW+KDV4cBC7R1OvcMg3kcxmA==", - "dev": true, - "license": "MIT", - "dependencies": { - "fixturify": "^1.2.0", - "tmp": "^0.0.33" - } - }, - "node_modules/@ember/render-modifiers/node_modules/fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/@ember/render-modifiers/node_modules/istextorbinary": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-2.1.0.tgz", - "integrity": "sha512-kT1g2zxZ5Tdabtpp9VSdOzW9lb6LXImyWbzbQeTxoRtHhurC9Ej9Wckngr2+uepPL09ky/mJHmN9jeJPML5t6A==", - "dev": true, - "license": "MIT", - "dependencies": { - "binaryextensions": "1 || 2", - "editions": "^1.1.1", - "textextensions": "1 || 2" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/@ember/render-modifiers/node_modules/json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, - "node_modules/@ember/render-modifiers/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "license": "MIT", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/@ember/render-modifiers/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@ember/render-modifiers/node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.6" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/@ember/render-modifiers/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true, - "license": "MIT" - }, - "node_modules/@ember/render-modifiers/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@ember/render-modifiers/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@ember/render-modifiers/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/@ember/render-modifiers/node_modules/pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", - "integrity": "sha512-fjAPuiws93rm7mPUu21RdBnkeZNrbfCFCwfAhPWY+rR3zG0ubpe5cEReHOw5fIbfmsxEV/g2kSxGTATY3Bpnwg==", - "dev": true, - "license": "MIT", - "dependencies": { - "find-up": "^2.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@ember/render-modifiers/node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@ember/render-modifiers/node_modules/reselect": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/reselect/-/reselect-3.0.1.tgz", - "integrity": "sha512-b/6tFZCmRhtBMa4xGqiiRp9jh9Aqi2A687Lo265cN0/QohJQEBPiQ52f4QB6i0eF3yp3hmLL21LSGBcML2dlxA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@ember/render-modifiers/node_modules/resolve-package-path": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/resolve-package-path/-/resolve-package-path-3.1.0.tgz", - "integrity": "sha512-2oC2EjWbMJwvSN6Z7DbDfJMnD8MYEouaLn5eIX0j8XwPsYCVIyY9bbnX88YHVkbr8XHqvZrYbxaLPibfTYKZMA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-root": "^0.1.1", - "resolve": "^1.17.0" - }, - "engines": { - "node": "10.* || >= 12" - } - }, - "node_modules/@ember/render-modifiers/node_modules/sync-disk-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/sync-disk-cache/-/sync-disk-cache-1.3.4.tgz", - "integrity": "sha512-GlkGeM81GPPEKz/lH7QUTbvqLq7K/IUTuaKDSMulP9XQ42glqNJIN/RKgSOw4y8vxL1gOVvj+W7ruEO4s36eCw==", - "dev": true, - "dependencies": { - "debug": "^2.1.3", - "heimdalljs": "^0.2.3", - "mkdirp": "^0.5.0", - "rimraf": "^2.2.8", - "username-sync": "^1.0.2" - } - }, - "node_modules/@ember/render-modifiers/node_modules/sync-disk-cache/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/@ember/render-modifiers/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/@ember/render-modifiers/node_modules/walk-sync": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/walk-sync/-/walk-sync-0.3.4.tgz", - "integrity": "sha512-ttGcuHA/OBnN2pcM6johpYlEms7XpO5/fyKIr48541xXedan4roO8cS1Q2S/zbbjGH/BarYDAMeS2Mi9HE5Tig==", - "dev": true, - "license": "MIT", - "dependencies": { - "ensure-posix-path": "^1.0.0", - "matcher-collection": "^1.0.0" - } - }, - "node_modules/@ember/render-modifiers/node_modules/walk-sync/node_modules/matcher-collection": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/matcher-collection/-/matcher-collection-1.1.2.tgz", - "integrity": "sha512-YQ/teqaOIIfUHedRam08PB3NK7Mjct6BvzRnJmpGDm8uFXpNr1sbY4yuflI5JcEs6COpYA0FpRQhSDBf1tT95g==", - "dev": true, - "license": "ISC", - "dependencies": { - "minimatch": "^3.0.2" - } - }, - "node_modules/@ember/render-modifiers/node_modules/workerpool": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-3.1.2.tgz", - "integrity": "sha512-WJFA0dGqIK7qj7xPTqciWBH5DlJQzoPjsANvc3Y4hNB0SScT+Emjvt0jPPkDBUjBNngX1q9hHgt1Gfwytu6pug==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@babel/core": "^7.3.4", - "object-assign": "4.1.1", - "rsvp": "^4.8.4" - } - }, "node_modules/@ember/string": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/@ember/string/-/string-3.1.1.tgz", @@ -5647,27 +4946,21 @@ } }, "node_modules/@ember/test-helpers": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@ember/test-helpers/-/test-helpers-3.3.1.tgz", - "integrity": "sha512-h4uFBy4pquBtHsHI+tx9S0wtMmn1L+8dkXiDiyoqG1+3e0Awk6GBujiFM9s4ANq6wC8uIhC3wEFyts10h2OAoQ==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@ember/test-helpers/-/test-helpers-4.0.4.tgz", + "integrity": "sha512-1mbOVyVEcLxYOGzBaeeaQkCrL1o9Av86QaHk/1RvrVBW24I6YUj1ILLEi2qLZT5PzcCy0TdfadHT3hKJwJ0GcQ==", "dev": true, "license": "(MIT OR Apache-2.0)", "dependencies": { - "@ember/test-waiters": "^3.0.2", - "@embroider/macros": "^1.10.0", + "@ember/test-waiters": "^3.1.0", + "@embroider/addon-shim": "^1.8.7", + "@embroider/macros": "^1.16.5", "@simple-dom/interface": "^1.4.0", - "broccoli-debug": "^0.6.5", - "broccoli-funnel": "^3.0.8", - "dom-element-descriptors": "^0.5.0", - "ember-auto-import": "^2.6.0", - "ember-cli-babel": "^8.2.0", - "ember-cli-htmlbars": "^6.2.0" - }, - "engines": { - "node": "16.* || >= 18" + "decorator-transforms": "^2.0.0", + "dom-element-descriptors": "^0.5.0" }, "peerDependencies": { - "ember-source": "^4.0.0 || ^5.0.0" + "ember-source": ">= 4.0.0" } }, "node_modules/@ember/test-waiters": { @@ -25981,9 +25274,9 @@ } }, "node_modules/ember-source": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/ember-source/-/ember-source-5.12.0.tgz", - "integrity": "sha512-2MWlJmQEeeiIk9p5CDMuvD470YPi7/4wXgU41ftbWc9svwF+0usoe4PLoLC0T/jV6YX+3SY5tumQfxLSLoFhmQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ember-source/-/ember-source-6.0.1.tgz", + "integrity": "sha512-2IK4qYuJXG3U0ngm2JO+7mABAWlXjjBT2yvwxxTmatyg+iuV5CCtGWZGTGa/uw1nfAaihkDwyaVqNjmlvbovcg==", "dev": true, "license": "MIT", "dependencies": { diff --git a/orga/package.json b/orga/package.json index 254b1d02dfe..d16a641f09a 100644 --- a/orga/package.json +++ b/orga/package.json @@ -47,7 +47,7 @@ "ember-eslint-parser": "^0.5.0" }, "ember-dayjs": { - "ember-source": "^5.8.0" + "ember-source": "^6.0.1" } }, "devDependencies": { @@ -60,9 +60,8 @@ "@babel/eslint-parser": "^7.19.1", "@babel/plugin-proposal-decorators": "^7.20.13", "@ember/optional-features": "^2.0.0", - "@ember/render-modifiers": "^2.0.5", "@ember/string": "^3.1.1", - "@ember/test-helpers": "^3.0.0", + "@ember/test-helpers": "^4.0.4", "@embroider/compat": "^3.4.4", "@embroider/core": "^3.4.4", "@embroider/macros": "^1.13.5", @@ -97,7 +96,7 @@ "ember-qunit": "^8.1.0", "ember-resolver": "^13.0.0", "ember-simple-auth": "^6.1.0", - "ember-source": "^5.9.0", + "ember-source": "^6.0.1", "ember-template-imports": "^4.1.3", "ember-template-lint": "^6.0.0", "ember-template-lint-plugin-prettier": "^5.0.0", diff --git a/orga/tests/acceptance/campaign-participants-individual-results-test.js b/orga/tests/acceptance/campaign-participants-individual-results-test.js index edd9959b474..b9628367778 100644 --- a/orga/tests/acceptance/campaign-participants-individual-results-test.js +++ b/orga/tests/acceptance/campaign-participants-individual-results-test.js @@ -27,7 +27,7 @@ module('Acceptance | Campaign Participants Individual Results', function (hooks) test('it should go to participant details', async function (assert) { // given - const organizationId = user.memberships.models.firstObject.organizationId; + const organizationId = user.memberships.models[0].organizationId; server.create('campaign', { id: 1 }); server.create('campaignProfile', { campaignId: 1, campaignParticipationId: 1 }); server.create('organization-participant', { id: 1, organizationId }); diff --git a/orga/tests/acceptance/organization-participant-list-test.js b/orga/tests/acceptance/organization-participant-list-test.js index b006a7e4252..0cddf028ba1 100644 --- a/orga/tests/acceptance/organization-participant-list-test.js +++ b/orga/tests/acceptance/organization-participant-list-test.js @@ -35,7 +35,7 @@ module('Acceptance | Organization Participant List', function (hooks) { test('it should return participant-list when having participants', async function (assert) { // given - const organizationId = user.memberships.models.firstObject.organizationId; + const organizationId = user.memberships.models[0].organizationId; // when server.create('organization-participant', { organizationId, firstName: 'Xavier', lastName: 'Charles' }); @@ -50,7 +50,7 @@ module('Acceptance | Organization Participant List', function (hooks) { test('it should filter by certificability', async function (assert) { // given - const organizationId = user.memberships.models.firstObject.organizationId; + const organizationId = user.memberships.models[0].organizationId; server.create('organization-participant', { organizationId, firstName: 'Jean', lastName: 'Charles' }); diff --git a/orga/tests/acceptance/profile-test.js b/orga/tests/acceptance/profile-test.js index e8b815d2303..182499e058a 100644 --- a/orga/tests/acceptance/profile-test.js +++ b/orga/tests/acceptance/profile-test.js @@ -25,7 +25,7 @@ module('Acceptance | Campaign Profile', function (hooks) { test('it should go to participant details', async function (assert) { // given - const organizationId = user.memberships.models.firstObject.organizationId; + const organizationId = user.memberships.models[0].organizationId; server.create('campaign', { id: 1 }); server.create('campaignProfile', { campaignId: 1, campaignParticipationId: 1 }); server.create('organization-participant', { id: 1, organizationId }); diff --git a/orga/tests/acceptance/remove-membership-test.js b/orga/tests/acceptance/remove-membership-test.js index ca543cacf7d..158aa0e2ed9 100644 --- a/orga/tests/acceptance/remove-membership-test.js +++ b/orga/tests/acceptance/remove-membership-test.js @@ -19,7 +19,7 @@ module('Acceptance | Remove membership', function (hooks) { createPrescriberByUser({ user: adminUser }); await authenticateSession(adminUser.id); - const organizationId = adminUser.memberships.models.firstObject.organizationId; + const organizationId = adminUser.memberships.models[0].organizationId; user = server.create('user', { firstName: 'John', lastName: 'Doe' }); server.create('membership', { userId: user.id, organizationId, organizationRole: 'MEMBER' }); diff --git a/orga/tests/acceptance/sco-organization-participant-list-test.js b/orga/tests/acceptance/sco-organization-participant-list-test.js index 1f87aa021b0..dcdb4e64c39 100644 --- a/orga/tests/acceptance/sco-organization-participant-list-test.js +++ b/orga/tests/acceptance/sco-organization-participant-list-test.js @@ -73,7 +73,7 @@ module('Acceptance | Sco Organization Participant List', function (hooks) { module('when prescriber is looking for students', function (hooks) { hooks.beforeEach(async function () { - organizationId = user.memberships.models.firstObject.organizationId; + organizationId = user.memberships.models[0].organizationId; server.create('sco-organization-participant', { organizationId, firstName: 'Chuck', @@ -173,7 +173,7 @@ module('Acceptance | Sco Organization Participant List', function (hooks) { module('when student is associated', function (hooks) { hooks.beforeEach(async function () { - organizationId = user.memberships.models.firstObject.organizationId; + organizationId = user.memberships.models[0].organizationId; server.createList('sco-organization-participant', 5, { organizationId }); }); diff --git a/orga/tests/acceptance/sup-organization-participant-list-test.js b/orga/tests/acceptance/sup-organization-participant-list-test.js index e53e7581bd0..0b1c31e6a46 100644 --- a/orga/tests/acceptance/sup-organization-participant-list-test.js +++ b/orga/tests/acceptance/sup-organization-participant-list-test.js @@ -28,7 +28,7 @@ module('Acceptance | Sup Organization Participant List', function (hooks) { await authenticateSession(user.id); - const { organizationId } = user.memberships.models.firstObject; + const { organizationId } = user.memberships.models[0]; server.create('group', { name: 'L1', }); @@ -70,7 +70,7 @@ module('Acceptance | Sup Organization Participant List', function (hooks) { test('it filters by certificability', async function (assert) { // given - const organizationId = user.memberships.models.firstObject.organizationId; + const organizationId = user.memberships.models[0].organizationId; server.create('organization-participant', { organizationId, firstName: 'Jean', lastName: 'Charles' }); diff --git a/orga/tests/integration/components/participant/assessment/results-test.js b/orga/tests/integration/components/participant/assessment/results-test.js index d08876bfdd5..2166511edbe 100644 --- a/orga/tests/integration/components/participant/assessment/results-test.js +++ b/orga/tests/integration/components/participant/assessment/results-test.js @@ -16,7 +16,10 @@ module('Integration | Component | Participant::Assessment::Results', function (h test('it should display a sentence when displayResults is false', async function (assert) { // when - const screen = await render(hbs``); + const competenceResults = []; + + this.set('competenceResults', competenceResults); + const screen = await render(hbs``); // then assert.dom(screen.getByText(t('pages.assessment-individual-results.table.empty'))).exists(); @@ -31,16 +34,12 @@ module('Integration | Component | Participant::Assessment::Results', function (h competenceMasteryRate: 0.5, }); - const campaignAssessmentParticipationResult = store.createRecord('campaign-assessment-participation-result', { - competenceResults: [competenceResult], - }); + const competenceResults = [competenceResult]; - this.set('campaignAssessmentParticipationResult', campaignAssessmentParticipationResult); + this.set('competenceResults', competenceResults); // when - const screen = await render( - hbs``, - ); + const screen = await render(hbs``); // then assert.dom(screen.getByLabelText(t('pages.assessment-individual-results.table.row-title'))).exists(); diff --git a/orga/tests/unit/models/campaign-assessment-participation-result-test.js b/orga/tests/unit/models/campaign-assessment-participation-result-test.js deleted file mode 100644 index a88e2997d22..00000000000 --- a/orga/tests/unit/models/campaign-assessment-participation-result-test.js +++ /dev/null @@ -1,33 +0,0 @@ -import { setupTest } from 'ember-qunit'; -import { module, test } from 'qunit'; - -module('Unit | Model | campaignAssessmentParticipationResult', function (hooks) { - setupTest(hooks); - - module('sortedCompetenceResults', function () { - test('should sort competence results', function (assert) { - const store = this.owner.lookup('service:store'); - const competenceResult1 = store.createRecord('campaign-assessment-participation-competence-result', { - index: '1.1', - }); - const competenceResult2 = store.createRecord('campaign-assessment-participation-competence-result', { - index: '4.1', - }); - const competenceResult3 = store.createRecord('campaign-assessment-participation-competence-result', { - index: '1.2', - }); - - const model = store.createRecord('campaign-assessment-participation-result', { - competenceResults: [competenceResult1, competenceResult2, competenceResult3], - }); - - // when - const sortedCompetenceResults = model.get('sortedCompetenceResults'); - - // then - assert.strictEqual(sortedCompetenceResults[0].index, '1.1'); - assert.strictEqual(sortedCompetenceResults[1].index, '1.2'); - assert.strictEqual(sortedCompetenceResults[2].index, '4.1'); - }); - }); -});