From 7c81ac76b4f7e872502c9287896ebfcd97538a46 Mon Sep 17 00:00:00 2001 From: Mathis Hofer Date: Mon, 6 Nov 2023 14:12:15 +0100 Subject: [PATCH] Automatically sort imports using Prettier plugin --- .prettierrc | 1 - .prettierrc.js | 27 ++++++++ _config.yml | 2 +- package-lock.json | 66 +++++++++++++++++++ package.json | 4 +- src/app/app-routing.module.ts | 4 +- src/app/app.component.spec.ts | 3 +- src/app/app.component.ts | 11 ++-- src/app/app.module.ts | 6 +- src/app/auth.guard.spec.ts | 7 +- src/app/auth.guard.ts | 3 +- .../dashboard-action.component.spec.ts | 3 +- .../dashboard-actions.component.spec.ts | 15 ++--- .../dashboard-actions.component.ts | 2 +- .../dashboard-deadline.component.spec.ts | 3 +- .../dashboard-search.component.spec.ts | 3 +- .../dashboard-search.component.ts | 2 +- ...ashboard-timetable-table.component.spec.ts | 1 - .../dashboard-timetable-table.component.ts | 2 +- .../dashboard-timetable.component.spec.ts | 11 ++-- .../dashboard-timetable.component.ts | 17 +++-- .../dashboard/dashboard.component.spec.ts | 5 +- src/app/dashboard/dashboard-routing.module.ts | 4 +- src/app/dashboard/dashboard.module.ts | 15 ++--- .../services/dashboard.service.spec.ts | 3 +- .../dashboard/services/dashboard.service.ts | 20 +++--- .../edit-absences-edit.component.spec.ts | 17 +++-- .../edit-absences-edit.component.ts | 21 +++--- .../edit-absences-header.component.spec.ts | 3 +- .../edit-absences-header.component.ts | 15 ++--- .../edit-absences-list.component.spec.ts | 5 +- .../edit-absences-list.component.ts | 19 +++--- .../edit-absences.component.spec.ts | 3 +- .../edit-absences/edit-absences.component.ts | 2 +- .../edit-absences-routing.module.ts | 8 +-- src/app/edit-absences/edit-absences.module.ts | 9 ++- .../edit-absences-selection.service.ts | 3 +- .../edit-absences-state.service.spec.ts | 3 +- .../services/edit-absences-state.service.ts | 21 +++--- .../edit-absences-update.service.spec.ts | 3 +- .../services/edit-absences-update.service.ts | 9 ++- ...evaluate-absences-header.component.spec.ts | 3 +- .../evaluate-absences-header.component.ts | 7 +- .../evaluate-absences-list.component.spec.ts | 11 ++-- .../evaluate-absences-list.component.ts | 19 +++--- .../evaluate-absences.component.spec.ts | 3 +- .../evaluate-absences.component.ts | 4 +- .../evaluate-absences-routing.module.ts | 6 +- .../evaluate-absences.module.ts | 7 +- .../evaluate-absences-state.service.spec.ts | 3 +- .../evaluate-absences-state.service.ts | 2 +- .../events-current.component.spec.ts | 5 +- .../events-list/events-list.component.spec.ts | 5 +- .../events-list/events-list.component.ts | 2 +- .../events-tests.component.spec.ts | 5 +- .../events/events.component.spec.ts | 1 - .../average-grades.component.spec.ts | 3 +- .../test-edit-grades.component.spec.ts | 2 +- .../test-edit-grades.component.ts | 4 +- .../test-table-header.component.spec.ts | 1 - .../tests-edit-form.component.spec.ts | 5 +- .../tests-edit-form.component.ts | 5 +- .../tests-delete.component.spec.ts | 7 +- .../tests-delete/tests-delete.component.ts | 2 +- .../tests-edit/tests-edit.component.spec.ts | 1 - .../tests-edit/tests-edit.component.ts | 6 +- .../tests-header.component.spec.ts | 5 +- .../tests-header/tests-header.component.ts | 2 +- .../tests-list/tests-list.component.spec.ts | 13 ++-- .../tests-list/tests-list.component.ts | 4 +- .../publish-test.component.spec.ts | 1 - .../components/tests/tests.component.spec.ts | 1 - .../components/tests/tests.component.ts | 4 +- src/app/events/events-routing.module.ts | 12 ++-- src/app/events/events.module.ts | 31 +++++---- .../pipes/test-summary-short.pipe.spec.ts | 2 +- .../services/events-state.service.spec.ts | 2 +- .../events/services/events-state.service.ts | 6 +- .../services/test-state.service.spec.ts | 3 +- src/app/events/services/test-state.service.ts | 24 +++---- src/app/events/utils/course-reducer.ts | 2 +- src/app/events/utils/events.spec.ts | 4 +- src/app/events/utils/tests.spec.ts | 2 +- src/app/global-error-handler.ts | 2 +- src/app/home.component.spec.ts | 1 - src/app/home.component.ts | 2 +- .../my-absences-abstract-confirm.component.ts | 13 ++-- .../my-absences-confirm.component.spec.ts | 5 +- .../my-absences-confirm.component.ts | 13 ++-- .../my-absences-report-confirm.component.ts | 15 ++--- ...y-absences-report-header.component.spec.ts | 3 +- .../my-absences-report-header.component.ts | 7 +- .../my-absences-report-link.component.spec.ts | 3 +- .../my-absences-report-link.component.ts | 4 +- .../my-absences-report-list.component.spec.ts | 5 +- .../my-absences-report-list.component.ts | 35 +++++----- .../my-absences-report.component.spec.ts | 3 +- .../my-absences-report.component.ts | 4 +- .../my-absences-show.component.spec.ts | 11 ++-- .../my-absences-show.component.ts | 7 +- .../my-absences/my-absences.component.spec.ts | 3 +- .../my-absences/my-absences.component.ts | 2 +- .../my-absences/my-absences-routing.module.ts | 10 +-- src/app/my-absences/my-absences.module.ts | 14 ++-- .../my-absences-report-selection.service.ts | 3 +- .../my-absences-report-state.service.spec.ts | 15 ++--- .../my-absences-report-state.service.ts | 25 ++++--- .../services/my-absences.service.spec.ts | 5 +- .../services/my-absences.service.ts | 23 ++++--- .../my-grades-header.component.spec.ts | 5 +- .../my-grades-show.component.spec.ts | 7 +- .../my-grades-show.component.ts | 2 +- .../my-grades/my-grades.component.spec.ts | 3 +- src/app/my-grades/my-grades-routing.module.ts | 2 +- src/app/my-grades/my-grades.module.ts | 9 ++- .../my-grades/services/my-grades.service.ts | 16 ++--- .../my-notifications-show.component.spec.ts | 1 - .../my-notifications-show.component.ts | 6 +- .../my-notifications.module.ts | 2 +- .../my-profile-address.component.spec.ts | 1 - .../my-profile-address.component.ts | 2 +- .../my-profile-edit.component.spec.ts | 7 +- .../my-profile-edit.component.ts | 7 +- .../my-profile-entry.component.spec.ts | 3 +- .../my-profile-entry.component.ts | 2 +- .../my-profile-header.component.spec.ts | 5 +- .../my-profile-header.component.ts | 5 +- .../my-profile-show.component.spec.ts | 3 +- .../my-profile-show.component.ts | 2 +- .../my-profile/my-profile.component.spec.ts | 3 +- .../my-profile/my-profile.component.ts | 2 +- .../my-profile/my-profile-routing.module.ts | 6 +- src/app/my-profile/my-profile.module.ts | 11 ++-- .../services/my-profile.service.spec.ts | 3 +- .../my-profile/services/my-profile.service.ts | 1 - ...ngs-notifications-toggle.component.spec.ts | 1 - ...settings-notifications-toggle.component.ts | 2 +- .../my-settings-notifications.component.ts | 17 +++-- .../my-settings-show.component.spec.ts | 1 - .../my-settings/my-settings.component.spec.ts | 3 +- .../my-settings/my-settings.component.ts | 2 +- .../my-settings/my-settings-routing.module.ts | 2 +- src/app/my-settings/my-settings.module.ts | 9 ++- .../open-absences-detail.component.spec.ts | 11 ++-- .../open-absences-detail.component.ts | 11 ++-- .../open-absences-list.component.spec.ts | 9 ++- .../open-absences-list.component.ts | 17 +++-- .../open-absences.component.spec.ts | 3 +- .../open-absences/open-absences.component.ts | 4 +- .../models/open-absences-entry.model.spec.ts | 2 +- .../models/open-absences-entry.model.ts | 2 +- .../open-absences-routing.module.ts | 9 ++- src/app/open-absences/open-absences.module.ts | 9 ++- .../services/open-absences.service.spec.ts | 7 +- .../services/open-absences.service.ts | 4 +- .../utils/open-absences-entries.spec.ts | 6 +- .../utils/open-absences-entries.ts | 6 +- ...nce-control-block-lesson.component.spec.ts | 5 +- .../presence-control-entry.component.spec.ts | 2 +- .../presence-control-entry.component.ts | 8 +-- ...nce-control-group-dialog.component.spec.ts | 3 +- ...presence-control-group-dialog.component.ts | 2 +- .../presence-control-group.component.spec.ts | 5 +- .../presence-control-group.component.ts | 8 +-- .../presence-control-header.component.spec.ts | 7 +- .../presence-control-header.component.ts | 8 +-- ...resence-control-incident.component.spec.ts | 5 +- .../presence-control-incident.component.ts | 4 +- .../presence-control-list.component.spec.ts | 23 ++++--- .../presence-control-list.component.ts | 15 ++--- ...ontrol-preceding-absence.component.spec.ts | 5 +- .../presence-control.component.spec.ts | 1 - .../presence-control.component.ts | 9 ++- .../models/lesson-entry.model.spec.ts | 2 +- .../models/lesson-entry.model.ts | 2 +- .../presence-control-entry.model.spec.ts | 6 +- .../models/presence-control-entry.model.ts | 8 +-- .../presence-control.module.ts | 17 +++-- ...sence-control-block-lesson.service.spec.ts | 3 +- .../presence-control-block-lesson.service.ts | 10 +-- ...resence-control-group-selection.service.ts | 1 - .../presence-control-group.service.spec.ts | 2 +- .../presence-control-group.service.ts | 26 ++++---- .../presence-control-state.service.spec.ts | 25 ++++--- .../presence-control-state.service.ts | 20 +++--- .../utils/lesson-entries.spec.ts | 8 +-- .../presence-control/utils/lesson-entries.ts | 6 +- .../presence-control/utils/lessons.spec.ts | 6 +- src/app/presence-control/utils/lessons.ts | 10 +-- .../utils/presence-control-entries.spec.ts | 2 +- .../utils/presence-types.spec.ts | 10 +-- .../presence-control/utils/presence-types.ts | 2 +- src/app/rest-auth-interceptor.spec.ts | 3 +- src/app/rest-auth-interceptor.ts | 9 ++- src/app/rest-error-interceptor.spec.ts | 5 +- src/app/rest-error-interceptor.ts | 15 ++--- src/app/rest-role-interceptor.spec.ts | 3 +- src/app/rest-role-interceptor.ts | 6 +- src/app/settings.ts | 1 - .../components/avatar/avatar.component.ts | 3 +- .../backlink/backlink.component.spec.ts | 1 - .../components/caret/caret.component.spec.ts | 3 +- .../confirm-absences.component.spec.ts | 7 +- .../confirm-absences.component.ts | 37 +++++------ .../date-select/date-select.component.spec.ts | 1 - .../date-select/date-select.component.ts | 2 +- .../multiselect/multiselect.component.spec.ts | 1 - .../multiselect/multiselect.component.ts | 3 +- .../reports-link.component.spec.ts | 1 - .../resettable-input.component.spec.ts | 1 - .../select/select.component.spec.ts | 1 - .../components/select/select.component.ts | 7 +- .../spinner/spinner.component.spec.ts | 1 - .../dossier-addresses.component.spec.ts | 2 +- .../dossier-course-tests.component.spec.ts | 2 +- .../dossier-course-tests.component.ts | 2 +- ...ier-grades-course-header.component.spec.ts | 1 - .../dossier-grades-edit.component.spec.ts | 1 - .../dossier-grades-edit.component.ts | 4 +- ...ssier-grades-final-grade.component.spec.ts | 1 - .../dossier-grades-final-grade.component.ts | 2 +- .../dossier-grades-view.component.spec.ts | 4 +- .../dossier-grades-view.component.ts | 2 +- .../dossier-grades.component.spec.ts | 7 +- .../student-dossier/dossier-route.ts | 2 +- .../dossier-single-test.component.spec.ts | 3 +- .../dossier-single-test.component.ts | 6 +- .../student-backlink.component.spec.ts | 1 - .../student-backlink.component.ts | 2 +- ...student-dossier-absences.component.spec.ts | 1 - .../student-dossier-absences.component.ts | 25 ++++--- .../student-dossier-address.component.spec.ts | 4 +- .../student-dossier-address.component.ts | 4 +- ...r-apprenticeship-company.component.spec.ts | 5 +- ...ossier-apprenticeship-company.component.ts | 2 +- ...ent-dossier-entry-header.component.spec.ts | 2 +- .../student-dossier-entry-header.component.ts | 2 +- ...ier-legal-representative.component.spec.ts | 3 +- ...-dossier-legal-representative.component.ts | 2 +- .../student-dossier.component.spec.ts | 7 +- .../switch/switch.component.spec.ts | 1 - .../components/switch/switch.component.ts | 2 +- .../preserve-line-height.component.spec.ts | 1 - .../components/toast/toast.component.spec.ts | 3 +- .../typeahead/typeahead.component.spec.ts | 3 +- .../typeahead/typeahead.component.ts | 17 +++-- src/app/shared/directives/let.directive.ts | 3 +- .../models/apprenticeship-contract.model.ts | 2 +- src/app/shared/models/common-types.spec.ts | 4 +- src/app/shared/models/common-types.ts | 8 +-- src/app/shared/models/lesson-absence.model.ts | 2 +- .../models/lesson-dispensation.model.ts | 2 +- .../shared/models/lesson-incident.model.ts | 2 +- .../models/lesson-presence-statistic.ts | 2 +- .../shared/models/lesson-presence.model.ts | 8 +-- src/app/shared/models/lesson.model.ts | 2 +- src/app/shared/models/person.model.ts | 2 +- src/app/shared/models/student-grades.spec.ts | 4 +- src/app/shared/models/student.model.ts | 2 +- .../shared/pipes/days-difference.pipe.spec.ts | 1 - src/app/shared/pipes/days-difference.pipe.ts | 2 +- .../shared/pipes/person-email.pipe.spec.ts | 2 +- src/app/shared/pipes/person-email.pipe.ts | 2 +- ...prenticeship-managers-rest.service.spec.ts | 1 - src/app/shared/services/auth.service.spec.ts | 1 - ...confirm-absences-selection.service.spec.ts | 7 +- .../confirm-absences-selection.service.ts | 13 ++-- .../shared/services/courses-rest.service.ts | 8 +-- .../shared/services/date-parser-formatter.ts | 2 +- .../services/dossier-grades.service.spec.ts | 2 +- .../shared/services/dossier-grades.service.ts | 12 ++-- .../services/dossier-state.service.spec.ts | 1 - .../drop-down-items-rest.service.spec.ts | 1 - .../services/drop-down-items-rest.service.ts | 9 ++- .../educational-events-rest.service.ts | 15 ++--- .../services/events-rest.service.spec.ts | 1 - .../shared/services/events-rest.service.ts | 4 +- .../services/grading-scales-rest.service.ts | 4 +- .../grading-scales.service-rest.spec.ts | 1 - .../services/gradings-rest.service.spec.ts | 1 - .../shared/services/gradings-rest.service.ts | 4 +- src/app/shared/services/i18n.service.spec.ts | 3 +- .../job-trainers-rest.service.spec.ts | 1 - .../lesson-presences-rest.service.spec.ts | 13 ++-- .../services/lesson-presences-rest.service.ts | 6 +- ...sson-presences-update-rest.service.spec.ts | 3 +- .../lesson-presences-update-rest.service.ts | 3 +- .../lesson-presences-update.service.spec.ts | 4 +- .../lesson-presences-update.service.ts | 12 ++-- .../lesson-teachers-rest.service.spec.ts | 3 +- .../services/lesson-teachers-rest.service.ts | 8 +-- .../shared/services/loading-service.spec.ts | 1 - src/app/shared/services/loading-service.ts | 6 +- .../notification-types.service.spec.ts | 5 +- .../services/notification-types.service.ts | 3 +- .../services/paginated-entries.service.ts | 25 ++++--- .../services/persons-rest.service.spec.ts | 7 +- .../shared/services/persons-rest.service.ts | 9 ++- .../presence-types-rest.service.spec.ts | 3 +- .../services/presence-types-rest.service.ts | 5 +- .../services/presence-types.service.spec.ts | 5 +- .../shared/services/presence-types.service.ts | 11 ++-- .../shared/services/reports.service.spec.ts | 7 +- src/app/shared/services/reports.service.ts | 9 ++- src/app/shared/services/rest.service.spec.ts | 9 ++- src/app/shared/services/rest.service.ts | 5 +- .../services/scroll-position.service.spec.ts | 1 - .../services/scroll-position.service.ts | 14 ++-- .../shared/services/selection.service.spec.ts | 3 +- src/app/shared/services/selection.service.ts | 6 +- src/app/shared/services/sort.service.spec.ts | 3 +- src/app/shared/services/sort.service.ts | 2 +- .../shared/services/storage.service.spec.ts | 1 - .../student-profile-absences.service.spec.ts | 1 - .../student-profile-absences.service.ts | 9 ++- .../services/student-profile.service.spec.ts | 9 ++- .../services/student-profile.service.ts | 15 ++--- .../services/students-rest.service.spec.ts | 7 +- .../shared/services/students-rest.service.ts | 15 ++--- .../subscription-details-rest.service.spec.ts | 5 +- .../subscription-details-rest.service.ts | 4 +- .../subscriptions-rest.service.spec.ts | 1 - .../services/subscriptions-rest.service.ts | 2 +- .../teacher-resources-rest.service.spec.ts | 3 +- .../teacher-resources-rest.service.ts | 10 +-- ...teacher-substitutions-rest.service.spec.ts | 5 +- .../teacher-substitutions-rest.service.ts | 6 +- src/app/shared/services/toast.service.spec.ts | 1 - .../shared/services/typeahead-rest.service.ts | 11 ++-- .../user-settings-rest.service.spec.ts | 9 ++- .../services/user-settings-rest.service.ts | 7 +- .../services/user-settings.service.spec.ts | 4 +- .../shared/services/user-settings.service.ts | 12 ++-- src/app/shared/shared.module.ts | 45 +++++++------ src/app/shared/utils/absences-filter.ts | 1 - src/app/shared/utils/array.spec.ts | 6 +- src/app/shared/utils/date.spec.ts | 4 +- src/app/shared/utils/decode.spec.ts | 2 +- src/app/shared/utils/decode.ts | 6 +- src/app/shared/utils/drop-down-items.ts | 2 +- src/app/shared/utils/filter.spec.ts | 6 +- src/app/shared/utils/form.spec.ts | 3 +- src/app/shared/utils/form.ts | 4 +- src/app/shared/utils/gradings.spec.ts | 2 +- src/app/shared/utils/lesson-presences.spec.ts | 4 +- src/app/shared/utils/lesson-presences.ts | 2 +- src/app/shared/utils/observable.ts | 12 ++-- src/app/shared/utils/pagination.ts | 4 +- src/app/shared/utils/persons.spec.ts | 2 +- src/app/shared/utils/persons.ts | 2 +- .../utils/presence-control-entries.spec.ts | 2 +- .../shared/utils/presence-control-entries.ts | 6 +- src/app/shared/utils/presence-types.spec.ts | 2 +- src/app/shared/utils/presence-types.ts | 2 +- src/app/shared/utils/url.ts | 2 +- src/app/shared/utils/user-settings.ts | 2 +- src/main.ts | 1 - src/polyfills.ts | 5 +- src/spec-builders.ts | 44 ++++++------- src/spec-helpers.ts | 19 +++--- src/test.ts | 3 +- 361 files changed, 1087 insertions(+), 1194 deletions(-) delete mode 100644 .prettierrc create mode 100644 .prettierrc.js diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 0967ef424..000000000 --- a/.prettierrc +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 000000000..381e81c7f --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,27 @@ +const config = { + /** + * Enable plugin for automatically sorting of imports + */ + plugins: ["@trivago/prettier-plugin-sort-imports"], + importOrderParserPlugins: ["typescript", "decorators-legacy"], + + /** + * Custom sorting of imports, first lit stuff, then other third + * party libs, then own modules + */ + importOrder: ["^@angular/", "", "^src/", "^../", "^./"], + + /** + * Whether to separate sorting groups (as defined above) with + * newline + */ + // importOrderSeparation: true, + + /** + * Whether to sort the specifiers on the left hand side of the + * import statement + */ + importOrderSortSpecifiers: true, +}; + +export default config; diff --git a/_config.yml b/_config.yml index c74188174..f980e760b 100644 --- a/_config.yml +++ b/_config.yml @@ -1 +1 @@ -theme: jekyll-theme-slate \ No newline at end of file +theme: jekyll-theme-slate diff --git a/package-lock.json b/package-lock.json index cd02c4ec9..dd9461208 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,6 +47,7 @@ "@angular/cli": "^16.2.7", "@angular/compiler-cli": "^16.2.10", "@angular/language-service": "^16.2.10", + "@trivago/prettier-plugin-sort-imports": "^4.2.1", "@types/jasmine": "~5.1.1", "@types/lodash-es": "^4.17.10", "@types/node": "^18.11.0", @@ -3510,6 +3511,65 @@ "node": ">= 6" } }, + "node_modules/@trivago/prettier-plugin-sort-imports": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.2.1.tgz", + "integrity": "sha512-iuy2MPVURGdxILTchHr15VAioItuYBejKfcTmQFlxIuqA7jeaT6ngr5aUIG6S6U096d6a6lJCgaOwlRrPLlOPg==", + "dev": true, + "dependencies": { + "@babel/generator": "7.17.7", + "@babel/parser": "^7.20.5", + "@babel/traverse": "7.23.2", + "@babel/types": "7.17.0", + "javascript-natural-sort": "0.7.1", + "lodash": "^4.17.21" + }, + "peerDependencies": { + "@vue/compiler-sfc": "3.x", + "prettier": "2.x - 3.x" + }, + "peerDependenciesMeta": { + "@vue/compiler-sfc": { + "optional": true + } + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/generator": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", + "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "dev": true, + "dependencies": { + "@babel/types": "^7.17.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/types": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@tufjs/canonical-json": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-1.0.0.tgz", @@ -9468,6 +9528,12 @@ "integrity": "sha512-UrzO3fL7nnxlQXlvTynNAenL+21oUQRlzqQFsA2U11ryb4+NLOCOePZ70PTojEaUKhiFugh7dG0Q+I58xlPdWg==", "dev": true }, + "node_modules/javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", + "dev": true + }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", diff --git a/package.json b/package.json index 672295240..9530532cf 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "type": "git", "url": "git+https@github.com:bkd-mba-fbi/webapp-schulverwaltung.git" }, + "type": "module", "scripts": { "ng": "ng", "start": "ng serve", @@ -21,7 +22,7 @@ "test:brief": "ng test --browsers=ChromeHeadless --reporters brief", "test:coverage": "ng test --browsers=ChromeHeadless --code-coverage --reporters coverage-istanbul", "lint": "ng lint", - "format": "prettier --write \"./**/*.{js,ts,json,css,scss,html,md,yaml}\"", + "format": "prettier --write \"./**/*\" --ignore-unknown", "format:upgrade": "npm install --save-exact prettier@latest && npm run format", "preanalyze": "ng build --stats-json", "analyze": "npx webpack-bundle-analyzer dist/$(ng config defaultProject)/stats.json", @@ -70,6 +71,7 @@ "@angular/cli": "^16.2.7", "@angular/compiler-cli": "^16.2.10", "@angular/language-service": "^16.2.10", + "@trivago/prettier-plugin-sort-imports": "^4.2.1", "@types/jasmine": "~5.1.1", "@types/lodash-es": "^4.17.10", "@types/node": "^18.11.0", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index dce2b287f..80b41edbd 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,7 +1,7 @@ import { NgModule } from "@angular/core"; -import { Routes, RouterModule } from "@angular/router"; -import { HomeComponent } from "./home.component"; +import { RouterModule, Routes } from "@angular/router"; import { authGuard } from "./auth.guard"; +import { HomeComponent } from "./home.component"; import { UnauthenticatedComponent } from "./unauthenticated.component"; const routes: Routes = [ diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 5d26a001b..550579aac 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,5 +1,4 @@ -import { TestBed, ComponentFixture, waitForAsync } from "@angular/core/testing"; - +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { AppComponent } from "./app.component"; diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 248c00252..da986bf0c 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,13 +1,12 @@ -import { Component, ChangeDetectionStrategy, Inject } from "@angular/core"; -import { catchError } from "rxjs/operators"; +import { ChangeDetectionStrategy, Component, Inject } from "@angular/core"; +import { Router } from "@angular/router"; import { EMPTY } from "rxjs"; - +import { catchError } from "rxjs/operators"; import { SETTINGS, Settings } from "./settings"; import { I18nService } from "./shared/services/i18n.service"; -import { decode } from "./shared/utils/decode"; -import { NAVIGATOR } from "./shared/tokens/dom-apis"; -import { Router } from "@angular/router"; import { ToastService } from "./shared/services/toast.service"; +import { NAVIGATOR } from "./shared/tokens/dom-apis"; +import { decode } from "./shared/utils/decode"; @Component({ template: diff --git a/src/app/app.module.ts b/src/app/app.module.ts index fbb616d04..c97a70059 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -11,9 +11,11 @@ import { NgModule, } from "@angular/core"; import { createCustomElement } from "@angular/elements"; +import { FormsModule } from "@angular/forms"; import { BrowserModule } from "@angular/platform-browser"; import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; import { RouterModule } from "@angular/router"; +import { NgSelectModule } from "@ng-select/ng-select"; import { TranslateLoader, TranslateModule } from "@ngx-translate/core"; import { TranslateHttpLoader } from "@ngx-translate/http-loader"; import { AppRoutingModule } from "./app-routing.module"; @@ -21,12 +23,10 @@ import { AppComponent } from "./app.component"; import { GlobalErrorHandler } from "./global-error-handler"; import { HomeComponent } from "./home.component"; import { MyNotificationsShowComponent } from "./my-notifications/components/my-notifications-show/my-notifications-show.component"; -import { Settings, SETTINGS } from "./settings"; +import { SETTINGS, Settings } from "./settings"; import { I18nService } from "./shared/services/i18n.service"; import { SharedModule } from "./shared/shared.module"; import { UnauthenticatedComponent } from "./unauthenticated.component"; -import { NgSelectModule } from "@ng-select/ng-select"; -import { FormsModule } from "@angular/forms"; // AoT requires an exported function for factories export function HttpLoaderFactory( diff --git a/src/app/auth.guard.spec.ts b/src/app/auth.guard.spec.ts index e0393d2f9..2e90350c7 100644 --- a/src/app/auth.guard.spec.ts +++ b/src/app/auth.guard.spec.ts @@ -1,15 +1,14 @@ -import { TestBed, fakeAsync, tick } from "@angular/core/testing"; import { Component } from "@angular/core"; +import { TestBed, fakeAsync, tick } from "@angular/core/testing"; import { - RouterStateSnapshot, ActivatedRouteSnapshot, Router, + RouterStateSnapshot, } from "@angular/router"; import { RouterTestingModule } from "@angular/router/testing"; - +import { buildTestModuleMetadata } from "src/spec-helpers"; import { authGuard } from "./auth.guard"; import { AuthService } from "./shared/services/auth.service"; -import { buildTestModuleMetadata } from "src/spec-helpers"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/auth.guard.ts b/src/app/auth.guard.ts index d1cc20781..ee5638a66 100644 --- a/src/app/auth.guard.ts +++ b/src/app/auth.guard.ts @@ -1,6 +1,5 @@ import { inject } from "@angular/core"; -import { Router, CanActivateFn } from "@angular/router"; - +import { CanActivateFn, Router } from "@angular/router"; import { AuthService } from "./shared/services/auth.service"; export function authGuard(): CanActivateFn { diff --git a/src/app/dashboard/components/dashboard-action/dashboard-action.component.spec.ts b/src/app/dashboard/components/dashboard-action/dashboard-action.component.spec.ts index ed375d64c..01290a182 100644 --- a/src/app/dashboard/components/dashboard-action/dashboard-action.component.spec.ts +++ b/src/app/dashboard/components/dashboard-action/dashboard-action.component.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; - -import { DashboardActionComponent } from "./dashboard-action.component"; import { buildTestModuleMetadata } from "../../../../spec-helpers"; import { DashboardDeadlineComponent } from "../dashboard-deadline/dashboard-deadline.component"; +import { DashboardActionComponent } from "./dashboard-action.component"; describe("DashboardActionComponent", () => { let component: DashboardActionComponent; diff --git a/src/app/dashboard/components/dashboard-actions/dashboard-actions.component.spec.ts b/src/app/dashboard/components/dashboard-actions/dashboard-actions.component.spec.ts index a73a72410..bf0b31421 100644 --- a/src/app/dashboard/components/dashboard-actions/dashboard-actions.component.spec.ts +++ b/src/app/dashboard/components/dashboard-actions/dashboard-actions.component.spec.ts @@ -1,18 +1,17 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; - -import { DashboardActionsComponent } from "./dashboard-actions.component"; -import { buildTestModuleMetadata } from "../../../../spec-helpers"; -import { UserSettingsService } from "../../../shared/services/user-settings.service"; import { BehaviorSubject, of } from "rxjs"; +import { buildLessonPresence, buildPerson } from "../../../../spec-builders"; +import { buildTestModuleMetadata } from "../../../../spec-helpers"; +import { CoursesRestService } from "../../../shared/services/courses-rest.service"; import { LessonPresencesRestService } from "../../../shared/services/lesson-presences-rest.service"; -import { StudentsRestService } from "../../../shared/services/students-rest.service"; +import { PersonsRestService } from "../../../shared/services/persons-rest.service"; import { StorageService } from "../../../shared/services/storage.service"; -import { buildLessonPresence, buildPerson } from "../../../../spec-builders"; +import { StudentsRestService } from "../../../shared/services/students-rest.service"; +import { UserSettingsService } from "../../../shared/services/user-settings.service"; import { DashboardService } from "../../services/dashboard.service"; import { DashboardActionComponent } from "../dashboard-action/dashboard-action.component"; import { DashboardDeadlineComponent } from "../dashboard-deadline/dashboard-deadline.component"; -import { CoursesRestService } from "../../../shared/services/courses-rest.service"; -import { PersonsRestService } from "../../../shared/services/persons-rest.service"; +import { DashboardActionsComponent } from "./dashboard-actions.component"; describe("DashboardActionsComponent", () => { // let component: DashboardActionsComponent; diff --git a/src/app/dashboard/components/dashboard-actions/dashboard-actions.component.ts b/src/app/dashboard/components/dashboard-actions/dashboard-actions.component.ts index b159cb76c..9add01a46 100644 --- a/src/app/dashboard/components/dashboard-actions/dashboard-actions.component.ts +++ b/src/app/dashboard/components/dashboard-actions/dashboard-actions.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from "@angular/core"; -import { Settings, SETTINGS } from "../../../settings"; +import { SETTINGS, Settings } from "../../../settings"; import { DashboardService } from "../../services/dashboard.service"; @Component({ diff --git a/src/app/dashboard/components/dashboard-deadline/dashboard-deadline.component.spec.ts b/src/app/dashboard/components/dashboard-deadline/dashboard-deadline.component.spec.ts index a77d85409..b981c8d0b 100644 --- a/src/app/dashboard/components/dashboard-deadline/dashboard-deadline.component.spec.ts +++ b/src/app/dashboard/components/dashboard-deadline/dashboard-deadline.component.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; - -import { DashboardDeadlineComponent } from "./dashboard-deadline.component"; import { buildTestModuleMetadata } from "../../../../spec-helpers"; +import { DashboardDeadlineComponent } from "./dashboard-deadline.component"; describe("DashboardDeadlineComponent", () => { let component: DashboardDeadlineComponent; diff --git a/src/app/dashboard/components/dashboard-search/dashboard-search.component.spec.ts b/src/app/dashboard/components/dashboard-search/dashboard-search.component.spec.ts index 3e2ac3909..97d99e741 100644 --- a/src/app/dashboard/components/dashboard-search/dashboard-search.component.spec.ts +++ b/src/app/dashboard/components/dashboard-search/dashboard-search.component.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { Router } from "@angular/router"; - -import { DashboardSearchComponent } from "./dashboard-search.component"; import { buildTestModuleMetadata } from "../../../../spec-helpers"; +import { DashboardSearchComponent } from "./dashboard-search.component"; describe("DashboardSearchComponent", () => { let component: DashboardSearchComponent; diff --git a/src/app/dashboard/components/dashboard-search/dashboard-search.component.ts b/src/app/dashboard/components/dashboard-search/dashboard-search.component.ts index 21782e9c3..6bb3f4930 100644 --- a/src/app/dashboard/components/dashboard-search/dashboard-search.component.ts +++ b/src/app/dashboard/components/dashboard-search/dashboard-search.component.ts @@ -1,7 +1,7 @@ import { Component } from "@angular/core"; import { Router } from "@angular/router"; -import { StudentsRestService } from "../../../shared/services/students-rest.service"; import { DropDownItem } from "../../../shared/models/drop-down-item.model"; +import { StudentsRestService } from "../../../shared/services/students-rest.service"; @Component({ selector: "erz-dashboard-search", diff --git a/src/app/dashboard/components/dashboard-timetable-table/dashboard-timetable-table.component.spec.ts b/src/app/dashboard/components/dashboard-timetable-table/dashboard-timetable-table.component.spec.ts index 8ec5f1e1a..f0c47e838 100644 --- a/src/app/dashboard/components/dashboard-timetable-table/dashboard-timetable-table.component.spec.ts +++ b/src/app/dashboard/components/dashboard-timetable-table/dashboard-timetable-table.component.spec.ts @@ -2,7 +2,6 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { of } from "rxjs"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { DashboardService } from "../../services/dashboard.service"; - import { DashboardTimetableTableComponent } from "./dashboard-timetable-table.component"; describe("DashboardTimetableTableComponent", () => { diff --git a/src/app/dashboard/components/dashboard-timetable-table/dashboard-timetable-table.component.ts b/src/app/dashboard/components/dashboard-timetable-table/dashboard-timetable-table.component.ts index 565057d76..54d445539 100644 --- a/src/app/dashboard/components/dashboard-timetable-table/dashboard-timetable-table.component.ts +++ b/src/app/dashboard/components/dashboard-timetable-table/dashboard-timetable-table.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, Input } from "@angular/core"; -import { Settings, SETTINGS } from "src/app/settings"; +import { SETTINGS, Settings } from "src/app/settings"; import { DashboardService } from "../../services/dashboard.service"; import { DashboardTimetableEntry } from "../dashboard-timetable/dashboard-timetable.component"; diff --git a/src/app/dashboard/components/dashboard-timetable/dashboard-timetable.component.spec.ts b/src/app/dashboard/components/dashboard-timetable/dashboard-timetable.component.spec.ts index b048ecafb..f71de6f31 100644 --- a/src/app/dashboard/components/dashboard-timetable/dashboard-timetable.component.spec.ts +++ b/src/app/dashboard/components/dashboard-timetable/dashboard-timetable.component.spec.ts @@ -1,19 +1,18 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; - -import { DashboardTimetableComponent } from "./dashboard-timetable.component"; -import { buildTestModuleMetadata } from "src/spec-helpers"; -import { StudentsRestService } from "src/app/shared/services/students-rest.service"; import { BehaviorSubject, Observable, of } from "rxjs"; +import { LessonPresencesRestService } from "src/app/shared/services/lesson-presences-rest.service"; +import { StudentsRestService } from "src/app/shared/services/students-rest.service"; +import { UserSettingsService } from "src/app/shared/services/user-settings.service"; import { buildLesson, buildLessonAbsence, buildLessonIncident, buildTimetableEntry, } from "src/spec-builders"; -import { LessonPresencesRestService } from "src/app/shared/services/lesson-presences-rest.service"; -import { UserSettingsService } from "src/app/shared/services/user-settings.service"; +import { buildTestModuleMetadata } from "src/spec-helpers"; import { DashboardService } from "../../services/dashboard.service"; import { DashboardTimetableTableComponent } from "../dashboard-timetable-table/dashboard-timetable-table.component"; +import { DashboardTimetableComponent } from "./dashboard-timetable.component"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/dashboard/components/dashboard-timetable/dashboard-timetable.component.ts b/src/app/dashboard/components/dashboard-timetable/dashboard-timetable.component.ts index 11bfa7abc..d03b35bdd 100644 --- a/src/app/dashboard/components/dashboard-timetable/dashboard-timetable.component.ts +++ b/src/app/dashboard/components/dashboard-timetable/dashboard-timetable.component.ts @@ -1,23 +1,22 @@ import { Component } from "@angular/core"; +import addDays from "date-fns/addDays"; +import format from "date-fns/format"; +import startOfDay from "date-fns/startOfDay"; +import subDays from "date-fns/subDays"; import { - combineLatest, + BehaviorSubject, Observable, + combineLatest, map, - switchMap, of, - BehaviorSubject, + switchMap, tap, } from "rxjs"; -import startOfDay from "date-fns/startOfDay"; -import format from "date-fns/format"; -import addDays from "date-fns/addDays"; -import subDays from "date-fns/subDays"; - +import { uniqueLessons } from "src/app/presence-control/utils/lesson-entries"; import { Lesson } from "src/app/shared/models/lesson.model"; import { TimetableEntry } from "src/app/shared/models/timetable-entry.model"; import { LessonPresencesRestService } from "src/app/shared/services/lesson-presences-rest.service"; import { StudentsRestService } from "src/app/shared/services/students-rest.service"; -import { uniqueLessons } from "src/app/presence-control/utils/lesson-entries"; import { UserSettingsService } from "src/app/shared/services/user-settings.service"; import { DashboardService } from "../../services/dashboard.service"; diff --git a/src/app/dashboard/components/dashboard/dashboard.component.spec.ts b/src/app/dashboard/components/dashboard/dashboard.component.spec.ts index d8898205c..a21599d11 100644 --- a/src/app/dashboard/components/dashboard/dashboard.component.spec.ts +++ b/src/app/dashboard/components/dashboard/dashboard.component.spec.ts @@ -1,15 +1,14 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { BehaviorSubject } from "rxjs"; - -import { DashboardComponent } from "./dashboard.component"; import { UserSettingsService } from "src/app/shared/services/user-settings.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { StorageService } from "../../../shared/services/storage.service"; import { DashboardService } from "../../services/dashboard.service"; +import { DashboardActionComponent } from "../dashboard-action/dashboard-action.component"; import { DashboardActionsComponent } from "../dashboard-actions/dashboard-actions.component"; import { DashboardSearchComponent } from "../dashboard-search/dashboard-search.component"; -import { DashboardActionComponent } from "../dashboard-action/dashboard-action.component"; import { DashboardTimetableComponent } from "../dashboard-timetable/dashboard-timetable.component"; +import { DashboardComponent } from "./dashboard.component"; describe("DashboardComponent", () => { let fixture: ComponentFixture; diff --git a/src/app/dashboard/dashboard-routing.module.ts b/src/app/dashboard/dashboard-routing.module.ts index 5297ad629..3150d5a4f 100644 --- a/src/app/dashboard/dashboard-routing.module.ts +++ b/src/app/dashboard/dashboard-routing.module.ts @@ -1,7 +1,7 @@ import { NgModule } from "@angular/core"; -import { Routes, RouterModule } from "@angular/router"; -import { DashboardComponent } from "./components/dashboard/dashboard.component"; +import { RouterModule, Routes } from "@angular/router"; import { dossierRoute } from "../shared/components/student-dossier/dossier-route"; +import { DashboardComponent } from "./components/dashboard/dashboard.component"; const routes: Routes = [ { diff --git a/src/app/dashboard/dashboard.module.ts b/src/app/dashboard/dashboard.module.ts index 3ae3265b7..305a44699 100644 --- a/src/app/dashboard/dashboard.module.ts +++ b/src/app/dashboard/dashboard.module.ts @@ -1,16 +1,15 @@ import { NgModule } from "@angular/core"; - +import { ConfirmAbsencesSelectionService } from "../shared/services/confirm-absences-selection.service"; import { SharedModule } from "../shared/shared.module"; -import { DashboardRoutingModule } from "./dashboard-routing.module"; -import { DashboardComponent } from "./components/dashboard/dashboard.component"; -import { DashboardSearchComponent } from "./components/dashboard-search/dashboard-search.component"; -import { DashboardActionsComponent } from "./components/dashboard-actions/dashboard-actions.component"; import { DashboardActionComponent } from "./components/dashboard-action/dashboard-action.component"; -import { DashboardTimetableComponent } from "./components/dashboard-timetable/dashboard-timetable.component"; +import { DashboardActionsComponent } from "./components/dashboard-actions/dashboard-actions.component"; +import { DashboardDeadlineComponent } from "./components/dashboard-deadline/dashboard-deadline.component"; +import { DashboardSearchComponent } from "./components/dashboard-search/dashboard-search.component"; import { DashboardTimetableTableComponent } from "./components/dashboard-timetable-table/dashboard-timetable-table.component"; +import { DashboardTimetableComponent } from "./components/dashboard-timetable/dashboard-timetable.component"; +import { DashboardComponent } from "./components/dashboard/dashboard.component"; +import { DashboardRoutingModule } from "./dashboard-routing.module"; import { DashboardService } from "./services/dashboard.service"; -import { DashboardDeadlineComponent } from "./components/dashboard-deadline/dashboard-deadline.component"; -import { ConfirmAbsencesSelectionService } from "../shared/services/confirm-absences-selection.service"; @NgModule({ declarations: [ diff --git a/src/app/dashboard/services/dashboard.service.spec.ts b/src/app/dashboard/services/dashboard.service.spec.ts index fab35e511..e6a9ea18c 100644 --- a/src/app/dashboard/services/dashboard.service.spec.ts +++ b/src/app/dashboard/services/dashboard.service.spec.ts @@ -1,8 +1,7 @@ import { TestBed } from "@angular/core/testing"; - -import { DashboardService } from "./dashboard.service"; import { buildTestModuleMetadata } from "../../../spec-helpers"; import { StorageService } from "../../shared/services/storage.service"; +import { DashboardService } from "./dashboard.service"; describe("DashboardService", () => { let service: DashboardService; diff --git a/src/app/dashboard/services/dashboard.service.ts b/src/app/dashboard/services/dashboard.service.ts index 91e755bc1..35f55ad9a 100644 --- a/src/app/dashboard/services/dashboard.service.ts +++ b/src/app/dashboard/services/dashboard.service.ts @@ -1,26 +1,26 @@ import { Inject, Injectable } from "@angular/core"; import { + Observable, + ReplaySubject, combineLatest, map, - Observable, of, - ReplaySubject, shareReplay, startWith, switchMap, } from "rxjs"; -import { Settings, SETTINGS } from "../../settings"; -import { UserSettingsService } from "../../shared/services/user-settings.service"; -import { LessonPresencesRestService } from "../../shared/services/lesson-presences-rest.service"; -import { StudentsRestService } from "../../shared/services/students-rest.service"; +import { SETTINGS, Settings } from "../../settings"; import { LessonAbsence } from "../../shared/models/lesson-absence.model"; -import { StorageService } from "../../shared/services/storage.service"; -import { CoursesRestService } from "../../shared/services/courses-rest.service"; import { LessonIncident } from "../../shared/models/lesson-incident.model"; import { TimetableEntry } from "../../shared/models/timetable-entry.model"; -import { notNull } from "../../shared/utils/filter"; -import { TeacherSubstitutionsRestService } from "../../shared/services/teacher-substitutions-rest.service"; +import { CoursesRestService } from "../../shared/services/courses-rest.service"; +import { LessonPresencesRestService } from "../../shared/services/lesson-presences-rest.service"; import { PersonsRestService } from "../../shared/services/persons-rest.service"; +import { StorageService } from "../../shared/services/storage.service"; +import { StudentsRestService } from "../../shared/services/students-rest.service"; +import { TeacherSubstitutionsRestService } from "../../shared/services/teacher-substitutions-rest.service"; +import { UserSettingsService } from "../../shared/services/user-settings.service"; +import { notNull } from "../../shared/utils/filter"; const SEARCH_ROLES = [ "LessonTeacherRole", diff --git a/src/app/edit-absences/components/edit-absences-edit/edit-absences-edit.component.spec.ts b/src/app/edit-absences/components/edit-absences-edit/edit-absences-edit.component.spec.ts index f23d45515..c445e0c46 100644 --- a/src/app/edit-absences/components/edit-absences-edit/edit-absences-edit.component.spec.ts +++ b/src/app/edit-absences/components/edit-absences-edit/edit-absences-edit.component.spec.ts @@ -1,16 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { HttpTestingController } from "@angular/common/http/testing"; -import { of, Observable } from "rxjs"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { isEqual } from "lodash-es"; - +import { Observable, of } from "rxjs"; +import { DropDownItem } from "src/app/shared/models/drop-down-item.model"; +import { PresenceType } from "src/app/shared/models/presence-type.model"; +import { DropDownItemsRestService } from "src/app/shared/services/drop-down-items-rest.service"; +import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; +import { buildLessonPresence, buildPresenceType } from "src/spec-builders"; import { buildTestModuleMetadata, settings } from "src/spec-helpers"; -import { EditAbsencesEditComponent } from "./edit-absences-edit.component"; import { EditAbsencesStateService } from "../../services/edit-absences-state.service"; -import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; -import { buildPresenceType, buildLessonPresence } from "src/spec-builders"; -import { DropDownItemsRestService } from "src/app/shared/services/drop-down-items-rest.service"; -import { PresenceType } from "src/app/shared/models/presence-type.model"; -import { DropDownItem } from "src/app/shared/models/drop-down-item.model"; +import { EditAbsencesEditComponent } from "./edit-absences-edit.component"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/edit-absences/components/edit-absences-edit/edit-absences-edit.component.ts b/src/app/edit-absences/components/edit-absences-edit/edit-absences-edit.component.ts index b977d483d..72df6a32b 100644 --- a/src/app/edit-absences/components/edit-absences-edit/edit-absences-edit.component.ts +++ b/src/app/edit-absences/components/edit-absences-edit/edit-absences-edit.component.ts @@ -12,32 +12,31 @@ import { } from "@angular/forms"; import { ActivatedRoute, Router } from "@angular/router"; import { TranslateService } from "@ngx-translate/core"; -import { BehaviorSubject, Subject, Observable } from "rxjs"; +import { uniq } from "lodash-es"; +import { BehaviorSubject, Observable, Subject } from "rxjs"; import { finalize, map, shareReplay, + switchMap, take, takeUntil, - switchMap, } from "rxjs/operators"; -import { uniq } from "lodash-es"; - import { SETTINGS, Settings } from "src/app/settings"; import { DropDownItem } from "src/app/shared/models/drop-down-item.model"; import { DropDownItemsRestService } from "src/app/shared/services/drop-down-items-rest.service"; +import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; import { - EditAbsencesUpdateService, - Category, -} from "../../services/edit-absences-update.service"; -import { - getValidationErrors, getControlValueChanges, + getValidationErrors, } from "src/app/shared/utils/form"; -import { EditAbsencesStateService } from "../../services/edit-absences-state.service"; import { parseQueryString } from "src/app/shared/utils/url"; -import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; import { ToastService } from "../../../shared/services/toast.service"; +import { EditAbsencesStateService } from "../../services/edit-absences-state.service"; +import { + Category, + EditAbsencesUpdateService, +} from "../../services/edit-absences-update.service"; @Component({ selector: "erz-edit-absences-edit", diff --git a/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.spec.ts b/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.spec.ts index fa8cf29b7..35ce84a04 100644 --- a/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.spec.ts +++ b/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.spec.ts @@ -1,9 +1,8 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { of } from "rxjs"; - import { buildTestModuleMetadata } from "src/spec-helpers"; -import { EditAbsencesHeaderComponent } from "./edit-absences-header.component"; import { EditAbsencesStateService } from "../../services/edit-absences-state.service"; +import { EditAbsencesHeaderComponent } from "./edit-absences-header.component"; describe("EditAbsencesHeaderComponent", () => { let component: EditAbsencesHeaderComponent; diff --git a/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.ts b/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.ts index b45efd350..32bd7870c 100644 --- a/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.ts +++ b/src/app/edit-absences/components/edit-absences-header/edit-absences-header.component.ts @@ -2,37 +2,36 @@ import { ChangeDetectionStrategy, Component, EventEmitter, - Output, Input, + Output, } from "@angular/core"; import { NgbDateAdapter, NgbDateNativeAdapter, NgbDateParserFormatter, } from "@ng-bootstrap/ng-bootstrap"; -import { map } from "rxjs/operators"; +import { TranslateService } from "@ngx-translate/core"; import { startOfDay } from "date-fns"; - -import { not } from "src/app/shared/utils/filter"; +import { map } from "rxjs/operators"; import { isComment, isIncident, } from "src/app/presence-control/utils/presence-types"; import { DateParserFormatter } from "src/app/shared/services/date-parser-formatter"; +import { StudentsRestService } from "src/app/shared/services/students-rest.service"; +import { StudyClassesRestService } from "src/app/shared/services/study-classes-rest.service"; +import { not } from "src/app/shared/utils/filter"; import { addGroupToDropdownItem, createPresenceTypesDropdownItems, sortPresenceTypes, } from "src/app/shared/utils/presence-types"; import { EducationalEventsRestService } from "../../../shared/services/educational-events-rest.service"; -import { StudentsRestService } from "src/app/shared/services/students-rest.service"; -import { StudyClassesRestService } from "src/app/shared/services/study-classes-rest.service"; +import { TeacherResourcesRestService } from "../../../shared/services/teacher-resources-rest.service"; import { EditAbsencesFilter, EditAbsencesStateService, } from "../../services/edit-absences-state.service"; -import { TranslateService } from "@ngx-translate/core"; -import { TeacherResourcesRestService } from "../../../shared/services/teacher-resources-rest.service"; @Component({ selector: "erz-edit-absences-header", diff --git a/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.spec.ts b/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.spec.ts index 7b6328c8b..19430fe33 100644 --- a/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.spec.ts +++ b/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.spec.ts @@ -1,12 +1,11 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { of } from "rxjs"; - +import { PresenceControlEntry } from "src/app/presence-control/models/presence-control-entry.model"; import { buildLessonPresence } from "src/spec-builders"; import { buildTestModuleMetadata, settings } from "src/spec-helpers"; import { EditAbsencesStateService } from "../../services/edit-absences-state.service"; -import { EditAbsencesListComponent } from "./edit-absences-list.component"; -import { PresenceControlEntry } from "src/app/presence-control/models/presence-control-entry.model"; import { EditAbsencesHeaderComponent } from "../edit-absences-header/edit-absences-header.component"; +import { EditAbsencesListComponent } from "./edit-absences-list.component"; describe("EditAbsencesListComponent", () => { let fixture: ComponentFixture; diff --git a/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.ts b/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.ts index a6eb3ffc1..d12dd7cdb 100644 --- a/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.ts +++ b/src/app/edit-absences/components/edit-absences-list/edit-absences-list.component.ts @@ -1,22 +1,21 @@ import { - Component, - OnInit, + AfterViewInit, ChangeDetectionStrategy, + Component, OnDestroy, - AfterViewInit, + OnInit, } from "@angular/core"; import { ActivatedRoute, Params } from "@angular/router"; import { Subject } from "rxjs"; -import { takeUntil, take, map, filter } from "rxjs/operators"; - -import { - EditAbsencesStateService, - EditAbsencesFilter, -} from "../../services/edit-absences-state.service"; -import { EditAbsencesSelectionService } from "../../services/edit-absences-selection.service"; +import { filter, map, take, takeUntil } from "rxjs/operators"; import { ScrollPositionService } from "src/app/shared/services/scroll-position.service"; import { parseISOLocalDate } from "src/app/shared/utils/date"; import { isTruthy } from "src/app/shared/utils/filter"; +import { EditAbsencesSelectionService } from "../../services/edit-absences-selection.service"; +import { + EditAbsencesFilter, + EditAbsencesStateService, +} from "../../services/edit-absences-state.service"; @Component({ selector: "erz-edit-absences-list", diff --git a/src/app/edit-absences/components/edit-absences/edit-absences.component.spec.ts b/src/app/edit-absences/components/edit-absences/edit-absences.component.spec.ts index f6d6a4ea5..137bc8a0f 100644 --- a/src/app/edit-absences/components/edit-absences/edit-absences.component.spec.ts +++ b/src/app/edit-absences/components/edit-absences/edit-absences.component.spec.ts @@ -1,9 +1,8 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - import { buildTestModuleMetadata } from "src/spec-helpers"; -import { EditAbsencesComponent } from "./edit-absences.component"; import { EditAbsencesHeaderComponent } from "../edit-absences-header/edit-absences-header.component"; import { EditAbsencesListComponent } from "../edit-absences-list/edit-absences-list.component"; +import { EditAbsencesComponent } from "./edit-absences.component"; describe("EditAbsencesComponent", () => { let component: EditAbsencesComponent; diff --git a/src/app/edit-absences/components/edit-absences/edit-absences.component.ts b/src/app/edit-absences/components/edit-absences/edit-absences.component.ts index 2a08fcfd0..f1edeb171 100644 --- a/src/app/edit-absences/components/edit-absences/edit-absences.component.ts +++ b/src/app/edit-absences/components/edit-absences/edit-absences.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component } from "@angular/core"; -import { EditAbsencesStateService } from "../../services/edit-absences-state.service"; import { CONFIRM_ABSENCES_SERVICE } from "src/app/shared/tokens/confirm-absences-service"; +import { EditAbsencesStateService } from "../../services/edit-absences-state.service"; @Component({ selector: "erz-edit-absences", diff --git a/src/app/edit-absences/edit-absences-routing.module.ts b/src/app/edit-absences/edit-absences-routing.module.ts index b940f2d5d..eefdc1ad0 100644 --- a/src/app/edit-absences/edit-absences-routing.module.ts +++ b/src/app/edit-absences/edit-absences-routing.module.ts @@ -1,9 +1,9 @@ import { NgModule } from "@angular/core"; -import { Routes, RouterModule } from "@angular/router"; -import { EditAbsencesComponent } from "./components/edit-absences/edit-absences.component"; -import { EditAbsencesListComponent } from "./components/edit-absences-list/edit-absences-list.component"; -import { EditAbsencesEditComponent } from "./components/edit-absences-edit/edit-absences-edit.component"; +import { RouterModule, Routes } from "@angular/router"; import { dossierRoute } from "../shared/components/student-dossier/dossier-route"; +import { EditAbsencesEditComponent } from "./components/edit-absences-edit/edit-absences-edit.component"; +import { EditAbsencesListComponent } from "./components/edit-absences-list/edit-absences-list.component"; +import { EditAbsencesComponent } from "./components/edit-absences/edit-absences.component"; const routes: Routes = [ { diff --git a/src/app/edit-absences/edit-absences.module.ts b/src/app/edit-absences/edit-absences.module.ts index 1636b3ee4..27bd0caec 100644 --- a/src/app/edit-absences/edit-absences.module.ts +++ b/src/app/edit-absences/edit-absences.module.ts @@ -1,12 +1,11 @@ import { NgModule } from "@angular/core"; - +import { ConfirmAbsencesSelectionService } from "../shared/services/confirm-absences-selection.service"; import { SharedModule } from "../shared/shared.module"; -import { EditAbsencesRoutingModule } from "./edit-absences-routing.module"; -import { EditAbsencesComponent } from "./components/edit-absences/edit-absences.component"; +import { EditAbsencesEditComponent } from "./components/edit-absences-edit/edit-absences-edit.component"; import { EditAbsencesHeaderComponent } from "./components/edit-absences-header/edit-absences-header.component"; import { EditAbsencesListComponent } from "./components/edit-absences-list/edit-absences-list.component"; -import { EditAbsencesEditComponent } from "./components/edit-absences-edit/edit-absences-edit.component"; -import { ConfirmAbsencesSelectionService } from "../shared/services/confirm-absences-selection.service"; +import { EditAbsencesComponent } from "./components/edit-absences/edit-absences.component"; +import { EditAbsencesRoutingModule } from "./edit-absences-routing.module"; @NgModule({ declarations: [ diff --git a/src/app/edit-absences/services/edit-absences-selection.service.ts b/src/app/edit-absences/services/edit-absences-selection.service.ts index e99f33276..f2d5c4e86 100644 --- a/src/app/edit-absences/services/edit-absences-selection.service.ts +++ b/src/app/edit-absences/services/edit-absences-selection.service.ts @@ -1,7 +1,6 @@ import { Injectable } from "@angular/core"; - -import { SelectionService } from "src/app/shared/services/selection.service"; import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; +import { SelectionService } from "src/app/shared/services/selection.service"; @Injectable() export class EditAbsencesSelectionService extends SelectionService {} diff --git a/src/app/edit-absences/services/edit-absences-state.service.spec.ts b/src/app/edit-absences/services/edit-absences-state.service.spec.ts index 9b3e6482b..991ad4f1f 100644 --- a/src/app/edit-absences/services/edit-absences-state.service.spec.ts +++ b/src/app/edit-absences/services/edit-absences-state.service.spec.ts @@ -1,7 +1,6 @@ import { TestBed } from "@angular/core/testing"; - -import { EditAbsencesStateService } from "./edit-absences-state.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { EditAbsencesStateService } from "./edit-absences-state.service"; describe("EditAbsencesStateService", () => { beforeEach(() => diff --git a/src/app/edit-absences/services/edit-absences-state.service.ts b/src/app/edit-absences/services/edit-absences-state.service.ts index d9d0af9e3..2d1829a62 100644 --- a/src/app/edit-absences/services/edit-absences-state.service.ts +++ b/src/app/edit-absences/services/edit-absences-state.service.ts @@ -1,28 +1,27 @@ -import { Injectable, Inject } from "@angular/core"; import { Location } from "@angular/common"; +import { Inject, Injectable } from "@angular/core"; import { Params } from "@angular/router"; -import { combineLatest, Observable } from "rxjs"; +import { Observable, combineLatest } from "rxjs"; import { map, shareReplay, takeUntil } from "rxjs/operators"; - +import { SETTINGS, Settings } from "src/app/settings"; import { DropDownItem } from "src/app/shared/models/drop-down-item.model"; import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; import { PresenceType } from "src/app/shared/models/presence-type.model"; import { DropDownItemsRestService } from "src/app/shared/services/drop-down-items-rest.service"; import { LessonPresencesRestService } from "src/app/shared/services/lesson-presences-rest.service"; import { LoadingService } from "src/app/shared/services/loading-service"; -import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; -import { sortDropDownItemsByValue } from "src/app/shared/utils/drop-down-items"; -import { spread } from "src/app/shared/utils/function"; -import { buildParamsFromAbsenceFilter } from "src/app/shared/utils/absences-filter"; import { - PaginatedEntriesService, PAGE_LOADING_CONTEXT, + PaginatedEntriesService, } from "src/app/shared/services/paginated-entries.service"; -import { Paginated } from "src/app/shared/utils/pagination"; -import { SETTINGS, Settings } from "src/app/settings"; +import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; +import { SortService } from "src/app/shared/services/sort.service"; import { IConfirmAbsencesService } from "src/app/shared/tokens/confirm-absences-service"; +import { buildParamsFromAbsenceFilter } from "src/app/shared/utils/absences-filter"; +import { sortDropDownItemsByValue } from "src/app/shared/utils/drop-down-items"; +import { spread } from "src/app/shared/utils/function"; +import { Paginated } from "src/app/shared/utils/pagination"; import { buildPresenceControlEntries } from "../../shared/utils/presence-control-entries"; -import { SortService } from "src/app/shared/services/sort.service"; export interface EditAbsencesFilter { student: Option; diff --git a/src/app/edit-absences/services/edit-absences-update.service.spec.ts b/src/app/edit-absences/services/edit-absences-update.service.spec.ts index dd8458d59..3aa5e0875 100644 --- a/src/app/edit-absences/services/edit-absences-update.service.spec.ts +++ b/src/app/edit-absences/services/edit-absences-update.service.spec.ts @@ -1,7 +1,6 @@ import { TestBed } from "@angular/core/testing"; - -import { EditAbsencesUpdateService } from "./edit-absences-update.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { EditAbsencesUpdateService } from "./edit-absences-update.service"; describe("EditAbsencesUpdateService", () => { let service: EditAbsencesUpdateService; diff --git a/src/app/edit-absences/services/edit-absences-update.service.ts b/src/app/edit-absences/services/edit-absences-update.service.ts index 4b70ebf3c..b98a6ca71 100644 --- a/src/app/edit-absences/services/edit-absences-update.service.ts +++ b/src/app/edit-absences/services/edit-absences-update.service.ts @@ -1,13 +1,12 @@ -import { Injectable, Inject } from "@angular/core"; +import { Inject, Injectable } from "@angular/core"; import { Observable, combineLatest } from "rxjs"; import { map } from "rxjs/operators"; - -import { LessonPresencesUpdateRestService } from "src/app/shared/services/lesson-presences-update-rest.service"; -import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; -import { getIdsGroupedByPerson } from "src/app/shared/utils/lesson-presences"; import { SETTINGS, Settings } from "src/app/settings"; +import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; import { PresenceType } from "src/app/shared/models/presence-type.model"; +import { LessonPresencesUpdateRestService } from "src/app/shared/services/lesson-presences-update-rest.service"; import { not } from "src/app/shared/utils/filter"; +import { getIdsGroupedByPerson } from "src/app/shared/utils/lesson-presences"; export enum Category { Absent = "absent", diff --git a/src/app/evaluate-absences/components/evaluate-absences-header/evaluate-absences-header.component.spec.ts b/src/app/evaluate-absences/components/evaluate-absences-header/evaluate-absences-header.component.spec.ts index 81ee76ce3..acec287e0 100644 --- a/src/app/evaluate-absences/components/evaluate-absences-header/evaluate-absences-header.component.spec.ts +++ b/src/app/evaluate-absences/components/evaluate-absences-header/evaluate-absences-header.component.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { EvaluateAbsencesHeaderComponent } from "./evaluate-absences-header.component"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { EvaluateAbsencesStateService } from "../../services/evaluate-absences-state.service"; +import { EvaluateAbsencesHeaderComponent } from "./evaluate-absences-header.component"; describe("EvaluateAbsencesHeaderComponent", () => { let component: EvaluateAbsencesHeaderComponent; diff --git a/src/app/evaluate-absences/components/evaluate-absences-header/evaluate-absences-header.component.ts b/src/app/evaluate-absences/components/evaluate-absences-header/evaluate-absences-header.component.ts index 1675444ea..a38a58691 100644 --- a/src/app/evaluate-absences/components/evaluate-absences-header/evaluate-absences-header.component.ts +++ b/src/app/evaluate-absences/components/evaluate-absences-header/evaluate-absences-header.component.ts @@ -1,14 +1,13 @@ import { - Component, ChangeDetectionStrategy, - Output, + Component, EventEmitter, Input, + Output, } from "@angular/core"; - import { StudentsRestService } from "src/app/shared/services/students-rest.service"; -import { EducationalEventsRestService } from "../../../shared/services/educational-events-rest.service"; import { StudyClassesRestService } from "src/app/shared/services/study-classes-rest.service"; +import { EducationalEventsRestService } from "../../../shared/services/educational-events-rest.service"; import { EvaluateAbsencesFilter } from "../../services/evaluate-absences-state.service"; @Component({ diff --git a/src/app/evaluate-absences/components/evaluate-absences-list/evaluate-absences-list.component.spec.ts b/src/app/evaluate-absences/components/evaluate-absences-list/evaluate-absences-list.component.spec.ts index cb06fc14f..56c21a7b8 100644 --- a/src/app/evaluate-absences/components/evaluate-absences-list/evaluate-absences-list.component.spec.ts +++ b/src/app/evaluate-absences/components/evaluate-absences-list/evaluate-absences-list.component.spec.ts @@ -1,14 +1,13 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { EvaluateAbsencesListComponent } from "./evaluate-absences-list.component"; -import { EvaluateAbsencesHeaderComponent } from "../evaluate-absences-header/evaluate-absences-header.component"; -import { buildTestModuleMetadata } from "src/spec-helpers"; -import { EvaluateAbsencesStateService } from "../../services/evaluate-absences-state.service"; import { of } from "rxjs"; import { LessonPresenceStatistic } from "src/app/shared/models/lesson-presence-statistic"; +import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; import { buildLessonPresenceStatistic } from "src/spec-builders"; +import { buildTestModuleMetadata } from "src/spec-helpers"; import { StorageService } from "../../../shared/services/storage.service"; -import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; +import { EvaluateAbsencesStateService } from "../../services/evaluate-absences-state.service"; +import { EvaluateAbsencesHeaderComponent } from "../evaluate-absences-header/evaluate-absences-header.component"; +import { EvaluateAbsencesListComponent } from "./evaluate-absences-list.component"; describe("EvaluateAbsencesListComponent", () => { let fixture: ComponentFixture; diff --git a/src/app/evaluate-absences/components/evaluate-absences-list/evaluate-absences-list.component.ts b/src/app/evaluate-absences/components/evaluate-absences-list/evaluate-absences-list.component.ts index 9bff4ebbd..11f9a0107 100644 --- a/src/app/evaluate-absences/components/evaluate-absences-list/evaluate-absences-list.component.ts +++ b/src/app/evaluate-absences/components/evaluate-absences-list/evaluate-absences-list.component.ts @@ -1,26 +1,25 @@ import { + AfterViewInit, + ChangeDetectionStrategy, Component, OnInit, - ChangeDetectionStrategy, - AfterViewInit, } from "@angular/core"; import { ActivatedRoute, Params } from "@angular/router"; import { Observable } from "rxjs"; -import { map, switchMap, take, shareReplay } from "rxjs/operators"; - -import { - EvaluateAbsencesStateService, - EvaluateAbsencesFilter, -} from "../../services/evaluate-absences-state.service"; +import { map, shareReplay, switchMap, take } from "rxjs/operators"; import { LessonPresenceStatistic } from "src/app/shared/models/lesson-presence-statistic"; import { ScrollPositionService } from "src/app/shared/services/scroll-position.service"; +import { LessonPresence } from "../../../shared/models/lesson-presence.model"; +import { LessonPresencesRestService } from "../../../shared/services/lesson-presences-rest.service"; import { PresenceTypesService } from "../../../shared/services/presence-types.service"; import { ReportInfo, ReportsService, } from "../../../shared/services/reports.service"; -import { LessonPresencesRestService } from "../../../shared/services/lesson-presences-rest.service"; -import { LessonPresence } from "../../../shared/models/lesson-presence.model"; +import { + EvaluateAbsencesFilter, + EvaluateAbsencesStateService, +} from "../../services/evaluate-absences-state.service"; interface Column { key: keyof LessonPresenceStatistic; diff --git a/src/app/evaluate-absences/components/evaluate-absences/evaluate-absences.component.spec.ts b/src/app/evaluate-absences/components/evaluate-absences/evaluate-absences.component.spec.ts index d5112b599..f5986724c 100644 --- a/src/app/evaluate-absences/components/evaluate-absences/evaluate-absences.component.spec.ts +++ b/src/app/evaluate-absences/components/evaluate-absences/evaluate-absences.component.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - import { buildTestModuleMetadata } from "src/spec-helpers"; -import { EvaluateAbsencesComponent } from "./evaluate-absences.component"; import { EvaluateAbsencesModule } from "../../evaluate-absences.module"; +import { EvaluateAbsencesComponent } from "./evaluate-absences.component"; describe("EvaluateAbsencesComponent", () => { let component: EvaluateAbsencesComponent; diff --git a/src/app/evaluate-absences/components/evaluate-absences/evaluate-absences.component.ts b/src/app/evaluate-absences/components/evaluate-absences/evaluate-absences.component.ts index 601490c20..109400376 100644 --- a/src/app/evaluate-absences/components/evaluate-absences/evaluate-absences.component.ts +++ b/src/app/evaluate-absences/components/evaluate-absences/evaluate-absences.component.ts @@ -1,6 +1,6 @@ -import { Component, ChangeDetectionStrategy } from "@angular/core"; -import { EvaluateAbsencesStateService } from "../../services/evaluate-absences-state.service"; +import { ChangeDetectionStrategy, Component } from "@angular/core"; import { CONFIRM_ABSENCES_SERVICE } from "src/app/shared/tokens/confirm-absences-service"; +import { EvaluateAbsencesStateService } from "../../services/evaluate-absences-state.service"; @Component({ selector: "erz-evaluate-absences", diff --git a/src/app/evaluate-absences/evaluate-absences-routing.module.ts b/src/app/evaluate-absences/evaluate-absences-routing.module.ts index eb63b92c8..b853de09c 100644 --- a/src/app/evaluate-absences/evaluate-absences-routing.module.ts +++ b/src/app/evaluate-absences/evaluate-absences-routing.module.ts @@ -1,8 +1,8 @@ import { NgModule } from "@angular/core"; -import { Routes, RouterModule } from "@angular/router"; -import { EvaluateAbsencesComponent } from "./components/evaluate-absences/evaluate-absences.component"; -import { EvaluateAbsencesListComponent } from "./components/evaluate-absences-list/evaluate-absences-list.component"; +import { RouterModule, Routes } from "@angular/router"; import { dossierRoute } from "../shared/components/student-dossier/dossier-route"; +import { EvaluateAbsencesListComponent } from "./components/evaluate-absences-list/evaluate-absences-list.component"; +import { EvaluateAbsencesComponent } from "./components/evaluate-absences/evaluate-absences.component"; const routes: Routes = [ { diff --git a/src/app/evaluate-absences/evaluate-absences.module.ts b/src/app/evaluate-absences/evaluate-absences.module.ts index 17ada36d2..44d9d8475 100644 --- a/src/app/evaluate-absences/evaluate-absences.module.ts +++ b/src/app/evaluate-absences/evaluate-absences.module.ts @@ -1,11 +1,10 @@ import { NgModule } from "@angular/core"; - +import { ConfirmAbsencesSelectionService } from "../shared/services/confirm-absences-selection.service"; import { SharedModule } from "../shared/shared.module"; -import { EvaluateAbsencesRoutingModule } from "./evaluate-absences-routing.module"; -import { EvaluateAbsencesComponent } from "./components/evaluate-absences/evaluate-absences.component"; import { EvaluateAbsencesHeaderComponent } from "./components/evaluate-absences-header/evaluate-absences-header.component"; import { EvaluateAbsencesListComponent } from "./components/evaluate-absences-list/evaluate-absences-list.component"; -import { ConfirmAbsencesSelectionService } from "../shared/services/confirm-absences-selection.service"; +import { EvaluateAbsencesComponent } from "./components/evaluate-absences/evaluate-absences.component"; +import { EvaluateAbsencesRoutingModule } from "./evaluate-absences-routing.module"; @NgModule({ declarations: [ diff --git a/src/app/evaluate-absences/services/evaluate-absences-state.service.spec.ts b/src/app/evaluate-absences/services/evaluate-absences-state.service.spec.ts index 780225aea..af10ada82 100644 --- a/src/app/evaluate-absences/services/evaluate-absences-state.service.spec.ts +++ b/src/app/evaluate-absences/services/evaluate-absences-state.service.spec.ts @@ -1,7 +1,6 @@ import { TestBed } from "@angular/core/testing"; - -import { EvaluateAbsencesStateService } from "./evaluate-absences-state.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { EvaluateAbsencesStateService } from "./evaluate-absences-state.service"; describe("EvaluateAbsencesStateService", () => { beforeEach(() => diff --git a/src/app/evaluate-absences/services/evaluate-absences-state.service.ts b/src/app/evaluate-absences/services/evaluate-absences-state.service.ts index 6a38d9a1d..3545405ad 100644 --- a/src/app/evaluate-absences/services/evaluate-absences-state.service.ts +++ b/src/app/evaluate-absences/services/evaluate-absences-state.service.ts @@ -11,7 +11,7 @@ import { PAGE_LOADING_CONTEXT, PaginatedEntriesService, } from "src/app/shared/services/paginated-entries.service"; -import { Sorting, SortService } from "src/app/shared/services/sort.service"; +import { SortService, Sorting } from "src/app/shared/services/sort.service"; import { IConfirmAbsencesService } from "src/app/shared/tokens/confirm-absences-service"; import { buildParamsFromAbsenceFilter } from "src/app/shared/utils/absences-filter"; import { Paginated } from "src/app/shared/utils/pagination"; diff --git a/src/app/events/components/events-current/events-current.component.spec.ts b/src/app/events/components/events-current/events-current.component.spec.ts index 564aa568c..fa736e7af 100644 --- a/src/app/events/components/events-current/events-current.component.spec.ts +++ b/src/app/events/components/events-current/events-current.component.spec.ts @@ -1,9 +1,8 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; - -import { EventsCurrentComponent } from "./events-current.component"; +import { StorageService } from "src/app/shared/services/storage.service"; import { buildTestModuleMetadata } from "../../../../spec-helpers"; import { EventsListComponent } from "../events-list/events-list.component"; -import { StorageService } from "src/app/shared/services/storage.service"; +import { EventsCurrentComponent } from "./events-current.component"; describe("EventsCurrentComponent", () => { let component: EventsCurrentComponent; diff --git a/src/app/events/components/events-list/events-list.component.spec.ts b/src/app/events/components/events-list/events-list.component.spec.ts index ed922330c..ad45383cf 100644 --- a/src/app/events/components/events-list/events-list.component.spec.ts +++ b/src/app/events/components/events-list/events-list.component.spec.ts @@ -1,11 +1,10 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { BehaviorSubject, of } from "rxjs"; import { buildTestModuleMetadata } from "src/spec-helpers"; -import { EventsStateService } from "../../services/events-state.service"; - -import { EventsListComponent } from "./events-list.component"; import { buildEvent } from "../../../../spec-builders"; import { StorageService } from "../../../shared/services/storage.service"; +import { EventsStateService } from "../../services/events-state.service"; +import { EventsListComponent } from "./events-list.component"; describe("EventsListComponent", () => { let component: EventsListComponent; diff --git a/src/app/events/components/events-list/events-list.component.ts b/src/app/events/components/events-list/events-list.component.ts index 492926ba6..75d61df23 100644 --- a/src/app/events/components/events-list/events-list.component.ts +++ b/src/app/events/components/events-list/events-list.component.ts @@ -1,6 +1,6 @@ import { Component, Input } from "@angular/core"; -import { EventsStateService } from "../../services/events-state.service"; import { StorageService } from "../../../shared/services/storage.service"; +import { EventsStateService } from "../../services/events-state.service"; @Component({ selector: "erz-events-list", diff --git a/src/app/events/components/events-tests/events-tests.component.spec.ts b/src/app/events/components/events-tests/events-tests.component.spec.ts index b80e6fe18..032ed89cd 100644 --- a/src/app/events/components/events-tests/events-tests.component.spec.ts +++ b/src/app/events/components/events-tests/events-tests.component.spec.ts @@ -1,9 +1,8 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; - -import { EventsTestsComponent } from "./events-tests.component"; +import { StorageService } from "src/app/shared/services/storage.service"; import { buildTestModuleMetadata } from "../../../../spec-helpers"; import { EventsListComponent } from "../events-list/events-list.component"; -import { StorageService } from "src/app/shared/services/storage.service"; +import { EventsTestsComponent } from "./events-tests.component"; describe("EventsTestsComponent", () => { let component: EventsTestsComponent; diff --git a/src/app/events/components/events/events.component.spec.ts b/src/app/events/components/events/events.component.spec.ts index 4051b4040..77a49ad8b 100644 --- a/src/app/events/components/events/events.component.spec.ts +++ b/src/app/events/components/events/events.component.spec.ts @@ -1,6 +1,5 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { EventsComponent } from "./events.component"; describe("EventsComponent", () => { diff --git a/src/app/events/components/grades/average-grades/average-grades.component.spec.ts b/src/app/events/components/grades/average-grades/average-grades.component.spec.ts index ac91877b7..ed8d16dd7 100644 --- a/src/app/events/components/grades/average-grades/average-grades.component.spec.ts +++ b/src/app/events/components/grades/average-grades/average-grades.component.spec.ts @@ -1,10 +1,9 @@ +import { DecimalPipe } from "@angular/common"; import { ComponentFixture, TestBed } from "@angular/core/testing"; import { Test } from "src/app/shared/models/test.model"; import { buildResult, buildTest } from "src/spec-builders"; import { expectNotInTheDocument, expectText } from "src/specs/expectations"; - import { AverageGradesComponent } from "./average-grades.component"; -import { DecimalPipe } from "@angular/common"; describe("AverageGradesComponent", () => { let component: AverageGradesComponent; diff --git a/src/app/events/components/test-edit-grades/test-edit-grades.component.spec.ts b/src/app/events/components/test-edit-grades/test-edit-grades.component.spec.ts index a5301e4b5..01d3aeee2 100644 --- a/src/app/events/components/test-edit-grades/test-edit-grades.component.spec.ts +++ b/src/app/events/components/test-edit-grades/test-edit-grades.component.spec.ts @@ -1,10 +1,10 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { BehaviorSubject, of } from "rxjs"; +import { Test } from "src/app/shared/models/test.model"; import { buildCourse, buildResult, buildTest } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { TestStateService } from "../../services/test-state.service"; import { TestEditGradesComponent } from "./test-edit-grades.component"; -import { Test } from "src/app/shared/models/test.model"; describe("TestEditGradesComponent", () => { let component: TestEditGradesComponent; diff --git a/src/app/events/components/test-edit-grades/test-edit-grades.component.ts b/src/app/events/components/test-edit-grades/test-edit-grades.component.ts index 6a27955de..a8200a78f 100644 --- a/src/app/events/components/test-edit-grades/test-edit-grades.component.ts +++ b/src/app/events/components/test-edit-grades/test-edit-grades.component.ts @@ -1,5 +1,7 @@ import { Component, Input, OnInit } from "@angular/core"; import { NgbModal, NgbModalRef } from "@ng-bootstrap/ng-bootstrap"; +import { Observable } from "rxjs"; +import { map, take } from "rxjs/operators"; import { PublishTestComponent } from "src/app/events/components/tests-publish/publish-test.component"; import { TestGradesResult, @@ -15,8 +17,6 @@ import { EventsStateService } from "../../services/events-state.service"; import { Filter, TestStateService } from "../../services/test-state.service"; import { getEventState } from "../../utils/events"; import { averageGrade, averagePoints } from "../../utils/tests"; -import { map, take } from "rxjs/operators"; -import { Observable } from "rxjs"; @Component({ selector: "erz-test-edit-grades", diff --git a/src/app/events/components/test-table-header/test-table-header.component.spec.ts b/src/app/events/components/test-table-header/test-table-header.component.spec.ts index 35d6af238..1116287a3 100644 --- a/src/app/events/components/test-table-header/test-table-header.component.spec.ts +++ b/src/app/events/components/test-table-header/test-table-header.component.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { buildTest } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { TestTableHeaderComponent } from "./test-table-header.component"; describe("TestTableHeaderComponent", () => { diff --git a/src/app/events/components/tests-edit-form/tests-edit-form.component.spec.ts b/src/app/events/components/tests-edit-form/tests-edit-form.component.spec.ts index 8f968951d..380c2d4f4 100644 --- a/src/app/events/components/tests-edit-form/tests-edit-form.component.spec.ts +++ b/src/app/events/components/tests-edit-form/tests-edit-form.component.spec.ts @@ -1,9 +1,8 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; -import { buildTestModuleMetadata } from "src/spec-helpers"; import { buildTest } from "src/spec-builders"; - -import { TestsEditFormComponent } from "./tests-edit-form.component"; +import { buildTestModuleMetadata } from "src/spec-helpers"; import { TestStateService } from "../../services/test-state.service"; +import { TestsEditFormComponent } from "./tests-edit-form.component"; describe("TestsEditFormComponent", () => { let component: TestsEditFormComponent; diff --git a/src/app/events/components/tests-edit-form/tests-edit-form.component.ts b/src/app/events/components/tests-edit-form/tests-edit-form.component.ts index 5cb854eb7..8102c4f33 100644 --- a/src/app/events/components/tests-edit-form/tests-edit-form.component.ts +++ b/src/app/events/components/tests-edit-form/tests-edit-form.component.ts @@ -17,17 +17,16 @@ import { NgbDateParserFormatter, } from "@ng-bootstrap/ng-bootstrap"; import { TranslateService } from "@ngx-translate/core"; -import { BehaviorSubject, of, Subject, takeUntil } from "rxjs"; import { uniqueId } from "lodash-es"; - +import { BehaviorSubject, Subject, of, takeUntil } from "rxjs"; import { Test } from "src/app/shared/models/test.model"; import { DateParserFormatter } from "src/app/shared/services/date-parser-formatter"; import { getControlValueChanges, getValidationErrors, } from "src/app/shared/utils/form"; -import { TestStateService } from "../../services/test-state.service"; import { greaterThanValidator } from "src/app/shared/validators/greater-than.validator"; +import { TestStateService } from "../../services/test-state.service"; @Component({ selector: "erz-tests-edit-form", diff --git a/src/app/events/components/tests-edit/tests-delete/tests-delete.component.spec.ts b/src/app/events/components/tests-edit/tests-delete/tests-delete.component.spec.ts index 38d3fe315..d9fa0adbe 100644 --- a/src/app/events/components/tests-edit/tests-delete/tests-delete.component.spec.ts +++ b/src/app/events/components/tests-edit/tests-delete/tests-delete.component.spec.ts @@ -1,11 +1,10 @@ +import { DebugElement } from "@angular/core"; import { ComponentFixture, TestBed } from "@angular/core/testing"; - -import { TestsDeleteComponent } from "./tests-delete.component"; import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; -import { buildTestModuleMetadata } from "../../../../../spec-helpers"; import { buildResult, buildTest } from "src/spec-builders"; -import { DebugElement } from "@angular/core"; import { byTestId } from "src/specs/utils"; +import { buildTestModuleMetadata } from "../../../../../spec-helpers"; +import { TestsDeleteComponent } from "./tests-delete.component"; describe("TestsDeleteComponent", () => { let component: TestsDeleteComponent; diff --git a/src/app/events/components/tests-edit/tests-delete/tests-delete.component.ts b/src/app/events/components/tests-edit/tests-delete/tests-delete.component.ts index 18f5c4034..517a56a19 100644 --- a/src/app/events/components/tests-edit/tests-delete/tests-delete.component.ts +++ b/src/app/events/components/tests-edit/tests-delete/tests-delete.component.ts @@ -1,6 +1,6 @@ import { Component, Input } from "@angular/core"; -import { Test } from "../../../../shared/models/test.model"; import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { Test } from "../../../../shared/models/test.model"; @Component({ selector: "erz-tests-delete", diff --git a/src/app/events/components/tests-edit/tests-edit.component.spec.ts b/src/app/events/components/tests-edit/tests-edit.component.spec.ts index c94ac4bf5..ad15cffcb 100644 --- a/src/app/events/components/tests-edit/tests-edit.component.spec.ts +++ b/src/app/events/components/tests-edit/tests-edit.component.spec.ts @@ -6,7 +6,6 @@ import { buildCourse, buildTest } from "src/spec-builders"; import { ActivatedRouteMock, buildTestModuleMetadata } from "src/spec-helpers"; import { TestStateService } from "../../services/test-state.service"; import { TestsEditFormComponent } from "../tests-edit-form/tests-edit-form.component"; - import { TestsEditComponent } from "./tests-edit.component"; describe("TestsEditComponent", () => { diff --git a/src/app/events/components/tests-edit/tests-edit.component.ts b/src/app/events/components/tests-edit/tests-edit.component.ts index 356c4fe47..989777c03 100644 --- a/src/app/events/components/tests-edit/tests-edit.component.ts +++ b/src/app/events/components/tests-edit/tests-edit.component.ts @@ -1,5 +1,6 @@ import { Component } from "@angular/core"; import { ActivatedRoute, Router } from "@angular/router"; +import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; import { TranslateService } from "@ngx-translate/core"; import { BehaviorSubject, @@ -9,13 +10,12 @@ import { map, switchMap, } from "rxjs"; +import { take } from "rxjs/operators"; import { Test } from "src/app/shared/models/test.model"; import { CoursesRestService } from "src/app/shared/services/courses-rest.service"; +import { ToastService } from "../../../shared/services/toast.service"; import { TestStateService } from "../../services/test-state.service"; -import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; import { TestsDeleteComponent } from "./tests-delete/tests-delete.component"; -import { take } from "rxjs/operators"; -import { ToastService } from "../../../shared/services/toast.service"; @Component({ selector: "erz-tests-edit", diff --git a/src/app/events/components/tests-header/tests-header.component.spec.ts b/src/app/events/components/tests-header/tests-header.component.spec.ts index ef7fc017e..0489be4ed 100644 --- a/src/app/events/components/tests-header/tests-header.component.spec.ts +++ b/src/app/events/components/tests-header/tests-header.component.spec.ts @@ -1,10 +1,9 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { of } from "rxjs"; import { buildCourse } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; -import { of } from "rxjs"; - -import { TestsHeaderComponent } from "./tests-header.component"; import { ReportsService } from "../../../shared/services/reports.service"; +import { TestsHeaderComponent } from "./tests-header.component"; describe("TestsHeaderComponent", () => { let component: TestsHeaderComponent; diff --git a/src/app/events/components/tests-header/tests-header.component.ts b/src/app/events/components/tests-header/tests-header.component.ts index 9453557ef..c464cc3b2 100644 --- a/src/app/events/components/tests-header/tests-header.component.ts +++ b/src/app/events/components/tests-header/tests-header.component.ts @@ -1,11 +1,11 @@ import { Component, Input } from "@angular/core"; import { Observable } from "rxjs"; +import { EventsRestService } from "src/app/shared/services/events-rest.service"; import { Course } from "../../../shared/models/course.model"; import { ReportInfo, ReportsService, } from "../../../shared/services/reports.service"; -import { EventsRestService } from "src/app/shared/services/events-rest.service"; @Component({ selector: "erz-tests-header", diff --git a/src/app/events/components/tests-list/tests-list.component.spec.ts b/src/app/events/components/tests-list/tests-list.component.spec.ts index 68abf954f..2f3a5bdaf 100644 --- a/src/app/events/components/tests-list/tests-list.component.spec.ts +++ b/src/app/events/components/tests-list/tests-list.component.spec.ts @@ -1,17 +1,16 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { BehaviorSubject, of } from "rxjs"; - +import { Course } from "src/app/shared/models/course.model"; +import { Result, Test } from "src/app/shared/models/test.model"; import { ReportsService } from "src/app/shared/services/reports.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; -import { TestStateService } from "../../services/test-state.service"; -import { TestsHeaderComponent } from "../tests-header/tests-header.component"; -import { TestsListComponent } from "./tests-list.component"; import { buildCourse, buildResult, buildTest } from "../../../../spec-builders"; +import { TestStateService } from "../../services/test-state.service"; +import { AverageGradesComponent } from "../grades/average-grades/average-grades.component"; import { TestEditGradesComponent } from "../test-edit-grades/test-edit-grades.component"; import { TestTableHeaderComponent } from "../test-table-header/test-table-header.component"; -import { AverageGradesComponent } from "../grades/average-grades/average-grades.component"; -import { Result, Test } from "src/app/shared/models/test.model"; -import { Course } from "src/app/shared/models/course.model"; +import { TestsHeaderComponent } from "../tests-header/tests-header.component"; +import { TestsListComponent } from "./tests-list.component"; describe("TestsListComponent", () => { let component: TestsListComponent; diff --git a/src/app/events/components/tests-list/tests-list.component.ts b/src/app/events/components/tests-list/tests-list.component.ts index 43715b9b3..1df11d6a2 100644 --- a/src/app/events/components/tests-list/tests-list.component.ts +++ b/src/app/events/components/tests-list/tests-list.component.ts @@ -1,10 +1,10 @@ import { Component, Inject } from "@angular/core"; import { TranslateService } from "@ngx-translate/core"; -import { merge, Observable, Subject } from "rxjs"; +import { Observable, Subject, merge } from "rxjs"; import { distinctUntilChanged, map, switchMap, take } from "rxjs/operators"; import { Test } from "src/app/shared/models/test.model"; +import { SETTINGS, Settings } from "../../../settings"; import { TestStateService } from "../../services/test-state.service"; -import { Settings, SETTINGS } from "../../../settings"; @Component({ selector: "erz-tests-list", diff --git a/src/app/events/components/tests-publish/publish-test.component.spec.ts b/src/app/events/components/tests-publish/publish-test.component.spec.ts index bb35bee38..aa10aba11 100644 --- a/src/app/events/components/tests-publish/publish-test.component.spec.ts +++ b/src/app/events/components/tests-publish/publish-test.component.spec.ts @@ -4,7 +4,6 @@ import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; import { buildTest } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { byTestId } from "src/specs/utils"; - import { PublishTestComponent } from "./publish-test.component"; describe("PublishTestComponent", () => { diff --git a/src/app/events/components/tests/tests.component.spec.ts b/src/app/events/components/tests/tests.component.spec.ts index ea935cd22..b923bbbd2 100644 --- a/src/app/events/components/tests/tests.component.spec.ts +++ b/src/app/events/components/tests/tests.component.spec.ts @@ -1,6 +1,5 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { TestsComponent } from "./tests.component"; describe("TestsComponent", () => { diff --git a/src/app/events/components/tests/tests.component.ts b/src/app/events/components/tests/tests.component.ts index f59a342bc..7af0f8567 100644 --- a/src/app/events/components/tests/tests.component.ts +++ b/src/app/events/components/tests/tests.component.ts @@ -1,8 +1,8 @@ import { Component, OnDestroy, OnInit } from "@angular/core"; -import { TestStateService } from "../../services/test-state.service"; +import { ActivatedRoute } from "@angular/router"; import { Observable, Subject } from "rxjs"; import { distinctUntilChanged, map, takeUntil } from "rxjs/operators"; -import { ActivatedRoute } from "@angular/router"; +import { TestStateService } from "../../services/test-state.service"; @Component({ selector: "erz-tests", diff --git a/src/app/events/events-routing.module.ts b/src/app/events/events-routing.module.ts index 8c2154262..57c52bdb1 100644 --- a/src/app/events/events-routing.module.ts +++ b/src/app/events/events-routing.module.ts @@ -1,13 +1,13 @@ import { NgModule } from "@angular/core"; import { RouterModule, Routes } from "@angular/router"; -import { EventsComponent } from "./components/events/events.component"; -import { TestsComponent } from "./components/tests/tests.component"; -import { TestsListComponent } from "./components/tests-list/tests-list.component"; -import { TestsEditComponent } from "./components/tests-edit/tests-edit.component"; -import { TestsAddComponent } from "./components/tests-add/tests-add.component"; import { dossierRoute } from "../shared/components/student-dossier/dossier-route"; -import { EventsTestsComponent } from "./components/events-tests/events-tests.component"; import { EventsCurrentComponent } from "./components/events-current/events-current.component"; +import { EventsTestsComponent } from "./components/events-tests/events-tests.component"; +import { EventsComponent } from "./components/events/events.component"; +import { TestsAddComponent } from "./components/tests-add/tests-add.component"; +import { TestsEditComponent } from "./components/tests-edit/tests-edit.component"; +import { TestsListComponent } from "./components/tests-list/tests-list.component"; +import { TestsComponent } from "./components/tests/tests.component"; const routes: Routes = [ { diff --git a/src/app/events/events.module.ts b/src/app/events/events.module.ts index f581a70d0..31e8488a5 100644 --- a/src/app/events/events.module.ts +++ b/src/app/events/events.module.ts @@ -1,26 +1,25 @@ import { NgModule } from "@angular/core"; - +import { ConfirmAbsencesSelectionService } from "../shared/services/confirm-absences-selection.service"; import { SharedModule } from "../shared/shared.module"; -import { EventsRoutingModule } from "./events-routing.module"; -import { EventsComponent } from "./components/events/events.component"; -import { TestsComponent } from "./components/tests/tests.component"; -import { TestsListComponent } from "./components/tests-list/tests-list.component"; +import { EventsCurrentComponent } from "./components/events-current/events-current.component"; import { EventsListComponent } from "./components/events-list/events-list.component"; -import { TestsHeaderComponent } from "./components/tests-header/tests-header.component"; -import { TestEditGradesComponent } from "./components/test-edit-grades/test-edit-grades.component"; +import { EventsTestsComponent } from "./components/events-tests/events-tests.component"; +import { EventsComponent } from "./components/events/events.component"; import { GradeComponent } from "./components/grade/grade.component"; -import { TestsAddComponent } from "./components/tests-add/tests-add.component"; +import { AverageGradesComponent } from "./components/grades/average-grades/average-grades.component"; +import { GradeSelectComponent } from "./components/grades/grade-select/grade-select.component"; +import { TestEditGradesComponent } from "./components/test-edit-grades/test-edit-grades.component"; import { TestTableHeaderComponent } from "./components/test-table-header/test-table-header.component"; -import { TestSummaryShortPipe } from "./pipes/test-summary-short.pipe"; -import { TestsEditComponent } from "./components/tests-edit/tests-edit.component"; +import { TestsAddComponent } from "./components/tests-add/tests-add.component"; import { TestsEditFormComponent } from "./components/tests-edit-form/tests-edit-form.component"; -import { PublishTestComponent } from "./components/tests-publish/publish-test.component"; import { TestsDeleteComponent } from "./components/tests-edit/tests-delete/tests-delete.component"; -import { AverageGradesComponent } from "./components/grades/average-grades/average-grades.component"; -import { GradeSelectComponent } from "./components/grades/grade-select/grade-select.component"; -import { ConfirmAbsencesSelectionService } from "../shared/services/confirm-absences-selection.service"; -import { EventsTestsComponent } from "./components/events-tests/events-tests.component"; -import { EventsCurrentComponent } from "./components/events-current/events-current.component"; +import { TestsEditComponent } from "./components/tests-edit/tests-edit.component"; +import { TestsHeaderComponent } from "./components/tests-header/tests-header.component"; +import { TestsListComponent } from "./components/tests-list/tests-list.component"; +import { PublishTestComponent } from "./components/tests-publish/publish-test.component"; +import { TestsComponent } from "./components/tests/tests.component"; +import { EventsRoutingModule } from "./events-routing.module"; +import { TestSummaryShortPipe } from "./pipes/test-summary-short.pipe"; @NgModule({ declarations: [ diff --git a/src/app/events/pipes/test-summary-short.pipe.spec.ts b/src/app/events/pipes/test-summary-short.pipe.spec.ts index 78558f50e..543e9b645 100644 --- a/src/app/events/pipes/test-summary-short.pipe.spec.ts +++ b/src/app/events/pipes/test-summary-short.pipe.spec.ts @@ -1,4 +1,4 @@ -import { waitForAsync, TestBed } from "@angular/core/testing"; +import { TestBed, waitForAsync } from "@angular/core/testing"; import { TranslateService } from "@ngx-translate/core"; import { Test } from "src/app/shared/models/test.model"; import { buildTest } from "src/spec-builders"; diff --git a/src/app/events/services/events-state.service.spec.ts b/src/app/events/services/events-state.service.spec.ts index b8fe2034f..a9cb66e1a 100644 --- a/src/app/events/services/events-state.service.spec.ts +++ b/src/app/events/services/events-state.service.spec.ts @@ -9,7 +9,7 @@ import { buildStudyClass, } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; -import { Event, EventsStateService, EventState } from "./events-state.service"; +import { Event, EventState, EventsStateService } from "./events-state.service"; describe("EventsStateService", () => { let service: EventsStateService; diff --git a/src/app/events/services/events-state.service.ts b/src/app/events/services/events-state.service.ts index 3b47df7d2..9f655e997 100644 --- a/src/app/events/services/events-state.service.ts +++ b/src/app/events/services/events-state.service.ts @@ -3,16 +3,17 @@ import { TranslateService } from "@ngx-translate/core"; import { format } from "date-fns"; import { BehaviorSubject, + Observable, combineLatest, map, - Observable, shareReplay, switchMap, } from "rxjs"; -import { Settings, SETTINGS } from "src/app/settings"; +import { SETTINGS, Settings } from "src/app/settings"; import { Course } from "src/app/shared/models/course.model"; import { StudyClass } from "src/app/shared/models/study-class.model"; import { CoursesRestService } from "src/app/shared/services/courses-rest.service"; +import { EventsRestService } from "src/app/shared/services/events-rest.service"; import { LoadingService } from "src/app/shared/services/loading-service"; import { StorageService } from "src/app/shared/services/storage.service"; import { StudyClassesRestService } from "src/app/shared/services/study-classes-rest.service"; @@ -20,7 +21,6 @@ import { spread } from "src/app/shared/utils/function"; import { hasRole } from "src/app/shared/utils/roles"; import { searchEntries } from "src/app/shared/utils/search"; import { EventStateWithLabel, getEventState, isRated } from "../utils/events"; -import { EventsRestService } from "src/app/shared/services/events-rest.service"; export enum EventState { Rating = "rating", diff --git a/src/app/events/services/test-state.service.spec.ts b/src/app/events/services/test-state.service.spec.ts index 5df224c57..2bff15a0f 100644 --- a/src/app/events/services/test-state.service.spec.ts +++ b/src/app/events/services/test-state.service.spec.ts @@ -1,7 +1,6 @@ import { TestBed } from "@angular/core/testing"; - -import { TestStateService } from "./test-state.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { TestStateService } from "./test-state.service"; describe("TestStateService", () => { let service: TestStateService; diff --git a/src/app/events/services/test-state.service.ts b/src/app/events/services/test-state.service.ts index 2901df0ba..af7807873 100644 --- a/src/app/events/services/test-state.service.ts +++ b/src/app/events/services/test-state.service.ts @@ -1,17 +1,18 @@ import { Injectable } from "@angular/core"; +import { uniq } from "lodash-es"; import { BehaviorSubject, + Observable, + ReplaySubject, combineLatest, merge, - Observable, of, - ReplaySubject, scan, shareReplay, } from "rxjs"; +import { filter, map, switchMap, take } from "rxjs/operators"; import { CoursesRestService } from "src/app/shared/services/courses-rest.service"; import { LoadingService } from "src/app/shared/services/loading-service"; -import { filter, map, switchMap, take } from "rxjs/operators"; import { Course, Grading, @@ -19,24 +20,23 @@ import { TestPointsResult, UpdatedTestResultResponse, } from "../../shared/models/course.model"; -import { notNull } from "../../shared/utils/filter"; -import { courseReducer, TestsAction } from "../utils/course-reducer"; -import { Test } from "../../shared/models/test.model"; -import { spread } from "../../shared/utils/function"; -import { uniq } from "lodash-es"; +import { DropDownItem } from "../../shared/models/drop-down-item.model"; import { + SortKeys, + StudentGrade, averageOfGradesForScale, compareFn, meanOf, pluckFinalGrades, - SortKeys, - StudentGrade, transform, } from "../../shared/models/student-grades"; -import { Sorting, SortService } from "../../shared/services/sort.service"; +import { Test } from "../../shared/models/test.model"; import { GradingScalesRestService } from "../../shared/services/grading-scales-rest.service"; import { GradingsRestService } from "../../shared/services/gradings-rest.service"; -import { DropDownItem } from "../../shared/models/drop-down-item.model"; +import { SortService, Sorting } from "../../shared/services/sort.service"; +import { notNull } from "../../shared/utils/filter"; +import { spread } from "../../shared/utils/function"; +import { TestsAction, courseReducer } from "../utils/course-reducer"; import { canSetFinalGrade } from "../utils/events"; import { sortByDate } from "../utils/tests"; diff --git a/src/app/events/utils/course-reducer.ts b/src/app/events/utils/course-reducer.ts index dc34bdd52..4c96a0f7e 100644 --- a/src/app/events/utils/course-reducer.ts +++ b/src/app/events/utils/course-reducer.ts @@ -1,7 +1,7 @@ import { Course, Grading } from "../../shared/models/course.model"; import { Result } from "../../shared/models/test.model"; -import { removeTestById, replaceResult, toggleIsPublished } from "./tests"; import { changeGrading, replaceGrading } from "./gradings"; +import { removeTestById, replaceResult, toggleIsPublished } from "./tests"; export type TestsAction = | { type: "reset"; payload: Course } diff --git a/src/app/events/utils/events.spec.ts b/src/app/events/utils/events.spec.ts index 69581a36e..2c6a256d5 100644 --- a/src/app/events/utils/events.spec.ts +++ b/src/app/events/utils/events.spec.ts @@ -1,7 +1,7 @@ -import { canSetFinalGrade, getEventState, isRated } from "./events"; +import { EvaluationStatusRef } from "src/app/shared/models/course.model"; import { buildCourse, buildFinalGrading } from "../../../spec-builders"; import { EventState } from "../services/events-state.service"; -import { EvaluationStatusRef } from "src/app/shared/models/course.model"; +import { canSetFinalGrade, getEventState, isRated } from "./events"; describe("Course utils", () => { describe("Get course state", () => { diff --git a/src/app/events/utils/tests.spec.ts b/src/app/events/utils/tests.spec.ts index 8e9f6d4b9..91dcdb3c3 100644 --- a/src/app/events/utils/tests.spec.ts +++ b/src/app/events/utils/tests.spec.ts @@ -1,5 +1,6 @@ import { Result, Test } from "src/app/shared/models/test.model"; import { buildGradingScale, buildResult, buildTest } from "src/spec-builders"; +import { GradingScale } from "../../shared/models/grading-scale.model"; import { averageGrade, averagePoints, @@ -11,7 +12,6 @@ import { sortByDate, toggleIsPublished, } from "./tests"; -import { GradingScale } from "../../shared/models/grading-scale.model"; describe("Test utils", () => { describe("update test results", () => { diff --git a/src/app/global-error-handler.ts b/src/app/global-error-handler.ts index 345ec3cdf..df9b000af 100644 --- a/src/app/global-error-handler.ts +++ b/src/app/global-error-handler.ts @@ -1,5 +1,5 @@ -import { Injectable, ErrorHandler, NgZone } from "@angular/core"; import { HttpErrorResponse } from "@angular/common/http"; +import { ErrorHandler, Injectable, NgZone } from "@angular/core"; import { TranslateService } from "@ngx-translate/core"; import { ToastService } from "./shared/services/toast.service"; diff --git a/src/app/home.component.spec.ts b/src/app/home.component.spec.ts index ed65171f5..05480ff91 100644 --- a/src/app/home.component.spec.ts +++ b/src/app/home.component.spec.ts @@ -1,5 +1,4 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - import { buildTestModuleMetadata } from "src/spec-helpers"; import { HomeComponent } from "./home.component"; diff --git a/src/app/home.component.ts b/src/app/home.component.ts index 4564871b6..eb95ccc75 100644 --- a/src/app/home.component.ts +++ b/src/app/home.component.ts @@ -1,4 +1,4 @@ -import { Component, ChangeDetectionStrategy } from "@angular/core"; +import { ChangeDetectionStrategy, Component } from "@angular/core"; interface Section { path: string; diff --git a/src/app/my-absences/components/my-absences-confirm/my-absences-abstract-confirm.component.ts b/src/app/my-absences/components/my-absences-confirm/my-absences-abstract-confirm.component.ts index 8f0a79dc3..cdf6db75a 100644 --- a/src/app/my-absences/components/my-absences-confirm/my-absences-abstract-confirm.component.ts +++ b/src/app/my-absences/components/my-absences-confirm/my-absences-abstract-confirm.component.ts @@ -1,4 +1,4 @@ -import { OnInit, Component, OnDestroy } from "@angular/core"; +import { Component, OnDestroy, OnInit } from "@angular/core"; import { UntypedFormBuilder, UntypedFormGroup, @@ -6,16 +6,15 @@ import { } from "@angular/forms"; import { Router } from "@angular/router"; import { TranslateService } from "@ngx-translate/core"; -import { BehaviorSubject, combineLatest, Observable, Subject, of } from "rxjs"; -import { finalize, map, filter, switchMap, take } from "rxjs/operators"; - +import { BehaviorSubject, Observable, Subject, combineLatest, of } from "rxjs"; +import { filter, finalize, map, switchMap, take } from "rxjs/operators"; +import { Settings } from "src/app/settings"; +import { PresenceType } from "src/app/shared/models/presence-type.model"; import { LessonPresencesUpdateRestService } from "src/app/shared/services/lesson-presences-update-rest.service"; import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; -import { getValidationErrors } from "src/app/shared/utils/form"; -import { Settings } from "src/app/settings"; import { StorageService } from "src/app/shared/services/storage.service"; -import { PresenceType } from "src/app/shared/models/presence-type.model"; import { isEmptyArray } from "src/app/shared/utils/array"; +import { getValidationErrors } from "src/app/shared/utils/form"; import { ToastService } from "../../../shared/services/toast.service"; @Component({ diff --git a/src/app/my-absences/components/my-absences-confirm/my-absences-confirm.component.spec.ts b/src/app/my-absences/components/my-absences-confirm/my-absences-confirm.component.spec.ts index 4b67b2db0..42548ef7c 100644 --- a/src/app/my-absences/components/my-absences-confirm/my-absences-confirm.component.spec.ts +++ b/src/app/my-absences/components/my-absences-confirm/my-absences-confirm.component.spec.ts @@ -1,10 +1,9 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { of } from "rxjs"; - -import { MyAbsencesConfirmComponent } from "./my-absences-confirm.component"; +import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { MyAbsencesService } from "../../services/my-absences.service"; -import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; +import { MyAbsencesConfirmComponent } from "./my-absences-confirm.component"; describe("MyAbsencesConfirmComponent", () => { let component: MyAbsencesConfirmComponent; diff --git a/src/app/my-absences/components/my-absences-confirm/my-absences-confirm.component.ts b/src/app/my-absences/components/my-absences-confirm/my-absences-confirm.component.ts index 27dc59605..55247602f 100644 --- a/src/app/my-absences/components/my-absences-confirm/my-absences-confirm.component.ts +++ b/src/app/my-absences/components/my-absences-confirm/my-absences-confirm.component.ts @@ -1,18 +1,17 @@ -import { Component, Inject, ChangeDetectionStrategy } from "@angular/core"; +import { ChangeDetectionStrategy, Component, Inject } from "@angular/core"; import { UntypedFormBuilder } from "@angular/forms"; import { Router } from "@angular/router"; import { TranslateService } from "@ngx-translate/core"; +import { flatten, uniq } from "lodash-es"; import { map } from "rxjs/operators"; - -import { MyAbsencesAbstractConfirmComponent } from "./my-absences-abstract-confirm.component"; +import { SETTINGS, Settings } from "src/app/settings"; +import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; import { LessonPresencesUpdateRestService } from "src/app/shared/services/lesson-presences-update-rest.service"; import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; -import { SETTINGS, Settings } from "src/app/settings"; -import { MyAbsencesService } from "../../services/my-absences.service"; import { StorageService } from "src/app/shared/services/storage.service"; -import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; -import { uniq, flatten } from "lodash-es"; import { ToastService } from "../../../shared/services/toast.service"; +import { MyAbsencesService } from "../../services/my-absences.service"; +import { MyAbsencesAbstractConfirmComponent } from "./my-absences-abstract-confirm.component"; @Component({ selector: "erz-my-absences-confirm", diff --git a/src/app/my-absences/components/my-absences-confirm/my-absences-report-confirm.component.ts b/src/app/my-absences/components/my-absences-confirm/my-absences-report-confirm.component.ts index 8eb37bb27..03854c9bd 100644 --- a/src/app/my-absences/components/my-absences-confirm/my-absences-report-confirm.component.ts +++ b/src/app/my-absences/components/my-absences-confirm/my-absences-report-confirm.component.ts @@ -1,20 +1,19 @@ -import { Component, Inject, ChangeDetectionStrategy } from "@angular/core"; +import { ChangeDetectionStrategy, Component, Inject } from "@angular/core"; import { UntypedFormBuilder } from "@angular/forms"; import { Router } from "@angular/router"; import { TranslateService } from "@ngx-translate/core"; +import { flatten, uniq } from "lodash-es"; import { Observable } from "rxjs"; import { map, take } from "rxjs/operators"; - -import { MyAbsencesAbstractConfirmComponent } from "./my-absences-abstract-confirm.component"; +import { SETTINGS, Settings } from "src/app/settings"; +import { PresenceType } from "src/app/shared/models/presence-type.model"; import { LessonPresencesUpdateRestService } from "src/app/shared/services/lesson-presences-update-rest.service"; import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; -import { SETTINGS, Settings } from "src/app/settings"; import { StorageService } from "src/app/shared/services/storage.service"; -import { MyAbsencesReportStateService } from "../../services/my-absences-report-state.service"; -import { MyAbsencesReportSelectionService } from "../../services/my-absences-report-selection.service"; -import { PresenceType } from "src/app/shared/models/presence-type.model"; -import { flatten, uniq } from "lodash-es"; import { ToastService } from "../../../shared/services/toast.service"; +import { MyAbsencesReportSelectionService } from "../../services/my-absences-report-selection.service"; +import { MyAbsencesReportStateService } from "../../services/my-absences-report-state.service"; +import { MyAbsencesAbstractConfirmComponent } from "./my-absences-abstract-confirm.component"; @Component({ selector: "erz-my-absences-confirm", diff --git a/src/app/my-absences/components/my-absences-report-header/my-absences-report-header.component.spec.ts b/src/app/my-absences/components/my-absences-report-header/my-absences-report-header.component.spec.ts index a73c545a5..d6b3d0ed9 100644 --- a/src/app/my-absences/components/my-absences-report-header/my-absences-report-header.component.spec.ts +++ b/src/app/my-absences/components/my-absences-report-header/my-absences-report-header.component.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { MyAbsencesReportHeaderComponent } from "./my-absences-report-header.component"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { MyAbsencesReportHeaderComponent } from "./my-absences-report-header.component"; describe("MyAbsencesReportHeaderComponent", () => { let component: MyAbsencesReportHeaderComponent; diff --git a/src/app/my-absences/components/my-absences-report-header/my-absences-report-header.component.ts b/src/app/my-absences/components/my-absences-report-header/my-absences-report-header.component.ts index 34b2b59c9..a7e377f17 100644 --- a/src/app/my-absences/components/my-absences-report-header/my-absences-report-header.component.ts +++ b/src/app/my-absences/components/my-absences-report-header/my-absences-report-header.component.ts @@ -1,17 +1,16 @@ import { + ChangeDetectionStrategy, Component, + EventEmitter, Input, Output, - EventEmitter, - ChangeDetectionStrategy, } from "@angular/core"; import { NgbDateAdapter, - NgbDateParserFormatter, NgbDateNativeAdapter, + NgbDateParserFormatter, } from "@ng-bootstrap/ng-bootstrap"; import { startOfDay } from "date-fns"; - import { DateParserFormatter } from "src/app/shared/services/date-parser-formatter"; import { ReportAbsencesFilter } from "../../services/my-absences-report-state.service"; diff --git a/src/app/my-absences/components/my-absences-report-link/my-absences-report-link.component.spec.ts b/src/app/my-absences/components/my-absences-report-link/my-absences-report-link.component.spec.ts index 264ce4781..077ecb217 100644 --- a/src/app/my-absences/components/my-absences-report-link/my-absences-report-link.component.spec.ts +++ b/src/app/my-absences/components/my-absences-report-link/my-absences-report-link.component.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { MyAbsencesReportLinkComponent } from "../my-absences-report-link/my-absences-report-link.component"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { MyAbsencesReportLinkComponent } from "../my-absences-report-link/my-absences-report-link.component"; describe("MyAbsencesEditLinkComponent", () => { let component: MyAbsencesReportLinkComponent; diff --git a/src/app/my-absences/components/my-absences-report-link/my-absences-report-link.component.ts b/src/app/my-absences/components/my-absences-report-link/my-absences-report-link.component.ts index 107df0553..c3b5c87ca 100644 --- a/src/app/my-absences/components/my-absences-report-link/my-absences-report-link.component.ts +++ b/src/app/my-absences/components/my-absences-report-link/my-absences-report-link.component.ts @@ -1,9 +1,9 @@ import { - Component, ChangeDetectionStrategy, + Component, + ElementRef, HostListener, ViewChild, - ElementRef, } from "@angular/core"; @Component({ diff --git a/src/app/my-absences/components/my-absences-report-list/my-absences-report-list.component.spec.ts b/src/app/my-absences/components/my-absences-report-list/my-absences-report-list.component.spec.ts index 1682138fc..ae9453a90 100644 --- a/src/app/my-absences/components/my-absences-report-list/my-absences-report-list.component.spec.ts +++ b/src/app/my-absences/components/my-absences-report-list/my-absences-report-list.component.spec.ts @@ -1,11 +1,10 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { of } from "rxjs"; - -import { MyAbsencesReportListComponent } from "./my-absences-report-list.component"; import { buildTestModuleMetadata } from "src/spec-helpers"; -import { MyAbsencesReportStateService } from "../../services/my-absences-report-state.service"; import { MyAbsencesReportSelectionService } from "../../services/my-absences-report-selection.service"; +import { MyAbsencesReportStateService } from "../../services/my-absences-report-state.service"; import { MyAbsencesReportHeaderComponent } from "../my-absences-report-header/my-absences-report-header.component"; +import { MyAbsencesReportListComponent } from "./my-absences-report-list.component"; describe("MyAbsencesReportListComponent", () => { let component: MyAbsencesReportListComponent; diff --git a/src/app/my-absences/components/my-absences-report-list/my-absences-report-list.component.ts b/src/app/my-absences/components/my-absences-report-list/my-absences-report-list.component.ts index a95eb6959..131f668b4 100644 --- a/src/app/my-absences/components/my-absences-report-list/my-absences-report-list.component.ts +++ b/src/app/my-absences/components/my-absences-report-list/my-absences-report-list.component.ts @@ -1,32 +1,31 @@ import { - Component, - OnInit, - ChangeDetectionStrategy, AfterViewInit, - OnDestroy, + ChangeDetectionStrategy, + Component, Inject, + OnDestroy, + OnInit, } from "@angular/core"; import { ActivatedRoute, Params } from "@angular/router"; -import { Subject, Observable, combineLatest } from "rxjs"; -import { map, take, takeUntil, switchMap } from "rxjs/operators"; - -import { parseISOLocalDate } from "src/app/shared/utils/date"; -import { not } from "src/app/shared/utils/filter"; -import { - ReportAbsencesFilter, - MyAbsencesReportStateService, -} from "../../services/my-absences-report-state.service"; -import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; -import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; -import { isAbsent } from "src/app/presence-control/utils/presence-types"; -import { SETTINGS, Settings } from "src/app/settings"; +import { Observable, Subject, combineLatest } from "rxjs"; +import { map, switchMap, take, takeUntil } from "rxjs/operators"; import { PresenceCategory, getPresenceCategoryIcon, } from "src/app/presence-control/models/presence-control-entry.model"; +import { isAbsent } from "src/app/presence-control/utils/presence-types"; +import { SETTINGS, Settings } from "src/app/settings"; +import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; import { PresenceType } from "src/app/shared/models/presence-type.model"; -import { MyAbsencesReportSelectionService } from "../../services/my-absences-report-selection.service"; +import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; import { ScrollPositionService } from "src/app/shared/services/scroll-position.service"; +import { parseISOLocalDate } from "src/app/shared/utils/date"; +import { not } from "src/app/shared/utils/filter"; +import { MyAbsencesReportSelectionService } from "../../services/my-absences-report-selection.service"; +import { + MyAbsencesReportStateService, + ReportAbsencesFilter, +} from "../../services/my-absences-report-state.service"; @Component({ selector: "erz-my-absences-report-list", diff --git a/src/app/my-absences/components/my-absences-report/my-absences-report.component.spec.ts b/src/app/my-absences/components/my-absences-report/my-absences-report.component.spec.ts index d4696c7b1..06747eb57 100644 --- a/src/app/my-absences/components/my-absences-report/my-absences-report.component.spec.ts +++ b/src/app/my-absences/components/my-absences-report/my-absences-report.component.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { MyAbsencesReportComponent } from "./my-absences-report.component"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { MyAbsencesReportComponent } from "./my-absences-report.component"; describe("MyAbsencesReportComponent", () => { let component: MyAbsencesReportComponent; diff --git a/src/app/my-absences/components/my-absences-report/my-absences-report.component.ts b/src/app/my-absences/components/my-absences-report/my-absences-report.component.ts index 5e64edccf..9a901aedc 100644 --- a/src/app/my-absences/components/my-absences-report/my-absences-report.component.ts +++ b/src/app/my-absences/components/my-absences-report/my-absences-report.component.ts @@ -1,6 +1,6 @@ -import { Component, ChangeDetectionStrategy } from "@angular/core"; -import { MyAbsencesReportStateService } from "../../services/my-absences-report-state.service"; +import { ChangeDetectionStrategy, Component } from "@angular/core"; import { MyAbsencesReportSelectionService } from "../../services/my-absences-report-selection.service"; +import { MyAbsencesReportStateService } from "../../services/my-absences-report-state.service"; @Component({ selector: "erz-my-absences-report", diff --git a/src/app/my-absences/components/my-absences-show/my-absences-show.component.spec.ts b/src/app/my-absences/components/my-absences-show/my-absences-show.component.spec.ts index 329a4d78c..a01173f0c 100644 --- a/src/app/my-absences/components/my-absences-show/my-absences-show.component.spec.ts +++ b/src/app/my-absences/components/my-absences-show/my-absences-show.component.spec.ts @@ -1,14 +1,13 @@ -import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { HttpTestingController } from "@angular/common/http/testing"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { BehaviorSubject, of } from "rxjs"; - -import { MyAbsencesShowComponent } from "./my-absences-show.component"; +import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; +import { StorageService } from "src/app/shared/services/storage.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { buildLessonAbsence } from "../../../../spec-builders"; import { MyAbsencesService } from "../../services/my-absences.service"; import { MyAbsencesReportLinkComponent } from "../my-absences-report-link/my-absences-report-link.component"; -import { StorageService } from "src/app/shared/services/storage.service"; -import { buildLessonAbsence } from "../../../../spec-builders"; -import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; +import { MyAbsencesShowComponent } from "./my-absences-show.component"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/my-absences/components/my-absences-show/my-absences-show.component.ts b/src/app/my-absences/components/my-absences-show/my-absences-show.component.ts index 8c45c20fc..c2d1181b8 100644 --- a/src/app/my-absences/components/my-absences-show/my-absences-show.component.ts +++ b/src/app/my-absences/components/my-absences-show/my-absences-show.component.ts @@ -1,9 +1,7 @@ import { ChangeDetectionStrategy, Component } from "@angular/core"; -import { combineLatest, Observable, of } from "rxjs"; -import { map, shareReplay, switchMap } from "rxjs/operators"; import { flatten, uniq } from "lodash-es"; - -import { MyAbsencesService } from "../../services/my-absences.service"; +import { Observable, combineLatest, of } from "rxjs"; +import { map, shareReplay, switchMap } from "rxjs/operators"; import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; import { ReportInfo, @@ -11,6 +9,7 @@ import { } from "src/app/shared/services/reports.service"; import { LessonAbsence } from "../../../shared/models/lesson-absence.model"; import { LessonIncident } from "../../../shared/models/lesson-incident.model"; +import { MyAbsencesService } from "../../services/my-absences.service"; @Component({ selector: "erz-my-absences-show", diff --git a/src/app/my-absences/components/my-absences/my-absences.component.spec.ts b/src/app/my-absences/components/my-absences/my-absences.component.spec.ts index 5acbd6817..74dfbc2e2 100644 --- a/src/app/my-absences/components/my-absences/my-absences.component.spec.ts +++ b/src/app/my-absences/components/my-absences/my-absences.component.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { MyAbsencesComponent } from "./my-absences.component"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { MyAbsencesComponent } from "./my-absences.component"; describe("MyAbsencesComponent", () => { let component: MyAbsencesComponent; diff --git a/src/app/my-absences/components/my-absences/my-absences.component.ts b/src/app/my-absences/components/my-absences/my-absences.component.ts index 812ac1c15..9e47a196a 100644 --- a/src/app/my-absences/components/my-absences/my-absences.component.ts +++ b/src/app/my-absences/components/my-absences/my-absences.component.ts @@ -1,4 +1,4 @@ -import { Component, ChangeDetectionStrategy } from "@angular/core"; +import { ChangeDetectionStrategy, Component } from "@angular/core"; import { MyAbsencesService } from "../../services/my-absences.service"; @Component({ diff --git a/src/app/my-absences/my-absences-routing.module.ts b/src/app/my-absences/my-absences-routing.module.ts index f6d9df32d..d47f02a41 100644 --- a/src/app/my-absences/my-absences-routing.module.ts +++ b/src/app/my-absences/my-absences-routing.module.ts @@ -1,11 +1,11 @@ import { NgModule } from "@angular/core"; -import { Routes, RouterModule } from "@angular/router"; -import { MyAbsencesComponent } from "./components/my-absences/my-absences.component"; -import { MyAbsencesShowComponent } from "./components/my-absences-show/my-absences-show.component"; +import { RouterModule, Routes } from "@angular/router"; import { MyAbsencesConfirmComponent } from "./components/my-absences-confirm/my-absences-confirm.component"; -import { MyAbsencesReportComponent } from "./components/my-absences-report/my-absences-report.component"; -import { MyAbsencesReportListComponent } from "./components/my-absences-report-list/my-absences-report-list.component"; import { MyAbsencesReportConfirmComponent } from "./components/my-absences-confirm/my-absences-report-confirm.component"; +import { MyAbsencesReportListComponent } from "./components/my-absences-report-list/my-absences-report-list.component"; +import { MyAbsencesReportComponent } from "./components/my-absences-report/my-absences-report.component"; +import { MyAbsencesShowComponent } from "./components/my-absences-show/my-absences-show.component"; +import { MyAbsencesComponent } from "./components/my-absences/my-absences.component"; const routes: Routes = [ { diff --git a/src/app/my-absences/my-absences.module.ts b/src/app/my-absences/my-absences.module.ts index 522a5afa4..c42850c77 100644 --- a/src/app/my-absences/my-absences.module.ts +++ b/src/app/my-absences/my-absences.module.ts @@ -1,15 +1,15 @@ import { NgModule } from "@angular/core"; +import { ConfirmAbsencesSelectionService } from "../shared/services/confirm-absences-selection.service"; import { SharedModule } from "../shared/shared.module"; -import { MyAbsencesRoutingModule } from "./my-absences-routing.module"; -import { MyAbsencesComponent } from "./components/my-absences/my-absences.component"; -import { MyAbsencesShowComponent } from "./components/my-absences-show/my-absences-show.component"; -import { MyAbsencesReportComponent } from "./components/my-absences-report/my-absences-report.component"; -import { MyAbsencesReportLinkComponent } from "./components/my-absences-report-link/my-absences-report-link.component"; import { MyAbsencesConfirmComponent } from "./components/my-absences-confirm/my-absences-confirm.component"; +import { MyAbsencesReportConfirmComponent } from "./components/my-absences-confirm/my-absences-report-confirm.component"; import { MyAbsencesReportHeaderComponent } from "./components/my-absences-report-header/my-absences-report-header.component"; +import { MyAbsencesReportLinkComponent } from "./components/my-absences-report-link/my-absences-report-link.component"; import { MyAbsencesReportListComponent } from "./components/my-absences-report-list/my-absences-report-list.component"; -import { MyAbsencesReportConfirmComponent } from "./components/my-absences-confirm/my-absences-report-confirm.component"; -import { ConfirmAbsencesSelectionService } from "../shared/services/confirm-absences-selection.service"; +import { MyAbsencesReportComponent } from "./components/my-absences-report/my-absences-report.component"; +import { MyAbsencesShowComponent } from "./components/my-absences-show/my-absences-show.component"; +import { MyAbsencesComponent } from "./components/my-absences/my-absences.component"; +import { MyAbsencesRoutingModule } from "./my-absences-routing.module"; @NgModule({ declarations: [ diff --git a/src/app/my-absences/services/my-absences-report-selection.service.ts b/src/app/my-absences/services/my-absences-report-selection.service.ts index 52dd71ee4..8ea6ba403 100644 --- a/src/app/my-absences/services/my-absences-report-selection.service.ts +++ b/src/app/my-absences/services/my-absences-report-selection.service.ts @@ -1,8 +1,7 @@ import { Injectable } from "@angular/core"; import { map } from "rxjs/operators"; - -import { SelectionService } from "../../shared/services/selection.service"; import { LessonPresence } from "../../shared/models/lesson-presence.model"; +import { SelectionService } from "../../shared/services/selection.service"; import { getIdsGroupedByPerson } from "../../shared/utils/lesson-presences"; @Injectable() diff --git a/src/app/my-absences/services/my-absences-report-state.service.spec.ts b/src/app/my-absences/services/my-absences-report-state.service.spec.ts index ee9168fa3..2e1d944f4 100644 --- a/src/app/my-absences/services/my-absences-report-state.service.spec.ts +++ b/src/app/my-absences/services/my-absences-report-state.service.spec.ts @@ -1,11 +1,8 @@ -import { fakeAsync, TestBed, tick } from "@angular/core/testing"; - -import { MyAbsencesReportStateService } from "./my-absences-report-state.service"; -import { buildTestModuleMetadata } from "src/spec-helpers"; -import { StorageService } from "src/app/shared/services/storage.service"; -import { StudentsRestService } from "../../shared/services/students-rest.service"; +import { TestBed, fakeAsync, tick } from "@angular/core/testing"; +import { addHours, subHours } from "date-fns"; import { of } from "rxjs"; -import { TimetableEntry } from "../../shared/models/timetable-entry.model"; +import { StorageService } from "src/app/shared/services/storage.service"; +import { buildTestModuleMetadata } from "src/spec-helpers"; import { buildLessonAbsence, buildLessonDispensation, @@ -13,7 +10,9 @@ import { buildPayLoad, buildTimetableEntry, } from "../../../spec-builders"; -import { addHours, subHours } from "date-fns"; +import { TimetableEntry } from "../../shared/models/timetable-entry.model"; +import { StudentsRestService } from "../../shared/services/students-rest.service"; +import { MyAbsencesReportStateService } from "./my-absences-report-state.service"; describe("MyAbsencesReportStateService", () => { let service: MyAbsencesReportStateService; diff --git a/src/app/my-absences/services/my-absences-report-state.service.ts b/src/app/my-absences/services/my-absences-report-state.service.ts index 26c0d845c..b3ab1c8cf 100644 --- a/src/app/my-absences/services/my-absences-report-state.service.ts +++ b/src/app/my-absences/services/my-absences-report-state.service.ts @@ -1,26 +1,25 @@ -import { Inject, Injectable } from "@angular/core"; import { Location } from "@angular/common"; import { HttpParams } from "@angular/common/http"; +import { Inject, Injectable } from "@angular/core"; import { Params } from "@angular/router"; -import { combineLatest, Observable, of } from "rxjs"; -import { map, switchMap } from "rxjs/operators"; import { addDays, format, subDays } from "date-fns"; - +import { Observable, combineLatest, of } from "rxjs"; +import { map, switchMap } from "rxjs/operators"; import { SETTINGS, Settings } from "src/app/settings"; +import { OptionalReference } from "src/app/shared/models/common-types"; +import { LessonAbsence } from "src/app/shared/models/lesson-absence.model"; +import { LessonDispensation } from "src/app/shared/models/lesson-dispensation.model"; +import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; +import { TimetableEntry } from "src/app/shared/models/timetable-entry.model"; +import { LoadingService } from "src/app/shared/services/loading-service"; import { PAGE_LOADING_CONTEXT, PaginatedEntriesService, } from "src/app/shared/services/paginated-entries.service"; -import { Paginated } from "src/app/shared/utils/pagination"; -import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; -import { LoadingService } from "src/app/shared/services/loading-service"; -import { TimetableEntry } from "src/app/shared/models/timetable-entry.model"; -import { LessonAbsence } from "src/app/shared/models/lesson-absence.model"; -import { LessonDispensation } from "src/app/shared/models/lesson-dispensation.model"; -import { OptionalReference } from "src/app/shared/models/common-types"; -import { StudentsRestService } from "src/app/shared/services/students-rest.service"; -import { StorageService } from "src/app/shared/services/storage.service"; import { SortService } from "src/app/shared/services/sort.service"; +import { StorageService } from "src/app/shared/services/storage.service"; +import { StudentsRestService } from "src/app/shared/services/students-rest.service"; +import { Paginated } from "src/app/shared/utils/pagination"; export interface ReportAbsencesFilter { dateFrom: Option; diff --git a/src/app/my-absences/services/my-absences.service.spec.ts b/src/app/my-absences/services/my-absences.service.spec.ts index 7297d1c65..2b8e1e84d 100644 --- a/src/app/my-absences/services/my-absences.service.spec.ts +++ b/src/app/my-absences/services/my-absences.service.spec.ts @@ -1,8 +1,7 @@ import { TestBed } from "@angular/core/testing"; - -import { MyAbsencesService } from "./my-absences.service"; -import { buildTestModuleMetadata } from "src/spec-helpers"; import { StorageService } from "src/app/shared/services/storage.service"; +import { buildTestModuleMetadata } from "src/spec-helpers"; +import { MyAbsencesService } from "./my-absences.service"; describe("MyAbsencesService", () => { let service: MyAbsencesService; diff --git a/src/app/my-absences/services/my-absences.service.ts b/src/app/my-absences/services/my-absences.service.ts index f4e1b65e8..e8365041f 100644 --- a/src/app/my-absences/services/my-absences.service.ts +++ b/src/app/my-absences/services/my-absences.service.ts @@ -1,26 +1,25 @@ -import { Injectable, Inject } from "@angular/core"; +import { Inject, Injectable } from "@angular/core"; import { Observable, ReplaySubject, combineLatest } from "rxjs"; import { - switchMap, - startWith, - map, - take, - shareReplay, filter, + map, share, + shareReplay, + startWith, + switchMap, + take, } from "rxjs/operators"; - import { SETTINGS, Settings } from "src/app/settings"; -import { StudentProfileAbsencesCounts } from "src/app/shared/services/student-profile-absences.service"; -import { StorageService } from "src/app/shared/services/storage.service"; -import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; import { LessonAbsence } from "src/app/shared/models/lesson-absence.model"; import { LessonIncident } from "src/app/shared/models/lesson-incident.model"; -import { StudentsRestService } from "src/app/shared/services/students-rest.service"; +import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; import { TimetableEntry } from "src/app/shared/models/timetable-entry.model"; -import { sortLessonPresencesByDate } from "src/app/shared/utils/lesson-presences"; +import { StorageService } from "src/app/shared/services/storage.service"; +import { StudentProfileAbsencesCounts } from "src/app/shared/services/student-profile-absences.service"; +import { StudentsRestService } from "src/app/shared/services/students-rest.service"; import { notNull } from "src/app/shared/utils/filter"; import { spread } from "src/app/shared/utils/function"; +import { sortLessonPresencesByDate } from "src/app/shared/utils/lesson-presences"; @Injectable() export class MyAbsencesService { diff --git a/src/app/my-grades/components/my-grades-header/my-grades-header.component.spec.ts b/src/app/my-grades/components/my-grades-header/my-grades-header.component.spec.ts index 0242ab2e6..8db78959e 100644 --- a/src/app/my-grades/components/my-grades-header/my-grades-header.component.spec.ts +++ b/src/app/my-grades/components/my-grades-header/my-grades-header.component.spec.ts @@ -1,9 +1,8 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; - -import { MyGradesHeaderComponent } from "./my-grades-header.component"; +import { of } from "rxjs"; import { buildTestModuleMetadata } from "../../../../spec-helpers"; import { MyGradesService } from "../../services/my-grades.service"; -import { of } from "rxjs"; +import { MyGradesHeaderComponent } from "./my-grades-header.component"; describe("MyGradesHeaderComponent", () => { let component: MyGradesHeaderComponent; diff --git a/src/app/my-grades/components/my-grades-show/my-grades-show.component.spec.ts b/src/app/my-grades/components/my-grades-show/my-grades-show.component.spec.ts index 29c64ede0..65aee1195 100644 --- a/src/app/my-grades/components/my-grades-show/my-grades-show.component.spec.ts +++ b/src/app/my-grades/components/my-grades-show/my-grades-show.component.spec.ts @@ -1,11 +1,10 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; - -import { MyGradesShowComponent } from "./my-grades-show.component"; -import { StorageService } from "../../../shared/services/storage.service"; +import { of } from "rxjs"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { StorageService } from "../../../shared/services/storage.service"; import { MyGradesService } from "../../services/my-grades.service"; -import { of } from "rxjs"; import { MyGradesHeaderComponent } from "../my-grades-header/my-grades-header.component"; +import { MyGradesShowComponent } from "./my-grades-show.component"; describe("MyGradesShowComponent", () => { let component: MyGradesShowComponent; diff --git a/src/app/my-grades/components/my-grades-show/my-grades-show.component.ts b/src/app/my-grades/components/my-grades-show/my-grades-show.component.ts index 01add4de9..6a35cc018 100644 --- a/src/app/my-grades/components/my-grades-show/my-grades-show.component.ts +++ b/src/app/my-grades/components/my-grades-show/my-grades-show.component.ts @@ -1,6 +1,6 @@ import { Component } from "@angular/core"; -import { MyGradesService } from "../../services/my-grades.service"; import { DossierGradesService } from "../../../shared/services/dossier-grades.service"; +import { MyGradesService } from "../../services/my-grades.service"; @Component({ selector: "erz-my-grades-show", diff --git a/src/app/my-grades/components/my-grades/my-grades.component.spec.ts b/src/app/my-grades/components/my-grades/my-grades.component.spec.ts index 174699e62..6c96ee893 100644 --- a/src/app/my-grades/components/my-grades/my-grades.component.spec.ts +++ b/src/app/my-grades/components/my-grades/my-grades.component.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; +import { RouterModule } from "@angular/router"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { MyGradesComponent } from "./my-grades.component"; -import { RouterModule } from "@angular/router"; describe("MyGradesComponent", () => { let component: MyGradesComponent; diff --git a/src/app/my-grades/my-grades-routing.module.ts b/src/app/my-grades/my-grades-routing.module.ts index 5e911e4b0..e710abec5 100644 --- a/src/app/my-grades/my-grades-routing.module.ts +++ b/src/app/my-grades/my-grades-routing.module.ts @@ -1,7 +1,7 @@ import { NgModule } from "@angular/core"; import { RouterModule, Routes } from "@angular/router"; -import { MyGradesComponent } from "./components/my-grades/my-grades.component"; import { MyGradesShowComponent } from "./components/my-grades-show/my-grades-show.component"; +import { MyGradesComponent } from "./components/my-grades/my-grades.component"; const routes: Routes = [ { diff --git a/src/app/my-grades/my-grades.module.ts b/src/app/my-grades/my-grades.module.ts index 22c141adb..ff6fa8fec 100644 --- a/src/app/my-grades/my-grades.module.ts +++ b/src/app/my-grades/my-grades.module.ts @@ -1,11 +1,10 @@ -import { NgModule } from "@angular/core"; import { CommonModule } from "@angular/common"; - -import { MyGradesRoutingModule } from "./my-grades-routing.module"; -import { MyGradesComponent } from "./components/my-grades/my-grades.component"; -import { MyGradesShowComponent } from "./components/my-grades-show/my-grades-show.component"; +import { NgModule } from "@angular/core"; import { SharedModule } from "../shared/shared.module"; import { MyGradesHeaderComponent } from "./components/my-grades-header/my-grades-header.component"; +import { MyGradesShowComponent } from "./components/my-grades-show/my-grades-show.component"; +import { MyGradesComponent } from "./components/my-grades/my-grades.component"; +import { MyGradesRoutingModule } from "./my-grades-routing.module"; @NgModule({ declarations: [ diff --git a/src/app/my-grades/services/my-grades.service.ts b/src/app/my-grades/services/my-grades.service.ts index 8d3567a3e..eeb35cb91 100644 --- a/src/app/my-grades/services/my-grades.service.ts +++ b/src/app/my-grades/services/my-grades.service.ts @@ -1,22 +1,22 @@ import { Inject, Injectable } from "@angular/core"; -import { StorageService } from "../../shared/services/storage.service"; import { + ReplaySubject, combineLatest, forkJoin, map, - ReplaySubject, shareReplay, switchMap, } from "rxjs"; -import { LoadingService } from "../../shared/services/loading-service"; -import { CoursesRestService } from "../../shared/services/courses-rest.service"; +import { SETTINGS, Settings } from "../../settings"; import { Course } from "../../shared/models/course.model"; -import { SubscriptionsRestService } from "../../shared/services/subscriptions-rest.service"; -import { ReportsService } from "../../shared/services/reports.service"; -import { Settings, SETTINGS } from "../../settings"; -import { notNull, unique } from "../../shared/utils/filter"; import { Test } from "../../shared/models/test.model"; +import { CoursesRestService } from "../../shared/services/courses-rest.service"; import { GradingScalesRestService } from "../../shared/services/grading-scales-rest.service"; +import { LoadingService } from "../../shared/services/loading-service"; +import { ReportsService } from "../../shared/services/reports.service"; +import { StorageService } from "../../shared/services/storage.service"; +import { SubscriptionsRestService } from "../../shared/services/subscriptions-rest.service"; +import { notNull, unique } from "../../shared/utils/filter"; @Injectable() export class MyGradesService { diff --git a/src/app/my-notifications/components/my-notifications-show/my-notifications-show.component.spec.ts b/src/app/my-notifications/components/my-notifications-show/my-notifications-show.component.spec.ts index 300f62312..50fb0ac0d 100644 --- a/src/app/my-notifications/components/my-notifications-show/my-notifications-show.component.spec.ts +++ b/src/app/my-notifications/components/my-notifications-show/my-notifications-show.component.spec.ts @@ -2,7 +2,6 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { of } from "rxjs"; import { UserSettingsService } from "src/app/shared/services/user-settings.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { MyNotificationsShowComponent } from "./my-notifications-show.component"; describe("MyNotificationsShowComponent-WithData", () => { diff --git a/src/app/my-notifications/components/my-notifications-show/my-notifications-show.component.ts b/src/app/my-notifications/components/my-notifications-show/my-notifications-show.component.ts index 9e19f9def..a34ff1b1e 100644 --- a/src/app/my-notifications/components/my-notifications-show/my-notifications-show.component.ts +++ b/src/app/my-notifications/components/my-notifications-show/my-notifications-show.component.ts @@ -1,3 +1,4 @@ +import { HttpErrorResponse } from "@angular/common/http"; import { Component, ElementRef, @@ -8,9 +9,9 @@ import { } from "@angular/core"; import { BehaviorSubject, - interval, Observable, Subject, + interval, throwError, } from "rxjs"; import { @@ -21,12 +22,11 @@ import { takeUntil, withLatestFrom, } from "rxjs/operators"; +import { SETTINGS, Settings } from "src/app/settings"; import { NotificationData, NotificationDataEntry, } from "src/app/shared/models/user-settings.model"; -import { SETTINGS, Settings } from "src/app/settings"; -import { HttpErrorResponse } from "@angular/common/http"; import { I18nService } from "src/app/shared/services/i18n.service"; import { UserSettingsService } from "src/app/shared/services/user-settings.service"; diff --git a/src/app/my-notifications/my-notifications.module.ts b/src/app/my-notifications/my-notifications.module.ts index c4b072e9f..452a0d06b 100644 --- a/src/app/my-notifications/my-notifications.module.ts +++ b/src/app/my-notifications/my-notifications.module.ts @@ -1,5 +1,5 @@ -import { NgModule } from "@angular/core"; import { CommonModule } from "@angular/common"; +import { NgModule } from "@angular/core"; import { MyNotificationsShowComponent } from "./components/my-notifications-show/my-notifications-show.component"; @NgModule({ diff --git a/src/app/my-profile/components/my-profile-address/my-profile-address.component.spec.ts b/src/app/my-profile/components/my-profile-address/my-profile-address.component.spec.ts index 55df44fc1..29a73f862 100644 --- a/src/app/my-profile/components/my-profile-address/my-profile-address.component.spec.ts +++ b/src/app/my-profile/components/my-profile-address/my-profile-address.component.spec.ts @@ -1,5 +1,4 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - import { MyProfileAddressComponent } from "./my-profile-address.component"; describe("MyProfileAddressComponent", () => { diff --git a/src/app/my-profile/components/my-profile-address/my-profile-address.component.ts b/src/app/my-profile/components/my-profile-address/my-profile-address.component.ts index daf23db16..4410d5523 100644 --- a/src/app/my-profile/components/my-profile-address/my-profile-address.component.ts +++ b/src/app/my-profile/components/my-profile-address/my-profile-address.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, ChangeDetectionStrategy } from "@angular/core"; +import { ChangeDetectionStrategy, Component, Input } from "@angular/core"; @Component({ selector: "erz-my-profile-address", diff --git a/src/app/my-profile/components/my-profile-edit/my-profile-edit.component.spec.ts b/src/app/my-profile/components/my-profile-edit/my-profile-edit.component.spec.ts index e50433538..9a77a1081 100644 --- a/src/app/my-profile/components/my-profile-edit/my-profile-edit.component.spec.ts +++ b/src/app/my-profile/components/my-profile-edit/my-profile-edit.component.spec.ts @@ -1,11 +1,10 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { of } from "rxjs"; - -import { buildTestModuleMetadata } from "src/spec-helpers"; +import { PersonsRestService } from "src/app/shared/services/persons-rest.service"; import { buildPerson } from "src/spec-builders"; -import { MyProfileEditComponent } from "./my-profile-edit.component"; +import { buildTestModuleMetadata } from "src/spec-helpers"; import { MyProfileService } from "../../services/my-profile.service"; -import { PersonsRestService } from "src/app/shared/services/persons-rest.service"; +import { MyProfileEditComponent } from "./my-profile-edit.component"; describe("MyProfileEditComponent", () => { // let component: MyProfileEditComponent; diff --git a/src/app/my-profile/components/my-profile-edit/my-profile-edit.component.ts b/src/app/my-profile/components/my-profile-edit/my-profile-edit.component.ts index 41669f35f..de8d9715c 100644 --- a/src/app/my-profile/components/my-profile-edit/my-profile-edit.component.ts +++ b/src/app/my-profile/components/my-profile-edit/my-profile-edit.component.ts @@ -1,4 +1,4 @@ -import { Component, ChangeDetectionStrategy } from "@angular/core"; +import { ChangeDetectionStrategy, Component } from "@angular/core"; import { UntypedFormBuilder, UntypedFormGroup, @@ -7,13 +7,12 @@ import { import { Router } from "@angular/router"; import { TranslateService } from "@ngx-translate/core"; import { BehaviorSubject } from "rxjs"; -import { map, take, switchMap, finalize, shareReplay } from "rxjs/operators"; - +import { finalize, map, shareReplay, switchMap, take } from "rxjs/operators"; import { Person } from "src/app/shared/models/person.model"; -import { MyProfileService } from "../../services/my-profile.service"; import { PersonsRestService } from "src/app/shared/services/persons-rest.service"; import { getValidationErrors } from "src/app/shared/utils/form"; import { ToastService } from "../../../shared/services/toast.service"; +import { MyProfileService } from "../../services/my-profile.service"; @Component({ selector: "erz-my-profile-edit", diff --git a/src/app/my-profile/components/my-profile-entry/my-profile-entry.component.spec.ts b/src/app/my-profile/components/my-profile-entry/my-profile-entry.component.spec.ts index ff4fb311c..1d6cce078 100644 --- a/src/app/my-profile/components/my-profile-entry/my-profile-entry.component.spec.ts +++ b/src/app/my-profile/components/my-profile-entry/my-profile-entry.component.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { MyProfileEntryComponent } from "./my-profile-entry.component"; import { buildTestModuleMetadata } from "../../../../spec-helpers"; +import { MyProfileEntryComponent } from "./my-profile-entry.component"; describe("MyProfileEntryComponent", () => { let component: MyProfileEntryComponent; diff --git a/src/app/my-profile/components/my-profile-entry/my-profile-entry.component.ts b/src/app/my-profile/components/my-profile-entry/my-profile-entry.component.ts index 723aa6004..15cb36821 100644 --- a/src/app/my-profile/components/my-profile-entry/my-profile-entry.component.ts +++ b/src/app/my-profile/components/my-profile-entry/my-profile-entry.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, ChangeDetectionStrategy } from "@angular/core"; +import { ChangeDetectionStrategy, Component, Input } from "@angular/core"; @Component({ selector: "erz-my-profile-entry", diff --git a/src/app/my-profile/components/my-profile-header/my-profile-header.component.spec.ts b/src/app/my-profile/components/my-profile-header/my-profile-header.component.spec.ts index f865b1b6c..d9d5389d1 100644 --- a/src/app/my-profile/components/my-profile-header/my-profile-header.component.spec.ts +++ b/src/app/my-profile/components/my-profile-header/my-profile-header.component.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { MyProfileHeaderComponent } from "./my-profile-header.component"; -import { buildTestModuleMetadata } from "src/spec-helpers"; import { ReportsService } from "src/app/shared/services/reports.service"; +import { buildTestModuleMetadata } from "src/spec-helpers"; +import { MyProfileHeaderComponent } from "./my-profile-header.component"; describe("MyProfileHeaderComponent", () => { let component: MyProfileHeaderComponent; diff --git a/src/app/my-profile/components/my-profile-header/my-profile-header.component.ts b/src/app/my-profile/components/my-profile-header/my-profile-header.component.ts index 60bb24f82..8f04dc150 100644 --- a/src/app/my-profile/components/my-profile-header/my-profile-header.component.ts +++ b/src/app/my-profile/components/my-profile-header/my-profile-header.component.ts @@ -1,12 +1,11 @@ import { + ChangeDetectionStrategy, Component, Input, - SimpleChanges, OnChanges, - ChangeDetectionStrategy, + SimpleChanges, } from "@angular/core"; import { ReplaySubject, map } from "rxjs"; - import { Person } from "../../../shared/models/person.model"; import { ReportsService } from "../../../shared/services/reports.service"; diff --git a/src/app/my-profile/components/my-profile-show/my-profile-show.component.spec.ts b/src/app/my-profile/components/my-profile-show/my-profile-show.component.spec.ts index 0e0ebd61b..82986939b 100644 --- a/src/app/my-profile/components/my-profile-show/my-profile-show.component.spec.ts +++ b/src/app/my-profile/components/my-profile-show/my-profile-show.component.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { MyProfileShowComponent } from "./my-profile-show.component"; import { buildTestModuleMetadata } from "../../../../spec-helpers"; import { MyProfileService } from "../../services/my-profile.service"; +import { MyProfileShowComponent } from "./my-profile-show.component"; describe("MyProfileShowComponent", () => { let component: MyProfileShowComponent; diff --git a/src/app/my-profile/components/my-profile-show/my-profile-show.component.ts b/src/app/my-profile/components/my-profile-show/my-profile-show.component.ts index 7f22714a3..6a87878e0 100644 --- a/src/app/my-profile/components/my-profile-show/my-profile-show.component.ts +++ b/src/app/my-profile/components/my-profile-show/my-profile-show.component.ts @@ -1,4 +1,4 @@ -import { Component, ChangeDetectionStrategy } from "@angular/core"; +import { ChangeDetectionStrategy, Component } from "@angular/core"; import { MyProfileService } from "../../services/my-profile.service"; @Component({ diff --git a/src/app/my-profile/components/my-profile/my-profile.component.spec.ts b/src/app/my-profile/components/my-profile/my-profile.component.spec.ts index 352aa15ec..eda3e2b15 100644 --- a/src/app/my-profile/components/my-profile/my-profile.component.spec.ts +++ b/src/app/my-profile/components/my-profile/my-profile.component.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { MyProfileComponent } from "./my-profile.component"; import { buildTestModuleMetadata } from "../../../../spec-helpers"; +import { MyProfileComponent } from "./my-profile.component"; describe("MyProfileComponent", () => { let component: MyProfileComponent; diff --git a/src/app/my-profile/components/my-profile/my-profile.component.ts b/src/app/my-profile/components/my-profile/my-profile.component.ts index ef530c475..f5b01c284 100644 --- a/src/app/my-profile/components/my-profile/my-profile.component.ts +++ b/src/app/my-profile/components/my-profile/my-profile.component.ts @@ -1,4 +1,4 @@ -import { Component, ChangeDetectionStrategy } from "@angular/core"; +import { ChangeDetectionStrategy, Component } from "@angular/core"; import { MyProfileService } from "../../services/my-profile.service"; @Component({ diff --git a/src/app/my-profile/my-profile-routing.module.ts b/src/app/my-profile/my-profile-routing.module.ts index 6d515d0f4..7748d23c6 100644 --- a/src/app/my-profile/my-profile-routing.module.ts +++ b/src/app/my-profile/my-profile-routing.module.ts @@ -1,8 +1,8 @@ import { NgModule } from "@angular/core"; -import { Routes, RouterModule } from "@angular/router"; -import { MyProfileComponent } from "./components/my-profile/my-profile.component"; -import { MyProfileShowComponent } from "./components/my-profile-show/my-profile-show.component"; +import { RouterModule, Routes } from "@angular/router"; import { MyProfileEditComponent } from "./components/my-profile-edit/my-profile-edit.component"; +import { MyProfileShowComponent } from "./components/my-profile-show/my-profile-show.component"; +import { MyProfileComponent } from "./components/my-profile/my-profile.component"; const routes: Routes = [ { diff --git a/src/app/my-profile/my-profile.module.ts b/src/app/my-profile/my-profile.module.ts index 6c0978405..162f0df3d 100644 --- a/src/app/my-profile/my-profile.module.ts +++ b/src/app/my-profile/my-profile.module.ts @@ -1,13 +1,12 @@ import { NgModule } from "@angular/core"; import { SharedModule } from "../shared/shared.module"; - -import { MyProfileRoutingModule } from "./my-profile-routing.module"; -import { MyProfileComponent } from "./components/my-profile/my-profile.component"; -import { MyProfileShowComponent } from "./components/my-profile-show/my-profile-show.component"; -import { MyProfileEntryComponent } from "./components/my-profile-entry/my-profile-entry.component"; -import { MyProfileHeaderComponent } from "./components/my-profile-header/my-profile-header.component"; import { MyProfileAddressComponent } from "./components/my-profile-address/my-profile-address.component"; import { MyProfileEditComponent } from "./components/my-profile-edit/my-profile-edit.component"; +import { MyProfileEntryComponent } from "./components/my-profile-entry/my-profile-entry.component"; +import { MyProfileHeaderComponent } from "./components/my-profile-header/my-profile-header.component"; +import { MyProfileShowComponent } from "./components/my-profile-show/my-profile-show.component"; +import { MyProfileComponent } from "./components/my-profile/my-profile.component"; +import { MyProfileRoutingModule } from "./my-profile-routing.module"; @NgModule({ declarations: [ diff --git a/src/app/my-profile/services/my-profile.service.spec.ts b/src/app/my-profile/services/my-profile.service.spec.ts index 6298cc70d..4323c727c 100644 --- a/src/app/my-profile/services/my-profile.service.spec.ts +++ b/src/app/my-profile/services/my-profile.service.spec.ts @@ -1,7 +1,6 @@ import { TestBed } from "@angular/core/testing"; - -import { MyProfileService } from "./my-profile.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { MyProfileService } from "./my-profile.service"; describe("MyProfileService", () => { let service: MyProfileService; diff --git a/src/app/my-profile/services/my-profile.service.ts b/src/app/my-profile/services/my-profile.service.ts index a7ffed7a5..5ec1a2023 100644 --- a/src/app/my-profile/services/my-profile.service.ts +++ b/src/app/my-profile/services/my-profile.service.ts @@ -1,7 +1,6 @@ import { Injectable } from "@angular/core"; import { BehaviorSubject } from "rxjs"; import { shareReplay, switchMap } from "rxjs/operators"; - import { StudentProfileService } from "src/app/shared/services/student-profile.service"; @Injectable() diff --git a/src/app/my-settings/components/my-settings-notifications-toggle/my-settings-notifications-toggle.component.spec.ts b/src/app/my-settings/components/my-settings-notifications-toggle/my-settings-notifications-toggle.component.spec.ts index db7473717..e6ea869f5 100644 --- a/src/app/my-settings/components/my-settings-notifications-toggle/my-settings-notifications-toggle.component.spec.ts +++ b/src/app/my-settings/components/my-settings-notifications-toggle/my-settings-notifications-toggle.component.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { SwitchComponent } from "src/app/shared/components/switch/switch.component"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { MySettingsNotificationsToggleComponent } from "./my-settings-notifications-toggle.component"; describe("MySettingsNotificationsToggleComponent", () => { diff --git a/src/app/my-settings/components/my-settings-notifications-toggle/my-settings-notifications-toggle.component.ts b/src/app/my-settings/components/my-settings-notifications-toggle/my-settings-notifications-toggle.component.ts index 4badfbe2b..c4e9c8426 100644 --- a/src/app/my-settings/components/my-settings-notifications-toggle/my-settings-notifications-toggle.component.ts +++ b/src/app/my-settings/components/my-settings-notifications-toggle/my-settings-notifications-toggle.component.ts @@ -2,8 +2,8 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, - forwardRef, Input, + forwardRef, } from "@angular/core"; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms"; diff --git a/src/app/my-settings/components/my-settings-notifications/my-settings-notifications.component.ts b/src/app/my-settings/components/my-settings-notifications/my-settings-notifications.component.ts index 311e14883..01903c3d5 100644 --- a/src/app/my-settings/components/my-settings-notifications/my-settings-notifications.component.ts +++ b/src/app/my-settings/components/my-settings-notifications/my-settings-notifications.component.ts @@ -1,30 +1,29 @@ import { - Component, ChangeDetectionStrategy, - OnInit, + Component, OnDestroy, + OnInit, } from "@angular/core"; import { UntypedFormBuilder, UntypedFormGroup } from "@angular/forms"; -import { BehaviorSubject, merge, Observable, of, Subject } from "rxjs"; import { TranslateService } from "@ngx-translate/core"; +import { BehaviorSubject, Observable, Subject, merge, of } from "rxjs"; import { - shareReplay, - map, + distinctUntilChanged, finalize, + map, + shareReplay, + skip, switchMap, takeUntil, withLatestFrom, - skip, - distinctUntilChanged, } from "rxjs/operators"; - import { NotificationChannels, NotificationTypesInactive, } from "src/app/shared/models/user-settings.model"; -import { ToastService } from "../../../shared/services/toast.service"; import { NotificationTypesService } from "src/app/shared/services/notification-types.service"; import { UserSettingsService } from "src/app/shared/services/user-settings.service"; +import { ToastService } from "../../../shared/services/toast.service"; interface NotificationSetting { key: string; diff --git a/src/app/my-settings/components/my-settings-show/my-settings-show.component.spec.ts b/src/app/my-settings/components/my-settings-show/my-settings-show.component.spec.ts index 04da86e82..ef75b53d2 100644 --- a/src/app/my-settings/components/my-settings-show/my-settings-show.component.spec.ts +++ b/src/app/my-settings/components/my-settings-show/my-settings-show.component.spec.ts @@ -1,5 +1,4 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - import { StorageService } from "src/app/shared/services/storage.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { MySettingsNotificationsComponent } from "../my-settings-notifications/my-settings-notifications.component"; diff --git a/src/app/my-settings/components/my-settings/my-settings.component.spec.ts b/src/app/my-settings/components/my-settings/my-settings.component.spec.ts index 07e4829cc..f2bdbaf7b 100644 --- a/src/app/my-settings/components/my-settings/my-settings.component.spec.ts +++ b/src/app/my-settings/components/my-settings/my-settings.component.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { MySettingsComponent } from "./my-settings.component"; import { buildTestModuleMetadata } from "../../../../spec-helpers"; +import { MySettingsComponent } from "./my-settings.component"; describe("MySettingsComponent", () => { let component: MySettingsComponent; diff --git a/src/app/my-settings/components/my-settings/my-settings.component.ts b/src/app/my-settings/components/my-settings/my-settings.component.ts index 7db3b6433..16aec52db 100644 --- a/src/app/my-settings/components/my-settings/my-settings.component.ts +++ b/src/app/my-settings/components/my-settings/my-settings.component.ts @@ -1,4 +1,4 @@ -import { Component, ChangeDetectionStrategy } from "@angular/core"; +import { ChangeDetectionStrategy, Component } from "@angular/core"; @Component({ selector: "erz-my-settings", diff --git a/src/app/my-settings/my-settings-routing.module.ts b/src/app/my-settings/my-settings-routing.module.ts index 6b1b3cec5..70eb3b0a4 100644 --- a/src/app/my-settings/my-settings-routing.module.ts +++ b/src/app/my-settings/my-settings-routing.module.ts @@ -1,5 +1,5 @@ import { NgModule } from "@angular/core"; -import { Routes, RouterModule } from "@angular/router"; +import { RouterModule, Routes } from "@angular/router"; import { MySettingsShowComponent } from "./components/my-settings-show/my-settings-show.component"; import { MySettingsComponent } from "./components/my-settings/my-settings.component"; diff --git a/src/app/my-settings/my-settings.module.ts b/src/app/my-settings/my-settings.module.ts index 8b14b5b64..1356c06c0 100644 --- a/src/app/my-settings/my-settings.module.ts +++ b/src/app/my-settings/my-settings.module.ts @@ -1,11 +1,10 @@ import { NgModule } from "@angular/core"; import { SharedModule } from "../shared/shared.module"; - -import { MySettingsRoutingModule } from "./my-settings-routing.module"; -import { MySettingsComponent } from "./components/my-settings/my-settings.component"; -import { MySettingsShowComponent } from "./components/my-settings-show/my-settings-show.component"; -import { MySettingsNotificationsComponent } from "./components/my-settings-notifications/my-settings-notifications.component"; import { MySettingsNotificationsToggleComponent } from "./components/my-settings-notifications-toggle/my-settings-notifications-toggle.component"; +import { MySettingsNotificationsComponent } from "./components/my-settings-notifications/my-settings-notifications.component"; +import { MySettingsShowComponent } from "./components/my-settings-show/my-settings-show.component"; +import { MySettingsComponent } from "./components/my-settings/my-settings.component"; +import { MySettingsRoutingModule } from "./my-settings-routing.module"; @NgModule({ declarations: [ diff --git a/src/app/open-absences/components/open-absences-detail/open-absences-detail.component.spec.ts b/src/app/open-absences/components/open-absences-detail/open-absences-detail.component.spec.ts index 2771fafe0..eecf69eb7 100644 --- a/src/app/open-absences/components/open-absences-detail/open-absences-detail.component.spec.ts +++ b/src/app/open-absences/components/open-absences-detail/open-absences-detail.component.spec.ts @@ -1,14 +1,13 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { ActivatedRoute, Router } from "@angular/router"; import { of } from "rxjs"; - -import { buildTestModuleMetadata, ActivatedRouteMock } from "src/spec-helpers"; -import { buildLessonPresenceWithIds } from "src/spec-builders"; -import { OpenAbsencesDetailComponent } from "./open-absences-detail.component"; -import { OpenAbsencesService } from "../../services/open-absences.service"; -import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; import { take } from "rxjs/operators"; +import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; +import { buildLessonPresenceWithIds } from "src/spec-builders"; +import { ActivatedRouteMock, buildTestModuleMetadata } from "src/spec-helpers"; +import { OpenAbsencesService } from "../../services/open-absences.service"; +import { OpenAbsencesDetailComponent } from "./open-absences-detail.component"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/open-absences/components/open-absences-detail/open-absences-detail.component.ts b/src/app/open-absences/components/open-absences-detail/open-absences-detail.component.ts index aa6979ca5..cd20935d2 100644 --- a/src/app/open-absences/components/open-absences-detail/open-absences-detail.component.ts +++ b/src/app/open-absences/components/open-absences-detail/open-absences-detail.component.ts @@ -6,17 +6,16 @@ import { OnInit, } from "@angular/core"; import { ActivatedRoute, ParamMap, Router } from "@angular/router"; -import { combineLatest, EMPTY, Observable, Subject } from "rxjs"; -import { filter, map, switchMap, take, takeUntil } from "rxjs/operators"; import { not } from "fp-ts/es6/Predicate"; - -import { OpenAbsencesService } from "../../services/open-absences.service"; -import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; +import { EMPTY, Observable, Subject, combineLatest } from "rxjs"; +import { filter, map, switchMap, take, takeUntil } from "rxjs/operators"; import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; +import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; import { ScrollPositionService } from "src/app/shared/services/scroll-position.service"; import { isTruthy, longerOrEqual } from "src/app/shared/utils/filter"; -import { PresenceTypesService } from "../../../shared/services/presence-types.service"; import { PersonsRestService } from "../../../shared/services/persons-rest.service"; +import { PresenceTypesService } from "../../../shared/services/presence-types.service"; +import { OpenAbsencesService } from "../../services/open-absences.service"; @Component({ selector: "erz-open-absences-detail", diff --git a/src/app/open-absences/components/open-absences-list/open-absences-list.component.spec.ts b/src/app/open-absences/components/open-absences-list/open-absences-list.component.spec.ts index 36f5093a8..dacc44b09 100644 --- a/src/app/open-absences/components/open-absences-list/open-absences-list.component.spec.ts +++ b/src/app/open-absences/components/open-absences-list/open-absences-list.component.spec.ts @@ -1,13 +1,12 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { of } from "rxjs"; import { take } from "rxjs/operators"; - -import { buildTestModuleMetadata } from "src/spec-helpers"; +import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; import { buildLessonPresenceWithIds } from "src/spec-builders"; -import { OpenAbsencesListComponent } from "./open-absences-list.component"; -import { OpenAbsencesService } from "../../services/open-absences.service"; +import { buildTestModuleMetadata } from "src/spec-helpers"; import { OpenAbsencesEntry } from "../../models/open-absences-entry.model"; -import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; +import { OpenAbsencesService } from "../../services/open-absences.service"; +import { OpenAbsencesListComponent } from "./open-absences-list.component"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/open-absences/components/open-absences-list/open-absences-list.component.ts b/src/app/open-absences/components/open-absences-list/open-absences-list.component.ts index ee993c10f..06a722576 100644 --- a/src/app/open-absences/components/open-absences-list/open-absences-list.component.ts +++ b/src/app/open-absences/components/open-absences-list/open-absences-list.component.ts @@ -1,21 +1,20 @@ import { - Component, - OnInit, + AfterViewInit, ChangeDetectionStrategy, + Component, OnDestroy, - AfterViewInit, + OnInit, } from "@angular/core"; import { Subject } from "rxjs"; - +import { take } from "rxjs/operators"; +import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; +import { ScrollPositionService } from "src/app/shared/services/scroll-position.service"; +import { SortCriteria } from "src/app/shared/utils/sort"; +import { OpenAbsencesEntry } from "../../models/open-absences-entry.model"; import { OpenAbsencesService, PrimarySortKey, } from "../../services/open-absences.service"; -import { OpenAbsencesEntry } from "../../models/open-absences-entry.model"; -import { ScrollPositionService } from "src/app/shared/services/scroll-position.service"; -import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; -import { SortCriteria } from "src/app/shared/utils/sort"; -import { take } from "rxjs/operators"; @Component({ selector: "erz-open-absences-list", diff --git a/src/app/open-absences/components/open-absences/open-absences.component.spec.ts b/src/app/open-absences/components/open-absences/open-absences.component.spec.ts index 99ea01a11..4a3570159 100644 --- a/src/app/open-absences/components/open-absences/open-absences.component.spec.ts +++ b/src/app/open-absences/components/open-absences/open-absences.component.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { OpenAbsencesComponent } from "./open-absences.component"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { OpenAbsencesComponent } from "./open-absences.component"; describe("OpenAbsencesComponent", () => { let component: OpenAbsencesComponent; diff --git a/src/app/open-absences/components/open-absences/open-absences.component.ts b/src/app/open-absences/components/open-absences/open-absences.component.ts index 0e786e22a..f688e4626 100644 --- a/src/app/open-absences/components/open-absences/open-absences.component.ts +++ b/src/app/open-absences/components/open-absences/open-absences.component.ts @@ -1,6 +1,6 @@ -import { Component, ChangeDetectionStrategy } from "@angular/core"; -import { OpenAbsencesService } from "../../services/open-absences.service"; +import { ChangeDetectionStrategy, Component } from "@angular/core"; import { CONFIRM_ABSENCES_SERVICE } from "src/app/shared/tokens/confirm-absences-service"; +import { OpenAbsencesService } from "../../services/open-absences.service"; @Component({ selector: "erz-open-absences", diff --git a/src/app/open-absences/models/open-absences-entry.model.spec.ts b/src/app/open-absences/models/open-absences-entry.model.spec.ts index 5e7fb0024..75403c1cf 100644 --- a/src/app/open-absences/models/open-absences-entry.model.spec.ts +++ b/src/app/open-absences/models/open-absences-entry.model.spec.ts @@ -1,6 +1,6 @@ -import { OpenAbsencesEntry } from "./open-absences-entry.model"; import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; import { buildLessonPresenceWithIds } from "src/spec-builders"; +import { OpenAbsencesEntry } from "./open-absences-entry.model"; describe("OpenAbsencesEntry", () => { let presenceA: LessonPresence; diff --git a/src/app/open-absences/models/open-absences-entry.model.ts b/src/app/open-absences/models/open-absences-entry.model.ts index 639dc4123..5ee6e26fc 100644 --- a/src/app/open-absences/models/open-absences-entry.model.ts +++ b/src/app/open-absences/models/open-absences-entry.model.ts @@ -1,4 +1,4 @@ -import { startOfDay, format } from "date-fns"; +import { format, startOfDay } from "date-fns"; import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; import { Searchable } from "src/app/shared/utils/search"; diff --git a/src/app/open-absences/open-absences-routing.module.ts b/src/app/open-absences/open-absences-routing.module.ts index 7df9ca325..d9e1b0e0b 100644 --- a/src/app/open-absences/open-absences-routing.module.ts +++ b/src/app/open-absences/open-absences-routing.module.ts @@ -1,10 +1,9 @@ import { NgModule } from "@angular/core"; -import { Routes, RouterModule } from "@angular/router"; - -import { OpenAbsencesComponent } from "./components/open-absences/open-absences.component"; -import { OpenAbsencesListComponent } from "./components/open-absences-list/open-absences-list.component"; -import { OpenAbsencesDetailComponent } from "./components/open-absences-detail/open-absences-detail.component"; +import { RouterModule, Routes } from "@angular/router"; import { ConfirmAbsencesComponent } from "../shared/components/confirm-absences/confirm-absences.component"; +import { OpenAbsencesDetailComponent } from "./components/open-absences-detail/open-absences-detail.component"; +import { OpenAbsencesListComponent } from "./components/open-absences-list/open-absences-list.component"; +import { OpenAbsencesComponent } from "./components/open-absences/open-absences.component"; const routes: Routes = [ { diff --git a/src/app/open-absences/open-absences.module.ts b/src/app/open-absences/open-absences.module.ts index 987c37b27..b5c8a4acc 100644 --- a/src/app/open-absences/open-absences.module.ts +++ b/src/app/open-absences/open-absences.module.ts @@ -1,11 +1,10 @@ import { NgModule } from "@angular/core"; - +import { ConfirmAbsencesSelectionService } from "../shared/services/confirm-absences-selection.service"; import { SharedModule } from "../shared/shared.module"; -import { OpenAbsencesRoutingModule } from "./open-absences-routing.module"; -import { OpenAbsencesComponent } from "./components/open-absences/open-absences.component"; -import { OpenAbsencesListComponent } from "./components/open-absences-list/open-absences-list.component"; import { OpenAbsencesDetailComponent } from "./components/open-absences-detail/open-absences-detail.component"; -import { ConfirmAbsencesSelectionService } from "../shared/services/confirm-absences-selection.service"; +import { OpenAbsencesListComponent } from "./components/open-absences-list/open-absences-list.component"; +import { OpenAbsencesComponent } from "./components/open-absences/open-absences.component"; +import { OpenAbsencesRoutingModule } from "./open-absences-routing.module"; @NgModule({ declarations: [ diff --git a/src/app/open-absences/services/open-absences.service.spec.ts b/src/app/open-absences/services/open-absences.service.spec.ts index dacfbc600..611f00db4 100644 --- a/src/app/open-absences/services/open-absences.service.spec.ts +++ b/src/app/open-absences/services/open-absences.service.spec.ts @@ -1,15 +1,14 @@ import { TestBed } from "@angular/core/testing"; import { of } from "rxjs"; - -import { buildTestModuleMetadata } from "src/spec-helpers"; -import { OpenAbsencesService } from "./open-absences.service"; +import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; import { LessonPresencesRestService } from "src/app/shared/services/lesson-presences-rest.service"; +import { buildTestModuleMetadata } from "src/spec-helpers"; import { buildLessonPresence, buildPersonWithEmails, } from "../../../spec-builders"; import { LessonPresence } from "../../shared/models/lesson-presence.model"; -import { ConfirmAbsencesSelectionService } from "src/app/shared/services/confirm-absences-selection.service"; +import { OpenAbsencesService } from "./open-absences.service"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/open-absences/services/open-absences.service.ts b/src/app/open-absences/services/open-absences.service.ts index b9d12ddf6..99f922de7 100644 --- a/src/app/open-absences/services/open-absences.service.ts +++ b/src/app/open-absences/services/open-absences.service.ts @@ -3,10 +3,10 @@ import { Router } from "@angular/router"; import { TranslateService } from "@ngx-translate/core"; import { BehaviorSubject, - combineLatest, - merge, Observable, Subject, + combineLatest, + merge, } from "rxjs"; import { map, shareReplay, take } from "rxjs/operators"; import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; diff --git a/src/app/open-absences/utils/open-absences-entries.spec.ts b/src/app/open-absences/utils/open-absences-entries.spec.ts index de3b51e64..464ac12b2 100644 --- a/src/app/open-absences/utils/open-absences-entries.spec.ts +++ b/src/app/open-absences/utils/open-absences-entries.spec.ts @@ -1,12 +1,12 @@ -import { buildLessonPresenceWithIds } from "src/spec-builders"; import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; +import { buildLessonPresenceWithIds } from "src/spec-builders"; +import { OpenAbsencesEntry } from "../models/open-absences-entry.model"; import { buildOpenAbsencesEntries, flattenOpenAbsencesEntries, - sortOpenAbsencesEntries, removeOpenAbsences, + sortOpenAbsencesEntries, } from "./open-absences-entries"; -import { OpenAbsencesEntry } from "../models/open-absences-entry.model"; describe("open absences entries utils", () => { let presenceA: LessonPresence; diff --git a/src/app/open-absences/utils/open-absences-entries.ts b/src/app/open-absences/utils/open-absences-entries.ts index 29d90179e..ecf9d2c73 100644 --- a/src/app/open-absences/utils/open-absences-entries.ts +++ b/src/app/open-absences/utils/open-absences-entries.ts @@ -1,10 +1,10 @@ import { format } from "date-fns"; -import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; -import { OpenAbsencesEntry } from "../models/open-absences-entry.model"; +import { uniqBy } from "lodash-es"; import { lessonsComparator } from "src/app/presence-control/utils/lessons"; +import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; import { UnreachableError } from "src/app/shared/utils/error"; -import { uniqBy } from "lodash-es"; import { SortCriteria } from "src/app/shared/utils/sort"; +import { OpenAbsencesEntry } from "../models/open-absences-entry.model"; import { PrimarySortKey } from "../services/open-absences.service"; export function buildOpenAbsencesEntries( diff --git a/src/app/presence-control/components/presence-control-block-lesson/presence-control-block-lesson.component.spec.ts b/src/app/presence-control/components/presence-control-block-lesson/presence-control-block-lesson.component.spec.ts index 86e354956..4167e0d4b 100644 --- a/src/app/presence-control/components/presence-control-block-lesson/presence-control-block-lesson.component.spec.ts +++ b/src/app/presence-control/components/presence-control-block-lesson/presence-control-block-lesson.component.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { PresenceControlBlockLessonComponent } from "./presence-control-block-lesson.component"; -import { buildTestModuleMetadata } from "src/spec-helpers"; import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { buildTestModuleMetadata } from "src/spec-helpers"; +import { PresenceControlBlockLessonComponent } from "./presence-control-block-lesson.component"; describe("PresenceControlBlockLessonComponent", () => { let component: PresenceControlBlockLessonComponent; diff --git a/src/app/presence-control/components/presence-control-entry/presence-control-entry.component.spec.ts b/src/app/presence-control/components/presence-control-entry/presence-control-entry.component.spec.ts index c33b1a528..fef086c12 100644 --- a/src/app/presence-control/components/presence-control-entry/presence-control-entry.component.spec.ts +++ b/src/app/presence-control/components/presence-control-entry/presence-control-entry.component.spec.ts @@ -5,9 +5,9 @@ import { changeInput, settings, } from "src/spec-helpers"; +import { PresenceControlViewMode } from "../../../shared/models/user-settings.model"; import { PresenceControlEntry } from "../../models/presence-control-entry.model"; import { PresenceControlEntryComponent } from "./presence-control-entry.component"; -import { PresenceControlViewMode } from "../../../shared/models/user-settings.model"; describe("PresenceControlEntryComponent", () => { let component: PresenceControlEntryComponent; diff --git a/src/app/presence-control/components/presence-control-entry/presence-control-entry.component.ts b/src/app/presence-control/components/presence-control-entry/presence-control-entry.component.ts index 1e7bf9caa..8650a36d8 100644 --- a/src/app/presence-control/components/presence-control-entry/presence-control-entry.component.ts +++ b/src/app/presence-control/components/presence-control-entry/presence-control-entry.component.ts @@ -10,13 +10,13 @@ import { import { Params } from "@angular/router"; import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; import { TranslateService } from "@ngx-translate/core"; -import { map, ReplaySubject, switchMap } from "rxjs"; -import { PresenceControlEntry } from "../../models/presence-control-entry.model"; -import { PresenceControlPrecedingAbsenceComponent } from "../presence-control-preceding-absence/presence-control-preceding-absence.component"; -import { ToastService } from "../../../shared/services/toast.service"; +import { ReplaySubject, map, switchMap } from "rxjs"; import { PresenceControlViewMode } from "src/app/shared/models/user-settings.model"; import { LoadingService } from "src/app/shared/services/loading-service"; +import { ToastService } from "../../../shared/services/toast.service"; +import { PresenceControlEntry } from "../../models/presence-control-entry.model"; import { getBlockLessonLoadingContext } from "../../services/presence-control-block-lesson.service"; +import { PresenceControlPrecedingAbsenceComponent } from "../presence-control-preceding-absence/presence-control-preceding-absence.component"; @Component({ selector: "erz-presence-control-entry", diff --git a/src/app/presence-control/components/presence-control-group-dialog/presence-control-group-dialog.component.spec.ts b/src/app/presence-control/components/presence-control-group-dialog/presence-control-group-dialog.component.spec.ts index 636035e74..fca4abb80 100644 --- a/src/app/presence-control/components/presence-control-group-dialog/presence-control-group-dialog.component.spec.ts +++ b/src/app/presence-control/components/presence-control-group-dialog/presence-control-group-dialog.component.spec.ts @@ -2,10 +2,9 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; import { buildSubscriptionDetail } from "../../../../spec-builders"; import { buildTestModuleMetadata } from "../../../../spec-helpers"; - import { - PresenceControlGroupDialogComponent, DialogMode, + PresenceControlGroupDialogComponent, } from "./presence-control-group-dialog.component"; describe("PresenceControlGroupDialogComponent", () => { diff --git a/src/app/presence-control/components/presence-control-group-dialog/presence-control-group-dialog.component.ts b/src/app/presence-control/components/presence-control-group-dialog/presence-control-group-dialog.component.ts index e7c4685bc..4262e1a45 100644 --- a/src/app/presence-control/components/presence-control-group-dialog/presence-control-group-dialog.component.ts +++ b/src/app/presence-control/components/presence-control-group-dialog/presence-control-group-dialog.component.ts @@ -1,8 +1,8 @@ import { Component, Input, OnInit } from "@angular/core"; import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; import { TranslateService } from "@ngx-translate/core"; -import { SubscriptionDetail } from "../../../shared/models/subscription-detail.model"; import { DropDownItem } from "../../../shared/models/drop-down-item.model"; +import { SubscriptionDetail } from "../../../shared/models/subscription-detail.model"; export interface GroupOptions { id: Option; diff --git a/src/app/presence-control/components/presence-control-group/presence-control-group.component.spec.ts b/src/app/presence-control/components/presence-control-group/presence-control-group.component.spec.ts index eba044278..bb7af1c99 100644 --- a/src/app/presence-control/components/presence-control-group/presence-control-group.component.spec.ts +++ b/src/app/presence-control/components/presence-control-group/presence-control-group.component.spec.ts @@ -1,9 +1,8 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; - -import { PresenceControlGroupComponent } from "./presence-control-group.component"; import { buildTestModuleMetadata } from "../../../../spec-helpers"; -import { PresenceControlStateService } from "../../services/presence-control-state.service"; import { PresenceControlGroupService } from "../../services/presence-control-group.service"; +import { PresenceControlStateService } from "../../services/presence-control-state.service"; +import { PresenceControlGroupComponent } from "./presence-control-group.component"; describe("PresenceControlGroupComponent", () => { let component: PresenceControlGroupComponent; diff --git a/src/app/presence-control/components/presence-control-group/presence-control-group.component.ts b/src/app/presence-control/components/presence-control-group/presence-control-group.component.ts index d3ac15701..2ec442309 100644 --- a/src/app/presence-control/components/presence-control-group/presence-control-group.component.ts +++ b/src/app/presence-control/components/presence-control-group/presence-control-group.component.ts @@ -4,7 +4,9 @@ import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; import { TranslateService } from "@ngx-translate/core"; import { BehaviorSubject, combineLatest, forkJoin } from "rxjs"; import { map, switchMap, take } from "rxjs/operators"; +import { UserSettingsService } from "src/app/shared/services/user-settings.service"; import { SubscriptionDetailsRestService } from "../../../shared/services/subscription-details-rest.service"; +import { ToastService } from "../../../shared/services/toast.service"; import { spread } from "../../../shared/utils/function"; import { parseQueryString } from "../../../shared/utils/url"; import { updateGroupViewSettings } from "../../../shared/utils/user-settings"; @@ -12,16 +14,14 @@ import { PresenceControlGroupSelectionService } from "../../services/presence-co import { PresenceControlGroupService } from "../../services/presence-control-group.service"; import { PresenceControlStateService } from "../../services/presence-control-state.service"; import { - sortSubscriptionDetails, SubscriptionDetailWithName, + sortSubscriptionDetails, } from "../../utils/subscriptions-details"; import { + DialogMode, GroupOptions, PresenceControlGroupDialogComponent, - DialogMode, } from "../presence-control-group-dialog/presence-control-group-dialog.component"; -import { ToastService } from "../../../shared/services/toast.service"; -import { UserSettingsService } from "src/app/shared/services/user-settings.service"; export type PrimarySortKey = "name" | "group"; diff --git a/src/app/presence-control/components/presence-control-header/presence-control-header.component.spec.ts b/src/app/presence-control/components/presence-control-header/presence-control-header.component.spec.ts index 7b4dfb213..cab2959ac 100644 --- a/src/app/presence-control/components/presence-control-header/presence-control-header.component.spec.ts +++ b/src/app/presence-control/components/presence-control-header/presence-control-header.component.spec.ts @@ -1,12 +1,11 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { BehaviorSubject } from "rxjs"; - -import { PresenceControlHeaderComponent } from "./presence-control-header.component"; -import { buildTestModuleMetadata } from "src/spec-helpers"; import { buildReference } from "src/spec-builders"; +import { buildTestModuleMetadata } from "src/spec-helpers"; import { fromLesson } from "../../models/lesson-entry.model"; -import { PresenceControlStateService } from "../../services/presence-control-state.service"; import { PresenceControlGroupService } from "../../services/presence-control-group.service"; +import { PresenceControlStateService } from "../../services/presence-control-state.service"; +import { PresenceControlHeaderComponent } from "./presence-control-header.component"; describe("PresenceControlHeaderComponent", () => { let component: PresenceControlHeaderComponent; diff --git a/src/app/presence-control/components/presence-control-header/presence-control-header.component.ts b/src/app/presence-control/components/presence-control-header/presence-control-header.component.ts index 1ad845268..945a77754 100644 --- a/src/app/presence-control/components/presence-control-header/presence-control-header.component.ts +++ b/src/app/presence-control/components/presence-control-header/presence-control-header.component.ts @@ -1,8 +1,8 @@ import { Component, + EventEmitter, Input, Output, - EventEmitter, ViewChild, } from "@angular/core"; import { @@ -13,13 +13,13 @@ import { NgbInputDatepickerConfig, } from "@ng-bootstrap/ng-bootstrap"; import { Options } from "@popperjs/core"; -import { notNull } from "src/app/shared/utils/filter"; import { map } from "rxjs"; +import { PresenceControlViewMode } from "src/app/shared/models/user-settings.model"; import { DateParserFormatter } from "src/app/shared/services/date-parser-formatter"; -import { PresenceControlStateService } from "../../services/presence-control-state.service"; +import { notNull } from "src/app/shared/utils/filter"; import { LessonEntry } from "../../models/lesson-entry.model"; -import { PresenceControlViewMode } from "src/app/shared/models/user-settings.model"; import { PresenceControlGroupService } from "../../services/presence-control-group.service"; +import { PresenceControlStateService } from "../../services/presence-control-state.service"; /** * On small screens, the `.dropdown` element gets translated diff --git a/src/app/presence-control/components/presence-control-incident/presence-control-incident.component.spec.ts b/src/app/presence-control/components/presence-control-incident/presence-control-incident.component.spec.ts index 7b99c0f11..587c716d5 100644 --- a/src/app/presence-control/components/presence-control-incident/presence-control-incident.component.spec.ts +++ b/src/app/presence-control/components/presence-control-incident/presence-control-incident.component.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { PresenceControlIncidentComponent } from "./presence-control-incident.component"; -import { buildTestModuleMetadata } from "src/spec-helpers"; import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { buildTestModuleMetadata } from "src/spec-helpers"; +import { PresenceControlIncidentComponent } from "./presence-control-incident.component"; describe("PresenceControlIncidentComponent", () => { let component: PresenceControlIncidentComponent; diff --git a/src/app/presence-control/components/presence-control-incident/presence-control-incident.component.ts b/src/app/presence-control/components/presence-control-incident/presence-control-incident.component.ts index 648bb8eca..8e0393836 100644 --- a/src/app/presence-control/components/presence-control-incident/presence-control-incident.component.ts +++ b/src/app/presence-control/components/presence-control-incident/presence-control-incident.component.ts @@ -1,7 +1,7 @@ -import { Component, OnInit, Input } from "@angular/core"; +import { Component, Input, OnInit } from "@angular/core"; import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; -import { PresenceType } from "../../../shared/models/presence-type.model"; import { TranslateService } from "@ngx-translate/core"; +import { PresenceType } from "../../../shared/models/presence-type.model"; interface IncidentOption { id: Option; diff --git a/src/app/presence-control/components/presence-control-list/presence-control-list.component.spec.ts b/src/app/presence-control/components/presence-control-list/presence-control-list.component.spec.ts index c89eb53f2..3b7a17e59 100644 --- a/src/app/presence-control/components/presence-control-list/presence-control-list.component.spec.ts +++ b/src/app/presence-control/components/presence-control-list/presence-control-list.component.spec.ts @@ -1,23 +1,22 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { of, BehaviorSubject } from "rxjs"; - -import { buildTestModuleMetadata, settings } from "src/spec-helpers"; +import { BehaviorSubject, of } from "rxjs"; +import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; +import { Lesson } from "src/app/shared/models/lesson.model"; +import { PresenceType } from "src/app/shared/models/presence-type.model"; +import { LessonPresencesUpdateService } from "src/app/shared/services/lesson-presences-update.service"; import { - buildLessonPresence, buildLesson, + buildLessonPresence, buildPresenceType, } from "src/spec-builders"; -import { PresenceControlListComponent } from "./presence-control-list.component"; -import { PresenceControlHeaderComponent } from "../presence-control-header/presence-control-header.component"; -import { PresenceControlStateService } from "../../services/presence-control-state.service"; -import { PresenceControlEntryComponent } from "../presence-control-entry/presence-control-entry.component"; +import { buildTestModuleMetadata, settings } from "src/spec-helpers"; import { PresenceControlEntry } from "../../models/presence-control-entry.model"; -import { Lesson } from "src/app/shared/models/lesson.model"; -import { LessonPresencesUpdateService } from "src/app/shared/services/lesson-presences-update.service"; -import { PresenceType } from "src/app/shared/models/presence-type.model"; -import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; import { PresenceControlBlockLessonService } from "../../services/presence-control-block-lesson.service"; import { PresenceControlGroupService } from "../../services/presence-control-group.service"; +import { PresenceControlStateService } from "../../services/presence-control-state.service"; +import { PresenceControlEntryComponent } from "../presence-control-entry/presence-control-entry.component"; +import { PresenceControlHeaderComponent } from "../presence-control-header/presence-control-header.component"; +import { PresenceControlListComponent } from "./presence-control-list.component"; describe("PresenceControlListComponent", () => { let component: PresenceControlListComponent; diff --git a/src/app/presence-control/components/presence-control-list/presence-control-list.component.ts b/src/app/presence-control/components/presence-control-list/presence-control-list.component.ts index be9a243dc..44a4908d6 100644 --- a/src/app/presence-control/components/presence-control-list/presence-control-list.component.ts +++ b/src/app/presence-control/components/presence-control-list/presence-control-list.component.ts @@ -1,29 +1,28 @@ import { + AfterViewInit, ChangeDetectionStrategy, Component, - OnInit, - AfterViewInit, OnDestroy, + OnInit, } from "@angular/core"; import { ActivatedRoute, Params } from "@angular/router"; import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; -import { BehaviorSubject, combineLatest, Subject } from "rxjs"; +import { BehaviorSubject, Subject, combineLatest } from "rxjs"; import { map, shareReplay, take, takeUntil } from "rxjs/operators"; - import { LessonPresencesUpdateService } from "src/app/shared/services/lesson-presences-update.service"; +import { ScrollPositionService } from "src/app/shared/services/scroll-position.service"; +import { parseISOLocalDate } from "src/app/shared/utils/date"; import { searchEntries } from "src/app/shared/utils/search"; +import { PresenceTypesService } from "../../../shared/services/presence-types.service"; import { spread } from "../../../shared/utils/function"; import { PresenceControlEntry } from "../../models/presence-control-entry.model"; +import { PresenceControlBlockLessonService } from "../../services/presence-control-block-lesson.service"; import { PresenceControlStateService, VIEW_MODES, } from "../../services/presence-control-state.service"; import { PresenceControlBlockLessonComponent } from "../presence-control-block-lesson/presence-control-block-lesson.component"; -import { ScrollPositionService } from "src/app/shared/services/scroll-position.service"; -import { parseISOLocalDate } from "src/app/shared/utils/date"; import { PresenceControlIncidentComponent } from "../presence-control-incident/presence-control-incident.component"; -import { PresenceTypesService } from "../../../shared/services/presence-types.service"; -import { PresenceControlBlockLessonService } from "../../services/presence-control-block-lesson.service"; @Component({ selector: "erz-presence-control-list", diff --git a/src/app/presence-control/components/presence-control-preceding-absence/presence-control-preceding-absence.component.spec.ts b/src/app/presence-control/components/presence-control-preceding-absence/presence-control-preceding-absence.component.spec.ts index 45e2dffe5..cd78b62ef 100644 --- a/src/app/presence-control/components/presence-control-preceding-absence/presence-control-preceding-absence.component.spec.ts +++ b/src/app/presence-control/components/presence-control-preceding-absence/presence-control-preceding-absence.component.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; - -import { PresenceControlPrecedingAbsenceComponent } from "./presence-control-preceding-absence.component"; -import { buildTestModuleMetadata } from "../../../../spec-helpers"; import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; +import { buildTestModuleMetadata } from "../../../../spec-helpers"; +import { PresenceControlPrecedingAbsenceComponent } from "./presence-control-preceding-absence.component"; describe("PresenceControlPreviousAbsenceComponent", () => { let component: PresenceControlPrecedingAbsenceComponent; diff --git a/src/app/presence-control/components/presence-control/presence-control.component.spec.ts b/src/app/presence-control/components/presence-control/presence-control.component.spec.ts index 2cc1a2574..2ce786b26 100644 --- a/src/app/presence-control/components/presence-control/presence-control.component.spec.ts +++ b/src/app/presence-control/components/presence-control/presence-control.component.spec.ts @@ -1,5 +1,4 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - import { buildTestModuleMetadata } from "src/spec-helpers"; import { PresenceControlComponent } from "./presence-control.component"; diff --git a/src/app/presence-control/components/presence-control/presence-control.component.ts b/src/app/presence-control/components/presence-control/presence-control.component.ts index d26ea3f8b..f83e9cc92 100644 --- a/src/app/presence-control/components/presence-control/presence-control.component.ts +++ b/src/app/presence-control/components/presence-control/presence-control.component.ts @@ -1,17 +1,16 @@ import { - Component, - OnInit, ChangeDetectionStrategy, + Component, OnDestroy, + OnInit, } from "@angular/core"; import { Subject } from "rxjs"; import { takeUntil } from "rxjs/operators"; - -import { PresenceControlStateService } from "../../services/presence-control-state.service"; import { LessonPresencesUpdateService } from "src/app/shared/services/lesson-presences-update.service"; import { CONFIRM_ABSENCES_SERVICE } from "src/app/shared/tokens/confirm-absences-service"; -import { PresenceControlGroupService } from "../../services/presence-control-group.service"; import { PresenceControlBlockLessonService } from "../../services/presence-control-block-lesson.service"; +import { PresenceControlGroupService } from "../../services/presence-control-group.service"; +import { PresenceControlStateService } from "../../services/presence-control-state.service"; @Component({ selector: "erz-presence-control", diff --git a/src/app/presence-control/models/lesson-entry.model.spec.ts b/src/app/presence-control/models/lesson-entry.model.spec.ts index c5c6dba9c..3aca5dce8 100644 --- a/src/app/presence-control/models/lesson-entry.model.spec.ts +++ b/src/app/presence-control/models/lesson-entry.model.spec.ts @@ -1,5 +1,5 @@ -import { fromLesson, lessonsEntryEqual } from "./lesson-entry.model"; import { buildLesson } from "../../../spec-builders"; +import { fromLesson, lessonsEntryEqual } from "./lesson-entry.model"; describe("lessons entry", () => { describe(".lessonsEntryEqual", () => { diff --git a/src/app/presence-control/models/lesson-entry.model.ts b/src/app/presence-control/models/lesson-entry.model.ts index 55b502ece..21ed34237 100644 --- a/src/app/presence-control/models/lesson-entry.model.ts +++ b/src/app/presence-control/models/lesson-entry.model.ts @@ -1,5 +1,5 @@ -import { Lesson } from "../../shared/models/lesson.model"; import { LessonPresence } from "../../shared/models/lesson-presence.model"; +import { Lesson } from "../../shared/models/lesson.model"; import { lessonsEqual } from "../utils/lessons"; export function lessonsEntryEqual( diff --git a/src/app/presence-control/models/presence-control-entry.model.spec.ts b/src/app/presence-control/models/presence-control-entry.model.spec.ts index eb5d76d04..b06a75cba 100644 --- a/src/app/presence-control/models/presence-control-entry.model.spec.ts +++ b/src/app/presence-control/models/presence-control-entry.model.spec.ts @@ -1,9 +1,9 @@ +import { PresenceType } from "src/app/shared/models/presence-type.model"; +import { buildLessonPresence, buildPresenceType } from "src/spec-builders"; import { - PresenceControlEntry, PresenceCategory, + PresenceControlEntry, } from "./presence-control-entry.model"; -import { buildLessonPresence, buildPresenceType } from "src/spec-builders"; -import { PresenceType } from "src/app/shared/models/presence-type.model"; describe("PresenceControlEntry", () => { let absenceType: PresenceType; diff --git a/src/app/presence-control/models/presence-control-entry.model.ts b/src/app/presence-control/models/presence-control-entry.model.ts index 9fb06387d..4388522b1 100644 --- a/src/app/presence-control/models/presence-control-entry.model.ts +++ b/src/app/presence-control/models/presence-control-entry.model.ts @@ -1,15 +1,15 @@ +import { Settings } from "src/app/settings"; +import { DropDownItem } from "src/app/shared/models/drop-down-item.model"; import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; import { PresenceType } from "src/app/shared/models/presence-type.model"; -import { Settings } from "src/app/settings"; import { Searchable } from "src/app/shared/utils/search"; +import { LessonAbsence } from "../../shared/models/lesson-absence.model"; import { + canChangePresenceType, isAbsent, isDefaultAbsence, - canChangePresenceType, isUnapprovedAbsence, } from "../utils/presence-types"; -import { DropDownItem } from "src/app/shared/models/drop-down-item.model"; -import { LessonAbsence } from "../../shared/models/lesson-absence.model"; export enum PresenceCategory { Present = "present", diff --git a/src/app/presence-control/presence-control.module.ts b/src/app/presence-control/presence-control.module.ts index 392cd1048..2b3c78adf 100644 --- a/src/app/presence-control/presence-control.module.ts +++ b/src/app/presence-control/presence-control.module.ts @@ -1,17 +1,16 @@ import { NgModule } from "@angular/core"; - +import { ConfirmAbsencesSelectionService } from "../shared/services/confirm-absences-selection.service"; import { SharedModule } from "../shared/shared.module"; -import { PresenceControlRoutingModule } from "./presence-control-routing.module"; -import { PresenceControlComponent } from "./components/presence-control/presence-control.component"; -import { PresenceControlHeaderComponent } from "./components/presence-control-header/presence-control-header.component"; -import { PresenceControlListComponent } from "./components/presence-control-list/presence-control-list.component"; -import { PresenceControlEntryComponent } from "./components/presence-control-entry/presence-control-entry.component"; import { PresenceControlBlockLessonComponent } from "./components/presence-control-block-lesson/presence-control-block-lesson.component"; +import { PresenceControlEntryComponent } from "./components/presence-control-entry/presence-control-entry.component"; +import { PresenceControlGroupDialogComponent } from "./components/presence-control-group-dialog/presence-control-group-dialog.component"; +import { PresenceControlGroupComponent } from "./components/presence-control-group/presence-control-group.component"; +import { PresenceControlHeaderComponent } from "./components/presence-control-header/presence-control-header.component"; import { PresenceControlIncidentComponent } from "./components/presence-control-incident/presence-control-incident.component"; +import { PresenceControlListComponent } from "./components/presence-control-list/presence-control-list.component"; import { PresenceControlPrecedingAbsenceComponent } from "./components/presence-control-preceding-absence/presence-control-preceding-absence.component"; -import { PresenceControlGroupComponent } from "./components/presence-control-group/presence-control-group.component"; -import { PresenceControlGroupDialogComponent } from "./components/presence-control-group-dialog/presence-control-group-dialog.component"; -import { ConfirmAbsencesSelectionService } from "../shared/services/confirm-absences-selection.service"; +import { PresenceControlComponent } from "./components/presence-control/presence-control.component"; +import { PresenceControlRoutingModule } from "./presence-control-routing.module"; @NgModule({ declarations: [ diff --git a/src/app/presence-control/services/presence-control-block-lesson.service.spec.ts b/src/app/presence-control/services/presence-control-block-lesson.service.spec.ts index e0622213e..6647973ef 100644 --- a/src/app/presence-control/services/presence-control-block-lesson.service.spec.ts +++ b/src/app/presence-control/services/presence-control-block-lesson.service.spec.ts @@ -1,8 +1,8 @@ import { HttpTestingController } from "@angular/common/http/testing"; import { TestBed } from "@angular/core/testing"; import { format } from "date-fns"; -import { of } from "rxjs"; import * as t from "io-ts"; +import { of } from "rxjs"; import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; import { Lesson } from "src/app/shared/models/lesson.model"; import { @@ -10,7 +10,6 @@ import { buildPresenceControlEntry, } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { PresenceControlBlockLessonService } from "./presence-control-block-lesson.service"; import { PresenceControlStateService } from "./presence-control-state.service"; diff --git a/src/app/presence-control/services/presence-control-block-lesson.service.ts b/src/app/presence-control/services/presence-control-block-lesson.service.ts index 220e01723..1fafe39c5 100644 --- a/src/app/presence-control/services/presence-control-block-lesson.service.ts +++ b/src/app/presence-control/services/presence-control-block-lesson.service.ts @@ -1,13 +1,13 @@ import { Inject, Injectable } from "@angular/core"; -import { combineLatest, map, Observable, take } from "rxjs"; -import { Settings, SETTINGS } from "src/app/settings"; +import { Observable, combineLatest, map, take } from "rxjs"; +import { SETTINGS, Settings } from "src/app/settings"; import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; +import { LessonPresencesRestService } from "src/app/shared/services/lesson-presences-rest.service"; +import { LoadingService } from "src/app/shared/services/loading-service"; import { PresenceControlEntry } from "../models/presence-control-entry.model"; import { getPresenceControlEntry } from "../utils/lessons"; -import { PresenceControlStateService } from "./presence-control-state.service"; import { canChangePresenceType } from "../utils/presence-types"; -import { LessonPresencesRestService } from "src/app/shared/services/lesson-presences-rest.service"; -import { LoadingService } from "src/app/shared/services/loading-service"; +import { PresenceControlStateService } from "./presence-control-state.service"; const MAX_BLOCK_LESSION_MINUTES_GAP = 30; diff --git a/src/app/presence-control/services/presence-control-group-selection.service.ts b/src/app/presence-control/services/presence-control-group-selection.service.ts index c7cadcea7..dae7be35f 100644 --- a/src/app/presence-control/services/presence-control-group-selection.service.ts +++ b/src/app/presence-control/services/presence-control-group-selection.service.ts @@ -1,5 +1,4 @@ import { Injectable } from "@angular/core"; - import { SelectionService } from "src/app/shared/services/selection.service"; import { SubscriptionDetailWithName } from "../utils/subscriptions-details"; diff --git a/src/app/presence-control/services/presence-control-group.service.spec.ts b/src/app/presence-control/services/presence-control-group.service.spec.ts index 3d0664efe..b962e95a1 100644 --- a/src/app/presence-control/services/presence-control-group.service.spec.ts +++ b/src/app/presence-control/services/presence-control-group.service.spec.ts @@ -4,7 +4,7 @@ import * as t from "io-ts/lib/index"; import { buildLesson, buildSubscriptionDetail } from "../../../spec-builders"; import { buildTestModuleMetadata } from "../../../spec-helpers"; import { SubscriptionDetail } from "../../shared/models/subscription-detail.model"; -import { fromLesson, LessonEntry } from "../models/lesson-entry.model"; +import { LessonEntry, fromLesson } from "../models/lesson-entry.model"; import { PresenceControlGroupService } from "./presence-control-group.service"; describe("PresenceControlGroupService", () => { diff --git a/src/app/presence-control/services/presence-control-group.service.ts b/src/app/presence-control/services/presence-control-group.service.ts index baa2c543e..a85cd6f0e 100644 --- a/src/app/presence-control/services/presence-control-group.service.ts +++ b/src/app/presence-control/services/presence-control-group.service.ts @@ -1,28 +1,28 @@ import { Inject, Injectable } from "@angular/core"; -import { combineLatest, Observable, of, ReplaySubject } from "rxjs"; -import { forkJoin, merge, Subject } from "rxjs"; -import { map, switchMap, shareReplay, startWith } from "rxjs/operators"; import { flatten, uniq } from "lodash-es"; +import { Observable, ReplaySubject, combineLatest, of } from "rxjs"; +import { Subject, forkJoin, merge } from "rxjs"; +import { map, shareReplay, startWith, switchMap } from "rxjs/operators"; +import { PresenceControlGroupViewEntry } from "src/app/shared/models/user-settings.model"; +import { UserSettingsService } from "src/app/shared/services/user-settings.service"; import { SETTINGS, Settings } from "../../settings"; import { LessonPresence } from "../../shared/models/lesson-presence.model"; import { SubscriptionDetail } from "../../shared/models/subscription-detail.model"; +import { EventsRestService } from "../../shared/services/events-rest.service"; +import { LoadingService } from "../../shared/services/loading-service"; +import { SubscriptionDetailsRestService } from "../../shared/services/subscription-details-rest.service"; +import { SubscriptionsRestService } from "../../shared/services/subscriptions-rest.service"; +import { spread } from "../../shared/utils/function"; +import { GroupOptions } from "../components/presence-control-group-dialog/presence-control-group-dialog.component"; +import { LessonEntry } from "../models/lesson-entry.model"; import { filterSubscriptionDetailsByGroupId, getSubscriptionDetailsWithName, } from "../utils/subscriptions-details"; -import { EventsRestService } from "../../shared/services/events-rest.service"; -import { LessonEntry } from "../models/lesson-entry.model"; import { - findSubscriptionDetailByGroupId, SubscriptionDetailWithName, + findSubscriptionDetailByGroupId, } from "../utils/subscriptions-details"; -import { SubscriptionsRestService } from "../../shared/services/subscriptions-rest.service"; -import { SubscriptionDetailsRestService } from "../../shared/services/subscription-details-rest.service"; -import { spread } from "../../shared/utils/function"; -import { LoadingService } from "../../shared/services/loading-service"; -import { UserSettingsService } from "src/app/shared/services/user-settings.service"; -import { PresenceControlGroupViewEntry } from "src/app/shared/models/user-settings.model"; -import { GroupOptions } from "../components/presence-control-group-dialog/presence-control-group-dialog.component"; const GROUP_LOADING_CONTEXT = "presence-control-group"; diff --git a/src/app/presence-control/services/presence-control-state.service.spec.ts b/src/app/presence-control/services/presence-control-state.service.spec.ts index 62f2a8194..8acb97277 100644 --- a/src/app/presence-control/services/presence-control-state.service.spec.ts +++ b/src/app/presence-control/services/presence-control-state.service.spec.ts @@ -1,27 +1,26 @@ -import { TestBed } from "@angular/core/testing"; import { HttpTestingController } from "@angular/common/http/testing"; +import { TestBed } from "@angular/core/testing"; import * as t from "io-ts/lib/index"; import { of } from "rxjs"; - -import { buildTestModuleMetadata } from "src/spec-helpers"; -import { PresenceControlStateService } from "./presence-control-state.service"; -import { LessonPresence } from "../../shared/models/lesson-presence.model"; +import { Lesson } from "src/app/shared/models/lesson.model"; +import { UserSettingsService } from "src/app/shared/services/user-settings.service"; import { - buildLessonPresence, buildLesson, - buildPresenceType, - buildPresenceControlEntry, + buildLessonPresence, buildPerson, + buildPresenceControlEntry, + buildPresenceType, } from "src/spec-builders"; -import { PresenceType } from "../../shared/models/presence-type.model"; +import { buildTestModuleMetadata } from "src/spec-helpers"; import { DropDownItem } from "../../shared/models/drop-down-item.model"; -import { fromLesson } from "../models/lesson-entry.model"; import { LessonAbsence } from "../../shared/models/lesson-absence.model"; +import { LessonPresence } from "../../shared/models/lesson-presence.model"; import { Person } from "../../shared/models/person.model"; -import { PresenceControlGroupService } from "./presence-control-group.service"; +import { PresenceType } from "../../shared/models/presence-type.model"; import { StorageService } from "../../shared/services/storage.service"; -import { UserSettingsService } from "src/app/shared/services/user-settings.service"; -import { Lesson } from "src/app/shared/models/lesson.model"; +import { fromLesson } from "../models/lesson-entry.model"; +import { PresenceControlGroupService } from "./presence-control-group.service"; +import { PresenceControlStateService } from "./presence-control-state.service"; describe("PresenceControlStateService", () => { let service: PresenceControlStateService; diff --git a/src/app/presence-control/services/presence-control-state.service.ts b/src/app/presence-control/services/presence-control-state.service.ts index e4fd77490..0b348a7b8 100644 --- a/src/app/presence-control/services/presence-control-state.service.ts +++ b/src/app/presence-control/services/presence-control-state.service.ts @@ -5,11 +5,11 @@ import { format, startOfDay } from "date-fns"; import { isEqual, uniq } from "lodash-es"; import { BehaviorSubject, + Observable, + Subject, combineLatest, merge, - Observable, of, - Subject, timer, } from "rxjs"; import { @@ -22,8 +22,14 @@ import { take, takeUntil, } from "rxjs/operators"; -import { Settings, SETTINGS } from "src/app/settings"; +import { SETTINGS, Settings } from "src/app/settings"; +import { PresenceControlViewMode } from "src/app/shared/models/user-settings.model"; +import { UserSettingsService } from "src/app/shared/services/user-settings.service"; import { IConfirmAbsencesService } from "src/app/shared/tokens/confirm-absences-service"; +import { + intervalOnInactivity, + reemitOnTrigger, +} from "src/app/shared/utils/observable"; import { serializeParams } from "src/app/shared/utils/url"; import { LessonPresence } from "../../shared/models/lesson-presence.model"; import { PresenceType } from "../../shared/models/presence-type.model"; @@ -33,6 +39,7 @@ import { LessonPresenceUpdate } from "../../shared/services/lesson-presences-upd import { LessonTeachersRestService } from "../../shared/services/lesson-teachers-rest.service"; import { LoadingService } from "../../shared/services/loading-service"; import { PresenceTypesService } from "../../shared/services/presence-types.service"; +import { StorageService } from "../../shared/services/storage.service"; import { spread } from "../../shared/utils/function"; import { filterByGroup } from "../../shared/utils/presence-control-entries"; import { LessonEntry } from "../models/lesson-entry.model"; @@ -48,13 +55,6 @@ import { getPrecedingAbsencesCount, } from "../utils/presence-control-entries"; import { PresenceControlGroupService } from "./presence-control-group.service"; -import { StorageService } from "../../shared/services/storage.service"; -import { PresenceControlViewMode } from "src/app/shared/models/user-settings.model"; -import { UserSettingsService } from "src/app/shared/services/user-settings.service"; -import { - intervalOnInactivity, - reemitOnTrigger, -} from "src/app/shared/utils/observable"; export const VIEW_MODES: ReadonlyArray = Object.values( PresenceControlViewMode, diff --git a/src/app/presence-control/utils/lesson-entries.spec.ts b/src/app/presence-control/utils/lesson-entries.spec.ts index 2515f99d0..8d70da85a 100644 --- a/src/app/presence-control/utils/lesson-entries.spec.ts +++ b/src/app/presence-control/utils/lesson-entries.spec.ts @@ -1,10 +1,10 @@ +import { buildLesson } from "../../../spec-builders"; +import { Lesson } from "../../shared/models/lesson.model"; +import { LessonEntry, fromLesson } from "../models/lesson-entry.model"; import { - getLessonEntriesForLessons, getCurrentLessonEntry, + getLessonEntriesForLessons, } from "./lesson-entries"; -import { buildLesson } from "../../../spec-builders"; -import { fromLesson, LessonEntry } from "../models/lesson-entry.model"; -import { Lesson } from "../../shared/models/lesson.model"; describe("lessons entries", () => { describe("getLessonEntriesForLessons", () => { diff --git a/src/app/presence-control/utils/lesson-entries.ts b/src/app/presence-control/utils/lesson-entries.ts index 51e70ad23..f5de80126 100644 --- a/src/app/presence-control/utils/lesson-entries.ts +++ b/src/app/presence-control/utils/lesson-entries.ts @@ -1,11 +1,11 @@ +import { isBefore, isSameDay, isWithinInterval } from "date-fns"; +import { Lesson } from "src/app/shared/models/lesson.model"; import { - fromLesson, LessonEntry, + fromLesson, lessonsEntryEqual, } from "../models/lesson-entry.model"; import { lessonsComparator, lessonsEqual } from "./lessons"; -import { isBefore, isSameDay, isWithinInterval } from "date-fns"; -import { Lesson } from "src/app/shared/models/lesson.model"; /** * Returns a sorted array of lesson entries for the given lesson presences. diff --git a/src/app/presence-control/utils/lessons.spec.ts b/src/app/presence-control/utils/lessons.spec.ts index 47856fbe6..627105652 100644 --- a/src/app/presence-control/utils/lessons.spec.ts +++ b/src/app/presence-control/utils/lessons.spec.ts @@ -1,14 +1,14 @@ import { - buildLessonPresence, buildLesson, + buildLessonPresence, buildReference, } from "../../../spec-builders"; +import { fromLesson } from "../models/lesson-entry.model"; import { - lessonsEqual, extractLesson, getLessonPresencesForLesson, + lessonsEqual, } from "./lessons"; -import { fromLesson } from "../models/lesson-entry.model"; describe("lessons utils", () => { beforeEach(() => jasmine.clock().install()); diff --git a/src/app/presence-control/utils/lessons.ts b/src/app/presence-control/utils/lessons.ts index b0e337682..4c8318fcf 100644 --- a/src/app/presence-control/utils/lessons.ts +++ b/src/app/presence-control/utils/lessons.ts @@ -1,11 +1,11 @@ -import { Lesson } from "../../shared/models/lesson.model"; -import { LessonPresence } from "../../shared/models/lesson-presence.model"; -import { PresenceControlEntry } from "../models/presence-control-entry.model"; +import { uniqBy } from "lodash-es"; import { PresenceType } from "src/app/shared/models/presence-type.model"; import { DropDownItem } from "../../shared/models/drop-down-item.model"; -import { LessonEntry } from "../models/lesson-entry.model"; import { LessonAbsence } from "../../shared/models/lesson-absence.model"; -import { uniqBy } from "lodash-es"; +import { LessonPresence } from "../../shared/models/lesson-presence.model"; +import { Lesson } from "../../shared/models/lesson.model"; +import { LessonEntry } from "../models/lesson-entry.model"; +import { PresenceControlEntry } from "../models/presence-control-entry.model"; export function lessonsEqual( a: Option, diff --git a/src/app/presence-control/utils/presence-control-entries.spec.ts b/src/app/presence-control/utils/presence-control-entries.spec.ts index e06666d26..09d2e71ba 100644 --- a/src/app/presence-control/utils/presence-control-entries.spec.ts +++ b/src/app/presence-control/utils/presence-control-entries.spec.ts @@ -1,6 +1,6 @@ +import { searchEntries } from "src/app/shared/utils/search"; import { buildLessonPresence } from "src/spec-builders"; import { PresenceControlEntry } from "../models/presence-control-entry.model"; -import { searchEntries } from "src/app/shared/utils/search"; describe("presence control entries utils", () => { let bichsel: PresenceControlEntry; diff --git a/src/app/presence-control/utils/presence-types.spec.ts b/src/app/presence-control/utils/presence-types.spec.ts index a4a3b3bdb..97e55a056 100644 --- a/src/app/presence-control/utils/presence-types.spec.ts +++ b/src/app/presence-control/utils/presence-types.spec.ts @@ -1,11 +1,11 @@ +import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; +import { PresenceType } from "src/app/shared/models/presence-type.model"; +import { buildLessonPresence, buildPresenceType } from "src/spec-builders"; +import { settings } from "src/spec-helpers"; import { - getNewConfirmationStateId, canChangePresenceType, + getNewConfirmationStateId, } from "./presence-types"; -import { buildLessonPresence, buildPresenceType } from "src/spec-builders"; -import { PresenceType } from "src/app/shared/models/presence-type.model"; -import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; -import { settings } from "src/spec-helpers"; describe("presence types", () => { let absenceType: PresenceType; diff --git a/src/app/presence-control/utils/presence-types.ts b/src/app/presence-control/utils/presence-types.ts index 65e092028..10baa92c9 100644 --- a/src/app/presence-control/utils/presence-types.ts +++ b/src/app/presence-control/utils/presence-types.ts @@ -1,6 +1,6 @@ -import { PresenceType } from "src/app/shared/models/presence-type.model"; import { Settings } from "src/app/settings"; import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; +import { PresenceType } from "src/app/shared/models/presence-type.model"; export function isPresent(presenceType: Option): boolean { return Boolean(!presenceType); diff --git a/src/app/rest-auth-interceptor.spec.ts b/src/app/rest-auth-interceptor.spec.ts index 0cff7c7f6..650981451 100644 --- a/src/app/rest-auth-interceptor.spec.ts +++ b/src/app/rest-auth-interceptor.spec.ts @@ -1,7 +1,6 @@ -import { TestBed } from "@angular/core/testing"; import { HttpClient } from "@angular/common/http"; import { HttpTestingController } from "@angular/common/http/testing"; - +import { TestBed } from "@angular/core/testing"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { AuthService } from "./shared/services/auth.service"; diff --git a/src/app/rest-auth-interceptor.ts b/src/app/rest-auth-interceptor.ts index 4fb58acb5..337a1f411 100644 --- a/src/app/rest-auth-interceptor.ts +++ b/src/app/rest-auth-interceptor.ts @@ -1,14 +1,13 @@ -import { Injectable, Inject } from "@angular/core"; import { + HttpEvent, + HttpHandler, HttpInterceptor, HttpRequest, - HttpHandler, - HttpEvent, } from "@angular/common/http"; +import { Inject, Injectable } from "@angular/core"; import { Observable } from "rxjs"; - -import { AuthService } from "./shared/services/auth.service"; import { SETTINGS, Settings } from "./settings"; +import { AuthService } from "./shared/services/auth.service"; @Injectable() export class RestAuthInterceptor implements HttpInterceptor { diff --git a/src/app/rest-error-interceptor.spec.ts b/src/app/rest-error-interceptor.spec.ts index 9cbac4214..a7de520e4 100644 --- a/src/app/rest-error-interceptor.spec.ts +++ b/src/app/rest-error-interceptor.spec.ts @@ -1,10 +1,9 @@ -import { TestBed } from "@angular/core/testing"; import { HttpClient } from "@angular/common/http"; import { HttpTestingController } from "@angular/common/http/testing"; +import { TestBed } from "@angular/core/testing"; import { Router } from "@angular/router"; - -import { withConfig } from "./rest-error-interceptor"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { withConfig } from "./rest-error-interceptor"; import { ToastService } from "./shared/services/toast.service"; describe("RestErrorInterceptor", () => { diff --git a/src/app/rest-error-interceptor.ts b/src/app/rest-error-interceptor.ts index 975d55953..5eac0dd6f 100644 --- a/src/app/rest-error-interceptor.ts +++ b/src/app/rest-error-interceptor.ts @@ -1,17 +1,16 @@ -import { Injectable } from "@angular/core"; import { - HttpInterceptor, - HttpRequest, - HttpHandler, - HttpEvent, HttpErrorResponse, + HttpEvent, + HttpHandler, + HttpInterceptor, HttpParams, + HttpRequest, } from "@angular/common/http"; +import { Injectable } from "@angular/core"; import { Router } from "@angular/router"; -import { Observable, EMPTY, throwError } from "rxjs"; -import { catchError } from "rxjs/operators"; import { TranslateService } from "@ngx-translate/core"; - +import { EMPTY, Observable, throwError } from "rxjs"; +import { catchError } from "rxjs/operators"; import { HTTP_STATUS } from "./shared/services/rest.service"; import { ToastService } from "./shared/services/toast.service"; import { nonEmptyString } from "./shared/utils/filter"; diff --git a/src/app/rest-role-interceptor.spec.ts b/src/app/rest-role-interceptor.spec.ts index 44db91290..90ed5ba70 100644 --- a/src/app/rest-role-interceptor.spec.ts +++ b/src/app/rest-role-interceptor.spec.ts @@ -1,8 +1,7 @@ -import { TestBed } from "@angular/core/testing"; import { HttpClient } from "@angular/common/http"; import { HttpTestingController } from "@angular/common/http/testing"; +import { TestBed } from "@angular/core/testing"; import { Router } from "@angular/router"; - import { buildTestModuleMetadata } from "src/spec-helpers"; describe("RestRoleInterceptor", () => { diff --git a/src/app/rest-role-interceptor.ts b/src/app/rest-role-interceptor.ts index 433be1b8b..11bd2c721 100644 --- a/src/app/rest-role-interceptor.ts +++ b/src/app/rest-role-interceptor.ts @@ -1,14 +1,14 @@ -import { Inject, Injectable } from "@angular/core"; import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, } from "@angular/common/http"; -import { Observable } from "rxjs"; -import { SETTINGS, Settings } from "./settings"; +import { Inject, Injectable } from "@angular/core"; import { Router } from "@angular/router"; import camelCase from "lodash-es/camelCase"; +import { Observable } from "rxjs"; +import { SETTINGS, Settings } from "./settings"; import { getFirstSegment } from "./shared/utils/url"; @Injectable() diff --git a/src/app/settings.ts b/src/app/settings.ts index e07d63008..bdeb72eed 100644 --- a/src/app/settings.ts +++ b/src/app/settings.ts @@ -1,6 +1,5 @@ import { InjectionToken } from "@angular/core"; import * as t from "io-ts"; - import { Option } from "./shared/models/common-types"; import { fromEnum } from "./shared/utils/types"; diff --git a/src/app/shared/components/avatar/avatar.component.ts b/src/app/shared/components/avatar/avatar.component.ts index 8bf1bb8b2..fcc68fde3 100644 --- a/src/app/shared/components/avatar/avatar.component.ts +++ b/src/app/shared/components/avatar/avatar.component.ts @@ -2,11 +2,10 @@ import { Component, Inject, Input, - SimpleChanges, OnChanges, + SimpleChanges, } from "@angular/core"; import { Params } from "@angular/router"; - import { SETTINGS, Settings } from "src/app/settings"; import { StorageService } from "../../services/storage.service"; diff --git a/src/app/shared/components/backlink/backlink.component.spec.ts b/src/app/shared/components/backlink/backlink.component.spec.ts index 45aea2386..7aece3b3c 100644 --- a/src/app/shared/components/backlink/backlink.component.spec.ts +++ b/src/app/shared/components/backlink/backlink.component.spec.ts @@ -1,6 +1,5 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { BacklinkComponent } from "./backlink.component"; describe("BacklinkComponent", () => { diff --git a/src/app/shared/components/caret/caret.component.spec.ts b/src/app/shared/components/caret/caret.component.spec.ts index d1ccbc43d..9b51a2330 100644 --- a/src/app/shared/components/caret/caret.component.spec.ts +++ b/src/app/shared/components/caret/caret.component.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; - -import { CaretComponent } from "./caret.component"; import { buildTestModuleMetadata } from "../../../../spec-helpers"; +import { CaretComponent } from "./caret.component"; describe("CaretComponent", () => { let component: CaretComponent; diff --git a/src/app/shared/components/confirm-absences/confirm-absences.component.spec.ts b/src/app/shared/components/confirm-absences/confirm-absences.component.spec.ts index 1eff1cbe6..669103009 100644 --- a/src/app/shared/components/confirm-absences/confirm-absences.component.spec.ts +++ b/src/app/shared/components/confirm-absences/confirm-absences.component.spec.ts @@ -1,10 +1,9 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { Router, ActivatedRoute } from "@angular/router"; - -import { buildTestModuleMetadata } from "src/spec-helpers"; -import { ConfirmAbsencesComponent } from "./confirm-absences.component"; +import { ActivatedRoute, Router } from "@angular/router"; import { OpenAbsencesService } from "src/app/open-absences/services/open-absences.service"; +import { buildTestModuleMetadata } from "src/spec-helpers"; import { ConfirmAbsencesSelectionService } from "../../services/confirm-absences-selection.service"; +import { ConfirmAbsencesComponent } from "./confirm-absences.component"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/shared/components/confirm-absences/confirm-absences.component.ts b/src/app/shared/components/confirm-absences/confirm-absences.component.ts index 708ff191e..b15b0a8f7 100644 --- a/src/app/shared/components/confirm-absences/confirm-absences.component.ts +++ b/src/app/shared/components/confirm-absences/confirm-absences.component.ts @@ -1,47 +1,46 @@ import { + ChangeDetectionStrategy, Component, - OnInit, - OnDestroy, Inject, - ChangeDetectionStrategy, + OnDestroy, + OnInit, Optional, } from "@angular/core"; import { - UntypedFormGroup, UntypedFormBuilder, + UntypedFormGroup, Validators, } from "@angular/forms"; -import { Router, ActivatedRoute } from "@angular/router"; -import { BehaviorSubject, Subject, combineLatest, Observable } from "rxjs"; +import { ActivatedRoute, Router } from "@angular/router"; +import { TranslateService } from "@ngx-translate/core"; +import { BehaviorSubject, Observable, Subject, combineLatest } from "rxjs"; import { - takeUntil, filter, - map, finalize, + map, shareReplay, - take, switchMap, + take, + takeUntil, } from "rxjs/operators"; -import { TranslateService } from "@ngx-translate/core"; - +import { SETTINGS, Settings } from "src/app/settings"; +import { DropDownItemsRestService } from "src/app/shared/services/drop-down-items-rest.service"; +import { LessonPresencesUpdateRestService } from "src/app/shared/services/lesson-presences-update-rest.service"; +import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; +import { findDropDownItem$ } from "src/app/shared/utils/drop-down-items"; import { notNull } from "src/app/shared/utils/filter"; import { - getValidationErrors, getControl, getControlValueChanges, + getValidationErrors, } from "src/app/shared/utils/form"; -import { DropDownItemsRestService } from "src/app/shared/services/drop-down-items-rest.service"; -import { LessonPresencesUpdateRestService } from "src/app/shared/services/lesson-presences-update-rest.service"; -import { SETTINGS, Settings } from "src/app/settings"; -import { findDropDownItem$ } from "src/app/shared/utils/drop-down-items"; -import { PresenceTypesService } from "src/app/shared/services/presence-types.service"; +import { LessonPresence } from "../../models/lesson-presence.model"; import { ConfirmAbsencesSelectionService } from "../../services/confirm-absences-selection.service"; +import { ToastService } from "../../services/toast.service"; import { CONFIRM_ABSENCES_SERVICE, IConfirmAbsencesService, } from "../../tokens/confirm-absences-service"; -import { LessonPresence } from "../../models/lesson-presence.model"; -import { ToastService } from "../../services/toast.service"; @Component({ selector: "erz-confirm-absences", diff --git a/src/app/shared/components/date-select/date-select.component.spec.ts b/src/app/shared/components/date-select/date-select.component.spec.ts index d76a4d564..18bc0f977 100644 --- a/src/app/shared/components/date-select/date-select.component.spec.ts +++ b/src/app/shared/components/date-select/date-select.component.spec.ts @@ -1,5 +1,4 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - import { buildTestModuleMetadata } from "src/spec-helpers"; import { DateSelectComponent } from "./date-select.component"; diff --git a/src/app/shared/components/date-select/date-select.component.ts b/src/app/shared/components/date-select/date-select.component.ts index edf4d88cf..1ef2f673d 100644 --- a/src/app/shared/components/date-select/date-select.component.ts +++ b/src/app/shared/components/date-select/date-select.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, Output, EventEmitter } from "@angular/core"; +import { Component, EventEmitter, Input, Output } from "@angular/core"; import { uniqueId } from "lodash-es"; @Component({ diff --git a/src/app/shared/components/multiselect/multiselect.component.spec.ts b/src/app/shared/components/multiselect/multiselect.component.spec.ts index 33aa4a323..669f12370 100644 --- a/src/app/shared/components/multiselect/multiselect.component.spec.ts +++ b/src/app/shared/components/multiselect/multiselect.component.spec.ts @@ -1,6 +1,5 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { MultiselectComponent } from "./multiselect.component"; describe("MultiselectComponent", () => { diff --git a/src/app/shared/components/multiselect/multiselect.component.ts b/src/app/shared/components/multiselect/multiselect.component.ts index 207133d52..9b522ca42 100644 --- a/src/app/shared/components/multiselect/multiselect.component.ts +++ b/src/app/shared/components/multiselect/multiselect.component.ts @@ -1,5 +1,4 @@ -import { Component, Input, Output, EventEmitter } from "@angular/core"; - +import { Component, EventEmitter, Input, Output } from "@angular/core"; import { DropDownGroupedItem } from "../../models/drop-down-grouped-item.model"; @Component({ diff --git a/src/app/shared/components/reports-link/reports-link.component.spec.ts b/src/app/shared/components/reports-link/reports-link.component.spec.ts index 278b1bf0b..1f1788451 100644 --- a/src/app/shared/components/reports-link/reports-link.component.spec.ts +++ b/src/app/shared/components/reports-link/reports-link.component.spec.ts @@ -1,5 +1,4 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; - import { ReportsLinkComponent } from "./reports-link.component"; describe("ReportsLinkComponent", () => { diff --git a/src/app/shared/components/resettable-input/resettable-input.component.spec.ts b/src/app/shared/components/resettable-input/resettable-input.component.spec.ts index c7ccb4523..9d7d74693 100644 --- a/src/app/shared/components/resettable-input/resettable-input.component.spec.ts +++ b/src/app/shared/components/resettable-input/resettable-input.component.spec.ts @@ -1,5 +1,4 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; - import { ResettableInputComponent } from "./resettable-input.component"; describe("ResettableInputComponent", () => { diff --git a/src/app/shared/components/select/select.component.spec.ts b/src/app/shared/components/select/select.component.spec.ts index d92c7e94e..11d0b985d 100644 --- a/src/app/shared/components/select/select.component.spec.ts +++ b/src/app/shared/components/select/select.component.spec.ts @@ -1,5 +1,4 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - import { buildTestModuleMetadata } from "src/spec-helpers"; import { SelectComponent } from "./select.component"; diff --git a/src/app/shared/components/select/select.component.ts b/src/app/shared/components/select/select.component.ts index 48677ba92..2adb90b12 100644 --- a/src/app/shared/components/select/select.component.ts +++ b/src/app/shared/components/select/select.component.ts @@ -1,15 +1,14 @@ import { Component, - Input, - Output, EventEmitter, + Input, OnChanges, + Output, SimpleChanges, } from "@angular/core"; - -import { DropDownItem } from "../../models/drop-down-item.model"; import { BehaviorSubject, combineLatest } from "rxjs"; import { map } from "rxjs/operators"; +import { DropDownItem } from "../../models/drop-down-item.model"; @Component({ selector: "erz-select", diff --git a/src/app/shared/components/spinner/spinner.component.spec.ts b/src/app/shared/components/spinner/spinner.component.spec.ts index 02a71fe10..9b79f1c93 100644 --- a/src/app/shared/components/spinner/spinner.component.spec.ts +++ b/src/app/shared/components/spinner/spinner.component.spec.ts @@ -1,5 +1,4 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - import { SpinnerComponent } from "./spinner.component"; describe("SpinnerComponent", () => { diff --git a/src/app/shared/components/student-dossier/dossier-addresses/dossier-addresses.component.spec.ts b/src/app/shared/components/student-dossier/dossier-addresses/dossier-addresses.component.spec.ts index 3ed9a83b0..fc49814e7 100644 --- a/src/app/shared/components/student-dossier/dossier-addresses/dossier-addresses.component.spec.ts +++ b/src/app/shared/components/student-dossier/dossier-addresses/dossier-addresses.component.spec.ts @@ -7,8 +7,8 @@ import { import { buildStudent } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { StudentDossierAddressComponent } from "../student-dossier-address/student-dossier-address.component"; -import { StudentDossierEntryHeaderComponent } from "../student-dossier-entry-header/student-dossier-entry-header.component"; import { StudentDossierApprenticeshipCompanyComponent } from "../student-dossier-apprenticeship-company/student-dossier-apprenticeship-company.component"; +import { StudentDossierEntryHeaderComponent } from "../student-dossier-entry-header/student-dossier-entry-header.component"; import { StudentDossierLegalRepresentativeComponent } from "../student-dossier-legal-representative/student-dossier-legal-representative.component"; import { DossierAddressesComponent } from "./dossier-addresses.component"; diff --git a/src/app/shared/components/student-dossier/dossier-course-tests/dossier-course-tests.component.spec.ts b/src/app/shared/components/student-dossier/dossier-course-tests/dossier-course-tests.component.spec.ts index 4470c1089..2351df378 100644 --- a/src/app/shared/components/student-dossier/dossier-course-tests/dossier-course-tests.component.spec.ts +++ b/src/app/shared/components/student-dossier/dossier-course-tests/dossier-course-tests.component.spec.ts @@ -3,10 +3,10 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { GradingScale } from "src/app/shared/models/grading-scale.model"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { expectText } from "src/specs/expectations"; -import { DossierCourseTestsComponent } from "./dossier-course-tests.component"; import { DossierGradesService } from "../../../services/dossier-grades.service"; import { StorageService } from "../../../services/storage.service"; import { CourseWithGrades } from "../dossier-grades-view/dossier-grades-view.component"; +import { DossierCourseTestsComponent } from "./dossier-course-tests.component"; describe("DossierCourseTestsComponent", () => { let component: DossierCourseTestsComponent; diff --git a/src/app/shared/components/student-dossier/dossier-course-tests/dossier-course-tests.component.ts b/src/app/shared/components/student-dossier/dossier-course-tests/dossier-course-tests.component.ts index 53497778d..56c8ac6b8 100644 --- a/src/app/shared/components/student-dossier/dossier-course-tests/dossier-course-tests.component.ts +++ b/src/app/shared/components/student-dossier/dossier-course-tests/dossier-course-tests.component.ts @@ -1,9 +1,9 @@ import { Component, Input, OnChanges, SimpleChanges } from "@angular/core"; +import { BehaviorSubject } from "rxjs"; import { GradingScale } from "src/app/shared/models/grading-scale.model"; import { Test } from "src/app/shared/models/test.model"; import { gradingScaleOfTest, sortByDate } from "../../../../events/utils/tests"; import { CourseWithGrades } from "../dossier-grades-view/dossier-grades-view.component"; -import { BehaviorSubject } from "rxjs"; @Component({ selector: "erz-dossier-course-tests", diff --git a/src/app/shared/components/student-dossier/dossier-grades-course-header/dossier-grades-course-header.component.spec.ts b/src/app/shared/components/student-dossier/dossier-grades-course-header/dossier-grades-course-header.component.spec.ts index f65bbe1c6..f4245935e 100644 --- a/src/app/shared/components/student-dossier/dossier-grades-course-header/dossier-grades-course-header.component.spec.ts +++ b/src/app/shared/components/student-dossier/dossier-grades-course-header/dossier-grades-course-header.component.spec.ts @@ -4,7 +4,6 @@ import { FinalGrading } from "src/app/shared/models/course.model"; import { Grade } from "src/app/shared/models/grading-scale.model"; import { buildGradingScale } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { DossierGradesCourseHeaderComponent } from "./dossier-grades-course-header.component"; describe("DossierGradesCourseHeaderComponent", () => { diff --git a/src/app/shared/components/student-dossier/dossier-grades-edit/dossier-grades-edit.component.spec.ts b/src/app/shared/components/student-dossier/dossier-grades-edit/dossier-grades-edit.component.spec.ts index 325b2dbcd..c0cf79520 100644 --- a/src/app/shared/components/student-dossier/dossier-grades-edit/dossier-grades-edit.component.spec.ts +++ b/src/app/shared/components/student-dossier/dossier-grades-edit/dossier-grades-edit.component.spec.ts @@ -2,7 +2,6 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; import { buildTest } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { DossierGradesEditComponent } from "./dossier-grades-edit.component"; describe("DossierGradesEditComponent", () => { diff --git a/src/app/shared/components/student-dossier/dossier-grades-edit/dossier-grades-edit.component.ts b/src/app/shared/components/student-dossier/dossier-grades-edit/dossier-grades-edit.component.ts index 89ac2c71f..a3f36fe1c 100644 --- a/src/app/shared/components/student-dossier/dossier-grades-edit/dossier-grades-edit.component.ts +++ b/src/app/shared/components/student-dossier/dossier-grades-edit/dossier-grades-edit.component.ts @@ -9,11 +9,11 @@ import { import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; import { BehaviorSubject, + Observable, + Subject, debounceTime, filter, map, - Observable, - Subject, takeUntil, } from "rxjs"; import { maxPoints } from "src/app/events/utils/tests"; diff --git a/src/app/shared/components/student-dossier/dossier-grades-final-grade/dossier-grades-final-grade.component.spec.ts b/src/app/shared/components/student-dossier/dossier-grades-final-grade/dossier-grades-final-grade.component.spec.ts index 08cfdfbd7..bd98df4d6 100644 --- a/src/app/shared/components/student-dossier/dossier-grades-final-grade/dossier-grades-final-grade.component.spec.ts +++ b/src/app/shared/components/student-dossier/dossier-grades-final-grade/dossier-grades-final-grade.component.spec.ts @@ -3,7 +3,6 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { FinalGrading, Grading } from "src/app/shared/models/course.model"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { expectText } from "src/specs/expectations"; - import { DossierGradesFinalGradeComponent } from "./dossier-grades-final-grade.component"; describe("DossierGradesFinalGradeComponent", () => { diff --git a/src/app/shared/components/student-dossier/dossier-grades-final-grade/dossier-grades-final-grade.component.ts b/src/app/shared/components/student-dossier/dossier-grades-final-grade/dossier-grades-final-grade.component.ts index 207e27ad1..78d066fdd 100644 --- a/src/app/shared/components/student-dossier/dossier-grades-final-grade/dossier-grades-final-grade.component.ts +++ b/src/app/shared/components/student-dossier/dossier-grades-final-grade/dossier-grades-final-grade.component.ts @@ -1,8 +1,8 @@ +import { DecimalPipe } from "@angular/common"; import { Component, Input } from "@angular/core"; import { FinalGrading, Grading } from "src/app/shared/models/course.model"; import { GradingScale } from "src/app/shared/models/grading-scale.model"; import * as Gradings from "src/app/shared/utils/gradings"; -import { DecimalPipe } from "@angular/common"; @Component({ selector: "erz-dossier-grades-final-grade", diff --git a/src/app/shared/components/student-dossier/dossier-grades-view/dossier-grades-view.component.spec.ts b/src/app/shared/components/student-dossier/dossier-grades-view/dossier-grades-view.component.spec.ts index 82bd4cd24..efc56b1ce 100644 --- a/src/app/shared/components/student-dossier/dossier-grades-view/dossier-grades-view.component.spec.ts +++ b/src/app/shared/components/student-dossier/dossier-grades-view/dossier-grades-view.component.spec.ts @@ -2,10 +2,10 @@ import { DebugElement } from "@angular/core"; import { ComponentFixture, TestBed } from "@angular/core/testing"; import { buildTestModuleMetadata, changeInput } from "src/spec-helpers"; import { expectText } from "src/specs/expectations"; -import { DossierGradesViewComponent } from "./dossier-grades-view.component"; +import { buildCourse } from "../../../../../spec-builders"; import { DossierGradesService } from "../../../services/dossier-grades.service"; import { StorageService } from "../../../services/storage.service"; -import { buildCourse } from "../../../../../spec-builders"; +import { DossierGradesViewComponent } from "./dossier-grades-view.component"; describe("DossierGradesViewComponent", () => { let component: DossierGradesViewComponent; diff --git a/src/app/shared/components/student-dossier/dossier-grades-view/dossier-grades-view.component.ts b/src/app/shared/components/student-dossier/dossier-grades-view/dossier-grades-view.component.ts index e21b0980a..6ec6469e7 100644 --- a/src/app/shared/components/student-dossier/dossier-grades-view/dossier-grades-view.component.ts +++ b/src/app/shared/components/student-dossier/dossier-grades-view/dossier-grades-view.component.ts @@ -1,4 +1,5 @@ import { Component, Input, OnChanges } from "@angular/core"; +import { BehaviorSubject } from "rxjs"; import { Course, FinalGrading, @@ -6,7 +7,6 @@ import { } from "src/app/shared/models/course.model"; import { GradingScale } from "src/app/shared/models/grading-scale.model"; import { DossierGradesService } from "src/app/shared/services/dossier-grades.service"; -import { BehaviorSubject } from "rxjs"; import { weightedAverage } from "../../../utils/math"; export interface CourseWithGrades { diff --git a/src/app/shared/components/student-dossier/dossier-grades/dossier-grades.component.spec.ts b/src/app/shared/components/student-dossier/dossier-grades/dossier-grades.component.spec.ts index 9befdea2d..7938f717f 100644 --- a/src/app/shared/components/student-dossier/dossier-grades/dossier-grades.component.spec.ts +++ b/src/app/shared/components/student-dossier/dossier-grades/dossier-grades.component.spec.ts @@ -1,4 +1,5 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; +import { BehaviorSubject, of } from "rxjs"; import { DossierGradesService } from "src/app/shared/services/dossier-grades.service"; import { DossierPage, @@ -6,12 +7,10 @@ import { } from "src/app/shared/services/dossier-state.service"; import { StorageService } from "src/app/shared/services/storage.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; - -import { DossierGradesComponent } from "./dossier-grades.component"; -import { BehaviorSubject, of } from "rxjs"; -import { Course } from "../../../models/course.model"; import { buildCourse, buildGradingScale } from "../../../../../spec-builders"; +import { Course } from "../../../models/course.model"; import { GradingScale } from "../../../models/grading-scale.model"; +import { DossierGradesComponent } from "./dossier-grades.component"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/shared/components/student-dossier/dossier-route.ts b/src/app/shared/components/student-dossier/dossier-route.ts index 2b08a51c9..9c70a0a0a 100644 --- a/src/app/shared/components/student-dossier/dossier-route.ts +++ b/src/app/shared/components/student-dossier/dossier-route.ts @@ -1,9 +1,9 @@ import { Route } from "@angular/router"; import { ConfirmAbsencesComponent } from "../confirm-absences/confirm-absences.component"; -import { StudentDossierComponent } from "./student-dossier/student-dossier.component"; import { DossierAbsencesComponent } from "./dossier-absences/dossier-absences.component"; import { DossierAddressesComponent } from "./dossier-addresses/dossier-addresses.component"; import { DossierGradesComponent } from "./dossier-grades/dossier-grades.component"; +import { StudentDossierComponent } from "./student-dossier/student-dossier.component"; export const dossierRoute: Route = { path: "student/:id", diff --git a/src/app/shared/components/student-dossier/dossier-single-test/dossier-single-test.component.spec.ts b/src/app/shared/components/student-dossier/dossier-single-test/dossier-single-test.component.spec.ts index d48304b2e..4c0ca4b31 100644 --- a/src/app/shared/components/student-dossier/dossier-single-test/dossier-single-test.component.spec.ts +++ b/src/app/shared/components/student-dossier/dossier-single-test/dossier-single-test.component.spec.ts @@ -9,10 +9,9 @@ import { expectNotInTheDocument, expectText, } from "src/specs/expectations"; - -import { DossierSingleTestComponent } from "./dossier-single-test.component"; import { DossierGradesService } from "../../../services/dossier-grades.service"; import { StorageService } from "../../../services/storage.service"; +import { DossierSingleTestComponent } from "./dossier-single-test.component"; describe("DossierSingleTestComponent", () => { let component: DossierSingleTestComponent; diff --git a/src/app/shared/components/student-dossier/dossier-single-test/dossier-single-test.component.ts b/src/app/shared/components/student-dossier/dossier-single-test/dossier-single-test.component.ts index cb718fb19..f099e8544 100644 --- a/src/app/shared/components/student-dossier/dossier-single-test/dossier-single-test.component.ts +++ b/src/app/shared/components/student-dossier/dossier-single-test/dossier-single-test.component.ts @@ -1,6 +1,6 @@ -import { Component, Input, SimpleChanges, OnChanges } from "@angular/core"; +import { Component, Input, OnChanges, SimpleChanges } from "@angular/core"; import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; -import { map, ReplaySubject } from "rxjs"; +import { ReplaySubject, map } from "rxjs"; import { replaceResultInTest, resultOfStudent, @@ -8,8 +8,8 @@ import { import { DropDownItem } from "src/app/shared/models/drop-down-item.model"; import { GradingScale } from "src/app/shared/models/grading-scale.model"; import { Result, Test } from "src/app/shared/models/test.model"; -import { DossierGradesEditComponent } from "../dossier-grades-edit/dossier-grades-edit.component"; import { DossierGradesService } from "../../../services/dossier-grades.service"; +import { DossierGradesEditComponent } from "../dossier-grades-edit/dossier-grades-edit.component"; @Component({ selector: "erz-dossier-single-test", diff --git a/src/app/shared/components/student-dossier/student-backlink/student-backlink.component.spec.ts b/src/app/shared/components/student-dossier/student-backlink/student-backlink.component.spec.ts index 298b87d4f..c30e31818 100644 --- a/src/app/shared/components/student-dossier/student-backlink/student-backlink.component.spec.ts +++ b/src/app/shared/components/student-dossier/student-backlink/student-backlink.component.spec.ts @@ -1,5 +1,4 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - import { buildTestModuleMetadata } from "src/spec-helpers"; import { StudentBacklinkComponent } from "./student-backlink.component"; diff --git a/src/app/shared/components/student-dossier/student-backlink/student-backlink.component.ts b/src/app/shared/components/student-dossier/student-backlink/student-backlink.component.ts index 926cb40b1..0b62c58bf 100644 --- a/src/app/shared/components/student-dossier/student-backlink/student-backlink.component.ts +++ b/src/app/shared/components/student-dossier/student-backlink/student-backlink.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, ChangeDetectionStrategy } from "@angular/core"; +import { ChangeDetectionStrategy, Component, Input } from "@angular/core"; import { Params, RouterLink } from "@angular/router"; import { Student } from "src/app/shared/models/student.model"; diff --git a/src/app/shared/components/student-dossier/student-dossier-absences/student-dossier-absences.component.spec.ts b/src/app/shared/components/student-dossier/student-dossier-absences/student-dossier-absences.component.spec.ts index 189c9d58a..6e7edb57d 100644 --- a/src/app/shared/components/student-dossier/student-dossier-absences/student-dossier-absences.component.spec.ts +++ b/src/app/shared/components/student-dossier/student-dossier-absences/student-dossier-absences.component.spec.ts @@ -1,5 +1,4 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - import { buildTestModuleMetadata } from "src/spec-helpers"; import { StudentDossierAbsencesComponent } from "./student-dossier-absences.component"; diff --git a/src/app/shared/components/student-dossier/student-dossier-absences/student-dossier-absences.component.ts b/src/app/shared/components/student-dossier/student-dossier-absences/student-dossier-absences.component.ts index 53d8ee56b..9de4d427b 100644 --- a/src/app/shared/components/student-dossier/student-dossier-absences/student-dossier-absences.component.ts +++ b/src/app/shared/components/student-dossier/student-dossier-absences/student-dossier-absences.component.ts @@ -1,36 +1,35 @@ import { + ChangeDetectionStrategy, Component, + ElementRef, Input, - SimpleChanges, OnChanges, - ChangeDetectionStrategy, - ViewChildren, QueryList, - ElementRef, + SimpleChanges, + ViewChildren, } from "@angular/core"; import { + BehaviorSubject, Observable, - combineLatest, ReplaySubject, - BehaviorSubject, + combineLatest, of, } from "rxjs"; import { - switchMap, filter, map, - take, + shareReplay, startWith, switchAll, - shareReplay, + switchMap, + take, } from "rxjs/operators"; - +import { ReportInfo } from "src/app/shared/services/reports.service"; import { LessonPresence } from "../../../models/lesson-presence.model"; -import { notNull, not } from "../../../utils/filter"; -import { isArray } from "../../../utils/array"; import { ConfirmAbsencesSelectionService } from "../../../services/confirm-absences-selection.service"; import { PresenceTypesService } from "../../../services/presence-types.service"; -import { ReportInfo } from "src/app/shared/services/reports.service"; +import { isArray } from "../../../utils/array"; +import { not, notNull } from "../../../utils/filter"; @Component({ selector: "erz-student-dossier-absences", diff --git a/src/app/shared/components/student-dossier/student-dossier-address/student-dossier-address.component.spec.ts b/src/app/shared/components/student-dossier/student-dossier-address/student-dossier-address.component.spec.ts index d7241bce8..c49202020 100644 --- a/src/app/shared/components/student-dossier/student-dossier-address/student-dossier-address.component.spec.ts +++ b/src/app/shared/components/student-dossier/student-dossier-address/student-dossier-address.component.spec.ts @@ -1,7 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { StudentDossierAddressComponent } from "./student-dossier-address.component"; -import { buildStudent, buildPerson } from "src/spec-builders"; +import { buildPerson, buildStudent } from "src/spec-builders"; import { Person } from "../../../models/person.model"; +import { StudentDossierAddressComponent } from "./student-dossier-address.component"; describe("StudentDossierAddressComponent", () => { let component: StudentDossierAddressComponent; diff --git a/src/app/shared/components/student-dossier/student-dossier-address/student-dossier-address.component.ts b/src/app/shared/components/student-dossier/student-dossier-address/student-dossier-address.component.ts index 266026f73..f693beb10 100644 --- a/src/app/shared/components/student-dossier/student-dossier-address/student-dossier-address.component.ts +++ b/src/app/shared/components/student-dossier/student-dossier-address/student-dossier-address.component.ts @@ -1,6 +1,6 @@ -import { Component, Input, ChangeDetectionStrategy } from "@angular/core"; -import { Student } from "../../../models/student.model"; +import { ChangeDetectionStrategy, Component, Input } from "@angular/core"; import { Person } from "../../../models/person.model"; +import { Student } from "../../../models/student.model"; @Component({ selector: "erz-student-dossier-address", diff --git a/src/app/shared/components/student-dossier/student-dossier-apprenticeship-company/student-dossier-apprenticeship-company.component.spec.ts b/src/app/shared/components/student-dossier/student-dossier-apprenticeship-company/student-dossier-apprenticeship-company.component.spec.ts index 7b1a7377f..ee5f73bed 100644 --- a/src/app/shared/components/student-dossier/student-dossier-apprenticeship-company/student-dossier-apprenticeship-company.component.spec.ts +++ b/src/app/shared/components/student-dossier/student-dossier-apprenticeship-company/student-dossier-apprenticeship-company.component.spec.ts @@ -1,12 +1,11 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { buildTestModuleMetadata } from "src/spec-helpers"; -import { StudentDossierApprenticeshipCompanyComponent } from "./student-dossier-apprenticeship-company.component"; import { buildApprenticeshipContract, buildApprenticeshipManager, buildJobTrainer, } from "src/spec-builders"; +import { buildTestModuleMetadata } from "src/spec-helpers"; +import { StudentDossierApprenticeshipCompanyComponent } from "./student-dossier-apprenticeship-company.component"; describe("StudentDossierApprenticeshipCompanyComponent", () => { let component: StudentDossierApprenticeshipCompanyComponent; diff --git a/src/app/shared/components/student-dossier/student-dossier-apprenticeship-company/student-dossier-apprenticeship-company.component.ts b/src/app/shared/components/student-dossier/student-dossier-apprenticeship-company/student-dossier-apprenticeship-company.component.ts index 7ed84d44a..eb56690be 100644 --- a/src/app/shared/components/student-dossier/student-dossier-apprenticeship-company/student-dossier-apprenticeship-company.component.ts +++ b/src/app/shared/components/student-dossier/student-dossier-apprenticeship-company/student-dossier-apprenticeship-company.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, ChangeDetectionStrategy } from "@angular/core"; +import { ChangeDetectionStrategy, Component, Input } from "@angular/core"; import { ApprenticeshipCompany } from "../../../services/student-profile.service"; @Component({ diff --git a/src/app/shared/components/student-dossier/student-dossier-entry-header/student-dossier-entry-header.component.spec.ts b/src/app/shared/components/student-dossier/student-dossier-entry-header/student-dossier-entry-header.component.spec.ts index 39a190992..ecc8b6dd0 100644 --- a/src/app/shared/components/student-dossier/student-dossier-entry-header/student-dossier-entry-header.component.spec.ts +++ b/src/app/shared/components/student-dossier/student-dossier-entry-header/student-dossier-entry-header.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; -import { StudentDossierEntryHeaderComponent } from "./student-dossier-entry-header.component"; import { buildTestModuleMetadata } from "../../../../../spec-helpers"; +import { StudentDossierEntryHeaderComponent } from "./student-dossier-entry-header.component"; describe("StudentDossierEntryHeaderComponent", () => { let component: StudentDossierEntryHeaderComponent; diff --git a/src/app/shared/components/student-dossier/student-dossier-entry-header/student-dossier-entry-header.component.ts b/src/app/shared/components/student-dossier/student-dossier-entry-header/student-dossier-entry-header.component.ts index 8f79db6f1..d0227bc35 100644 --- a/src/app/shared/components/student-dossier/student-dossier-entry-header/student-dossier-entry-header.component.ts +++ b/src/app/shared/components/student-dossier/student-dossier-entry-header/student-dossier-entry-header.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, ChangeDetectionStrategy } from "@angular/core"; +import { ChangeDetectionStrategy, Component, Input } from "@angular/core"; @Component({ selector: "erz-student-dossier-entry-header", diff --git a/src/app/shared/components/student-dossier/student-dossier-legal-representative/student-dossier-legal-representative.component.spec.ts b/src/app/shared/components/student-dossier/student-dossier-legal-representative/student-dossier-legal-representative.component.spec.ts index 2a174ae89..07806cd9e 100644 --- a/src/app/shared/components/student-dossier/student-dossier-legal-representative/student-dossier-legal-representative.component.spec.ts +++ b/src/app/shared/components/student-dossier/student-dossier-legal-representative/student-dossier-legal-representative.component.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - +import { buildPerson } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { StudentDossierLegalRepresentativeComponent } from "./student-dossier-legal-representative.component"; -import { buildPerson } from "src/spec-builders"; describe("StudentDossierLegalRepresentativeComponent", () => { let component: StudentDossierLegalRepresentativeComponent; diff --git a/src/app/shared/components/student-dossier/student-dossier-legal-representative/student-dossier-legal-representative.component.ts b/src/app/shared/components/student-dossier/student-dossier-legal-representative/student-dossier-legal-representative.component.ts index 3e803f738..737ef1b95 100644 --- a/src/app/shared/components/student-dossier/student-dossier-legal-representative/student-dossier-legal-representative.component.ts +++ b/src/app/shared/components/student-dossier/student-dossier-legal-representative/student-dossier-legal-representative.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, ChangeDetectionStrategy } from "@angular/core"; +import { ChangeDetectionStrategy, Component, Input } from "@angular/core"; import { Person } from "../../../models/person.model"; @Component({ diff --git a/src/app/shared/components/student-dossier/student-dossier/student-dossier.component.spec.ts b/src/app/shared/components/student-dossier/student-dossier/student-dossier.component.spec.ts index b88e796b4..95a1aaccd 100644 --- a/src/app/shared/components/student-dossier/student-dossier/student-dossier.component.spec.ts +++ b/src/app/shared/components/student-dossier/student-dossier/student-dossier.component.spec.ts @@ -1,11 +1,10 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { buildTestModuleMetadata } from "src/spec-helpers"; -import { StudentDossierComponent } from "./student-dossier.component"; -import { DossierStateService } from "../../../services/dossier-state.service"; import { DossierGradesService } from "src/app/shared/services/dossier-grades.service"; import { ReportsService } from "src/app/shared/services/reports.service"; import { StorageService } from "src/app/shared/services/storage.service"; +import { buildTestModuleMetadata } from "src/spec-helpers"; +import { DossierStateService } from "../../../services/dossier-state.service"; +import { StudentDossierComponent } from "./student-dossier.component"; describe("StudentDossierComponent", () => { let component: StudentDossierComponent; diff --git a/src/app/shared/components/switch/switch.component.spec.ts b/src/app/shared/components/switch/switch.component.spec.ts index 2f27f56bd..830046897 100644 --- a/src/app/shared/components/switch/switch.component.spec.ts +++ b/src/app/shared/components/switch/switch.component.spec.ts @@ -1,6 +1,5 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { SwitchComponent } from "./switch.component"; describe("SwitchComponent", () => { diff --git a/src/app/shared/components/switch/switch.component.ts b/src/app/shared/components/switch/switch.component.ts index e29799ff7..b9fa565e5 100644 --- a/src/app/shared/components/switch/switch.component.ts +++ b/src/app/shared/components/switch/switch.component.ts @@ -1,8 +1,8 @@ import { ChangeDetectionStrategy, Component, - Input, EventEmitter, + Input, Output, } from "@angular/core"; import { uniqueId } from "lodash-es"; diff --git a/src/app/shared/components/text/line/preserve-line-height.component.spec.ts b/src/app/shared/components/text/line/preserve-line-height.component.spec.ts index d202a1853..ff5f8e3df 100644 --- a/src/app/shared/components/text/line/preserve-line-height.component.spec.ts +++ b/src/app/shared/components/text/line/preserve-line-height.component.spec.ts @@ -1,7 +1,6 @@ import { Component } from "@angular/core"; import { ComponentFixture, TestBed } from "@angular/core/testing"; import { By } from "@angular/platform-browser"; - import { PreserveLineHeightComponent } from "./preserve-line-height.component"; describe("LineComponent", () => { diff --git a/src/app/shared/components/toast/toast.component.spec.ts b/src/app/shared/components/toast/toast.component.spec.ts index 601dda5f6..24068bd34 100644 --- a/src/app/shared/components/toast/toast.component.spec.ts +++ b/src/app/shared/components/toast/toast.component.spec.ts @@ -1,13 +1,12 @@ import { ComponentFixture, - fakeAsync, TestBed, + fakeAsync, tick, } from "@angular/core/testing"; import { NgbToastConfig } from "@ng-bootstrap/ng-bootstrap"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { ToastService } from "../../services/toast.service"; - import { ToastComponent } from "./toast.component"; describe("ToastComponent", () => { diff --git a/src/app/shared/components/typeahead/typeahead.component.spec.ts b/src/app/shared/components/typeahead/typeahead.component.spec.ts index 68472f980..2e3f8fe98 100644 --- a/src/app/shared/components/typeahead/typeahead.component.spec.ts +++ b/src/app/shared/components/typeahead/typeahead.component.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; - -import { TypeaheadComponent } from "./typeahead.component"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { TypeaheadComponent } from "./typeahead.component"; describe("TypeaheadComponent", () => { let component: TypeaheadComponent; diff --git a/src/app/shared/components/typeahead/typeahead.component.ts b/src/app/shared/components/typeahead/typeahead.component.ts index ae51cd194..bf8022d0f 100644 --- a/src/app/shared/components/typeahead/typeahead.component.ts +++ b/src/app/shared/components/typeahead/typeahead.component.ts @@ -1,28 +1,27 @@ import { - Component, ChangeDetectionStrategy, - Output, + Component, Input, OnChanges, + Output, SimpleChanges, } from "@angular/core"; -import { Observable, BehaviorSubject } from "rxjs"; +import { uniqueId } from "lodash-es"; +import { BehaviorSubject, Observable } from "rxjs"; import { debounceTime, distinctUntilChanged, - switchMap, - map, filter, finalize, + map, + switchMap, } from "rxjs/operators"; -import { uniqueId } from "lodash-es"; - -import { longerOrEqual } from "../../utils/filter"; +import { DropDownItem } from "../../models/drop-down-item.model"; import { HttpParams, TypeaheadService, } from "../../services/typeahead-rest.service"; -import { DropDownItem } from "../../models/drop-down-item.model"; +import { longerOrEqual } from "../../utils/filter"; const FETCH_DEBOUNCE_TIME = 300; const MINIMAL_TERM_LENGTH = 3; diff --git a/src/app/shared/directives/let.directive.ts b/src/app/shared/directives/let.directive.ts index 891c414e4..5a8a75d27 100644 --- a/src/app/shared/directives/let.directive.ts +++ b/src/app/shared/directives/let.directive.ts @@ -17,13 +17,12 @@ * * License: MIT */ - import { Directive, Input, + OnInit, TemplateRef, ViewContainerRef, - OnInit, } from "@angular/core"; export class LetContext { diff --git a/src/app/shared/models/apprenticeship-contract.model.ts b/src/app/shared/models/apprenticeship-contract.model.ts index 9cd885370..694effad8 100644 --- a/src/app/shared/models/apprenticeship-contract.model.ts +++ b/src/app/shared/models/apprenticeship-contract.model.ts @@ -1,5 +1,5 @@ import * as t from "io-ts"; -import { Option, LocalDateTimeFromString } from "./common-types"; +import { LocalDateTimeFromString, Option } from "./common-types"; const ApprenticeshipContract = t.type({ Id: t.number, diff --git a/src/app/shared/models/common-types.spec.ts b/src/app/shared/models/common-types.spec.ts index 5bd33c30f..612dc6e81 100644 --- a/src/app/shared/models/common-types.spec.ts +++ b/src/app/shared/models/common-types.spec.ts @@ -1,6 +1,6 @@ -import { LocalDateTimeFromString, LocalDateFromString } from "./common-types"; import { fold } from "fp-ts/es6/Either"; -import { parseISOLocalDateTime, parseISOLocalDate } from "../utils/date"; +import { parseISOLocalDate, parseISOLocalDateTime } from "../utils/date"; +import { LocalDateFromString, LocalDateTimeFromString } from "./common-types"; describe("common types", () => { describe("LocalDateTimeFromString", () => { diff --git a/src/app/shared/models/common-types.ts b/src/app/shared/models/common-types.ts index 63fc957c7..5d4136331 100644 --- a/src/app/shared/models/common-types.ts +++ b/src/app/shared/models/common-types.ts @@ -1,12 +1,12 @@ -import * as t from "io-ts"; -import { pipe } from "fp-ts/es6/function"; import { chain } from "fp-ts/es6/Either"; +import { pipe } from "fp-ts/es6/function"; +import * as t from "io-ts"; import { JsonFromString } from "io-ts-types"; import { - parseISOLocalDateTime, + formatISOLocalDate, formatISOLocalDateTime, parseISOLocalDate, - formatISOLocalDate, + parseISOLocalDateTime, } from "../utils/date"; export function Option( diff --git a/src/app/shared/models/lesson-absence.model.ts b/src/app/shared/models/lesson-absence.model.ts index a7fedb1fd..bcafe77a0 100644 --- a/src/app/shared/models/lesson-absence.model.ts +++ b/src/app/shared/models/lesson-absence.model.ts @@ -1,5 +1,5 @@ import * as t from "io-ts"; -import { Reference, Option, LocalDateTimeFromString } from "./common-types"; +import { LocalDateTimeFromString, Option, Reference } from "./common-types"; const id = t.type({ Id: t.number, diff --git a/src/app/shared/models/lesson-dispensation.model.ts b/src/app/shared/models/lesson-dispensation.model.ts index 1083a895f..71618605e 100644 --- a/src/app/shared/models/lesson-dispensation.model.ts +++ b/src/app/shared/models/lesson-dispensation.model.ts @@ -1,5 +1,5 @@ import * as t from "io-ts"; -import { Reference, Option } from "./common-types"; +import { Option, Reference } from "./common-types"; // TODO: complete properties const LessonDispensation = t.type({ diff --git a/src/app/shared/models/lesson-incident.model.ts b/src/app/shared/models/lesson-incident.model.ts index ae014548a..2dfb690d3 100644 --- a/src/app/shared/models/lesson-incident.model.ts +++ b/src/app/shared/models/lesson-incident.model.ts @@ -1,5 +1,5 @@ import * as t from "io-ts"; -import { Reference, Option } from "./common-types"; +import { Option, Reference } from "./common-types"; const LessonIncident = t.type({ LessonRef: Reference, diff --git a/src/app/shared/models/lesson-presence-statistic.ts b/src/app/shared/models/lesson-presence-statistic.ts index e7a7b594c..65e362783 100644 --- a/src/app/shared/models/lesson-presence-statistic.ts +++ b/src/app/shared/models/lesson-presence-statistic.ts @@ -1,5 +1,5 @@ -import { Reference } from "./common-types"; import * as t from "io-ts"; +import { Reference } from "./common-types"; const LessonPresenceStatistic = t.type({ StudentRef: Reference, diff --git a/src/app/shared/models/lesson-presence.model.ts b/src/app/shared/models/lesson-presence.model.ts index 7d9ec20d4..a5b931bb5 100644 --- a/src/app/shared/models/lesson-presence.model.ts +++ b/src/app/shared/models/lesson-presence.model.ts @@ -1,10 +1,10 @@ import * as t from "io-ts"; import { - Reference, - OptionalReference, - Option, - LocalDateTimeFromString, LocalDateFromString, + LocalDateTimeFromString, + Option, + OptionalReference, + Reference, } from "./common-types"; const LessonPresence = t.type({ diff --git a/src/app/shared/models/lesson.model.ts b/src/app/shared/models/lesson.model.ts index e8702ca94..93a9b203c 100644 --- a/src/app/shared/models/lesson.model.ts +++ b/src/app/shared/models/lesson.model.ts @@ -1,5 +1,5 @@ import * as t from "io-ts"; -import { Reference, LocalDateTimeFromString } from "./common-types"; +import { LocalDateTimeFromString, Reference } from "./common-types"; const Lesson = t.type({ LessonRef: Reference, diff --git a/src/app/shared/models/person.model.ts b/src/app/shared/models/person.model.ts index 9d6163701..20dc28a8f 100644 --- a/src/app/shared/models/person.model.ts +++ b/src/app/shared/models/person.model.ts @@ -1,5 +1,5 @@ import * as t from "io-ts"; -import { Option, Maybe, LocalDateTimeFromString } from "./common-types"; +import { LocalDateTimeFromString, Maybe, Option } from "./common-types"; const Person = t.type({ Id: t.number, diff --git a/src/app/shared/models/student-grades.spec.ts b/src/app/shared/models/student-grades.spec.ts index 859edf9e3..b4e524028 100644 --- a/src/app/shared/models/student-grades.spec.ts +++ b/src/app/shared/models/student-grades.spec.ts @@ -8,10 +8,10 @@ import { } from "src/spec-builders"; import { FinalGrade, - meanOf, - averageOfGradesForScale, NoResult, StudentGrade, + averageOfGradesForScale, + meanOf, toMaxPoints, transform, } from "./student-grades"; diff --git a/src/app/shared/models/student.model.ts b/src/app/shared/models/student.model.ts index 0bc69232b..0f3911a57 100644 --- a/src/app/shared/models/student.model.ts +++ b/src/app/shared/models/student.model.ts @@ -1,5 +1,5 @@ import * as t from "io-ts"; -import { Maybe, Option, LocalDateTimeFromString } from "./common-types"; +import { LocalDateTimeFromString, Maybe, Option } from "./common-types"; const Student = t.type({ Id: t.number, diff --git a/src/app/shared/pipes/days-difference.pipe.spec.ts b/src/app/shared/pipes/days-difference.pipe.spec.ts index 5c216c3b0..a1b3ea2d0 100644 --- a/src/app/shared/pipes/days-difference.pipe.spec.ts +++ b/src/app/shared/pipes/days-difference.pipe.spec.ts @@ -1,6 +1,5 @@ import { TestBed, waitForAsync } from "@angular/core/testing"; import { TranslateService } from "@ngx-translate/core"; - import { buildTestModuleMetadata } from "src/spec-helpers"; import { DaysDifferencePipe } from "./days-difference.pipe"; diff --git a/src/app/shared/pipes/days-difference.pipe.ts b/src/app/shared/pipes/days-difference.pipe.ts index e341561a5..c3ff86fe8 100644 --- a/src/app/shared/pipes/days-difference.pipe.ts +++ b/src/app/shared/pipes/days-difference.pipe.ts @@ -1,4 +1,4 @@ -import { PipeTransform, Pipe } from "@angular/core"; +import { Pipe, PipeTransform } from "@angular/core"; import { TranslateService } from "@ngx-translate/core"; import { differenceInCalendarDays } from "date-fns"; diff --git a/src/app/shared/pipes/person-email.pipe.spec.ts b/src/app/shared/pipes/person-email.pipe.spec.ts index b9b7117b0..2bc5cc8af 100644 --- a/src/app/shared/pipes/person-email.pipe.spec.ts +++ b/src/app/shared/pipes/person-email.pipe.spec.ts @@ -1,5 +1,5 @@ -import { PersonEmailPipe } from "./person-email.pipe"; import { buildPersonWithEmails } from "../../../spec-builders"; +import { PersonEmailPipe } from "./person-email.pipe"; describe("PersonEmailPipe", () => { let personEmailPipe: PersonEmailPipe; diff --git a/src/app/shared/pipes/person-email.pipe.ts b/src/app/shared/pipes/person-email.pipe.ts index 4006e52df..a0c6acd21 100644 --- a/src/app/shared/pipes/person-email.pipe.ts +++ b/src/app/shared/pipes/person-email.pipe.ts @@ -1,4 +1,4 @@ -import { PipeTransform, Pipe } from "@angular/core"; +import { Pipe, PipeTransform } from "@angular/core"; import { Person } from "../../shared/models/person.model"; @Pipe({ diff --git a/src/app/shared/services/apprenticeship-managers-rest.service.spec.ts b/src/app/shared/services/apprenticeship-managers-rest.service.spec.ts index 96caeb66f..5053df508 100644 --- a/src/app/shared/services/apprenticeship-managers-rest.service.spec.ts +++ b/src/app/shared/services/apprenticeship-managers-rest.service.spec.ts @@ -1,6 +1,5 @@ import { TestBed } from "@angular/core/testing"; import { buildTestModuleMetadata } from "../../../spec-helpers"; - import { ApprenticeshipManagersRestService } from "./apprenticeship-managers-rest.service"; describe("ApprenticeshipManagerRestService", () => { diff --git a/src/app/shared/services/auth.service.spec.ts b/src/app/shared/services/auth.service.spec.ts index db83095c4..9959c9845 100644 --- a/src/app/shared/services/auth.service.spec.ts +++ b/src/app/shared/services/auth.service.spec.ts @@ -1,5 +1,4 @@ import { TestBed } from "@angular/core/testing"; - import { AuthService } from "./auth.service"; describe("AuthService", () => { diff --git a/src/app/shared/services/confirm-absences-selection.service.spec.ts b/src/app/shared/services/confirm-absences-selection.service.spec.ts index 027f27b26..ef9880abc 100644 --- a/src/app/shared/services/confirm-absences-selection.service.spec.ts +++ b/src/app/shared/services/confirm-absences-selection.service.spec.ts @@ -1,11 +1,10 @@ import { TestBed } from "@angular/core/testing"; import { take } from "rxjs/operators"; - -import { buildTestModuleMetadata } from "src/spec-helpers"; +import { OpenAbsencesEntry } from "src/app/open-absences/models/open-absences-entry.model"; +import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; import { buildLessonPresenceWithIds } from "src/spec-builders"; +import { buildTestModuleMetadata } from "src/spec-helpers"; import { ConfirmAbsencesSelectionService } from "./confirm-absences-selection.service"; -import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; -import { OpenAbsencesEntry } from "src/app/open-absences/models/open-absences-entry.model"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/shared/services/confirm-absences-selection.service.ts b/src/app/shared/services/confirm-absences-selection.service.ts index 97103463a..6ee480afc 100644 --- a/src/app/shared/services/confirm-absences-selection.service.ts +++ b/src/app/shared/services/confirm-absences-selection.service.ts @@ -1,14 +1,13 @@ -import { Injectable, Inject } from "@angular/core"; -import { map, shareReplay, take } from "rxjs/operators"; +import { Inject, Injectable } from "@angular/core"; import { not } from "fp-ts/es6/Predicate"; - -import { SelectionService } from "src/app/shared/services/selection.service"; -import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; -import { getIdsGroupedByPersonAndPresenceType } from "src/app/shared/utils/lesson-presences"; -import { isInstanceOf } from "src/app/shared/utils/filter"; +import { map, shareReplay, take } from "rxjs/operators"; import { OpenAbsencesEntry } from "src/app/open-absences/models/open-absences-entry.model"; import { flattenOpenAbsencesEntries } from "src/app/open-absences/utils/open-absences-entries"; import { SETTINGS, Settings } from "src/app/settings"; +import { LessonPresence } from "src/app/shared/models/lesson-presence.model"; +import { SelectionService } from "src/app/shared/services/selection.service"; +import { isInstanceOf } from "src/app/shared/utils/filter"; +import { getIdsGroupedByPersonAndPresenceType } from "src/app/shared/utils/lesson-presences"; @Injectable() export class ConfirmAbsencesSelectionService extends SelectionService< diff --git a/src/app/shared/services/courses-rest.service.ts b/src/app/shared/services/courses-rest.service.ts index 6558c7869..d89befff7 100644 --- a/src/app/shared/services/courses-rest.service.ts +++ b/src/app/shared/services/courses-rest.service.ts @@ -1,19 +1,19 @@ import { HttpClient } from "@angular/common/http"; import { Inject, Injectable } from "@angular/core"; -import { map, Observable, switchMap, of } from "rxjs"; import * as t from "io-ts"; -import { Settings, SETTINGS } from "src/app/settings"; +import { Observable, map, of, switchMap } from "rxjs"; +import { SETTINGS, Settings } from "src/app/settings"; import { - Course, AverageTestResultResponse, + Course, TestGradesResult, TestPointsResult, UpdatedTestResultResponse, } from "../models/course.model"; import { decode, decodeArray } from "../utils/decode"; import { hasRole } from "../utils/roles"; -import { RestService } from "./rest.service"; import { pick } from "../utils/types"; +import { RestService } from "./rest.service"; @Injectable({ providedIn: "root", diff --git a/src/app/shared/services/date-parser-formatter.ts b/src/app/shared/services/date-parser-formatter.ts index cd24272be..488adfe43 100644 --- a/src/app/shared/services/date-parser-formatter.ts +++ b/src/app/shared/services/date-parser-formatter.ts @@ -1,9 +1,9 @@ import { Injectable } from "@angular/core"; -import { format, parse } from "date-fns"; import { NgbDateParserFormatter, NgbDateStruct, } from "@ng-bootstrap/ng-bootstrap"; +import { format, parse } from "date-fns"; @Injectable() export class DateParserFormatter extends NgbDateParserFormatter { diff --git a/src/app/shared/services/dossier-grades.service.spec.ts b/src/app/shared/services/dossier-grades.service.spec.ts index 3f3d7cb71..b8aa1d3b6 100644 --- a/src/app/shared/services/dossier-grades.service.spec.ts +++ b/src/app/shared/services/dossier-grades.service.spec.ts @@ -9,10 +9,10 @@ import { } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { Course, FinalGrading, Grading } from "../models/course.model"; +import { Grade } from "../models/grading-scale.model"; import { CoursesRestService } from "./courses-rest.service"; import { DossierGradesService } from "./dossier-grades.service"; import { StorageService } from "./storage.service"; -import { Grade } from "../models/grading-scale.model"; describe("DossierGradesService", () => { let service: DossierGradesService; diff --git a/src/app/shared/services/dossier-grades.service.ts b/src/app/shared/services/dossier-grades.service.ts index a1572ecde..c120bba05 100644 --- a/src/app/shared/services/dossier-grades.service.ts +++ b/src/app/shared/services/dossier-grades.service.ts @@ -1,28 +1,28 @@ import { Inject, Injectable } from "@angular/core"; import { + ReplaySubject, + Subject, combineLatest, distinctUntilChanged, forkJoin, map, merge, - ReplaySubject, shareReplay, - Subject, switchMap, } from "rxjs"; -import { Settings, SETTINGS } from "src/app/settings"; +import { withLatestFrom } from "rxjs/operators"; +import { SETTINGS, Settings } from "src/app/settings"; +import { gradingScaleOfTest, resultOfStudent } from "../../events/utils/tests"; import { Course, FinalGrading, Grading } from "../models/course.model"; import { Grade, GradingScale } from "../models/grading-scale.model"; import { Test } from "../models/test.model"; import { notNull, unique } from "../utils/filter"; +import { ValueWithWeight } from "../utils/math"; import { CoursesRestService } from "./courses-rest.service"; import { GradingScalesRestService } from "./grading-scales-rest.service"; import { LoadingService } from "./loading-service"; import { ReportsService } from "./reports.service"; import { SubscriptionsRestService } from "./subscriptions-rest.service"; -import { gradingScaleOfTest, resultOfStudent } from "../../events/utils/tests"; -import { ValueWithWeight } from "../utils/math"; -import { withLatestFrom } from "rxjs/operators"; @Injectable() export class DossierGradesService { diff --git a/src/app/shared/services/dossier-state.service.spec.ts b/src/app/shared/services/dossier-state.service.spec.ts index c2b5e7dd3..aa1ec44f5 100644 --- a/src/app/shared/services/dossier-state.service.spec.ts +++ b/src/app/shared/services/dossier-state.service.spec.ts @@ -1,6 +1,5 @@ import { TestBed } from "@angular/core/testing"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { DossierStateService } from "./dossier-state.service"; describe("DossierStateService", () => { diff --git a/src/app/shared/services/drop-down-items-rest.service.spec.ts b/src/app/shared/services/drop-down-items-rest.service.spec.ts index baf6aeeea..77a131408 100644 --- a/src/app/shared/services/drop-down-items-rest.service.spec.ts +++ b/src/app/shared/services/drop-down-items-rest.service.spec.ts @@ -1,5 +1,4 @@ import { TestBed } from "@angular/core/testing"; - import { buildTestModuleMetadata } from "src/spec-helpers"; import { DropDownItemsRestService } from "./drop-down-items-rest.service"; diff --git a/src/app/shared/services/drop-down-items-rest.service.ts b/src/app/shared/services/drop-down-items-rest.service.ts index fee5b44ef..3f7f7e10d 100644 --- a/src/app/shared/services/drop-down-items-rest.service.ts +++ b/src/app/shared/services/drop-down-items-rest.service.ts @@ -1,11 +1,10 @@ -import { Injectable, Inject } from "@angular/core"; import { HttpClient } from "@angular/common/http"; -import { switchMap, shareReplay } from "rxjs/operators"; -import { decodeArray } from "../utils/decode"; - +import { Inject, Injectable } from "@angular/core"; +import { Observable } from "rxjs"; +import { shareReplay, switchMap } from "rxjs/operators"; import { SETTINGS, Settings } from "src/app/settings"; import { DropDownItem } from "../models/drop-down-item.model"; -import { Observable } from "rxjs"; +import { decodeArray } from "../utils/decode"; @Injectable({ providedIn: "root", diff --git a/src/app/shared/services/educational-events-rest.service.ts b/src/app/shared/services/educational-events-rest.service.ts index db903c38b..4f9e52ee1 100644 --- a/src/app/shared/services/educational-events-rest.service.ts +++ b/src/app/shared/services/educational-events-rest.service.ts @@ -1,18 +1,17 @@ -import { Injectable, Inject } from "@angular/core"; import { HttpClient } from "@angular/common/http"; - +import { Inject, Injectable } from "@angular/core"; +import { TranslateService } from "@ngx-translate/core"; +import * as t from "io-ts"; +import { EMPTY, Observable, of } from "rxjs"; +import { map, switchMap } from "rxjs/operators"; import { SETTINGS, Settings } from "../../settings"; -import { TypeaheadService } from "./typeahead-rest.service"; +import { DropDownItem } from "../models/drop-down-item.model"; import { EducationalEvent } from "../models/educational-event.model"; -import { switchMap, map } from "rxjs/operators"; import { decodeArray } from "../utils/decode"; -import { Observable, EMPTY, of } from "rxjs"; -import { DropDownItem } from "../models/drop-down-item.model"; -import { TranslateService } from "@ngx-translate/core"; import { pick } from "../utils/types"; import { RestService } from "./rest.service"; -import * as t from "io-ts"; import { ToastService } from "./toast.service"; +import { TypeaheadService } from "./typeahead-rest.service"; @Injectable({ providedIn: "root", diff --git a/src/app/shared/services/events-rest.service.spec.ts b/src/app/shared/services/events-rest.service.spec.ts index 3605b79e7..00c3b5c3c 100644 --- a/src/app/shared/services/events-rest.service.spec.ts +++ b/src/app/shared/services/events-rest.service.spec.ts @@ -1,7 +1,6 @@ import { HttpTestingController } from "@angular/common/http/testing"; import { TestBed } from "@angular/core/testing"; import { buildTestModuleMetadata } from "../../../spec-helpers"; - import { EventsRestService } from "./events-rest.service"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/shared/services/events-rest.service.ts b/src/app/shared/services/events-rest.service.ts index 33fefb147..5025ffd39 100644 --- a/src/app/shared/services/events-rest.service.ts +++ b/src/app/shared/services/events-rest.service.ts @@ -2,11 +2,11 @@ import { HttpClient } from "@angular/common/http"; import { Inject, Injectable } from "@angular/core"; import { Observable } from "rxjs"; import { switchMap } from "rxjs/operators"; -import { Settings, SETTINGS } from "../../settings"; +import { Course } from "src/app/shared/models/course.model"; +import { SETTINGS, Settings } from "../../settings"; import { SubscriptionDetail } from "../models/subscription-detail.model"; import { decodeArray } from "../utils/decode"; import { RestService } from "./rest.service"; -import { Course } from "src/app/shared/models/course.model"; @Injectable({ providedIn: "root", diff --git a/src/app/shared/services/grading-scales-rest.service.ts b/src/app/shared/services/grading-scales-rest.service.ts index eeb31db8e..1a2dac0b4 100644 --- a/src/app/shared/services/grading-scales-rest.service.ts +++ b/src/app/shared/services/grading-scales-rest.service.ts @@ -1,7 +1,7 @@ import { HttpClient } from "@angular/common/http"; import { Inject, Injectable } from "@angular/core"; -import { forkJoin, Observable, of, shareReplay, switchMap } from "rxjs"; -import { Settings, SETTINGS } from "src/app/settings"; +import { Observable, forkJoin, of, shareReplay, switchMap } from "rxjs"; +import { SETTINGS, Settings } from "src/app/settings"; import { GradingScale } from "../models/grading-scale.model"; import { decode } from "../utils/decode"; import { RestService } from "./rest.service"; diff --git a/src/app/shared/services/grading-scales.service-rest.spec.ts b/src/app/shared/services/grading-scales.service-rest.spec.ts index 5c02fb3cb..712dcb51a 100644 --- a/src/app/shared/services/grading-scales.service-rest.spec.ts +++ b/src/app/shared/services/grading-scales.service-rest.spec.ts @@ -2,7 +2,6 @@ import { HttpTestingController } from "@angular/common/http/testing"; import { TestBed } from "@angular/core/testing"; import { buildGradingScale } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { GradingScalesRestService } from "./grading-scales-rest.service"; describe("GradingScalesRestService", () => { diff --git a/src/app/shared/services/gradings-rest.service.spec.ts b/src/app/shared/services/gradings-rest.service.spec.ts index b14161f01..79087f1fa 100644 --- a/src/app/shared/services/gradings-rest.service.spec.ts +++ b/src/app/shared/services/gradings-rest.service.spec.ts @@ -2,7 +2,6 @@ import { HttpTestingController } from "@angular/common/http/testing"; import { TestBed } from "@angular/core/testing"; import isEqual from "lodash-es/isEqual"; import { buildTestModuleMetadata } from "src/spec-helpers"; - import { GradingsRestService } from "./gradings-rest.service"; describe("GradingsRestService", () => { diff --git a/src/app/shared/services/gradings-rest.service.ts b/src/app/shared/services/gradings-rest.service.ts index 387918651..98dd74c9f 100644 --- a/src/app/shared/services/gradings-rest.service.ts +++ b/src/app/shared/services/gradings-rest.service.ts @@ -1,7 +1,7 @@ import { HttpClient } from "@angular/common/http"; import { Inject, Injectable } from "@angular/core"; -import { map, Observable } from "rxjs"; -import { Settings, SETTINGS } from "src/app/settings"; +import { Observable, map } from "rxjs"; +import { SETTINGS, Settings } from "src/app/settings"; import { Grading } from "../models/course.model"; import { RestService } from "./rest.service"; diff --git a/src/app/shared/services/i18n.service.spec.ts b/src/app/shared/services/i18n.service.spec.ts index 617700d3d..cd8f1b599 100644 --- a/src/app/shared/services/i18n.service.spec.ts +++ b/src/app/shared/services/i18n.service.spec.ts @@ -1,7 +1,6 @@ import { TestBed } from "@angular/core/testing"; - -import { I18nService } from "./i18n.service"; import { TranslateService } from "@ngx-translate/core"; +import { I18nService } from "./i18n.service"; import { StorageService } from "./storage.service"; describe("I18nService", () => { diff --git a/src/app/shared/services/job-trainers-rest.service.spec.ts b/src/app/shared/services/job-trainers-rest.service.spec.ts index 72b3461ac..3fcc87ea3 100644 --- a/src/app/shared/services/job-trainers-rest.service.spec.ts +++ b/src/app/shared/services/job-trainers-rest.service.spec.ts @@ -1,6 +1,5 @@ import { TestBed } from "@angular/core/testing"; import { buildTestModuleMetadata } from "../../../spec-helpers"; - import { JobTrainersRestService } from "./job-trainers-rest.service"; describe("JobTrainersRestService", () => { diff --git a/src/app/shared/services/lesson-presences-rest.service.spec.ts b/src/app/shared/services/lesson-presences-rest.service.spec.ts index cd5b02413..caa188a97 100644 --- a/src/app/shared/services/lesson-presences-rest.service.spec.ts +++ b/src/app/shared/services/lesson-presences-rest.service.spec.ts @@ -1,16 +1,15 @@ -import { TestBed } from "@angular/core/testing"; import { HttpTestingController } from "@angular/common/http/testing"; +import { TestBed } from "@angular/core/testing"; +import { format } from "date-fns"; import * as t from "io-ts/lib/index"; - -import { buildTestModuleMetadata } from "src/spec-helpers"; -import { LessonPresencesRestService } from "./lesson-presences-rest.service"; -import { EvaluateAbsencesFilter } from "src/app/evaluate-absences/services/evaluate-absences-state.service"; import { EditAbsencesFilter } from "src/app/edit-absences/services/edit-absences-state.service"; +import { EvaluateAbsencesFilter } from "src/app/evaluate-absences/services/evaluate-absences-state.service"; +import { buildLesson, buildLessonPresence } from "src/spec-builders"; +import { buildTestModuleMetadata } from "src/spec-helpers"; import { LessonPresenceStatistic } from "../models/lesson-presence-statistic"; import { LessonPresence } from "../models/lesson-presence.model"; -import { buildLesson, buildLessonPresence } from "src/spec-builders"; +import { LessonPresencesRestService } from "./lesson-presences-rest.service"; import { Sorting } from "./sort.service"; -import { format } from "date-fns"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/shared/services/lesson-presences-rest.service.ts b/src/app/shared/services/lesson-presences-rest.service.ts index 859b21109..ad3a87dfd 100644 --- a/src/app/shared/services/lesson-presences-rest.service.ts +++ b/src/app/shared/services/lesson-presences-rest.service.ts @@ -2,7 +2,7 @@ import { HttpClient, HttpParams } from "@angular/common/http"; import { Inject, Injectable } from "@angular/core"; import { addDays, format, isSameDay, subDays } from "date-fns"; import * as t from "io-ts"; -import { forkJoin, Observable, of } from "rxjs"; +import { Observable, forkJoin, of } from "rxjs"; import { map, switchMap } from "rxjs/operators"; import { EditAbsencesFilter } from "src/app/edit-absences/services/edit-absences-state.service"; import { EvaluateAbsencesFilter } from "src/app/evaluate-absences/services/evaluate-absences-state.service"; @@ -14,16 +14,16 @@ import { Lesson } from "../models/lesson.model"; import { decodeArray } from "../utils/decode"; import { spread } from "../utils/function"; import { - decodePaginatedResponse, Paginated, + decodePaginatedResponse, paginatedHeaders, paginatedParams, } from "../utils/pagination"; +import { hasRole } from "../utils/roles"; import { pick } from "../utils/types"; import { RestService } from "./rest.service"; import { Sorting } from "./sort.service"; import { StorageService } from "./storage.service"; -import { hasRole } from "../utils/roles"; @Injectable({ providedIn: "root", diff --git a/src/app/shared/services/lesson-presences-update-rest.service.spec.ts b/src/app/shared/services/lesson-presences-update-rest.service.spec.ts index f35c42d87..b23c474f7 100644 --- a/src/app/shared/services/lesson-presences-update-rest.service.spec.ts +++ b/src/app/shared/services/lesson-presences-update-rest.service.spec.ts @@ -1,9 +1,8 @@ +import { HttpTestingController } from "@angular/common/http/testing"; import { TestBed } from "@angular/core/testing"; import { isEqual } from "lodash-es"; - import { buildTestModuleMetadata } from "src/spec-helpers"; import { LessonPresencesUpdateRestService } from "./lesson-presences-update-rest.service"; -import { HttpTestingController } from "@angular/common/http/testing"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/shared/services/lesson-presences-update-rest.service.ts b/src/app/shared/services/lesson-presences-update-rest.service.ts index a1fb5096e..59a9ba6f0 100644 --- a/src/app/shared/services/lesson-presences-update-rest.service.ts +++ b/src/app/shared/services/lesson-presences-update-rest.service.ts @@ -1,8 +1,7 @@ -import { Injectable, Inject } from "@angular/core"; import { HttpClient, HttpParams } from "@angular/common/http"; +import { Inject, Injectable } from "@angular/core"; import { Observable } from "rxjs"; import { map } from "rxjs/operators"; - import { SETTINGS, Settings } from "src/app/settings"; @Injectable({ diff --git a/src/app/shared/services/lesson-presences-update.service.spec.ts b/src/app/shared/services/lesson-presences-update.service.spec.ts index d21a5f2bb..69d09fc1d 100644 --- a/src/app/shared/services/lesson-presences-update.service.spec.ts +++ b/src/app/shared/services/lesson-presences-update.service.spec.ts @@ -1,4 +1,4 @@ -import { fakeAsync, TestBed, tick } from "@angular/core/testing"; +import { TestBed, fakeAsync, tick } from "@angular/core/testing"; import { of, throwError } from "rxjs"; import { withConfig } from "src/app/rest-error-interceptor"; import { @@ -8,6 +8,7 @@ import { buildReference, } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { PresenceControlEntry } from "../../presence-control/models/presence-control-entry.model"; import { LessonPresence } from "../models/lesson-presence.model"; import { PresenceType } from "../models/presence-type.model"; import { LessonPresencesUpdateRestService } from "./lesson-presences-update-rest.service"; @@ -18,7 +19,6 @@ import { } from "./lesson-presences-update.service"; import { PresenceTypesService } from "./presence-types.service"; import { ToastService } from "./toast.service"; -import { PresenceControlEntry } from "../../presence-control/models/presence-control-entry.model"; describe("LessonPresencesUpdateService", () => { let service: LessonPresencesUpdateService; diff --git a/src/app/shared/services/lesson-presences-update.service.ts b/src/app/shared/services/lesson-presences-update.service.ts index ee4dadc8a..19634519d 100644 --- a/src/app/shared/services/lesson-presences-update.service.ts +++ b/src/app/shared/services/lesson-presences-update.service.ts @@ -1,28 +1,28 @@ import { Inject, Injectable, OnDestroy } from "@angular/core"; import { TranslateService } from "@ngx-translate/core"; -import { combineLatest, merge, Observable, of, Subject } from "rxjs"; +import { Observable, Subject, combineLatest, merge, of } from "rxjs"; import { catchError, concatMap, debounceTime, filter, map, - switchMap, scan, share, + switchMap, takeUntil, } from "rxjs/operators"; +import { getNewConfirmationStateId } from "src/app/presence-control/utils/presence-types"; import { withConfig } from "src/app/rest-error-interceptor"; -import { Settings, SETTINGS } from "src/app/settings"; +import { SETTINGS, Settings } from "src/app/settings"; +import { PresenceControlEntry } from "../../presence-control/models/presence-control-entry.model"; import { LessonPresence } from "../models/lesson-presence.model"; +import { PresenceType } from "../models/presence-type.model"; import { isEmptyArray } from "../utils/array"; import { not } from "../utils/filter"; import { LessonPresencesUpdateRestService } from "./lesson-presences-update-rest.service"; -import { getNewConfirmationStateId } from "src/app/presence-control/utils/presence-types"; import { PresenceTypesService } from "./presence-types.service"; -import { PresenceType } from "../models/presence-type.model"; import { ToastService } from "./toast.service"; -import { PresenceControlEntry } from "../../presence-control/models/presence-control-entry.model"; export const UPDATE_STATE_DEBOUNCE_TIME = 20; diff --git a/src/app/shared/services/lesson-teachers-rest.service.spec.ts b/src/app/shared/services/lesson-teachers-rest.service.spec.ts index 50c54611f..92e53002c 100644 --- a/src/app/shared/services/lesson-teachers-rest.service.spec.ts +++ b/src/app/shared/services/lesson-teachers-rest.service.spec.ts @@ -1,7 +1,6 @@ import { TestBed } from "@angular/core/testing"; - -import { LessonTeachersRestService } from "./lesson-teachers-rest.service"; import { buildTestModuleMetadata } from "../../../spec-helpers"; +import { LessonTeachersRestService } from "./lesson-teachers-rest.service"; describe("LessonTeachersService", () => { let service: LessonTeachersRestService; diff --git a/src/app/shared/services/lesson-teachers-rest.service.ts b/src/app/shared/services/lesson-teachers-rest.service.ts index c8663cf05..362c9e0f6 100644 --- a/src/app/shared/services/lesson-teachers-rest.service.ts +++ b/src/app/shared/services/lesson-teachers-rest.service.ts @@ -1,11 +1,11 @@ -import { Inject, Injectable } from "@angular/core"; -import { RestService } from "./rest.service"; import { HttpClient, HttpParams } from "@angular/common/http"; -import { Settings, SETTINGS } from "../../settings"; +import { Inject, Injectable } from "@angular/core"; import { Observable } from "rxjs"; import { switchMap } from "rxjs/operators"; -import { decodeArray } from "../utils/decode"; +import { SETTINGS, Settings } from "../../settings"; import { LessonAbsence } from "../models/lesson-absence.model"; +import { decodeArray } from "../utils/decode"; +import { RestService } from "./rest.service"; @Injectable({ providedIn: "root", diff --git a/src/app/shared/services/loading-service.spec.ts b/src/app/shared/services/loading-service.spec.ts index 44c46f0ac..3381b08b3 100644 --- a/src/app/shared/services/loading-service.spec.ts +++ b/src/app/shared/services/loading-service.spec.ts @@ -1,5 +1,4 @@ import { TestBed } from "@angular/core/testing"; - import { buildTestModuleMetadata } from "src/spec-helpers"; import { LoadingService } from "./loading-service"; diff --git a/src/app/shared/services/loading-service.ts b/src/app/shared/services/loading-service.ts index 1acb61386..0d32d18e0 100644 --- a/src/app/shared/services/loading-service.ts +++ b/src/app/shared/services/loading-service.ts @@ -1,17 +1,17 @@ import { Injectable, OnDestroy } from "@angular/core"; import { Observable, - Subject, ReplaySubject, + Subject, Subscription, connectable, } from "rxjs"; import { - map, + distinctUntilChanged, finalize, + map, scan, startWith, - distinctUntilChanged, } from "rxjs/operators"; import { prepare } from "../utils/observable"; diff --git a/src/app/shared/services/notification-types.service.spec.ts b/src/app/shared/services/notification-types.service.spec.ts index f139417b2..05ac66a30 100644 --- a/src/app/shared/services/notification-types.service.spec.ts +++ b/src/app/shared/services/notification-types.service.spec.ts @@ -1,9 +1,8 @@ import { TestBed } from "@angular/core/testing"; - -import { NotificationTypesService } from "./notification-types.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; -import { StorageService } from "./storage.service"; import { TokenPayload } from "../models/token-payload.model"; +import { NotificationTypesService } from "./notification-types.service"; +import { StorageService } from "./storage.service"; describe("NotificationTypesService", () => { let service: NotificationTypesService; diff --git a/src/app/shared/services/notification-types.service.ts b/src/app/shared/services/notification-types.service.ts index 1838ccaae..853a7ea7e 100644 --- a/src/app/shared/services/notification-types.service.ts +++ b/src/app/shared/services/notification-types.service.ts @@ -1,7 +1,6 @@ import { Inject, Injectable } from "@angular/core"; import { uniq } from "lodash-es"; - -import { NotificationTypeText, Settings, SETTINGS } from "src/app/settings"; +import { NotificationTypeText, SETTINGS, Settings } from "src/app/settings"; import { getRoles } from "../utils/roles"; import { StorageService } from "./storage.service"; diff --git a/src/app/shared/services/paginated-entries.service.ts b/src/app/shared/services/paginated-entries.service.ts index 5ed99d712..29df25450 100644 --- a/src/app/shared/services/paginated-entries.service.ts +++ b/src/app/shared/services/paginated-entries.service.ts @@ -1,32 +1,31 @@ -import { OnDestroy, Injectable } from "@angular/core"; import { Location } from "@angular/common"; +import { Injectable, OnDestroy } from "@angular/core"; import { Params } from "@angular/router"; +import { cloneDeep, isEqual } from "lodash-es"; import { BehaviorSubject, Observable, Subject, - merge, combineLatest, + merge, } from "rxjs"; import { - map, - filter, concatMap, - shareReplay, - takeUntil, - scan, debounceTime, - take, distinctUntilChanged, + filter, + map, + scan, + shareReplay, + take, + takeUntil, } from "rxjs/operators"; -import { isEqual, cloneDeep } from "lodash-es"; - -import { LoadingService } from "./loading-service"; import { Settings } from "src/app/settings"; -import { Paginated } from "../utils/pagination"; import { spread } from "../utils/function"; +import { Paginated } from "../utils/pagination"; import { serializeParams } from "../utils/url"; -import { Sorting, SortService } from "./sort.service"; +import { LoadingService } from "./loading-service"; +import { SortService, Sorting } from "./sort.service"; interface ResetEntriesAction { action: "reset"; diff --git a/src/app/shared/services/persons-rest.service.spec.ts b/src/app/shared/services/persons-rest.service.spec.ts index 88741792b..02ee6045d 100644 --- a/src/app/shared/services/persons-rest.service.spec.ts +++ b/src/app/shared/services/persons-rest.service.spec.ts @@ -1,12 +1,11 @@ -import { TestBed } from "@angular/core/testing"; import { HttpTestingController } from "@angular/common/http/testing"; +import { TestBed } from "@angular/core/testing"; import * as t from "io-ts/lib/index"; import { isEqual } from "lodash-es"; - -import { buildTestModuleMetadata } from "src/spec-helpers"; -import { PersonsRestService } from "./persons-rest.service"; import { buildPerson } from "src/spec-builders"; +import { buildTestModuleMetadata } from "src/spec-helpers"; import { Person } from "../models/person.model"; +import { PersonsRestService } from "./persons-rest.service"; describe("PersonsRestService", () => { let service: PersonsRestService; diff --git a/src/app/shared/services/persons-rest.service.ts b/src/app/shared/services/persons-rest.service.ts index 678946f62..adff227b6 100644 --- a/src/app/shared/services/persons-rest.service.ts +++ b/src/app/shared/services/persons-rest.service.ts @@ -1,14 +1,13 @@ -import { Injectable, Inject } from "@angular/core"; import { HttpClient } from "@angular/common/http"; +import { Inject, Injectable } from "@angular/core"; +import * as t from "io-ts"; import { Observable } from "rxjs"; -import { switchMap, map } from "rxjs/operators"; - -import { RestService } from "./rest.service"; +import { map, switchMap } from "rxjs/operators"; import { SETTINGS, Settings } from "../../settings"; import { Person } from "../models/person.model"; import { decode, decodeArray } from "../utils/decode"; -import * as t from "io-ts"; import { pick } from "../utils/types"; +import { RestService } from "./rest.service"; @Injectable({ providedIn: "root", diff --git a/src/app/shared/services/presence-types-rest.service.spec.ts b/src/app/shared/services/presence-types-rest.service.spec.ts index 59188df41..0d11726bd 100644 --- a/src/app/shared/services/presence-types-rest.service.spec.ts +++ b/src/app/shared/services/presence-types-rest.service.spec.ts @@ -1,7 +1,6 @@ import { TestBed } from "@angular/core/testing"; - -import { PresenceTypesRestService } from "./presence-types-rest.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { PresenceTypesRestService } from "./presence-types-rest.service"; describe("PresenceTypesRestService", () => { beforeEach(() => TestBed.configureTestingModule(buildTestModuleMetadata({}))); diff --git a/src/app/shared/services/presence-types-rest.service.ts b/src/app/shared/services/presence-types-rest.service.ts index b7434b2c1..4b49b868b 100644 --- a/src/app/shared/services/presence-types-rest.service.ts +++ b/src/app/shared/services/presence-types-rest.service.ts @@ -1,9 +1,8 @@ -import { Injectable, Inject } from "@angular/core"; import { HttpClient } from "@angular/common/http"; - -import { RestService } from "./rest.service"; +import { Inject, Injectable } from "@angular/core"; import { SETTINGS, Settings } from "../../settings"; import { PresenceType } from "../models/presence-type.model"; +import { RestService } from "./rest.service"; /** * Don't use this service to load presence types in diff --git a/src/app/shared/services/presence-types.service.spec.ts b/src/app/shared/services/presence-types.service.spec.ts index c80655d55..f650f9d5f 100644 --- a/src/app/shared/services/presence-types.service.spec.ts +++ b/src/app/shared/services/presence-types.service.spec.ts @@ -1,10 +1,9 @@ -import { TestBed } from "@angular/core/testing"; import { HttpTestingController } from "@angular/common/http/testing"; +import { TestBed } from "@angular/core/testing"; import * as t from "io-ts/lib/index"; - import { buildTestModuleMetadata } from "src/spec-helpers"; -import { PresenceTypesService } from "./presence-types.service"; import { PresenceType } from "../models/presence-type.model"; +import { PresenceTypesService } from "./presence-types.service"; describe("PresenceTypesService", () => { let service: PresenceTypesService; diff --git a/src/app/shared/services/presence-types.service.ts b/src/app/shared/services/presence-types.service.ts index 930d8b57e..f5ab71e56 100644 --- a/src/app/shared/services/presence-types.service.ts +++ b/src/app/shared/services/presence-types.service.ts @@ -1,16 +1,15 @@ -import { Injectable, Inject } from "@angular/core"; +import { Inject, Injectable } from "@angular/core"; import { Observable } from "rxjs"; import { - shareReplay, + distinctUntilChanged, map, + shareReplay, startWith, - distinctUntilChanged, } from "rxjs/operators"; - -import { PresenceTypesRestService } from "./presence-types-rest.service"; -import { PresenceType } from "../models/presence-type.model"; import { SETTINGS, Settings } from "src/app/settings"; +import { PresenceType } from "../models/presence-type.model"; import { sortPresenceTypes } from "../utils/presence-types"; +import { PresenceTypesRestService } from "./presence-types-rest.service"; /** * This service provides the presence types and their variations. It diff --git a/src/app/shared/services/reports.service.spec.ts b/src/app/shared/services/reports.service.spec.ts index cd2951e92..1de3d1f46 100644 --- a/src/app/shared/services/reports.service.spec.ts +++ b/src/app/shared/services/reports.service.spec.ts @@ -1,10 +1,9 @@ +import { HttpTestingController } from "@angular/common/http/testing"; import { TestBed } from "@angular/core/testing"; - -import { ReportsService } from "./reports.service"; import { buildTestModuleMetadata } from "src/spec-helpers"; -import { StorageService } from "./storage.service"; -import { HttpTestingController } from "@angular/common/http/testing"; import { AvailableReports } from "../models/report.model"; +import { ReportsService } from "./reports.service"; +import { StorageService } from "./storage.service"; describe("ReportsService", () => { let service: ReportsService; diff --git a/src/app/shared/services/reports.service.ts b/src/app/shared/services/reports.service.ts index e0aaf7571..0cba81168 100644 --- a/src/app/shared/services/reports.service.ts +++ b/src/app/shared/services/reports.service.ts @@ -1,13 +1,12 @@ -import { Injectable, Inject } from "@angular/core"; import { HttpClient } from "@angular/common/http"; +import { Inject, Injectable } from "@angular/core"; +import { flatten, groupBy } from "lodash-es"; import { Observable, combineLatest, of } from "rxjs"; import { map, switchMap } from "rxjs/operators"; -import { flatten, groupBy } from "lodash-es"; - import { Report, ReportType, SETTINGS, Settings } from "src/app/settings"; -import { StorageService } from "./storage.service"; -import { decode } from "../utils/decode"; import { AvailableReports } from "../models/report.model"; +import { decode } from "../utils/decode"; +import { StorageService } from "./storage.service"; export type ReportInfo = Report & { title: string; url: string }; diff --git a/src/app/shared/services/rest.service.spec.ts b/src/app/shared/services/rest.service.spec.ts index f6c358c53..c409acf54 100644 --- a/src/app/shared/services/rest.service.spec.ts +++ b/src/app/shared/services/rest.service.spec.ts @@ -1,13 +1,12 @@ -import { TestBed } from "@angular/core/testing"; import { HttpClient } from "@angular/common/http"; -import { Injectable, Inject } from "@angular/core"; import { HttpTestingController } from "@angular/common/http/testing"; +import { Inject, Injectable } from "@angular/core"; +import { TestBed } from "@angular/core/testing"; import * as t from "io-ts"; - +import { SETTINGS, Settings } from "src/app/settings"; import { buildTestModuleMetadata } from "src/spec-helpers"; -import { RestService } from "./rest.service"; import { DecodeError } from "../utils/decode"; -import { SETTINGS, Settings } from "src/app/settings"; +import { RestService } from "./rest.service"; describe("RestService", () => { let service: FooService; diff --git a/src/app/shared/services/rest.service.ts b/src/app/shared/services/rest.service.ts index 635a9becf..4be92f6e7 100644 --- a/src/app/shared/services/rest.service.ts +++ b/src/app/shared/services/rest.service.ts @@ -1,8 +1,7 @@ -import { HttpClient, HttpParams, HttpHeaders } from "@angular/common/http"; +import { HttpClient, HttpHeaders, HttpParams } from "@angular/common/http"; +import * as t from "io-ts/lib/index"; import { Observable } from "rxjs"; import { switchMap } from "rxjs/operators"; -import * as t from "io-ts/lib/index"; - import { Settings } from "../../settings"; import { decode, decodeArray } from "../utils/decode"; diff --git a/src/app/shared/services/scroll-position.service.spec.ts b/src/app/shared/services/scroll-position.service.spec.ts index 181bdb159..cb46664a0 100644 --- a/src/app/shared/services/scroll-position.service.spec.ts +++ b/src/app/shared/services/scroll-position.service.spec.ts @@ -1,5 +1,4 @@ import { TestBed } from "@angular/core/testing"; - import { buildTestModuleMetadata } from "src/spec-helpers"; import { ScrollPositionService } from "./scroll-position.service"; diff --git a/src/app/shared/services/scroll-position.service.ts b/src/app/shared/services/scroll-position.service.ts index 00625186f..68cf1975f 100644 --- a/src/app/shared/services/scroll-position.service.ts +++ b/src/app/shared/services/scroll-position.service.ts @@ -1,23 +1,23 @@ -import { Injectable, OnDestroy } from "@angular/core"; import { ViewportScroller } from "@angular/common"; +import { Injectable, OnDestroy } from "@angular/core"; import { - Router, ActivatedRouteSnapshot, ActivationEnd, - NavigationStart, NavigationEnd, + NavigationStart, + Router, } from "@angular/router"; import { Subject, of } from "rxjs"; import { filter, map, - takeUntil, - take, - switchMap, mergeMap, - switchAll, shareReplay, skip, + switchAll, + switchMap, + take, + takeUntil, } from "rxjs/operators"; /** diff --git a/src/app/shared/services/selection.service.spec.ts b/src/app/shared/services/selection.service.spec.ts index 0ac0232b3..159b69e37 100644 --- a/src/app/shared/services/selection.service.spec.ts +++ b/src/app/shared/services/selection.service.spec.ts @@ -1,6 +1,5 @@ -import { TestBed } from "@angular/core/testing"; import { Injectable } from "@angular/core"; - +import { TestBed } from "@angular/core/testing"; import { SelectionService } from "./selection.service"; describe("SelectionService", () => { diff --git a/src/app/shared/services/selection.service.ts b/src/app/shared/services/selection.service.ts index 05f447564..ae7526e86 100644 --- a/src/app/shared/services/selection.service.ts +++ b/src/app/shared/services/selection.service.ts @@ -1,12 +1,12 @@ +import { Injectable, OnDestroy } from "@angular/core"; import { - Subject, Observable, ReplaySubject, + Subject, Subscription, connectable, } from "rxjs"; -import { scan, map, startWith, distinctUntilChanged } from "rxjs/operators"; -import { Injectable, OnDestroy } from "@angular/core"; +import { distinctUntilChanged, map, scan, startWith } from "rxjs/operators"; enum SelectionActionTypes { ToggleSelection = "TOGGLE", diff --git a/src/app/shared/services/sort.service.spec.ts b/src/app/shared/services/sort.service.spec.ts index 22d5368e4..1544ff796 100644 --- a/src/app/shared/services/sort.service.spec.ts +++ b/src/app/shared/services/sort.service.spec.ts @@ -1,6 +1,5 @@ import { TestBed } from "@angular/core/testing"; - -import { Sorting, SortService } from "./sort.service"; +import { SortService, Sorting } from "./sort.service"; describe("SortService", () => { type SortableKeys = "one" | "two"; diff --git a/src/app/shared/services/sort.service.ts b/src/app/shared/services/sort.service.ts index 672a8e770..ad8dfaa4d 100644 --- a/src/app/shared/services/sort.service.ts +++ b/src/app/shared/services/sort.service.ts @@ -2,9 +2,9 @@ import { Injectable } from "@angular/core"; import { isEqual } from "lodash-es"; import { BehaviorSubject, + Observable, distinctUntilChanged, map, - Observable, shareReplay, take, } from "rxjs"; diff --git a/src/app/shared/services/storage.service.spec.ts b/src/app/shared/services/storage.service.spec.ts index 7a84b6f3b..554aaac14 100644 --- a/src/app/shared/services/storage.service.spec.ts +++ b/src/app/shared/services/storage.service.spec.ts @@ -1,5 +1,4 @@ import { TestBed } from "@angular/core/testing"; - import { StorageService } from "./storage.service"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/shared/services/student-profile-absences.service.spec.ts b/src/app/shared/services/student-profile-absences.service.spec.ts index 02a995c05..c122461c6 100644 --- a/src/app/shared/services/student-profile-absences.service.spec.ts +++ b/src/app/shared/services/student-profile-absences.service.spec.ts @@ -1,5 +1,4 @@ import { TestBed } from "@angular/core/testing"; - import { buildTestModuleMetadata } from "src/spec-helpers"; import { StudentProfileAbsencesService } from "./student-profile-absences.service"; diff --git a/src/app/shared/services/student-profile-absences.service.ts b/src/app/shared/services/student-profile-absences.service.ts index 47ebf3dd0..d5f275717 100644 --- a/src/app/shared/services/student-profile-absences.service.ts +++ b/src/app/shared/services/student-profile-absences.service.ts @@ -1,13 +1,12 @@ -import { Injectable, Inject } from "@angular/core"; +import { Inject, Injectable } from "@angular/core"; import { TranslateService } from "@ngx-translate/core"; -import { Observable, ReplaySubject, EMPTY, of, combineLatest } from "rxjs"; -import { map, switchMap, startWith, share } from "rxjs/operators"; - +import { EMPTY, Observable, ReplaySubject, combineLatest, of } from "rxjs"; +import { map, share, startWith, switchMap } from "rxjs/operators"; import { SETTINGS, Settings } from "src/app/settings"; +import { LessonPresenceStatistic } from "../models/lesson-presence-statistic"; import { LessonPresence } from "../models/lesson-presence.model"; import { LessonPresencesRestService } from "./lesson-presences-rest.service"; import { PresenceTypesService } from "./presence-types.service"; -import { LessonPresenceStatistic } from "../models/lesson-presence-statistic"; import { ToastService } from "./toast.service"; export interface StudentProfileAbsencesCounts { diff --git a/src/app/shared/services/student-profile.service.spec.ts b/src/app/shared/services/student-profile.service.spec.ts index b6bd532b2..27104d1b5 100644 --- a/src/app/shared/services/student-profile.service.spec.ts +++ b/src/app/shared/services/student-profile.service.spec.ts @@ -1,24 +1,23 @@ import { HttpTestingController } from "@angular/common/http/testing"; import { TestBed } from "@angular/core/testing"; import * as t from "io-ts/lib/index"; - import { ApprenticeshipContract } from "src/app/shared/models/apprenticeship-contract.model"; import { LegalRepresentative } from "src/app/shared/models/legal-representative.model"; import { Person } from "src/app/shared/models/person.model"; import { Student } from "src/app/shared/models/student.model"; import { buildApprenticeshipContract, + buildApprenticeshipManagerWithEmails, + buildJobTrainerWithEmails, buildLegalRepresentative, buildPerson, - buildStudent, buildPersonWithEmails, - buildJobTrainerWithEmails, - buildApprenticeshipManagerWithEmails, + buildStudent, } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; import { - StudentProfileService, Profile, + StudentProfileService, } from "../../shared/services/student-profile.service"; import { ApprenticeshipManager } from "../models/apprenticeship-manager.model"; import { DropDownItem } from "../models/drop-down-item.model"; diff --git a/src/app/shared/services/student-profile.service.ts b/src/app/shared/services/student-profile.service.ts index d408a39a0..76154ebe4 100644 --- a/src/app/shared/services/student-profile.service.ts +++ b/src/app/shared/services/student-profile.service.ts @@ -1,24 +1,23 @@ import { Injectable } from "@angular/core"; -import { combineLatest, Observable, of } from "rxjs"; -import { map, switchMap, filter } from "rxjs/operators"; - +import { Observable, combineLatest, of } from "rxjs"; +import { filter, map, switchMap } from "rxjs/operators"; import { withConfig } from "src/app/rest-error-interceptor"; import { ApprenticeshipContract } from "src/app/shared/models/apprenticeship-contract.model"; +import { ApprenticeshipManager } from "src/app/shared/models/apprenticeship-manager.model"; +import { JobTrainer } from "src/app/shared/models/job-trainer.model"; import { LegalRepresentative } from "src/app/shared/models/legal-representative.model"; import { Person } from "src/app/shared/models/person.model"; import { Student } from "src/app/shared/models/student.model"; -import { ApprenticeshipManager } from "src/app/shared/models/apprenticeship-manager.model"; -import { JobTrainer } from "src/app/shared/models/job-trainer.model"; +import { ApprenticeshipManagersRestService } from "src/app/shared/services/apprenticeship-managers-rest.service"; +import { JobTrainersRestService } from "src/app/shared/services/job-trainers-rest.service"; import { LoadingService } from "src/app/shared/services/loading-service"; import { PersonsRestService } from "src/app/shared/services/persons-rest.service"; import { StudentsRestService } from "src/app/shared/services/students-rest.service"; -import { ApprenticeshipManagersRestService } from "src/app/shared/services/apprenticeship-managers-rest.service"; -import { JobTrainersRestService } from "src/app/shared/services/job-trainers-rest.service"; -import { DropDownItemsRestService } from "./drop-down-items-rest.service"; import { spread } from "src/app/shared/utils/function"; import { catch404 } from "src/app/shared/utils/observable"; import { notNull } from "../utils/filter"; import { isAdult } from "../utils/persons"; +import { DropDownItemsRestService } from "./drop-down-items-rest.service"; export interface Profile { student: T; diff --git a/src/app/shared/services/students-rest.service.spec.ts b/src/app/shared/services/students-rest.service.spec.ts index 0e3414705..a611fe99e 100644 --- a/src/app/shared/services/students-rest.service.spec.ts +++ b/src/app/shared/services/students-rest.service.spec.ts @@ -1,12 +1,11 @@ -import { TestBed } from "@angular/core/testing"; - -import { buildTestModuleMetadata } from "src/spec-helpers"; -import { StudentsRestService } from "./students-rest.service"; import { HttpTestingController } from "@angular/common/http/testing"; +import { TestBed } from "@angular/core/testing"; import { buildApprenticeshipContract, buildLegalRepresentative, } from "src/spec-builders"; +import { buildTestModuleMetadata } from "src/spec-helpers"; +import { StudentsRestService } from "./students-rest.service"; describe("StudentsRestService", () => { let service: StudentsRestService; diff --git a/src/app/shared/services/students-rest.service.ts b/src/app/shared/services/students-rest.service.ts index 4b8291d77..17b12a083 100644 --- a/src/app/shared/services/students-rest.service.ts +++ b/src/app/shared/services/students-rest.service.ts @@ -1,18 +1,17 @@ -import { Injectable, Inject } from "@angular/core"; import { HttpClient, HttpParams } from "@angular/common/http"; +import { Inject, Injectable } from "@angular/core"; import { Observable } from "rxjs"; import { switchMap } from "rxjs/operators"; - import { SETTINGS, Settings } from "../../settings"; -import { TypeaheadRestService } from "./typeahead-rest.service"; -import { decodeArray } from "../utils/decode"; -import { Student } from "../models/student.model"; -import { LegalRepresentative } from "../models/legal-representative.model"; import { ApprenticeshipContract } from "../models/apprenticeship-contract.model"; -import { TimetableEntry } from "../models/timetable-entry.model"; +import { LegalRepresentative } from "../models/legal-representative.model"; import { LessonAbsence } from "../models/lesson-absence.model"; -import { LessonIncident } from "../models/lesson-incident.model"; import { LessonDispensation } from "../models/lesson-dispensation.model"; +import { LessonIncident } from "../models/lesson-incident.model"; +import { Student } from "../models/student.model"; +import { TimetableEntry } from "../models/timetable-entry.model"; +import { decodeArray } from "../utils/decode"; +import { TypeaheadRestService } from "./typeahead-rest.service"; @Injectable({ providedIn: "root", diff --git a/src/app/shared/services/subscription-details-rest.service.spec.ts b/src/app/shared/services/subscription-details-rest.service.spec.ts index b57af6381..b92f62e4a 100644 --- a/src/app/shared/services/subscription-details-rest.service.spec.ts +++ b/src/app/shared/services/subscription-details-rest.service.spec.ts @@ -1,11 +1,10 @@ import { HttpTestingController } from "@angular/common/http/testing"; import { TestBed } from "@angular/core/testing"; -import { buildTestModuleMetadata } from "../../../spec-helpers"; import { isEqual } from "lodash-es"; - -import { SubscriptionDetailsRestService } from "./subscription-details-rest.service"; import { buildSubscriptionDetail } from "../../../spec-builders"; +import { buildTestModuleMetadata } from "../../../spec-helpers"; import { SubscriptionDetail } from "../models/subscription-detail.model"; +import { SubscriptionDetailsRestService } from "./subscription-details-rest.service"; describe("SubscriptionDetailsRestService", () => { let service: SubscriptionDetailsRestService; diff --git a/src/app/shared/services/subscription-details-rest.service.ts b/src/app/shared/services/subscription-details-rest.service.ts index 8a24c3b6d..c0b33a6ac 100644 --- a/src/app/shared/services/subscription-details-rest.service.ts +++ b/src/app/shared/services/subscription-details-rest.service.ts @@ -2,10 +2,10 @@ import { HttpClient } from "@angular/common/http"; import { Inject, Injectable } from "@angular/core"; import { Observable } from "rxjs"; import { map } from "rxjs/operators"; -import { Settings, SETTINGS } from "../../settings"; +import { GroupOptions } from "../../presence-control/components/presence-control-group-dialog/presence-control-group-dialog.component"; +import { SETTINGS, Settings } from "../../settings"; import { SubscriptionDetail } from "../models/subscription-detail.model"; import { RestService } from "./rest.service"; -import { GroupOptions } from "../../presence-control/components/presence-control-group-dialog/presence-control-group-dialog.component"; @Injectable({ providedIn: "root", diff --git a/src/app/shared/services/subscriptions-rest.service.spec.ts b/src/app/shared/services/subscriptions-rest.service.spec.ts index a443211c8..fcf8209c7 100644 --- a/src/app/shared/services/subscriptions-rest.service.spec.ts +++ b/src/app/shared/services/subscriptions-rest.service.spec.ts @@ -3,7 +3,6 @@ import { TestBed } from "@angular/core/testing"; import { buildIdSubscription } from "src/spec-builders"; import { buildTestModuleMetadata } from "../../../spec-helpers"; import { IdSubscription } from "../models/subscription-detail.model"; - import { SubscriptionsRestService } from "./subscriptions-rest.service"; describe("SubscriptionsRestService", () => { diff --git a/src/app/shared/services/subscriptions-rest.service.ts b/src/app/shared/services/subscriptions-rest.service.ts index 512e27f67..cba985f3f 100644 --- a/src/app/shared/services/subscriptions-rest.service.ts +++ b/src/app/shared/services/subscriptions-rest.service.ts @@ -2,7 +2,7 @@ import { HttpClient } from "@angular/common/http"; import { Inject, Injectable } from "@angular/core"; import { Observable } from "rxjs"; import { switchMap } from "rxjs/operators"; -import { Settings, SETTINGS } from "../../settings"; +import { SETTINGS, Settings } from "../../settings"; import { IdSubscription, SubscriptionDetail, diff --git a/src/app/shared/services/teacher-resources-rest.service.spec.ts b/src/app/shared/services/teacher-resources-rest.service.spec.ts index 17dca55b3..f07424015 100644 --- a/src/app/shared/services/teacher-resources-rest.service.spec.ts +++ b/src/app/shared/services/teacher-resources-rest.service.spec.ts @@ -1,7 +1,6 @@ import { TestBed } from "@angular/core/testing"; - -import { TeacherResourcesRestService } from "./teacher-resources-rest.service"; import { buildTestModuleMetadata } from "../../../spec-helpers"; +import { TeacherResourcesRestService } from "./teacher-resources-rest.service"; describe("TeacherResourcesTestService", () => { let service: TeacherResourcesRestService; diff --git a/src/app/shared/services/teacher-resources-rest.service.ts b/src/app/shared/services/teacher-resources-rest.service.ts index 5d5114f44..7ae2f692a 100644 --- a/src/app/shared/services/teacher-resources-rest.service.ts +++ b/src/app/shared/services/teacher-resources-rest.service.ts @@ -1,12 +1,12 @@ -import { Inject, Injectable } from "@angular/core"; -import { TeacherResource } from "../models/teacher-resource.model"; import { HttpClient } from "@angular/common/http"; -import { Settings, SETTINGS } from "../../settings"; -import { TypeaheadRestService } from "./typeahead-rest.service"; -import { DropDownItem } from "../models/drop-down-item.model"; +import { Inject, Injectable } from "@angular/core"; import { Observable, of } from "rxjs"; import { switchMap } from "rxjs/operators"; +import { SETTINGS, Settings } from "../../settings"; +import { DropDownItem } from "../models/drop-down-item.model"; +import { TeacherResource } from "../models/teacher-resource.model"; import { decodeArray } from "../utils/decode"; +import { TypeaheadRestService } from "./typeahead-rest.service"; @Injectable({ providedIn: "root", diff --git a/src/app/shared/services/teacher-substitutions-rest.service.spec.ts b/src/app/shared/services/teacher-substitutions-rest.service.spec.ts index b3a3cc5fd..f30bcf63e 100644 --- a/src/app/shared/services/teacher-substitutions-rest.service.spec.ts +++ b/src/app/shared/services/teacher-substitutions-rest.service.spec.ts @@ -1,9 +1,8 @@ +import { HttpTestingController } from "@angular/common/http/testing"; import { TestBed } from "@angular/core/testing"; - -import { TeacherSubstitutionsRestService } from "./teacher-substitutions-rest.service"; import { buildTestModuleMetadata } from "../../../spec-helpers"; -import { HttpTestingController } from "@angular/common/http/testing"; import { TeacherSubstitution } from "../models/teacher-substitution.model"; +import { TeacherSubstitutionsRestService } from "./teacher-substitutions-rest.service"; describe("TeacherSubstitutionsRestService", () => { let service: TeacherSubstitutionsRestService; diff --git a/src/app/shared/services/teacher-substitutions-rest.service.ts b/src/app/shared/services/teacher-substitutions-rest.service.ts index 3dd44719b..e5efb4f9c 100644 --- a/src/app/shared/services/teacher-substitutions-rest.service.ts +++ b/src/app/shared/services/teacher-substitutions-rest.service.ts @@ -1,9 +1,9 @@ import { HttpClient } from "@angular/common/http"; import { Inject, Injectable } from "@angular/core"; -import { RestService } from "./rest.service"; -import { Settings, SETTINGS } from "../../settings"; -import { TeacherSubstitution } from "../models/teacher-substitution.model"; import { Observable, map } from "rxjs"; +import { SETTINGS, Settings } from "../../settings"; +import { TeacherSubstitution } from "../models/teacher-substitution.model"; +import { RestService } from "./rest.service"; @Injectable({ providedIn: "root", diff --git a/src/app/shared/services/toast.service.spec.ts b/src/app/shared/services/toast.service.spec.ts index e169c7b95..6222a1e12 100644 --- a/src/app/shared/services/toast.service.spec.ts +++ b/src/app/shared/services/toast.service.spec.ts @@ -1,5 +1,4 @@ import { TestBed } from "@angular/core/testing"; - import { buildTestModuleMetadata } from "src/spec-helpers"; import { ToastInfo, ToastService } from "./toast.service"; diff --git a/src/app/shared/services/typeahead-rest.service.ts b/src/app/shared/services/typeahead-rest.service.ts index 76a190117..81d0147b8 100644 --- a/src/app/shared/services/typeahead-rest.service.ts +++ b/src/app/shared/services/typeahead-rest.service.ts @@ -1,13 +1,12 @@ import { HttpClient } from "@angular/common/http"; -import { Observable } from "rxjs"; -import { switchMap, map } from "rxjs/operators"; import * as t from "io-ts"; - +import { Observable } from "rxjs"; +import { map, switchMap } from "rxjs/operators"; import { Settings } from "src/app/settings"; -import { pick } from "../utils/types"; -import { decodeArray, decode } from "../utils/decode"; -import { RestService } from "../services/rest.service"; import { DropDownItem } from "../models/drop-down-item.model"; +import { RestService } from "../services/rest.service"; +import { decode, decodeArray } from "../utils/decode"; +import { pick } from "../utils/types"; export class HttpParams { params: { [param: string]: string }; diff --git a/src/app/shared/services/user-settings-rest.service.spec.ts b/src/app/shared/services/user-settings-rest.service.spec.ts index b9e417630..ed087e916 100644 --- a/src/app/shared/services/user-settings-rest.service.spec.ts +++ b/src/app/shared/services/user-settings-rest.service.spec.ts @@ -1,11 +1,10 @@ -import { TestBed } from "@angular/core/testing"; import { HttpTestingController } from "@angular/common/http/testing"; - +import { TestBed } from "@angular/core/testing"; +import { isEqual } from "lodash"; +import { buildUserSettingsWithNotificationSetting } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; +import { AccessInfo, UserSettings } from "../models/user-settings.model"; import { UserSettingsRestService } from "./user-settings-rest.service"; -import { buildUserSettingsWithNotificationSetting } from "src/spec-builders"; -import { isEqual } from "lodash"; -import { UserSettings, AccessInfo } from "../models/user-settings.model"; describe("UserSettingsRestService", () => { let service: UserSettingsRestService; diff --git a/src/app/shared/services/user-settings-rest.service.ts b/src/app/shared/services/user-settings-rest.service.ts index 1521e299f..e37f93172 100644 --- a/src/app/shared/services/user-settings-rest.service.ts +++ b/src/app/shared/services/user-settings-rest.service.ts @@ -1,12 +1,11 @@ -import { Injectable, Inject } from "@angular/core"; import { HttpClient, HttpParams } from "@angular/common/http"; +import { Inject, Injectable } from "@angular/core"; import { Observable } from "rxjs"; import { map, switchMap } from "rxjs/operators"; - -import { RestService } from "./rest.service"; import { SETTINGS, Settings } from "../../settings"; -import { UserSettings, AccessInfo } from "../models/user-settings.model"; +import { AccessInfo, UserSettings } from "../models/user-settings.model"; import { decode } from "../utils/decode"; +import { RestService } from "./rest.service"; @Injectable({ providedIn: "root", diff --git a/src/app/shared/services/user-settings.service.spec.ts b/src/app/shared/services/user-settings.service.spec.ts index 6d57c4f1f..4f6f89630 100644 --- a/src/app/shared/services/user-settings.service.spec.ts +++ b/src/app/shared/services/user-settings.service.spec.ts @@ -1,9 +1,9 @@ import { HttpTestingController } from "@angular/common/http/testing"; -import { fakeAsync, TestBed, tick } from "@angular/core/testing"; +import { TestBed, fakeAsync, tick } from "@angular/core/testing"; import { isEqual } from "lodash-es"; import { buildUserSettings } from "src/spec-builders"; import { buildTestModuleMetadata } from "src/spec-helpers"; -import { UserSettings, AccessInfo } from "../models/user-settings.model"; +import { AccessInfo, UserSettings } from "../models/user-settings.model"; import { UserSettingsRestService } from "./user-settings-rest.service"; import { REFETCH_DEBOUNCE_TIME, diff --git a/src/app/shared/services/user-settings.service.ts b/src/app/shared/services/user-settings.service.ts index dc3c894db..7db5b03fb 100644 --- a/src/app/shared/services/user-settings.service.ts +++ b/src/app/shared/services/user-settings.service.ts @@ -1,23 +1,23 @@ import { Injectable } from "@angular/core"; import { + Observable, + Subject, debounceTime, map, - Observable, shareReplay, startWith, - Subject, switchMap, tap, } from "rxjs"; import { - UserSetting, NotificationChannels, - NotificationTypesInactive, - UserSettings, NotificationData, + NotificationTypesInactive, + PresenceControlGroupView, PresenceControlViewMode, PresenceControlViewModeObject, - PresenceControlGroupView, + UserSetting, + UserSettings, } from "../models/user-settings.model"; import { decode } from "../utils/decode"; import { defaultValue } from "../utils/observable"; diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 19ce7f6c8..477618baa 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -1,54 +1,53 @@ import { CommonModule } from "@angular/common"; -import { HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http"; +import { HTTP_INTERCEPTORS, HttpClientModule } from "@angular/common/http"; import { NgModule } from "@angular/core"; import { FormsModule, ReactiveFormsModule } from "@angular/forms"; import { RouterModule } from "@angular/router"; import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { NgSelectModule } from "@ng-select/ng-select"; import { TranslateModule } from "@ngx-translate/core"; - -import { AddSpacePipe } from "./pipes/add-space.pipe"; +import { InfiniteScrollModule } from "ngx-infinite-scroll"; +import { RestAuthInterceptor } from "../rest-auth-interceptor"; +import { RestErrorInterceptor } from "../rest-error-interceptor"; +import { RestRoleInterceptor } from "../rest-role-interceptor"; import { AvatarComponent } from "./components/avatar/avatar.component"; import { BacklinkComponent } from "./components/backlink/backlink.component"; import { CaretComponent } from "./components/caret/caret.component"; import { ConfirmAbsencesComponent } from "./components/confirm-absences/confirm-absences.component"; import { DateSelectComponent } from "./components/date-select/date-select.component"; -import { DaysDifferencePipe } from "./pipes/days-difference.pipe"; -import { DecimalOrDashPipe } from "./pipes/decimal-or-dash.pipe"; +import { MultiselectComponent } from "./components/multiselect/multiselect.component"; +import { ReportsLinkComponent } from "./components/reports-link/reports-link.component"; +import { ResettableInputComponent } from "./components/resettable-input/resettable-input.component"; +import { SelectComponent } from "./components/select/select.component"; +import { SpinnerComponent } from "./components/spinner/spinner.component"; import { DossierAbsencesComponent } from "./components/student-dossier/dossier-absences/dossier-absences.component"; import { DossierAddressesComponent } from "./components/student-dossier/dossier-addresses/dossier-addresses.component"; import { DossierCourseTestsComponent } from "./components/student-dossier/dossier-course-tests/dossier-course-tests.component"; -import { DossierGradesComponent } from "./components/student-dossier/dossier-grades/dossier-grades.component"; import { DossierGradesCourseHeaderComponent } from "./components/student-dossier/dossier-grades-course-header/dossier-grades-course-header.component"; import { DossierGradesEditComponent } from "./components/student-dossier/dossier-grades-edit/dossier-grades-edit.component"; import { DossierGradesFinalGradeComponent } from "./components/student-dossier/dossier-grades-final-grade/dossier-grades-final-grade.component"; import { DossierGradesViewComponent } from "./components/student-dossier/dossier-grades-view/dossier-grades-view.component"; +import { DossierGradesComponent } from "./components/student-dossier/dossier-grades/dossier-grades.component"; import { DossierSingleTestComponent } from "./components/student-dossier/dossier-single-test/dossier-single-test.component"; -import { InfiniteScrollModule } from "ngx-infinite-scroll"; -import { LetDirective } from "./directives/let.directive"; -import { MultiselectComponent } from "./components/multiselect/multiselect.component"; -import { NgSelectModule } from "@ng-select/ng-select"; -import { PersonEmailPipe } from "./pipes/person-email.pipe"; -import { PreserveLineHeightComponent } from "./components/text/line/preserve-line-height.component"; -import { ReportsLinkComponent } from "./components/reports-link/reports-link.component"; -import { ResettableInputComponent } from "./components/resettable-input/resettable-input.component"; -import { RestAuthInterceptor } from "../rest-auth-interceptor"; -import { RestErrorInterceptor } from "../rest-error-interceptor"; -import { RestRoleInterceptor } from "../rest-role-interceptor"; -import { SafePipe } from "./pipes/safe.pipe"; -import { SelectComponent } from "./components/select/select.component"; -import { SpinnerComponent } from "./components/spinner/spinner.component"; import { StudentBacklinkComponent } from "./components/student-dossier/student-backlink/student-backlink.component"; import { StudentDossierAbsencesComponent } from "./components/student-dossier/student-dossier-absences/student-dossier-absences.component"; import { StudentDossierAddressComponent } from "./components/student-dossier/student-dossier-address/student-dossier-address.component"; import { StudentDossierApprenticeshipCompanyComponent } from "./components/student-dossier/student-dossier-apprenticeship-company/student-dossier-apprenticeship-company.component"; -import { StudentDossierComponent } from "./components/student-dossier/student-dossier/student-dossier.component"; import { StudentDossierEntryHeaderComponent } from "./components/student-dossier/student-dossier-entry-header/student-dossier-entry-header.component"; import { StudentDossierLegalRepresentativeComponent } from "./components/student-dossier/student-dossier-legal-representative/student-dossier-legal-representative.component"; +import { StudentDossierComponent } from "./components/student-dossier/student-dossier/student-dossier.component"; import { SwitchComponent } from "./components/switch/switch.component"; -import { TestPointsPipe } from "./pipes/test-points.pipe"; -import { TestsWeightPipe } from "./pipes/test-weight.pipe"; +import { PreserveLineHeightComponent } from "./components/text/line/preserve-line-height.component"; import { ToastComponent } from "./components/toast/toast.component"; import { TypeaheadComponent } from "./components/typeahead/typeahead.component"; +import { LetDirective } from "./directives/let.directive"; +import { AddSpacePipe } from "./pipes/add-space.pipe"; +import { DaysDifferencePipe } from "./pipes/days-difference.pipe"; +import { DecimalOrDashPipe } from "./pipes/decimal-or-dash.pipe"; +import { PersonEmailPipe } from "./pipes/person-email.pipe"; +import { SafePipe } from "./pipes/safe.pipe"; +import { TestPointsPipe } from "./pipes/test-points.pipe"; +import { TestsWeightPipe } from "./pipes/test-weight.pipe"; import { XssPipe } from "./pipes/xss.pipe"; const directives = [LetDirective]; diff --git a/src/app/shared/utils/absences-filter.ts b/src/app/shared/utils/absences-filter.ts index 1a9f58630..fb0d326ba 100644 --- a/src/app/shared/utils/absences-filter.ts +++ b/src/app/shared/utils/absences-filter.ts @@ -1,6 +1,5 @@ import { Params } from "@angular/router"; import { format } from "date-fns"; - import { EditAbsencesFilter } from "src/app/edit-absences/services/edit-absences-state.service"; import { EvaluateAbsencesFilter } from "src/app/evaluate-absences/services/evaluate-absences-state.service"; diff --git a/src/app/shared/utils/array.spec.ts b/src/app/shared/utils/array.spec.ts index 2deb9fe61..465875712 100644 --- a/src/app/shared/utils/array.spec.ts +++ b/src/app/shared/utils/array.spec.ts @@ -1,9 +1,9 @@ import { - previousElement, - nextElement, + isArray, isEmptyArray, length, - isArray, + nextElement, + previousElement, } from "./array"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/shared/utils/date.spec.ts b/src/app/shared/utils/date.spec.ts index 150c436d6..6c1b5cd45 100644 --- a/src/app/shared/utils/date.spec.ts +++ b/src/app/shared/utils/date.spec.ts @@ -1,8 +1,8 @@ import { - parseISOLocalDateTime, + formatISOLocalDate, formatISOLocalDateTime, parseISOLocalDate, - formatISOLocalDate, + parseISOLocalDateTime, } from "./date"; describe("date utils", () => { diff --git a/src/app/shared/utils/decode.spec.ts b/src/app/shared/utils/decode.spec.ts index c270e05bb..8ddcf28c6 100644 --- a/src/app/shared/utils/decode.spec.ts +++ b/src/app/shared/utils/decode.spec.ts @@ -1,5 +1,5 @@ import * as t from "io-ts/lib/index"; -import { decode, decodeArray, DecodeError } from "./decode"; +import { DecodeError, decode, decodeArray } from "./decode"; describe("decode utils", () => { const Foo = t.type({ diff --git a/src/app/shared/utils/decode.ts b/src/app/shared/utils/decode.ts index 22147ce98..866dc230e 100644 --- a/src/app/shared/utils/decode.ts +++ b/src/app/shared/utils/decode.ts @@ -1,8 +1,8 @@ -import * as t from "io-ts"; -import { pipe } from "fp-ts/es6/function"; import { fold, left } from "fp-ts/es6/Either"; +import { pipe } from "fp-ts/es6/function"; +import * as t from "io-ts"; import { PathReporter } from "io-ts/es6/PathReporter"; -import { Observable, throwError, of } from "rxjs"; +import { Observable, of, throwError } from "rxjs"; export class DecodeError extends Error { name = "DecodeError"; diff --git a/src/app/shared/utils/drop-down-items.ts b/src/app/shared/utils/drop-down-items.ts index 80c11d1fc..8f9322d85 100644 --- a/src/app/shared/utils/drop-down-items.ts +++ b/src/app/shared/utils/drop-down-items.ts @@ -1,6 +1,6 @@ -import { DropDownItem } from "../models/drop-down-item.model"; import { Observable } from "rxjs"; import { map } from "rxjs/operators"; +import { DropDownItem } from "../models/drop-down-item.model"; export function findDropDownItem$( items$: Observable>, diff --git a/src/app/shared/utils/filter.spec.ts b/src/app/shared/utils/filter.spec.ts index 19b2f74b8..d1087e7d7 100644 --- a/src/app/shared/utils/filter.spec.ts +++ b/src/app/shared/utils/filter.spec.ts @@ -1,11 +1,11 @@ import { + isInstanceOf, + isTruthy, + nonEmptyString, nonZero, not, notNull, - isTruthy, - isInstanceOf, unique, - nonEmptyString, } from "./filter"; describe("filter utils", () => { diff --git a/src/app/shared/utils/form.spec.ts b/src/app/shared/utils/form.spec.ts index 6614d7ad6..b278e4ea0 100644 --- a/src/app/shared/utils/form.spec.ts +++ b/src/app/shared/utils/form.spec.ts @@ -1,10 +1,9 @@ import { - UntypedFormGroup, UntypedFormControl, + UntypedFormGroup, Validators, } from "@angular/forms"; import { Subject } from "rxjs"; - import { getControl, getControlValueChanges, diff --git a/src/app/shared/utils/form.ts b/src/app/shared/utils/form.ts index eb5b7a24d..37ae33106 100644 --- a/src/app/shared/utils/form.ts +++ b/src/app/shared/utils/form.ts @@ -1,6 +1,6 @@ import { AbstractControl, UntypedFormGroup } from "@angular/forms"; -import { Observable, of, combineLatest, EMPTY } from "rxjs"; -import { startWith, map, switchMap, filter, shareReplay } from "rxjs/operators"; +import { EMPTY, Observable, combineLatest, of } from "rxjs"; +import { filter, map, shareReplay, startWith, switchMap } from "rxjs/operators"; /** * Emits the validation errors of the form group or the control with diff --git a/src/app/shared/utils/gradings.spec.ts b/src/app/shared/utils/gradings.spec.ts index a1dadc5b2..e8c3a7b5c 100644 --- a/src/app/shared/utils/gradings.spec.ts +++ b/src/app/shared/utils/gradings.spec.ts @@ -1,5 +1,5 @@ import { FinalGrading, Grading } from "../models/course.model"; -import { GradingScale, Grade } from "../models/grading-scale.model"; +import { Grade, GradingScale } from "../models/grading-scale.model"; import * as Gradings from "./gradings"; describe("gradings", () => { diff --git a/src/app/shared/utils/lesson-presences.spec.ts b/src/app/shared/utils/lesson-presences.spec.ts index ee46b5aa3..a2350d6d6 100644 --- a/src/app/shared/utils/lesson-presences.spec.ts +++ b/src/app/shared/utils/lesson-presences.spec.ts @@ -4,10 +4,10 @@ import { } from "src/spec-builders"; import { LessonPresence } from "../models/lesson-presence.model"; import { - getIdsGroupedByPerson, getIdsGroupedByLesson, - sortLessonPresencesByDate, + getIdsGroupedByPerson, getIdsGroupedByPersonAndPresenceType, + sortLessonPresencesByDate, toDesignationDateTimeTypeString, } from "./lesson-presences"; diff --git a/src/app/shared/utils/lesson-presences.ts b/src/app/shared/utils/lesson-presences.ts index ad3ff207f..75dfcac76 100644 --- a/src/app/shared/utils/lesson-presences.ts +++ b/src/app/shared/utils/lesson-presences.ts @@ -1,5 +1,5 @@ -import { LessonPresence } from "../models/lesson-presence.model"; import { format } from "date-fns"; +import { LessonPresence } from "../models/lesson-presence.model"; export function getIdsGroupedByPerson( lessonPresences: ReadonlyArray, diff --git a/src/app/shared/utils/observable.ts b/src/app/shared/utils/observable.ts index 8d7399761..541b494cb 100644 --- a/src/app/shared/utils/observable.ts +++ b/src/app/shared/utils/observable.ts @@ -1,24 +1,24 @@ import { HttpErrorResponse } from "@angular/common/http"; import { + MonoTypeOperatorFunction, + Observable, ObservableInput, ObservedValueOf, - of, OperatorFunction, - throwError, - MonoTypeOperatorFunction, - Observable, defer, fromEvent, interval, merge, + of, + throwError, } from "rxjs"; import { catchError, defaultIfEmpty, - tap, map, - switchMap, startWith, + switchMap, + tap, } from "rxjs/operators"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/app/shared/utils/pagination.ts b/src/app/shared/utils/pagination.ts index 30859b333..61c48b98a 100644 --- a/src/app/shared/utils/pagination.ts +++ b/src/app/shared/utils/pagination.ts @@ -1,7 +1,7 @@ +import { HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http"; import * as t from "io-ts/lib/index"; -import { HttpResponse, HttpParams, HttpHeaders } from "@angular/common/http"; import { Observable } from "rxjs"; -import { switchMap, map } from "rxjs/operators"; +import { map, switchMap } from "rxjs/operators"; import { decodeArray } from "./decode"; export interface Paginated { diff --git a/src/app/shared/utils/persons.spec.ts b/src/app/shared/utils/persons.spec.ts index 79f467416..1cba578af 100644 --- a/src/app/shared/utils/persons.spec.ts +++ b/src/app/shared/utils/persons.spec.ts @@ -1,7 +1,7 @@ -import { isAdult } from "./persons"; import { buildPerson, buildStudent } from "src/spec-builders"; import { Person } from "../models/person.model"; import { Student } from "../models/student.model"; +import { isAdult } from "./persons"; describe("persons utilities", () => { beforeEach(() => { diff --git a/src/app/shared/utils/persons.ts b/src/app/shared/utils/persons.ts index 7ed6a9edc..ef36112c3 100644 --- a/src/app/shared/utils/persons.ts +++ b/src/app/shared/utils/persons.ts @@ -1,6 +1,6 @@ import { differenceInYears } from "date-fns"; -import { Student } from "../models/student.model"; import { Person } from "../models/person.model"; +import { Student } from "../models/student.model"; const ADULT_AGE = 18; diff --git a/src/app/shared/utils/presence-control-entries.spec.ts b/src/app/shared/utils/presence-control-entries.spec.ts index 792c56191..b2a04ba05 100644 --- a/src/app/shared/utils/presence-control-entries.spec.ts +++ b/src/app/shared/utils/presence-control-entries.spec.ts @@ -1,6 +1,6 @@ import { - buildPresenceControlEntry, buildLessonPresenceWithIds, + buildPresenceControlEntry, } from "../../../spec-builders"; import { PresenceControlEntry } from "../../presence-control/models/presence-control-entry.model"; import { filterByGroup } from "./presence-control-entries"; diff --git a/src/app/shared/utils/presence-control-entries.ts b/src/app/shared/utils/presence-control-entries.ts index d1192443b..374a66c3e 100644 --- a/src/app/shared/utils/presence-control-entries.ts +++ b/src/app/shared/utils/presence-control-entries.ts @@ -1,8 +1,8 @@ +import { GroupOptions } from "../../presence-control/components/presence-control-group-dialog/presence-control-group-dialog.component"; +import { PresenceControlEntry } from "../../presence-control/models/presence-control-entry.model"; +import { DropDownItem } from "../models/drop-down-item.model"; import { LessonPresence } from "../models/lesson-presence.model"; import { PresenceType } from "../models/presence-type.model"; -import { DropDownItem } from "../models/drop-down-item.model"; -import { PresenceControlEntry } from "../../presence-control/models/presence-control-entry.model"; -import { GroupOptions } from "../../presence-control/components/presence-control-group-dialog/presence-control-group-dialog.component"; export function buildPresenceControlEntries( lessonPresences: ReadonlyArray, diff --git a/src/app/shared/utils/presence-types.spec.ts b/src/app/shared/utils/presence-types.spec.ts index b1f983cbb..49c38711d 100644 --- a/src/app/shared/utils/presence-types.spec.ts +++ b/src/app/shared/utils/presence-types.spec.ts @@ -1,5 +1,5 @@ -import { sortPresenceTypes } from "./presence-types"; import { buildPresenceType } from "src/spec-builders"; +import { sortPresenceTypes } from "./presence-types"; describe("presence types utilities", () => { describe("sortPresenceTypes", () => { diff --git a/src/app/shared/utils/presence-types.ts b/src/app/shared/utils/presence-types.ts index fe7ac98dc..97eee00f1 100644 --- a/src/app/shared/utils/presence-types.ts +++ b/src/app/shared/utils/presence-types.ts @@ -1,6 +1,6 @@ -import { PresenceType } from "../models/presence-type.model"; import { DropDownGroupedItem } from "../models/drop-down-grouped-item.model"; import { DropDownItem } from "../models/drop-down-item.model"; +import { PresenceType } from "../models/presence-type.model"; /** * Sorts an array of presence types by the `Sort` attribute. diff --git a/src/app/shared/utils/url.ts b/src/app/shared/utils/url.ts index 60f3929e1..90ec8575e 100644 --- a/src/app/shared/utils/url.ts +++ b/src/app/shared/utils/url.ts @@ -1,7 +1,7 @@ import { DefaultUrlSerializer, - Params, PRIMARY_OUTLET, + Params, UrlSegment, UrlSegmentGroup, } from "@angular/router"; diff --git a/src/app/shared/utils/user-settings.ts b/src/app/shared/utils/user-settings.ts index 246a35dda..5cff165ef 100644 --- a/src/app/shared/utils/user-settings.ts +++ b/src/app/shared/utils/user-settings.ts @@ -1,5 +1,5 @@ -import { PresenceControlGroupViewEntry } from "../models/user-settings.model"; import { GroupOptions } from "../../presence-control/components/presence-control-group-dialog/presence-control-group-dialog.component"; +import { PresenceControlGroupViewEntry } from "../models/user-settings.model"; export function updateGroupViewSettings( group: GroupOptions["id"], diff --git a/src/main.ts b/src/main.ts index d93538c69..340c5014e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,5 @@ import { enableProdMode } from "@angular/core"; import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; - import { AppModule } from "./app/app.module"; import { environment } from "./environments/environment"; diff --git a/src/polyfills.ts b/src/polyfills.ts index 0e134a707..a19b9f949 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -2,6 +2,7 @@ * Load `$localize` onto the global scope - used if i18n tags appear in Angular templates. */ import "@angular/localize/init"; + /** * This file includes polyfills needed by Angular and is loaded before the app. * You can add your own extra polyfills to this file. @@ -49,7 +50,9 @@ import "@angular/localize/init"; /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ -import "zone.js"; // Included with Angular CLI. +import "zone.js"; + +// Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS diff --git a/src/spec-builders.ts b/src/spec-builders.ts index 1691d47e3..7190b4a56 100644 --- a/src/spec-builders.ts +++ b/src/spec-builders.ts @@ -1,42 +1,42 @@ -import { OptionalReference, Reference } from "./app/shared/models/common-types"; -import { LessonPresence } from "./app/shared/models/lesson-presence.model"; -import { Lesson } from "./app/shared/models/lesson.model"; -import { PresenceType } from "./app/shared/models/presence-type.model"; +import { Event, EventState } from "./app/events/services/events-state.service"; import { PresenceControlEntry } from "./app/presence-control/models/presence-control-entry.model"; -import { Student } from "./app/shared/models/student.model"; import { ApprenticeshipContract } from "./app/shared/models/apprenticeship-contract.model"; -import { LegalRepresentative } from "./app/shared/models/legal-representative.model"; -import { Person } from "./app/shared/models/person.model"; -import { LessonPresenceStatistic } from "./app/shared/models/lesson-presence-statistic"; import { ApprenticeshipManager } from "./app/shared/models/apprenticeship-manager.model"; -import { JobTrainer } from "./app/shared/models/job-trainer.model"; -import { UserSettings } from "./app/shared/models/user-settings.model"; -import { LessonAbsence } from "./app/shared/models/lesson-absence.model"; -import { - IdSubscription, - SubscriptionDetail, -} from "./app/shared/models/subscription-detail.model"; +import { OptionalReference, Reference } from "./app/shared/models/common-types"; import { - Course, AttendanceRef, + Course, EvaluationStatusRef, - Grading, FinalGrading, + Grading, } from "./app/shared/models/course.model"; -import { Result, Test } from "./app/shared/models/test.model"; -import { StudyClass } from "./app/shared/models/study-class.model"; import { Grade } from "./app/shared/models/grading-scale.model"; +import { JobTrainer } from "./app/shared/models/job-trainer.model"; +import { LegalRepresentative } from "./app/shared/models/legal-representative.model"; +import { LessonAbsence } from "./app/shared/models/lesson-absence.model"; +import { LessonDispensation } from "./app/shared/models/lesson-dispensation.model"; +import { LessonIncident } from "./app/shared/models/lesson-incident.model"; +import { LessonPresenceStatistic } from "./app/shared/models/lesson-presence-statistic"; +import { LessonPresence } from "./app/shared/models/lesson-presence.model"; +import { Lesson } from "./app/shared/models/lesson.model"; +import { Person } from "./app/shared/models/person.model"; +import { PresenceType } from "./app/shared/models/presence-type.model"; import { FinalGrade, GradeKind, GradeOrNoResult, StudentGrade, } from "./app/shared/models/student-grades"; +import { Student } from "./app/shared/models/student.model"; +import { StudyClass } from "./app/shared/models/study-class.model"; +import { + IdSubscription, + SubscriptionDetail, +} from "./app/shared/models/subscription-detail.model"; +import { Result, Test } from "./app/shared/models/test.model"; import { TimetableEntry } from "./app/shared/models/timetable-entry.model"; -import { LessonDispensation } from "./app/shared/models/lesson-dispensation.model"; import { TokenPayload } from "./app/shared/models/token-payload.model"; -import { EventState, Event } from "./app/events/services/events-state.service"; -import { LessonIncident } from "./app/shared/models/lesson-incident.model"; +import { UserSettings } from "./app/shared/models/user-settings.model"; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/spec-helpers.ts b/src/spec-helpers.ts index ed3dedda5..a3ff55e11 100644 --- a/src/spec-helpers.ts +++ b/src/spec-helpers.ts @@ -1,18 +1,17 @@ -import { SimpleChanges, SimpleChange } from "@angular/core"; -import { TestModuleMetadata } from "@angular/core/testing"; -import { RouterTestingModule } from "@angular/router/testing"; -import { ParamMap, Params, convertToParamMap } from "@angular/router"; import { HttpClient } from "@angular/common/http"; import { HttpClientTestingModule } from "@angular/common/http/testing"; +import { SimpleChange, SimpleChanges } from "@angular/core"; +import { TestModuleMetadata } from "@angular/core/testing"; import { ReactiveFormsModule } from "@angular/forms"; -import { ReplaySubject } from "rxjs"; -import { TranslateModule, TranslateLoader } from "@ngx-translate/core"; +import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { ParamMap, Params, convertToParamMap } from "@angular/router"; +import { RouterTestingModule } from "@angular/router/testing"; +import { TranslateLoader, TranslateModule } from "@ngx-translate/core"; import { TranslateHttpLoader } from "@ngx-translate/http-loader"; - -import { SharedModule } from "./app/shared/shared.module"; -import { Settings, SETTINGS } from "./app/settings"; +import { ReplaySubject } from "rxjs"; +import { SETTINGS, Settings } from "./app/settings"; import { AuthService } from "./app/shared/services/auth.service"; -import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { SharedModule } from "./app/shared/shared.module"; export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader { return new TranslateHttpLoader(http, "./assets/locales/", ".json"); diff --git a/src/test.ts b/src/test.ts index 4579da836..d8c216119 100644 --- a/src/test.ts +++ b/src/test.ts @@ -1,11 +1,10 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import "zone.js/testing"; import { getTestBed } from "@angular/core/testing"; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting, } from "@angular/platform-browser-dynamic/testing"; +import "zone.js/testing"; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment(