From 3cff142cb3101994dee25445ffc44bcf350a3fb1 Mon Sep 17 00:00:00 2001 From: Florent Poittevin <florent.poittevin@unige.ch> Date: Thu, 24 Feb 2022 15:42:41 +0100 Subject: [PATCH 1/2] chore: [DLCM-2103-2104-2105] improve eslint rules --- .eslintrc.js | 171 +-------------- cypress/integration/test-helper.ts | 6 +- package-lock.json | 194 +++++++++++++----- package.json | 5 +- src/app/app.component.ts | 10 +- .../components/dialogs/user/user.dialog.ts | 2 +- .../abstract-main-toolbar.presentational.ts | 15 +- ...olbar-desktop-horizontal.presentational.ts | 6 +- .../main-toolbar-mobile.presentational.ts | 5 - .../user-form/user-form.presentational.ts | 8 +- .../user-menu/user-menu.presentational.ts | 10 +- .../admin-archive-acl-form.presentational.ts | 6 +- .../admin-archive-acl-detail-edit.routable.ts | 8 +- .../stores/admin-archive-acl.state.ts | 10 +- ...admin-archive-type-detail-edit.routable.ts | 6 +- .../stores/admin-archive-type.state.ts | 18 +- ...issemination-policy-form.presentational.ts | 6 +- ...ssemination-policy-detail-edit.routable.ts | 8 +- .../admin-dissemination-policy.state.ts | 10 +- ...in-funding-agencies-form.presentational.ts | 6 +- ...n-funding-agencies-detail-edit.routable.ts | 8 +- .../stores/admin-funding-agencies.state.ts | 32 +-- ...anizational-unit-funding-agencies.state.ts | 10 +- ...n-index-field-alias-form.presentational.ts | 28 +-- ...-index-field-alias-detail-edit.routable.ts | 8 +- .../stores/admin-index-field-alias.state.ts | 10 +- .../admin-institution-form.presentational.ts | 8 +- .../admin-institution-detail-edit.routable.ts | 8 +- .../stores/admin-institution.state.ts | 24 +-- ...n-institution-organizational-unit.state.ts | 10 +- .../admin-language-create-edit.dialog.ts | 6 +- .../admin-language-form.presentational.ts | 8 +- .../language/stores/admin-language.state.ts | 14 +- .../admin-license-form.presentational.ts | 6 +- .../admin-license-detail-edit.routable.ts | 8 +- .../license/stores/admin-license.state.ts | 10 +- ...admin-metadata-type-form.presentational.ts | 6 +- ...dmin-metadata-type-detail-edit.routable.ts | 12 +- .../stores/admin-metadata-type.state.ts | 22 +- ...admin-notification-detail-edit.routable.ts | 8 +- .../stores/admin-notification.state.ts | 14 +- ...admin-notification-status-history.state.ts | 10 +- ...oai-metadata-prefix-form.presentational.ts | 6 +- ...ai-metadata-prefix-detail-edit.routable.ts | 8 +- .../stores/admin-oai-metadata-prefix.state.ts | 14 +- .../admin-oai-set-bulk-form.presentational.ts | 8 +- .../admin-oai-set-form.presentational.ts | 6 +- .../admin-oai-set-detail-edit.routable.ts | 8 +- .../oai-set/stores/admin-oai-set.state.ts | 24 +-- ...al-unit-additional-fields-rename.dialog.ts | 2 +- ...t-additional-fields-form.presentational.ts | 6 +- ...organizational-unit-form.presentational.ts | 12 +- ...al-unit-additional-fields-list.routable.ts | 12 +- ...rganizational-unit-detail-edit.routable.ts | 18 +- ...n-organizational-unit-metadata.routable.ts | 4 +- ...ional-unit-additional-fields-form.state.ts | 14 +- .../stores/admin-organizational-unit.state.ts | 60 +++--- ...ational-unit-dissemination-policy.state.ts | 26 +-- ...rganizational-unit-funding-agency.state.ts | 10 +- ...n-organizational-unit-institution.state.ts | 10 +- ...n-organizational-unit-person-role.state.ts | 12 +- ...zational-unit-preservation-policy.state.ts | 26 +-- ...nizational-unit-submission-policy.state.ts | 26 +-- .../admin-person-form.presentational.ts | 6 +- .../admin-person-detail-edit.routable.ts | 8 +- .../admin/person/stores/admin-person.state.ts | 32 +-- .../admin-people-institutions.state.ts | 10 +- .../admin-person-orgunit-role.state.ts | 12 +- ...preservation-policy-form.presentational.ts | 6 +- ...reservation-policy-detail-edit.routable.ts | 8 +- .../stores/admin-preservation-policy.state.ts | 10 +- ...dmin-research-domain-create-edit.dialog.ts | 6 +- ...min-research-domain-form.presentational.ts | 14 +- .../admin-research-domain-list.routable.ts | 4 +- .../stores/admin-research-domain.state.ts | 14 +- .../admin-role-form.presentational.ts | 8 +- .../admin-role-detail-edit.routable.ts | 8 +- .../admin/role/stores/admin-role.state.ts | 10 +- src/app/features/admin/stores/admin.state.ts | 2 +- ...n-submission-policy-form.presentational.ts | 6 +- ...-submission-policy-detail-edit.routable.ts | 8 +- .../stores/admin-submission-policy.state.ts | 10 +- ...dmin-user-edit-role-current-user.dialog.ts | 2 +- .../admin-user-form.presentational.ts | 8 +- .../admin-user-detail-edit.routable.ts | 16 +- .../admin/user/stores/admin-user.state.ts | 20 +- .../deposit-collection.container.ts | 16 +- .../deposit-file/deposit-file.container.ts | 12 +- .../deposit-upload.container.ts | 6 +- .../deposit-file-upload-archive.dialog.ts | 6 +- .../deposit-file-upload.dialog.ts | 6 +- .../deposit-order-author.dialog.ts | 8 +- .../deposit-person-alternative.dialog.ts | 6 +- .../deposit-person/deposit-person.dialog.ts | 22 +- .../deposit-reject/deposit-reject.dialog.ts | 2 +- .../deposit-file.presentational.ts | 2 +- ...files-upload-in-progress.presentational.ts | 2 +- .../deposit-form.presentational.ts | 18 +- .../deposit-collection.routable.ts | 6 +- .../deposit-data/deposit-data.routable.ts | 6 +- .../deposit-detail-edit.routable.ts | 48 ++--- .../deposit-file/deposit-file.routable.ts | 6 +- .../deposit-home/deposit-home.routable.ts | 8 +- .../deposit-list/deposit-list.routable.ts | 42 ++-- .../deposit-metadata.routable.ts | 6 +- .../deposit-root/deposit-root.routable.ts | 4 +- .../helpers/data-file-upload.helper.ts | 4 +- .../deposit/stores/aip/deposit-aip.state.ts | 10 +- ...it-authorized-organizational-unit.state.ts | 10 +- .../collection/deposit-collection.state.ts | 20 +- ...deposit-collection-status-history.state.ts | 10 +- .../data-file/deposit-data-file.state.ts | 88 ++++---- .../deposit-data-file-metadata-type.state.ts | 14 +- .../deposit-data-file-status-history.state.ts | 10 +- .../features/deposit/stores/deposit.state.ts | 124 +++++------ ...ional-unit-additional-fields-form.state.ts | 12 +- .../deposit-organizational-unit.state.ts | 10 +- .../stores/people/deposit-people.state.ts | 10 +- .../deposit-status-history.state.ts | 10 +- .../stores/upload/deposit-upload.state.ts | 16 +- .../home-carousel.presentational.ts | 4 +- .../home-partners.presentational.ts | 6 +- .../home-search-facet.presentational.ts | 8 +- .../home-twitter-widget.presentational.ts | 10 +- .../home-archive-collection-list.routable.ts | 8 +- .../home-archive-detail.routable.ts | 12 +- .../home-archive-file-list.routable.ts | 8 +- .../home-archive-not-found.routable.ts | 4 +- .../routables/home-page/home-page.routable.ts | 22 +- .../home-search/home-search.routable.ts | 72 +++---- .../services/archive-access-right.service.ts | 4 +- .../features/home/services/twitter.service.ts | 20 +- .../home-archive-collection.state.ts | 22 +- .../data-file/home-archive-data-file.state.ts | 36 ++-- .../package/home-archive-package.state.ts | 12 +- .../rating/home-archive-rating.state.ts | 24 +-- src/app/features/home/stores/home.state.ts | 42 ++-- .../order-home/order-home.routable.ts | 6 +- .../order-all-order-form.presentational.ts | 6 +- .../order-all-order-detail-edit.routable.ts | 20 +- .../stores/aip/order-all-order-aip.state.ts | 10 +- .../stores/dip/order-all-order-dip.state.ts | 10 +- .../all-order/stores/order-all-order.state.ts | 16 +- .../order-all-order-order-archive.state.ts | 14 +- .../order-all-order-status-history.state.ts | 10 +- .../my-order/order-my-order.presentational.ts | 10 +- .../order-my-order-detail-edit.routable.ts | 16 +- .../order-my-order-list.routable.ts | 32 +-- .../stores/aip/order-my-order-aip.state.ts | 10 +- .../stores/dip/order-my-order-dip.state.ts | 10 +- .../my-order/stores/order-my-order.state.ts | 16 +- .../order-my-order-status-history.state.ts | 10 +- src/app/features/order/stores/order.state.ts | 2 +- ...nning-aip-downloaded-not-found.routable.ts | 4 +- .../preservation-planning-aip-status.state.ts | 18 +- ...ation-planning-aip-detail-guard.service.ts | 4 +- ...ervation-planning-deposit-list.routable.ts | 6 +- .../preservation-planning-deposit.state.ts | 16 +- ...n-planning-deposit-status-history.state.ts | 10 +- ...vation-planning-dip-form.presentational.ts | 8 +- ...ation-planning-dip-detail-edit.routable.ts | 18 +- ...preservation-planning-dip-file.routable.ts | 20 +- ...preservation-planning-dip-list.routable.ts | 6 +- ...ervation-planning-dip-metadata.routable.ts | 2 +- .../preservation-planning-dip-aip.state.ts | 10 +- ...eservation-planning-dip-data-file.state.ts | 24 +-- ...ning-dip-data-file-status-history.state.ts | 10 +- .../stores/preservation-planning-dip.state.ts | 28 +-- ...ation-planning-dip-status-history.state.ts | 10 +- ...n-planning-job-execution-list.container.ts | 20 +- ...-job-report-detail-error-message.dialog.ts | 2 +- ...ation-planning-job-report-detail.dialog.ts | 6 +- ...nning-job-execution-form.presentational.ts | 6 +- ...vation-planning-job-form.presentational.ts | 18 +- ...ation-planning-job-detail-edit.routable.ts | 10 +- ...-planning-job-execution-detail.routable.ts | 12 +- ...preservation-planning-job-list.routable.ts | 8 +- ...ion-planning-job-execution-report.state.ts | 16 +- ...eservation-planning-job-execution.state.ts | 16 +- .../stores/preservation-planning-job.state.ts | 36 ++-- ...-planning-monitoring-web-service.dialog.ts | 2 +- ...ation-planning-monitoring-home.routable.ts | 4 +- .../preservation-planning-monitoring.state.ts | 14 +- ...n-planning-monitoring-web-service.state.ts | 14 +- ...vation-planning-sip-form.presentational.ts | 6 +- ...vation-planning-sip-collection.routable.ts | 20 +- ...ation-planning-sip-detail-edit.routable.ts | 20 +- ...preservation-planning-sip-file.routable.ts | 20 +- ...preservation-planning-sip-list.routable.ts | 6 +- ...ervation-planning-sip-metadata.routable.ts | 2 +- ...servation-planning-sip-collection.state.ts | 16 +- ...ing-sip-collection-status-history.state.ts | 10 +- ...eservation-planning-sip-data-file.state.ts | 24 +-- ...ning-sip-data-file-status-history.state.ts | 10 +- .../stores/preservation-planning-sip.state.ts | 34 +-- ...ation-planning-sip-status-history.state.ts | 10 +- .../preservation-planning-order.state.ts | 10 +- ...ion-planning-order-status-history.state.ts | 10 +- .../stores/preservation-planning.state.ts | 2 +- ...on-space-aip-steward-not-found.routable.ts | 4 +- .../preservation-space-home.routable.ts | 26 ++- ...n-space-contributor-form.presentational.ts | 6 +- ...-space-contributor-detail-edit.routable.ts | 8 +- ...rvation-space-contributor-deposit.state.ts | 10 +- .../preservation-space-contributor.state.ts | 12 +- ...space-notification-detail-edit.routable.ts | 8 +- ...vation-space-notification-list.routable.ts | 6 +- .../preservation-space-notification.state.ts | 62 +++--- ...space-notification-status-history.state.ts | 10 +- ...ganizational-unit-request-access.dialog.ts | 2 +- ...al-unit-archive-acl-form.presentational.ts | 6 +- ...organizational-unit-form.presentational.ts | 24 +-- ...tional-unit-archive-acl-create.routable.ts | 6 +- ...l-unit-archive-acl-detail-edit.routable.ts | 14 +- ...zational-unit-archive-acl-list.routable.ts | 4 +- ...rganizational-unit-detail-edit.routable.ts | 8 +- ...space-organizational-unit-list.routable.ts | 18 +- ...e-organizational-unit-archive-acl.state.ts | 10 +- ...ational-unit-dissemination-policy.state.ts | 26 +-- ...e-organizational-unit-institution.state.ts | 10 +- ...e-organizational-unit-person-role.state.ts | 12 +- ...zational-unit-preservation-policy.state.ts | 26 +-- ...rvation-space-organizational-unit.state.ts | 44 ++-- ...nizational-unit-submission-policy.state.ts | 26 +-- .../stores/preservation-space.state.ts | 2 +- src/app/in-memory.storage.ts | 14 +- .../shared-archive-name.container.ts | 8 +- .../shared-avatar-upload-wrapper.container.ts | 8 +- ...ared-file-and-aip-information.container.ts | 24 +-- .../shared-logo-wrapper.container.ts | 10 +- ...ed-organizational-unit-member.container.ts | 6 +- ...ared-organizational-unit-name.container.ts | 8 +- .../shared-table-orgunit.container.ts | 16 +- ...red-table-person-orgunit-role.container.ts | 29 +-- .../shared-abstract-create-edit.dialog.ts | 22 +- .../shared-upload-image.dialog.ts | 2 +- ...in-research-domain-label.presentational.ts | 8 +- .../shared-aip-status-name.presentational.ts | 4 +- ...-aip-status-orgunit-name.presentational.ts | 4 +- ...hared-aip-status-summary.presentational.ts | 4 +- .../shared-avatar.presentational.ts | 6 +- ...ed-datafile-quick-status.presentational.ts | 20 +- .../shared-doi-menu.presentational.ts | 6 +- .../shared-folder-tree.presentational.ts | 32 +-- .../shared-avatar.presentational.ts | 6 +- ...shared-notification-form.presentational.ts | 8 +- .../shared-person-form.presentational.ts | 6 +- ...ed-preservation-duration.presentational.ts | 42 ++-- .../shared-aip-form.presentational.ts | 6 +- .../shared-aip-collection.routable.ts | 16 +- .../shared-aip-detail-edit.routable.ts | 28 +-- .../aip-file/shared-aip-file.routable.ts | 20 +- .../aip-list/shared-aip-list.routable.ts | 30 +-- .../shared-aip-metadata.routable.ts | 2 +- .../shared-aip-not-found.routable.ts | 6 +- .../aip-tabs/shared-aip-tabs.routable.ts | 18 +- .../shared-aip-collection.state.ts | 18 +- ...red-aip-collection-status-history.state.ts | 12 +- .../shared-aip-data-file.state.ts | 26 +-- ...ared-aip-data-file-status-history.state.ts | 12 +- .../shared-aip-organizational-unit.state.ts | 10 +- .../features/aip/stores/shared-aip.state.ts | 90 ++++---- .../shared-aip-status-history.state.ts | 12 +- .../application-maintenance-guard.service.ts | 4 +- .../guards/application-role-guard.service.ts | 2 +- .../shared/guards/archive-guard.service.ts | 8 +- .../deposit-role-guard-detail.service.ts | 6 +- .../guards/deposit-role-guard-edit.service.ts | 6 +- ...ational-unit-compute-is-manager.service.ts | 6 +- .../organizational-unit-role-guard.service.ts | 6 +- src/app/shared/pipes/translate-facet.pipe.ts | 2 +- .../services/mat-dialog-override.service.ts | 2 +- src/app/shared/services/orcid.service.ts | 4 +- src/app/shared/services/security.service.ts | 38 ++-- .../shared/services/store-dialog.service.ts | 2 +- .../shared/services/store-route.service.ts | 6 +- src/app/shared/shared.module.ts | 4 +- .../archive-acl/shared-archive-acl.state.ts | 10 +- .../archive-type/shared-archive-type.state.ts | 14 +- .../stores/archive/shared-archive.state.ts | 54 ++--- .../contributor/shared-contributor.state.ts | 10 +- .../stores/deposit/shared-deposit.state.ts | 10 +- .../shared-dissemination-policy.state.ts | 10 +- .../dlcm-resource/dlcm-resource.state.ts | 14 +- .../shared-funding-agency.state.ts | 10 +- .../shared-index-field-alias.state.ts | 10 +- .../institution/shared-institution.state.ts | 10 +- .../stores/language/shared-language.state.ts | 10 +- .../stores/license/shared-license.state.ts | 10 +- .../shared-metadata-type.state.ts | 10 +- .../notification/shared-notification.state.ts | 14 +- .../shared-oai-metadata-prefix.state.ts | 10 +- .../stores/oai-set/shared-oai-set.state.ts | 10 +- .../shared/stores/order/shared-order.state.ts | 10 +- ...ational.unit-dissemination-policy.state.ts | 10 +- ...zational-unit-preservation-policy.state.ts | 10 +- .../shared-organizational-unit.state.ts | 12 +- ...nizational-unit-submission-policy.state.ts | 10 +- .../stores/person/shared-person.state.ts | 30 +-- .../shared-preservation-policy.state.ts | 10 +- .../shared-research-domain.state.ts | 16 +- .../resource-logo/resource-logo.state.ts | 16 +- .../shared/stores/role/shared-role.state.ts | 10 +- src/app/shared/stores/shared.state.ts | 11 +- .../status-history/status-history.state.ts | 20 +- .../shared-submission-policy.state.ts | 10 +- .../shared/stores/user/shared-user.state.ts | 22 +- src/app/shared/utils/metadata.util.ts | 56 ++--- src/app/stores/app.state.ts | 2 +- .../archive-acl/app-archive-acl.state.ts | 10 +- ...pp-authorized-organizational-unit.state.ts | 10 +- src/app/stores/banner/app-banner.state.ts | 8 +- src/app/stores/carousel/app-carousel.state.ts | 14 +- src/app/stores/cart/app-cart.state.ts | 16 +- .../cart/archive/app-cart-archive.state.ts | 12 +- src/app/stores/cart/dip/app-cart-dip.state.ts | 20 +- .../data-file/app-cart-dip-data-file.state.ts | 14 +- .../stores/cart/order/app-cart-order.state.ts | 14 +- .../app-notification-inbox.state.ts | 10 +- src/app/stores/person/app-person.state.ts | 22 +- .../app-person-notification-type.state.ts | 10 +- .../app-system-property.state.ts | 12 +- src/app/stores/toc/app-toc.state.ts | 18 +- src/app/stores/user/app-user.state.ts | 12 +- src/test-helpers/activated-route-stub.ts | 6 +- 325 files changed, 2324 insertions(+), 2430 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 1a978846c..39dc3afde 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,7 +1,9 @@ module.exports = { - root: true, + extends: [ + "./node_modules/solidify-frontend/.eslintrc.js", + ], ignorePatterns: [ - "projects/**/*", + "node_modules/**/*", "src/app/generated-api" ], overrides: [ @@ -17,36 +19,9 @@ module.exports = { ], createDefaultProgram: true }, - extends: [ - "plugin:@angular-eslint/ng-cli-compat", - "plugin:@angular-eslint/ng-cli-compat--formatting-add-on", - "plugin:@angular-eslint/template/process-inline-templates", - ], - plugins: [ - "change-detection-strategy", - "solidify", - ], + extends: [], + plugins: [], rules: { - "solidify/copyright-header": ["error", - { - "file": "copyright-header.js", - "inceptionYear": "2017", - } - ], - "change-detection-strategy/on-push": "error", - "@angular-eslint/component-class-suffix": [ - "error", - { - "suffixes": [ - "AppComponent", - "Routable", - "Presentational", - "Container", - "Dialog", - "Form" - ] - } - ], "@angular-eslint/component-selector": [ "error", { @@ -55,7 +30,6 @@ module.exports = { "style": "kebab-case" } ], - "@angular-eslint/directive-class-suffix": "off", "@angular-eslint/directive-selector": [ "error", { @@ -64,144 +38,13 @@ module.exports = { "style": "camelCase" } ], - "@angular-eslint/no-input-rename": "off", - "@angular-eslint/no-output-on-prefix": "off", - "@angular-eslint/no-output-rename": "off", - "@typescript-eslint/array-type": [ - "error", - { - "default": "array" - } - ], - "@typescript-eslint/consistent-type-definitions": "error", - "@typescript-eslint/dot-notation": "off", - "@typescript-eslint/explicit-member-accessibility": [ - "off", - { - "accessibility": "explicit" - } - ], - "@typescript-eslint/member-delimiter-style": [ - "error", - { - "multiline": { - "delimiter": "semi", - "requireLast": true - }, - "singleline": { - "delimiter": "comma", - "requireLast": false - } - } - ], - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/naming-convention": [ - "warn", - { - "selector": "variable", - "format": [ - "camelCase", - "UPPER_CASE", - "snake_case", - "PascalCase" - ] - } - ], - "@typescript-eslint/no-empty-interface": "off", - "@typescript-eslint/no-namespace": [ - "off", - { - "allowDeclarations": true, - "allowDefinitionFiles": true - } - ], - "@typescript-eslint/no-inferrable-types": [ - "off", - { - "ignoreParameters": true - } - ], - "@typescript-eslint/quotes": [ - "error", - "double", - { - "allowTemplateLiterals": true - } - ], - "@typescript-eslint/semi": [ - "error" - ], - "@typescript-eslint/no-unused-expressions": [ - "error" - ], - "@typescript-eslint/explicit-function-return-type": [ - "error", - { - "allowExpressions": true, - } - ], - "arrow-body-style": [ - "error", - "as-needed" - ], - "brace-style": [ - "error", - "1tbs" - ], - "comma-dangle": [ - "error", - { - "arrays": "always-multiline", - "objects": "always-multiline", - "imports": "always-multiline", - "exports": "always-multiline", - "functions": "always-multiline" - } - ], - "complexity": [ - "error", - { - "max": 200 - } - ], - "import/no-deprecated": "off", - "jsdoc/no-types": "off", - "max-len": "off", - "no-console": [ - "error", - { - "allow": [ - "null" - ] - } - ], - "no-redeclare": "off", - "no-undef-init": "off", - "no-underscore-dangle": "off", - "no-mixed-spaces-and-tabs": [ - "error" - ], - "no-restricted-imports": [ - "error", - { - "paths": [], - "patterns": [ - "rxjs/Rx", - "@app/generated-api", - "**/generated-api" - ] - } - ], - "object-shorthand": "off" } }, { files: [ "*.html" ], - extends: [ - "plugin:@angular-eslint/template/recommended" - ], + extends: [], rules: {} } ] diff --git a/cypress/integration/test-helper.ts b/cypress/integration/test-helper.ts index bb1e710e3..1d6b4c429 100644 --- a/cypress/integration/test-helper.ts +++ b/cypress/integration/test-helper.ts @@ -18,7 +18,7 @@ import WaitXHR = Cypress.WaitXHR; export class TestHelper { static xhrBaseUrl: string = "http*://**/"; - private static waitAppReady(): void { + private static _waitAppReady(): void { cy.server(); this.waitXhr(ApiResourceNameEnum.SYSTEM_PROPERTY, () => cy.visit(cypressEnvironment.rootUrl)); cy.wait(250); // In some case app is not still init after the request to ApiResourceNameEnum.SYSTEM_PROPERTY @@ -47,7 +47,7 @@ export class TestHelper { } } - this.waitAppReady(); + this._waitAppReady(); if (isNotNullNorUndefined(token)) { return; @@ -62,7 +62,7 @@ export class TestHelper { static logout(): void { SessionStorageHelper.removeItem("access_token"); SessionStorageHelper.removeItem("refresh_token"); - this.waitAppReady(); + this._waitAppReady(); } static testData(dataTest: DataTestEnum): string { diff --git a/package-lock.json b/package-lock.json index 2aa2351af..d7c40014e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,7 +53,7 @@ "normalize.css": "8.0.1", "patch-package": "6.4.7", "rxjs": "7.5.2", - "solidify-frontend": "3.0.11", + "solidify-frontend": "../solidify-frontend/projects/solidify-frontend", "tiff.js": "1.0.0", "tslib": "2.3.1", "videojs-wavesurfer": "3.8.0", @@ -89,7 +89,8 @@ "eslint-plugin-import": "2.25.4", "eslint-plugin-jsdoc": "37.7.0", "eslint-plugin-prefer-arrow": "1.2.3", - "eslint-plugin-solidify": "0.0.1-to-remove", + "eslint-plugin-solidify": "../solidify-eslint-plugin/dist", + "eslint-plugin-unused-imports": "^2.0.0", "jasmine-core": "4.0.0", "jasmine-spec-reporter": "7.0.0", "karma": "6.3.13", @@ -111,6 +112,81 @@ "node": "^16.0.0" } }, + "../solidify-eslint-plugin": { + "name": "eslint-plugin-solidify", + "version": "1.0.0", + "dev": true, + "license": "GPL-2.0-or-later", + "devDependencies": { + "@types/eslint": "8.4.1", + "@types/estree": "0.0.39", + "@types/node": "17.0.14", + "@typescript-eslint/eslint-plugin": "5.10.2", + "@typescript-eslint/parser": "5.10.2", + "@typescript-eslint/utils": "5.12.1", + "eslint": "8.8.0", + "requireindex": "1.2.0", + "tsup": "5.11.13", + "typescript": "4.5.5" + } + }, + "../solidify-eslint-plugin/dist": { + "name": "eslint-plugin-solidify", + "version": "1.0.0", + "dev": true, + "license": "GPL-2.0-or-later", + "devDependencies": { + "@types/eslint": "8.4.1", + "@types/estree": "0.0.39", + "@types/node": "17.0.14", + "@typescript-eslint/eslint-plugin": "5.10.2", + "@typescript-eslint/parser": "5.10.2", + "@typescript-eslint/utils": "5.12.1", + "eslint": "8.8.0", + "standard-version": "9.3.2", + "typescript": "4.5.5" + } + }, + "../solidify-frontend/projects/solidify-frontend": { + "version": "3.0.11", + "license": "GPL-2.0-or-later", + "devDependencies": { + "standard-version": "^9.3.2" + }, + "engines": { + "node": "^16.0.0" + }, + "peerDependencies": { + "@angular-devkit/core": "^13.2.1", + "@angular/animations": "^13.2.1", + "@angular/cdk": "^13.2.1", + "@angular/common": "^13.2.1", + "@angular/compiler": "^13.2.1", + "@angular/core": "^13.2.1", + "@angular/forms": "^13.2.1", + "@angular/material": "^13.2.1", + "@angular/platform-browser": "^13.2.1", + "@angular/platform-browser-dynamic": "^13.2.1", + "@angular/router": "^13.2.1", + "@angular/service-worker": "^13.2.1", + "@elastic/apm-rum-angular": "2.1.3", + "@ngx-translate/core": "^14.0.0", + "@ngxs/router-plugin": "^3.7.3", + "@ngxs/store": "^3.7.3", + "change-case": "^4.1.2", + "core-js": "^3.21.0", + "docx-preview": "0.1.8", + "moment": "^2.29.1", + "ng2-pdf-viewer": "7.0.2", + "ngx-cookie": "5.0.2", + "ngx-highlightjs": "6.1.1", + "rxjs": "^7.5.2", + "tiff.js": "1.0.0", + "videojs-wavesurfer": "3.8.0", + "wavesurfer.js": "5.2.0", + "zone.js": "^0.11.4" + } + }, "node_modules/@75lb/deep-merge": { "version": "1.1.1", "resolved": "https://nexus.unige.ch/repository/npm-all/@75lb/deep-merge/-/deep-merge-1.1.1.tgz", @@ -10329,11 +10405,40 @@ } }, "node_modules/eslint-plugin-solidify": { - "version": "0.0.1-to-remove", - "resolved": "https://nexus.unige.ch/repository/npm-all/eslint-plugin-solidify/-/eslint-plugin-solidify-0.0.1-to-remove.tgz", - "integrity": "sha512-OwFYkpBtbw2ivzhBjxjHSY2RrbELzf4hGHzgAhP3kv5nzmzr4QEsv5rjLPAVc+6TKjDhJbNqkWqyeR1M8m7M4g==", + "resolved": "../solidify-eslint-plugin/dist", + "link": true + }, + "node_modules/eslint-plugin-unused-imports": { + "version": "2.0.0", + "resolved": "https://nexus.unige.ch/repository/npm-all/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-2.0.0.tgz", + "integrity": "sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-rule-composer": "^0.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^5.0.0", + "eslint": "^8.0.0" + }, + "peerDependenciesMeta": { + "@typescript-eslint/eslint-plugin": { + "optional": true + } + } + }, + "node_modules/eslint-rule-composer": { + "version": "0.3.0", + "resolved": "https://nexus.unige.ch/repository/npm-all/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz", + "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==", "dev": true, - "license": "GPL-2.0-or-later" + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } }, "node_modules/eslint-scope": { "version": "5.1.1", @@ -19565,46 +19670,8 @@ } }, "node_modules/solidify-frontend": { - "version": "3.0.11", - "resolved": "https://nexus.unige.ch/repository/npm-all/solidify-frontend/-/solidify-frontend-3.0.11.tgz", - "integrity": "sha512-KuudEWh7huyE+qovYspiCOvuCxEfaEvHF8yuqKSia495Lv7+O3mMgFwS4uPW3VqKVavUaT36ZyVSHXGKK22k8Q==", - "license": "GPL-2.0-or-later", - "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": "^16.0.0" - }, - "peerDependencies": { - "@angular-devkit/core": "^13.2.1", - "@angular/animations": "^13.2.1", - "@angular/cdk": "^13.2.1", - "@angular/common": "^13.2.1", - "@angular/compiler": "^13.2.1", - "@angular/core": "^13.2.1", - "@angular/forms": "^13.2.1", - "@angular/material": "^13.2.1", - "@angular/platform-browser": "^13.2.1", - "@angular/platform-browser-dynamic": "^13.2.1", - "@angular/router": "^13.2.1", - "@angular/service-worker": "^13.2.1", - "@elastic/apm-rum-angular": "2.1.3", - "@ngx-translate/core": "^14.0.0", - "@ngxs/router-plugin": "^3.7.3", - "@ngxs/store": "^3.7.3", - "change-case": "^4.1.2", - "core-js": "^3.21.0", - "docx-preview": "0.1.8", - "moment": "^2.29.1", - "ng2-pdf-viewer": "7.0.2", - "ngx-cookie": "5.0.2", - "ngx-highlightjs": "6.1.1", - "rxjs": "^7.5.2", - "tiff.js": "1.0.0", - "videojs-wavesurfer": "3.8.0", - "wavesurfer.js": "5.2.0", - "zone.js": "^0.11.4" - } + "resolved": "../solidify-frontend/projects/solidify-frontend", + "link": true }, "node_modules/source-map": { "version": "0.7.3", @@ -29389,9 +29456,32 @@ "requires": {} }, "eslint-plugin-solidify": { - "version": "0.0.1-to-remove", - "resolved": "https://nexus.unige.ch/repository/npm-all/eslint-plugin-solidify/-/eslint-plugin-solidify-0.0.1-to-remove.tgz", - "integrity": "sha512-OwFYkpBtbw2ivzhBjxjHSY2RrbELzf4hGHzgAhP3kv5nzmzr4QEsv5rjLPAVc+6TKjDhJbNqkWqyeR1M8m7M4g==", + "version": "file:../solidify-eslint-plugin/dist", + "requires": { + "@types/eslint": "8.4.1", + "@types/estree": "0.0.39", + "@types/node": "17.0.14", + "@typescript-eslint/eslint-plugin": "5.10.2", + "@typescript-eslint/parser": "5.10.2", + "@typescript-eslint/utils": "5.12.1", + "eslint": "8.8.0", + "standard-version": "9.3.2", + "typescript": "4.5.5" + } + }, + "eslint-plugin-unused-imports": { + "version": "2.0.0", + "resolved": "https://nexus.unige.ch/repository/npm-all/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-2.0.0.tgz", + "integrity": "sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==", + "dev": true, + "requires": { + "eslint-rule-composer": "^0.3.0" + } + }, + "eslint-rule-composer": { + "version": "0.3.0", + "resolved": "https://nexus.unige.ch/repository/npm-all/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz", + "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==", "dev": true }, "eslint-scope": { @@ -35767,11 +35857,9 @@ } }, "solidify-frontend": { - "version": "3.0.11", - "resolved": "https://nexus.unige.ch/repository/npm-all/solidify-frontend/-/solidify-frontend-3.0.11.tgz", - "integrity": "sha512-KuudEWh7huyE+qovYspiCOvuCxEfaEvHF8yuqKSia495Lv7+O3mMgFwS4uPW3VqKVavUaT36ZyVSHXGKK22k8Q==", + "version": "file:../solidify-frontend/projects/solidify-frontend", "requires": { - "tslib": "^2.3.0" + "standard-version": "^9.3.2" } }, "source-map": { diff --git a/package.json b/package.json index 9b07fcf2c..13dba10e8 100644 --- a/package.json +++ b/package.json @@ -130,10 +130,11 @@ "esbuild": "0.14.18", "eslint": "8.8.0", "eslint-plugin-change-detection-strategy": "0.1.1", - "eslint-plugin-solidify": "0.0.1-to-remove", "eslint-plugin-import": "2.25.4", "eslint-plugin-jsdoc": "37.7.0", "eslint-plugin-prefer-arrow": "1.2.3", + "eslint-plugin-solidify": "0.0.2", + "eslint-plugin-unused-imports": "2.0.0", "jasmine-core": "4.0.0", "jasmine-spec-reporter": "7.0.0", "karma": "6.3.13", @@ -142,9 +143,9 @@ "karma-jasmine": "4.0.1", "karma-jasmine-html-reporter": "1.7.0", "karma-junit-reporter": "2.0.1", + "license-checker-rseidelsohn": "3.1.0", "local-web-server": "5.1.1", "ngx-translate-extract-csv": "1.1.1", - "license-checker-rseidelsohn": "3.1.0", "protractor": "7.0.0", "ts-loader": "9.2.6", "ts-node": "10.4.0", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index b14044613..9c273030d 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -124,7 +124,6 @@ export class AppComponent extends AbstractAppComponent { public readonly breakpointService: BreakpointService, protected readonly _dialog: MatDialog, public readonly tourService: TourService, - protected readonly router: Router, protected readonly _scrollService: ScrollService, protected readonly _googleAnalyticsService: GoogleAnalyticsService, protected readonly _cookieConsentService: CookieConsentService, @@ -142,24 +141,23 @@ export class AppComponent extends AbstractAppComponent { appStatusService, breakpointService, _dialog, - router, _scrollService, _googleAnalyticsService, _cookieConsentService, ); this._listenCurrentModule(); - this.subscribe(this.observeLoggedUserForCart()); - this.checkOrcidQueryParam(); + this.subscribe(this._observeLoggedUserForCart()); + this._checkOrcidQueryParam(); } - private observeLoggedUserForCart(): Observable<boolean> { + private _observeLoggedUserForCart(): Observable<boolean> { return combineLatest([this.isLoggedObs, this.userRolesObs]) .pipe( map(([isLogged, userRoles]) => this.computeDisplayCart(isLogged, userRoles)), ); } - private checkOrcidQueryParam(): void { + private _checkOrcidQueryParam(): void { if (UrlQueryParamHelper.contains(environment.orcidQueryParam)) { this.subscribe(this.currentUserObs.pipe( filter(user => isNotNullNorUndefined(user)), diff --git a/src/app/components/dialogs/user/user.dialog.ts b/src/app/components/dialogs/user/user.dialog.ts index 8875ced7d..ce5b17842 100644 --- a/src/app/components/dialogs/user/user.dialog.ts +++ b/src/app/components/dialogs/user/user.dialog.ts @@ -92,7 +92,7 @@ export class UserDialog extends SharedAbstractDialog<User, Person> implements On constructor(protected readonly _store: Store, protected readonly _dialogRef: MatDialogRef<UserDialog>, - @Inject(MAT_DIALOG_DATA) public user: User, + @Inject(MAT_DIALOG_DATA) public readonly user: User, protected readonly _actions$: Actions, protected readonly _securityService: SecurityService) { super(_dialogRef, user); diff --git a/src/app/components/presentationals/main-toolbar/abstract-main-toolbar/abstract-main-toolbar.presentational.ts b/src/app/components/presentationals/main-toolbar/abstract-main-toolbar/abstract-main-toolbar.presentational.ts index 0aa58384e..e3e34e6f7 100644 --- a/src/app/components/presentationals/main-toolbar/abstract-main-toolbar/abstract-main-toolbar.presentational.ts +++ b/src/app/components/presentationals/main-toolbar/abstract-main-toolbar/abstract-main-toolbar.presentational.ts @@ -47,7 +47,6 @@ import { Observable, } from "rxjs"; import { - OAuth2Service, ObservableUtil, SOLIDIFY_CONSTANTS, } from "solidify-frontend"; @@ -81,7 +80,7 @@ export abstract class AbstractMainToolbarPresentational extends SharedAbstractPr numberPendingRequestNotificationInbox: number = 0; @Input() - private userRoles: Enums.UserApplicationRole.UserApplicationRoleEnum[]; + userRoles: Enums.UserApplicationRole.UserApplicationRoleEnum[]; // Theme private readonly _themeBS: BehaviorSubject<ThemeEnum | undefined> = new BehaviorSubject<ThemeEnum | undefined>(undefined); @@ -130,7 +129,7 @@ export abstract class AbstractMainToolbarPresentational extends SharedAbstractPr @Output("loginChange") readonly loginObs: Observable<void | undefined> = ObservableUtil.asObservable(this._loginBS); - private listMenus: MenuToolbar[] = [ + private _listMenus: MenuToolbar[] = [ { click: (menu) => this.navigate(menu.path()), path: () => RoutesEnum.homePage, @@ -178,7 +177,7 @@ export abstract class AbstractMainToolbarPresentational extends SharedAbstractPr }, ]; - private listMenusAdmin: MenuToolbar[] = [ + private _listMenusAdmin: MenuToolbar[] = [ { click: (menu) => this.navigate(menu.path()), path: () => RoutesEnum.preservationPlanning, @@ -207,16 +206,12 @@ export abstract class AbstractMainToolbarPresentational extends SharedAbstractPr return TourEnum; } - protected constructor(private oauthService: OAuth2Service) { - super(); - } - getListMenuUser(): MenuToolbar[] { - return this.listMenus.filter(m => m.isVisible()); + return this._listMenus.filter(m => m.isVisible()); } getListMenuAdmin(): MenuToolbar[] { - return this.listMenusAdmin.filter(m => m.isVisible()); + return this._listMenusAdmin.filter(m => m.isVisible()); } getListMenuUserAndAdminMenu(): MenuToolbar[] { diff --git a/src/app/components/presentationals/main-toolbar/main-toolbar-desktop-horizontal/main-toolbar-desktop-horizontal.presentational.ts b/src/app/components/presentationals/main-toolbar/main-toolbar-desktop-horizontal/main-toolbar-desktop-horizontal.presentational.ts index 3a64b1dcf..cf3d0a2d0 100644 --- a/src/app/components/presentationals/main-toolbar/main-toolbar-desktop-horizontal/main-toolbar-desktop-horizontal.presentational.ts +++ b/src/app/components/presentationals/main-toolbar/main-toolbar-desktop-horizontal/main-toolbar-desktop-horizontal.presentational.ts @@ -35,7 +35,6 @@ import { } from "rxjs"; import { BreakpointService, - OAuth2Service, ObservableUtil, } from "solidify-frontend"; @@ -63,9 +62,8 @@ export class MainToolbarDesktopHorizontalPresentational extends AbstractMainTool @Output("searchChange") readonly searchObs: Observable<string | undefined> = ObservableUtil.asObservable(this._searchBS); - constructor(private oauth: OAuth2Service, - public breakpointService: BreakpointService) { - super(oauth); + constructor(public readonly breakpointService: BreakpointService) { + super(); } navigateToHome(): void { diff --git a/src/app/components/presentationals/main-toolbar/main-toolbar-mobile/main-toolbar-mobile.presentational.ts b/src/app/components/presentationals/main-toolbar/main-toolbar-mobile/main-toolbar-mobile.presentational.ts index 4462b8852..f3c822f24 100644 --- a/src/app/components/presentationals/main-toolbar/main-toolbar-mobile/main-toolbar-mobile.presentational.ts +++ b/src/app/components/presentationals/main-toolbar/main-toolbar-mobile/main-toolbar-mobile.presentational.ts @@ -34,7 +34,6 @@ import { } from "@angular/core"; import {AbstractMainToolbarPresentational} from "@app/components/presentationals/main-toolbar/abstract-main-toolbar/abstract-main-toolbar.presentational"; import {AppUtil} from "@app/shared/utils/app.util"; -import {OAuth2Service} from "solidify-frontend"; @Component({ selector: "dlcm-main-toolbar-mobile", @@ -54,10 +53,6 @@ export class MainToolbarMobilePresentational extends AbstractMainToolbarPresenta return AppUtil; } - constructor(private oauth: OAuth2Service) { - super(oauth); - } - override navigate(path: string): void { super.navigate(path); this.toggleMenu(); diff --git a/src/app/components/presentationals/user-form/user-form.presentational.ts b/src/app/components/presentationals/user-form/user-form.presentational.ts index baf29e33e..75e7dcfb5 100644 --- a/src/app/components/presentationals/user-form/user-form.presentational.ts +++ b/src/app/components/presentationals/user-form/user-form.presentational.ts @@ -73,7 +73,7 @@ export class UserFormPresentational extends AbstractFormPresentational<User> { super(_changeDetectorRef, _elementRef, _injector); } - protected bindFormTo(user: User): void { + protected _bindFormTo(user: User): void { this.form = this._fb.group({ [this.formDefinition.externalUid]: [user.externalUid, [Validators.required, SolidifyValidator]], [this.formDefinition.firstName]: [user.firstName, [Validators.required, SolidifyValidator]], @@ -87,7 +87,7 @@ export class UserFormPresentational extends AbstractFormPresentational<User> { }); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.externalUid]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.firstName]: ["", [Validators.required, SolidifyValidator]], @@ -101,7 +101,7 @@ export class UserFormPresentational extends AbstractFormPresentational<User> { }); } - protected treatmentBeforeSubmit(user: User): User { + protected _treatmentBeforeSubmit(user: User): User { return user; } @@ -109,7 +109,7 @@ export class UserFormPresentational extends AbstractFormPresentational<User> { return this.form.controls.applicationRoles.value as FormArray; } - protected override disableSpecificField(): void { + protected override _disableSpecificField(): void { this.form.get(this.formDefinition.homeOrganization).disable(); } } diff --git a/src/app/components/presentationals/user-menu/user-menu.presentational.ts b/src/app/components/presentationals/user-menu/user-menu.presentational.ts index 0c1b3998a..fd85d5450 100644 --- a/src/app/components/presentationals/user-menu/user-menu.presentational.ts +++ b/src/app/components/presentationals/user-menu/user-menu.presentational.ts @@ -83,9 +83,9 @@ export class UserMenuPresentational extends SharedAbstractPresentational { @Input() listMenuAdmin: MenuToolbar[]; - private readonly DEFAULT_INITIAL: string = "U"; + private readonly _DEFAULT_INITIAL: string = "U"; - initial: string = this.DEFAULT_INITIAL; + initial: string = this._DEFAULT_INITIAL; // Logout private readonly _logoutBS: BehaviorSubject<void | undefined> = new BehaviorSubject<void | undefined>(undefined); @@ -100,7 +100,7 @@ export class UserMenuPresentational extends SharedAbstractPresentational { @Output("themeChange") readonly themeChangeObs: Observable<ThemeEnum | undefined> = ObservableUtil.asObservable(this._themeChangeBS); - constructor(private dialog: MatDialog) { + constructor(private readonly _dialog: MatDialog) { super(); } @@ -109,7 +109,7 @@ export class UserMenuPresentational extends SharedAbstractPresentational { } displayToken(): void { - DialogUtil.open(this.dialog, TokenDialog, { + DialogUtil.open(this._dialog, TokenDialog, { extraInformation: [ { key: LabelTranslateEnum.role, @@ -120,7 +120,7 @@ export class UserMenuPresentational extends SharedAbstractPresentational { } profileInfo(): void { - DialogUtil.open(this.dialog, UserDialog, this.user, { + DialogUtil.open(this._dialog, UserDialog, this.user, { width: "90%", }); } diff --git a/src/app/features/admin/archive-acl/components/presentationals/admin-archive-acl-form/admin-archive-acl-form.presentational.ts b/src/app/features/admin/archive-acl/components/presentationals/admin-archive-acl-form/admin-archive-acl-form.presentational.ts index aeda0af2c..885e3e7e7 100644 --- a/src/app/features/admin/archive-acl/components/presentationals/admin-archive-acl-form/admin-archive-acl-form.presentational.ts +++ b/src/app/features/admin/archive-acl/components/presentationals/admin-archive-acl-form/admin-archive-acl-form.presentational.ts @@ -110,7 +110,7 @@ export class AdminArchiveAclFormPresentational extends AbstractFormPresentationa super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.aipId]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.organizationalUnitId]: ["", [Validators.required, SolidifyValidator]], @@ -119,7 +119,7 @@ export class AdminArchiveAclFormPresentational extends AbstractFormPresentationa }); } - protected bindFormTo(archiveAcl: ArchiveACL): void { + protected _bindFormTo(archiveAcl: ArchiveACL): void { this.form = this._fb.group({ [this.formDefinition.aipId]: [archiveAcl.aipId, [Validators.required, SolidifyValidator]], [this.formDefinition.organizationalUnitId]: [archiveAcl.organizationalUnit.resId, [Validators.required, SolidifyValidator]], @@ -159,7 +159,7 @@ export class AdminArchiveAclFormPresentational extends AbstractFormPresentationa formControl.updateValueAndValidity(); } - protected treatmentBeforeSubmit(archiveAcl: ArchiveACL): ArchiveACL { + protected _treatmentBeforeSubmit(archiveAcl: ArchiveACL): ArchiveACL { return { resId: archiveAcl.resId, aipId: this.form.get(this.formDefinition.aipId).value, diff --git a/src/app/features/admin/archive-acl/components/routables/admin-archive-acl-detail-edit/admin-archive-acl-detail-edit.routable.ts b/src/app/features/admin/archive-acl/components/routables/admin-archive-acl-detail-edit/admin-archive-acl-detail-edit.routable.ts index d8c187b30..cac5c766e 100644 --- a/src/app/features/admin/archive-acl/components/routables/admin-archive-acl-detail-edit/admin-archive-acl-detail-edit.routable.ts +++ b/src/app/features/admin/archive-acl/components/routables/admin-archive-acl-detail-edit/admin-archive-acl-detail-edit.routable.ts @@ -56,15 +56,15 @@ export class AdminArchiveAclDetailEditRoutable extends AbstractDetailEditCommonR readonly KEY_PARAM_NAME: keyof ArchiveACL & string = "aipId"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_archiveAcl, _injector, adminArchiveAclActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/admin/archive-acl/stores/admin-archive-acl.state.ts b/src/app/features/admin/archive-acl/stores/admin-archive-acl.state.ts index f733ee540..3cea94ee7 100644 --- a/src/app/features/admin/archive-acl/stores/admin-archive-acl.state.ts +++ b/src/app/features/admin/archive-acl/stores/admin-archive-acl.state.ts @@ -59,11 +59,11 @@ export interface AdminArchiveAclStateModel extends ResourceStateModel<ArchiveACL children: [], }) export class AdminArchiveAclState extends ResourceState<AdminArchiveAclStateModel, ArchiveACL> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminArchiveAclActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminArchiveAclDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminArchiveAclDetail + urlSeparator + resId, diff --git a/src/app/features/admin/archive-type/components/routables/admin-archive-type-detail-edit/admin-archive-type-detail-edit.routable.ts b/src/app/features/admin/archive-type/components/routables/admin-archive-type-detail-edit/admin-archive-type-detail-edit.routable.ts index 0c10d413d..d2b923263 100644 --- a/src/app/features/admin/archive-type/components/routables/admin-archive-type-detail-edit/admin-archive-type-detail-edit.routable.ts +++ b/src/app/features/admin/archive-type/components/routables/admin-archive-type-detail-edit/admin-archive-type-detail-edit.routable.ts @@ -62,11 +62,11 @@ export class AdminArchiveTypeDetailEditRoutable extends AbstractDetailEditCommon readonly KEY_PARAM_NAME: keyof ArchiveType & string = "typeName"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_archiveType, _injector, adminArchiveTypeActionNameSpace, StateEnum.admin); } diff --git a/src/app/features/admin/archive-type/stores/admin-archive-type.state.ts b/src/app/features/admin/archive-type/stores/admin-archive-type.state.ts index 3b24054ab..e3f24c02b 100644 --- a/src/app/features/admin/archive-type/stores/admin-archive-type.state.ts +++ b/src/app/features/admin/archive-type/stores/admin-archive-type.state.ts @@ -73,11 +73,11 @@ export interface AdminArchiveTypeStateModel extends ResourceStateModel<ArchiveTy }, }) export class AdminArchiveTypeState extends ResourceState<AdminArchiveTypeStateModel, ArchiveType> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminArchiveTypeActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminArchiveTypeDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminArchiveTypeDetail + urlSeparator + resId, @@ -131,15 +131,15 @@ export class AdminArchiveTypeState extends ResourceState<AdminArchiveTypeStateMo { action: new SharedArchiveTypeAction.GetListMasterTypes(), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedArchiveTypeAction.GetListMasterTypesSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedArchiveTypeAction.GetListMasterTypesFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedArchiveTypeAction.GetListMasterTypesSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedArchiveTypeAction.GetListMasterTypesFail)), ], }, { action: new SharedArchiveTypeAction.GetListMasterTypesNames(), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedArchiveTypeAction.GetListMasterTypesNamesSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedArchiveTypeAction.GetListMasterTypesNamesFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedArchiveTypeAction.GetListMasterTypesNamesSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedArchiveTypeAction.GetListMasterTypesNamesFail)), ], }, ]).pipe( diff --git a/src/app/features/admin/dissemination-policy/components/presentationals/admin-dissemination-policy-form/admin-dissemination-policy-form.presentational.ts b/src/app/features/admin/dissemination-policy/components/presentationals/admin-dissemination-policy-form/admin-dissemination-policy-form.presentational.ts index 0763140d7..3aed5bc04 100644 --- a/src/app/features/admin/dissemination-policy/components/presentationals/admin-dissemination-policy-form/admin-dissemination-policy-form.presentational.ts +++ b/src/app/features/admin/dissemination-policy/components/presentationals/admin-dissemination-policy-form/admin-dissemination-policy-form.presentational.ts @@ -70,7 +70,7 @@ export class AdminDisseminationPolicyFormPresentational extends AbstractFormPres super(_changeDetectorRef, _elementRef, _injector); } - protected bindFormTo(disseminationPolicies: DisseminationPolicy): void { + protected _bindFormTo(disseminationPolicies: DisseminationPolicy): void { this.form = this._fb.group({ [this.formDefinition.name]: [disseminationPolicies.name, [Validators.required, SolidifyValidator]], [this.formDefinition.destinationServer]: [disseminationPolicies.destinationServer, [SolidifyValidator]], @@ -79,7 +79,7 @@ export class AdminDisseminationPolicyFormPresentational extends AbstractFormPres }); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.name]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.destinationServer]: ["", [Validators.required, SolidifyValidator]], @@ -88,7 +88,7 @@ export class AdminDisseminationPolicyFormPresentational extends AbstractFormPres }); } - protected treatmentBeforeSubmit(disseminationPolicies: DisseminationPolicy): DisseminationPolicy { + protected _treatmentBeforeSubmit(disseminationPolicies: DisseminationPolicy): DisseminationPolicy { return disseminationPolicies; } diff --git a/src/app/features/admin/dissemination-policy/components/routables/admin-dissemination-policy-detail-edit/admin-dissemination-policy-detail-edit.routable.ts b/src/app/features/admin/dissemination-policy/components/routables/admin-dissemination-policy-detail-edit/admin-dissemination-policy-detail-edit.routable.ts index 67629adcf..1ea44056e 100644 --- a/src/app/features/admin/dissemination-policy/components/routables/admin-dissemination-policy-detail-edit/admin-dissemination-policy-detail-edit.routable.ts +++ b/src/app/features/admin/dissemination-policy/components/routables/admin-dissemination-policy-detail-edit/admin-dissemination-policy-detail-edit.routable.ts @@ -56,15 +56,15 @@ export class AdminDisseminationPolicyDetailEditRoutable extends AbstractDetailEd readonly KEY_PARAM_NAME: keyof DisseminationPolicy & string = "name"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_disseminationPolicy, _injector, adminDisseminationPolicyActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/admin/dissemination-policy/stores/admin-dissemination-policy.state.ts b/src/app/features/admin/dissemination-policy/stores/admin-dissemination-policy.state.ts index 824c4f943..3899e3dc3 100644 --- a/src/app/features/admin/dissemination-policy/stores/admin-dissemination-policy.state.ts +++ b/src/app/features/admin/dissemination-policy/stores/admin-dissemination-policy.state.ts @@ -58,11 +58,11 @@ export interface AdminDisseminationPolicyStateModel extends ResourceStateModel<D }, }) export class AdminDisseminationPolicyState extends ResourceState<AdminDisseminationPolicyStateModel, DisseminationPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminDisseminationPolicyActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminDisseminationPolicyDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminDisseminationPolicyDetail + urlSeparator + resId, diff --git a/src/app/features/admin/funding-agencies/components/presentationals/admin-funding-agencies-form/admin-funding-agencies-form.presentational.ts b/src/app/features/admin/funding-agencies/components/presentationals/admin-funding-agencies-form/admin-funding-agencies-form.presentational.ts index 0cadae2ae..7750003d7 100644 --- a/src/app/features/admin/funding-agencies/components/presentationals/admin-funding-agencies-form/admin-funding-agencies-form.presentational.ts +++ b/src/app/features/admin/funding-agencies/components/presentationals/admin-funding-agencies-form/admin-funding-agencies-form.presentational.ts @@ -79,7 +79,7 @@ export class AdminFundingAgenciesFormPresentational extends AbstractFormPresenta super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.acronym]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.name]: ["", [Validators.required, SolidifyValidator]], @@ -89,7 +89,7 @@ export class AdminFundingAgenciesFormPresentational extends AbstractFormPresenta }); } - protected bindFormTo(fundingAgency: FundingAgency): void { + protected _bindFormTo(fundingAgency: FundingAgency): void { this.form = this._fb.group({ [this.formDefinition.acronym]: [fundingAgency.acronym, [Validators.required, SolidifyValidator]], [this.formDefinition.name]: [fundingAgency.name, [Validators.required, SolidifyValidator]], @@ -99,7 +99,7 @@ export class AdminFundingAgenciesFormPresentational extends AbstractFormPresenta }); } - protected treatmentBeforeSubmit(fundingAgency: FundingAgency): FundingAgency { + protected _treatmentBeforeSubmit(fundingAgency: FundingAgency): FundingAgency { fundingAgency.organizationalUnits = []; const listOrgUnitId = this.form.get(this.formDefinition.organizationalUnits).value; if (!isNullOrUndefined(listOrgUnitId)) { diff --git a/src/app/features/admin/funding-agencies/components/routables/admin-funding-agencies-detail-edit/admin-funding-agencies-detail-edit.routable.ts b/src/app/features/admin/funding-agencies/components/routables/admin-funding-agencies-detail-edit/admin-funding-agencies-detail-edit.routable.ts index ec1a06d1c..50fe1adf4 100644 --- a/src/app/features/admin/funding-agencies/components/routables/admin-funding-agencies-detail-edit/admin-funding-agencies-detail-edit.routable.ts +++ b/src/app/features/admin/funding-agencies/components/routables/admin-funding-agencies-detail-edit/admin-funding-agencies-detail-edit.routable.ts @@ -71,16 +71,16 @@ export class AdminFundingAgenciesDetailEditRoutable extends AbstractDetailEditCo readonly KEY_PARAM_NAME: keyof FundingAgency & string = "name"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_fundingAgencies, _injector, adminFundingAgenciesActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new AdminFundingAgenciesOrgUnitAction.GetAll(id)); } } diff --git a/src/app/features/admin/funding-agencies/stores/admin-funding-agencies.state.ts b/src/app/features/admin/funding-agencies/stores/admin-funding-agencies.state.ts index 0b3b12e8e..e3cc094b4 100644 --- a/src/app/features/admin/funding-agencies/stores/admin-funding-agencies.state.ts +++ b/src/app/features/admin/funding-agencies/stores/admin-funding-agencies.state.ts @@ -89,11 +89,11 @@ export interface AdminFundingAgenciesStateModel extends ResourceStateModel<Fundi ], }) export class AdminFundingAgenciesState extends ResourceState<AdminFundingAgenciesStateModel, FundingAgency> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminFundingAgenciesActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminFundingAgenciesDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminFundingAgenciesDetail + urlSeparator + resId, @@ -149,8 +149,8 @@ export class AdminFundingAgenciesState extends ResourceState<AdminFundingAgencie { action: new SharedOrgUnitAction.GetAll(undefined, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedOrgUnitAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedOrgUnitAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedOrgUnitAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedOrgUnitAction.GetAllFail)), ], }, ]).pipe( @@ -168,10 +168,10 @@ export class AdminFundingAgenciesState extends ResourceState<AdminFundingAgencie @OverrideDefaultAction() @Action(AdminFundingAgenciesAction.Create) create(ctx: StateContext<AdminFundingAgenciesStateModel>, action: AdminFundingAgenciesAction.Create): Observable<FundingAgency> { - return super.internalCreate(ctx, action) + return super._internalCreate(ctx, action) .pipe( tap(model => { - this.updateSubResource(model, action, ctx) + this._updateSubResource(model, action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new AdminFundingAgenciesAction.CreateSuccess(action, model)); @@ -186,10 +186,10 @@ export class AdminFundingAgenciesState extends ResourceState<AdminFundingAgencie @OverrideDefaultAction() @Action(AdminFundingAgenciesAction.Update) update(ctx: StateContext<AdminFundingAgenciesStateModel>, action: AdminFundingAgenciesAction.Update): Observable<FundingAgency> { - return super.internalUpdate(ctx, action) + return super._internalUpdate(ctx, action) .pipe( tap(model => { - this.updateSubResource(model, action, ctx) + this._updateSubResource(model, action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new AdminFundingAgenciesAction.UpdateSuccess(action, model)); @@ -201,15 +201,15 @@ export class AdminFundingAgenciesState extends ResourceState<AdminFundingAgencie ); } - private updateSubResource(model: FundingAgency, action: AdminFundingAgenciesAction.Create | AdminFundingAgenciesAction.Update, ctx: StateContext<AdminFundingAgenciesStateModel>): Observable<boolean> { + private _updateSubResource(model: FundingAgency, action: AdminFundingAgenciesAction.Create | AdminFundingAgenciesAction.Update, ctx: StateContext<AdminFundingAgenciesStateModel>): Observable<boolean> { const fundingAgencyId = model.resId; const newOrgUnit = action.modelFormControlEvent.model.organizationalUnits.map(o => o.resId); return StoreUtil.dispatchParallelActionAndWaitForSubActionsCompletion(ctx, [{ action: new AdminFundingAgenciesOrgUnitAction.Update(fundingAgencyId, newOrgUnit), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(AdminFundingAgenciesOrgUnitAction.UpdateSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AdminFundingAgenciesOrgUnitAction.UpdateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminFundingAgenciesOrgUnitAction.UpdateSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminFundingAgenciesOrgUnitAction.UpdateFail)), ], }]).pipe( map(result => result.success), @@ -227,8 +227,8 @@ export class AdminFundingAgenciesState extends ResourceState<AdminFundingAgencie { action: new adminFundingAgenciesOrgUnitActionNameSpace.DeleteList(action.resId, oldOrgUnit), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(adminFundingAgenciesOrgUnitActionNameSpace.DeleteListSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(adminFundingAgenciesOrgUnitActionNameSpace.DeleteListFail)), + this._actions$.pipe(ofSolidifyActionCompleted(adminFundingAgenciesOrgUnitActionNameSpace.DeleteListSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(adminFundingAgenciesOrgUnitActionNameSpace.DeleteListFail)), ], }, ], diff --git a/src/app/features/admin/funding-agencies/stores/organizational-unit/admin-organizational-unit-funding-agencies.state.ts b/src/app/features/admin/funding-agencies/stores/organizational-unit/admin-organizational-unit-funding-agencies.state.ts index dbeae92dd..8a0ee8e8d 100644 --- a/src/app/features/admin/funding-agencies/stores/organizational-unit/admin-organizational-unit-funding-agencies.state.ts +++ b/src/app/features/admin/funding-agencies/stores/organizational-unit/admin-organizational-unit-funding-agencies.state.ts @@ -52,11 +52,11 @@ export interface AdminFundingAgenciesOrganizationalUnitStateModel extends Associ }, }) export class AdminFundingAgenciesOrganizationalUnitState extends AssociationState<AdminFundingAgenciesOrganizationalUnitStateModel, OrganizationalUnit> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminFundingAgenciesOrgUnitActionNameSpace, resourceName: ApiResourceNameEnum.ORG_UNIT, }); diff --git a/src/app/features/admin/index-field-alias/components/presentationals/admin-index-field-alias-form/admin-index-field-alias-form.presentational.ts b/src/app/features/admin/index-field-alias/components/presentationals/admin-index-field-alias-form/admin-index-field-alias-form.presentational.ts index c1bc9701d..186cb50a6 100644 --- a/src/app/features/admin/index-field-alias/components/presentationals/admin-index-field-alias-form/admin-index-field-alias-form.presentational.ts +++ b/src/app/features/admin/index-field-alias/components/presentationals/admin-index-field-alias-form/admin-index-field-alias-form.presentational.ts @@ -75,15 +75,15 @@ export class AdminIndexFieldAliasFormPresentational extends AbstractFormPresenta } this.languages.forEach(language => { if (isNullOrUndefined(this.model) || isNullOrUndefined(this.model.labels)) { - this.addControl(language.resId); + this._addControl(language.resId); return; } const existingValue = this.model.labels.find(label => label.language.resId === language.resId); if (isNullOrUndefined(existingValue)) { - this.addControl(language.resId); + this._addControl(language.resId); return; } - this.addControl(language.resId, existingValue.text); + this._addControl(language.resId, existingValue.text); }); } @@ -103,11 +103,11 @@ export class AdminIndexFieldAliasFormPresentational extends AbstractFormPresenta protected readonly _elementRef: ElementRef, protected readonly _injector: Injector, private readonly _fb: FormBuilder, - protected readonly store: Store) { + protected readonly _store: Store) { super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.indexName]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.alias]: ["", [Validators.required, SolidifyValidator]], @@ -121,7 +121,7 @@ export class AdminIndexFieldAliasFormPresentational extends AbstractFormPresenta }); } - protected bindFormTo(indexFieldAlias: IndexFieldAlias): void { + protected _bindFormTo(indexFieldAlias: IndexFieldAlias): void { this.form = this._fb.group({ [this.formDefinition.indexName]: [indexFieldAlias.indexName, [Validators.required, SolidifyValidator]], [this.formDefinition.alias]: [indexFieldAlias.alias, [Validators.required, SolidifyValidator]], @@ -137,22 +137,22 @@ export class AdminIndexFieldAliasFormPresentational extends AbstractFormPresenta ngOnInit(): void { super.ngOnInit(); - this.store.dispatch(new SharedLanguageAction.GetAll()); - this.addValidators(); + this._store.dispatch(new SharedLanguageAction.GetAll()); + this._addValidators(); } - private addValidators(): void { + private _addValidators(): void { const facetFormControl = this.form.get(this.formDefinition.facet); this.subscribe(facetFormControl.valueChanges.pipe( distinctUntilChanged(), tap((isFacet: boolean) => { - this.setValidator(isFacet); + this._setValidator(isFacet); }), )); - this.setValidator(facetFormControl.value); + this._setValidator(facetFormControl.value); } - private setValidator(isFacet: boolean): void { + private _setValidator(isFacet: boolean): void { const facetMinCountFormControl = this.form.get(this.formDefinition.facetMinCount); const facetLimitFormControl = this.form.get(this.formDefinition.facetLimit); const facetOrderControl = this.form.get(this.formDefinition.facetOrder); @@ -173,7 +173,7 @@ export class AdminIndexFieldAliasFormPresentational extends AbstractFormPresenta this._changeDetectorRef.detectChanges(); } - protected treatmentBeforeSubmit(indexFieldAlias: IndexFieldAlias): IndexFieldAlias { + protected _treatmentBeforeSubmit(indexFieldAlias: IndexFieldAlias): IndexFieldAlias { const newLabels: Label[] = []; this.languages.forEach(language => { @@ -189,7 +189,7 @@ export class AdminIndexFieldAliasFormPresentational extends AbstractFormPresenta return indexFieldAlias; } - private addControl(languageResId: string, value: string | undefined = undefined): void { + private _addControl(languageResId: string, value: string | undefined = undefined): void { if (!isNullOrUndefined(this.form)) { this.form.addControl(languageResId, this._fb.control(value)); } diff --git a/src/app/features/admin/index-field-alias/components/routables/admin-index-field-alias-detail-edit/admin-index-field-alias-detail-edit.routable.ts b/src/app/features/admin/index-field-alias/components/routables/admin-index-field-alias-detail-edit/admin-index-field-alias-detail-edit.routable.ts index 4170f132a..cf4bc4a57 100644 --- a/src/app/features/admin/index-field-alias/components/routables/admin-index-field-alias-detail-edit/admin-index-field-alias-detail-edit.routable.ts +++ b/src/app/features/admin/index-field-alias/components/routables/admin-index-field-alias-detail-edit/admin-index-field-alias-detail-edit.routable.ts @@ -69,15 +69,15 @@ export class AdminIndexFieldAliasDetailEditRoutable extends AbstractDetailEditCo readonly KEY_PARAM_NAME: keyof IndexFieldAlias & string = "alias"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_indexFieldAlias, _injector, adminIndexFieldAliasActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/admin/index-field-alias/stores/admin-index-field-alias.state.ts b/src/app/features/admin/index-field-alias/stores/admin-index-field-alias.state.ts index 10f57768d..42fa1ef5a 100644 --- a/src/app/features/admin/index-field-alias/stores/admin-index-field-alias.state.ts +++ b/src/app/features/admin/index-field-alias/stores/admin-index-field-alias.state.ts @@ -67,11 +67,11 @@ export interface AdminIndexFieldAliasStateModel extends ResourceStateModel<Index children: [], }) export class AdminIndexFieldAliasState extends ResourceState<AdminIndexFieldAliasStateModel, IndexFieldAlias> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminIndexFieldAliasActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminIndexFieldAliasDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminIndexFieldAliasDetail + urlSeparator + resId, diff --git a/src/app/features/admin/institution/components/presentationals/admin-institution-form/admin-institution-form.presentational.ts b/src/app/features/admin/institution/components/presentationals/admin-institution-form/admin-institution-form.presentational.ts index 6c11c3e0f..a295f48c8 100644 --- a/src/app/features/admin/institution/components/presentationals/admin-institution-form/admin-institution-form.presentational.ts +++ b/src/app/features/admin/institution/components/presentationals/admin-institution-form/admin-institution-form.presentational.ts @@ -96,7 +96,7 @@ export class AdminInstitutionFormPresentational extends AbstractFormPresentation ]; } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.name]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.url]: ["", [SolidifyValidator, Validators.pattern(RegexUtil.url)]], @@ -106,7 +106,7 @@ export class AdminInstitutionFormPresentational extends AbstractFormPresentation }); } - protected bindFormTo(institutions: Institution): void { + protected _bindFormTo(institutions: Institution): void { this.form = this._fb.group({ [this.formDefinition.name]: [institutions.name, [Validators.required, SolidifyValidator]], [this.formDefinition.url]: [institutions.url, [SolidifyValidator, Validators.pattern(RegexUtil.url)]], @@ -117,12 +117,12 @@ export class AdminInstitutionFormPresentational extends AbstractFormPresentation }); } - protected treatmentBeforeSubmit(institution: Institution): Institution { + protected _treatmentBeforeSubmit(institution: Institution): Institution { institution.organizationalUnits = []; if (this.form.get(this.formDefinition.orgUnit).value !== "") { const orgUnits = this.form.get(this.formDefinition.orgUnit).value as OrgUnitModel[]; orgUnits.forEach((c) => { - institution.organizationalUnits.push({resId: c.id}); + institution.organizationalUnits.push({resId: c.id}); }); } return institution; diff --git a/src/app/features/admin/institution/components/routables/admin-institution-detail-edit/admin-institution-detail-edit.routable.ts b/src/app/features/admin/institution/components/routables/admin-institution-detail-edit/admin-institution-detail-edit.routable.ts index e3adfbaba..65ab256dd 100644 --- a/src/app/features/admin/institution/components/routables/admin-institution-detail-edit/admin-institution-detail-edit.routable.ts +++ b/src/app/features/admin/institution/components/routables/admin-institution-detail-edit/admin-institution-detail-edit.routable.ts @@ -75,16 +75,16 @@ export class AdminInstitutionDetailEditRoutable extends AbstractDetailEditCommon readonly KEY_PARAM_NAME: keyof Institution & string = "name"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_institution, _injector, adminInstitutionActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new AdminInstitutionOrganizationalUnitAction.GetAll(id)); } diff --git a/src/app/features/admin/institution/stores/admin-institution.state.ts b/src/app/features/admin/institution/stores/admin-institution.state.ts index 6fd66109a..e21569162 100644 --- a/src/app/features/admin/institution/stores/admin-institution.state.ts +++ b/src/app/features/admin/institution/stores/admin-institution.state.ts @@ -88,12 +88,12 @@ export interface AdminInstitutionStateModel extends ResourceLogoStateModel<Insti }, ) export class AdminInstitutionState extends ResourceLogoState<AdminInstitutionStateModel, Institution> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, protected readonly _httpClient: HttpClient) { - super(apiService, store, notificationService, actions$, { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminInstitutionActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminInstitutionDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminInstitutionDetail + urlSeparator + resId, @@ -155,10 +155,10 @@ export class AdminInstitutionState extends ResourceLogoState<AdminInstitutionSta @OverrideDefaultAction() @Action(AdminInstitutionAction.Create) create(ctx: StateContext<AdminInstitutionStateModel>, action: AdminInstitutionAction.Create): Observable<Institution> { - return super.internalCreate(ctx, action) + return super._internalCreate(ctx, action) .pipe( tap(model => { - this.updateSubResource(model, action, ctx) + this._updateSubResource(model, action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new AdminInstitutionAction.CreateSuccess(action, model)); @@ -173,11 +173,11 @@ export class AdminInstitutionState extends ResourceLogoState<AdminInstitutionSta @OverrideDefaultAction() @Action(AdminInstitutionAction.Update) update(ctx: StateContext<AdminInstitutionStateModel>, action: AdminInstitutionAction.Update): Observable<Institution> { - return super.internalUpdate(ctx, action) + return super._internalUpdate(ctx, action) .pipe( tap(model => { this.subscribe( - this.updateSubResource(model, action, ctx).pipe( + this._updateSubResource(model, action, ctx).pipe( tap(success => { if (success) { ctx.dispatch(new AdminInstitutionAction.UpdateSuccess(action, model)); @@ -190,7 +190,7 @@ export class AdminInstitutionState extends ResourceLogoState<AdminInstitutionSta ); } - private updateSubResource(model: Institution, action: AdminInstitutionAction.Create | AdminInstitutionAction.Update, ctx: StateContext<AdminInstitutionStateModel>): Observable<boolean> { + private _updateSubResource(model: Institution, action: AdminInstitutionAction.Create | AdminInstitutionAction.Update, ctx: StateContext<AdminInstitutionStateModel>): Observable<boolean> { const institutionId = model.resId; const newOrgUnitIds = action.modelFormControlEvent.model.organizationalUnits.map(p => p.resId); @@ -199,8 +199,8 @@ export class AdminInstitutionState extends ResourceLogoState<AdminInstitutionSta { action: new AdminInstitutionOrganizationalUnitAction.Update(institutionId, newOrgUnitIds), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(AdminInstitutionOrganizationalUnitAction.UpdateSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AdminInstitutionOrganizationalUnitAction.UpdateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminInstitutionOrganizationalUnitAction.UpdateSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminInstitutionOrganizationalUnitAction.UpdateFail)), ], }, ]).pipe( diff --git a/src/app/features/admin/institution/stores/organizational-unit/admin-institution-organizational-unit.state.ts b/src/app/features/admin/institution/stores/organizational-unit/admin-institution-organizational-unit.state.ts index e6c4ba18f..574000287 100644 --- a/src/app/features/admin/institution/stores/organizational-unit/admin-institution-organizational-unit.state.ts +++ b/src/app/features/admin/institution/stores/organizational-unit/admin-institution-organizational-unit.state.ts @@ -53,11 +53,11 @@ export interface AdminInstitutionOrganizationalUnitStateModel extends Associatio }, }) export class AdminInstitutionOrganizationalUnitState extends AssociationState<AdminInstitutionOrganizationalUnitStateModel, OrganizationalUnit> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminInstitutionOrganizationalUnitNamespace, resourceName: ApiResourceNameEnum.ORG_UNIT, }); diff --git a/src/app/features/admin/language/components/dialogs/admin-language-create-edit/admin-language-create-edit.dialog.ts b/src/app/features/admin/language/components/dialogs/admin-language-create-edit/admin-language-create-edit.dialog.ts index e0dae9b49..7d4b97657 100644 --- a/src/app/features/admin/language/components/dialogs/admin-language-create-edit/admin-language-create-edit.dialog.ts +++ b/src/app/features/admin/language/components/dialogs/admin-language-create-edit/admin-language-create-edit.dialog.ts @@ -56,7 +56,7 @@ import {ResourceNameSpace} from "solidify-frontend"; export class AdminLanguageCreateEditDialog extends SharedAbstractCreateEditDialog<Language, AdminLanguageStateModel, CreateEditDialog<Language>> { override checkAvailableResourceNameSpace: ResourceNameSpace = sharedLanguageActionNameSpace; - constructor(@Inject(MAT_DIALOG_DATA) protected readonly data: CreateEditDialog<Language>, + constructor(@Inject(MAT_DIALOG_DATA) protected readonly _data: CreateEditDialog<Language>, protected readonly _store: Store, protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, @@ -64,10 +64,10 @@ export class AdminLanguageCreateEditDialog extends SharedAbstractCreateEditDialo protected readonly _dialog: MatDialog, protected readonly _dialogRef: MatDialogRef<AdminLanguageCreateEditDialog>, protected readonly _injector: Injector) { - super(data, _store, _route, _actions$, _changeDetector, _dialog, _dialogRef, StateEnum.admin_language, adminLanguageActionNameSpace, _injector, StateEnum.admin); + super(_data, _store, _route, _actions$, _changeDetector, _dialog, _dialogRef, StateEnum.admin_language, adminLanguageActionNameSpace, _injector, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } readonly KEY_CANCEL_BUTTON: string | undefined; diff --git a/src/app/features/admin/language/components/presentationals/admin-language-form/admin-language-form.presentational.ts b/src/app/features/admin/language/components/presentationals/admin-language-form/admin-language-form.presentational.ts index 80e0bf5e7..4b1b5bd60 100644 --- a/src/app/features/admin/language/components/presentationals/admin-language-form/admin-language-form.presentational.ts +++ b/src/app/features/admin/language/components/presentationals/admin-language-form/admin-language-form.presentational.ts @@ -83,14 +83,14 @@ export class AdminLanguageFormPresentational extends AbstractFormPresentational< )); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.code]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.resId]: ["", [Validators.required, SolidifyValidator]], }); } - protected bindFormTo(languages: Language): void { + protected _bindFormTo(languages: Language): void { this.form = this._fb.group({ [this.formDefinition.code]: [languages.code, [Validators.required, SolidifyValidator]], [this.formDefinition.resId]: [languages.resId, [Validators.required, SolidifyValidator]], @@ -98,7 +98,7 @@ export class AdminLanguageFormPresentational extends AbstractFormPresentational< } override onSubmit(): void { - const model = this.treatmentBeforeSubmit(this.form.value as Language); + const model = this._treatmentBeforeSubmit(this.form.value as Language); this._submitBS.next({ model: model, formControl: this.form, @@ -106,7 +106,7 @@ export class AdminLanguageFormPresentational extends AbstractFormPresentational< }); } - protected treatmentBeforeSubmit(languages: Language): Language { + protected _treatmentBeforeSubmit(languages: Language): Language { return languages; } } diff --git a/src/app/features/admin/language/stores/admin-language.state.ts b/src/app/features/admin/language/stores/admin-language.state.ts index 0c30a67bf..cc045692c 100644 --- a/src/app/features/admin/language/stores/admin-language.state.ts +++ b/src/app/features/admin/language/stores/admin-language.state.ts @@ -66,11 +66,11 @@ export interface AdminLanguageStateModel extends ResourceStateModel<Language> { }, }) export class AdminLanguageState extends ResourceState<AdminLanguageStateModel, Language> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminLanguageActionNameSpace, routeRedirectUrlAfterSuccessDeleteAction: RoutesEnum.adminLanguage, notificationResourceCreateSuccessTextToTranslate: MARK_AS_TRANSLATABLE("admin.language.notification.resource.create"), @@ -122,8 +122,8 @@ export class AdminLanguageState extends ResourceState<AdminLanguageStateModel, L { action: new SharedLanguageAction.GetAll(null, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedLanguageAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedLanguageAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedLanguageAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedLanguageAction.GetAllFail)), ], }, ]).pipe( diff --git a/src/app/features/admin/license/components/presentationals/admin-license-form/admin-license-form.presentational.ts b/src/app/features/admin/license/components/presentationals/admin-license-form/admin-license-form.presentational.ts index fa0785607..8c331d010 100644 --- a/src/app/features/admin/license/components/presentationals/admin-license-form/admin-license-form.presentational.ts +++ b/src/app/features/admin/license/components/presentationals/admin-license-form/admin-license-form.presentational.ts @@ -79,7 +79,7 @@ export class AdminLicenseFormPresentational extends AbstractFormPresentational<L super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.title]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.openLicenseId]: ["", [Validators.required, SolidifyValidator]], @@ -96,7 +96,7 @@ export class AdminLicenseFormPresentational extends AbstractFormPresentational<L }); } - protected bindFormTo(licenses: License): void { + protected _bindFormTo(licenses: License): void { this.form = this._fb.group({ [this.formDefinition.title]: [licenses.title, [Validators.required, SolidifyValidator]], [this.formDefinition.openLicenseId]: [licenses.openLicenseId, [Validators.required, SolidifyValidator]], @@ -113,7 +113,7 @@ export class AdminLicenseFormPresentational extends AbstractFormPresentational<L }); } - protected treatmentBeforeSubmit(licenses: License): License { + protected _treatmentBeforeSubmit(licenses: License): License { return licenses; } diff --git a/src/app/features/admin/license/components/routables/admin-license-detail-edit/admin-license-detail-edit.routable.ts b/src/app/features/admin/license/components/routables/admin-license-detail-edit/admin-license-detail-edit.routable.ts index 8e4e786a4..98685958c 100644 --- a/src/app/features/admin/license/components/routables/admin-license-detail-edit/admin-license-detail-edit.routable.ts +++ b/src/app/features/admin/license/components/routables/admin-license-detail-edit/admin-license-detail-edit.routable.ts @@ -62,15 +62,15 @@ export class AdminLicenseDetailEditRoutable extends AbstractDetailEditCommonRout readonly KEY_PARAM_NAME: keyof License & string = "title"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_license, _injector, adminLicenseActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/admin/license/stores/admin-license.state.ts b/src/app/features/admin/license/stores/admin-license.state.ts index fe3fd4476..4eecfeecb 100644 --- a/src/app/features/admin/license/stores/admin-license.state.ts +++ b/src/app/features/admin/license/stores/admin-license.state.ts @@ -69,12 +69,12 @@ export interface AdminLicenseStateModel extends ResourceLogoStateModel<License> }, }) export class AdminLicenseState extends ResourceLogoState<AdminLicenseStateModel, License> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, protected readonly _httpClient: HttpClient) { - super(apiService, store, notificationService, actions$, { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminLicenseActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminLicenseDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminLicenseDetail + urlSeparator + resId, diff --git a/src/app/features/admin/metadata-type/components/presentationals/admin-metadata-type-form/admin-metadata-type-form.presentational.ts b/src/app/features/admin/metadata-type/components/presentationals/admin-metadata-type-form/admin-metadata-type-form.presentational.ts index ef0837d50..2fcc197f7 100644 --- a/src/app/features/admin/metadata-type/components/presentationals/admin-metadata-type-form/admin-metadata-type-form.presentational.ts +++ b/src/app/features/admin/metadata-type/components/presentationals/admin-metadata-type-form/admin-metadata-type-form.presentational.ts @@ -88,7 +88,7 @@ export class AdminMetadataTypeFormPresentational extends AbstractFormPresentatio super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.name]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.description]: ["", [Validators.required, SolidifyValidator]], @@ -99,7 +99,7 @@ export class AdminMetadataTypeFormPresentational extends AbstractFormPresentatio }); } - protected bindFormTo(metadataTypes: MetadataType): void { + protected _bindFormTo(metadataTypes: MetadataType): void { this.form = this._fb.group({ [this.formDefinition.name]: [metadataTypes.name, [Validators.required, SolidifyValidator]], [this.formDefinition.description]: [metadataTypes.description, [Validators.required, SolidifyValidator]], @@ -110,7 +110,7 @@ export class AdminMetadataTypeFormPresentational extends AbstractFormPresentatio }); } - protected treatmentBeforeSubmit(metadataTypes: MetadataType): MetadataType { + protected _treatmentBeforeSubmit(metadataTypes: MetadataType): MetadataType { return metadataTypes; } diff --git a/src/app/features/admin/metadata-type/components/routables/admin-metadata-type-detail-edit/admin-metadata-type-detail-edit.routable.ts b/src/app/features/admin/metadata-type/components/routables/admin-metadata-type-detail-edit/admin-metadata-type-detail-edit.routable.ts index b7d1cd93c..6147408e3 100644 --- a/src/app/features/admin/metadata-type/components/routables/admin-metadata-type-detail-edit/admin-metadata-type-detail-edit.routable.ts +++ b/src/app/features/admin/metadata-type/components/routables/admin-metadata-type-detail-edit/admin-metadata-type-detail-edit.routable.ts @@ -78,26 +78,26 @@ export class AdminMetadataTypeDetailEditRoutable extends AbstractDetailEditCommo color: "primary", icon: IconNameEnum.download, displayCondition: current => !this.isEdit, - callback: () => this.download(), + callback: () => this._download(), disableCondition: current => isNullOrUndefined(current), labelToTranslate: (current) => LabelTranslateEnum.download, order: 40, }, ]; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_metadataType, _injector, adminMetadataTypeActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } - private download(): void { + private _download(): void { this._store.dispatch(new AdminMetadataTypeAction.Download(this.current)); } diff --git a/src/app/features/admin/metadata-type/stores/admin-metadata-type.state.ts b/src/app/features/admin/metadata-type/stores/admin-metadata-type.state.ts index f3cff973d..0c38cec87 100644 --- a/src/app/features/admin/metadata-type/stores/admin-metadata-type.state.ts +++ b/src/app/features/admin/metadata-type/stores/admin-metadata-type.state.ts @@ -85,13 +85,13 @@ export interface AdminMetadataTypeStateModel extends ResourceStateModel<Metadata export class AdminMetadataTypeState extends ResourceState<AdminMetadataTypeStateModel, MetadataType> { private readonly _FILE_KEY: string = "file"; - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - protected downloadService: DownloadService, - protected httpClient: HttpClient) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + protected readonly _downloadService: DownloadService, + protected readonly _httpClient: HttpClient) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminMetadataTypeActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminMetadataTypeDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminMetadataTypeDetail + urlSeparator + resId, @@ -144,7 +144,7 @@ export class AdminMetadataTypeState extends ResourceState<AdminMetadataTypeState ext = "json"; } const fileName = "metadata_type_" + StringUtil.convertToSnakeCase(action.metadataType.name) + "." + ext; - this.downloadService.download(`${this._urlResource}/${action.metadataType.resId}/${ApiResourceNameEnum.SCHEMA}`, fileName); + this._downloadService.download(`${this._urlResource}/${action.metadataType.resId}/${ApiResourceNameEnum.SCHEMA}`, fileName); } @Action(AdminMetadataTypeAction.TestFile) @@ -155,7 +155,7 @@ export class AdminMetadataTypeState extends ResourceState<AdminMetadataTypeState const formData = new FormData(); formData.append(this._FILE_KEY, action.file, action.file.name); - return this.apiService.upload(`${this._urlResource}/${action.id}/${ApiActionNameEnum.VALIDATE}`, formData) + return this._apiService.upload(`${this._urlResource}/${action.id}/${ApiActionNameEnum.VALIDATE}`, formData) .pipe( map((event: UploadEventModel) => { switch (event.type) { @@ -184,7 +184,7 @@ export class AdminMetadataTypeState extends ResourceState<AdminMetadataTypeState ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.action.testFile.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.action.testFile.success")); } @Action(AdminMetadataTypeAction.TestFileFail) @@ -192,6 +192,6 @@ export class AdminMetadataTypeState extends ResourceState<AdminMetadataTypeState ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.sip.action.testFile.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.sip.action.testFile.fail")); } } diff --git a/src/app/features/admin/notification/components/routables/admin-notification-detail-edit/admin-notification-detail-edit.routable.ts b/src/app/features/admin/notification/components/routables/admin-notification-detail-edit/admin-notification-detail-edit.routable.ts index 7802a8a47..378dc8888 100644 --- a/src/app/features/admin/notification/components/routables/admin-notification-detail-edit/admin-notification-detail-edit.routable.ts +++ b/src/app/features/admin/notification/components/routables/admin-notification-detail-edit/admin-notification-detail-edit.routable.ts @@ -83,16 +83,16 @@ export class AdminNotificationDetailEditRoutable extends AbstractDetailEditCommo readonly KEY_PARAM_NAME: keyof NotificationDlcm & string = "notificationType"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_notification, _injector, adminNotificationActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } showHistory(): void { diff --git a/src/app/features/admin/notification/stores/admin-notification.state.ts b/src/app/features/admin/notification/stores/admin-notification.state.ts index 3da76f118..2073af370 100644 --- a/src/app/features/admin/notification/stores/admin-notification.state.ts +++ b/src/app/features/admin/notification/stores/admin-notification.state.ts @@ -78,11 +78,11 @@ export interface AdminNotificationStateModel extends ResourceStateModel<Notifica ], }) export class AdminNotificationState extends ResourceState<AdminNotificationStateModel, NotificationDlcm> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminNotificationActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminNotificationDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminNotificationDetail + urlSeparator + resId, @@ -137,8 +137,8 @@ export class AdminNotificationState extends ResourceState<AdminNotificationState { action: new SharedRoleAction.GetAll(undefined, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllFail)), ], }, ]).pipe( diff --git a/src/app/features/admin/notification/stores/status-history/admin-notification-status-history.state.ts b/src/app/features/admin/notification/stores/status-history/admin-notification-status-history.state.ts index 80e4a1954..f0de93710 100644 --- a/src/app/features/admin/notification/stores/status-history/admin-notification-status-history.state.ts +++ b/src/app/features/admin/notification/stores/status-history/admin-notification-status-history.state.ts @@ -54,11 +54,11 @@ export interface AdminNotificationStatusHistoryStateModel extends StatusHistoryS }) export class AdminNotificationStatusHistoryState extends StatusHistoryState<AdminNotificationStatusHistoryStateModel, NotificationDlcm> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminNotificationStatusHistoryActionNameSpace, }); } diff --git a/src/app/features/admin/oai-metadata-prefix/components/presentationals/admin-oai-metadata-prefix-form/admin-oai-metadata-prefix-form.presentational.ts b/src/app/features/admin/oai-metadata-prefix/components/presentationals/admin-oai-metadata-prefix-form/admin-oai-metadata-prefix-form.presentational.ts index 568ca30db..24de794f0 100644 --- a/src/app/features/admin/oai-metadata-prefix/components/presentationals/admin-oai-metadata-prefix-form/admin-oai-metadata-prefix-form.presentational.ts +++ b/src/app/features/admin/oai-metadata-prefix/components/presentationals/admin-oai-metadata-prefix-form/admin-oai-metadata-prefix-form.presentational.ts @@ -70,7 +70,7 @@ export class AdminOaiMetadataPrefixFormPresentational extends AbstractFormPresen super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.prefix]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.name]: ["", [Validators.required, SolidifyValidator]], @@ -84,7 +84,7 @@ export class AdminOaiMetadataPrefixFormPresentational extends AbstractFormPresen }); } - protected bindFormTo(oaiMetadataPrefix: OaiMetadataPrefix): void { + protected _bindFormTo(oaiMetadataPrefix: OaiMetadataPrefix): void { this.form = this._fb.group({ [this.formDefinition.prefix]: [oaiMetadataPrefix.prefix, [Validators.required, SolidifyValidator]], [this.formDefinition.name]: [oaiMetadataPrefix.name, [Validators.required, SolidifyValidator]], @@ -98,7 +98,7 @@ export class AdminOaiMetadataPrefixFormPresentational extends AbstractFormPresen }); } - protected treatmentBeforeSubmit(OaiMetadataPrefixes: OaiMetadataPrefix): OaiMetadataPrefix { + protected _treatmentBeforeSubmit(OaiMetadataPrefixes: OaiMetadataPrefix): OaiMetadataPrefix { return OaiMetadataPrefixes; } } diff --git a/src/app/features/admin/oai-metadata-prefix/components/routables/admin-oai-metadata-prefix-detail-edit/admin-oai-metadata-prefix-detail-edit.routable.ts b/src/app/features/admin/oai-metadata-prefix/components/routables/admin-oai-metadata-prefix-detail-edit/admin-oai-metadata-prefix-detail-edit.routable.ts index c58a432ff..db36a6258 100644 --- a/src/app/features/admin/oai-metadata-prefix/components/routables/admin-oai-metadata-prefix-detail-edit/admin-oai-metadata-prefix-detail-edit.routable.ts +++ b/src/app/features/admin/oai-metadata-prefix/components/routables/admin-oai-metadata-prefix-detail-edit/admin-oai-metadata-prefix-detail-edit.routable.ts @@ -62,15 +62,15 @@ export class AdminOaiMetadataPrefixDetailEditRoutable extends AbstractDetailEdit readonly KEY_PARAM_NAME: keyof OaiMetadataPrefix & string = "name"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_oaiMetadataPrefix, _injector, adminOaiMetadataPrefixActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/admin/oai-metadata-prefix/stores/admin-oai-metadata-prefix.state.ts b/src/app/features/admin/oai-metadata-prefix/stores/admin-oai-metadata-prefix.state.ts index 5ec183a18..6ac560838 100644 --- a/src/app/features/admin/oai-metadata-prefix/stores/admin-oai-metadata-prefix.state.ts +++ b/src/app/features/admin/oai-metadata-prefix/stores/admin-oai-metadata-prefix.state.ts @@ -67,11 +67,11 @@ export interface AdminOaiMetadataPrefixStateModel extends ResourceStateModel<Oai }, }) export class AdminOaiMetadataPrefixState extends ResourceState<AdminOaiMetadataPrefixStateModel, OaiMetadataPrefix> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminOaiMetadataPrefixActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminOaiMetadataPrefixDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminOaiMetadataPrefixDetail + urlSeparator + resId, @@ -125,8 +125,8 @@ export class AdminOaiMetadataPrefixState extends ResourceState<AdminOaiMetadataP { action: new SharedOrgUnitAction.GetAll(undefined, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedOrgUnitAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedOrgUnitAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedOrgUnitAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedOrgUnitAction.GetAllFail)), ], }, ]).pipe( diff --git a/src/app/features/admin/oai-set/components/presentationals/admin-oai-set-bulk-form/admin-oai-set-bulk-form.presentational.ts b/src/app/features/admin/oai-set/components/presentationals/admin-oai-set-bulk-form/admin-oai-set-bulk-form.presentational.ts index fce018f05..16a20cfd5 100644 --- a/src/app/features/admin/oai-set/components/presentationals/admin-oai-set-bulk-form/admin-oai-set-bulk-form.presentational.ts +++ b/src/app/features/admin/oai-set/components/presentationals/admin-oai-set-bulk-form/admin-oai-set-bulk-form.presentational.ts @@ -71,16 +71,16 @@ export class AdminOaiSetBulkFormPresentational extends AbstractFormPresentationa super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.organizationalUnits]: [], }); } - protected bindFormTo(oaiSet: OaiSet): void { + protected _bindFormTo(oaiSet: OaiSet): void { } - protected treatmentBeforeSubmit(oaiSet: OaiSet): OaiSet { + protected _treatmentBeforeSubmit(oaiSet: OaiSet): OaiSet { oaiSet.organizationalUnits = []; const listOrgUnitId = this.form.get(this.formDefinition.organizationalUnits).value; if (!isNullOrUndefined(listOrgUnitId)) { @@ -93,7 +93,7 @@ export class AdminOaiSetBulkFormPresentational extends AbstractFormPresentationa } public onSubmit(): void { - const model = this.treatmentBeforeSubmit(this.form.value as OaiSet); + const model = this._treatmentBeforeSubmit(this.form.value as OaiSet); this._submitBS.next({ model: model, formControl: this.form, diff --git a/src/app/features/admin/oai-set/components/presentationals/admin-oai-set-form/admin-oai-set-form.presentational.ts b/src/app/features/admin/oai-set/components/presentationals/admin-oai-set-form/admin-oai-set-form.presentational.ts index f9181d6ef..851e78d13 100644 --- a/src/app/features/admin/oai-set/components/presentationals/admin-oai-set-form/admin-oai-set-form.presentational.ts +++ b/src/app/features/admin/oai-set/components/presentationals/admin-oai-set-form/admin-oai-set-form.presentational.ts @@ -69,7 +69,7 @@ export class AdminOaiSetFormPresentational extends AbstractFormPresentational<Oa super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.spec]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.name]: ["", [Validators.required, SolidifyValidator]], @@ -79,7 +79,7 @@ export class AdminOaiSetFormPresentational extends AbstractFormPresentational<Oa }); } - protected bindFormTo(oaiSets: OaiSet): void { + protected _bindFormTo(oaiSets: OaiSet): void { this.form = this._fb.group({ [this.formDefinition.spec]: [oaiSets.spec, [Validators.required, SolidifyValidator]], [this.formDefinition.name]: [oaiSets.name, [Validators.required, SolidifyValidator]], @@ -89,7 +89,7 @@ export class AdminOaiSetFormPresentational extends AbstractFormPresentational<Oa }); } - protected treatmentBeforeSubmit(oaiSets: OaiSet): OaiSet { + protected _treatmentBeforeSubmit(oaiSets: OaiSet): OaiSet { return oaiSets; } } diff --git a/src/app/features/admin/oai-set/components/routables/admin-oai-set-detail-edit/admin-oai-set-detail-edit.routable.ts b/src/app/features/admin/oai-set/components/routables/admin-oai-set-detail-edit/admin-oai-set-detail-edit.routable.ts index 34d1a0057..fb6fbef38 100644 --- a/src/app/features/admin/oai-set/components/routables/admin-oai-set-detail-edit/admin-oai-set-detail-edit.routable.ts +++ b/src/app/features/admin/oai-set/components/routables/admin-oai-set-detail-edit/admin-oai-set-detail-edit.routable.ts @@ -62,15 +62,15 @@ export class AdminOaiSetDetailEditRoutable extends AbstractDetailEditCommonRouta readonly KEY_PARAM_NAME: keyof OaiSet & string = "name"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_oaiSet, _injector, adminOaiSetActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/admin/oai-set/stores/admin-oai-set.state.ts b/src/app/features/admin/oai-set/stores/admin-oai-set.state.ts index 28358bf76..1cbf0f3e9 100644 --- a/src/app/features/admin/oai-set/stores/admin-oai-set.state.ts +++ b/src/app/features/admin/oai-set/stores/admin-oai-set.state.ts @@ -72,11 +72,11 @@ export interface AdminOaiSetStateModel extends ResourceStateModel<OaiSet> { }, }) export class AdminOaiSetState extends ResourceState<AdminOaiSetStateModel, OaiSet> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminOaiSetActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminOaiSetDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminOaiSetDetail + urlSeparator + resId, @@ -130,8 +130,8 @@ export class AdminOaiSetState extends ResourceState<AdminOaiSetStateModel, OaiSe { action: new SharedOrgUnitAction.GetAll(undefined, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedOrgUnitAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedOrgUnitAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedOrgUnitAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedOrgUnitAction.GetAllFail)), ], }, ]).pipe( @@ -168,8 +168,8 @@ export class AdminOaiSetState extends ResourceState<AdminOaiSetStateModel, OaiSe model: oaiSet, }), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(AdminOaiSetAction.CreateDuringBulkSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AdminOaiSetAction.CreateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOaiSetAction.CreateDuringBulkSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOaiSetAction.CreateFail)), ], }); }); @@ -189,7 +189,7 @@ export class AdminOaiSetState extends ResourceState<AdminOaiSetStateModel, OaiSe }); StoreUtil.navigateIfDefined(ctx, RoutesEnum.adminOaiSet, null); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("admin.oai-set.notification.bulkCreateSuccess")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("admin.oai-set.notification.bulkCreateSuccess")); } @Action(AdminOaiSetAction.BulkCreateFail) @@ -205,9 +205,9 @@ export class AdminOaiSetState extends ResourceState<AdminOaiSetStateModel, OaiSe isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return super.internalCreate(ctx, action as AdminOaiSetAction.Create).pipe( + return super._internalCreate(ctx, action as AdminOaiSetAction.Create).pipe( tap(model => { - this.store.dispatch(new AdminOaiSetAction.CreateDuringBulkSuccess(action)); + this._store.dispatch(new AdminOaiSetAction.CreateDuringBulkSuccess(action)); }), ); } diff --git a/src/app/features/admin/organizational-unit/components/dialogs/admin-organizational-unit-additional-fields-rename/admin-organizational-unit-additional-fields-rename.dialog.ts b/src/app/features/admin/organizational-unit/components/dialogs/admin-organizational-unit-additional-fields-rename/admin-organizational-unit-additional-fields-rename.dialog.ts index a916d1d0d..814de766e 100644 --- a/src/app/features/admin/organizational-unit/components/dialogs/admin-organizational-unit-additional-fields-rename/admin-organizational-unit-additional-fields-rename.dialog.ts +++ b/src/app/features/admin/organizational-unit/components/dialogs/admin-organizational-unit-additional-fields-rename/admin-organizational-unit-additional-fields-rename.dialog.ts @@ -69,7 +69,7 @@ export class AdminOrganizationalUnitAdditionalFieldsRenameDialog extends SharedA constructor(private readonly _store: Store, private readonly _actions$: Actions, protected readonly _dialogRef: MatDialogRef<AdminOrganizationalUnitAdditionalFieldsRenameDialog>, - @Inject(MAT_DIALOG_DATA) protected _data: AdminOrganizationalUnitAdditionalFieldsRenameDialogData, + @Inject(MAT_DIALOG_DATA) protected readonly _data: AdminOrganizationalUnitAdditionalFieldsRenameDialogData, private readonly _fb: FormBuilder) { super(_dialogRef, _data); } diff --git a/src/app/features/admin/organizational-unit/components/presentationals/admin-organizational-unit-additional-fields-form/admin-organizational-unit-additional-fields-form.presentational.ts b/src/app/features/admin/organizational-unit/components/presentationals/admin-organizational-unit-additional-fields-form/admin-organizational-unit-additional-fields-form.presentational.ts index b43691b69..9f49a7ae7 100644 --- a/src/app/features/admin/organizational-unit/components/presentationals/admin-organizational-unit-additional-fields-form/admin-organizational-unit-additional-fields-form.presentational.ts +++ b/src/app/features/admin/organizational-unit/components/presentationals/admin-organizational-unit-additional-fields-form/admin-organizational-unit-additional-fields-form.presentational.ts @@ -69,7 +69,7 @@ export class AdminOrganizationalUnitAdditionalFieldsFormPresentational extends A super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.type]: [Enums.FormDescription.TypeEnum.FORMLY, [Validators.required, SolidifyValidator]], [this.formDefinition.name]: ["", [SolidifyValidator]], @@ -78,7 +78,7 @@ export class AdminOrganizationalUnitAdditionalFieldsFormPresentational extends A } - protected bindFormTo(additionalFieldsForm: AdditionalFieldsForm): void { + protected _bindFormTo(additionalFieldsForm: AdditionalFieldsForm): void { this.form = this._fb.group({ [this.formDefinition.type]: [additionalFieldsForm.type, [Validators.required, SolidifyValidator]], [this.formDefinition.name]: [additionalFieldsForm.name, [SolidifyValidator]], @@ -86,7 +86,7 @@ export class AdminOrganizationalUnitAdditionalFieldsFormPresentational extends A }); } - protected treatmentBeforeSubmit(additionalFieldsForm: AdditionalFieldsForm | any): AdditionalFieldsForm { + protected _treatmentBeforeSubmit(additionalFieldsForm: AdditionalFieldsForm | any): AdditionalFieldsForm { return additionalFieldsForm; } } diff --git a/src/app/features/admin/organizational-unit/components/presentationals/admin-organizational-unit-form/admin-organizational-unit-form.presentational.ts b/src/app/features/admin/organizational-unit/components/presentationals/admin-organizational-unit-form/admin-organizational-unit-form.presentational.ts index 86ac0abb2..f5501a4ed 100644 --- a/src/app/features/admin/organizational-unit/components/presentationals/admin-organizational-unit-form/admin-organizational-unit-form.presentational.ts +++ b/src/app/features/admin/organizational-unit/components/presentationals/admin-organizational-unit-form/admin-organizational-unit-form.presentational.ts @@ -111,7 +111,7 @@ export class AdminOrganizationalUnitFormPresentational extends AbstractFormPrese return DataTestEnum; } - private readonly KEY_SOURCE: keyof ResearchDomain = "source"; + private readonly _KEY_SOURCE: keyof ResearchDomain = "source"; readonly TIME_BEFORE_DISPLAY_TOOLTIP: number = environment.timeBeforeDisplayTooltip; formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition(); @@ -220,7 +220,7 @@ export class AdminOrganizationalUnitFormPresentational extends AbstractFormPrese super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.name]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.description]: ["", [SolidifyValidator]], @@ -245,7 +245,7 @@ export class AdminOrganizationalUnitFormPresentational extends AbstractFormPrese this._creationForUserAskingInNotificationRequest(); } - protected bindFormTo(organizationalUnit: OrganizationalUnit): void { + protected _bindFormTo(organizationalUnit: OrganizationalUnit): void { this.form = this._fb.group({ [this.formDefinition.name]: [organizationalUnit.name, [Validators.required, SolidifyValidator]], [this.formDefinition.description]: [organizationalUnit.description, [SolidifyValidator]], @@ -268,7 +268,7 @@ export class AdminOrganizationalUnitFormPresentational extends AbstractFormPrese }); } - protected treatmentBeforeSubmit(organizationalUnit: OrganizationalUnit | any): OrganizationalUnit { + protected _treatmentBeforeSubmit(organizationalUnit: OrganizationalUnit | any): OrganizationalUnit { delete organizationalUnit[this.formDefinition.filterResearchDomains]; organizationalUnit.openingDate = DateUtil.convertToLocalDateDateSimple(organizationalUnit.openingDate); organizationalUnit.closingDate = DateUtil.convertToLocalDateDateSimple(organizationalUnit.closingDate); @@ -379,10 +379,10 @@ export class AdminOrganizationalUnitFormPresentational extends AbstractFormPrese private _computeExtraSearchParameterCategory(value: string): void { if (isNullOrUndefined(value) || isEmptyString(value)) { - MappingObjectUtil.delete(this.researchDomainExtraSearchParameterSource, this.KEY_SOURCE as string); + MappingObjectUtil.delete(this.researchDomainExtraSearchParameterSource, this._KEY_SOURCE as string); return; } - MappingObjectUtil.set(this.researchDomainExtraSearchParameterSource, this.KEY_SOURCE as string, value); + MappingObjectUtil.set(this.researchDomainExtraSearchParameterSource, this._KEY_SOURCE as string, value); } } diff --git a/src/app/features/admin/organizational-unit/components/routables/admin-organizational-unit-additional-fields-list/admin-organizational-unit-additional-fields-list.routable.ts b/src/app/features/admin/organizational-unit/components/routables/admin-organizational-unit-additional-fields-list/admin-organizational-unit-additional-fields-list.routable.ts index aa4b87a42..ad92d88ff 100644 --- a/src/app/features/admin/organizational-unit/components/routables/admin-organizational-unit-additional-fields-list/admin-organizational-unit-additional-fields-list.routable.ts +++ b/src/app/features/admin/organizational-unit/components/routables/admin-organizational-unit-additional-fields-list/admin-organizational-unit-additional-fields-list.routable.ts @@ -72,12 +72,12 @@ export class AdminOrganizationalUnitAdditionalFieldsListRoutable { actions: DataTableActions<DepositDataFile>[] = [ { logo: IconNameEnum.edit, - callback: (additionalFieldsForm: AdditionalFieldsForm) => this.renameVersion(this._resId, additionalFieldsForm), + callback: (additionalFieldsForm: AdditionalFieldsForm) => this._renameVersion(this._resId, additionalFieldsForm), placeholder: current => LabelTranslateEnum.rename, }, { logo: IconNameEnum.create, - callback: (additionalFieldsForm: AdditionalFieldsForm) => this.createNewVersionFromExistingOne(this._resId, additionalFieldsForm), + callback: (additionalFieldsForm: AdditionalFieldsForm) => this._createNewVersionFromExistingOne(this._resId, additionalFieldsForm), placeholder: current => MARK_AS_TRANSLATABLE("crud.list.action.createNewVersionFromExistingOne"), }, ]; @@ -86,11 +86,11 @@ export class AdminOrganizationalUnitAdditionalFieldsListRoutable { protected readonly _route: ActivatedRoute, private readonly _changeDetector: ChangeDetectorRef, public readonly _dialog: MatDialog) { - this.retrieveResIdFromUrl(); + this._retrieveResIdFromUrl(); this.defineColumns(); } - protected retrieveResIdFromUrl(): void { + protected _retrieveResIdFromUrl(): void { this._orgUnitResId = this._route.snapshot.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); if (isNullOrUndefined(this._orgUnitResId)) { this._orgUnitResId = this._route.parent.snapshot.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); @@ -131,14 +131,14 @@ export class AdminOrganizationalUnitAdditionalFieldsListRoutable { }); } - private renameVersion(_resId: string, additionalFieldsForm: AdditionalFieldsForm): void { + private _renameVersion(_resId: string, additionalFieldsForm: AdditionalFieldsForm): void { DialogUtil.open(this._dialog, AdminOrganizationalUnitAdditionalFieldsRenameDialog, { parentResId: this._orgUnitResId, additionalFieldsForm: additionalFieldsForm, }); } - private createNewVersionFromExistingOne(_resId: string, additionalFieldsForm: AdditionalFieldsForm): void { + private _createNewVersionFromExistingOne(_resId: string, additionalFieldsForm: AdditionalFieldsForm): void { DialogUtil.open(this._dialog, AdminOrganizationalUnitAdditionalFieldsDetailCreateUpdateDialog, { parentResId: this._orgUnitResId, additionalFieldsForm: additionalFieldsForm, diff --git a/src/app/features/admin/organizational-unit/components/routables/admin-organizational-unit-detail-edit/admin-organizational-unit-detail-edit.routable.ts b/src/app/features/admin/organizational-unit/components/routables/admin-organizational-unit-detail-edit/admin-organizational-unit-detail-edit.routable.ts index 41216ac2d..2c899a4e3 100644 --- a/src/app/features/admin/organizational-unit/components/routables/admin-organizational-unit-detail-edit/admin-organizational-unit-detail-edit.routable.ts +++ b/src/app/features/admin/organizational-unit/components/routables/admin-organizational-unit-detail-edit/admin-organizational-unit-detail-edit.routable.ts @@ -88,7 +88,7 @@ export class AdminOrganizationalUnitDetailEditRoutable extends AbstractDetailEdi readonly KEY_PARAM_NAME: keyof OrganizationalUnit & string = "name"; - private currentTab: Tab; + private _currentTab: Tab; listTabs: Tab[] = [ { @@ -96,18 +96,18 @@ export class AdminOrganizationalUnitDetailEditRoutable extends AbstractDetailEdi suffixUrl: AdminRoutesEnum.organizationalUnitData, icon: IconNameEnum.metadata, titleToTranslate: LabelTranslateEnum.detail, - route: () => [...this.rootUrl, AdminRoutesEnum.organizationalUnitData], + route: () => [...this._rootUrl, AdminRoutesEnum.organizationalUnitData], }, { id: TabEnum.ADDITIONAL_FIELDS_FORM, suffixUrl: AdminRoutesEnum.organizationalUnitAdditionalFieldsForm, icon: IconNameEnum.files, titleToTranslate: MARK_AS_TRANSLATABLE("admin.organizationalUnit.tab.additionalFieldsForm"), - route: () => [...this.rootUrl, AdminRoutesEnum.organizationalUnitAdditionalFieldsForm], + route: () => [...this._rootUrl, AdminRoutesEnum.organizationalUnitAdditionalFieldsForm], }, ]; - private get rootUrl(): string[] { + private get _rootUrl(): string[] { return [AppRoutesEnum.admin, AdminRoutesEnum.organizationalUnit, AdminRoutesEnum.organizationalUnitDetail, this._resId]; } @@ -128,7 +128,7 @@ export class AdminOrganizationalUnitDetailEditRoutable extends AbstractDetailEdi icon: IconNameEnum.create, labelToTranslate: (current) => MARK_AS_TRANSLATABLE("admin.organizationalUnit.button.createAdditionalFieldsForm"), order: 40, - callback: () => this.createAdditionalFieldsFromScratch(this._resId), + callback: () => this._createAdditionalFieldsFromScratch(this._resId), }, ]; @@ -148,13 +148,13 @@ export class AdminOrganizationalUnitDetailEditRoutable extends AbstractDetailEdi } setCurrentTab($event: Tab): void { - this.currentTab = $event; + this._currentTab = $event; } - protected getSubResourceWithParentId(id: string): void { + protected _getSubResourceWithParentId(id: string): void { } - private createAdditionalFieldsFromScratch(_resId: string): void { + private _createAdditionalFieldsFromScratch(_resId: string): void { DialogUtil.open(this._dialog, AdminOrganizationalUnitAdditionalFieldsDetailCreateUpdateDialog, { parentResId: this._resId, additionalFieldsForm: undefined, @@ -163,7 +163,7 @@ export class AdminOrganizationalUnitDetailEditRoutable extends AbstractDetailEdi } override backToDetail(): void { - super.backToDetail([...this.rootUrl, AdminRoutesEnum.organizationalUnitData]); + super.backToDetail([...this._rootUrl, AdminRoutesEnum.organizationalUnitData]); } } diff --git a/src/app/features/admin/organizational-unit/components/routables/admin-organizational-unit-metadata/admin-organizational-unit-metadata.routable.ts b/src/app/features/admin/organizational-unit/components/routables/admin-organizational-unit-metadata/admin-organizational-unit-metadata.routable.ts index e0ba2745d..da27d15d4 100644 --- a/src/app/features/admin/organizational-unit/components/routables/admin-organizational-unit-metadata/admin-organizational-unit-metadata.routable.ts +++ b/src/app/features/admin/organizational-unit/components/routables/admin-organizational-unit-metadata/admin-organizational-unit-metadata.routable.ts @@ -147,7 +147,7 @@ export class AdminOrganizationalUnitMetadataRoutable extends AbstractDetailEditC ); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new AdminOrganizationalUnitSubmissionPolicyAction.GetAll(id)); this._store.dispatch(new AdminOrganizationalUnitPreservationPolicyAction.GetAll(id)); this._store.dispatch(new AdminOrganizationalUnitDisseminationPolicyAction.GetAll(id)); @@ -163,6 +163,6 @@ export class AdminOrganizationalUnitMetadataRoutable extends AbstractDetailEditC this._store.dispatch(new Navigate([RoutesEnum.adminOrganizationalUnitDetail, this._resId, AdminRoutesEnum.organizationalUnitData, DepositRoutesEnum.edit], {}, {skipLocationChange: true})); } - protected override cleanState(): void { + protected override _cleanState(): void { } } diff --git a/src/app/features/admin/organizational-unit/stores/additional-fields-form/admin-organizational-unit-additional-fields-form.state.ts b/src/app/features/admin/organizational-unit/stores/additional-fields-form/admin-organizational-unit-additional-fields-form.state.ts index c0f804f18..e9cd5af7d 100644 --- a/src/app/features/admin/organizational-unit/stores/additional-fields-form/admin-organizational-unit-additional-fields-form.state.ts +++ b/src/app/features/admin/organizational-unit/stores/additional-fields-form/admin-organizational-unit-additional-fields-form.state.ts @@ -76,11 +76,11 @@ export interface AdminOrganizationalUnitAdditionalFieldsFormStateModel extends C }, }) export class AdminOrganizationalUnitAdditionalFieldsFormState extends CompositionState<AdminOrganizationalUnitAdditionalFieldsFormStateModel, AdditionalFieldsForm> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminOrganizationalUnitAdditionalFieldsFormActionNameSpace, resourceName: ApiResourceNameEnum.ADDITIONAL_FIELDS_FORM, }); @@ -95,7 +95,7 @@ export class AdminOrganizationalUnitAdditionalFieldsFormState extends Compositio ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.getByIdInPath<AdditionalFieldsForm>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiResourceNameEnum.CURRENT_VERSION}`) + return this._apiService.getByIdInPath<AdditionalFieldsForm>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiResourceNameEnum.CURRENT_VERSION}`) .pipe( tap(result => ctx.dispatch(new GetCurrentMetadataFormSuccess(action, result))), catchError((error: SolidifyHttpErrorResponseModel) => { @@ -125,6 +125,6 @@ export class AdminOrganizationalUnitAdditionalFieldsFormState extends Compositio @Action(AdminOrganizationalUnitAdditionalFieldsFormAction.CreateSuccess) createSuccess(ctx: StateContext<AdminOrganizationalUnitAdditionalFieldsFormStateModel>, action: AdminOrganizationalUnitAdditionalFieldsFormAction.CreateSuccess): void { super.createSuccess(ctx, action); - this.notificationService.showError(MARK_AS_TRANSLATABLE("admin.organizationalUnit.additionalFieldsForm.notification.unableToCreate")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("admin.organizationalUnit.additionalFieldsForm.notification.unableToCreate")); } } diff --git a/src/app/features/admin/organizational-unit/stores/admin-organizational-unit.state.ts b/src/app/features/admin/organizational-unit/stores/admin-organizational-unit.state.ts index f6981aba3..2a502e471 100644 --- a/src/app/features/admin/organizational-unit/stores/admin-organizational-unit.state.ts +++ b/src/app/features/admin/organizational-unit/stores/admin-organizational-unit.state.ts @@ -148,12 +148,12 @@ export interface AdminOrganizationalUnitStateModel extends ResourceLogoStateMode }) export class AdminOrganizationalUnitState extends ResourceLogoState<AdminOrganizationalUnitStateModel, OrganizationalUnit> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, protected readonly _httpClient: HttpClient) { - super(apiService, store, notificationService, actions$, { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminOrganizationalUnitActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminOrganizationalUnitDetail + urlSeparator + resId + urlSeparator + AdminRoutesEnum.organizationalUnitData, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminOrganizationalUnitDetail + urlSeparator + resId + urlSeparator + AdminRoutesEnum.organizationalUnitData, @@ -223,29 +223,29 @@ export class AdminOrganizationalUnitState extends ResourceLogoState<AdminOrganiz { action: new SharedPreservationPolicyAction.GetAll(undefined, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedPreservationPolicyAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedPreservationPolicyAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedPreservationPolicyAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedPreservationPolicyAction.GetAllFail)), ], }, { action: new SharedSubmissionPolicyAction.GetAll(undefined, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedSubmissionPolicyAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedSubmissionPolicyAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedSubmissionPolicyAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedSubmissionPolicyAction.GetAllFail)), ], }, { action: new SharedDisseminationPolicyAction.GetAll(undefined, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedDisseminationPolicyAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedDisseminationPolicyAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedDisseminationPolicyAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedDisseminationPolicyAction.GetAllFail)), ], }, { action: new SharedRoleAction.GetAll(undefined, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllFail)), ], }, ]).pipe( @@ -262,10 +262,10 @@ export class AdminOrganizationalUnitState extends ResourceLogoState<AdminOrganiz @OverrideDefaultAction() @Action(AdminOrganizationalUnitAction.Create) create(ctx: StateContext<AdminOrganizationalUnitStateModel>, action: AdminOrganizationalUnitAction.Create): Observable<OrganizationalUnit> { - return super.internalCreate(ctx, action) + return super._internalCreate(ctx, action) .pipe( tap(model => { - this.updateSubResource(model, action, ctx) + this._updateSubResource(model, action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new AdminOrganizationalUnitAction.CreateSuccess(action, model)); @@ -287,10 +287,10 @@ export class AdminOrganizationalUnitState extends ResourceLogoState<AdminOrganiz @OverrideDefaultAction() @Action(AdminOrganizationalUnitAction.Update) update(ctx: StateContext<AdminOrganizationalUnitStateModel>, action: AdminOrganizationalUnitAction.Update): Observable<OrganizationalUnit> { - return super.internalUpdate(ctx, action) + return super._internalUpdate(ctx, action) .pipe( tap(model => { - this.updateSubResource(model, action, ctx) + this._updateSubResource(model, action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new AdminOrganizationalUnitAction.UpdateSuccess(action, model)); @@ -302,7 +302,7 @@ export class AdminOrganizationalUnitState extends ResourceLogoState<AdminOrganiz ); } - private updateSubResource(model: OrganizationalUnit, action: AdminOrganizationalUnitAction.Create | AdminOrganizationalUnitAction.Update, ctx: StateContext<AdminOrganizationalUnitStateModel>): Observable<boolean> { + private _updateSubResource(model: OrganizationalUnit, action: AdminOrganizationalUnitAction.Create | AdminOrganizationalUnitAction.Update, ctx: StateContext<AdminOrganizationalUnitStateModel>): Observable<boolean> { const orgUnitId = model.resId; let oldDefaultPreservationPolicyId = undefined; @@ -337,43 +337,43 @@ export class AdminOrganizationalUnitState extends ResourceLogoState<AdminOrganiz { action: new AdminOrganizationalUnitPreservationPolicyAction.Update(orgUnitId, newPreservationPoliciesIds, oldDefaultPreservationPolicyId, newDefaultPreservationPolicyId), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitPreservationPolicyAction.UpdateSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitPreservationPolicyAction.UpdateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitPreservationPolicyAction.UpdateSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitPreservationPolicyAction.UpdateFail)), ], }, { action: new AdminOrganizationalUnitSubmissionPolicyAction.Update(orgUnitId, newSubmissionPoliciesIds, oldDefaultSubmissionPolicyId, newDefaultSubmissionPolicyId), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitSubmissionPolicyAction.UpdateSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitSubmissionPolicyAction.UpdateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitSubmissionPolicyAction.UpdateSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitSubmissionPolicyAction.UpdateFail)), ], }, { action: new AdminOrganizationalUnitDisseminationPolicyAction.Update(orgUnitId, newDisseminationPoliciesIds, oldDefaultDisseminationPolicyId, newDefaultDisseminationPolicyId), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitDisseminationPolicyAction.UpdateSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitDisseminationPolicyAction.UpdateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitDisseminationPolicyAction.UpdateSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitDisseminationPolicyAction.UpdateFail)), ], }, { action: new AdminOrganizationalUnitPersonRoleAction.Update(orgUnitId, newPersonRole), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitPersonRoleAction.UpdateSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitPersonRoleAction.UpdateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitPersonRoleAction.UpdateSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitPersonRoleAction.UpdateFail)), ], }, { action: new AdminOrganizationalUnitFundingAgencyAction.Update(orgUnitId, newFundingAgencyIds), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitFundingAgencyAction.UpdateSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitFundingAgencyAction.UpdateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitFundingAgencyAction.UpdateSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitFundingAgencyAction.UpdateFail)), ], }, { action: new AdminOrganizationalUnitInstitutionAction.Update(orgUnitId, newInstitutionsIds), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitInstitutionAction.UpdateSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitInstitutionAction.UpdateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitInstitutionAction.UpdateSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitInstitutionAction.UpdateFail)), ], }, ]).pipe( diff --git a/src/app/features/admin/organizational-unit/stores/dissemination-policy/admin-organizational-unit-dissemination-policy.state.ts b/src/app/features/admin/organizational-unit/stores/dissemination-policy/admin-organizational-unit-dissemination-policy.state.ts index a992e8bae..36ed50310 100644 --- a/src/app/features/admin/organizational-unit/stores/dissemination-policy/admin-organizational-unit-dissemination-policy.state.ts +++ b/src/app/features/admin/organizational-unit/stores/dissemination-policy/admin-organizational-unit-dissemination-policy.state.ts @@ -73,11 +73,11 @@ export interface AdminOrganizationalUnitDisseminationPolicyStateModel extends Re }, }) export class AdminOrganizationalUnitDisseminationPolicyState extends Relation2TiersState<AdminOrganizationalUnitDisseminationPolicyStateModel, DisseminationPolicy, OrganizationalUnitDisseminationPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminOrganizationalUnitDisseminationPolicyActionNameSpace, resourceName: ApiResourceNameEnum.DISSEMINATION_POLICY, }); @@ -90,14 +90,14 @@ export class AdminOrganizationalUnitDisseminationPolicyState extends Relation2Ti @OverrideDefaultAction() @Action(AdminOrganizationalUnitDisseminationPolicyAction.Update) update(ctx: StateContext<AdminOrganizationalUnitDisseminationPolicyStateModel>, action: AdminOrganizationalUnitDisseminationPolicyAction.Update): Observable<boolean> { - return super.internalUpdate(ctx, action) + return super._internalUpdate(ctx, action) .pipe( tap((isSuccess: boolean) => { if (!isSuccess) { ctx.dispatch(new AdminOrganizationalUnitDisseminationPolicyAction.UpdateFail(action, action.parentId)); return; } - this.updateSubResource(action, ctx) + this._updateSubResource(action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new AdminOrganizationalUnitDisseminationPolicyAction.UpdateSuccess(action, action.parentId)); @@ -109,7 +109,7 @@ export class AdminOrganizationalUnitDisseminationPolicyState extends Relation2Ti ); } - private updateSubResource(action: AdminOrganizationalUnitDisseminationPolicyAction.Update, ctx: StateContext<AdminOrganizationalUnitDisseminationPolicyStateModel>): Observable<boolean> { + private _updateSubResource(action: AdminOrganizationalUnitDisseminationPolicyAction.Update, ctx: StateContext<AdminOrganizationalUnitDisseminationPolicyStateModel>): Observable<boolean> { const orgUnitId = action.parentId; const listActionSubActionCompletionsWrapper: ActionSubActionCompletionsWrapper[] = []; @@ -118,14 +118,14 @@ export class AdminOrganizationalUnitDisseminationPolicyState extends Relation2Ti if (isNotNullNorUndefined(action.oldDefaultResId) && action.newResId.includes(action.oldDefaultResId)) { listActionSubActionCompletionsWrapper.push({ action: new AdminOrganizationalUnitDisseminationPolicyAction.UpdateRelation(orgUnitId, action.oldDefaultResId, {defaultPolicy: false} as OrganizationalUnitDisseminationPolicy), - subActionCompletions: this.getSubActionCompletions(), + subActionCompletions: this._getSubActionCompletions(), }); } if (isNotNullNorUndefined(action.newDefaultResId)) { listActionSubActionCompletionsWrapper.push({ action: new AdminOrganizationalUnitDisseminationPolicyAction.UpdateRelation(orgUnitId, action.newDefaultResId, {defaultPolicy: true} as OrganizationalUnitDisseminationPolicy), - subActionCompletions: this.getSubActionCompletions(), + subActionCompletions: this._getSubActionCompletions(), }); } } @@ -137,10 +137,10 @@ export class AdminOrganizationalUnitDisseminationPolicyState extends Relation2Ti ); } - private getSubActionCompletions(): Observable<ActionCompletion<BaseSubAction<AdminOrganizationalUnitDisseminationPolicyAction.UpdateRelation>, Error>>[] | undefined { + private _getSubActionCompletions(): Observable<ActionCompletion<BaseSubAction<AdminOrganizationalUnitDisseminationPolicyAction.UpdateRelation>, Error>>[] | undefined { return [ - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitDisseminationPolicyAction.UpdateRelationSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitDisseminationPolicyAction.UpdateRelationFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitDisseminationPolicyAction.UpdateRelationSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitDisseminationPolicyAction.UpdateRelationFail)), ]; } } diff --git a/src/app/features/admin/organizational-unit/stores/funding-agency/admin-organizational-unit-funding-agency.state.ts b/src/app/features/admin/organizational-unit/stores/funding-agency/admin-organizational-unit-funding-agency.state.ts index 05f6da61a..3fb42b467 100644 --- a/src/app/features/admin/organizational-unit/stores/funding-agency/admin-organizational-unit-funding-agency.state.ts +++ b/src/app/features/admin/organizational-unit/stores/funding-agency/admin-organizational-unit-funding-agency.state.ts @@ -51,11 +51,11 @@ export interface AdminOrganizationalUnitFundingAgencyStateModel extends Associat }, }) export class AdminOrganizationalUnitFundingAgencyState extends AssociationState<AdminOrganizationalUnitFundingAgencyStateModel, FundingAgency> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminOrganizationalUnitFundingAgencyNamespace, resourceName: ApiResourceNameEnum.FUNDING_AGENCY, }); diff --git a/src/app/features/admin/organizational-unit/stores/institution/admin-organizational-unit-institution.state.ts b/src/app/features/admin/organizational-unit/stores/institution/admin-organizational-unit-institution.state.ts index c7e9d102c..000f811d5 100644 --- a/src/app/features/admin/organizational-unit/stores/institution/admin-organizational-unit-institution.state.ts +++ b/src/app/features/admin/organizational-unit/stores/institution/admin-organizational-unit-institution.state.ts @@ -51,11 +51,11 @@ export interface AdminOrganizationalUnitInstitutionStateModel extends Associatio }, }) export class AdminOrganizationalUnitInstitutionState extends AssociationState<AdminOrganizationalUnitInstitutionStateModel, Institution> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminOrganizationalUnitInstitutionNamespace, resourceName: ApiResourceNameEnum.INSTITUTION, }); diff --git a/src/app/features/admin/organizational-unit/stores/person-role/admin-organizational-unit-person-role.state.ts b/src/app/features/admin/organizational-unit/stores/person-role/admin-organizational-unit-person-role.state.ts index d2031749c..75f0ad047 100644 --- a/src/app/features/admin/organizational-unit/stores/person-role/admin-organizational-unit-person-role.state.ts +++ b/src/app/features/admin/organizational-unit/stores/person-role/admin-organizational-unit-person-role.state.ts @@ -63,11 +63,11 @@ export interface AdminOrganizationalUnitPersonRoleStateModel extends Relation3Ti }) // OrganizationalUnitPersonController export class AdminOrganizationalUnitPersonRoleState extends Relation3TiersState<AdminOrganizationalUnitPersonRoleStateModel, PersonRole, OrganizationalUnitPersonRole> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminOrganizationalUnitPersonRoleActionNameSpace, resourceName: ApiResourceNameEnum.PERSON, }); @@ -77,7 +77,7 @@ export class AdminOrganizationalUnitPersonRoleState extends Relation3TiersState< return ApiEnum.adminOrganizationalUnits; } - protected convertResourceInForm(resource: PersonRole): Relation3TiersForm { + protected _convertResourceInForm(resource: PersonRole): Relation3TiersForm { return {id: resource.resId, listId: resource.roles.map(r => r.resId)}; } } diff --git a/src/app/features/admin/organizational-unit/stores/preservation-policy/admin-organizational-unit-preservation-policy.state.ts b/src/app/features/admin/organizational-unit/stores/preservation-policy/admin-organizational-unit-preservation-policy.state.ts index 06e493e3f..c9ea924f1 100644 --- a/src/app/features/admin/organizational-unit/stores/preservation-policy/admin-organizational-unit-preservation-policy.state.ts +++ b/src/app/features/admin/organizational-unit/stores/preservation-policy/admin-organizational-unit-preservation-policy.state.ts @@ -73,11 +73,11 @@ export interface AdminOrganizationalUnitPreservationPolicyStateModel extends Rel }, }) export class AdminOrganizationalUnitPreservationPolicyState extends Relation2TiersState<AdminOrganizationalUnitPreservationPolicyStateModel, PreservationPolicy, OrganizationalUnitPreservationPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminOrganizationalUnitPreservationPolicyActionNameSpace, resourceName: ApiResourceNameEnum.PRES_POLICY, }); @@ -90,14 +90,14 @@ export class AdminOrganizationalUnitPreservationPolicyState extends Relation2Tie @OverrideDefaultAction() @Action(AdminOrganizationalUnitPreservationPolicyAction.Update) update(ctx: StateContext<AdminOrganizationalUnitPreservationPolicyStateModel>, action: AdminOrganizationalUnitPreservationPolicyAction.Update): Observable<boolean> { - return super.internalUpdate(ctx, action) + return super._internalUpdate(ctx, action) .pipe( tap((isSuccess: boolean) => { if (!isSuccess) { ctx.dispatch(new AdminOrganizationalUnitPreservationPolicyAction.UpdateFail(action, action.parentId)); return; } - this.updateSubResource(action, ctx) + this._updateSubResource(action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new AdminOrganizationalUnitPreservationPolicyAction.UpdateSuccess(action, action.parentId)); @@ -109,7 +109,7 @@ export class AdminOrganizationalUnitPreservationPolicyState extends Relation2Tie ); } - private updateSubResource(action: AdminOrganizationalUnitPreservationPolicyAction.Update, ctx: StateContext<AdminOrganizationalUnitPreservationPolicyStateModel>): Observable<boolean> { + private _updateSubResource(action: AdminOrganizationalUnitPreservationPolicyAction.Update, ctx: StateContext<AdminOrganizationalUnitPreservationPolicyStateModel>): Observable<boolean> { const orgUnitId = action.parentId; const listActionSubActionCompletionsWrapper: ActionSubActionCompletionsWrapper[] = []; @@ -118,14 +118,14 @@ export class AdminOrganizationalUnitPreservationPolicyState extends Relation2Tie if (isNotNullNorUndefined(action.oldDefaultResId) && action.newResId.includes(action.oldDefaultResId)) { listActionSubActionCompletionsWrapper.push({ action: new AdminOrganizationalUnitPreservationPolicyAction.UpdateRelation(orgUnitId, action.oldDefaultResId, {defaultPolicy: false} as OrganizationalUnitPreservationPolicy), - subActionCompletions: this.getSubActionCompletions(), + subActionCompletions: this._getSubActionCompletions(), }); } if (isNotNullNorUndefined(action.newDefaultResId)) { listActionSubActionCompletionsWrapper.push({ action: new AdminOrganizationalUnitPreservationPolicyAction.UpdateRelation(orgUnitId, action.newDefaultResId, {defaultPolicy: true} as OrganizationalUnitPreservationPolicy), - subActionCompletions: this.getSubActionCompletions(), + subActionCompletions: this._getSubActionCompletions(), }); } } @@ -137,10 +137,10 @@ export class AdminOrganizationalUnitPreservationPolicyState extends Relation2Tie ); } - private getSubActionCompletions(): Observable<ActionCompletion<BaseSubAction<AdminOrganizationalUnitPreservationPolicyAction.UpdateRelation>, Error>>[] | undefined { + private _getSubActionCompletions(): Observable<ActionCompletion<BaseSubAction<AdminOrganizationalUnitPreservationPolicyAction.UpdateRelation>, Error>>[] | undefined { return [ - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitPreservationPolicyAction.UpdateRelationSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitPreservationPolicyAction.UpdateRelationFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitPreservationPolicyAction.UpdateRelationSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitPreservationPolicyAction.UpdateRelationFail)), ]; } } diff --git a/src/app/features/admin/organizational-unit/stores/submission-policy/admin-organizational-unit-submission-policy.state.ts b/src/app/features/admin/organizational-unit/stores/submission-policy/admin-organizational-unit-submission-policy.state.ts index 139340983..e6cbccc91 100644 --- a/src/app/features/admin/organizational-unit/stores/submission-policy/admin-organizational-unit-submission-policy.state.ts +++ b/src/app/features/admin/organizational-unit/stores/submission-policy/admin-organizational-unit-submission-policy.state.ts @@ -73,11 +73,11 @@ export interface AdminOrganizationalUnitSubmissionPolicyStateModel extends Relat }, }) export class AdminOrganizationalUnitSubmissionPolicyState extends Relation2TiersState<AdminOrganizationalUnitSubmissionPolicyStateModel, SubmissionPolicy, OrganizationalUnitSubmissionPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminOrganizationalUnitSubmissionPolicyActionNameSpace, resourceName: ApiResourceNameEnum.SUB_POLICY, }); @@ -90,14 +90,14 @@ export class AdminOrganizationalUnitSubmissionPolicyState extends Relation2Tiers @OverrideDefaultAction() @Action(AdminOrganizationalUnitSubmissionPolicyAction.Update) update(ctx: StateContext<AdminOrganizationalUnitSubmissionPolicyStateModel>, action: AdminOrganizationalUnitSubmissionPolicyAction.Update): Observable<boolean> { - return super.internalUpdate(ctx, action) + return super._internalUpdate(ctx, action) .pipe( tap((isSuccess: boolean) => { if (!isSuccess) { ctx.dispatch(new AdminOrganizationalUnitSubmissionPolicyAction.UpdateFail(action, action.parentId)); return; } - this.updateSubResource(action, ctx) + this._updateSubResource(action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new AdminOrganizationalUnitSubmissionPolicyAction.UpdateSuccess(action, action.parentId)); @@ -109,7 +109,7 @@ export class AdminOrganizationalUnitSubmissionPolicyState extends Relation2Tiers ); } - private updateSubResource(action: AdminOrganizationalUnitSubmissionPolicyAction.Update, ctx: StateContext<AdminOrganizationalUnitSubmissionPolicyStateModel>): Observable<boolean> { + private _updateSubResource(action: AdminOrganizationalUnitSubmissionPolicyAction.Update, ctx: StateContext<AdminOrganizationalUnitSubmissionPolicyStateModel>): Observable<boolean> { const orgUnitId = action.parentId; const listActionSubActionCompletionsWrapper: ActionSubActionCompletionsWrapper[] = []; @@ -118,14 +118,14 @@ export class AdminOrganizationalUnitSubmissionPolicyState extends Relation2Tiers if (isNotNullNorUndefined(action.oldDefaultResId) && action.newResId.includes(action.oldDefaultResId)) { listActionSubActionCompletionsWrapper.push({ action: new AdminOrganizationalUnitSubmissionPolicyAction.UpdateRelation(orgUnitId, action.oldDefaultResId, {defaultPolicy: false} as OrganizationalUnitSubmissionPolicy), - subActionCompletions: this.getSubActionCompletions(), + subActionCompletions: this._getSubActionCompletions(), }); } if (isNotNullNorUndefined(action.newDefaultResId)) { listActionSubActionCompletionsWrapper.push({ action: new AdminOrganizationalUnitSubmissionPolicyAction.UpdateRelation(orgUnitId, action.newDefaultResId, {defaultPolicy: true} as OrganizationalUnitSubmissionPolicy), - subActionCompletions: this.getSubActionCompletions(), + subActionCompletions: this._getSubActionCompletions(), }); } } @@ -137,10 +137,10 @@ export class AdminOrganizationalUnitSubmissionPolicyState extends Relation2Tiers ); } - private getSubActionCompletions(): Observable<ActionCompletion<BaseSubAction<AdminOrganizationalUnitSubmissionPolicyAction.UpdateRelation>, Error>>[] | undefined { + private _getSubActionCompletions(): Observable<ActionCompletion<BaseSubAction<AdminOrganizationalUnitSubmissionPolicyAction.UpdateRelation>, Error>>[] | undefined { return [ - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitSubmissionPolicyAction.UpdateRelationSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitSubmissionPolicyAction.UpdateRelationFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitSubmissionPolicyAction.UpdateRelationSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminOrganizationalUnitSubmissionPolicyAction.UpdateRelationFail)), ]; } } diff --git a/src/app/features/admin/person/components/presentationals/admin-person-form/admin-person-form.presentational.ts b/src/app/features/admin/person/components/presentationals/admin-person-form/admin-person-form.presentational.ts index 94d7c7785..b1c0ce39a 100644 --- a/src/app/features/admin/person/components/presentationals/admin-person-form/admin-person-form.presentational.ts +++ b/src/app/features/admin/person/components/presentationals/admin-person-form/admin-person-form.presentational.ts @@ -100,7 +100,7 @@ export class AdminPersonFormPresentational extends AbstractFormPresentational<Pe super(_changeDetectorRef, _elementRef, _injector); } - protected bindFormTo(person: Person): void { + protected _bindFormTo(person: Person): void { this.form = this._fb.group({ [this.formDefinition.firstName]: [person.firstName, [Validators.required, SolidifyValidator]], [this.formDefinition.lastName]: [person.lastName, [Validators.required, SolidifyValidator]], @@ -110,7 +110,7 @@ export class AdminPersonFormPresentational extends AbstractFormPresentational<Pe }); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.firstName]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.lastName]: ["", [Validators.required, SolidifyValidator]], @@ -120,7 +120,7 @@ export class AdminPersonFormPresentational extends AbstractFormPresentational<Pe }); } - protected treatmentBeforeSubmit(person: Person): Person { + protected _treatmentBeforeSubmit(person: Person): Person { person.institutions = []; const listInstitutions = this.form.get(this.formDefinition.institutions).value; if (!isNullOrUndefined(listInstitutions)) { diff --git a/src/app/features/admin/person/components/routables/admin-person-detail-edit/admin-person-detail-edit.routable.ts b/src/app/features/admin/person/components/routables/admin-person-detail-edit/admin-person-detail-edit.routable.ts index e7558caaf..2720ce7b8 100644 --- a/src/app/features/admin/person/components/routables/admin-person-detail-edit/admin-person-detail-edit.routable.ts +++ b/src/app/features/admin/person/components/routables/admin-person-detail-edit/admin-person-detail-edit.routable.ts @@ -76,16 +76,16 @@ export class AdminPersonDetailEditRoutable extends AbstractDetailEditCommonRouta readonly KEY_PARAM_NAME: keyof Person & string = "fullName"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_person, _injector, adminPersonActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new AdminPersonOrgUnitRoleAction.GetAll(id)); this._store.dispatch(new AdminPersonInstitutionsAction.GetAll(id)); } diff --git a/src/app/features/admin/person/stores/admin-person.state.ts b/src/app/features/admin/person/stores/admin-person.state.ts index 898fae612..3f659d2f6 100644 --- a/src/app/features/admin/person/stores/admin-person.state.ts +++ b/src/app/features/admin/person/stores/admin-person.state.ts @@ -94,11 +94,11 @@ export interface AdminPersonStateModel extends ResourceStateModel<Person> { ], }) export class AdminPersonState extends ResourceState<AdminPersonStateModel, Person> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminPersonActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminPersonDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminPersonDetail + urlSeparator + resId, @@ -156,8 +156,8 @@ export class AdminPersonState extends ResourceState<AdminPersonStateModel, Perso { action: new SharedRoleAction.GetAll(undefined, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllFail)), ], }, ]).pipe( @@ -175,10 +175,10 @@ export class AdminPersonState extends ResourceState<AdminPersonStateModel, Perso @OverrideDefaultAction() @Action(AdminPersonAction.Create) create(ctx: StateContext<AdminPersonStateModel>, action: AdminPersonAction.Create): Observable<Person> { - return super.internalCreate(ctx, action) + return super._internalCreate(ctx, action) .pipe( tap(model => { - this.updateSubResource(model, action, ctx) + this._updateSubResource(model, action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new AdminPersonAction.CreateSuccess(action, model)); @@ -193,10 +193,10 @@ export class AdminPersonState extends ResourceState<AdminPersonStateModel, Perso @OverrideDefaultAction() @Action(AdminPersonAction.Update) update(ctx: StateContext<AdminPersonStateModel>, action: AdminPersonAction.Update): Observable<Person> { - return super.internalUpdate(ctx, action) + return super._internalUpdate(ctx, action) .pipe( tap(model => { - this.updateSubResource(model, action, ctx) + this._updateSubResource(model, action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new AdminPersonAction.UpdateSuccess(action, model)); @@ -208,7 +208,7 @@ export class AdminPersonState extends ResourceState<AdminPersonStateModel, Perso ); } - private updateSubResource(model: Person, action: AdminPersonAction.Create | AdminPersonAction.Update, ctx: StateContext<AdminPersonStateModel>): Observable<boolean> { + private _updateSubResource(model: Person, action: AdminPersonAction.Create | AdminPersonAction.Update, ctx: StateContext<AdminPersonStateModel>): Observable<boolean> { const personId = model.resId; const newOrgUnitRole = action.modelFormControlEvent.formControl.get("orgUnitRole").value as Relation3TiersForm[]; newOrgUnitRole.forEach((elem) => { @@ -222,15 +222,15 @@ export class AdminPersonState extends ResourceState<AdminPersonStateModel, Perso { action: new AdminPersonOrgUnitRoleAction.Update(personId, newOrgUnitRole), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(AdminPersonOrgUnitRoleAction.UpdateSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AdminPersonOrgUnitRoleAction.UpdateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminPersonOrgUnitRoleAction.UpdateSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminPersonOrgUnitRoleAction.UpdateFail)), ], }, { action: new AdminPersonInstitutionsAction.Update(personId, newInstitutions), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(AdminPersonInstitutionsAction.UpdateSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AdminPersonInstitutionsAction.UpdateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminPersonInstitutionsAction.UpdateSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AdminPersonInstitutionsAction.UpdateFail)), ], }, ]).pipe( diff --git a/src/app/features/admin/person/stores/institutions/admin-people-institutions.state.ts b/src/app/features/admin/person/stores/institutions/admin-people-institutions.state.ts index 74043a2df..2ce4e20be 100644 --- a/src/app/features/admin/person/stores/institutions/admin-people-institutions.state.ts +++ b/src/app/features/admin/person/stores/institutions/admin-people-institutions.state.ts @@ -52,11 +52,11 @@ export interface AdminPersonInstitutionsStateModel extends AssociationStateModel }, }) export class AdminPersonInstitutionsState extends AssociationState<AdminPersonInstitutionsStateModel, Institution> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminPersonInstitutionNamespace, resourceName: ApiResourceNameEnum.INSTITUTION, }); diff --git a/src/app/features/admin/person/stores/person-role/admin-person-orgunit-role.state.ts b/src/app/features/admin/person/stores/person-role/admin-person-orgunit-role.state.ts index 2bf0191a6..aef7bfa1d 100644 --- a/src/app/features/admin/person/stores/person-role/admin-person-orgunit-role.state.ts +++ b/src/app/features/admin/person/stores/person-role/admin-person-orgunit-role.state.ts @@ -63,11 +63,11 @@ export interface AdminPersonOrgUnitRoleStateModel extends Relation3TiersStateMod }) // PersonOrganizationalUnitController export class AdminPersonOrgUnitRoleState extends Relation3TiersState<AdminPersonOrgUnitRoleStateModel, OrganizationalUnitRole, OrganizationalUnitPersonRole> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminPersonOrgUnitRoleActionNameSpace, resourceName: ApiResourceNameEnum.ORG_UNIT, }); @@ -77,7 +77,7 @@ export class AdminPersonOrgUnitRoleState extends Relation3TiersState<AdminPerson return ApiEnum.adminPeople; } - protected convertResourceInForm(resource: OrganizationalUnitRole): Relation3TiersForm { + protected _convertResourceInForm(resource: OrganizationalUnitRole): Relation3TiersForm { return {id: resource.resId, listId: resource.roles.map(r => r.resId)}; } } diff --git a/src/app/features/admin/preservation-policy/components/presentationals/admin-preservation-policy-form/admin-preservation-policy-form.presentational.ts b/src/app/features/admin/preservation-policy/components/presentationals/admin-preservation-policy-form/admin-preservation-policy-form.presentational.ts index 97b01602e..b489c9038 100644 --- a/src/app/features/admin/preservation-policy/components/presentationals/admin-preservation-policy-form/admin-preservation-policy-form.presentational.ts +++ b/src/app/features/admin/preservation-policy/components/presentationals/admin-preservation-policy-form/admin-preservation-policy-form.presentational.ts @@ -66,7 +66,7 @@ export class AdminPreservationPolicyFormPresentational extends AbstractFormPrese super(_changeDetectorRef, _elementRef, _injector); } - protected bindFormTo(preservationPolicies: PreservationPolicy): void { + protected _bindFormTo(preservationPolicies: PreservationPolicy): void { this.form = this._fb.group({ [this.formDefinition.name]: [preservationPolicies.name, [Validators.required, SolidifyValidator]], [this.formDefinition.dispositionApproval]: [preservationPolicies.dispositionApproval, [SolidifyValidator]], @@ -74,7 +74,7 @@ export class AdminPreservationPolicyFormPresentational extends AbstractFormPrese }); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.name]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.dispositionApproval]: [false, [SolidifyValidator]], @@ -82,7 +82,7 @@ export class AdminPreservationPolicyFormPresentational extends AbstractFormPrese }); } - protected treatmentBeforeSubmit(preservationPolicies: PreservationPolicy): PreservationPolicy { + protected _treatmentBeforeSubmit(preservationPolicies: PreservationPolicy): PreservationPolicy { return preservationPolicies; } diff --git a/src/app/features/admin/preservation-policy/components/routables/admin-preservation-policy-detail-edit/admin-preservation-policy-detail-edit.routable.ts b/src/app/features/admin/preservation-policy/components/routables/admin-preservation-policy-detail-edit/admin-preservation-policy-detail-edit.routable.ts index fa8b65a8d..baf78a435 100644 --- a/src/app/features/admin/preservation-policy/components/routables/admin-preservation-policy-detail-edit/admin-preservation-policy-detail-edit.routable.ts +++ b/src/app/features/admin/preservation-policy/components/routables/admin-preservation-policy-detail-edit/admin-preservation-policy-detail-edit.routable.ts @@ -56,16 +56,16 @@ export class AdminPreservationPolicyDetailEditRoutable extends AbstractDetailEdi readonly KEY_PARAM_NAME: keyof PreservationPolicy & string = "name"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_preservationPolicy, _injector, adminPreservationPolicyActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/admin/preservation-policy/stores/admin-preservation-policy.state.ts b/src/app/features/admin/preservation-policy/stores/admin-preservation-policy.state.ts index f88fcafa2..2f6a2c2d6 100644 --- a/src/app/features/admin/preservation-policy/stores/admin-preservation-policy.state.ts +++ b/src/app/features/admin/preservation-policy/stores/admin-preservation-policy.state.ts @@ -58,11 +58,11 @@ export interface AdminPreservationPolicyStateModel extends ResourceStateModel<Pr }, }) export class AdminPreservationPolicyState extends ResourceState<AdminPreservationPolicyStateModel, PreservationPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminPreservationPolicyActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminPreservationPolicyDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminPreservationPolicyDetail + urlSeparator + resId, diff --git a/src/app/features/admin/research-domain/components/dialogs/admin-research-domain-create-edit/admin-research-domain-create-edit.dialog.ts b/src/app/features/admin/research-domain/components/dialogs/admin-research-domain-create-edit/admin-research-domain-create-edit.dialog.ts index 4230cd086..548345a4f 100644 --- a/src/app/features/admin/research-domain/components/dialogs/admin-research-domain-create-edit/admin-research-domain-create-edit.dialog.ts +++ b/src/app/features/admin/research-domain/components/dialogs/admin-research-domain-create-edit/admin-research-domain-create-edit.dialog.ts @@ -66,7 +66,7 @@ export class AdminResearchDomainCreateEditDialog extends SharedAbstractCreateEdi override checkAvailableResourceNameSpace: ResourceNameSpace = sharedResearchDomainActionNameSpace; - constructor(@Inject(MAT_DIALOG_DATA) protected readonly data: CreateEditDialog<ResearchDomain>, + constructor(@Inject(MAT_DIALOG_DATA) protected readonly _data: CreateEditDialog<ResearchDomain>, protected readonly _store: Store, protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, @@ -74,10 +74,10 @@ export class AdminResearchDomainCreateEditDialog extends SharedAbstractCreateEdi protected readonly _injector: Injector, protected readonly _dialog: MatDialog, protected readonly _dialogRef: MatDialogRef<AdminResearchDomainCreateEditDialog>) { - super(data, _store, _route, _actions$, _changeDetector, _dialog, _dialogRef, StateEnum.admin_researchDomain, adminResearchDomainActionNameSpace, _injector, StateEnum.admin); + super(_data, _store, _route, _actions$, _changeDetector, _dialog, _dialogRef, StateEnum.admin_researchDomain, adminResearchDomainActionNameSpace, _injector, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } readonly KEY_CANCEL_BUTTON: string | undefined; diff --git a/src/app/features/admin/research-domain/components/presentationals/admin-research-domain-form/admin-research-domain-form.presentational.ts b/src/app/features/admin/research-domain/components/presentationals/admin-research-domain-form/admin-research-domain-form.presentational.ts index 58270b049..5c2096f43 100644 --- a/src/app/features/admin/research-domain/components/presentationals/admin-research-domain-form/admin-research-domain-form.presentational.ts +++ b/src/app/features/admin/research-domain/components/presentationals/admin-research-domain-form/admin-research-domain-form.presentational.ts @@ -69,15 +69,15 @@ export class AdminResearchDomainFormPresentational extends AbstractFormPresentat } this.languages.forEach(language => { if (isNullOrUndefined(this.model) || isNullOrUndefined(this.model.labels)) { - this.addControl(language.resId); + this._addControl(language.resId); return; } const existingValue = (this.model.labels as ResearchDomainLabel[]).find(label => label.language.resId === language.resId); if (isNullOrUndefined(existingValue)) { - this.addControl(language.resId); + this._addControl(language.resId); return; } - this.addControl(language.resId, existingValue.text); + this._addControl(language.resId, existingValue.text); }); } @@ -85,7 +85,7 @@ export class AdminResearchDomainFormPresentational extends AbstractFormPresentat return this._languages; } - private addControl(languageResId: string, value: string | undefined = undefined): void { + private _addControl(languageResId: string, value: string | undefined = undefined): void { this.form.addControl(languageResId, this._fb.control(value)); } @@ -98,7 +98,7 @@ export class AdminResearchDomainFormPresentational extends AbstractFormPresentat super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.name]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.source]: ["", [Validators.required, SolidifyValidator]], @@ -106,7 +106,7 @@ export class AdminResearchDomainFormPresentational extends AbstractFormPresentat }); } - protected bindFormTo(researchDomains: ResearchDomain): void { + protected _bindFormTo(researchDomains: ResearchDomain): void { this.form = this._fb.group({ [this.formDefinition.name]: [researchDomains.name, [Validators.required, SolidifyValidator]], [this.formDefinition.source]: [researchDomains.source, [Validators.required, SolidifyValidator]], @@ -114,7 +114,7 @@ export class AdminResearchDomainFormPresentational extends AbstractFormPresentat }); } - protected treatmentBeforeSubmit(researchDomains: ResearchDomain): ResearchDomain { + protected _treatmentBeforeSubmit(researchDomains: ResearchDomain): ResearchDomain { const newLabels: ResearchDomainLabel[] = []; this.languages.forEach(language => { newLabels.push({ diff --git a/src/app/features/admin/research-domain/components/routables/admin-research-domain-list/admin-research-domain-list.routable.ts b/src/app/features/admin/research-domain/components/routables/admin-research-domain-list/admin-research-domain-list.routable.ts index fab8549bb..d5a6124c3 100644 --- a/src/app/features/admin/research-domain/components/routables/admin-research-domain-list/admin-research-domain-list.routable.ts +++ b/src/app/features/admin/research-domain/components/routables/admin-research-domain-list/admin-research-domain-list.routable.ts @@ -97,7 +97,7 @@ export class AdminResearchDomainListRoutable extends AbstractListRoutable<Resear filter(languages => !isNullOrUndefined(languages)), take(1), ), - languages => this.addLanguagesColumns(languages)); + languages => this._addLanguagesColumns(languages)); } conditionDisplayEditButton(model: ResearchDomain | undefined): boolean { @@ -154,7 +154,7 @@ export class AdminResearchDomainListRoutable extends AbstractListRoutable<Resear ]; } - private addLanguagesColumns(listLanguages: Language[]): void { + private _addLanguagesColumns(listLanguages: Language[]): void { const languagesColumn: DataTableColumns<ResearchDomain>[] = []; listLanguages.forEach(language => { languagesColumn.push({ diff --git a/src/app/features/admin/research-domain/stores/admin-research-domain.state.ts b/src/app/features/admin/research-domain/stores/admin-research-domain.state.ts index 893e56372..9175b11a0 100644 --- a/src/app/features/admin/research-domain/stores/admin-research-domain.state.ts +++ b/src/app/features/admin/research-domain/stores/admin-research-domain.state.ts @@ -66,11 +66,11 @@ export interface AdminResearchDomainStateModel extends ResourceStateModel<Resear }, }) export class AdminResearchDomainState extends ResourceState<AdminResearchDomainStateModel, ResearchDomain> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminResearchDomainActionNameSpace, routeRedirectUrlAfterSuccessDeleteAction: RoutesEnum.adminResearchDomain, notificationResourceCreateSuccessTextToTranslate: MARK_AS_TRANSLATABLE("admin.researchDomain.notification.resource.create"), @@ -122,8 +122,8 @@ export class AdminResearchDomainState extends ResourceState<AdminResearchDomainS { action: new SharedLanguageAction.GetAll(null, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedLanguageAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedLanguageAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedLanguageAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedLanguageAction.GetAllFail)), ], }, ]).pipe( diff --git a/src/app/features/admin/role/components/presentationals/admin-role-form/admin-role-form.presentational.ts b/src/app/features/admin/role/components/presentationals/admin-role-form/admin-role-form.presentational.ts index 93bc66824..e9fbdd926 100644 --- a/src/app/features/admin/role/components/presentationals/admin-role-form/admin-role-form.presentational.ts +++ b/src/app/features/admin/role/components/presentationals/admin-role-form/admin-role-form.presentational.ts @@ -66,22 +66,22 @@ export class AdminRoleFormPresentational extends AbstractFormPresentational<Role super(_changeDetectorRef, _elementRef, _injector); } - protected bindFormTo(role: Role): void { + protected _bindFormTo(role: Role): void { this.form = this._fb.group({ [this.formDefinition.name]: [role.name, [Validators.required, SolidifyValidator]], [this.formDefinition.level]: [role.level], }); } - protected initNewForm(): void { + protected _initNewForm(): void { } - protected treatmentBeforeSubmit(role: Role): Role { + protected _treatmentBeforeSubmit(role: Role): Role { role.level = this.model.level; return role; } - protected override disableSpecificField(): void { + protected override _disableSpecificField(): void { this.form.get(this.formDefinition.level).disable(); } } diff --git a/src/app/features/admin/role/components/routables/admin-role-detail-edit/admin-role-detail-edit.routable.ts b/src/app/features/admin/role/components/routables/admin-role-detail-edit/admin-role-detail-edit.routable.ts index 9175e8489..db7a1d1b8 100644 --- a/src/app/features/admin/role/components/routables/admin-role-detail-edit/admin-role-detail-edit.routable.ts +++ b/src/app/features/admin/role/components/routables/admin-role-detail-edit/admin-role-detail-edit.routable.ts @@ -64,15 +64,15 @@ export class AdminRoleDetailEditRoutable extends AbstractDetailEditCommonRoutabl override readonly deleteAvailable: boolean = false; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_role, _injector, adminRoleActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/admin/role/stores/admin-role.state.ts b/src/app/features/admin/role/stores/admin-role.state.ts index 22420fadc..4f96394ce 100644 --- a/src/app/features/admin/role/stores/admin-role.state.ts +++ b/src/app/features/admin/role/stores/admin-role.state.ts @@ -59,11 +59,11 @@ export interface AdminRoleStateModel extends ResourceStateModel<Role> { }) export class AdminRoleState extends ResourceState<AdminRoleStateModel, Role> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminRoleActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminRoleDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminRoleDetail + urlSeparator + resId, diff --git a/src/app/features/admin/stores/admin.state.ts b/src/app/features/admin/stores/admin.state.ts index 4c2adb9df..ae8295084 100644 --- a/src/app/features/admin/stores/admin.state.ts +++ b/src/app/features/admin/stores/admin.state.ts @@ -172,6 +172,6 @@ export interface AdminStateModel extends BaseStateModel { ], }) export class AdminState { - constructor(protected store: Store) { + constructor(protected readonly _store: Store) { } } diff --git a/src/app/features/admin/submission-policy/components/presentationals/admin-submission-policy-form/admin-submission-policy-form.presentational.ts b/src/app/features/admin/submission-policy/components/presentationals/admin-submission-policy-form/admin-submission-policy-form.presentational.ts index 821e16251..d1ed07cef 100644 --- a/src/app/features/admin/submission-policy/components/presentationals/admin-submission-policy-form/admin-submission-policy-form.presentational.ts +++ b/src/app/features/admin/submission-policy/components/presentationals/admin-submission-policy-form/admin-submission-policy-form.presentational.ts @@ -66,7 +66,7 @@ export class AdminSubmissionPolicyFormPresentational extends AbstractFormPresent super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.name]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.submissionApproval]: [false, [SolidifyValidator]], @@ -74,7 +74,7 @@ export class AdminSubmissionPolicyFormPresentational extends AbstractFormPresent }); } - protected bindFormTo(submissionPolicies: SubmissionPolicy): void { + protected _bindFormTo(submissionPolicies: SubmissionPolicy): void { this.form = this._fb.group({ [this.formDefinition.name]: [submissionPolicies.name, [Validators.required, SolidifyValidator]], [this.formDefinition.submissionApproval]: [submissionPolicies.submissionApproval, [SolidifyValidator]], @@ -82,7 +82,7 @@ export class AdminSubmissionPolicyFormPresentational extends AbstractFormPresent }); } - protected treatmentBeforeSubmit(submissionPolicies: SubmissionPolicy): SubmissionPolicy { + protected _treatmentBeforeSubmit(submissionPolicies: SubmissionPolicy): SubmissionPolicy { return submissionPolicies; } } diff --git a/src/app/features/admin/submission-policy/components/routables/admin-submission-policy-detail-edit/admin-submission-policy-detail-edit.routable.ts b/src/app/features/admin/submission-policy/components/routables/admin-submission-policy-detail-edit/admin-submission-policy-detail-edit.routable.ts index 2a2963555..7a9ca8fd9 100644 --- a/src/app/features/admin/submission-policy/components/routables/admin-submission-policy-detail-edit/admin-submission-policy-detail-edit.routable.ts +++ b/src/app/features/admin/submission-policy/components/routables/admin-submission-policy-detail-edit/admin-submission-policy-detail-edit.routable.ts @@ -56,15 +56,15 @@ export class AdminSubmissionPolicyDetailEditRoutable extends AbstractDetailEditC readonly KEY_PARAM_NAME: keyof SubmissionPolicy & string = "name"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_submissionPolicy, _injector, adminSubmissionPolicyActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/admin/submission-policy/stores/admin-submission-policy.state.ts b/src/app/features/admin/submission-policy/stores/admin-submission-policy.state.ts index a37029936..c1b9c92bf 100644 --- a/src/app/features/admin/submission-policy/stores/admin-submission-policy.state.ts +++ b/src/app/features/admin/submission-policy/stores/admin-submission-policy.state.ts @@ -58,11 +58,11 @@ export interface AdminSubmissionPolicyStateModel extends ResourceStateModel<Subm }, }) export class AdminSubmissionPolicyState extends ResourceState<AdminSubmissionPolicyStateModel, SubmissionPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminSubmissionPolicyActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminSubmissionPolicyDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminSubmissionPolicyDetail + urlSeparator + resId, diff --git a/src/app/features/admin/user/components/dialogs/admin-user-edit-role-current-user/admin-user-edit-role-current-user.dialog.ts b/src/app/features/admin/user/components/dialogs/admin-user-edit-role-current-user/admin-user-edit-role-current-user.dialog.ts index 1390f9757..c2a61f398 100644 --- a/src/app/features/admin/user/components/dialogs/admin-user-edit-role-current-user/admin-user-edit-role-current-user.dialog.ts +++ b/src/app/features/admin/user/components/dialogs/admin-user-edit-role-current-user/admin-user-edit-role-current-user.dialog.ts @@ -45,7 +45,7 @@ export class AdminUserEditRoleCurrentUserDialog extends SharedAbstractDialog<Adm return Enums.UserApplicationRole.UserApplicationRoleEnum; } - constructor(protected readonly store: Store, + constructor(protected readonly _store: Store, protected readonly _dialogRef: MatDialogRef<AdminUserEditRoleCurrentUserDialog>, @Inject(MAT_DIALOG_DATA) public readonly data: AdminUserEditRoleCurrentUserDialogData) { super(_dialogRef, data); diff --git a/src/app/features/admin/user/components/presentationals/admin-user-form/admin-user-form.presentational.ts b/src/app/features/admin/user/components/presentationals/admin-user-form/admin-user-form.presentational.ts index f5ed83bb4..f0d62edcb 100644 --- a/src/app/features/admin/user/components/presentationals/admin-user-form/admin-user-form.presentational.ts +++ b/src/app/features/admin/user/components/presentationals/admin-user-form/admin-user-form.presentational.ts @@ -95,7 +95,7 @@ export class AdminUserFormPresentational extends AbstractFormPresentational<User super(_changeDetectorRef, _elementRef, _injector); } - protected bindFormTo(user: User): void { + protected _bindFormTo(user: User): void { this.form = this._fb.group({ [this.formDefinition.externalUid]: [user.externalUid, [Validators.required, SolidifyValidator]], [this.formDefinition.firstName]: [user.firstName, [Validators.required, SolidifyValidator]], @@ -109,7 +109,7 @@ export class AdminUserFormPresentational extends AbstractFormPresentational<User }); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.externalUid]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.firstName]: ["", [Validators.required, SolidifyValidator]], @@ -121,10 +121,10 @@ export class AdminUserFormPresentational extends AbstractFormPresentational<User }); } - protected disableSpecificField(): void { + protected _disableSpecificField(): void { } - protected treatmentBeforeSubmit(user: User): User { + protected _treatmentBeforeSubmit(user: User): User { delete user.lastLoginTime; delete user.lastLoginIpAddress; user.applicationRole = {resId: this.form.get(this.formDefinition.applicationRole).value}; diff --git a/src/app/features/admin/user/components/routables/admin-user-detail-edit/admin-user-detail-edit.routable.ts b/src/app/features/admin/user/components/routables/admin-user-detail-edit/admin-user-detail-edit.routable.ts index 7aca2c697..f35fa7dee 100644 --- a/src/app/features/admin/user/components/routables/admin-user-detail-edit/admin-user-detail-edit.routable.ts +++ b/src/app/features/admin/user/components/routables/admin-user-detail-edit/admin-user-detail-edit.routable.ts @@ -85,16 +85,16 @@ export class AdminUserDetailEditRoutable extends AbstractDetailEditCommonRoutabl readonly KEY_PARAM_NAME: keyof User & string = "externalUid"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.admin_user, _injector, adminUserActionNameSpace, StateEnum.admin); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } update(model: ModelFormControlEvent<User>): Observable<any> { @@ -114,7 +114,7 @@ export class AdminUserDetailEditRoutable extends AbstractDetailEditCommonRoutabl return; } - this.openModalConfirmEditRole({ + this._openModalConfirmEditRole({ addedRole: addedRole, removedRole: removedRole, } as AdminUserEditRoleCurrentUserDialogData, model); @@ -123,16 +123,16 @@ export class AdminUserDetailEditRoutable extends AbstractDetailEditCommonRoutabl return of(); } - private openModalConfirmEditRole(data: AdminUserEditRoleCurrentUserDialogData, model: ModelFormControlEvent<User>): void { + private _openModalConfirmEditRole(data: AdminUserEditRoleCurrentUserDialogData, model: ModelFormControlEvent<User>): void { this.subscribe(DialogUtil.open(this._dialog, AdminUserEditRoleCurrentUserDialog, data, undefined, isConfirmed => { if (isTrue(isConfirmed)) { - this.updateAndLogout(model); + this._updateAndLogout(model); } })); } - private updateAndLogout(model: ModelFormControlEvent<User>): void { + private _updateAndLogout(model: ModelFormControlEvent<User>): void { super.update(model); this.subscribe(this._actions$.pipe( ofSolidifyActionCompleted(AdminUserAction.UpdateSuccess), diff --git a/src/app/features/admin/user/stores/admin-user.state.ts b/src/app/features/admin/user/stores/admin-user.state.ts index e80c2c6ad..a908b06e3 100644 --- a/src/app/features/admin/user/stores/admin-user.state.ts +++ b/src/app/features/admin/user/stores/admin-user.state.ts @@ -82,12 +82,12 @@ export interface AdminUserStateModel extends ResourceLogoStateModel<User> { }, }) export class AdminUserState extends ResourceLogoState<AdminUserStateModel, User> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, protected readonly _httpClient: HttpClient) { - super(apiService, store, notificationService, actions$, { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: adminUserActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.adminUserDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.adminUserDetail + urlSeparator + resId, @@ -145,8 +145,8 @@ export class AdminUserState extends ResourceLogoState<AdminUserStateModel, User> { action: new SharedPersonAction.GetAll(undefined, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.GetAllFail)), ], }, ]).pipe( @@ -177,7 +177,7 @@ export class AdminUserState extends ResourceLogoState<AdminUserStateModel, User> isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<any, Result>(this._urlResource + urlSeparator + ApiActionNameEnum.REFRESH).pipe( + return this._apiService.post<any, Result>(this._urlResource + urlSeparator + ApiActionNameEnum.REFRESH).pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { ctx.dispatch(new AdminUserAction.RefreshSuccess(action, result)); @@ -197,7 +197,7 @@ export class AdminUserState extends ResourceLogoState<AdminUserStateModel, User> ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showSuccess(action.result.message); + this._notificationService.showSuccess(action.result.message); ctx.dispatch(new AdminUserAction.GetAll()); } @@ -206,7 +206,7 @@ export class AdminUserState extends ResourceLogoState<AdminUserStateModel, User> ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("admin.user.notification.refresh.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("admin.user.notification.refresh.fail")); } } diff --git a/src/app/features/deposit/components/containers/deposit-collection/deposit-collection.container.ts b/src/app/features/deposit/components/containers/deposit-collection/deposit-collection.container.ts index 69957c104..428f5740d 100644 --- a/src/app/features/deposit/components/containers/deposit-collection/deposit-collection.container.ts +++ b/src/app/features/deposit/components/containers/deposit-collection/deposit-collection.container.ts @@ -109,7 +109,7 @@ export class DepositCollectionContainer extends AbstractDetailEditRoutable<Depos }, { logo: IconNameEnum.internalLink, - callback: (aip: Aip) => this.goToAip(aip), + callback: (aip: Aip) => this._goToAip(aip), placeholder: current => LabelTranslateEnum.goToAip, displayOnCondition: (aip: Aip) => this._securityService.isRootOrAdmin(), }, @@ -206,23 +206,23 @@ export class DepositCollectionContainer extends AbstractDetailEditRoutable<Depos ngOnInit(): void { super.ngOnInit(); - this.getCurrentModelOnParent(); + this._getCurrentModelOnParent(); } - private getCurrentModelOnParent(): void { + private _getCurrentModelOnParent(): void { this._resId = this._route.snapshot.parent.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); - this.getDepositById(this._resId); + this._getDepositById(this._resId); } - private getDepositById(id: string): void { + private _getDepositById(id: string): void { const depositInState = MemoizedUtil.currentSnapshot(this._store, DepositState); if (isNullOrUndefined(depositInState) || id !== depositInState.resId) { this._store.dispatch(ResourceActionHelper.getById(depositActionNameSpace, id, true)); } - this.getSubResourceWithParentId(id); + this._getSubResourceWithParentId(id); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new DepositCollectionAction.GetAll(id, null, true)); } @@ -239,7 +239,7 @@ export class DepositCollectionContainer extends AbstractDetailEditRoutable<Depos this._store.dispatch(new Navigate([AppRoutesEnum.deposit, orgUnitId, DepositRoutesEnum.detail, this._resId, DepositRoutesEnum.collections, aip.resId])); } - private goToAip(aip: Aip): void { + private _goToAip(aip: Aip): void { this.subscribe(StoreUtil.dispatchActionAndWaitForSubActionCompletion(this._store, this._actions$, new DepositCollectionAction.GoToAip(aip) as any, DepositCollectionAction.GoToAip as any, diff --git a/src/app/features/deposit/components/containers/deposit-file/deposit-file.container.ts b/src/app/features/deposit/components/containers/deposit-file/deposit-file.container.ts index a36bc0719..73061b678 100644 --- a/src/app/features/deposit/components/containers/deposit-file/deposit-file.container.ts +++ b/src/app/features/deposit/components/containers/deposit-file/deposit-file.container.ts @@ -351,23 +351,23 @@ export class DepositFileContainer extends AbstractDetailEditRoutable<Deposit, De ngOnInit(): void { super.ngOnInit(); - this.getCurrentModelOnParent(); + this._getCurrentModelOnParent(); } - private getCurrentModelOnParent(): void { + private _getCurrentModelOnParent(): void { this._resId = this._route.snapshot.parent.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); - this.getDepositById(this._resId); + this._getDepositById(this._resId); } - private getDepositById(id: string): void { + private _getDepositById(id: string): void { const depositInState = MemoizedUtil.currentSnapshot(this._store, DepositState); if (isNullOrUndefined(depositInState) || id !== depositInState.resId) { this._store.dispatch(ResourceActionHelper.getById(depositActionNameSpace, id, true)); } - this.getSubResourceWithParentId(id); + this._getSubResourceWithParentId(id); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new DepositDataFileAction.GetAll(id, undefined, true)); this._store.dispatch(new DepositDataFileAction.GetListFolder(id)); } diff --git a/src/app/features/deposit/components/containers/deposit-upload/deposit-upload.container.ts b/src/app/features/deposit/components/containers/deposit-upload/deposit-upload.container.ts index c02c7d360..6e00a58fe 100644 --- a/src/app/features/deposit/components/containers/deposit-upload/deposit-upload.container.ts +++ b/src/app/features/deposit/components/containers/deposit-upload/deposit-upload.container.ts @@ -132,13 +132,13 @@ export class DepositUploadContainer extends AbstractDetailEditRoutable<Deposit, ngOnInit(): void { super.ngOnInit(); - this.getCurrentModelOnParent(); + this._getCurrentModelOnParent(); } - protected getSubResourceWithParentId(id: string): void { + protected _getSubResourceWithParentId(id: string): void { } - private getCurrentModelOnParent(): void { + private _getCurrentModelOnParent(): void { this._resId = this._route.snapshot.parent.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); } diff --git a/src/app/features/deposit/components/dialogs/deposit-file-upload-archive/deposit-file-upload-archive.dialog.ts b/src/app/features/deposit/components/dialogs/deposit-file-upload-archive/deposit-file-upload-archive.dialog.ts index ca377bcdc..1a1d860e2 100644 --- a/src/app/features/deposit/components/dialogs/deposit-file-upload-archive/deposit-file-upload-archive.dialog.ts +++ b/src/app/features/deposit/components/dialogs/deposit-file-upload-archive/deposit-file-upload-archive.dialog.ts @@ -65,9 +65,9 @@ export class DepositFileUploadArchiveDialog extends AbstractDepositFileUploadDia return EnumUtil; } - constructor(protected _dialogRef: MatDialogRef<DepositFileUploadArchiveDialog>, - protected _fb: FormBuilder, - @Inject(MAT_DIALOG_DATA) public data: DepositFileUploadArchiveDialogData) { + constructor(protected readonly _dialogRef: MatDialogRef<DepositFileUploadArchiveDialog>, + protected readonly _fb: FormBuilder, + @Inject(MAT_DIALOG_DATA) public readonly data: DepositFileUploadArchiveDialogData) { super(_dialogRef, _fb, data); } diff --git a/src/app/features/deposit/components/dialogs/deposit-file-upload/deposit-file-upload.dialog.ts b/src/app/features/deposit/components/dialogs/deposit-file-upload/deposit-file-upload.dialog.ts index 8d9ab63b0..86eb697d9 100644 --- a/src/app/features/deposit/components/dialogs/deposit-file-upload/deposit-file-upload.dialog.ts +++ b/src/app/features/deposit/components/dialogs/deposit-file-upload/deposit-file-upload.dialog.ts @@ -259,7 +259,7 @@ export class DepositFileUploadDialog extends AbstractDepositFileUploadDialog<Dep private _addNewFileToExistingList(files: File[]): void { files = files.filter(fileToFilter => { - const isIncluded = this.getIndexOfFile(fileToFilter) !== -1; + const isIncluded = this._getIndexOfFile(fileToFilter) !== -1; return !isIncluded; }); const listFileWrapper: FileWrapper[] = []; @@ -276,7 +276,7 @@ export class DepositFileUploadDialog extends AbstractDepositFileUploadDialog<Dep this.filesToUpload.push(...listFileWrapper); } - private getIndexOfFile(file: File): number { + private _getIndexOfFile(file: File): number { return this.filesToUpload.findIndex(fileAlreadyToUpload => fileAlreadyToUpload.file.name === file.name && fileAlreadyToUpload.file.type === file.type && fileAlreadyToUpload.file.size === file.size && fileAlreadyToUpload.file.lastModified === file.lastModified); } @@ -327,7 +327,7 @@ export class DepositFileUploadDialog extends AbstractDepositFileUploadDialog<Dep } delete(file: File, index?: number): void { - this.filesToUpload.splice(this.getIndexOfFile(file), 1); + this.filesToUpload.splice(this._getIndexOfFile(file), 1); this.formArray.removeAt(index); } diff --git a/src/app/features/deposit/components/dialogs/deposit-order-author/deposit-order-author.dialog.ts b/src/app/features/deposit/components/dialogs/deposit-order-author/deposit-order-author.dialog.ts index 66c81292f..de5454eb6 100644 --- a/src/app/features/deposit/components/dialogs/deposit-order-author/deposit-order-author.dialog.ts +++ b/src/app/features/deposit/components/dialogs/deposit-order-author/deposit-order-author.dialog.ts @@ -49,10 +49,10 @@ import {isNullOrUndefined} from "solidify-frontend"; export class DepositOrderAuthorDialog extends SharedAbstractDialog<DepositOrderAuthorDialogWrapper, string[]> implements OnInit { listAuthorsSorted: Person[]; - constructor(protected readonly store: Store, - protected readonly dialogRef: MatDialogRef<DepositOrderAuthorDialog>, - @Inject(MAT_DIALOG_DATA) public data: DepositOrderAuthorDialogWrapper) { - super(dialogRef, data); + constructor(protected readonly _store: Store, + protected readonly _dialogRef: MatDialogRef<DepositOrderAuthorDialog>, + @Inject(MAT_DIALOG_DATA) public readonly data: DepositOrderAuthorDialogWrapper) { + super(_dialogRef, data); } ngOnInit(): void { diff --git a/src/app/features/deposit/components/dialogs/deposit-person-alternative/deposit-person-alternative.dialog.ts b/src/app/features/deposit/components/dialogs/deposit-person-alternative/deposit-person-alternative.dialog.ts index 0333785d0..d565812a9 100644 --- a/src/app/features/deposit/components/dialogs/deposit-person-alternative/deposit-person-alternative.dialog.ts +++ b/src/app/features/deposit/components/dialogs/deposit-person-alternative/deposit-person-alternative.dialog.ts @@ -43,9 +43,9 @@ import {isNullOrUndefined} from "solidify-frontend"; export class DepositPersonAlternativeDialog extends SharedAbstractDialog<DepositPersonAlternativeDialogData, AlternativeDepositPersonSelected> { selectedDepositPerson: AlternativeDepositPersonSelected; - constructor(protected readonly dialogRef: MatDialogRef<DepositPersonAlternativeDialog>, - @Inject(MAT_DIALOG_DATA) public data: DepositPersonAlternativeDialogData) { - super(dialogRef, data); + constructor(protected readonly _dialogRef: MatDialogRef<DepositPersonAlternativeDialog>, + @Inject(MAT_DIALOG_DATA) public readonly data: DepositPersonAlternativeDialogData) { + super(_dialogRef, data); } select(selected: Person, isNew: boolean): void { diff --git a/src/app/features/deposit/components/dialogs/deposit-person/deposit-person.dialog.ts b/src/app/features/deposit/components/dialogs/deposit-person/deposit-person.dialog.ts index d8a090dd0..d67658ce2 100644 --- a/src/app/features/deposit/components/dialogs/deposit-person/deposit-person.dialog.ts +++ b/src/app/features/deposit/components/dialogs/deposit-person/deposit-person.dialog.ts @@ -69,31 +69,31 @@ export class DepositPersonDialog extends SharedAbstractDialog<DepositPersonDialo constructor(protected readonly _store: Store, protected readonly _dialogRef: MatDialogRef<DepositPersonDialog>, - private readonly notificationService: NotificationService, - private readonly dialog: MatDialog, + private readonly _notificationService: NotificationService, + private readonly _dialog: MatDialog, private readonly _actions$: Actions, - @Inject(MAT_DIALOG_DATA) public data: DepositPersonDialogData) { + @Inject(MAT_DIALOG_DATA) public readonly data: DepositPersonDialogData) { super(_dialogRef, data); } savePerson($event: ModelFormControlEvent<Person>): void { - this.checkSimilarPerson($event); + this._checkSimilarPerson($event); } - private checkSimilarPerson($event: ModelFormControlEvent<Person>): void { + private _checkSimilarPerson($event: ModelFormControlEvent<Person>): void { this.subscribe(this._store.dispatch(new SharedPersonAction.Search($event.model)).pipe( tap((state: LocalStateModel) => { const listPersonMatching = state.shared.shared_person.listPersonMatching; if (isNullOrUndefined(listPersonMatching) || isEmptyArray(listPersonMatching)) { - this.createPerson($event); + this._createPerson($event); } else { - this.openAlternativeDialog($event, listPersonMatching); + this._openAlternativeDialog($event, listPersonMatching); } }), )); } - private createPerson($event: ModelFormControlEvent<Person>): void { + private _createPerson($event: ModelFormControlEvent<Person>): void { this.subscribe(StoreUtil.dispatchActionAndWaitForSubActionCompletion(this._store, this._actions$, new SharedPersonAction.Create($event), SharedPersonAction.CreateSuccess, @@ -102,14 +102,14 @@ export class DepositPersonDialog extends SharedAbstractDialog<DepositPersonDialo })); } - private openAlternativeDialog(newPerson: ModelFormControlEvent<Person>, listMatchingPerson: Person[]): void { - this.subscribe(DialogUtil.open(this.dialog, DepositPersonAlternativeDialog, { + private _openAlternativeDialog(newPerson: ModelFormControlEvent<Person>, listMatchingPerson: Person[]): void { + this.subscribe(DialogUtil.open(this._dialog, DepositPersonAlternativeDialog, { listExistingPerson: listMatchingPerson, newPerson: newPerson.model, }, undefined, depositPersonSelected => { if (depositPersonSelected.isNew) { - this.createPerson(newPerson); + this._createPerson(newPerson); } else { this.submit(depositPersonSelected.selected); } diff --git a/src/app/features/deposit/components/dialogs/deposit-reject/deposit-reject.dialog.ts b/src/app/features/deposit/components/dialogs/deposit-reject/deposit-reject.dialog.ts index 353063ea0..65813bdba 100644 --- a/src/app/features/deposit/components/dialogs/deposit-reject/deposit-reject.dialog.ts +++ b/src/app/features/deposit/components/dialogs/deposit-reject/deposit-reject.dialog.ts @@ -68,7 +68,7 @@ export class DepositRejectDialog extends SharedAbstractDialog<DepositRejectDialo private readonly _actions$: Actions, protected readonly _dialogRef: MatDialogRef<DepositRejectDialog>, private readonly _fb: FormBuilder, - @Inject(MAT_DIALOG_DATA) public data: DepositRejectDialogData) { + @Inject(MAT_DIALOG_DATA) public readonly data: DepositRejectDialogData) { super(_dialogRef, data); } diff --git a/src/app/features/deposit/components/presentationals/deposit-file/deposit-file.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-file/deposit-file.presentational.ts index 0e003c55c..4ea8c8b45 100644 --- a/src/app/features/deposit/components/presentationals/deposit-file/deposit-file.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-file/deposit-file.presentational.ts @@ -90,7 +90,7 @@ export class DepositFilePresentational extends SharedAbstractPresentational { private readonly _IN_ERROR_STATUS: string = "IN_ERROR"; - constructor(public dialog: MatDialog) { + constructor(public readonly dialog: MatDialog) { super(); } diff --git a/src/app/features/deposit/components/presentationals/deposit-files-upload-in-progress/deposit-files-upload-in-progress.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-files-upload-in-progress/deposit-files-upload-in-progress.presentational.ts index ad80586fc..36cafb3c8 100644 --- a/src/app/features/deposit/components/presentationals/deposit-files-upload-in-progress/deposit-files-upload-in-progress.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-files-upload-in-progress/deposit-files-upload-in-progress.presentational.ts @@ -69,7 +69,7 @@ export class DepositFilesUploadInProgressPresentational extends SharedAbstractPr @Output("uploadArchiveChange") readonly uploadArchiveObs: Observable<DlcmFileUploadWrapper | undefined> = ObservableUtil.asObservable(this._uploadArchiveBS); - constructor(private dialog: MatDialog) { + constructor(private readonly _dialog: MatDialog) { super(); } diff --git a/src/app/features/deposit/components/presentationals/deposit-form/deposit-form.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form/deposit-form.presentational.ts index 29cf93626..f11524219 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form/deposit-form.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form/deposit-form.presentational.ts @@ -257,7 +257,7 @@ export class DepositFormPresentational extends AbstractFormPresentational<Deposi ngOnInit(): void { if (this.isTourMode) { - this.bindFormTo({ + this._bindFormTo({ title: "Deposit Tour", additionalFieldsValues: "{}", status: Enums.Deposit.StatusEnum.IN_PROGRESS, @@ -265,8 +265,8 @@ export class DepositFormPresentational extends AbstractFormPresentational<Deposi return; } super.ngOnInit(); - this.validationLicenseRequiredWhenAccessPublic(); - this.validationEmbargo(); + this._validationLicenseRequiredWhenAccessPublic(); + this._validationEmbargo(); this.subscribe(this._listenerAccessLevel()); this.defaultLicenseId = this.orgUnit?.defaultLicense?.resId ?? this.defaultPlatformLicenseId; this.commonValueLicenseId = [this.defaultLicenseId]; @@ -295,7 +295,7 @@ export class DepositFormPresentational extends AbstractFormPresentational<Deposi ); } - private validationLicenseRequiredWhenAccessPublic(): void { + private _validationLicenseRequiredWhenAccessPublic(): void { const licenseFormControl = this.form.get(this.formDefinition.licenseId); this.subscribe(this.form.get(this.formDefinition.access).valueChanges.pipe( distinctUntilChanged(), @@ -310,7 +310,7 @@ export class DepositFormPresentational extends AbstractFormPresentational<Deposi )); } - protected initNewForm(): void { + protected _initNewForm(): void { this.initEmbargoAccessLevel(Enums.Deposit.AccessEnum.PUBLIC); const formDesc = { [this.formDefinition.organizationalUnitId]: [this.orgUnit.resId, [Validators.required, SolidifyValidator]], @@ -341,7 +341,7 @@ export class DepositFormPresentational extends AbstractFormPresentational<Deposi this.formFormly = this._fb.group({}); } - protected bindFormTo(deposit: Deposit): void { + protected _bindFormTo(deposit: Deposit): void { this.initEmbargoAccessLevel(deposit.access); let formDesc = { [this.formDefinition.organizationalUnitId]: [deposit.organizationalUnitId, [Validators.required, SolidifyValidator]], @@ -381,7 +381,7 @@ export class DepositFormPresentational extends AbstractFormPresentational<Deposi this.isValidWhenDisable = this.form.valid; } - protected treatmentBeforeSubmit(deposit: Deposit): Deposit { + protected _treatmentBeforeSubmit(deposit: Deposit): Deposit { deposit.publicationDate = DateUtil.convertToLocalDateDateSimple(deposit.publicationDate); deposit.collectionBegin = DateUtil.convertToOffsetDateTimeIso8601(deposit.collectionBegin); deposit.collectionEnd = DateUtil.convertToOffsetDateTimeIso8601(deposit.collectionEnd); @@ -406,7 +406,7 @@ export class DepositFormPresentational extends AbstractFormPresentational<Deposi return deposit; } - private validationEmbargo(): void { + private _validationEmbargo(): void { const embargoDurationFormControl = this.form.get(this.formDefinition.embargoNumberMonths); const embargoAccessFormControl = this.form.get(this.formDefinition.embargoAccess); this.subscribe(this.form.get(this.formDefinition.hasEmbargo).valueChanges.pipe( @@ -425,7 +425,7 @@ export class DepositFormPresentational extends AbstractFormPresentational<Deposi )); } - protected disableSpecificField(): void { + protected _disableSpecificField(): void { this.form.get(this.formDefinition.doi).disable(); if (isTrue(this.isMetadataEdit)) { this.form.get(this.formDefinition.preservationPolicyId).disable(); diff --git a/src/app/features/deposit/components/routables/deposit-collection/deposit-collection.routable.ts b/src/app/features/deposit/components/routables/deposit-collection/deposit-collection.routable.ts index 2cd65827f..18fa41e8c 100644 --- a/src/app/features/deposit/components/routables/deposit-collection/deposit-collection.routable.ts +++ b/src/app/features/deposit/components/routables/deposit-collection/deposit-collection.routable.ts @@ -95,8 +95,8 @@ export class DepositCollectionRoutable extends AbstractDetailEditRoutable<Deposi ngOnInit(): void { super.ngOnInit(); - this.retrieveResIdFromUrl(); - this.getSubResourceWithParentId(this._resId); + this._retrieveResIdFromUrl(); + this._getSubResourceWithParentId(this._resId); this.subscribe(this._store.select((s: LocalStateModel) => s.router.state.url) .pipe( @@ -108,7 +108,7 @@ export class DepositCollectionRoutable extends AbstractDetailEditRoutable<Deposi )); } - protected getSubResourceWithParentId(id: string): void { + protected _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/deposit/components/routables/deposit-data/deposit-data.routable.ts b/src/app/features/deposit/components/routables/deposit-data/deposit-data.routable.ts index aa9475edd..cb3419162 100644 --- a/src/app/features/deposit/components/routables/deposit-data/deposit-data.routable.ts +++ b/src/app/features/deposit/components/routables/deposit-data/deposit-data.routable.ts @@ -102,8 +102,8 @@ export class DepositDataRoutable extends AbstractDetailEditRoutable<Deposit, Dep this.isTour = true; return; } - this.retrieveResIdFromUrl(); - this.getSubResourceWithParentId(this._resId); + this._retrieveResIdFromUrl(); + this._getSubResourceWithParentId(this._resId); this.subscribe(this._store.select((s: LocalStateModel) => s.router.state.url) .pipe( @@ -115,7 +115,7 @@ export class DepositDataRoutable extends AbstractDetailEditRoutable<Deposit, Dep )); } - protected getSubResourceWithParentId(id: string): void { + protected _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/deposit/components/routables/deposit-detail-edit/deposit-detail-edit.routable.ts b/src/app/features/deposit/components/routables/deposit-detail-edit/deposit-detail-edit.routable.ts index 2cfcf31ad..edae1a226 100644 --- a/src/app/features/deposit/components/routables/deposit-detail-edit/deposit-detail-edit.routable.ts +++ b/src/app/features/deposit/components/routables/deposit-detail-edit/deposit-detail-edit.routable.ts @@ -140,7 +140,7 @@ export class DepositDetailEditRoutable extends AbstractDetailEditRoutable<Deposi @ViewChild("matTabGroup") readonly matTabGroup: MatTabGroup; - private get rootUrl(): string[] { + private get _rootUrl(): string[] { return [AppRoutesEnum.deposit, this._orgUnitResId, DepositRoutesEnum.detail, this._resId]; } @@ -166,14 +166,14 @@ export class DepositDetailEditRoutable extends AbstractDetailEditRoutable<Deposi suffixUrl: DepositRoutesEnum.metadata, icon: IconNameEnum.metadata, titleToTranslate: LabelTranslateEnum.metadata, - route: () => [...this.rootUrl, DepositRoutesEnum.metadata], + route: () => [...this._rootUrl, DepositRoutesEnum.metadata], }, { id: TabEnum.DATA, suffixUrl: DepositRoutesEnum.data, icon: IconNameEnum.files, titleToTranslate: LabelTranslateEnum.data, - route: () => [...this.rootUrl, DepositRoutesEnum.data], + route: () => [...this._rootUrl, DepositRoutesEnum.data], conditionDisplay: () => MemoizedUtil.selectSnapshot(this._store, AppState, state => state.isInTourMode) || this.depositModeTabEnumObs.pipe(map(mode => mode === ModeDepositTabEnum.FILE_OR_COLLECTION)), }, { @@ -181,7 +181,7 @@ export class DepositDetailEditRoutable extends AbstractDetailEditRoutable<Deposi suffixUrl: DepositRoutesEnum.files, icon: IconNameEnum.files, titleToTranslate: LabelTranslateEnum.files, - route: () => [...this.rootUrl, DepositRoutesEnum.files], + route: () => [...this._rootUrl, DepositRoutesEnum.files], conditionDisplay: () => combineLatest([ this.depositModeTabEnumObs.pipe(map(mode => mode === ModeDepositTabEnum.FILE)), MemoizedUtil.select(this._store, DepositState, state => state?.current?.dataFileNumber > 0 || isNotNullNorUndefined(state?.logo)), @@ -195,12 +195,12 @@ export class DepositDetailEditRoutable extends AbstractDetailEditRoutable<Deposi suffixUrl: DepositRoutesEnum.collections, icon: IconNameEnum.files, titleToTranslate: LabelTranslateEnum.collections, - route: () => [...this.rootUrl, DepositRoutesEnum.collections], + route: () => [...this._rootUrl, DepositRoutesEnum.collections], conditionDisplay: () => this.depositModeTabEnumObs.pipe(map(mode => mode === ModeDepositTabEnum.COLLECTION)), }, ]; - private currentTab: Tab; + private _currentTab: Tab; messageParametersUnableSubmit: SolidifyObject | undefined; messageReasonUnableSubmit: string | undefined; @@ -290,7 +290,7 @@ export class DepositDetailEditRoutable extends AbstractDetailEditRoutable<Deposi { color: "primary", icon: IconNameEnum.reserveDoi, - displayCondition: current => this.displayReserveDOIButton(), + displayCondition: current => this._displayReserveDOIButton(), callback: () => this._reserveDOI(), disableCondition: current => isNullOrUndefined(current), labelToTranslate: (current) => LabelTranslateEnum.reserveDoi, @@ -300,7 +300,7 @@ export class DepositDetailEditRoutable extends AbstractDetailEditRoutable<Deposi { color: "primary", icon: IconNameEnum.submit, - displayCondition: current => this.displaySubmitButton(), + displayCondition: current => this._displaySubmitButton(), callback: () => this._submit(), disableCondition: current => isNullOrUndefined(current) || !this.canSubmitAction, labelToTranslate: (current) => LabelTranslateEnum.submit, @@ -367,13 +367,13 @@ export class DepositDetailEditRoutable extends AbstractDetailEditRoutable<Deposi stopRefreshAfterMaximumIntervalReached: true, resetIntervalWhenUserMouseEvent: true, doBeforeFilter: () => { - const shouldContinuePollingBefore = this.shouldContinuePolling; - this.computedShouldContinuePolling(); - if (shouldContinuePollingBefore && !this.shouldContinuePolling) { + const shouldContinuePollingBefore = this._shouldContinuePolling; + this._computedShouldContinuePolling(); + if (shouldContinuePollingBefore && !this._shouldContinuePolling) { this._store.dispatch(new DepositDataFileAction.Refresh(this._resId)); } }, - filter: () => this.shouldContinuePolling, + filter: () => this._shouldContinuePolling, actionToDo: () => { this._store.dispatch(new DepositDataFileAction.GetListCurrentStatus(this._resId)); }, @@ -387,32 +387,32 @@ export class DepositDetailEditRoutable extends AbstractDetailEditRoutable<Deposi maximumIntervalRefreshInSecond: 60, stopRefreshAfterMaximumIntervalReached: true, resetIntervalWhenUserMouseEvent: true, - filter: () => this.statusShouldContinuePolling(), + filter: () => this._statusShouldContinuePolling(), actionToDo: () => { this._store.dispatch(new DepositAction.GetById(this._resId, true)); }, })); } - private shouldContinuePolling: boolean = false; + private _shouldContinuePolling: boolean = false; - private statusShouldContinuePolling(): boolean { + private _statusShouldContinuePolling(): boolean { const status = MemoizedUtil.selectSnapshot(this._store, DepositState, state => state.current?.status); return isNotNullNorUndefined(status) && (status === Enums.Deposit.StatusEnum.SUBMITTED || status === Enums.Deposit.StatusEnum.CHECKED || status === Enums.Deposit.StatusEnum.APPROVED); } - private computedShouldContinuePolling(): void { - this.shouldContinuePolling = DataFileUploadHelper.numberFilesPending(this._store) > 0 + private _computedShouldContinuePolling(): void { + this._shouldContinuePolling = DataFileUploadHelper.numberFilesPending(this._store) > 0 && MemoizedUtil.selectSnapshot(this._store, DepositState, state => state?.current?.status !== Enums.Deposit.StatusEnum.CLEANED); } ngOnDestroy(): void { super.ngOnDestroy(); - this.cleanState(); + this._cleanState(); this._store.dispatch(new AppBannerAction.Hide()); } - protected retrieveResIdFromUrl(): void { + protected _retrieveResIdFromUrl(): void { this._resId = this._route.snapshot.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); this._orgUnitResId = this._route.parent.snapshot.paramMap.get(AppRoutesEnum.paramIdOrgUnitWithoutPrefixParam); } @@ -505,11 +505,11 @@ export class DepositDetailEditRoutable extends AbstractDetailEditRoutable<Deposi )); } - private displaySubmitButton(): boolean { + private _displaySubmitButton(): boolean { return !this.isEdit && this.canDoAlterationActions !== DepositEditModeEnum.none && isFalse(MemoizedUtil.isLoadingSnapshot(this._store, DepositState)); } - private displayReserveDOIButton(): boolean { + private _displayReserveDOIButton(): boolean { return !this.isEdit && this.canDoAlterationActions === DepositEditModeEnum.full && this.canReserveDoiAction; } @@ -517,7 +517,7 @@ export class DepositDetailEditRoutable extends AbstractDetailEditRoutable<Deposi this._store.dispatch(new Navigate([RoutesEnum.deposit, this._orgUnitResId, DepositRoutesEnum.detail, this._resId, DepositRoutesEnum.metadata, DepositRoutesEnum.edit], {}, {skipLocationChange: true})); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new DepositPersonAction.GetAll(id)); this._store.dispatch(new DepositDataFileAction.Refresh(id)); this._store.dispatch(new DepositCollectionAction.Refresh(id)); @@ -605,11 +605,11 @@ export class DepositDetailEditRoutable extends AbstractDetailEditRoutable<Deposi } override backToDetail(): void { - super.backToDetail([...this.rootUrl, DepositRoutesEnum.metadata]); + super.backToDetail([...this._rootUrl, DepositRoutesEnum.metadata]); } setCurrentTab($event: Tab): void { - this.currentTab = $event; + this._currentTab = $event; this._computeBannerMessage(); } diff --git a/src/app/features/deposit/components/routables/deposit-file/deposit-file.routable.ts b/src/app/features/deposit/components/routables/deposit-file/deposit-file.routable.ts index 1814bdd68..1a828aae6 100644 --- a/src/app/features/deposit/components/routables/deposit-file/deposit-file.routable.ts +++ b/src/app/features/deposit/components/routables/deposit-file/deposit-file.routable.ts @@ -91,8 +91,8 @@ export class DepositFileRoutable extends AbstractDetailEditRoutable<Deposit, Dep ngOnInit(): void { super.ngOnInit(); - this.retrieveResIdFromUrl(); - this.getSubResourceWithParentId(this._resId); + this._retrieveResIdFromUrl(); + this._getSubResourceWithParentId(this._resId); this.subscribe(this._store.select((s: LocalStateModel) => s.router.state.url) .pipe( @@ -104,7 +104,7 @@ export class DepositFileRoutable extends AbstractDetailEditRoutable<Deposit, Dep )); } - protected getSubResourceWithParentId(id: string): void { + protected _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/deposit/components/routables/deposit-home/deposit-home.routable.ts b/src/app/features/deposit/components/routables/deposit-home/deposit-home.routable.ts index ccfc417d4..94ff68a5d 100644 --- a/src/app/features/deposit/components/routables/deposit-home/deposit-home.routable.ts +++ b/src/app/features/deposit/components/routables/deposit-home/deposit-home.routable.ts @@ -61,7 +61,7 @@ export class DepositHomeRoutable extends SharedAbstractRoutable implements OnIni if (MemoizedUtil.selectSnapshot(this._store, AppState, state => state.isInTourMode)) { return; } - this.retrieveCurrentModelWithUrl(); + this._retrieveCurrentModelWithUrl(); this.subscribe(StoreUtil.dispatchParallelActionAndWaitForSubActionsCompletion(this._store, [ { action: new DepositAction.GetExcludedListFiles(), @@ -80,12 +80,12 @@ export class DepositHomeRoutable extends SharedAbstractRoutable implements OnIni ])); } - protected retrieveCurrentModelWithUrl(): void { - this.retrieveResIdFromUrl(); + protected _retrieveCurrentModelWithUrl(): void { + this._retrieveResIdFromUrl(); this._store.dispatch(new DepositAction.SetOrganizationalUnit(this._orgUnitResId)); } - protected retrieveResIdFromUrl(): void { + protected _retrieveResIdFromUrl(): void { this._orgUnitResId = this._route.snapshot.paramMap.get(AppRoutesEnum.paramIdOrgUnitWithoutPrefixParam); if (isNullOrUndefined(this._orgUnitResId)) { this._orgUnitResId = this._route.parent.snapshot.paramMap.get(AppRoutesEnum.paramIdOrgUnitWithoutPrefixParam); diff --git a/src/app/features/deposit/components/routables/deposit-list/deposit-list.routable.ts b/src/app/features/deposit/components/routables/deposit-list/deposit-list.routable.ts index 26e97dad5..59dcf226e 100644 --- a/src/app/features/deposit/components/routables/deposit-list/deposit-list.routable.ts +++ b/src/app/features/deposit/components/routables/deposit-list/deposit-list.routable.ts @@ -173,7 +173,7 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt }; }; - private INTERVAL_REFRESH_IN_SECOND: number = environment.refreshTabStatusCounterIntervalInSecond; + private _INTERVAL_REFRESH_IN_SECOND: number = environment.refreshTabStatusCounterIntervalInSecond; get tourEnum(): typeof TourEnum { return TourEnum; @@ -228,7 +228,7 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt super.ngOnInit(); - this.retrieveOrgUnitInUrl(); + this._retrieveOrgUnitInUrl(); if (MemoizedUtil.selectSnapshot(this._store, AppState, state => state.isInTourMode)) { this.form = this._fb.group({ @@ -237,8 +237,8 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt return; } - this.updateCurrentTab(); - this.subscribe(this.observeRoutingUpdate()); + this._updateCurrentTab(); + this.subscribe(this._observeRoutingUpdate()); this.form = this._fb.group({ [this.formDefinition.organizationalUnitId]: [this._orgUnitResId, [Validators.required, SolidifyValidator]], @@ -247,7 +247,7 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt this.subscribe(this._route.url.pipe(distinctUntilChanged()), value => { // TAB or ORGUNIT change - this.retrieveOrgUnitInUrl(); + this._retrieveOrgUnitInUrl(); if (this._isInitialized === true) { let queryParameters = QueryParametersUtil.clone(MemoizedUtil.queryParametersSnapshot(this._store, DepositState)); queryParameters = QueryParametersUtil.resetToFirstPage(queryParameters); @@ -261,20 +261,20 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt // ORGUNIT CHANGE this._store.dispatch(new Navigate([RoutesEnum.deposit, resId, this.currentTabStatus.tabEnum])); this._store.dispatch(new DepositAction.SetOrganizationalUnit(resId)); - this.refreshCounter(); + this._refreshCounter(); }), )); this._isInitialized = true; - this.refreshCounter(); + this._refreshCounter(); this.subscribe(PollingHelper.startPollingObs({ - initialIntervalRefreshInSecond: this.INTERVAL_REFRESH_IN_SECOND, + initialIntervalRefreshInSecond: this._INTERVAL_REFRESH_IN_SECOND, resetIntervalWhenUserMouseEvent: true, incrementInterval: true, maximumIntervalRefreshInSecond: 60 * 10, stopRefreshAfterMaximumIntervalReached: true, - actionToDo: () => this.refreshCounter(), + actionToDo: () => this._refreshCounter(), })); } @@ -290,7 +290,7 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt } } - private refreshCounter(): void { + private _refreshCounter(): void { const listTabWithCounter = this.listTabStatus.filter(t => isTrue(t.displayCounter)).map(tabStatus => tabStatus.tabEnum); this._store.dispatch(new DepositAction.RefreshAllCounterStatusTab(listTabWithCounter)); } @@ -299,7 +299,7 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt return FormValidationHelper.getFormControl(this.form, key); } - private retrieveOrgUnitInUrl(): void { + private _retrieveOrgUnitInUrl(): void { this._orgUnitResId = this._route.snapshot.parent.paramMap.get(AppRoutesEnum.paramIdOrgUnitWithoutPrefixParam); } @@ -307,18 +307,18 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt return FormValidationHelper; } - private observeRoutingUpdate(): Observable<any> { + private _observeRoutingUpdate(): Observable<any> { return this._router.events .pipe( filter(event => event instanceof NavigationCancel || event instanceof NavigationEnd), distinctUntilChanged(), tap(event => { - this.updateCurrentTab(); + this._updateCurrentTab(); }), ); } - private updateCurrentTab(): void { + private _updateCurrentTab(): void { const tab: DepositTabStatusEnum = this._route.snapshot.paramMap.get(DepositRoutesEnum.paramTabWithoutPrefix) as DepositTabStatusEnum; this.selectedTabIndex = this.listTabStatus.findIndex(t => t.tabEnum === tab); if (this.selectedTabIndex !== -1) { @@ -339,7 +339,7 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt let queryParameters = QueryParametersUtil.clone(MemoizedUtil.queryParametersSnapshot(this._store, DepositState)); queryParameters = QueryParametersUtil.resetToFirstPage(queryParameters); this.onQueryParametersEvent(queryParameters, false); - this.refreshCounter(); + this._refreshCounter(); this._changeDetector.detectChanges(); }, 100); })); @@ -352,7 +352,7 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt let queryParameters = QueryParametersUtil.clone(MemoizedUtil.queryParametersSnapshot(this._store, DepositState)); queryParameters = QueryParametersUtil.resetToFirstPage(queryParameters); this.onQueryParametersEvent(queryParameters, false); - this.refreshCounter(); + this._refreshCounter(); this._changeDetector.detectChanges(); }, 100); })); @@ -413,7 +413,7 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt ]; } - protected override defineActions(): DataTableActions<Deposit>[] { + protected override _defineActions(): DataTableActions<Deposit>[] { return [ { logo: IconNameEnum.download, @@ -455,7 +455,7 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt this._store.dispatch(new Navigate([RoutesEnum.deposit, this._orgUnitResId, DepositRoutesEnum.create], {}, {skipLocationChange: true})); } - private updateQueryParameterWithOrgUnit(queryParameters: QueryParameters, orgUnit: OrganizationalUnit | undefined): QueryParameters | undefined { + private _updateQueryParameterWithOrgUnit(queryParameters: QueryParameters, orgUnit: OrganizationalUnit | undefined): QueryParameters | undefined { if (isNullOrUndefined(orgUnit)) { return queryParameters; } @@ -464,7 +464,7 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt return queryParameters; } - private updateQueryParameterWithStatus(queryParameters: QueryParameters): QueryParameters | undefined { + private _updateQueryParameterWithStatus(queryParameters: QueryParameters): QueryParameters | undefined { if (isNullOrUndefined(this.currentTabStatus)) { return queryParameters; } @@ -501,8 +501,8 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt if (needCopy) { queryParameters = QueryParametersUtil.clone(queryParameters); } - this.updateQueryParameterWithOrgUnit(queryParameters, {resId: this._orgUnitResId}); - this.updateQueryParameterWithStatus(queryParameters); + this._updateQueryParameterWithOrgUnit(queryParameters, {resId: this._orgUnitResId}); + this._updateQueryParameterWithStatus(queryParameters); super.onQueryParametersEvent(queryParameters); } } diff --git a/src/app/features/deposit/components/routables/deposit-metadata/deposit-metadata.routable.ts b/src/app/features/deposit/components/routables/deposit-metadata/deposit-metadata.routable.ts index 0d3a3f525..7e77bc7bb 100644 --- a/src/app/features/deposit/components/routables/deposit-metadata/deposit-metadata.routable.ts +++ b/src/app/features/deposit/components/routables/deposit-metadata/deposit-metadata.routable.ts @@ -146,7 +146,7 @@ export class DepositMetadataRoutable extends AbstractDetailEditRoutable<Deposit, return; } - this.retrieveResIdFromUrl(); + this._retrieveResIdFromUrl(); this.initPolicies(); this.subscribe(this.isReadyToBeDisplayedObs.pipe( filter(ready => ready && isNotNullNorUndefined(this.formPresentational)), @@ -156,7 +156,7 @@ export class DepositMetadataRoutable extends AbstractDetailEditRoutable<Deposit, ); } - protected retrieveResIdFromUrl(): void { + protected _retrieveResIdFromUrl(): void { this._orgUnitResId = this._route.parent.parent.snapshot.paramMap.get(AppRoutesEnum.paramIdOrgUnitWithoutPrefixParam); this._resId = this._route.parent.snapshot.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); } @@ -196,6 +196,6 @@ export class DepositMetadataRoutable extends AbstractDetailEditRoutable<Deposit, this._store.dispatch(new Navigate([RoutesEnum.deposit, this._orgUnitResId, DepositRoutesEnum.detail, this._resId, DepositRoutesEnum.metadata, DepositRoutesEnum.edit], {}, {skipLocationChange: true})); } - protected getSubResourceWithParentId(id: string): void { + protected _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/deposit/components/routables/deposit-root/deposit-root.routable.ts b/src/app/features/deposit/components/routables/deposit-root/deposit-root.routable.ts index 1786ebb8a..2bea22e1b 100644 --- a/src/app/features/deposit/components/routables/deposit-root/deposit-root.routable.ts +++ b/src/app/features/deposit/components/routables/deposit-root/deposit-root.routable.ts @@ -63,7 +63,7 @@ export class DepositRootRoutable extends SharedAbstractRoutable implements OnIni constructor(private readonly _store: Store, private readonly _actions$: Actions, - private notificationService: NotificationService) { + private readonly _notificationService: NotificationService) { super(); } @@ -85,7 +85,7 @@ export class DepositRootRoutable extends SharedAbstractRoutable implements OnIni const listAuthorizedOrgUnit = MemoizedUtil.listSnapshot(this._store, AppAuthorizedOrganizationalUnitState); if (isEmptyArray(listAuthorizedOrgUnit)) { this.noOrgUnit = true; - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.deposit.noOrgUnit")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.deposit.noOrgUnit")); this._store.dispatch(new Navigate([AppRoutesEnum.preservationSpace])); return; } diff --git a/src/app/features/deposit/helpers/data-file-upload.helper.ts b/src/app/features/deposit/helpers/data-file-upload.helper.ts index 0522bf905..a68cd41bc 100644 --- a/src/app/features/deposit/helpers/data-file-upload.helper.ts +++ b/src/app/features/deposit/helpers/data-file-upload.helper.ts @@ -30,7 +30,7 @@ import { } from "solidify-frontend"; export class DataFileUploadHelper { - private static readonly LIST_PENDING_STATUS: Enums.DataFile.StatusEnum[] = [ + private static readonly _LIST_PENDING_STATUS: Enums.DataFile.StatusEnum[] = [ Enums.DataFile.StatusEnum.RECEIVED, Enums.DataFile.StatusEnum.CHANGE_RELATIVE_LOCATION, Enums.DataFile.StatusEnum.TO_PROCESS, @@ -69,7 +69,7 @@ export class DataFileUploadHelper { const listCurrentStatus = MemoizedUtil.selectSnapshot(store, DepositDataFileState, state => state.listCurrentStatus); let pendingCounter = 0; MappingObjectUtil.forEach(listCurrentStatus, (value, key: Enums.DataFile.StatusEnum) => { - if (this.LIST_PENDING_STATUS.indexOf(key) !== -1) { + if (this._LIST_PENDING_STATUS.indexOf(key) !== -1) { pendingCounter += value; } }); diff --git a/src/app/features/deposit/stores/aip/deposit-aip.state.ts b/src/app/features/deposit/stores/aip/deposit-aip.state.ts index b78e43ab5..458558580 100644 --- a/src/app/features/deposit/stores/aip/deposit-aip.state.ts +++ b/src/app/features/deposit/stores/aip/deposit-aip.state.ts @@ -51,11 +51,11 @@ export interface DepositAipStateModel extends ResourceStateModel<Aip> { }) export class DepositAipState extends ResourceState<DepositAipStateModel, Aip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: depositAipActionNameSpace, }); } diff --git a/src/app/features/deposit/stores/authorized-organizational-unit/deposit-authorized-organizational-unit.state.ts b/src/app/features/deposit/stores/authorized-organizational-unit/deposit-authorized-organizational-unit.state.ts index e78c77829..9ca973230 100644 --- a/src/app/features/deposit/stores/authorized-organizational-unit/deposit-authorized-organizational-unit.state.ts +++ b/src/app/features/deposit/stores/authorized-organizational-unit/deposit-authorized-organizational-unit.state.ts @@ -78,11 +78,11 @@ const getQueryParameter: () => QueryParameters = () => { }) export class DepositAuthorizedOrganizationalUnitState extends ResourceState<DepositAuthorizedOrganizationalUnitStateModel, OrganizationalUnit> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: depositAuthorizedOrganizationalUnitNameSpace, }); } diff --git a/src/app/features/deposit/stores/collection/deposit-collection.state.ts b/src/app/features/deposit/stores/collection/deposit-collection.state.ts index e10e1d6fa..d6fa959f7 100644 --- a/src/app/features/deposit/stores/collection/deposit-collection.state.ts +++ b/src/app/features/deposit/stores/collection/deposit-collection.state.ts @@ -92,11 +92,11 @@ export interface DepositCollectionStateModel extends AssociationRemoteStateModel ], }) export class DepositCollectionState extends AssociationRemoteState<DepositCollectionStateModel, Aip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: depositCollectionActionNameSpace, resourceName: ApiResourceNameEnum.AIP, }); @@ -124,15 +124,15 @@ export class DepositCollectionState extends AssociationRemoteState<DepositCollec { action: new DepositCollectionAction.GetAll(action.parentId, undefined, true), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(DepositCollectionAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(DepositCollectionAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositCollectionAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositCollectionAction.GetAllFail)), ], }, { action: new DepositCollectionAction.GetNumberCollections(action.parentId), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(DepositCollectionAction.GetNumberCollectionsSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(DepositCollectionAction.GetNumberCollectionsFail)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositCollectionAction.GetNumberCollectionsSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositCollectionAction.GetNumberCollectionsFail)), ], }, ]).pipe( @@ -191,7 +191,7 @@ export class DepositCollectionState extends AssociationRemoteState<DepositCollec }); const queryParameters = new QueryParameters(environment.minimalPageSizeToRetrievePaginationInfo); - return this.apiService.get<Aip>(`${this._urlResource}/${action.parentId}/${this._resourceName}`, queryParameters) + return this._apiService.get<Aip>(`${this._urlResource}/${action.parentId}/${this._resourceName}`, queryParameters) .pipe( tap(collection => { ctx.dispatch(new DepositCollectionAction.GetNumberCollectionsSuccess(action, collection._page.totalItems)); diff --git a/src/app/features/deposit/stores/collection/status-history/deposit-collection-status-history.state.ts b/src/app/features/deposit/stores/collection/status-history/deposit-collection-status-history.state.ts index 48e825171..74477b626 100644 --- a/src/app/features/deposit/stores/collection/status-history/deposit-collection-status-history.state.ts +++ b/src/app/features/deposit/stores/collection/status-history/deposit-collection-status-history.state.ts @@ -54,11 +54,11 @@ export interface DepositCollectionHistoryStateModel extends StatusHistoryStateMo }) export class DepositCollectionStatusHistoryState extends StatusHistoryState<DepositCollectionHistoryStateModel, Aip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: depositCollectionStatusHistoryNamespace, }); } diff --git a/src/app/features/deposit/stores/data-file/deposit-data-file.state.ts b/src/app/features/deposit/stores/data-file/deposit-data-file.state.ts index b162de014..0bdd3df9e 100644 --- a/src/app/features/deposit/stores/data-file/deposit-data-file.state.ts +++ b/src/app/features/deposit/stores/data-file/deposit-data-file.state.ts @@ -120,17 +120,17 @@ export interface DepositDataFileStateModel extends CompositionStateModel<Deposit ], }) export class DepositDataFileState extends CompositionState<DepositDataFileStateModel, DepositDataFile> { - private readonly KEY_STATUS: keyof DepositDataFile = "status"; - private readonly KEY_RELATIVE_LOCATION: keyof DepositDataFile = "relativeLocation"; - - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - @Inject(WINDOW) private _window: Window, - protected httpClient: HttpClient, - private downloadService: DownloadService) { - super(apiService, store, notificationService, actions$, { + private readonly _KEY_STATUS: keyof DepositDataFile = "status"; + private readonly _KEY_RELATIVE_LOCATION: keyof DepositDataFile = "relativeLocation"; + + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + @Inject(WINDOW) private readonly _window: Window, + protected readonly _httpClient: HttpClient, + private readonly _downloadService: DownloadService) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: depositDataFileActionNameSpace, resourceName: ApiResourceNameEnum.DATAFILE, }); @@ -142,18 +142,18 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM @Action(DepositDataFileAction.Resume) resume(ctx: StateContext<DepositDataFileStateModel>, action: DepositDataFileAction.Resume): Observable<Result> { - return this.apiService.post<any, Result>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.RESUME}`) + return this._apiService.post<any, Result>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.RESUME}`) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { - this.notificationService.showInformation(LabelTranslateEnum.resourceResumed); + this._notificationService.showInformation(LabelTranslateEnum.resourceResumed); ctx.dispatch(new DepositDataFileAction.GetAll(action.parentId, undefined, true)); } else { - this.notificationService.showError(LabelTranslateEnum.unableResumedResource); + this._notificationService.showError(LabelTranslateEnum.unableResumedResource); } }), catchError((error: SolidifyHttpErrorResponseModel) => { - this.notificationService.showError(LabelTranslateEnum.unableResumedResource); + this._notificationService.showError(LabelTranslateEnum.unableResumedResource); throw new SolidifyStateError(this, error); }), ); @@ -168,10 +168,10 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM } const currentFolder = ctx.getState().currentFolder; if (isNullOrUndefined(currentFolder)) { - MappingObjectUtil.delete(QueryParametersUtil.getSearchItems(queryParameters), this.KEY_RELATIVE_LOCATION); + MappingObjectUtil.delete(QueryParametersUtil.getSearchItems(queryParameters), this._KEY_RELATIVE_LOCATION); } else { - MappingObjectUtil.set(QueryParametersUtil.getSearchItems(queryParameters), this.KEY_RELATIVE_LOCATION, ctx.getState().currentFolder); + MappingObjectUtil.set(QueryParametersUtil.getSearchItems(queryParameters), this._KEY_RELATIVE_LOCATION, ctx.getState().currentFolder); } ctx.patchState({ queryParameters: queryParameters, @@ -189,22 +189,22 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM { action: new DepositDataFileAction.GetAll(action.parentId, undefined, true), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(DepositDataFileAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(DepositDataFileAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositDataFileAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositDataFileAction.GetAllFail)), ], }, { action: new DepositDataFileAction.GetListFolder(action.parentId), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(DepositDataFileAction.GetListFolderSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(DepositDataFileAction.GetListFolderFail)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositDataFileAction.GetListFolderSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositDataFileAction.GetListFolderFail)), ], }, { action: new DepositDataFileAction.GetListCurrentStatus(action.parentId), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(DepositDataFileAction.GetListCurrentStatusSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(DepositDataFileAction.GetListCurrentStatusFail)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositDataFileAction.GetListCurrentStatusSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositDataFileAction.GetListCurrentStatusFail)), ], }, ]).pipe( @@ -237,7 +237,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM @Action(DepositDataFileAction.Download) download(ctx: StateContext<DepositDataFileStateModel>, action: DepositDataFileAction.Download): void { const url = `${this._urlResource}/${action.parentId}/${ApiResourceNameEnum.DATAFILE}/${action.dataFile.resId}/${ApiActionNameEnum.DL}`; - this.downloadService.download(url, action.dataFile.fileName, action.dataFile.fileSize); + this._downloadService.download(url, action.dataFile.fileName, action.dataFile.fileSize); } @Action(DepositDataFileAction.ChangeCurrentFolder) @@ -245,7 +245,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM ctx.patchState({ currentFolder: action.newCurrentFolder, }); - const depositId = MemoizedUtil.currentSnapshot(this.store, DepositState).resId; + const depositId = MemoizedUtil.currentSnapshot(this._store, DepositState).resId; if (!isNullOrUndefined(action.newCurrentFolder)) { ctx.dispatch(new DepositDataFileAction.GetListFolder(depositId)); } @@ -258,7 +258,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM @Action(DepositDataFileAction.ChangeCurrentCategory) ChangeCurrentCategory(ctx: StateContext<DepositDataFileStateModel>, action: DepositDataFileAction.ChangeCurrentCategory): void { - const depositId = MemoizedUtil.currentSnapshot(this.store, DepositState).resId; + const depositId = MemoizedUtil.currentSnapshot(this._store, DepositState).resId; if (action.refreshNewCategory) { ctx.dispatch(new DepositDataFileAction.GetAll(depositId)); } @@ -270,7 +270,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.httpClient.get<string[]>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiActionNameEnum.LIST_FOLDERS}`) + return this._httpClient.get<string[]>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiActionNameEnum.LIST_FOLDERS}`) .pipe( tap((listFolder: string[]) => { ctx.dispatch(new DepositDataFileAction.GetListFolderSuccess(action, listFolder)); @@ -317,7 +317,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.httpClient.post<Result>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.VALIDATE}`, null) + return this._httpClient.post<Result>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.VALIDATE}`, null) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -338,7 +338,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("notification.deposit.file.validate.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("notification.deposit.file.validate.success")); ctx.dispatch(new DepositDataFileAction.Refresh(action.parentAction.parentId)); } @@ -347,7 +347,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.deposit.file.validate.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.deposit.file.validate.fail")); } @Action(DepositDataFileAction.Move) @@ -356,7 +356,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.httpClient.patch<DepositDataFile>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}`, { + return this._httpClient.patch<DepositDataFile>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}`, { relativeLocation: action.dataFile.relativeLocation, } as DepositDataFile) .pipe( @@ -374,7 +374,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM moveSuccess(ctx: StateContext<DepositDataFileStateModel>, action: DepositDataFileAction.MoveSuccess): void { const relativeLocation = action.parentAction.dataFile.relativeLocation; ctx.dispatch(new DepositDataFileAction.ChangeCurrentFolder(relativeLocation, true)); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("notification.deposit.file.move.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("notification.deposit.file.move.success")); ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); @@ -385,7 +385,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.deposit.file.move.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.deposit.file.move.fail")); } @Action(DepositDataFileAction.ChangeDataCategory) @@ -394,7 +394,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.httpClient.patch<DepositDataFile>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}`, { + return this._httpClient.patch<DepositDataFile>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}`, { dataCategory: action.dataFile.dataCategory, dataType: action.dataFile.dataType, metadataType: !isNullOrUndefined(action.dataFile.metadataType) ? action.dataFile.metadataType : null, @@ -414,11 +414,11 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM changeDataCategorySuccess(ctx: StateContext<DepositDataFileStateModel>, action: DepositDataFileAction.ChangeDataCategorySuccess): void { const dataCategory = (action.parentAction as DepositDataFileAction.ChangeDataCategory).dataFile.dataCategory; const dataType = (action.parentAction as DepositDataFileAction.ChangeDataCategory).dataFile.dataType; - const depositId = MemoizedUtil.currentSnapshot(this.store, DepositState).resId; + const depositId = MemoizedUtil.currentSnapshot(this._store, DepositState).resId; ctx.dispatch(new DepositDataFileAction.ChangeCurrentCategory(dataCategory, dataType, true)); ctx.dispatch(new DepositDataFileAction.Refresh(depositId)); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("notification.deposit.file.changeDataCategory.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("notification.deposit.file.changeDataCategory.success")); ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); @@ -429,7 +429,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.deposit.file.changeDataCategory.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.deposit.file.changeDataCategory.fail")); } @Action(DepositDataFileAction.DeleteAll) @@ -438,7 +438,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.delete<string[]>(`${this._urlResource}/${action.parentId}/${this._resourceName}`, action.listResId) + return this._apiService.delete<string[]>(`${this._urlResource}/${action.parentId}/${this._resourceName}`, action.listResId) .pipe( tap(collection => { ctx.dispatch(new DepositDataFileAction.DeleteAllSuccess(action)); @@ -472,7 +472,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<string[]>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiActionNameEnum.RESUME}`, action.listResId) + return this._apiService.post<string[]>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiActionNameEnum.RESUME}`, action.listResId) .pipe( tap(collection => { ctx.dispatch(new DepositDataFileAction.ResumeAllSuccess(action)); @@ -506,7 +506,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<string[]>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiActionNameEnum.VALIDATE}`, action.listResId) + return this._apiService.post<string[]>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiActionNameEnum.VALIDATE}`, action.listResId) .pipe( tap(collection => { ctx.dispatch(new DepositDataFileAction.ValidateAllSuccess(action)); @@ -540,7 +540,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<string>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiActionNameEnum.DELETE_FOLDER}?${this.KEY_RELATIVE_LOCATION}=${action.fullFolderName}`) + return this._apiService.post<string>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiActionNameEnum.DELETE_FOLDER}?${this._KEY_RELATIVE_LOCATION}=${action.fullFolderName}`) .pipe( tap(result => { ctx.dispatch(new DepositDataFileAction.DeleteFolderSuccess(action)); @@ -558,7 +558,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM isLoadingCounter: ctx.getState().isLoadingCounter - 1, currentFolder: "" + DepositDataFileHelper.ROOT, }); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("notification.deposit.folder.deleteWithSuccess")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("notification.deposit.folder.deleteWithSuccess")); ctx.dispatch(new DepositDataFileAction.Refresh(action.parentAction.parentId)); } @@ -567,7 +567,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.deposit.folder.deleteFail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.deposit.folder.deleteFail")); } @Action(DepositDataFileAction.GetListCurrentStatus) @@ -576,7 +576,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM isLoadingCurrentStatus: ctx.getState().isLoadingCurrentStatus + 1, }); - return this.apiService.getByIdInPath<MappingObject<number>>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiActionNameEnum.LIST_CURRENT_STATUS}`) + return this._apiService.getByIdInPath<MappingObject<number>>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiActionNameEnum.LIST_CURRENT_STATUS}`) .pipe( tap(result => { ctx.dispatch(new DepositDataFileAction.GetListCurrentStatusSuccess(action, result)); diff --git a/src/app/features/deposit/stores/data-file/metadata-type/deposit-data-file-metadata-type.state.ts b/src/app/features/deposit/stores/data-file/metadata-type/deposit-data-file-metadata-type.state.ts index d8f0fac44..f7f88f99e 100644 --- a/src/app/features/deposit/stores/data-file/metadata-type/deposit-data-file-metadata-type.state.ts +++ b/src/app/features/deposit/stores/data-file/metadata-type/deposit-data-file-metadata-type.state.ts @@ -21,7 +21,6 @@ * ----------------------------------------------------------------------------------------------%% */ -import {HttpClient} from "@angular/common/http"; import {Injectable} from "@angular/core"; import {depositDataFileMetadataTypeActionNameSpace} from "@deposit/stores/data-file/metadata-type/deposit-data-file-metadata-type.action"; import {MetadataType} from "@models"; @@ -35,7 +34,6 @@ import {StateEnum} from "@shared/enums/state.enum"; import { ApiService, defaultResourceStateInitValue, - DownloadService, NotificationService, ResourceState, ResourceStateModel, @@ -52,13 +50,11 @@ export interface DepositDataFileMetadataTypeStateModel extends ResourceStateMode }, }) export class DepositDataFileMetadataTypeState extends ResourceState<DepositDataFileMetadataTypeStateModel, MetadataType> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - protected downloadService: DownloadService, - protected httpClient: HttpClient) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: depositDataFileMetadataTypeActionNameSpace, }); } diff --git a/src/app/features/deposit/stores/data-file/status-history/deposit-data-file-status-history.state.ts b/src/app/features/deposit/stores/data-file/status-history/deposit-data-file-status-history.state.ts index ebd2a887b..f1f7ee83b 100644 --- a/src/app/features/deposit/stores/data-file/status-history/deposit-data-file-status-history.state.ts +++ b/src/app/features/deposit/stores/data-file/status-history/deposit-data-file-status-history.state.ts @@ -54,11 +54,11 @@ export interface DepositDataFileStatusHistoryStateModel extends StatusHistorySta }) export class DepositDataFileStatusHistoryState extends StatusHistoryState<DepositDataFileStatusHistoryStateModel, DepositDataFile> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: depositDataFileStatusHistoryNamespace, }); } diff --git a/src/app/features/deposit/stores/deposit.state.ts b/src/app/features/deposit/stores/deposit.state.ts index e06abf141..9128feb73 100644 --- a/src/app/features/deposit/stores/deposit.state.ts +++ b/src/app/features/deposit/stores/deposit.state.ts @@ -219,14 +219,14 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> private readonly _FOLDER_QUERY_PARAM: string = "folder"; private readonly _DEPOSIT_REJECT_REASON: string = "reason"; - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, protected readonly _securityService: SecurityService, - private downloadService: DownloadService, - protected _httpClient: HttpClient) { - super(apiService, store, notificationService, actions$, { + private readonly _downloadService: DownloadService, + protected readonly _httpClient: HttpClient) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: depositActionNameSpace, routeRedirectUrlAfterSuccessDeleteAction: RoutesEnum.deposit, notificationResourceCreateSuccessTextToTranslate: MARK_AS_TRANSLATABLE("deposit.notification.resource.create"), @@ -295,8 +295,8 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> { action: new SharedLanguageAction.GetAll(null, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedLanguageAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedLanguageAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedLanguageAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedLanguageAction.GetAllFail)), ], }, ]).pipe( @@ -313,7 +313,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> @Action(DepositAction.SetOrganizationalUnit) setOrganizationalUnit(ctx: StateContext<DepositStateModel>, action: DepositAction.SetOrganizationalUnit): void { - const listAuthorizedOrgUnit = MemoizedUtil.listSnapshot(this.store, AppAuthorizedOrganizationalUnitState); + const listAuthorizedOrgUnit = MemoizedUtil.listSnapshot(this._store, AppAuthorizedOrganizationalUnitState); if (isNullOrUndefined(listAuthorizedOrgUnit) || isEmptyArray(listAuthorizedOrgUnit)) { return; } @@ -344,10 +344,10 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> @OverrideDefaultAction() @Action(DepositAction.Create) create(ctx: StateContext<DepositStateModel>, action: DepositAction.Create): Observable<Deposit> { - return super.internalCreate(ctx, action) + return super._internalCreate(ctx, action) .pipe( tap(model => { - this.updateSubResource(model, action, ctx) + this._updateSubResource(model, action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new DepositAction.CreateSuccess(action, model)); @@ -372,10 +372,10 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> @OverrideDefaultAction() @Action(DepositAction.Update) update(ctx: StateContext<DepositStateModel>, action: DepositAction.Update): Observable<Deposit> { - return super.internalUpdate(ctx, action) + return super._internalUpdate(ctx, action) .pipe( tap(model => { - this.updateSubResource(model, action, ctx) + this._updateSubResource(model, action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new DepositAction.UpdateSuccess(action, model)); @@ -400,7 +400,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> ]); } - private updateSubResource(model: Deposit, action: DepositAction.Create | DepositAction.Update, ctx: StateContext<DepositStateModel>): Observable<boolean> { + private _updateSubResource(model: Deposit, action: DepositAction.Create | DepositAction.Update, ctx: StateContext<DepositStateModel>): Observable<boolean> { const depositId = model.resId; const selectedPerson = ctx.getState().deposit_person.selected; const oldAuthors: string[] = isNullOrUndefined(selectedPerson) ? [] : selectedPerson.map(p => p.resId); @@ -410,15 +410,15 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> { action: new DepositPersonAction.DeleteList(depositId, oldAuthors), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(DepositPersonAction.DeleteListSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(DepositPersonAction.DeleteListFail)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositPersonAction.DeleteListSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositPersonAction.DeleteListFail)), ], }, { action: new DepositPersonAction.Create(depositId, newAuthors), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(DepositPersonAction.CreateSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(DepositPersonAction.CreateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositPersonAction.CreateSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositPersonAction.CreateFail)), ], }, ]).pipe( @@ -443,7 +443,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> if (isTrue(submissionWithApproval)) { suffix = ApiActionNameEnum.SUBMIT_FOR_APPROVAL; } - return this.apiService.post<any, Result>(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + suffix) + return this._apiService.post<any, Result>(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + suffix) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -461,8 +461,8 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> @Action(DepositAction.SubmitSuccess) submitSuccess(ctx: StateContext<DepositStateModel>, action: DepositAction.SubmitSuccess): void { - this.redirectToDepositDetail(ctx, action.result.resId); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.submit.success")); + this._redirectToDepositDetail(ctx, action.result.resId); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.submit.success")); } @Action(DepositAction.SubmitFail) @@ -479,12 +479,12 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> } }); } - this.notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.submit.fail"), {errors: errorsMessage}); + this._notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.submit.fail"), {errors: errorsMessage}); } @Action(DepositAction.Approve) approve(ctx: StateContext<DepositStateModel>, action: DepositAction.Approve): Observable<Result> { - return this.apiService.post<any, Result>(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.APPROVE) + return this._apiService.post<any, Result>(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.APPROVE) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -502,18 +502,18 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> @Action(DepositAction.ApproveSuccess) approveSuccess(ctx: StateContext<DepositStateModel>, action: DepositAction.ApproveSuccess): void { - this.redirectToDepositDetail(ctx, action.result.resId); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.approve.success")); + this._redirectToDepositDetail(ctx, action.result.resId); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.approve.success")); } @Action(DepositAction.ApproveFail) approveFail(ctx: StateContext<DepositStateModel>, action: DepositAction.ApproveFail): void { - this.notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.approve.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.approve.fail")); } @Action(DepositAction.Reject) reject(ctx: StateContext<DepositStateModel>, action: DepositAction.Reject): Observable<Result> { - return this.apiService.post<any, Result>(`${this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.REJECT}?${this._DEPOSIT_REJECT_REASON}=${action.message}`) + return this._apiService.post<any, Result>(`${this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.REJECT}?${this._DEPOSIT_REJECT_REASON}=${action.message}`) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -531,18 +531,18 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> @Action(DepositAction.RejectSuccess) rejectSuccess(ctx: StateContext<DepositStateModel>, action: DepositAction.RejectSuccess): void { - this.redirectToDepositDetail(ctx, action.result.resId); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.reject.success")); + this._redirectToDepositDetail(ctx, action.result.resId); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.reject.success")); } @Action(DepositAction.RejectFail) rejectFail(ctx: StateContext<DepositStateModel>, action: DepositAction.RejectFail): void { - this.notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.reject.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.reject.fail")); } @Action(DepositAction.BackToEdit) backToEdit(ctx: StateContext<DepositStateModel>, action: DepositAction.BackToEdit): Observable<Result> { - return this.apiService.post<Result>(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.ENABLE_REVISION) + return this._apiService.post<Result>(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.ENABLE_REVISION) .pipe( tap(result => ctx.dispatch(new DepositAction.BackToEditSuccess(action, result))), catchError((error: SolidifyHttpErrorResponseModel) => { @@ -554,13 +554,13 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> @Action(DepositAction.BackToEditSuccess) backToEditSuccess(ctx: StateContext<DepositStateModel>, action: DepositAction.BackToEditSuccess): void { - this.redirectToDepositDetail(ctx, action.result.resId); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.backToEdit.success")); + this._redirectToDepositDetail(ctx, action.result.resId); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.backToEdit.success")); } @Action(DepositAction.BackToEditFail) backToEditFail(ctx: StateContext<DepositStateModel>, action: DepositAction.BackToEditFail): void { - this.notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.backToEdit.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.backToEdit.fail")); } @Action(DepositAction.ReserveDOI) @@ -568,7 +568,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.RESERVE_DOI) + return this._apiService.post(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.RESERVE_DOI) .pipe( tap(deposit => ctx.dispatch(new DepositAction.ReserveDOISuccess(action, deposit))), catchError((error: SolidifyHttpErrorResponseModel) => { @@ -588,7 +588,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> current: action.deposit, isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.reserveDOI.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.reserveDOI.success")); } @Action(DepositAction.ReserveDOIFail) @@ -596,7 +596,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.reserveDOI.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.reserveDOI.fail")); } @Action(DepositAction.RefreshAllCounterStatusTab) @@ -606,8 +606,8 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> listActionsWrappper.push({ action: new DepositAction.RefreshCounterStatusTab(tabEnum), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(DepositAction.RefreshCounterStatusTabSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(DepositAction.RefreshCounterStatusTabFail)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositAction.RefreshCounterStatusTabSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(DepositAction.RefreshCounterStatusTabFail)), ], }); }); @@ -640,7 +640,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> MappingObjectUtil.set(searchItems, DepositHelper.KEY_STATUS_LIST, tab.depositStatusEnum.join(SOLIDIFY_CONSTANTS.COMMA)); } } - return this.apiService.get<Deposit>(this._urlResource, queryParameters) + return this._apiService.get<Deposit>(this._urlResource, queryParameters) .pipe( map((collection: CollectionTyped<Deposit>) => { const totalItem = collection._page.totalItems; @@ -686,7 +686,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> }); } - private redirectToDepositDetail(ctx: StateContext<DepositStateModel>, depositId: string): void { + private _redirectToDepositDetail(ctx: StateContext<DepositStateModel>, depositId: string): void { ctx.dispatch(new Navigate([RoutesEnum.deposit, ctx.getState().deposit_organizationalUnit.current.resId, DepositRoutesEnum.detail, depositId])); ctx.dispatch(new DepositAction.GetById(depositId)); } @@ -703,7 +703,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.getByIdInPath<FileListModel>(this._urlResource + urlSeparator + ApiActionNameEnum.LIST_EXCLUDE_FILES) + return this._apiService.getByIdInPath<FileListModel>(this._urlResource + urlSeparator + ApiActionNameEnum.LIST_EXCLUDE_FILES) .pipe( tap(fileList => ctx.dispatch(new DepositAction.GetExcludedListFilesSuccess(action, fileList))), catchError((error: SolidifyHttpErrorResponseModel) => { @@ -733,7 +733,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.getByIdInPath<FileListModel>(this._urlResource + urlSeparator + ApiActionNameEnum.LIST_IGNORE_FILES) + return this._apiService.getByIdInPath<FileListModel>(this._urlResource + urlSeparator + ApiActionNameEnum.LIST_IGNORE_FILES) .pipe( tap(fileList => ctx.dispatch(new DepositAction.GetIgnoredListFilesSuccess(action, fileList))), catchError((error: SolidifyHttpErrorResponseModel) => { @@ -773,12 +773,12 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> url = url + `?${this._FOLDER_QUERY_PARAM}=${action.fullFolderName}`; fileName = fileName + action.fullFolderName; } - this.downloadService.download(url, fileName + this._ZIP_EXTENSION); + this._downloadService.download(url, fileName + this._ZIP_EXTENSION); } @Action(DepositAction.CheckCompliance) checkCompliance(ctx: StateContext<DepositStateModel>, action: DepositAction.CheckCompliance): Observable<Result> { - return this.apiService.post<any, Result>(this._urlResource + urlSeparator + action.id + urlSeparator + ApiActionNameEnum.CHECK_COMPLIANCE) + return this._apiService.post<any, Result>(this._urlResource + urlSeparator + action.id + urlSeparator + ApiActionNameEnum.CHECK_COMPLIANCE) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -796,17 +796,17 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> @Action(DepositAction.CheckComplianceSuccess) checkComplianceSuccess(ctx: StateContext<DepositStateModel>, action: DepositAction.CheckComplianceSuccess): void { - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.checkCompliance.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.checkCompliance.success")); } @Action(DepositAction.CheckComplianceFail) checkComplianceFail(ctx: StateContext<DepositStateModel>, action: DepositAction.CheckComplianceFail): void { - this.notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.checkCompliance.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.checkCompliance.fail")); } @Action(DepositAction.StartMetadataEditing) startMetadataEditing(ctx: StateContext<DepositStateModel>, action: DepositAction.StartMetadataEditing): Observable<Result> { - return this.apiService.post<any, Result>(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.START_METADATA_EDITING) + return this._apiService.post<any, Result>(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.START_METADATA_EDITING) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -824,18 +824,18 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> @Action(DepositAction.StartMetadataEditingSuccess) startMetadataEditingSuccess(ctx: StateContext<DepositStateModel>, action: DepositAction.StartMetadataEditingSuccess): void { - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.startMetadataEditing.success")); - this.redirectToDepositDetail(ctx, action.parentAction.deposit.resId); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.startMetadataEditing.success")); + this._redirectToDepositDetail(ctx, action.parentAction.deposit.resId); } @Action(DepositAction.StartMetadataEditingFail) startMetadataEditingFail(ctx: StateContext<DepositStateModel>, action: DepositAction.StartMetadataEditingFail): void { - this.notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.startMetadataEditing.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.startMetadataEditing.fail")); } @Action(DepositAction.CancelMetadataEditing) cancelMetadataEditing(ctx: StateContext<DepositStateModel>, action: DepositAction.CancelMetadataEditing): Observable<Result> { - return this.apiService.post<any, Result>(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.CANCEL_METADATA_EDITING) + return this._apiService.post<any, Result>(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.CANCEL_METADATA_EDITING) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -853,24 +853,24 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> @Action(DepositAction.CancelMetadataEditingSuccess) cancelMetadataEditingSuccess(ctx: StateContext<DepositStateModel>, action: DepositAction.CancelMetadataEditingSuccess): void { - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.cancelMetadataEditing.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("deposit.notification.cancelMetadataEditing.success")); ctx.dispatch(new Navigate([RoutesEnum.deposit, action.parentAction.deposit.organizationalUnitId, DepositTabStatusEnum.completed])); } @Action(DepositAction.CancelMetadataEditingFail) cancelMetadataEditingFail(ctx: StateContext<DepositStateModel>, action: DepositAction.CancelMetadataEditingFail): void { - this.notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.cancelMetadataEditing.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("deposit.notification.cancelMetadataEditing.fail")); } @Action(DepositAction.ComputeModeTab) computeModeTab(ctx: StateContext<DepositStateModel>, action: DepositAction.ComputeModeTab): void { let mode: ModeDepositTabEnum; - const url = this.store.selectSnapshot((s: LocalStateModel) => s.router.state.url); + const url = this._store.selectSnapshot((s: LocalStateModel) => s.router.state.url); const currentDisplay = url.substring(url.lastIndexOf(urlSeparator) + 1, url.length); const baseUrl = url.substring(0, url.lastIndexOf(urlSeparator)); const numberCollection = ctx.getState()?.deposit_collection?.numberCollections; - const numberFiles = DataFileUploadHelper.numberFiles(this.store); + const numberFiles = DataFileUploadHelper.numberFiles(this._store); let redirectionRouteSuffix = undefined; if (numberCollection > 0) { @@ -909,7 +909,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> uploadPhoto(ctx: StateContext<DepositStateModel>, action: DepositAction.UploadPhoto): Observable<any> { if (isNotNullNorUndefined(ctx.getState().dataFileLogo)) { ctx.dispatch(new DepositAction.DeletePhoto(action.resId, action.file)); - return this.actions$.pipe( + return this._actions$.pipe( ofSolidifyActionCompleted(DepositAction.DeletePhotoSuccess), switchMap(result => { if (isTrue(result.result.successful)) { @@ -932,7 +932,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> file: action.file, } as DlcmFileUploadWrapper); - this.subscribe(StoreUtil.waitForSubActionCompletion(this.actions$, + this.subscribe(StoreUtil.waitForSubActionCompletion(this._actions$, actionUploadDataFile, DepositUploadAction.UploadFileSuccess, resultAction => { @@ -943,7 +943,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> ctx.dispatch(new DepositAction.UploadPhotoSuccess(resultAction as any)); })); - this.subscribe(StoreUtil.waitForSubActionCompletion(this.actions$, + this.subscribe(StoreUtil.waitForSubActionCompletion(this._actions$, actionUploadDataFile, DepositUploadAction.UploadFileFail, resultAction => { @@ -961,7 +961,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> const searchItems = QueryParametersUtil.getSearchItems(queryParameters); MappingObjectUtil.set(searchItems, "dataCategory", Enums.DataFile.DataCategoryEnum.Internal); MappingObjectUtil.set(searchItems, "dataType", Enums.DataFile.DataTypeEnum.DatasetThumbnail); - return this.apiService.get<DataFile>(this._urlResource + urlSeparator + depositId + urlSeparator + ApiResourceNameEnum.DATAFILE, queryParameters) + return this._apiService.get<DataFile>(this._urlResource + urlSeparator + depositId + urlSeparator + ApiResourceNameEnum.DATAFILE, queryParameters) .pipe( tap((collection: CollectionTyped<DataFile>) => { if (collection._data.length === 1) { @@ -996,7 +996,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> continueUntil: () => !isReady, actionToDo: () => { const url = `${this._urlResource}/${depositId}/${ApiResourceNameEnum.DATAFILE}/${datafileId}`; - this.subscribe(this.apiService.getByIdInPath(url) + this.subscribe(this._apiService.getByIdInPath(url) .pipe( tap((result: DataFile) => { if (result.status === Enums.DataFile.StatusEnum.READY) { diff --git a/src/app/features/deposit/stores/organizational-unit/additional-fields-form/deposit-organizational-unit-additional-fields-form.state.ts b/src/app/features/deposit/stores/organizational-unit/additional-fields-form/deposit-organizational-unit-additional-fields-form.state.ts index 71616e294..653f7c241 100644 --- a/src/app/features/deposit/stores/organizational-unit/additional-fields-form/deposit-organizational-unit-additional-fields-form.state.ts +++ b/src/app/features/deposit/stores/organizational-unit/additional-fields-form/deposit-organizational-unit-additional-fields-form.state.ts @@ -74,11 +74,11 @@ export interface DepositOrganizationalUnitAdditionalFieldsFormStateModel extends }, }) export class DepositOrganizationalUnitAdditionalFieldsFormState extends CompositionState<DepositOrganizationalUnitAdditionalFieldsFormStateModel, AdditionalFieldsForm> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: depositOrganizationalUnitAdditionalFieldsFormActionNameSpace, resourceName: ApiResourceNameEnum.ADDITIONAL_FIELDS_FORM, }); @@ -93,7 +93,7 @@ export class DepositOrganizationalUnitAdditionalFieldsFormState extends Composit ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.getByIdInPath<AdditionalFieldsForm>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiResourceNameEnum.CURRENT_VERSION}`) + return this._apiService.getByIdInPath<AdditionalFieldsForm>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiResourceNameEnum.CURRENT_VERSION}`) .pipe( tap(result => ctx.dispatch(new GetCurrentMetadataFormSuccess(action, result))), catchError((error: SolidifyHttpErrorResponseModel) => { diff --git a/src/app/features/deposit/stores/organizational-unit/deposit-organizational-unit.state.ts b/src/app/features/deposit/stores/organizational-unit/deposit-organizational-unit.state.ts index daf7c354f..15c5259af 100644 --- a/src/app/features/deposit/stores/organizational-unit/deposit-organizational-unit.state.ts +++ b/src/app/features/deposit/stores/organizational-unit/deposit-organizational-unit.state.ts @@ -77,12 +77,12 @@ export interface DepositOrganizationalUnitStateModel extends ResourceLogoStateMo }) export class DepositOrganizationalUnitState extends ResourceLogoState<DepositOrganizationalUnitStateModel, OrganizationalUnit> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, protected readonly _httpClient: HttpClient) { - super(apiService, store, notificationService, actions$, { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: depositOrganizationalUnitNameSpace, }, _httpClient, ResourceLogoStateModeEnum.logo); } diff --git a/src/app/features/deposit/stores/people/deposit-people.state.ts b/src/app/features/deposit/stores/people/deposit-people.state.ts index 0129a5d8f..9a724ed13 100644 --- a/src/app/features/deposit/stores/people/deposit-people.state.ts +++ b/src/app/features/deposit/stores/people/deposit-people.state.ts @@ -53,11 +53,11 @@ export interface DepositPersonStateModel extends AssociationRemoteStateModel<Per }) export class DepositPeopleState extends AssociationRemoteState<DepositPersonStateModel, Person> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: depositPersonActionNameSpace, resourceName: ApiResourceNameEnum.CONTRIBUTOR, }); diff --git a/src/app/features/deposit/stores/status-history/deposit-status-history.state.ts b/src/app/features/deposit/stores/status-history/deposit-status-history.state.ts index ff356bdcd..e8aa0691f 100644 --- a/src/app/features/deposit/stores/status-history/deposit-status-history.state.ts +++ b/src/app/features/deposit/stores/status-history/deposit-status-history.state.ts @@ -54,11 +54,11 @@ export interface DepositStatusHistoryStateModel extends StatusHistoryStateModel< }) export class DepositStatusHistoryState extends StatusHistoryState<DepositStatusHistoryStateModel, Deposit> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: depositStatusHistoryNamespace, }); } diff --git a/src/app/features/deposit/stores/upload/deposit-upload.state.ts b/src/app/features/deposit/stores/upload/deposit-upload.state.ts index 6092eef7c..0e340be3b 100644 --- a/src/app/features/deposit/stores/upload/deposit-upload.state.ts +++ b/src/app/features/deposit/stores/upload/deposit-upload.state.ts @@ -85,18 +85,18 @@ export class DepositUploadState extends UploadState<DepositUploadStateModel, Dep private readonly _CHECKSUM_CRC32: string = "checksumCrc32"; private readonly _CHECKSUM_CRC32_ORIGIN: string = "checksumCrc32Origin"; - constructor(protected readonly apiService: ApiService, - protected readonly store: Store, - protected readonly notificationService: NotificationService, - protected readonly actions$: Actions, + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, @Inject(ENVIRONMENT) protected readonly _environment: DlcmEnvironment, @Inject(LABEL_TRANSLATE) protected readonly _labelTranslateInterface: LabelTranslateInterface, protected readonly _translate: TranslateService, ) { - super(apiService, store, notificationService, actions$, { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: depositUploadActionNameSpace, - callbackAfterAllUploadFinished: action => store.dispatch(new DepositDataFileAction.Refresh(action.parentId)), - fileSizeLimit: () => +MemoizedUtil.selectSnapshot(this.store, AppSystemPropertyState, state => state.current.fileSizeLimit), + callbackAfterAllUploadFinished: action => _store.dispatch(new DepositDataFileAction.Refresh(action.parentId)), + fileSizeLimit: () => +MemoizedUtil.selectSnapshot(this._store, AppSystemPropertyState, state => state.current.fileSizeLimit), }, _environment, _labelTranslateInterface, _translate); } @@ -104,7 +104,7 @@ export class DepositUploadState extends UploadState<DepositUploadStateModel, Dep return ApiEnum.preIngestDeposits; } - protected override generateUploadFormData(action: DepositUploadAction.UploadFile): FormData { + protected override _generateUploadFormData(action: DepositUploadAction.UploadFile): FormData { const formData = new FormData(); const fileUploadWrapper = action.fileUploadWrapper as DlcmFileUploadWrapper; if (!action.isArchive) { diff --git a/src/app/features/home/components/presentationals/home-carousel/home-carousel.presentational.ts b/src/app/features/home/components/presentationals/home-carousel/home-carousel.presentational.ts index 4af88bb36..3d1940c62 100644 --- a/src/app/features/home/components/presentationals/home-carousel/home-carousel.presentational.ts +++ b/src/app/features/home/components/presentationals/home-carousel/home-carousel.presentational.ts @@ -84,7 +84,7 @@ export class HomeCarouselPresentational extends SharedAbstractPresentational imp } return true; }, - actionToDo: () => this.changeActiveTile(), + actionToDo: () => this._changeActiveTile(), })); } @@ -93,7 +93,7 @@ export class HomeCarouselPresentational extends SharedAbstractPresentational imp this.skipNextChangeDueToManualChangeOfTiles = true; } - private changeActiveTile(): void { + private _changeActiveTile(): void { this.activeTile++; if (this.activeTile >= this.listTiles?.length) { this.activeTile = 0; diff --git a/src/app/features/home/components/presentationals/home-partners/home-partners.presentational.ts b/src/app/features/home/components/presentationals/home-partners/home-partners.presentational.ts index f8bfe40eb..c0081071d 100644 --- a/src/app/features/home/components/presentationals/home-partners/home-partners.presentational.ts +++ b/src/app/features/home/components/presentationals/home-partners/home-partners.presentational.ts @@ -40,7 +40,7 @@ export class HomePartnersPresentational extends SharedAbstractPresentational { @Input() currentTheme: ThemeEnum; - private readonly unigeImage: ImageInfos = { + private readonly _unigeImage: ImageInfos = { imageName: "UNIGE.png", altText: "UNIGE", url: "https://www.unige.ch/", @@ -60,11 +60,11 @@ export class HomePartnersPresentational extends SharedAbstractPresentational { ]; listDeveloppedBy: ImageInfos[] = [ - this.unigeImage, + this._unigeImage, ]; listProjectMembers: ImageInfos[] = [ - this.unigeImage, + this._unigeImage, { imageName: "hes-so.png", altText: "HES-SO", diff --git a/src/app/features/home/components/presentationals/home-search-facet/home-search-facet.presentational.ts b/src/app/features/home/components/presentationals/home-search-facet/home-search-facet.presentational.ts index 73e078363..4f6656709 100644 --- a/src/app/features/home/components/presentationals/home-search-facet/home-search-facet.presentational.ts +++ b/src/app/features/home/components/presentationals/home-search-facet/home-search-facet.presentational.ts @@ -74,14 +74,14 @@ export class HomeSearchFacetPresentational extends SharedAbstractPresentational this._initFacetsSelected(value); } - private isEnabled: boolean; + private _isEnabled: boolean; private _initFacetsSelected(value: MappingObject<string[]>): void { - if (this.isEnabled === true) { + if (this._isEnabled === true) { return; } this.facetsSelected = MappingObjectUtil.copy(value); - this.isEnabled = true; + this._isEnabled = true; this.numberActiveCriteria = 0; MappingObjectUtil.forEach(this.facetsSelected, values => this.numberActiveCriteria += values.length); @@ -121,7 +121,7 @@ export class HomeSearchFacetPresentational extends SharedAbstractPresentational return this._listFacets; } - constructor(private _fb: FormBuilder) { + constructor(private readonly _fb: FormBuilder) { super(); } diff --git a/src/app/features/home/components/presentationals/home-tweet-detail/home-twitter-widget.presentational.ts b/src/app/features/home/components/presentationals/home-tweet-detail/home-twitter-widget.presentational.ts index 46eea16b2..860eb789f 100644 --- a/src/app/features/home/components/presentationals/home-tweet-detail/home-twitter-widget.presentational.ts +++ b/src/app/features/home/components/presentationals/home-tweet-detail/home-twitter-widget.presentational.ts @@ -77,11 +77,11 @@ export class HomeTwitterWidgetPresentational extends SharedAbstractPresentationa @Input() chrome: TwitterChromeEnum[] = [TwitterChromeEnum.noborders]; - constructor(private _renderer: Renderer2, - private _element: ElementRef, - private _twitterService: TwitterService, - private _loggingService: LoggingService, - @Inject(WINDOW) private _window: Window) { + constructor(private readonly _renderer: Renderer2, + private readonly _element: ElementRef, + private readonly _twitterService: TwitterService, + private readonly _loggingService: LoggingService, + @Inject(WINDOW) private readonly _window: Window) { super(); } diff --git a/src/app/features/home/components/routables/home-archive-collection-list/home-archive-collection-list.routable.ts b/src/app/features/home/components/routables/home-archive-collection-list/home-archive-collection-list.routable.ts index bef684713..514f7fa5a 100644 --- a/src/app/features/home/components/routables/home-archive-collection-list/home-archive-collection-list.routable.ts +++ b/src/app/features/home/components/routables/home-archive-collection-list/home-archive-collection-list.routable.ts @@ -179,7 +179,7 @@ export class HomeArchiveCollectionListRoutable extends SharedAbstractRoutable im ngOnInit(): void { super.ngOnInit(); - this.getCurrentModelOnParent(); + this._getCurrentModelOnParent(); this.subscribe(this._store.select((s: LocalStateModel) => s.router.state.url) .pipe( @@ -191,12 +191,12 @@ export class HomeArchiveCollectionListRoutable extends SharedAbstractRoutable im )); } - private getCurrentModelOnParent(): void { + private _getCurrentModelOnParent(): void { this._archiveId = this._route.parent.snapshot.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); - this.getArchiveById(this._archiveId); + this._getArchiveById(this._archiveId); } - private getArchiveById(id: string): void { + private _getArchiveById(id: string): void { this.getSubResourceWithParentId(id); } diff --git a/src/app/features/home/components/routables/home-archive-detail/home-archive-detail.routable.ts b/src/app/features/home/components/routables/home-archive-detail/home-archive-detail.routable.ts index e79bfb5af..7abdfbe4d 100644 --- a/src/app/features/home/components/routables/home-archive-detail/home-archive-detail.routable.ts +++ b/src/app/features/home/components/routables/home-archive-detail/home-archive-detail.routable.ts @@ -111,7 +111,7 @@ export class HomeArchiveDetailRoutable extends SharedAbstractPresentational impl private readonly _archiveAccessRightService: ArchiveAccessRightService, private readonly _router: Router, private readonly _changeDetector: ChangeDetectorRef, - protected route: ActivatedRoute) { + protected readonly _route: ActivatedRoute) { super(); } @@ -133,7 +133,7 @@ export class HomeArchiveDetailRoutable extends SharedAbstractPresentational impl distinctUntilChanged(), tap(archiveId => { this._resId = archiveId; - this.getById(this._resId); + this._getById(this._resId); this._initIsLoadingPrepareDownloadObs(); }), )); @@ -146,18 +146,18 @@ export class HomeArchiveDetailRoutable extends SharedAbstractPresentational impl } private _promptRequestAccessDialogIfLoggedAndParamInUrl(): void { - this.subscribe(this.route.paramMap.pipe( + this.subscribe(this._route.paramMap.pipe( take(1), tap(p => { const currentUser = MemoizedUtil.currentSnapshot(this._store, AppUserState); if (isNotNullNorUndefined(currentUser)) { - this.checkArchiveQueryParams(); + this._checkArchiveQueryParams(); } }), )); } - private checkArchiveQueryParams(): void { + private _checkArchiveQueryParams(): void { const hasAccessRequest = UrlQueryParamHelper.contains(environment.accessRequestRoute); const archive = MemoizedUtil.selectSnapshot(this._store, HomeState, state => state.current); @@ -171,7 +171,7 @@ export class HomeArchiveDetailRoutable extends SharedAbstractPresentational impl } } - private getById(id: string): void { + private _getById(id: string): void { const archive = MemoizedUtil.selectSnapshot(this._store, HomeState, state => state.current); this._store.dispatch(new HomeAction.GetStatistics(id)); if (this._archiveAccessRightService.isDownloadAuthorized(archive)) { diff --git a/src/app/features/home/components/routables/home-archive-file-list/home-archive-file-list.routable.ts b/src/app/features/home/components/routables/home-archive-file-list/home-archive-file-list.routable.ts index 6736c2136..bf2f3a66d 100644 --- a/src/app/features/home/components/routables/home-archive-file-list/home-archive-file-list.routable.ts +++ b/src/app/features/home/components/routables/home-archive-file-list/home-archive-file-list.routable.ts @@ -185,7 +185,7 @@ export class HomeArchiveFileListRoutable extends SharedAbstractRoutable implemen ngOnInit(): void { super.ngOnInit(); - this.getCurrentModelOnParent(); + this._getCurrentModelOnParent(); this.subscribe(this._store.select((s: LocalStateModel) => s.router.state.url) .pipe( @@ -197,12 +197,12 @@ export class HomeArchiveFileListRoutable extends SharedAbstractRoutable implemen )); } - private getCurrentModelOnParent(): void { + private _getCurrentModelOnParent(): void { this._archiveId = this._route.parent.snapshot.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); - this.getArchiveById(this._archiveId); + this._getArchiveById(this._archiveId); } - private getArchiveById(id: string): void { + private _getArchiveById(id: string): void { this.getSubResourceWithParentId(id); } diff --git a/src/app/features/home/components/routables/home-archive-not-found/home-archive-not-found.routable.ts b/src/app/features/home/components/routables/home-archive-not-found/home-archive-not-found.routable.ts index a981bc5a6..0c993cb4e 100644 --- a/src/app/features/home/components/routables/home-archive-not-found/home-archive-not-found.routable.ts +++ b/src/app/features/home/components/routables/home-archive-not-found/home-archive-not-found.routable.ts @@ -79,10 +79,10 @@ export class HomeArchiveNotFoundRoutable extends SharedAbstractRoutable implemen } back(): void { - this.navigate([RoutesEnum.homeSearch]); + this._navigate([RoutesEnum.homeSearch]); } - private navigate(path: (string | number)[]): void { + private _navigate(path: (string | number)[]): void { this._store.dispatch(new Navigate(path)); } } diff --git a/src/app/features/home/components/routables/home-page/home-page.routable.ts b/src/app/features/home/components/routables/home-page/home-page.routable.ts index 666e905a2..a0eee2328 100644 --- a/src/app/features/home/components/routables/home-page/home-page.routable.ts +++ b/src/app/features/home/components/routables/home-page/home-page.routable.ts @@ -62,10 +62,10 @@ import { changeDetection: ChangeDetectionStrategy.OnPush, }) export class HomePageRoutable extends SharedAbstractPresentational implements OnInit, OnDestroy { - queryParametersObs: Observable<QueryParameters> = MemoizedUtil.select(this.store, HomeState, state => state.queryParameters); - isLoadingObs: Observable<boolean> = MemoizedUtil.isLoading(this.store, HomeState); - themeObs: Observable<ThemeEnum> = MemoizedUtil.select(this.store, AppState, state => state.theme); - carouselTilesObs: Observable<Node[]> = MemoizedUtil.select(this.store, AppCarouselState, state => state.tiles); + queryParametersObs: Observable<QueryParameters> = MemoizedUtil.select(this._store, HomeState, state => state.queryParameters); + isLoadingObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, HomeState); + themeObs: Observable<ThemeEnum> = MemoizedUtil.select(this._store, AppState, state => state.theme); + carouselTilesObs: Observable<Node[]> = MemoizedUtil.select(this._store, AppCarouselState, state => state.tiles); searchValueInUrl: string = StringUtil.stringEmpty; @@ -77,8 +77,8 @@ export class HomePageRoutable extends SharedAbstractPresentational implements On return StringUtil.convertToPascalCase(environment.theme); } - constructor(private store: Store, - private translate: TranslateService, + constructor(private readonly _store: Store, + private readonly _translate: TranslateService, private readonly _route: ActivatedRoute, private readonly _actions$: Actions, private readonly _archiveAccessRightService: ArchiveAccessRightService, @@ -95,7 +95,7 @@ export class HomePageRoutable extends SharedAbstractPresentational implements On } search(searchTerm: string): void { - HomeHelper.navigateToSearch(this.store, searchTerm); + HomeHelper.navigateToSearch(this._store, searchTerm); } ngOnDestroy(): void { @@ -103,19 +103,19 @@ export class HomePageRoutable extends SharedAbstractPresentational implements On } navigate($event: RoutesEnum): void { - this.store.dispatch(new Navigate([$event])); + this._store.dispatch(new Navigate([$event])); } goToDeposit(): void { - const isLogged = MemoizedUtil.selectSnapshot(this.store, AppState, state => state.isLoggedIn); + const isLogged = MemoizedUtil.selectSnapshot(this._store, AppState, state => state.isLoggedIn); if (isLogged) { - this.store.dispatch(new Navigate([RoutesEnum.deposit])); + this._store.dispatch(new Navigate([RoutesEnum.deposit])); } else { this._oauthService.initAuthorizationCodeFlow(AppRoutesEnum.deposit); } } getToSearch(): void { - this.store.dispatch(new Navigate([RoutesEnum.homeSearch], HomeHelper.getDefaultSearchQueryParams())); + this._store.dispatch(new Navigate([RoutesEnum.homeSearch], HomeHelper.getDefaultSearchQueryParams())); } } diff --git a/src/app/features/home/components/routables/home-search/home-search.routable.ts b/src/app/features/home/components/routables/home-search/home-search.routable.ts index b594ddd79..856d5a466 100644 --- a/src/app/features/home/components/routables/home-search/home-search.routable.ts +++ b/src/app/features/home/components/routables/home-search/home-search.routable.ts @@ -87,17 +87,17 @@ import { changeDetection: ChangeDetectionStrategy.OnPush, }) export class HomeSearchRoutable extends SharedAbstractPresentational implements OnInit, OnDestroy { - searchObs: Observable<string> = MemoizedUtil.select(this.store, HomeState, state => state.search); - facetsSelectedObs: Observable<MappingObject<string[]>> = MemoizedUtil.select(this.store, HomeState, state => state.facetsSelected); - queryParametersObs: Observable<QueryParameters> = MemoizedUtil.select(this.store, HomeState, state => state.queryParameters); - viewModeTableEnumObs: Observable<ViewModeTableEnum> = MemoizedUtil.select(this.store, HomeState, state => state.viewModeTableEnum); - totalObs: Observable<number> = MemoizedUtil.select(this.store, HomeState, state => state.total); - listObs: Observable<Archive[]> = MemoizedUtil.select(this.store, HomeState, state => state.list); - facetsObs: Observable<Facet[]> = MemoizedUtil.select(this.store, HomeState, state => state.facets); - isLoadingObs: Observable<boolean> = MemoizedUtil.isLoading(this.store, HomeState); - systemPropertyObs: Observable<SystemProperty> = MemoizedUtil.select(this.store, AppSystemPropertyState, state => state.current); - isInTourModeObs: Observable<boolean> = MemoizedUtil.select(this.store, AppState, state => state.isInTourMode); - isLoggedInObs: Observable<boolean> = MemoizedUtil.select(this.store, AppState, state => state.isLoggedIn); + searchObs: Observable<string> = MemoizedUtil.select(this._store, HomeState, state => state.search); + facetsSelectedObs: Observable<MappingObject<string[]>> = MemoizedUtil.select(this._store, HomeState, state => state.facetsSelected); + queryParametersObs: Observable<QueryParameters> = MemoizedUtil.select(this._store, HomeState, state => state.queryParameters); + viewModeTableEnumObs: Observable<ViewModeTableEnum> = MemoizedUtil.select(this._store, HomeState, state => state.viewModeTableEnum); + totalObs: Observable<number> = MemoizedUtil.select(this._store, HomeState, state => state.total); + listObs: Observable<Archive[]> = MemoizedUtil.select(this._store, HomeState, state => state.list); + facetsObs: Observable<Facet[]> = MemoizedUtil.select(this._store, HomeState, state => state.facets); + isLoadingObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, HomeState); + systemPropertyObs: Observable<SystemProperty> = MemoizedUtil.select(this._store, AppSystemPropertyState, state => state.current); + isInTourModeObs: Observable<boolean> = MemoizedUtil.select(this._store, AppState, state => state.isInTourMode); + isLoggedInObs: Observable<boolean> = MemoizedUtil.select(this._store, AppState, state => state.isLoggedIn); isFacetClosed: boolean = true; get viewModeTableEnum(): typeof ViewModeTableEnum { @@ -175,24 +175,24 @@ export class HomeSearchRoutable extends SharedAbstractPresentational implements callback: current => this.download(current), placeholder: current => LabelTranslateEnum.download, disableCondition: current => this.archiveAccessRightService.isAccessControlled(current), - displayOnCondition: current => this.store.selectSnapshot((state: LocalStateModel) => state.application.isLoggedIn) || current.accessLevel === Enums.Deposit.AccessEnum.PUBLIC, + displayOnCondition: current => this._store.selectSnapshot((state: LocalStateModel) => state.application.isLoggedIn) || current.accessLevel === Enums.Deposit.AccessEnum.PUBLIC, }, { logo: IconNameEnum.addToCart, callback: current => this.addToCart(current), placeholder: current => LabelTranslateEnum.addToDownloadOrder, - displayOnCondition: current => MemoizedUtil.selectSnapshot(this.store, AppState, state => state.isLoggedIn), + displayOnCondition: current => MemoizedUtil.selectSnapshot(this._store, AppState, state => state.isLoggedIn), }, { logo: IconNameEnum.sendRequest, - callback: current => this.requestAccessDataset(current), + callback: current => this._requestAccessDataset(current), placeholder: current => LabelTranslateEnum.requestAccess, displayOnCondition: current => !this.archiveAccessRightService.isDownloadAuthorized(current), }, ]; - constructor(private readonly store: Store, - private readonly translate: TranslateService, + constructor(private readonly _store: Store, + private readonly _translate: TranslateService, private readonly _route: ActivatedRoute, private readonly _actions$: Actions, private readonly _archiveAccessRightService: ArchiveAccessRightService, @@ -204,48 +204,48 @@ export class HomeSearchRoutable extends SharedAbstractPresentational implements ngOnInit(): void { super.ngOnInit(); - this.subscribe(this.observeSearchQueryParam()); + this.subscribe(this._observeSearchQueryParam()); } - private observeSearchQueryParam(): Observable<Params> { + private _observeSearchQueryParam(): Observable<Params> { return this._route.queryParams.pipe(tap(params => { const searchInfos = HomeHelper.extractSearchInfosFromUrl(params); - this.store.dispatch(new HomeAction.Search(true, searchInfos.search, searchInfos.facetsSelected, searchInfos.viewTabMode)); + this._store.dispatch(new HomeAction.Search(true, searchInfos.search, searchInfos.facetsSelected, searchInfos.viewTabMode)); })); } - private requestAccessDataset(archive: Archive): void { + private _requestAccessDataset(archive: Archive): void { this._archiveAccessRightService.requestAccessDataset(archive); } searchText(search: string): void { - const facetsSelected = MemoizedUtil.selectSnapshot(this.store, HomeState, state => state.facetsSelected); - const viewMode = MemoizedUtil.selectSnapshot(this.store, HomeState, state => state.viewModeTableEnum); + const facetsSelected = MemoizedUtil.selectSnapshot(this._store, HomeState, state => state.facetsSelected); + const viewMode = MemoizedUtil.selectSnapshot(this._store, HomeState, state => state.viewModeTableEnum); this._search(search, facetsSelected, viewMode); } searchFacet(facetsSelected: MappingObject<string[]>): void { - const search = MemoizedUtil.selectSnapshot(this.store, HomeState, state => state.search); - const viewMode = MemoizedUtil.selectSnapshot(this.store, HomeState, state => state.viewModeTableEnum); + const search = MemoizedUtil.selectSnapshot(this._store, HomeState, state => state.search); + const viewMode = MemoizedUtil.selectSnapshot(this._store, HomeState, state => state.viewModeTableEnum); this._search(search, facetsSelected, viewMode); } switchViewMode(viewMode: ViewModeTableEnum): void { - const search = MemoizedUtil.selectSnapshot(this.store, HomeState, state => state.search); - const facetsSelected = MemoizedUtil.selectSnapshot(this.store, HomeState, state => state.facetsSelected); + const search = MemoizedUtil.selectSnapshot(this._store, HomeState, state => state.search); + const facetsSelected = MemoizedUtil.selectSnapshot(this._store, HomeState, state => state.facetsSelected); this._search(search, facetsSelected, viewMode); } private _search(searchTerm: string, facetsSelected: MappingObject<string[]>, viewModeTableEnum: ViewModeTableEnum = ViewModeTableEnum.list): void { - HomeHelper.navigateToSearch(this.store, searchTerm, facetsSelected, viewModeTableEnum); + HomeHelper.navigateToSearch(this._store, searchTerm, facetsSelected, viewModeTableEnum); } onQueryParametersEvent($event: QueryParameters): void { - this.store.dispatch(new HomeAction.ChangeQueryParameters($event)); + this._store.dispatch(new HomeAction.ChangeQueryParameters($event)); } showDetail(archive: Archive): void { - this.store.dispatch(new Navigate([RoutesEnum.homeDetail, archive.resId])); + this._store.dispatch(new Navigate([RoutesEnum.homeDetail, archive.resId])); } ngOnDestroy(): void { @@ -253,30 +253,30 @@ export class HomeSearchRoutable extends SharedAbstractPresentational implements } download(archive: Archive): void { - this.store.dispatch(new SharedArchiveAction.Download(archive)); + this._store.dispatch(new SharedArchiveAction.Download(archive)); } addToCart(archive: Archive): void { - this.store.dispatch(new AppCartAction.AddToCart(archive)); + this._store.dispatch(new AppCartAction.AddToCart(archive)); } navigate($event: RoutesEnum): void { - this.store.dispatch(new Navigate([$event])); + this._store.dispatch(new Navigate([$event])); } goToDeposit(): void { - const isLogged = MemoizedUtil.selectSnapshot(this.store, AppState, state => state.isLoggedIn); + const isLogged = MemoizedUtil.selectSnapshot(this._store, AppState, state => state.isLoggedIn); if (isLogged) { - this.store.dispatch(new Navigate([RoutesEnum.deposit])); + this._store.dispatch(new Navigate([RoutesEnum.deposit])); } else { this._oauthService.initAuthorizationCodeFlow(AppRoutesEnum.deposit); } } pageChange(paging: Paging): void { - const queryParameters = QueryParametersUtil.clone(MemoizedUtil.selectSnapshot(this.store, HomeState, state => state.queryParameters)); + const queryParameters = QueryParametersUtil.clone(MemoizedUtil.selectSnapshot(this._store, HomeState, state => state.queryParameters)); queryParameters.paging = paging; - this.store.dispatch(new HomeAction.ChangeQueryParameters(queryParameters)); + this._store.dispatch(new HomeAction.ChangeQueryParameters(queryParameters)); } openHelp(): void { diff --git a/src/app/features/home/services/archive-access-right.service.ts b/src/app/features/home/services/archive-access-right.service.ts index 77560881c..cee678a83 100644 --- a/src/app/features/home/services/archive-access-right.service.ts +++ b/src/app/features/home/services/archive-access-right.service.ts @@ -108,7 +108,7 @@ export class ArchiveAccessRightService extends AbstractBaseService { } } - private sendRequestAccessDataset(archiveId: string, archiveOrgUnitId: string, message: string): void { + private _sendRequestAccessDataset(archiveId: string, archiveOrgUnitId: string, message: string): void { this._store.dispatch(new SharedNotificationAction.Create({ model: { emitter: MemoizedUtil.currentSnapshot(this._store, AppUserState), @@ -129,7 +129,7 @@ export class ArchiveAccessRightService extends AbstractBaseService { minWidth: "500px", takeOne: true, }, message => { - this.sendRequestAccessDataset(archiveId, archiveOrgUnitId, message); + this._sendRequestAccessDataset(archiveId, archiveOrgUnitId, message); })); } diff --git a/src/app/features/home/services/twitter.service.ts b/src/app/features/home/services/twitter.service.ts index 98c835a5c..b0cee85a5 100644 --- a/src/app/features/home/services/twitter.service.ts +++ b/src/app/features/home/services/twitter.service.ts @@ -50,7 +50,7 @@ export class TwitterService extends AbstractBaseService { loadScript(renderer: Renderer2): Observable<TwitterMetadata> { return new Observable(observer => { - const twitterMetadata = this.initTwitterComponent(renderer); + const twitterMetadata = this._initTwitterComponent(renderer); twitterMetadata.ready((metadata: TwitterMetadata) => { observer.next(metadata); observer.complete(); @@ -58,34 +58,34 @@ export class TwitterService extends AbstractBaseService { }); } - private initTwitterComponent(renderer: Renderer2): TwitterMetadata { - if (this.getTwitterScript()) { + private _initTwitterComponent(renderer: Renderer2): TwitterMetadata { + if (this._getTwitterScript()) { return this._window[this.TWITTER_WINDOW_ID] || {}; } - const scriptTwitter = this.createScript(renderer); - const firstScriptTag = this.getFirstScriptTag(); + const scriptTwitter = this._createScript(renderer); + const firstScriptTag = this._getFirstScriptTag(); renderer.insertBefore(firstScriptTag.parentNode, scriptTwitter, firstScriptTag); - return this.initTwitterMetadata(); + return this._initTwitterMetadata(); } - private createScript(renderer: Renderer2): Element { + private _createScript(renderer: Renderer2): Element { const script = renderer.createElement(this._SCRIPT); renderer.setAttribute(script, this._ATTRIBUTE_ID, this._TWITTER_SCRIPT_ID); renderer.setAttribute(script, this._ATTRIBUTE_SRC, this._TWITTER_WIDGET_URL); return script; } - private getFirstScriptTag(): Element { + private _getFirstScriptTag(): Element { return this._document.getElementsByTagName(this._SCRIPT)[0]; } - private getTwitterScript(): HTMLElement { + private _getTwitterScript(): HTMLElement { return this._document.getElementById(this._TWITTER_SCRIPT_ID); } - private initTwitterMetadata(): TwitterMetadata { + private _initTwitterMetadata(): TwitterMetadata { const twitterMetadata: TwitterMetadata = {}; twitterMetadata._e = []; twitterMetadata.ready = (metadata: TwitterMetadata) => twitterMetadata._e.push(metadata); diff --git a/src/app/features/home/stores/archive/collection/home-archive-collection.state.ts b/src/app/features/home/stores/archive/collection/home-archive-collection.state.ts index e4bfdfdd8..7eb30fc29 100644 --- a/src/app/features/home/stores/archive/collection/home-archive-collection.state.ts +++ b/src/app/features/home/stores/archive/collection/home-archive-collection.state.ts @@ -89,15 +89,15 @@ export class HomeArchiveCollectionState extends BasicState<HomeArchiveCollection return ApiEnum.accessPublicMetadata; } - private evaluateSubResourceUrl(parentId: string): string { + private _evaluateSubResourceUrl(parentId: string): string { return this._urlResource + urlSeparator + parentId + urlSeparator + this._resourceName; } - constructor(protected apiService: ApiService, - protected store: Store, - protected httpClient: HttpClient, - protected notificationService: NotificationService, - protected actions$: Actions) { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _httpClient: HttpClient, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { super(); } @@ -125,8 +125,8 @@ export class HomeArchiveCollectionState extends BasicState<HomeArchiveCollection queryParameters: StoreUtil.getQueryParametersToApply(action.queryParameters, ctx), ...reset, }); - const url = this.evaluateSubResourceUrl(action.parentId); - return this.apiService.get<ArchiveMetadataDataFile>(url, ctx.getState().queryParameters) + const url = this._evaluateSubResourceUrl(action.parentId); + return this._apiService.get<ArchiveMetadataDataFile>(url, ctx.getState().queryParameters) .pipe( tap((collection: CollectionTyped<ArchiveMetadataDataFile>) => { collection._data = ArchiveDataFileHelper.adaptListArchivesMetadataInArchive(collection._data) as ArchiveDataFile[] | any; @@ -164,7 +164,7 @@ export class HomeArchiveCollectionState extends BasicState<HomeArchiveCollection current: undefined, }); - return this.apiService.getById<ArchiveMetadataDataFile>(this.evaluateSubResourceUrl(action.parentId), action.resId) + return this._apiService.getById<ArchiveMetadataDataFile>(this._evaluateSubResourceUrl(action.parentId), action.resId) .pipe( tap(model => ctx.dispatch(new HomeArchiveCollectionAction.GetByIdSuccess(action, ArchiveDataFileHelper.adaptArchiveMetadataInArchiveDataFile(model)))), catchError((error: SolidifyHttpErrorResponseModel) => { @@ -199,8 +199,8 @@ export class HomeArchiveCollectionState extends BasicState<HomeArchiveCollection { action: new HomeArchiveCollectionAction.GetAll(action.parentId, undefined, true), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(HomeArchiveCollectionAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(HomeArchiveCollectionAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(HomeArchiveCollectionAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(HomeArchiveCollectionAction.GetAllFail)), ], }, ]).pipe( diff --git a/src/app/features/home/stores/archive/data-file/home-archive-data-file.state.ts b/src/app/features/home/stores/archive/data-file/home-archive-data-file.state.ts index 813a8ff50..17d8c19b2 100644 --- a/src/app/features/home/stores/archive/data-file/home-archive-data-file.state.ts +++ b/src/app/features/home/stores/archive/data-file/home-archive-data-file.state.ts @@ -99,21 +99,21 @@ export interface HomeArchiveDataFileStateModel extends BaseResourceState { }) export class HomeArchiveDataFileState extends BasicState<HomeArchiveDataFileStateModel> { private readonly _resourceName: ApiResourceNameEnum = ApiResourceNameEnum.DATAFILE; - private readonly KEY_PATH: string = "path"; + private readonly _KEY_PATH: string = "path"; protected get _urlResource(): string { return ApiEnum.accessPublicMetadata; } - private evaluateSubResourceUrl(parentId: string): string { + private _evaluateSubResourceUrl(parentId: string): string { return this._urlResource + urlSeparator + parentId + urlSeparator + this._resourceName; } - constructor(protected apiService: ApiService, - protected store: Store, - protected httpClient: HttpClient, - protected notificationService: NotificationService, - protected actions$: Actions) { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _httpClient: HttpClient, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { super(); } @@ -135,10 +135,10 @@ export class HomeArchiveDataFileState extends BasicState<HomeArchiveDataFileStat } const currentFolder = ctx.getState().currentFolder; if (isNullOrUndefined(currentFolder)) { - MappingObjectUtil.delete(QueryParametersUtil.getSearchItems(queryParameters), this.KEY_PATH); + MappingObjectUtil.delete(QueryParametersUtil.getSearchItems(queryParameters), this._KEY_PATH); } else { - MappingObjectUtil.set(QueryParametersUtil.getSearchItems(queryParameters), this.KEY_PATH, ctx.getState().currentFolder); + MappingObjectUtil.set(QueryParametersUtil.getSearchItems(queryParameters), this._KEY_PATH, ctx.getState().currentFolder); } ctx.patchState({ queryParameters: queryParameters, @@ -156,8 +156,8 @@ export class HomeArchiveDataFileState extends BasicState<HomeArchiveDataFileStat queryParameters: StoreUtil.getQueryParametersToApply(action.queryParameters, ctx), ...reset, }); - const url = this.evaluateSubResourceUrl(action.parentId); - return this.apiService.get<ArchiveMetadataDataFile>(url, ctx.getState().queryParameters) + const url = this._evaluateSubResourceUrl(action.parentId); + return this._apiService.get<ArchiveMetadataDataFile>(url, ctx.getState().queryParameters) .pipe( tap((collection: CollectionTyped<ArchiveMetadataDataFile>) => { collection._data = ArchiveDataFileHelper.adaptListArchivesMetadataInArchive(collection._data) as ArchiveDataFile[] | any; @@ -195,7 +195,7 @@ export class HomeArchiveDataFileState extends BasicState<HomeArchiveDataFileStat current: undefined, }); - return this.apiService.getById<ArchiveMetadataDataFile>(this.evaluateSubResourceUrl(action.parentId), action.resId) + return this._apiService.getById<ArchiveMetadataDataFile>(this._evaluateSubResourceUrl(action.parentId), action.resId) .pipe( tap(model => ctx.dispatch(new HomeArchiveDataFileAction.GetByIdSuccess(action, ArchiveDataFileHelper.adaptArchiveMetadataInArchiveDataFile(model)))), catchError((error: SolidifyHttpErrorResponseModel) => { @@ -230,15 +230,15 @@ export class HomeArchiveDataFileState extends BasicState<HomeArchiveDataFileStat { action: new HomeArchiveDataFileAction.GetAll(action.parentId, undefined, true), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(HomeArchiveDataFileAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(HomeArchiveDataFileAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(HomeArchiveDataFileAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(HomeArchiveDataFileAction.GetAllFail)), ], }, { action: new HomeArchiveDataFileAction.GetListFolder(action.parentId), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(HomeArchiveDataFileAction.GetListFolderSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(HomeArchiveDataFileAction.GetListFolderFail)), + this._actions$.pipe(ofSolidifyActionCompleted(HomeArchiveDataFileAction.GetListFolderSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(HomeArchiveDataFileAction.GetListFolderFail)), ], }, ]).pipe( @@ -273,7 +273,7 @@ export class HomeArchiveDataFileState extends BasicState<HomeArchiveDataFileStat isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.httpClient.get<string[]>(`${this._urlResource}/${action.parentId}/${ApiActionNameEnum.LIST_FOLDERS}`) + return this._httpClient.get<string[]>(`${this._urlResource}/${action.parentId}/${ApiActionNameEnum.LIST_FOLDERS}`) .pipe( tap((listFolder: string[]) => { ctx.dispatch(new HomeArchiveDataFileAction.GetListFolderSuccess(action, listFolder)); @@ -310,7 +310,7 @@ export class HomeArchiveDataFileState extends BasicState<HomeArchiveDataFileStat ctx.patchState({ currentFolder: action.newCurrentFolder, }); - const archiveId = MemoizedUtil.selectSnapshot(this.store, HomeState, state => state.current?.resId); + const archiveId = MemoizedUtil.selectSnapshot(this._store, HomeState, state => state.current?.resId); if (!isNullOrUndefined(action.newCurrentFolder)) { ctx.dispatch(new HomeArchiveDataFileAction.GetListFolder(archiveId)); } diff --git a/src/app/features/home/stores/archive/package/home-archive-package.state.ts b/src/app/features/home/stores/archive/package/home-archive-package.state.ts index 06cadfb47..10bf99e5d 100644 --- a/src/app/features/home/stores/archive/package/home-archive-package.state.ts +++ b/src/app/features/home/stores/archive/package/home-archive-package.state.ts @@ -75,11 +75,11 @@ export class HomeArchivePackageState extends BasicState<HomeArchivePackageStateM return ApiEnum.accessPublicMetadata; } - constructor(protected apiService: ApiService, - protected store: Store, - protected httpClient: HttpClient, - protected notificationService: NotificationService, - protected actions$: Actions) { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _httpClient: HttpClient, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { super(); } @@ -94,7 +94,7 @@ export class HomeArchivePackageState extends BasicState<HomeArchivePackageStateM } ctx.patchState(objectToPatch); - return this.apiService.getByIdInPath<ArchiveMetadataPackages>(this._urlResource + urlSeparator + action.resId + urlSeparator + this._resourceName) + return this._apiService.getByIdInPath<ArchiveMetadataPackages>(this._urlResource + urlSeparator + action.resId + urlSeparator + this._resourceName) .pipe( tap(model => ctx.dispatch(new HomeArchivePackageAction.GetByIdSuccess(action, model))), catchError((error: SolidifyHttpErrorResponseModel) => { diff --git a/src/app/features/home/stores/archive/rating/home-archive-rating.state.ts b/src/app/features/home/stores/archive/rating/home-archive-rating.state.ts index 233f93d9c..38fbe56cd 100644 --- a/src/app/features/home/stores/archive/rating/home-archive-rating.state.ts +++ b/src/app/features/home/stores/archive/rating/home-archive-rating.state.ts @@ -77,11 +77,11 @@ export interface HomeArchiveRatingStateModel extends CompositionStateModel<Archi children: [], }) export class HomeArchiveRatingState extends CompositionState<HomeArchiveRatingStateModel, ArchiveUserRating> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: homeArchiveRatingActionNameSpace, resourceName: ApiActionNameEnum.RATING, keepCurrentStateAfterCreate: true, @@ -93,7 +93,7 @@ export class HomeArchiveRatingState extends CompositionState<HomeArchiveRatingSt return ApiEnum.accessPublicMetadata; } - private _evaluateSubResourceUrl(parentId: string): string { + protected override _evaluateSubResourceUrl(parentId: string): string { return this._urlResource + urlSeparator + parentId + urlSeparator + this._resourceName; } @@ -112,7 +112,7 @@ export class HomeArchiveRatingState extends CompositionState<HomeArchiveRatingSt ...reset, }); const url = this._evaluateSubResourceUrl(action.parentId) + urlSeparator + ApiActionNameEnum.RATING_BY_USER; - return this.apiService.get<ArchiveUserRating>(url, ctx.getState().queryParameters) + return this._apiService.get<ArchiveUserRating>(url, ctx.getState().queryParameters) .pipe( tap((collection: CollectionTyped<ArchiveUserRating>) => { ctx.dispatch(new HomeArchiveRatingAction.GetAllSuccess(action, collection)); @@ -151,7 +151,7 @@ export class HomeArchiveRatingState extends CompositionState<HomeArchiveRatingSt isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); const url = this._evaluateSubResourceUrl(action.parentId); - return this.apiService.post<ArchiveUserRating>(url, undefined, { + return this._apiService.post<ArchiveUserRating>(url, undefined, { ratingType: action.model.ratingType.resId, grade: action.model.grade, }) @@ -173,9 +173,9 @@ export class HomeArchiveRatingState extends CompositionState<HomeArchiveRatingSt isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); const rating = action.model; - rating.user = MemoizedUtil.selectSnapshot(this.store, AppUserState, state => state.current); + rating.user = MemoizedUtil.selectSnapshot(this._store, AppUserState, state => state.current); const url = this._evaluateSubResourceUrl(action.parentId); - return this.apiService.patchByIdWithCustomUrl<ArchiveUserRating>(url, action.model) + return this._apiService.patchByIdWithCustomUrl<ArchiveUserRating>(url, action.model) .pipe( tap(() => { ctx.dispatch(new HomeArchiveRatingAction.UpdateSuccess(action, action.parentId)); @@ -191,7 +191,7 @@ export class HomeArchiveRatingState extends CompositionState<HomeArchiveRatingSt @Action(HomeArchiveRatingAction.CreateSuccess) createSuccess(ctx: StateContext<HomeArchiveRatingStateModel>, action: HomeArchiveRatingAction.CreateSuccess): void { super.createSuccess(ctx, action); - this.notificationService.showSuccess(LabelTranslateEnum.evaluationTakenIntoAccount); + this._notificationService.showSuccess(LabelTranslateEnum.evaluationTakenIntoAccount); ctx.dispatch([ new HomeAction.GetStatistics(action.parentId), new HomeArchiveRatingAction.GetAllByCurrentUser(action.parentId), @@ -202,7 +202,7 @@ export class HomeArchiveRatingState extends CompositionState<HomeArchiveRatingSt @Action(HomeArchiveRatingAction.UpdateSuccess) updateSuccess(ctx: StateContext<HomeArchiveRatingStateModel>, action: HomeArchiveRatingAction.UpdateSuccess): void { super.updateSuccess(ctx, action); - this.notificationService.showSuccess(LabelTranslateEnum.evaluationTakenIntoAccount); + this._notificationService.showSuccess(LabelTranslateEnum.evaluationTakenIntoAccount); ctx.dispatch([ new HomeAction.GetStatistics(action.parentId), new HomeArchiveRatingAction.GetAllByCurrentUser(action.parentId), diff --git a/src/app/features/home/stores/home.state.ts b/src/app/features/home/stores/home.state.ts index 6183ca802..88f2566df 100644 --- a/src/app/features/home/stores/home.state.ts +++ b/src/app/features/home/stores/home.state.ts @@ -118,16 +118,16 @@ export class HomeState extends BasicState<HomeStateModel> { return ApiEnum.accessPublicMetadata; } - constructor(protected apiService: ApiService, - protected store: Store, - protected httpClient: HttpClient, - protected notificationService: NotificationService, - protected actions$: Actions) { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _httpClient: HttpClient, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { super(); } - private readonly PATH_FILTER: string = "query"; - private readonly DEFAULT_SEARCH: string = HOME_SEARCH_ALL; + private readonly _PATH_FILTER: string = "query"; + private readonly _DEFAULT_SEARCH: string = HOME_SEARCH_ALL; @Selector() static current(state: HomeStateModel): Archive { @@ -162,7 +162,7 @@ export class HomeState extends BasicState<HomeStateModel> { @Action(HomeAction.Search) search(ctx: StateContext<HomeStateModel>, action: HomeAction.Search): Observable<CollectionTyped<Metadata>> { - const searchString = this.getSearchStringToApply(ctx, action); + const searchString = this._getSearchStringToApply(ctx, action); const viewMode = this._getViewModeToApply(ctx, action); let queryParameters = StoreUtil.getQueryParametersToApply(action.queryParameters, ctx); if (action.resetPagination) { @@ -177,7 +177,7 @@ export class HomeState extends BasicState<HomeStateModel> { }); queryParameters = QueryParametersUtil.clone(queryParameters); - MappingObjectUtil.set(QueryParametersUtil.getSearchItems(queryParameters), this.PATH_FILTER, isEmptyString(searchString) ? HOME_SEARCH_ALL : searchString); + MappingObjectUtil.set(QueryParametersUtil.getSearchItems(queryParameters), this._PATH_FILTER, isEmptyString(searchString) ? HOME_SEARCH_ALL : searchString); const facetsSelectedForBackend = HomeHelper.getFacetsSelectedForBackend(action.facetsSelected); const json = JSON.stringify(facetsSelectedForBackend); @@ -187,14 +187,14 @@ export class HomeState extends BasicState<HomeStateModel> { const queryParametersHttp = ApiService.getQueryParameters(undefined, queryParameters); let body = new HttpParams(); body = body.set("conditions", json); - return this.httpClient.post<CollectionTyped<Metadata>>(this._urlResource + urlSeparator + ApiActionNameEnum.SEARCH, + return this._httpClient.post<CollectionTyped<Metadata>>(this._urlResource + urlSeparator + ApiActionNameEnum.SEARCH, body, { headers, params: queryParametersHttp, }, ).pipe( - StoreUtil.cancelUncompleted(ctx, this.actions$, [HomeAction.Search]), + StoreUtil.cancelUncompleted(ctx, this._actions$, [HomeAction.Search]), tap((collection: CollectionTyped<Metadata>) => { const collectionArchive = { _links: collection._links, @@ -211,16 +211,16 @@ export class HomeState extends BasicState<HomeStateModel> { ); } - private getSearchStringToApply(ctx: StateContext<HomeStateModel>, action: HomeAction.Search): string { + private _getSearchStringToApply(ctx: StateContext<HomeStateModel>, action: HomeAction.Search): string { if (isNullOrUndefined(action.search)) { - return this.getDefaultSearchStringIfNotDefined(ctx); + return this._getDefaultSearchStringIfNotDefined(ctx); } return action.search; } - private getDefaultSearchStringIfNotDefined(ctx: StateContext<HomeStateModel>): string { + private _getDefaultSearchStringIfNotDefined(ctx: StateContext<HomeStateModel>): string { if (ctx.getState().search === null || ctx.getState().search === undefined) { - return this.DEFAULT_SEARCH; + return this._DEFAULT_SEARCH; } return ctx.getState().search; } @@ -245,7 +245,7 @@ export class HomeState extends BasicState<HomeStateModel> { list: [], total: 0, }); - this.notificationService.showError(LabelTranslateEnum.notificationHttpInternalError); + this._notificationService.showError(LabelTranslateEnum.notificationHttpInternalError); } @Action(HomeAction.SearchRelativeArchive) @@ -257,11 +257,11 @@ export class HomeState extends BasicState<HomeStateModel> { }); const queryParameters = new QueryParameters(5); - MappingObjectUtil.set(QueryParametersUtil.getSearchItems(queryParameters), this.PATH_FILTER, searchString); + MappingObjectUtil.set(QueryParametersUtil.getSearchItems(queryParameters), this._PATH_FILTER, searchString); - return this.apiService.get<Metadata>(this._urlResource + urlSeparator + "search", queryParameters) + return this._apiService.get<Metadata>(this._urlResource + urlSeparator + "search", queryParameters) .pipe( - StoreUtil.cancelUncompleted(ctx, this.actions$, [HomeAction.Search]), + StoreUtil.cancelUncompleted(ctx, this._actions$, [HomeAction.Search]), tap((collection: any) => { collection._data = ArchiveHelper.adaptListArchivesMetadataInArchive(collection._data as Metadata[]); ctx.dispatch(new HomeAction.SearchRelativeArchiveSuccess(action, collection)); @@ -296,7 +296,7 @@ export class HomeState extends BasicState<HomeStateModel> { listRelativeArchive: undefined, }); - return this.apiService.getById<Metadata>(this._urlResource, action.resId) + return this._apiService.getById<Metadata>(this._urlResource, action.resId) .pipe( tap(model => ctx.dispatch(new HomeAction.SearchDetailSuccess(action, ArchiveHelper.adaptArchiveMetadataInArchive(model)))), catchError((error: SolidifyHttpErrorResponseModel) => { @@ -347,7 +347,7 @@ export class HomeState extends BasicState<HomeStateModel> { archiveStatisticDto: undefined, }); - return this.apiService.getByIdInPath<ArchiveStatisticsDto>(`${this._urlResource}/${action.archiveId}/${ApiActionNameEnum.STATISTICS}`) + return this._apiService.getByIdInPath<ArchiveStatisticsDto>(`${this._urlResource}/${action.archiveId}/${ApiActionNameEnum.STATISTICS}`) .pipe( tap((model: ArchiveStatisticsDto) => { ctx.dispatch(new HomeAction.GetStatisticsSuccess(action, model)); diff --git a/src/app/features/order/components/routables/order-home/order-home.routable.ts b/src/app/features/order/components/routables/order-home/order-home.routable.ts index 76b238424..ae9a14f11 100644 --- a/src/app/features/order/components/routables/order-home/order-home.routable.ts +++ b/src/app/features/order/components/routables/order-home/order-home.routable.ts @@ -69,13 +69,13 @@ export class OrderHomeRoutable extends SharedAbstractPresentational { }, ]; - constructor(private store: Store) { + constructor(private readonly _store: Store) { super(); - this.userRolesObs = this.store.selectSnapshot((state: LocalStateModel) => state.application.userRoles); + this.userRolesObs = this._store.selectSnapshot((state: LocalStateModel) => state.application.userRoles); } navigate(path: RoutesEnum): void { - this.store.dispatch(new Navigate([path])); + this._store.dispatch(new Navigate([path])); } getOrderResources(): OrderResource[] { diff --git a/src/app/features/order/features/all-order/components/presentationals/all-order-form/order-all-order-form.presentational.ts b/src/app/features/order/features/all-order/components/presentationals/all-order-form/order-all-order-form.presentational.ts index 923043c7a..ccfdf0e9d 100644 --- a/src/app/features/order/features/all-order/components/presentationals/all-order-form/order-all-order-form.presentational.ts +++ b/src/app/features/order/features/all-order/components/presentationals/all-order-form/order-all-order-form.presentational.ts @@ -76,7 +76,7 @@ export class OrderAllOrderFormPresentational extends AbstractFormPresentational< super.ngOnInit(); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.resId]: [undefined, []], [this.formDefinition.name]: ["", [Validators.required, SolidifyValidator]], @@ -86,7 +86,7 @@ export class OrderAllOrderFormPresentational extends AbstractFormPresentational< }); } - protected bindFormTo(order: Order): void { + protected _bindFormTo(order: Order): void { this.form = this._fb.group({ [this.formDefinition.resId]: [order.resId, []], [this.formDefinition.name]: [order.name, [Validators.required, SolidifyValidator]], @@ -97,7 +97,7 @@ export class OrderAllOrderFormPresentational extends AbstractFormPresentational< this.isValidWhenDisable = this.form.valid; } - protected treatmentBeforeSubmit(order: Order): Order { + protected _treatmentBeforeSubmit(order: Order): Order { delete order.resId; delete order.status; return order; diff --git a/src/app/features/order/features/all-order/components/routables/all-order-detail-edit/order-all-order-detail-edit.routable.ts b/src/app/features/order/features/all-order/components/routables/all-order-detail-edit/order-all-order-detail-edit.routable.ts index a117ed630..d47ed7d95 100644 --- a/src/app/features/order/features/all-order/components/routables/all-order-detail-edit/order-all-order-detail-edit.routable.ts +++ b/src/app/features/order/features/all-order/components/routables/all-order-detail-edit/order-all-order-detail-edit.routable.ts @@ -136,7 +136,7 @@ export class OrderAllOrderDetailEditRoutable extends AbstractDetailEditCommonRou color: "primary", icon: IconNameEnum.done, displayCondition: current => !this.isEdit && !isNullOrUndefined(current) && current.status === Enums.Order.StatusEnum.IN_PROGRESS, - callback: () => this.save(), + callback: () => this._save(), labelToTranslate: (current) => LabelTranslateEnum.save, order: 40, }, @@ -144,7 +144,7 @@ export class OrderAllOrderDetailEditRoutable extends AbstractDetailEditCommonRou color: "primary", icon: IconNameEnum.submit, displayCondition: current => !this.isEdit && !isNullOrUndefined(current) && current.status === Enums.Order.StatusEnum.IN_PROGRESS && current.aipNumber > 0, - callback: () => this.submit(), + callback: () => this._submit(), labelToTranslate: (current) => LabelTranslateEnum.submit, order: 40, }, @@ -152,7 +152,7 @@ export class OrderAllOrderDetailEditRoutable extends AbstractDetailEditCommonRou color: "primary", icon: IconNameEnum.resume, displayCondition: current => !this.isEdit && !isNullOrUndefined(current) && current.status === Enums.Order.StatusEnum.IN_ERROR, - callback: () => this.resume(), + callback: () => this._resume(), labelToTranslate: (current) => LabelTranslateEnum.resume, order: 40, }, @@ -183,13 +183,13 @@ export class OrderAllOrderDetailEditRoutable extends AbstractDetailEditCommonRou ngOnDestroy(): void { super.ngOnDestroy(); - this.cleanState(); + this._cleanState(); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new OrderAllOrderAipAction.GetAll(id)); this._store.dispatch(new OrderAllOrderDipAction.GetAll(id)); - this.view(); + this._view(); } showHistory(): void { @@ -207,19 +207,19 @@ export class OrderAllOrderDetailEditRoutable extends AbstractDetailEditCommonRou }); } - private submit(): void { + private _submit(): void { this._store.dispatch(new OrderAllOrderAction.Submit(this._resId)); } - private resume(): void { + private _resume(): void { this._store.dispatch(new OrderAllOrderAction.Resume(this._resId)); } - private view(): void { + private _view(): void { this._store.dispatch(new OrderAllOrderOrderArchiveAction.GetAll(this._resId)); } - private save(): void { + private _save(): void { this.subscribe(StoreUtil.dispatchActionAndWaitForSubActionCompletion(this._store, this._actions$, new OrderAllOrderAction.Save(this._resId), OrderAllOrderAction.SaveSuccess, diff --git a/src/app/features/order/features/all-order/stores/aip/order-all-order-aip.state.ts b/src/app/features/order/features/all-order/stores/aip/order-all-order-aip.state.ts index 6f0fd4a00..07977ebc3 100644 --- a/src/app/features/order/features/all-order/stores/aip/order-all-order-aip.state.ts +++ b/src/app/features/order/features/all-order/stores/aip/order-all-order-aip.state.ts @@ -53,11 +53,11 @@ export interface OrderAllOrderAipStateModel extends AssociationStateModel<Aip> { }, }) export class OrderAllOrderAipState extends AssociationState<OrderAllOrderAipStateModel, Aip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: orderAllOrderAipNamespace, resourceName: ApiResourceNameEnum.AIP, }); diff --git a/src/app/features/order/features/all-order/stores/dip/order-all-order-dip.state.ts b/src/app/features/order/features/all-order/stores/dip/order-all-order-dip.state.ts index 639711e5e..c59617916 100644 --- a/src/app/features/order/features/all-order/stores/dip/order-all-order-dip.state.ts +++ b/src/app/features/order/features/all-order/stores/dip/order-all-order-dip.state.ts @@ -53,11 +53,11 @@ export interface OrderAllOrderDipStateModel extends AssociationStateModel<Dip> { }, }) export class OrderAllOrderDipState extends AssociationState<OrderAllOrderDipStateModel, Dip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: orderAllOrderDipNamespace, resourceName: ApiResourceNameEnum.DIP, }); diff --git a/src/app/features/order/features/all-order/stores/order-all-order.state.ts b/src/app/features/order/features/all-order/stores/order-all-order.state.ts index 09abc7bac..5eba35a31 100644 --- a/src/app/features/order/features/all-order/stores/order-all-order.state.ts +++ b/src/app/features/order/features/all-order/stores/order-all-order.state.ts @@ -110,11 +110,11 @@ export interface OrderAllOrderStateModel extends ResourceStateModel<Order> { ], }) export class OrderAllOrderState extends ResourceState<OrderAllOrderStateModel, Order> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: orderAllOrderActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.orderAllOrderDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.orderAllOrderDetail + urlSeparator + resId, @@ -164,7 +164,7 @@ export class OrderAllOrderState extends ResourceState<OrderAllOrderStateModel, O isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<any, Result>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.SUBMIT}`, null) + return this._apiService.post<any, Result>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.SUBMIT}`, null) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -205,7 +205,7 @@ export class OrderAllOrderState extends ResourceState<OrderAllOrderStateModel, O isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<any, Result>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.RESUME}`, null) + return this._apiService.post<any, Result>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.RESUME}`, null) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -242,7 +242,7 @@ export class OrderAllOrderState extends ResourceState<OrderAllOrderStateModel, O isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<OrderArchive>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.SAVE}`) + return this._apiService.post<OrderArchive>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.SAVE}`) .pipe( tap(() => { ctx.dispatch(new OrderAllOrderAction.SaveSuccess(action)); diff --git a/src/app/features/order/features/all-order/stores/order-archive/order-all-order-order-archive.state.ts b/src/app/features/order/features/all-order/stores/order-archive/order-all-order-order-archive.state.ts index 98817d570..40c04b7da 100644 --- a/src/app/features/order/features/all-order/stores/order-archive/order-all-order-order-archive.state.ts +++ b/src/app/features/order/features/all-order/stores/order-archive/order-all-order-order-archive.state.ts @@ -72,11 +72,11 @@ export interface OrderAllOrderOrderArchiveStateModel extends ResourceStateModel< children: [], }) export class OrderAllOrderOrderArchiveState extends ResourceState<OrderAllOrderOrderArchiveStateModel, OrderArchive> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: orderAllOrderOrderArchiveActionNameSpace, }); } @@ -100,9 +100,9 @@ export class OrderAllOrderOrderArchiveState extends ResourceState<OrderAllOrderO queryParameters: StoreUtil.getQueryParametersToApply(action.queryParameters, ctx), ...reset, }); - return this.apiService.get<OrderArchive>(this._urlResource + urlSeparator + action.resId + urlSeparator + ApiActionNameEnum.VIEW, ctx.getState().queryParameters) + return this._apiService.get<OrderArchive>(this._urlResource + urlSeparator + action.resId + urlSeparator + ApiActionNameEnum.VIEW, ctx.getState().queryParameters) .pipe( - StoreUtil.cancelUncompleted(ctx, this.actions$, [this._nameSpace.GetAll, Navigate]), + StoreUtil.cancelUncompleted(ctx, this._actions$, [this._nameSpace.GetAll, Navigate]), tap((collection: CollectionTyped<OrderArchive>) => { ctx.dispatch(ResourceActionHelper.getAllSuccess<OrderArchive>(this._nameSpace, action, collection)); }), diff --git a/src/app/features/order/features/all-order/stores/status-history/order-all-order-status-history.state.ts b/src/app/features/order/features/all-order/stores/status-history/order-all-order-status-history.state.ts index 792593c36..097cd89c6 100644 --- a/src/app/features/order/features/all-order/stores/status-history/order-all-order-status-history.state.ts +++ b/src/app/features/order/features/all-order/stores/status-history/order-all-order-status-history.state.ts @@ -54,11 +54,11 @@ export interface OrderAllOrderStatusHistoryStateModel extends StatusHistoryState }) export class OrderAllOrderStatusHistoryState extends StatusHistoryState<OrderAllOrderStatusHistoryStateModel, Order> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: orderAllOrderStatusHistoryNamespace, }); } diff --git a/src/app/features/order/features/my-order/components/presentationals/my-order/order-my-order.presentational.ts b/src/app/features/order/features/my-order/components/presentationals/my-order/order-my-order.presentational.ts index b87999cc0..6af723a67 100644 --- a/src/app/features/order/features/my-order/components/presentationals/my-order/order-my-order.presentational.ts +++ b/src/app/features/order/features/my-order/components/presentationals/my-order/order-my-order.presentational.ts @@ -178,26 +178,26 @@ export class OrderMyOrderPresentational extends SharedAbstractPresentational imp ngOnInit(): void { super.ngOnInit(); if (isNullOrUndefined(this.order)) { - this.initNewForm(); + this._initNewForm(); } else { - this.bindFormTo(this.order); + this._bindFormTo(this.order); } } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.name]: ["", [Validators.required, SolidifyValidator]], }); } - protected bindFormTo(order: Order): void { + protected _bindFormTo(order: Order): void { this.form = this._fb.group({ [this.formDefinition.name]: [order.name, [Validators.required, SolidifyValidator]], }); this.form.controls[this.formDefinition.name].disable(); } - protected treatmentBeforeSubmit(order: Order): Order { + protected _treatmentBeforeSubmit(order: Order): Order { return order; } diff --git a/src/app/features/order/features/my-order/components/routables/my-order-detail-edit/order-my-order-detail-edit.routable.ts b/src/app/features/order/features/my-order/components/routables/my-order-detail-edit/order-my-order-detail-edit.routable.ts index 512fba637..904cdf57b 100644 --- a/src/app/features/order/features/my-order/components/routables/my-order-detail-edit/order-my-order-detail-edit.routable.ts +++ b/src/app/features/order/features/my-order/components/routables/my-order-detail-edit/order-my-order-detail-edit.routable.ts @@ -154,23 +154,23 @@ export class OrderMyOrderDetailEditRoutable extends AbstractDetailEditCommonRout color: "primary", icon: IconNameEnum.resume, displayCondition: current => !this.isEdit && !isNullOrUndefined(current) && current.status === Enums.Order.StatusEnum.IN_ERROR, - callback: () => this.resume(), + callback: () => this._resume(), labelToTranslate: (current) => LabelTranslateEnum.resume, order: 40, }, ]; - private readonly INTERVAL_REFRESH_INITIAL_IN_SECOND: number = 5; - private readonly INTERVAL_REFRESH_MAX_IN_SECOND: number = 60; + private readonly _INTERVAL_REFRESH_INITIAL_IN_SECOND: number = 5; + private readonly _INTERVAL_REFRESH_MAX_IN_SECOND: number = 60; ngOnInit(): void { super.ngOnInit(); this.subscribe(PollingHelper.startPollingObs({ - initialIntervalRefreshInSecond: this.INTERVAL_REFRESH_INITIAL_IN_SECOND, + initialIntervalRefreshInSecond: this._INTERVAL_REFRESH_INITIAL_IN_SECOND, incrementInterval: true, resetIntervalWhenUserMouseEvent: true, - maximumIntervalRefreshInSecond: this.INTERVAL_REFRESH_MAX_IN_SECOND, + maximumIntervalRefreshInSecond: this._INTERVAL_REFRESH_MAX_IN_SECOND, continueUntil: () => isNullOrUndefined(this.current) || (this.current.status !== Enums.Order.StatusEnum.READY && this.current.status !== Enums.Order.StatusEnum.IN_ERROR), actionToDo: () => this._store.dispatch(ResourceActionHelper.getById(this._resourceNameSpace, this._resId, true)), })); @@ -225,10 +225,10 @@ export class OrderMyOrderDetailEditRoutable extends AbstractDetailEditCommonRout ngOnDestroy(): void { super.ngOnDestroy(); - this.cleanState(); + this._cleanState(); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } showHistory(): void { @@ -246,7 +246,7 @@ export class OrderMyOrderDetailEditRoutable extends AbstractDetailEditCommonRout }); } - private resume(): void { + private _resume(): void { this._store.dispatch(new OrderMyOrderAction.Resume(this._resId)); } diff --git a/src/app/features/order/features/my-order/components/routables/my-order-list/order-my-order-list.routable.ts b/src/app/features/order/features/my-order/components/routables/my-order-list/order-my-order-list.routable.ts index 8d23532cb..7cf787733 100644 --- a/src/app/features/order/features/my-order/components/routables/my-order-list/order-my-order-list.routable.ts +++ b/src/app/features/order/features/my-order/components/routables/my-order-list/order-my-order-list.routable.ts @@ -76,11 +76,11 @@ export class OrderMyOrderListRoutable extends AbstractListRoutable<Order, OrderM readonly KEY_CREATE_BUTTON: string = undefined; readonly KEY_BACK_BUTTON: string = LabelTranslateEnum.backToArchiveOrders; readonly KEY_PARAM_NAME: keyof Order & string = "name"; - private readonly KEY_CREATOR: string = "creation.who"; - private readonly KEY_PUBLIC_ORDER: string = "publicOrder"; + private readonly _KEY_CREATOR: string = "creation.who"; + private readonly _KEY_PUBLIC_ORDER: string = "publicOrder"; - columnsSkippedToClear: string[] = [this.KEY_CREATOR, this.KEY_PUBLIC_ORDER]; - protected onlyMyOrders: boolean = false; + columnsSkippedToClear: string[] = [this._KEY_CREATOR, this._KEY_PUBLIC_ORDER]; + protected _onlyMyOrders: boolean = false; override listNewId: string[] = LocalStorageHelper.getListItem(LocalStorageEnum.newOrderAvailable); @@ -116,22 +116,22 @@ export class OrderMyOrderListRoutable extends AbstractListRoutable<Order, OrderM let queryParameter = MemoizedUtil.queryParametersSnapshot(this._store, OrderMyOrderState); queryParameter = QueryParametersUtil.clone(queryParameter); if (checked) { - this.updateQueryParameterWithCurrentUser(queryParameter, true); - this.onlyMyOrders = true; + this._updateQueryParameterWithCurrentUser(queryParameter, true); + this._onlyMyOrders = true; } else { - this.updateQueryParameterWithCurrentUser(queryParameter, false); - this.onlyMyOrders = false; + this._updateQueryParameterWithCurrentUser(queryParameter, false); + this._onlyMyOrders = false; } this._store.dispatch(new OrderMyOrderAction.ChangeQueryParameters(queryParameter, true)); this._changeDetector.detectChanges(); } override onQueryParametersEvent(queryParameters: QueryParameters): void { - if (this.onlyMyOrders) { - this.updateQueryParameterWithCurrentUser(queryParameters, true); + if (this._onlyMyOrders) { + this._updateQueryParameterWithCurrentUser(queryParameters, true); this._store.dispatch(new OrderMyOrderAction.ChangeQueryParameters(queryParameters, true)); } else { - this.updateQueryParameterWithCurrentUser(queryParameters, false); + this._updateQueryParameterWithCurrentUser(queryParameters, false); this._store.dispatch(new OrderMyOrderAction.ChangeQueryParameters(queryParameters, true)); } this._changeDetector.detectChanges(); // Allow to display spinner the first time @@ -199,17 +199,17 @@ export class OrderMyOrderListRoutable extends AbstractListRoutable<Order, OrderM ]; } - private updateQueryParameterWithCurrentUser(queryParameters: QueryParameters, myOrder: boolean): QueryParameters | undefined { + private _updateQueryParameterWithCurrentUser(queryParameters: QueryParameters, myOrder: boolean): QueryParameters | undefined { queryParameters = ObjectUtil.clone(queryParameters); queryParameters.search = ObjectUtil.clone(queryParameters.search); if (myOrder) { const userTargetedUid = this._store.selectSnapshot(AppState.currentUser).externalUid; - MappingObjectUtil.set(queryParameters.search.searchItems, this.KEY_CREATOR, userTargetedUid); - MappingObjectUtil.delete(queryParameters.search.searchItems, this.KEY_PUBLIC_ORDER); + MappingObjectUtil.set(queryParameters.search.searchItems, this._KEY_CREATOR, userTargetedUid); + MappingObjectUtil.delete(queryParameters.search.searchItems, this._KEY_PUBLIC_ORDER); } else { - MappingObjectUtil.set(queryParameters.search.searchItems, this.KEY_PUBLIC_ORDER, "true"); - MappingObjectUtil.delete(queryParameters.search.searchItems, this.KEY_CREATOR); + MappingObjectUtil.set(queryParameters.search.searchItems, this._KEY_PUBLIC_ORDER, "true"); + MappingObjectUtil.delete(queryParameters.search.searchItems, this._KEY_CREATOR); } return queryParameters; } diff --git a/src/app/features/order/features/my-order/stores/aip/order-my-order-aip.state.ts b/src/app/features/order/features/my-order/stores/aip/order-my-order-aip.state.ts index 8206150e3..f3c869573 100644 --- a/src/app/features/order/features/my-order/stores/aip/order-my-order-aip.state.ts +++ b/src/app/features/order/features/my-order/stores/aip/order-my-order-aip.state.ts @@ -54,11 +54,11 @@ export interface OrderMyOrderAipStateModel extends AssociationStateModel<Aip> { }, }) export class OrderMyOrderAipState extends AssociationState<OrderMyOrderAipStateModel, Aip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: orderMyOrderAipNamespace, resourceName: ApiResourceNameEnum.AIP, }); diff --git a/src/app/features/order/features/my-order/stores/dip/order-my-order-dip.state.ts b/src/app/features/order/features/my-order/stores/dip/order-my-order-dip.state.ts index 6902467d9..aa514183c 100644 --- a/src/app/features/order/features/my-order/stores/dip/order-my-order-dip.state.ts +++ b/src/app/features/order/features/my-order/stores/dip/order-my-order-dip.state.ts @@ -54,11 +54,11 @@ export interface OrderMyOrderDipStateModel extends AssociationStateModel<Dip> { }, }) export class OrderMyOrderDipState extends AssociationState<OrderMyOrderDipStateModel, Dip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: orderMyOrderDipNamespace, resourceName: ApiResourceNameEnum.DIP, }); diff --git a/src/app/features/order/features/my-order/stores/order-my-order.state.ts b/src/app/features/order/features/my-order/stores/order-my-order.state.ts index d3921308d..8efeff711 100644 --- a/src/app/features/order/features/my-order/stores/order-my-order.state.ts +++ b/src/app/features/order/features/my-order/stores/order-my-order.state.ts @@ -99,11 +99,11 @@ export interface OrderMyOrderStateModel extends ResourceStateModel<Order> { ], }) export class OrderMyOrderState extends ResourceState<OrderMyOrderStateModel, Order> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: orderMyOrderActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.orderMyOrderDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.orderMyOrderDetail + urlSeparator + resId, @@ -153,7 +153,7 @@ export class OrderMyOrderState extends ResourceState<OrderMyOrderStateModel, Ord isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<any, Result>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.SUBMIT}`, null) + return this._apiService.post<any, Result>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.SUBMIT}`, null) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -190,7 +190,7 @@ export class OrderMyOrderState extends ResourceState<OrderMyOrderStateModel, Ord isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<any, Result>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.RESUME}`, null) + return this._apiService.post<any, Result>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.RESUME}`, null) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -227,7 +227,7 @@ export class OrderMyOrderState extends ResourceState<OrderMyOrderStateModel, Ord isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<OrderArchive>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.SAVE}`) + return this._apiService.post<OrderArchive>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.SAVE}`) .pipe( tap(() => { ctx.dispatch(new OrderMyOrderAction.SaveSuccess(action)); diff --git a/src/app/features/order/features/my-order/stores/status-history/order-my-order-status-history.state.ts b/src/app/features/order/features/my-order/stores/status-history/order-my-order-status-history.state.ts index 2edec39b6..e7ebc8d56 100644 --- a/src/app/features/order/features/my-order/stores/status-history/order-my-order-status-history.state.ts +++ b/src/app/features/order/features/my-order/stores/status-history/order-my-order-status-history.state.ts @@ -54,11 +54,11 @@ export interface OrderMyOrderStatusHistoryStateModel extends StatusHistoryStateM }) export class OrderMyOrderStatusHistoryState extends StatusHistoryState<OrderMyOrderStatusHistoryStateModel, Order> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: orderMyOrderStatusHistoryNamespace, }); } diff --git a/src/app/features/order/stores/order.state.ts b/src/app/features/order/stores/order.state.ts index a68ab56df..7ae2915fb 100644 --- a/src/app/features/order/stores/order.state.ts +++ b/src/app/features/order/stores/order.state.ts @@ -56,6 +56,6 @@ export interface OrderStateModel extends BaseStateModel { ], }) export class OrderState { - constructor(protected store: Store) { + constructor(protected readonly _store: Store) { } } diff --git a/src/app/features/preservation-planning/aip-downloaded/components/routables/aip-downloaded-not-found/preservation-planning-aip-downloaded-not-found.routable.ts b/src/app/features/preservation-planning/aip-downloaded/components/routables/aip-downloaded-not-found/preservation-planning-aip-downloaded-not-found.routable.ts index 686519580..8524c6916 100644 --- a/src/app/features/preservation-planning/aip-downloaded/components/routables/aip-downloaded-not-found/preservation-planning-aip-downloaded-not-found.routable.ts +++ b/src/app/features/preservation-planning/aip-downloaded/components/routables/aip-downloaded-not-found/preservation-planning-aip-downloaded-not-found.routable.ts @@ -48,10 +48,10 @@ export class PreservationPlanningAipDownloadedNotFoundRoutable extends SharedAbs } back(): void { - this.navigate([RoutesEnum.preservationPlanningAipDownloaded]); + this._navigate([RoutesEnum.preservationPlanningAipDownloaded]); } - private navigate(path: (string | number)[]): void { + private _navigate(path: (string | number)[]): void { this._store.dispatch(new Navigate(path)); } } diff --git a/src/app/features/preservation-planning/aip-status/stores/preservation-planning-aip-status.state.ts b/src/app/features/preservation-planning/aip-status/stores/preservation-planning-aip-status.state.ts index eef270e4f..76b589161 100644 --- a/src/app/features/preservation-planning/aip-status/stores/preservation-planning-aip-status.state.ts +++ b/src/app/features/preservation-planning/aip-status/stores/preservation-planning-aip-status.state.ts @@ -67,12 +67,12 @@ export interface PreservationPlanningAipStatusStateModel extends ResourceStateMo }, }) export class PreservationPlanningAipStatusState extends ResourceState<PreservationPlanningAipStatusStateModel, AipCopyList> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - protected httpClient: HttpClient) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + protected readonly _httpClient: HttpClient) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationAipStatusActionNameSpace, }); } @@ -87,7 +87,7 @@ export class PreservationPlanningAipStatusState extends ResourceState<Preservati isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.httpClient.post(this._urlResource + urlSeparator + ApiActionNameEnum.DELETE_CACHE, null, { + return this._httpClient.post(this._urlResource + urlSeparator + ApiActionNameEnum.DELETE_CACHE, null, { responseType: "text", }).pipe( tap(result => { @@ -105,7 +105,7 @@ export class PreservationPlanningAipStatusState extends ResourceState<Preservati ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("admin.preservation.aipStatuses.notification.deleteCache.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("admin.preservation.aipStatuses.notification.deleteCache.success")); } @Action(PreservationAipStatusAction.DeleteCacheFail) @@ -113,6 +113,6 @@ export class PreservationPlanningAipStatusState extends ResourceState<Preservati ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("admin.preservation.aipStatuses.notification.deleteCache.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("admin.preservation.aipStatuses.notification.deleteCache.fail")); } } diff --git a/src/app/features/preservation-planning/aip/preservation-planning-aip-detail-guard.service.ts b/src/app/features/preservation-planning/aip/preservation-planning-aip-detail-guard.service.ts index 1d68c5aa9..60a20adcc 100644 --- a/src/app/features/preservation-planning/aip/preservation-planning-aip-detail-guard.service.ts +++ b/src/app/features/preservation-planning/aip/preservation-planning-aip-detail-guard.service.ts @@ -64,10 +64,10 @@ export class PreservationPlanningAipDetailGuardService implements CanActivate { } canActivate(route: ActivatedRouteSnapshot): Observable<boolean> { - return this.isAuthorized(route); + return this._isAuthorized(route); } - private isAuthorized(route: ActivatedRouteSnapshot): Observable<boolean> { + private _isAuthorized(route: ActivatedRouteSnapshot): Observable<boolean> { const idAip = route.params[AppRoutesEnum.paramIdWithoutPrefixParam]; const storagionNodeId = +route.parent.params[PreservationPlanningRoutesEnum.storagionNumberWithoutPrefixParam]; diff --git a/src/app/features/preservation-planning/deposit/components/routables/deposit-list/preservation-planning-deposit-list.routable.ts b/src/app/features/preservation-planning/deposit/components/routables/deposit-list/preservation-planning-deposit-list.routable.ts index ba257a1ce..10db592f9 100644 --- a/src/app/features/preservation-planning/deposit/components/routables/deposit-list/preservation-planning-deposit-list.routable.ts +++ b/src/app/features/preservation-planning/deposit/components/routables/deposit-list/preservation-planning-deposit-list.routable.ts @@ -167,18 +167,18 @@ export class PreservationPlanningDepositListRoutable extends AbstractListRoutabl ]; } - protected override defineActions(): DataTableActions<PreservationJob>[] { + protected override _defineActions(): DataTableActions<PreservationJob>[] { return [ { logo: IconNameEnum.download, - callback: (model: Deposit) => this.download(model), + callback: (model: Deposit) => this._download(model), placeholder: current => LabelTranslateEnum.download, displayOnCondition: (model: Deposit) => true, }, ]; } - private download(sip: Deposit): void { + private _download(sip: Deposit): void { this._store.dispatch(new PreservationPlanningDepositAction.Download(sip.resId)); } diff --git a/src/app/features/preservation-planning/deposit/stores/preservation-planning-deposit.state.ts b/src/app/features/preservation-planning/deposit/stores/preservation-planning-deposit.state.ts index 56e797f5f..e84a7e8bc 100644 --- a/src/app/features/preservation-planning/deposit/stores/preservation-planning-deposit.state.ts +++ b/src/app/features/preservation-planning/deposit/stores/preservation-planning-deposit.state.ts @@ -78,13 +78,13 @@ export class PreservationPlanningDepositState extends ResourceState<Preservation private readonly _ZIP_EXTENSION: string = ".zip"; private readonly _FOLDER_QUERY_PARAM: string = "folder"; - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - protected httpClient: HttpClient, - private downloadService: DownloadService) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + protected readonly _httpClient: HttpClient, + private readonly _downloadService: DownloadService) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningDepositActionNameSpace, }); } @@ -119,7 +119,7 @@ export class PreservationPlanningDepositState extends ResourceState<Preservation url = url + `?${this._FOLDER_QUERY_PARAM}=${action.fullFolderName}`; fileName = fileName + action.fullFolderName; } - this.downloadService.download(url, fileName + this._ZIP_EXTENSION); + this._downloadService.download(url, fileName + this._ZIP_EXTENSION); } } diff --git a/src/app/features/preservation-planning/deposit/stores/status-history/preservation-planning-deposit-status-history.state.ts b/src/app/features/preservation-planning/deposit/stores/status-history/preservation-planning-deposit-status-history.state.ts index 8adc3c5e2..664145f5d 100644 --- a/src/app/features/preservation-planning/deposit/stores/status-history/preservation-planning-deposit-status-history.state.ts +++ b/src/app/features/preservation-planning/deposit/stores/status-history/preservation-planning-deposit-status-history.state.ts @@ -54,11 +54,11 @@ export interface PreservationPlanningDepositStatusHistoryStateModel extends Stat }) export class PreservationPlanningDepositStatusHistoryState extends StatusHistoryState<PreservationPlanningDepositStatusHistoryStateModel, Sip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningDepositStatusHistoryNamespace, }); } diff --git a/src/app/features/preservation-planning/dip/components/presentationals/dip-form/preservation-planning-dip-form.presentational.ts b/src/app/features/preservation-planning/dip/components/presentationals/dip-form/preservation-planning-dip-form.presentational.ts index 34f74071f..b5136fc60 100644 --- a/src/app/features/preservation-planning/dip/components/presentationals/dip-form/preservation-planning-dip-form.presentational.ts +++ b/src/app/features/preservation-planning/dip/components/presentationals/dip-form/preservation-planning-dip-form.presentational.ts @@ -130,10 +130,10 @@ export class PreservationPlanningDipFormPresentational extends AbstractFormPrese super.ngOnInit(); } - protected initNewForm(): void { + protected _initNewForm(): void { } - protected bindFormTo(dip: Dip): void { + protected _bindFormTo(dip: Dip): void { this.form = this._fb.group({ [this.formDefinition.organizationalUnitId]: [dip.info.organizationalUnitId, [SolidifyValidator]], [this.formDefinition.resId]: [dip.resId, [SolidifyValidator]], @@ -150,7 +150,7 @@ export class PreservationPlanningDipFormPresentational extends AbstractFormPrese this.isValidWhenDisable = this.form.valid; } - protected treatmentBeforeSubmit(dip: Dip): Dip { + protected _treatmentBeforeSubmit(dip: Dip): Dip { const dipToSubmit: Dip = { info: { name: this.form.get(this.formDefinition.name).value, @@ -160,7 +160,7 @@ export class PreservationPlanningDipFormPresentational extends AbstractFormPrese return dipToSubmit; } - protected override disableSpecificField(): void { + protected override _disableSpecificField(): void { this.form.get(this.formDefinition.resId).disable(); this.form.get(this.formDefinition.status).disable(); this.form.get(this.formDefinition.access).disable(); diff --git a/src/app/features/preservation-planning/dip/components/routables/dip-detail-edit/preservation-planning-dip-detail-edit.routable.ts b/src/app/features/preservation-planning/dip/components/routables/dip-detail-edit/preservation-planning-dip-detail-edit.routable.ts index 3e2b15087..65bb7561b 100644 --- a/src/app/features/preservation-planning/dip/components/routables/dip-detail-edit/preservation-planning-dip-detail-edit.routable.ts +++ b/src/app/features/preservation-planning/dip/components/routables/dip-detail-edit/preservation-planning-dip-detail-edit.routable.ts @@ -86,7 +86,7 @@ import { export class PreservationPlanningDipDetailEditRoutable extends AbstractDetailEditRoutable<Dip, PreservationPlanningDipStateModel> implements OnInit, OnDestroy { - private readonly STATUS_TO_STOP_POLLING_REFRESH_STATUS: Enums.Package.StatusEnum[] = [ + private readonly _STATUS_TO_STOP_POLLING_REFRESH_STATUS: Enums.Package.StatusEnum[] = [ Enums.Package.StatusEnum.IN_ERROR, Enums.Package.StatusEnum.COMPLETED, Enums.Package.StatusEnum.PRESERVATION_ERROR, @@ -116,9 +116,9 @@ export class PreservationPlanningDipDetailEditRoutable readonly KEY_PARAM_NAME: keyof Dip & string = undefined; - private currentTab: Tab; + private _currentTab: Tab; - private get rootUrl(): string[] { + private get _rootUrl(): string[] { return [RoutesEnum.preservationPlanningDipDetail, this._resId]; } @@ -128,14 +128,14 @@ export class PreservationPlanningDipDetailEditRoutable suffixUrl: PreservationPlanningRoutesEnum.dipMetadata, icon: IconNameEnum.metadata, titleToTranslate: LabelTranslateEnum.metadata, - route: () => [...this.rootUrl, PreservationPlanningRoutesEnum.dipMetadata], + route: () => [...this._rootUrl, PreservationPlanningRoutesEnum.dipMetadata], }, { id: TabEnum.FILES, suffixUrl: PreservationPlanningRoutesEnum.sipFiles, icon: IconNameEnum.files, titleToTranslate: LabelTranslateEnum.files, - route: () => [...this.rootUrl, PreservationPlanningRoutesEnum.dipFiles], + route: () => [...this._rootUrl, PreservationPlanningRoutesEnum.dipFiles], }, ]; @@ -168,10 +168,10 @@ export class PreservationPlanningDipDetailEditRoutable ngOnDestroy(): void { super.ngOnDestroy(); - this.cleanState(); + this._cleanState(); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new PreservationPlanningDipAipAction.GetAll(id)); } @@ -230,7 +230,7 @@ export class PreservationPlanningDipDetailEditRoutable ]; setCurrentTab($event: Tab): void { - this.currentTab = $event; + this._currentTab = $event; } download(): void { @@ -265,7 +265,7 @@ export class PreservationPlanningDipDetailEditRoutable private _shouldContinuePollingWaitCompletedStatus(): boolean { const status = MemoizedUtil.selectSnapshot(this._store, PreservationPlanningDipState, state => state.current?.info?.status) as Enums.Package.StatusEnum; - return isNotNullNorUndefined(status) && this.STATUS_TO_STOP_POLLING_REFRESH_STATUS.indexOf(status) === -1; + return isNotNullNorUndefined(status) && this._STATUS_TO_STOP_POLLING_REFRESH_STATUS.indexOf(status) === -1; } } diff --git a/src/app/features/preservation-planning/dip/components/routables/dip-file/preservation-planning-dip-file.routable.ts b/src/app/features/preservation-planning/dip/components/routables/dip-file/preservation-planning-dip-file.routable.ts index 2dda51e30..d0b44b83c 100644 --- a/src/app/features/preservation-planning/dip/components/routables/dip-file/preservation-planning-dip-file.routable.ts +++ b/src/app/features/preservation-planning/dip/components/routables/dip-file/preservation-planning-dip-file.routable.ts @@ -165,13 +165,13 @@ export class PreservationPlanningDipFileRoutable extends AbstractDetailEditRouta this.actions = [ { logo: IconNameEnum.resume, - callback: (dipDataFile: DipDataFile) => this.resumeDataFile(this._resId, dipDataFile), + callback: (dipDataFile: DipDataFile) => this._resumeDataFile(this._resId, dipDataFile), placeholder: current => LabelTranslateEnum.resume, displayOnCondition: current => isNullOrUndefined(current) || current.status === Enums.DataFile.StatusEnum.IN_ERROR, }, { logo: IconNameEnum.download, - callback: (dipDataFile: DipDataFile) => this.downloadDataFile(this._resId, dipDataFile), + callback: (dipDataFile: DipDataFile) => this._downloadDataFile(this._resId, dipDataFile), placeholder: current => LabelTranslateEnum.download, displayOnCondition: (current: DipDataFile) => current.status === Enums.DataFile.StatusEnum.PROCESSED || current.status === Enums.DataFile.StatusEnum.READY || current.status === Enums.DataFile.StatusEnum.VIRUS_CHECKED, }, @@ -186,19 +186,19 @@ export class PreservationPlanningDipFileRoutable extends AbstractDetailEditRouta ngOnInit(): void { super.ngOnInit(); - this.getCurrentModelOnParent(); + this._getCurrentModelOnParent(); } - private getCurrentModelOnParent(): void { + private _getCurrentModelOnParent(): void { this._resId = this._route.snapshot.parent.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); - this.getDepositById(this._resId); + this._getDepositById(this._resId); } - private getDepositById(id: string): void { - this.getSubResourceWithParentId(id); + private _getDepositById(id: string): void { + this._getSubResourceWithParentId(id); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new PreservationPlanningDipDataFileAction.GetAll(id, null, true)); } @@ -218,11 +218,11 @@ export class PreservationPlanningDipFileRoutable extends AbstractDetailEditRouta this._store.dispatch(new Navigate([RoutesEnum.preservationPlanningDipDetail, this._resId, PreservationPlanningRoutesEnum.dipFiles, dipDataFile.resId])); } - private downloadDataFile(parentId: string, dataFile: DipDataFile): void { + private _downloadDataFile(parentId: string, dataFile: DipDataFile): void { this._store.dispatch(new PreservationPlanningDipDataFileAction.Download(parentId, dataFile)); } - private resumeDataFile(parentId: string, dataFile: DipDataFile): void { + private _resumeDataFile(parentId: string, dataFile: DipDataFile): void { this._store.dispatch(new PreservationPlanningDipDataFileAction.Resume(parentId, dataFile)); } diff --git a/src/app/features/preservation-planning/dip/components/routables/dip-list/preservation-planning-dip-list.routable.ts b/src/app/features/preservation-planning/dip/components/routables/dip-list/preservation-planning-dip-list.routable.ts index 5cc7d852b..348f2395f 100644 --- a/src/app/features/preservation-planning/dip/components/routables/dip-list/preservation-planning-dip-list.routable.ts +++ b/src/app/features/preservation-planning/dip/components/routables/dip-list/preservation-planning-dip-list.routable.ts @@ -163,18 +163,18 @@ export class PreservationPlanningDipListRoutable extends AbstractListRoutable<Di ]; } - protected override defineActions(): DataTableActions<PreservationJob>[] { + protected override _defineActions(): DataTableActions<PreservationJob>[] { return [ { logo: IconNameEnum.download, - callback: (model: Dip) => this.download(model), + callback: (model: Dip) => this._download(model), placeholder: current => LabelTranslateEnum.download, displayOnCondition: (model: Dip) => true, }, ]; } - private download(dip: Dip): void { + private _download(dip: Dip): void { this._store.dispatch(new PreservationPlanningDipAction.Download(dip.resId)); } } diff --git a/src/app/features/preservation-planning/dip/components/routables/dip-metadata/preservation-planning-dip-metadata.routable.ts b/src/app/features/preservation-planning/dip/components/routables/dip-metadata/preservation-planning-dip-metadata.routable.ts index e937b9038..1b734595d 100644 --- a/src/app/features/preservation-planning/dip/components/routables/dip-metadata/preservation-planning-dip-metadata.routable.ts +++ b/src/app/features/preservation-planning/dip/components/routables/dip-metadata/preservation-planning-dip-metadata.routable.ts @@ -89,6 +89,6 @@ export class PreservationPlanningDipMetadataRoutable extends AbstractDetailEditR super.ngOnDestroy(); } - protected getSubResourceWithParentId(id: string): void { + protected _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/preservation-planning/dip/stores/aip/preservation-planning-dip-aip.state.ts b/src/app/features/preservation-planning/dip/stores/aip/preservation-planning-dip-aip.state.ts index bd09ab035..2298860d9 100644 --- a/src/app/features/preservation-planning/dip/stores/aip/preservation-planning-dip-aip.state.ts +++ b/src/app/features/preservation-planning/dip/stores/aip/preservation-planning-dip-aip.state.ts @@ -54,11 +54,11 @@ export interface PreservationPlanningDipAipStateModel extends AssociationStateMo }, }) export class PreservationPlanningDipAipState extends AssociationState<PreservationPlanningDipAipStateModel, Aip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningDipAipNamespace, resourceName: ApiResourceNameEnum.AIP, }); diff --git a/src/app/features/preservation-planning/dip/stores/data-file/preservation-planning-dip-data-file.state.ts b/src/app/features/preservation-planning/dip/stores/data-file/preservation-planning-dip-data-file.state.ts index 6c7cee1b0..0f16d9309 100644 --- a/src/app/features/preservation-planning/dip/stores/data-file/preservation-planning-dip-data-file.state.ts +++ b/src/app/features/preservation-planning/dip/stores/data-file/preservation-planning-dip-data-file.state.ts @@ -87,13 +87,13 @@ export interface PreservationPlanningDipDataFileStateModel extends CompositionSt ], }) export class PreservationPlanningDipDataFileState extends CompositionState<PreservationPlanningDipDataFileStateModel, DipDataFile> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - @Inject(WINDOW) private _window: Window, - private downloadService: DownloadService) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + @Inject(WINDOW) private readonly _window: Window, + private readonly _downloadService: DownloadService) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningDipDataFileActionNameSpace, resourceName: ApiResourceNameEnum.DATAFILE, }); @@ -111,23 +111,23 @@ export class PreservationPlanningDipDataFileState extends CompositionState<Prese @Action(PreservationPlanningDipDataFileAction.Download) download(ctx: StateContext<PreservationPlanningDipDataFileStateModel>, action: PreservationPlanningDipDataFileAction.Download): void { const url = `${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.DL}`; - this.downloadService.download(url, action.dataFile.fileName, action.dataFile.fileSize); + this._downloadService.download(url, action.dataFile.fileName, action.dataFile.fileSize); } @Action(PreservationPlanningDipDataFileAction.Resume) resume(ctx: StateContext<PreservationPlanningDipDataFileStateModel>, action: PreservationPlanningDipDataFileAction.Resume): Observable<Result> { - return this.apiService.post<any, Result>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.RESUME}`) + return this._apiService.post<any, Result>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.RESUME}`) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { - this.notificationService.showInformation(LabelTranslateEnum.resourceResumed); + this._notificationService.showInformation(LabelTranslateEnum.resourceResumed); ctx.dispatch(new PreservationPlanningDipDataFileAction.GetAll(action.parentId, undefined, true)); } else { - this.notificationService.showError(LabelTranslateEnum.unableResumedResource); + this._notificationService.showError(LabelTranslateEnum.unableResumedResource); } }), catchError((error: SolidifyHttpErrorResponseModel) => { - this.notificationService.showError(LabelTranslateEnum.unableResumedResource); + this._notificationService.showError(LabelTranslateEnum.unableResumedResource); throw new SolidifyStateError(this, error); }), ); diff --git a/src/app/features/preservation-planning/dip/stores/data-file/status-history/preservation-planning-dip-data-file-status-history.state.ts b/src/app/features/preservation-planning/dip/stores/data-file/status-history/preservation-planning-dip-data-file-status-history.state.ts index 111d63b2d..a2c9a51b4 100644 --- a/src/app/features/preservation-planning/dip/stores/data-file/status-history/preservation-planning-dip-data-file-status-history.state.ts +++ b/src/app/features/preservation-planning/dip/stores/data-file/status-history/preservation-planning-dip-data-file-status-history.state.ts @@ -54,11 +54,11 @@ export interface PreservationPlanningDipDataFileStatusHistoryStateModel extends }) export class PreservationPlanningDipDataFileStatusHistoryState extends StatusHistoryState<PreservationPlanningDipDataFileStatusHistoryStateModel, DipDataFile> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningDipDataFileStatusHistoryNamespace, }); } diff --git a/src/app/features/preservation-planning/dip/stores/preservation-planning-dip.state.ts b/src/app/features/preservation-planning/dip/stores/preservation-planning-dip.state.ts index 447959646..835933556 100644 --- a/src/app/features/preservation-planning/dip/stores/preservation-planning-dip.state.ts +++ b/src/app/features/preservation-planning/dip/stores/preservation-planning-dip.state.ts @@ -108,13 +108,13 @@ export interface PreservationPlanningDipStateModel extends ResourceStateModel<Di ], }) export class PreservationPlanningDipState extends ResourceState<PreservationPlanningDipStateModel, Dip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - protected httpClient: HttpClient, - private downloadService: DownloadService) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + protected readonly _httpClient: HttpClient, + private readonly _downloadService: DownloadService) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningDipActionNameSpace, routeRedirectUrlAfterSuccessDeleteAction: RoutesEnum.preservationPlanningDip, notificationResourceDeleteSuccessTextToTranslate: MARK_AS_TRANSLATABLE("dip.notification.resource.delete.success"), @@ -171,7 +171,7 @@ export class PreservationPlanningDipState extends ResourceState<PreservationPlan @Action(PreservationPlanningDipAction.Download) download(ctx: StateContext<PreservationPlanningDipStateModel>, action: PreservationPlanningDipAction.Download): void { const fileName = "dip_" + action.id + ".zip"; - this.downloadService.download(`${this._urlResource}/${action.id}/${ApiActionNameEnum.DL}`, fileName); + this._downloadService.download(`${this._urlResource}/${action.id}/${ApiActionNameEnum.DL}`, fileName); } @Action(PreservationPlanningDipAction.Resume) @@ -179,7 +179,7 @@ export class PreservationPlanningDipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.RESUME}`, null) + return this._httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.RESUME}`, null) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -200,7 +200,7 @@ export class PreservationPlanningDipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.dip.action.resume.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.dip.action.resume.success")); ctx.dispatch(new PreservationPlanningDipAction.GetById(action.parentAction.id, true)); } @@ -209,7 +209,7 @@ export class PreservationPlanningDipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.dip.action.resume.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.dip.action.resume.fail")); } @Action(PreservationPlanningDipAction.PutInError) @@ -217,7 +217,7 @@ export class PreservationPlanningDipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.RESUME}`, null) + return this._httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.RESUME}`, null) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -238,7 +238,7 @@ export class PreservationPlanningDipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.dip.action.put-in-error.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.dip.action.put-in-error.success")); ctx.dispatch(new PreservationPlanningDipAction.GetById(action.parentAction.id, true)); } @@ -247,7 +247,7 @@ export class PreservationPlanningDipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.dip.action.put-in-error.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.dip.action.put-in-error.fail")); } @Action(PreservationPlanningDipAction.GoToDip) diff --git a/src/app/features/preservation-planning/dip/stores/status-history/preservation-planning-dip-status-history.state.ts b/src/app/features/preservation-planning/dip/stores/status-history/preservation-planning-dip-status-history.state.ts index 1ed4ee0a1..3f0c14391 100644 --- a/src/app/features/preservation-planning/dip/stores/status-history/preservation-planning-dip-status-history.state.ts +++ b/src/app/features/preservation-planning/dip/stores/status-history/preservation-planning-dip-status-history.state.ts @@ -54,11 +54,11 @@ export interface PreservationPlanningDipStatusHistoryStateModel extends StatusHi }) export class PreservationPlanningDipStatusHistoryState extends StatusHistoryState<PreservationPlanningDipStatusHistoryStateModel, Dip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningDipStatusHistoryNamespace, }); } diff --git a/src/app/features/preservation-planning/job/components/containers/job-execution-list/preservation-planning-job-execution-list.container.ts b/src/app/features/preservation-planning/job/components/containers/job-execution-list/preservation-planning-job-execution-list.container.ts index 203f6b746..97907e315 100644 --- a/src/app/features/preservation-planning/job/components/containers/job-execution-list/preservation-planning-job-execution-list.container.ts +++ b/src/app/features/preservation-planning/job/components/containers/job-execution-list/preservation-planning-job-execution-list.container.ts @@ -84,8 +84,8 @@ export class PreservationPlanningJobExecutionListContainer extends SharedAbstrac jobObs: Observable<PreservationJob> = MemoizedUtil.current(this._store, PreservationPlanningJobState); columns: DataTableColumns<JobExecution>[]; paramMessage: { name: string } = {name: StringUtil.stringEmpty}; - private readonly INTERVAL_REFRESH_IN_SECOND: number = 0.2; - private readonly MAX_INTERVAL_REFRESH_IN_SECOND: number = 2; + private readonly _INTERVAL_REFRESH_IN_SECOND: number = 0.2; + private readonly _MAX_INTERVAL_REFRESH_IN_SECOND: number = 2; pollingToUpdateProgressBar: boolean = false; private _resId: string; @@ -101,12 +101,12 @@ export class PreservationPlanningJobExecutionListContainer extends SharedAbstrac ngOnInit(): void { super.ngOnInit(); this.defineColumns(); - this.retrieveCurrentModelWithUrl(); + this._retrieveCurrentModelWithUrl(); this.subscribe(PollingHelper.startPollingObs({ - initialIntervalRefreshInSecond: this.INTERVAL_REFRESH_IN_SECOND, + initialIntervalRefreshInSecond: this._INTERVAL_REFRESH_IN_SECOND, incrementInterval: true, - maximumIntervalRefreshInSecond: this.MAX_INTERVAL_REFRESH_IN_SECOND, + maximumIntervalRefreshInSecond: this._MAX_INTERVAL_REFRESH_IN_SECOND, resetIntervalWhenUserMouseEvent: true, filter: () => isTrue(this.pollingToUpdateProgressBar), actionToDo: () => this.getAll(), @@ -121,19 +121,19 @@ export class PreservationPlanningJobExecutionListContainer extends SharedAbstrac this._changeDetector.detectChanges(); } - protected retrieveResIdFromUrl(): void { + protected _retrieveResIdFromUrl(): void { this._resId = this._route.snapshot.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); if (isNullOrUndefined(this._resId)) { this._resId = this._route.parent.snapshot.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); } } - protected retrieveCurrentModelWithUrl(): void { - this.retrieveResIdFromUrl(); - this.getById(this._resId); + protected _retrieveCurrentModelWithUrl(): void { + this._retrieveResIdFromUrl(); + this._getById(this._resId); } - protected getById(id: string): void { + protected _getById(id: string): void { } defineColumns(): void { diff --git a/src/app/features/preservation-planning/job/components/dialogs/job-report-detail-error-message/preservation-planning-job-report-detail-error-message.dialog.ts b/src/app/features/preservation-planning/job/components/dialogs/job-report-detail-error-message/preservation-planning-job-report-detail-error-message.dialog.ts index 0e2249ed4..ca763b55f 100644 --- a/src/app/features/preservation-planning/job/components/dialogs/job-report-detail-error-message/preservation-planning-job-report-detail-error-message.dialog.ts +++ b/src/app/features/preservation-planning/job/components/dialogs/job-report-detail-error-message/preservation-planning-job-report-detail-error-message.dialog.ts @@ -48,7 +48,7 @@ export class PreservationPlanningJobReportDetailErrorMessageDialog extends Share paramMessage: { resId: string } = {resId: StringUtil.stringEmpty}; constructor(protected readonly _dialogRef: MatDialogRef<PreservationPlanningJobReportDetailErrorMessageDialog>, - @Inject(MAT_DIALOG_DATA) public data: PreservationPlanningJobReportDetailErrorMessageDialogData) { + @Inject(MAT_DIALOG_DATA) public readonly data: PreservationPlanningJobReportDetailErrorMessageDialogData) { super(_dialogRef, data); } diff --git a/src/app/features/preservation-planning/job/components/dialogs/job-report-detail/preservation-planning-job-report-detail.dialog.ts b/src/app/features/preservation-planning/job/components/dialogs/job-report-detail/preservation-planning-job-report-detail.dialog.ts index 873c28df0..a24d47642 100644 --- a/src/app/features/preservation-planning/job/components/dialogs/job-report-detail/preservation-planning-job-report-detail.dialog.ts +++ b/src/app/features/preservation-planning/job/components/dialogs/job-report-detail/preservation-planning-job-report-detail.dialog.ts @@ -135,7 +135,7 @@ export class PreservationPlanningJobReportDetailDialog extends SharedAbstractDia private readonly _changeDetector: ChangeDetectorRef, protected readonly _dialogRef: MatDialogRef<PreservationPlanningJobReportDetailDialog>, protected readonly _dialog: MatDialog, - @Inject(MAT_DIALOG_DATA) public data: PreservationPlanningJobReportDetailDialogData) { + @Inject(MAT_DIALOG_DATA) public readonly data: PreservationPlanningJobReportDetailDialogData) { super(_dialogRef, data); } @@ -245,7 +245,7 @@ export class PreservationPlanningJobReportDetailDialog extends SharedAbstractDia statusEnums: Enums.Package.StatusEnumTranslate, }; } else if (this.data.jobType === Enums.PreservationJob.TypeEnum.PURGE_ORDER) { - dataForDialog = this.getDataHistoryForPurgeOrder(jobExecutionReportLine); + dataForDialog = this._getDataHistoryForPurgeOrder(jobExecutionReportLine); } else { dataForDialog = { parentId: null, @@ -263,7 +263,7 @@ export class PreservationPlanningJobReportDetailDialog extends SharedAbstractDia }); } - private getDataHistoryForPurgeOrder(jobExecutionReportLine: JobExecutionReportLine): StatusHistoryDialogData { + private _getDataHistoryForPurgeOrder(jobExecutionReportLine: JobExecutionReportLine): StatusHistoryDialogData { let dataForDialog: StatusHistoryDialogData; if (jobExecutionReportLine.url.indexOf(ApiEnum.accessOrders) !== -1) { dataForDialog = { diff --git a/src/app/features/preservation-planning/job/components/presentationals/job-execution-form/preservation-planning-job-execution-form.presentational.ts b/src/app/features/preservation-planning/job/components/presentationals/job-execution-form/preservation-planning-job-execution-form.presentational.ts index 238f6c7b2..eaf29609b 100644 --- a/src/app/features/preservation-planning/job/components/presentationals/job-execution-form/preservation-planning-job-execution-form.presentational.ts +++ b/src/app/features/preservation-planning/job/components/presentationals/job-execution-form/preservation-planning-job-execution-form.presentational.ts @@ -76,7 +76,7 @@ export class PreservationPlanningJobExecutionFormPresentational extends Abstract super(_changeDetectorRef, _elementRef, _injector); } - protected bindFormTo(jobExecution: JobExecution): void { + protected _bindFormTo(jobExecution: JobExecution): void { this.form = this._fb.group({ [this.formDefinition.status]: [jobExecution.status, [Validators.required, SolidifyValidator]], [this.formDefinition.statusMessage]: [jobExecution.statusMessage, [SolidifyValidator]], @@ -89,7 +89,7 @@ export class PreservationPlanningJobExecutionFormPresentational extends Abstract }); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.status]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.statusMessage]: ["", [SolidifyValidator]], @@ -102,7 +102,7 @@ export class PreservationPlanningJobExecutionFormPresentational extends Abstract }); } - protected treatmentBeforeSubmit(model: JobExecution): JobExecution { + protected _treatmentBeforeSubmit(model: JobExecution): JobExecution { return undefined; } diff --git a/src/app/features/preservation-planning/job/components/presentationals/job-form/preservation-planning-job-form.presentational.ts b/src/app/features/preservation-planning/job/components/presentationals/job-form/preservation-planning-job-form.presentational.ts index 7d02b5f2f..6e9faef76 100644 --- a/src/app/features/preservation-planning/job/components/presentationals/job-form/preservation-planning-job-form.presentational.ts +++ b/src/app/features/preservation-planning/job/components/presentationals/job-form/preservation-planning-job-form.presentational.ts @@ -89,7 +89,7 @@ export class PreservationPlanningJobFormPresentational extends AbstractFormPrese super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.name]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.enable]: ["", [SolidifyValidator]], @@ -102,7 +102,7 @@ export class PreservationPlanningJobFormPresentational extends AbstractFormPrese }); } - protected bindFormTo(preservationJob: PreservationJob): void { + protected _bindFormTo(preservationJob: PreservationJob): void { // Work around since this property has a validator with minimal value 1 but default value 0 const scheduling: PreservationJobScheduling = ObjectUtil.clone(preservationJob.scheduling); if (scheduling.monthDay === 0) { @@ -113,14 +113,14 @@ export class PreservationPlanningJobFormPresentational extends AbstractFormPrese [this.formDefinition.enable]: [preservationJob.enable, [SolidifyValidator]], [this.formDefinition.jobRecurrence]: [preservationJob.jobRecurrence, [Validators.required, SolidifyValidator]], [this.formDefinition.jobType]: [preservationJob.jobType, [Validators.required, SolidifyValidator]], - [this.formDefinition.hour]: [this.getHours(preservationJob), [Validators.min(0), Validators.max(23), SolidifyValidator]], - [this.formDefinition.weekDay]: [this.getWeekDay(preservationJob), [SolidifyValidator]], + [this.formDefinition.hour]: [this._getHours(preservationJob), [Validators.min(0), Validators.max(23), SolidifyValidator]], + [this.formDefinition.weekDay]: [this._getWeekDay(preservationJob), [SolidifyValidator]], [this.formDefinition.monthDay]: [scheduling.monthDay, [Validators.min(1), Validators.max(31), SolidifyValidator]], - [this.formDefinition.month]: [this.getMonth(preservationJob), [SolidifyValidator]], + [this.formDefinition.month]: [this._getMonth(preservationJob), [SolidifyValidator]], }); } - protected treatmentBeforeSubmit(preservationJob: PreservationJob): PreservationJob { + protected _treatmentBeforeSubmit(preservationJob: PreservationJob): PreservationJob { const newScheduling: PreservationJobScheduling = { hour: this.form.get(this.formDefinition.hour).value === "" ? null : this.form.get(this.formDefinition.hour).value, month: this.form.get(this.formDefinition.month).value === "" ? null : this.form.get(this.formDefinition.month).value, @@ -157,11 +157,11 @@ export class PreservationPlanningJobFormPresentational extends AbstractFormPrese } } - private getHours(preservationJob: PreservationJob): number | undefined { + private _getHours(preservationJob: PreservationJob): number | undefined { return isNullOrUndefined(preservationJob.scheduling) ? undefined : preservationJob.scheduling.hour; } - private getMonth(preservationJob: PreservationJob): string { + private _getMonth(preservationJob: PreservationJob): string { if (isNullOrUndefined(preservationJob.scheduling) || isNullOrUndefined(preservationJob.scheduling.month)) { return undefined; } @@ -169,7 +169,7 @@ export class PreservationPlanningJobFormPresentational extends AbstractFormPrese return month === undefined ? null : month.key; } - private getWeekDay(preservationJob: PreservationJob): string { + private _getWeekDay(preservationJob: PreservationJob): string { if (isNullOrUndefined(preservationJob.scheduling) || isNullOrUndefined(preservationJob.scheduling.weekDay)) { return undefined; } diff --git a/src/app/features/preservation-planning/job/components/routables/job-detail-edit/preservation-planning-job-detail-edit.routable.ts b/src/app/features/preservation-planning/job/components/routables/job-detail-edit/preservation-planning-job-detail-edit.routable.ts index 827b5f669..29661a53e 100644 --- a/src/app/features/preservation-planning/job/components/routables/job-detail-edit/preservation-planning-job-detail-edit.routable.ts +++ b/src/app/features/preservation-planning/job/components/routables/job-detail-edit/preservation-planning-job-detail-edit.routable.ts @@ -105,18 +105,18 @@ export class PreservationPlanningJobDetailEditRoutable extends AbstractDetailEdi }, ]; - constructor(protected _store: Store, - protected _route: ActivatedRoute, - protected _router: Router, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, + protected readonly _router: Router, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector, private readonly _scrollService: ScrollService) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.preservationPlanning_job, _injector, preservationPlanningJobActionNameSpace, StateEnum.preservationPlanning); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } ngOnInit(): void { diff --git a/src/app/features/preservation-planning/job/components/routables/job-execution-detail/preservation-planning-job-execution-detail.routable.ts b/src/app/features/preservation-planning/job/components/routables/job-execution-detail/preservation-planning-job-execution-detail.routable.ts index 3c726b105..731e0c849 100644 --- a/src/app/features/preservation-planning/job/components/routables/job-execution-detail/preservation-planning-job-execution-detail.routable.ts +++ b/src/app/features/preservation-planning/job/components/routables/job-execution-detail/preservation-planning-job-execution-detail.routable.ts @@ -133,15 +133,15 @@ export class PreservationPlanningJobExecutionDetailRoutable extends SharedAbstra private readonly _actions$: Actions, private readonly _dialog: MatDialog) { super(); - this.retrieveCurrentModelWithUrl(); + this._retrieveCurrentModelWithUrl(); } - protected retrieveCurrentModelWithUrl(): void { - this.retrieveResIdFromUrl(); + protected _retrieveCurrentModelWithUrl(): void { + this._retrieveResIdFromUrl(); this._store.dispatch(new PreservationPlanningJobExecutionAction.GetById(this._preservationJobId, this._resId)); } - protected retrieveResIdFromUrl(): void { + protected _retrieveResIdFromUrl(): void { this._resId = this._route.snapshot.paramMap.get(AppRoutesEnum.paramIdExecutionWithoutPrefixParam); this._preservationJobId = this._route.snapshot.parent.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); } @@ -166,14 +166,14 @@ export class PreservationPlanningJobExecutionDetailRoutable extends SharedAbstra color: "primary", icon: IconNameEnum.resume, labelToTranslate: (current) => LabelTranslateEnum.resume, - callback: () => this.resume(), + callback: () => this._resume(), displayCondition: () => !isNullOrUndefined(CompositionState.currentSnapshot(this._store, PreservationPlanningJobExecutionState)) && CompositionState.currentSnapshot(this._store, PreservationPlanningJobExecutionState).status === Enums.PreservationJob.ExecutionStatusEnum.IN_ERROR, order: 40, }, ]; } - private resume(): void { + private _resume(): void { this.subscribe(StoreUtil.dispatchActionAndWaitForSubActionCompletion(this._store, this._actions$, new PreservationPlanningJobExecutionAction.Resume(this._preservationJobId, this._resId), PreservationPlanningJobExecutionAction.ResumeSuccess, diff --git a/src/app/features/preservation-planning/job/components/routables/job-list/preservation-planning-job-list.routable.ts b/src/app/features/preservation-planning/job/components/routables/job-list/preservation-planning-job-list.routable.ts index cfe6fdb85..87641cf34 100644 --- a/src/app/features/preservation-planning/job/components/routables/job-list/preservation-planning-job-list.routable.ts +++ b/src/app/features/preservation-planning/job/components/routables/job-list/preservation-planning-job-list.routable.ts @@ -159,12 +159,12 @@ export class PreservationPlanningJobListRoutable extends AbstractListRoutable<Pr ]; } - protected override defineActions(): DataTableActions<PreservationJob>[] { + protected override _defineActions(): DataTableActions<PreservationJob>[] { return [ - ...super.defineActions(), + ...super._defineActions(), { logo: IconNameEnum.run, - callback: (model: PreservationJob) => this.start(model), + callback: (model: PreservationJob) => this._start(model), placeholder: current => LabelTranslateEnum.run, displayOnCondition: (model: PreservationJob) => isNullOrUndefined(model) || (model.jobRecurrence !== JobRecurrenceEnum.ONCE), }, @@ -179,7 +179,7 @@ export class PreservationPlanningJobListRoutable extends AbstractListRoutable<Pr this._store.dispatch(new PreservationPlanningJobAction.Init()); } - private start(job: PreservationJob): void { + private _start(job: PreservationJob): void { this._store.dispatch(new PreservationPlanningJobAction.VerifyBeforeStart(job.resId)); } } diff --git a/src/app/features/preservation-planning/job/stores/job-execution/job-execution-report/preservation-planning-job-execution-report.state.ts b/src/app/features/preservation-planning/job/stores/job-execution/job-execution-report/preservation-planning-job-execution-report.state.ts index b8fd650d1..c302634bc 100644 --- a/src/app/features/preservation-planning/job/stores/job-execution/job-execution-report/preservation-planning-job-execution-report.state.ts +++ b/src/app/features/preservation-planning/job/stores/job-execution/job-execution-report/preservation-planning-job-execution-report.state.ts @@ -99,11 +99,11 @@ export class PreservationPlanningJobExecutionReportState extends BaseState<Prese protected readonly _nameSpace: ReportNamespace; - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningJobExecutionReportNamespace, }, PreservationPlanningJobExecutionReportState); } @@ -137,7 +137,7 @@ export class PreservationPlanningJobExecutionReportState extends BaseState<Prese isLoadingCounter: ctx.getState().isLoadingCounter + 1, queryParameters: this.getQueryParametersToApply(action.queryParameters, ctx.getState().queryParameters), }); - return this.apiService.get<JobExecutionReport>(this._urlResource + urlSeparator + action.parentId + urlSeparator + ApiResourceNameEnum.PRES_JOB_EXECUTION + urlSeparator + action.id + urlSeparator + ApiActionNameEnum.REPORT, ctx.getState().queryParameters) + return this._apiService.get<JobExecutionReport>(this._urlResource + urlSeparator + action.parentId + urlSeparator + ApiResourceNameEnum.PRES_JOB_EXECUTION + urlSeparator + action.id + urlSeparator + ApiActionNameEnum.REPORT, ctx.getState().queryParameters) .pipe( tap((list: CollectionTyped<JobExecutionReport>) => { ctx.dispatch(new this._nameSpace.ReportSuccess(action, list)); @@ -175,7 +175,7 @@ export class PreservationPlanningJobExecutionReportState extends BaseState<Prese queryParametersLines: this.getQueryParametersToApply(action.queryParameters, ctx.getState().queryParametersLines), }); - return this.apiService.get<JobExecutionReportLine>(this._urlResource + urlSeparator + action.parentId + urlSeparator + ApiResourceNameEnum.PRES_JOB_EXECUTION + urlSeparator + action.id + urlSeparator + ApiActionNameEnum.REPORT + urlSeparator + action.reportId + urlSeparator + "detail", action.queryParameters) + return this._apiService.get<JobExecutionReportLine>(this._urlResource + urlSeparator + action.parentId + urlSeparator + ApiResourceNameEnum.PRES_JOB_EXECUTION + urlSeparator + action.id + urlSeparator + ApiActionNameEnum.REPORT + urlSeparator + action.reportId + urlSeparator + "detail", action.queryParameters) .pipe( tap((list: CollectionTyped<JobExecutionReportLine>) => { ctx.dispatch(new this._nameSpace.ReportLinesSuccess(action, list)); @@ -252,7 +252,7 @@ export class PreservationPlanningJobExecutionReportState extends BaseState<Prese @Action(PreservationPlanningJobExecutionReportAction.GoToDeposit) goToDeposit(ctx: StateContext<PreservationPlanningJobExecutionStateModel>, action: PreservationPlanningJobExecutionReportAction.GoToDeposit): void { - this.subscribe(StoreUtil.dispatchActionAndWaitForSubActionCompletion(ctx as StateContext<any>, this.actions$, + this.subscribe(StoreUtil.dispatchActionAndWaitForSubActionCompletion(ctx as StateContext<any>, this._actions$, new PreservationPlanningDepositAction.GetById(action.depositId), PreservationPlanningDepositAction.GetByIdSuccess, resultAction => { diff --git a/src/app/features/preservation-planning/job/stores/job-execution/preservation-planning-job-execution.state.ts b/src/app/features/preservation-planning/job/stores/job-execution/preservation-planning-job-execution.state.ts index 71721cc36..f9cc34f98 100644 --- a/src/app/features/preservation-planning/job/stores/job-execution/preservation-planning-job-execution.state.ts +++ b/src/app/features/preservation-planning/job/stores/job-execution/preservation-planning-job-execution.state.ts @@ -89,11 +89,11 @@ export interface PreservationPlanningJobExecutionStateModel extends CompositionS ], }) export class PreservationPlanningJobExecutionState extends CompositionState<PreservationPlanningJobExecutionStateModel, JobExecution> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationJobExecutionActionNameSpace, resourceName: ApiResourceNameEnum.PRES_JOB_EXECUTION, }); @@ -132,7 +132,7 @@ export class PreservationPlanningJobExecutionState extends CompositionState<Pres isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<any, Result>(this._urlResource + urlSeparator + action.parentId + urlSeparator + ApiResourceNameEnum.PRES_JOB_EXECUTION + urlSeparator + action.jobExecutionId + urlSeparator + ApiActionNameEnum.RESUME) + return this._apiService.post<any, Result>(this._urlResource + urlSeparator + action.parentId + urlSeparator + ApiResourceNameEnum.PRES_JOB_EXECUTION + urlSeparator + action.jobExecutionId + urlSeparator + ApiActionNameEnum.RESUME) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -153,7 +153,7 @@ export class PreservationPlanningJobExecutionState extends CompositionState<Pres ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservation.jobExecution.notification.resume.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservation.jobExecution.notification.resume.success")); } @Action(PreservationPlanningJobExecutionAction.ResumeFail) @@ -161,6 +161,6 @@ export class PreservationPlanningJobExecutionState extends CompositionState<Pres ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("preservation.jobExecution.notification.resume.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("preservation.jobExecution.notification.resume.fail")); } } diff --git a/src/app/features/preservation-planning/job/stores/preservation-planning-job.state.ts b/src/app/features/preservation-planning/job/stores/preservation-planning-job.state.ts index a014ac3e6..3c4a8a4fb 100644 --- a/src/app/features/preservation-planning/job/stores/preservation-planning-job.state.ts +++ b/src/app/features/preservation-planning/job/stores/preservation-planning-job.state.ts @@ -100,11 +100,11 @@ export interface PreservationPlanningJobStateModel extends ResourceStateModel<Pr }) export class PreservationPlanningJobState extends ResourceState<PreservationPlanningJobStateModel, PreservationJob> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningJobActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.preservationPlanningJobDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.preservationPlanningJobDetail + urlSeparator + resId, @@ -154,7 +154,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<any, Result>(this._urlResource + urlSeparator + ApiActionNameEnum.INIT).pipe( + return this._apiService.post<any, Result>(this._urlResource + urlSeparator + ApiActionNameEnum.INIT).pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { ctx.dispatch(new PreservationPlanningJobAction.InitSuccess(action)); @@ -174,7 +174,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservation.job.notification.init.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservation.job.notification.init.success")); } @Action(PreservationPlanningJobAction.InitFail) @@ -182,7 +182,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("preservation.job.notification.init.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("preservation.job.notification.init.fail")); } @Action(PreservationPlanningJobAction.VerifyBeforeStart) @@ -195,7 +195,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan const queryParameters = new QueryParameters(environment.minimalPageSizeToRetrievePaginationInfo); MappingObjectUtil.set(queryParameters.search.searchItems, JOB_EXEC_STATUS, Enums.PreservationJob.ExecutionStatusEnum.IN_PROGRESS); - return this.apiService.get<JobExecution>(this._urlResource + urlSeparator + action.resId + urlSeparator + ApiResourceNameEnum.PRES_JOB_EXECUTION, queryParameters) + return this._apiService.get<JobExecution>(this._urlResource + urlSeparator + action.resId + urlSeparator + ApiResourceNameEnum.PRES_JOB_EXECUTION, queryParameters) .pipe( tap(result => { if (isEmptyArray(result._data)) { @@ -224,7 +224,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("preservation.job.notification.verify.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("preservation.job.notification.verify.fail")); } @Action(PreservationPlanningJobAction.Start) @@ -233,7 +233,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<any, Result>(this._urlResource + urlSeparator + action.resId + urlSeparator + ApiActionNameEnum.START).pipe( + return this._apiService.post<any, Result>(this._urlResource + urlSeparator + action.resId + urlSeparator + ApiActionNameEnum.START).pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { ctx.dispatch(new PreservationPlanningJobAction.StartSuccess(action)); @@ -253,7 +253,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservation.job.notification.start.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservation.job.notification.start.success")); } @Action(PreservationPlanningJobAction.StartFail) @@ -261,7 +261,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("preservation.job.notification.start.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("preservation.job.notification.start.fail")); } @Action(PreservationPlanningJobAction.Resume) @@ -270,7 +270,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<any, Result>(this._urlResource + urlSeparator + action.resId + urlSeparator + ApiActionNameEnum.RESUME).pipe( + return this._apiService.post<any, Result>(this._urlResource + urlSeparator + action.resId + urlSeparator + ApiActionNameEnum.RESUME).pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { ctx.dispatch(new PreservationPlanningJobAction.ResumeSuccess(action)); @@ -290,7 +290,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservation.job.notification.resume.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservation.job.notification.resume.success")); } @Action(PreservationPlanningJobAction.ResumeFail) @@ -298,7 +298,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("preservation.job.notification.resume.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("preservation.job.notification.resume.fail")); } @Action(PreservationPlanningJobAction.ListJobTypes) @@ -307,7 +307,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.getList<JobType>(this._urlResource + urlSeparator + ApiActionNameEnum.LIST_JOB_TYPE, null).pipe( + return this._apiService.getList<JobType>(this._urlResource + urlSeparator + ApiActionNameEnum.LIST_JOB_TYPE, null).pipe( tap(result => { ctx.dispatch(new PreservationPlanningJobAction.ListJobTypesSuccess(action, result)); }), @@ -339,7 +339,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.getList<JobRecurrence>(this._urlResource + urlSeparator + ApiActionNameEnum.LIST_JOB_RECURRENCE, null).pipe( + return this._apiService.getList<JobRecurrence>(this._urlResource + urlSeparator + ApiActionNameEnum.LIST_JOB_RECURRENCE, null).pipe( tap(result => { ctx.dispatch(new PreservationPlanningJobAction.ListJobRecurrencesSuccess(action, result)); }), diff --git a/src/app/features/preservation-planning/monitoring/components/dialogs/monitoring-web-service/preservation-planning-monitoring-web-service.dialog.ts b/src/app/features/preservation-planning/monitoring/components/dialogs/monitoring-web-service/preservation-planning-monitoring-web-service.dialog.ts index e67c47eb2..70b83ce97 100644 --- a/src/app/features/preservation-planning/monitoring/components/dialogs/monitoring-web-service/preservation-planning-monitoring-web-service.dialog.ts +++ b/src/app/features/preservation-planning/monitoring/components/dialogs/monitoring-web-service/preservation-planning-monitoring-web-service.dialog.ts @@ -60,7 +60,7 @@ export class PreservationPlanningMonitoringWebServiceDialog extends SharedAbstra constructor(private readonly _store: Store, private readonly _actions$: Actions, protected readonly _dialogRef: MatDialogRef<PreservationPlanningMonitoringWebServiceDialog>, - @Inject(MAT_DIALOG_DATA) public data: PreservationPlanningMonitoringWebServiceDialogData, + @Inject(MAT_DIALOG_DATA) public readonly data: PreservationPlanningMonitoringWebServiceDialogData, private readonly _fb: FormBuilder) { super(_dialogRef, data); } diff --git a/src/app/features/preservation-planning/monitoring/components/routables/monitoring-home/preservation-planning-monitoring-home.routable.ts b/src/app/features/preservation-planning/monitoring/components/routables/monitoring-home/preservation-planning-monitoring-home.routable.ts index 1e8e13759..181672e1a 100644 --- a/src/app/features/preservation-planning/monitoring/components/routables/monitoring-home/preservation-planning-monitoring-home.routable.ts +++ b/src/app/features/preservation-planning/monitoring/components/routables/monitoring-home/preservation-planning-monitoring-home.routable.ts @@ -56,7 +56,7 @@ export class PreservationPlanningMonitoringHomeRoutable extends SharedAbstractPr preservationPlanningMonitor: Observable<PreservationPlanningMonitor> = MemoizedUtil.select(this._store, PreservationPlanningMonitoringState, state => state.preservationPlanningMonitor, true); isLoading: Observable<boolean> = MemoizedUtil.isLoading(this._store, PreservationPlanningMonitoringState); - private readonly INTERVAL_REFRESH_IN_SECOND: number = 10; + private readonly _INTERVAL_REFRESH_IN_SECOND: number = 10; constructor(private readonly _store: Store) { super(); @@ -67,7 +67,7 @@ export class PreservationPlanningMonitoringHomeRoutable extends SharedAbstractPr this._store.dispatch(new PreservationPlanningMonitoringAction.Get(true)); this.subscribe(PollingHelper.startPollingObs({ - initialIntervalRefreshInSecond: this.INTERVAL_REFRESH_IN_SECOND, + initialIntervalRefreshInSecond: this._INTERVAL_REFRESH_IN_SECOND, incrementInterval: true, resetIntervalWhenUserMouseEvent: true, actionToDo: () => this.getAll(), diff --git a/src/app/features/preservation-planning/monitoring/stores/preservation-planning-monitoring.state.ts b/src/app/features/preservation-planning/monitoring/stores/preservation-planning-monitoring.state.ts index df0c87bc4..33d2f5d13 100644 --- a/src/app/features/preservation-planning/monitoring/stores/preservation-planning-monitoring.state.ts +++ b/src/app/features/preservation-planning/monitoring/stores/preservation-planning-monitoring.state.ts @@ -75,11 +75,11 @@ export interface PreservationPlanningMonitoringStateModel extends BaseStateModel ], }) export class PreservationPlanningMonitoringState extends BaseState<PreservationPlanningMonitoringStateModel> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningMonitorActionNameSpace, }, PreservationPlanningMonitoringState); } @@ -100,9 +100,9 @@ export class PreservationPlanningMonitoringState extends BaseState<PreservationP isLoadingCounter: ctx.getState().isLoadingCounter + 1, ...reset, }); - return this.apiService.get<PreservationPlanningMonitor>(this._urlResource, null) + return this._apiService.get<PreservationPlanningMonitor>(this._urlResource, null) .pipe( - StoreUtil.cancelUncompleted(ctx, this.actions$, [Navigate]), + StoreUtil.cancelUncompleted(ctx, this._actions$, [Navigate]), tap((preservationPlanningMonitor: PreservationPlanningMonitor) => { ctx.dispatch(new PreservationPlanningMonitoringAction.GetSuccess(action, preservationPlanningMonitor)); }), diff --git a/src/app/features/preservation-planning/monitoring/stores/web-service/preservation-planning-monitoring-web-service.state.ts b/src/app/features/preservation-planning/monitoring/stores/web-service/preservation-planning-monitoring-web-service.state.ts index fc0fbfe94..50481cab0 100644 --- a/src/app/features/preservation-planning/monitoring/stores/web-service/preservation-planning-monitoring-web-service.state.ts +++ b/src/app/features/preservation-planning/monitoring/stores/web-service/preservation-planning-monitoring-web-service.state.ts @@ -67,12 +67,12 @@ export interface PreservationPlanningMonitoringWebServiceStateModel extends Base children: [], }) export class PreservationPlanningMonitoringWebServiceState extends BaseState<PreservationPlanningMonitoringWebServiceStateModel> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, private readonly _httpClient: HttpClient) { - super(apiService, store, notificationService, actions$, { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningMonitorWebServiceActionNameSpace, }, PreservationPlanningMonitoringWebServiceState); } @@ -94,8 +94,8 @@ export class PreservationPlanningMonitoringWebServiceState extends BaseState<Pre ...reset, }); - return this.apiService.getByIdInPath(action.apiUrl).pipe( - StoreUtil.cancelUncompleted(ctx, this.actions$, [PreservationPlanningMonitoringWebServiceAction.Get, Navigate]), + return this._apiService.getByIdInPath(action.apiUrl).pipe( + StoreUtil.cancelUncompleted(ctx, this._actions$, [PreservationPlanningMonitoringWebServiceAction.Get, Navigate]), tap((result: SolidifyObject) => { ctx.dispatch(new PreservationPlanningMonitoringWebServiceAction.GetSuccess(action, result)); }), diff --git a/src/app/features/preservation-planning/sip/components/presentationals/sip-form/preservation-planning-sip-form.presentational.ts b/src/app/features/preservation-planning/sip/components/presentationals/sip-form/preservation-planning-sip-form.presentational.ts index d87981a06..a92873e89 100644 --- a/src/app/features/preservation-planning/sip/components/presentationals/sip-form/preservation-planning-sip-form.presentational.ts +++ b/src/app/features/preservation-planning/sip/components/presentationals/sip-form/preservation-planning-sip-form.presentational.ts @@ -121,10 +121,10 @@ export class PreservationPlanningSipFormPresentational extends AbstractFormPrese super.ngOnInit(); } - protected initNewForm(): void { + protected _initNewForm(): void { } - protected bindFormTo(sip: Sip): void { + protected _bindFormTo(sip: Sip): void { this.form = this._fb.group({ [this.formDefinition.organizationalUnitName]: [sip.organizationalUnit.name, []], [this.formDefinition.resId]: [sip.resId, []], @@ -149,7 +149,7 @@ export class PreservationPlanningSipFormPresentational extends AbstractFormPrese } } - protected treatmentBeforeSubmit(sip: Sip): Sip { + protected _treatmentBeforeSubmit(sip: Sip): Sip { return sip; } diff --git a/src/app/features/preservation-planning/sip/components/routables/sip-collection/preservation-planning-sip-collection.routable.ts b/src/app/features/preservation-planning/sip/components/routables/sip-collection/preservation-planning-sip-collection.routable.ts index dc12348fd..6f873a3ee 100644 --- a/src/app/features/preservation-planning/sip/components/routables/sip-collection/preservation-planning-sip-collection.routable.ts +++ b/src/app/features/preservation-planning/sip/components/routables/sip-collection/preservation-planning-sip-collection.routable.ts @@ -160,13 +160,13 @@ export class PreservationPlanningSipCollectionRoutable extends AbstractDetailEdi this.actions = [ { logo: IconNameEnum.download, - callback: (aip: Aip) => this.downloadSipAip(this._resId, aip), + callback: (aip: Aip) => this._downloadSipAip(this._resId, aip), placeholder: current => LabelTranslateEnum.download, displayOnCondition: current => false, }, { logo: IconNameEnum.internalLink, - callback: (aip: Aip) => this.goToAip(aip), + callback: (aip: Aip) => this._goToAip(aip), placeholder: current => LabelTranslateEnum.goToAip, }, ]; @@ -174,7 +174,7 @@ export class PreservationPlanningSipCollectionRoutable extends AbstractDetailEdi ngOnInit(): void { super.ngOnInit(); - this.getCurrentModelOnParent(); + this._getCurrentModelOnParent(); this.subscribe(this._store.select((s: LocalStateModel) => s.router.state.url) .pipe( @@ -187,16 +187,16 @@ export class PreservationPlanningSipCollectionRoutable extends AbstractDetailEdi ); } - private getCurrentModelOnParent(): void { + private _getCurrentModelOnParent(): void { this._resId = this._route.snapshot.parent.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); - this.getDepositById(this._resId); + this._getDepositById(this._resId); } - private getDepositById(id: string): void { - this.getSubResourceWithParentId(id); + private _getDepositById(id: string): void { + this._getSubResourceWithParentId(id); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new PreservationPlanningSipCollectionAction.GetAll(id, null, true)); } @@ -212,11 +212,11 @@ export class PreservationPlanningSipCollectionRoutable extends AbstractDetailEdi this._store.dispatch(new Navigate([RoutesEnum.preservationPlanningSipDetail, this._resId, PreservationPlanningRoutesEnum.sipCollections, aip.resId])); } - private downloadSipAip(parentId: string, aip: Aip): void { + private _downloadSipAip(parentId: string, aip: Aip): void { this._store.dispatch(new SharedAipCollectionAction.DownloadAip(parentId, aip)); } - private goToAip(aip: Aip): void { + private _goToAip(aip: Aip): void { this._store.dispatch(new PreservationPlanningSipCollectionAction.GoToAip(aip)); } diff --git a/src/app/features/preservation-planning/sip/components/routables/sip-detail-edit/preservation-planning-sip-detail-edit.routable.ts b/src/app/features/preservation-planning/sip/components/routables/sip-detail-edit/preservation-planning-sip-detail-edit.routable.ts index 71383f27c..b53a6c74f 100644 --- a/src/app/features/preservation-planning/sip/components/routables/sip-detail-edit/preservation-planning-sip-detail-edit.routable.ts +++ b/src/app/features/preservation-planning/sip/components/routables/sip-detail-edit/preservation-planning-sip-detail-edit.routable.ts @@ -87,7 +87,7 @@ import { changeDetection: ChangeDetectionStrategy.OnPush, }) export class PreservationPlanningSipDetailEditRoutable extends AbstractDetailEditRoutable<Sip, PreservationPlanningSipStateModel> implements OnInit, OnDestroy { - private readonly STATUS_TO_STOP_POLLING_REFRESH_STATUS: Enums.Package.StatusEnum[] = [ + private readonly _STATUS_TO_STOP_POLLING_REFRESH_STATUS: Enums.Package.StatusEnum[] = [ Enums.Package.StatusEnum.IN_ERROR, Enums.Package.StatusEnum.COMPLETED, Enums.Package.StatusEnum.PRESERVATION_ERROR, @@ -119,9 +119,9 @@ export class PreservationPlanningSipDetailEditRoutable extends AbstractDetailEdi readonly KEY_BACK_BUTTON: string = MARK_AS_TRANSLATABLE("preservation.sip.button.goBackToList"); readonly KEY_BACK_TO_DETAIL_BUTTON: string = undefined; - private currentTab: Tab; + private _currentTab: Tab; - private get rootUrl(): string[] { + private get _rootUrl(): string[] { return [RoutesEnum.preservationPlanningSipDetail, this._resId]; } @@ -183,14 +183,14 @@ export class PreservationPlanningSipDetailEditRoutable extends AbstractDetailEdi suffixUrl: PreservationPlanningRoutesEnum.sipMetadata, icon: IconNameEnum.metadata, titleToTranslate: LabelTranslateEnum.metadata, - route: () => [...this.rootUrl, PreservationPlanningRoutesEnum.sipMetadata], + route: () => [...this._rootUrl, PreservationPlanningRoutesEnum.sipMetadata], }, { id: TabEnum.FILES, suffixUrl: PreservationPlanningRoutesEnum.sipFiles, icon: IconNameEnum.files, titleToTranslate: LabelTranslateEnum.files, - route: () => [...this.rootUrl, PreservationPlanningRoutesEnum.sipFiles], + route: () => [...this._rootUrl, PreservationPlanningRoutesEnum.sipFiles], conditionDisplay: () => this.currentObs.pipe(map(current => current?.dataFileNumber > 0)), }, { @@ -198,7 +198,7 @@ export class PreservationPlanningSipDetailEditRoutable extends AbstractDetailEdi suffixUrl: PreservationPlanningRoutesEnum.sipCollections, icon: IconNameEnum.collection, titleToTranslate: LabelTranslateEnum.collection, - route: () => [...this.rootUrl, PreservationPlanningRoutesEnum.sipCollections], + route: () => [...this._rootUrl, PreservationPlanningRoutesEnum.sipCollections], conditionDisplay: () => this.currentObs.pipe(map(current => current?.collectionSize > 0)), }, ]; @@ -223,10 +223,10 @@ export class PreservationPlanningSipDetailEditRoutable extends AbstractDetailEdi ngOnDestroy(): void { super.ngOnDestroy(); - this.cleanState(); + this._cleanState(); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } showHistory(): void { @@ -245,7 +245,7 @@ export class PreservationPlanningSipDetailEditRoutable extends AbstractDetailEdi } setCurrentTab($event: Tab): void { - this.currentTab = $event; + this._currentTab = $event; } download(): void { @@ -280,7 +280,7 @@ export class PreservationPlanningSipDetailEditRoutable extends AbstractDetailEdi private _shouldContinuePollingWaitCompletedStatus(): boolean { const status = MemoizedUtil.selectSnapshot(this._store, PreservationPlanningSipState, state => state.current?.info?.status) as Enums.Package.StatusEnum; - return isNotNullNorUndefined(status) && this.STATUS_TO_STOP_POLLING_REFRESH_STATUS.indexOf(status) === -1; + return isNotNullNorUndefined(status) && this._STATUS_TO_STOP_POLLING_REFRESH_STATUS.indexOf(status) === -1; } } diff --git a/src/app/features/preservation-planning/sip/components/routables/sip-file/preservation-planning-sip-file.routable.ts b/src/app/features/preservation-planning/sip/components/routables/sip-file/preservation-planning-sip-file.routable.ts index 45ad9d67b..66e81e283 100644 --- a/src/app/features/preservation-planning/sip/components/routables/sip-file/preservation-planning-sip-file.routable.ts +++ b/src/app/features/preservation-planning/sip/components/routables/sip-file/preservation-planning-sip-file.routable.ts @@ -170,13 +170,13 @@ export class PreservationPlanningSipFileRoutable extends AbstractDetailEditRouta this.actions = [ { logo: IconNameEnum.resume, - callback: (sipDataFile: SipDataFile) => this.resumeDataFile(this._resId, sipDataFile), + callback: (sipDataFile: SipDataFile) => this._resumeDataFile(this._resId, sipDataFile), placeholder: current => LabelTranslateEnum.resume, displayOnCondition: current => isNullOrUndefined(current) || current.status === Enums.DataFile.StatusEnum.IN_ERROR, }, { logo: IconNameEnum.download, - callback: (sipDataFile: SipDataFile) => this.downloadDataFile(this._resId, sipDataFile), + callback: (sipDataFile: SipDataFile) => this._downloadDataFile(this._resId, sipDataFile), placeholder: current => LabelTranslateEnum.download, displayOnCondition: (current: SipDataFile) => current.status === Enums.DataFile.StatusEnum.PROCESSED || current.status === Enums.DataFile.StatusEnum.READY || current.status === Enums.DataFile.StatusEnum.VIRUS_CHECKED, }, @@ -191,7 +191,7 @@ export class PreservationPlanningSipFileRoutable extends AbstractDetailEditRouta ngOnInit(): void { super.ngOnInit(); - this.getCurrentModelOnParent(); + this._getCurrentModelOnParent(); this.subscribe(this._store.select((s: LocalStateModel) => s.router.state.url) .pipe( @@ -204,16 +204,16 @@ export class PreservationPlanningSipFileRoutable extends AbstractDetailEditRouta ); } - private getCurrentModelOnParent(): void { + private _getCurrentModelOnParent(): void { this._resId = this._route.snapshot.parent.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); - this.getDepositById(this._resId); + this._getDepositById(this._resId); } - private getDepositById(id: string): void { - this.getSubResourceWithParentId(id); + private _getDepositById(id: string): void { + this._getSubResourceWithParentId(id); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new PreservationPlanningSipDataFileAction.GetAll(id, null, true)); } @@ -233,11 +233,11 @@ export class PreservationPlanningSipFileRoutable extends AbstractDetailEditRouta this._store.dispatch(new Navigate([RoutesEnum.preservationPlanningSipDetail, this._resId, PreservationPlanningRoutesEnum.sipFiles, sipDataFile.resId])); } - private downloadDataFile(parentId: string, dataFile: SipDataFile): void { + private _downloadDataFile(parentId: string, dataFile: SipDataFile): void { this._store.dispatch(new PreservationPlanningSipDataFileAction.Download(parentId, dataFile)); } - private resumeDataFile(parentId: string, dataFile: SipDataFile): void { + private _resumeDataFile(parentId: string, dataFile: SipDataFile): void { this._store.dispatch(new PreservationPlanningSipDataFileAction.Resume(parentId, dataFile)); } diff --git a/src/app/features/preservation-planning/sip/components/routables/sip-list/preservation-planning-sip-list.routable.ts b/src/app/features/preservation-planning/sip/components/routables/sip-list/preservation-planning-sip-list.routable.ts index 0faee4b1c..3b80917b8 100644 --- a/src/app/features/preservation-planning/sip/components/routables/sip-list/preservation-planning-sip-list.routable.ts +++ b/src/app/features/preservation-planning/sip/components/routables/sip-list/preservation-planning-sip-list.routable.ts @@ -162,18 +162,18 @@ export class PreservationPlanningSipListRoutable extends AbstractListRoutable<Si ]; } - protected override defineActions(): DataTableActions<PreservationJob>[] { + protected override _defineActions(): DataTableActions<PreservationJob>[] { return [ { logo: IconNameEnum.download, - callback: (model: Sip) => this.download(model), + callback: (model: Sip) => this._download(model), placeholder: current => LabelTranslateEnum.download, displayOnCondition: (model: Sip) => true, }, ]; } - private download(sip: Sip): void { + private _download(sip: Sip): void { this._store.dispatch(new PreservationPlanningSipAction.Download(sip.resId)); } } diff --git a/src/app/features/preservation-planning/sip/components/routables/sip-metadata/preservation-planning-sip-metadata.routable.ts b/src/app/features/preservation-planning/sip/components/routables/sip-metadata/preservation-planning-sip-metadata.routable.ts index a86be1a9e..a1fd6773f 100644 --- a/src/app/features/preservation-planning/sip/components/routables/sip-metadata/preservation-planning-sip-metadata.routable.ts +++ b/src/app/features/preservation-planning/sip/components/routables/sip-metadata/preservation-planning-sip-metadata.routable.ts @@ -81,6 +81,6 @@ export class PreservationPlanningSipMetadataRoutable extends AbstractDetailEditR super.ngOnDestroy(); } - protected getSubResourceWithParentId(id: string): void { + protected _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/features/preservation-planning/sip/stores/collection/preservation-planning-sip-collection.state.ts b/src/app/features/preservation-planning/sip/stores/collection/preservation-planning-sip-collection.state.ts index a3676d190..ec3c88df5 100644 --- a/src/app/features/preservation-planning/sip/stores/collection/preservation-planning-sip-collection.state.ts +++ b/src/app/features/preservation-planning/sip/stores/collection/preservation-planning-sip-collection.state.ts @@ -84,13 +84,13 @@ export interface PreservationPlanningSipCollectionStateModel extends Composition ], }) export class PreservationPlanningSipCollectionState extends CompositionState<PreservationPlanningSipCollectionStateModel, Aip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - @Inject(WINDOW) private _window: Window, - private downloadService: DownloadService) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + @Inject(WINDOW) private readonly _window: Window, + private readonly _downloadService: DownloadService) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningSipCollectionActionNameSpace, resourceName: ApiResourceNameEnum.AIP, }); @@ -116,6 +116,6 @@ export class PreservationPlanningSipCollectionState extends CompositionState<Pre downloadAip(ctx: StateContext<PreservationPlanningSipCollectionStateModel>, action: PreservationPlanningSipCollectionAction.DownloadAip): void { // NOT WORK const url = `${this._urlResource}/${action.parentId}/${this._resourceName}/${action.aip.resId}/${ApiActionNameEnum.DL}`; - this.downloadService.download(url, action.aip.info.name, action.aip.archiveSize); + this._downloadService.download(url, action.aip.info.name, action.aip.archiveSize); } } diff --git a/src/app/features/preservation-planning/sip/stores/collection/status-history/preservation-planning-sip-collection-status-history.state.ts b/src/app/features/preservation-planning/sip/stores/collection/status-history/preservation-planning-sip-collection-status-history.state.ts index d2fcec41c..1ac2befb1 100644 --- a/src/app/features/preservation-planning/sip/stores/collection/status-history/preservation-planning-sip-collection-status-history.state.ts +++ b/src/app/features/preservation-planning/sip/stores/collection/status-history/preservation-planning-sip-collection-status-history.state.ts @@ -54,11 +54,11 @@ export interface PreservationPlanningSipCollectionStatusHistoryStateModel extend }) export class PreservationPlanningSipCollectionStatusHistoryState extends StatusHistoryState<PreservationPlanningSipCollectionStatusHistoryStateModel, Aip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningSipCollectionStatusHistoryNamespace, }); } diff --git a/src/app/features/preservation-planning/sip/stores/data-file/preservation-planning-sip-data-file.state.ts b/src/app/features/preservation-planning/sip/stores/data-file/preservation-planning-sip-data-file.state.ts index 756b2b1aa..703d165e9 100644 --- a/src/app/features/preservation-planning/sip/stores/data-file/preservation-planning-sip-data-file.state.ts +++ b/src/app/features/preservation-planning/sip/stores/data-file/preservation-planning-sip-data-file.state.ts @@ -87,13 +87,13 @@ export interface PreservationPlanningSipDataFileStateModel extends CompositionSt ], }) export class PreservationPlanningSipDataFileState extends CompositionState<PreservationPlanningSipDataFileStateModel, SipDataFile> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - @Inject(WINDOW) private _window: Window, - private downloadService: DownloadService) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + @Inject(WINDOW) private readonly _window: Window, + private readonly _downloadService: DownloadService) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningSipDataFileActionNameSpace, resourceName: ApiResourceNameEnum.DATAFILE, }); @@ -111,23 +111,23 @@ export class PreservationPlanningSipDataFileState extends CompositionState<Prese @Action(PreservationPlanningSipDataFileAction.Download) download(ctx: StateContext<PreservationPlanningSipDataFileStateModel>, action: PreservationPlanningSipDataFileAction.Download): void { const url = `${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.DL}`; - this.downloadService.download(url, action.dataFile.fileName, action.dataFile.fileSize); + this._downloadService.download(url, action.dataFile.fileName, action.dataFile.fileSize); } @Action(PreservationPlanningSipDataFileAction.Resume) resume(ctx: StateContext<PreservationPlanningSipDataFileStateModel>, action: PreservationPlanningSipDataFileAction.Resume): Observable<Result> { - return this.apiService.post<any, Result>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.RESUME}`) + return this._apiService.post<any, Result>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.RESUME}`) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { - this.notificationService.showInformation(LabelTranslateEnum.resourceResumed); + this._notificationService.showInformation(LabelTranslateEnum.resourceResumed); ctx.dispatch(new PreservationPlanningSipDataFileAction.GetAll(action.parentId, undefined, true)); } else { - this.notificationService.showError(LabelTranslateEnum.unableResumedResource); + this._notificationService.showError(LabelTranslateEnum.unableResumedResource); } }), catchError((error: SolidifyHttpErrorResponseModel) => { - this.notificationService.showError(LabelTranslateEnum.unableResumedResource); + this._notificationService.showError(LabelTranslateEnum.unableResumedResource); throw new SolidifyStateError(this, error); }), ); diff --git a/src/app/features/preservation-planning/sip/stores/data-file/status-history/preservation-planning-sip-data-file-status-history.state.ts b/src/app/features/preservation-planning/sip/stores/data-file/status-history/preservation-planning-sip-data-file-status-history.state.ts index f3c27b253..ac33d4640 100644 --- a/src/app/features/preservation-planning/sip/stores/data-file/status-history/preservation-planning-sip-data-file-status-history.state.ts +++ b/src/app/features/preservation-planning/sip/stores/data-file/status-history/preservation-planning-sip-data-file-status-history.state.ts @@ -54,11 +54,11 @@ export interface SharedAipDataFileStatusHistoryStateModel extends StatusHistoryS }) export class PreservationPlanningSipDataFileStatusHistoryState extends StatusHistoryState<SharedAipDataFileStatusHistoryStateModel, SipDataFile> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningSipDataFileStatusHistoryNamespace, }); } diff --git a/src/app/features/preservation-planning/sip/stores/preservation-planning-sip.state.ts b/src/app/features/preservation-planning/sip/stores/preservation-planning-sip.state.ts index b5d0a7c74..e163d57b9 100644 --- a/src/app/features/preservation-planning/sip/stores/preservation-planning-sip.state.ts +++ b/src/app/features/preservation-planning/sip/stores/preservation-planning-sip.state.ts @@ -93,13 +93,13 @@ export interface PreservationPlanningSipStateModel extends ResourceStateModel<Si ], }) export class PreservationPlanningSipState extends ResourceState<PreservationPlanningSipStateModel, Sip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - protected httpClient: HttpClient, - private downloadService: DownloadService) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + protected readonly _httpClient: HttpClient, + private readonly _downloadService: DownloadService) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningSipActionNameSpace, routeRedirectUrlAfterSuccessDeleteAction: () => RoutesEnum.preservationPlanningSip, }); @@ -141,7 +141,7 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan @Action(PreservationPlanningSipAction.Download) download(ctx: StateContext<PreservationPlanningSipStateModel>, action: PreservationPlanningSipAction.Download): void { const fileName = "sip_" + action.id + ".zip"; - this.downloadService.download(`${this._urlResource}/${action.id}/${ApiActionNameEnum.DL}`, fileName); + this._downloadService.download(`${this._urlResource}/${action.id}/${ApiActionNameEnum.DL}`, fileName); } @Action(PreservationPlanningSipAction.Resume) @@ -149,7 +149,7 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.RESUME}`, null) + return this._httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.RESUME}`, null) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -170,7 +170,7 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.action.resume.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.action.resume.success")); ctx.dispatch(new PreservationPlanningSipAction.GetById(action.parentAction.id, true)); } @@ -179,7 +179,7 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.sip.action.resume.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.sip.action.resume.fail")); } @Action(PreservationPlanningSipAction.Resubmit) @@ -187,7 +187,7 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.RESUBMIT}`, null) + return this._httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.RESUBMIT}`, null) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -208,7 +208,7 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.action.resubmit.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.action.resubmit.success")); ctx.dispatch(new PreservationPlanningSipAction.GetById(action.parentAction.id, true)); } @@ -217,7 +217,7 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.sip.action.resubmit.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.sip.action.resubmit.fail")); } @Action(PreservationPlanningSipAction.PutInError) @@ -225,7 +225,7 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.PUT_IN_ERROR}`, null) + return this._httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.PUT_IN_ERROR}`, null) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -246,7 +246,7 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.action.put-in-error.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.action.put-in-error.success")); ctx.dispatch(new PreservationPlanningSipAction.GetById(action.parentAction.id, true)); } @@ -255,6 +255,6 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.sip.action.put-in-error.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.sip.action.put-in-error.fail")); } } diff --git a/src/app/features/preservation-planning/sip/stores/status-history/preservation-planning-sip-status-history.state.ts b/src/app/features/preservation-planning/sip/stores/status-history/preservation-planning-sip-status-history.state.ts index c77e10044..61a417f28 100644 --- a/src/app/features/preservation-planning/sip/stores/status-history/preservation-planning-sip-status-history.state.ts +++ b/src/app/features/preservation-planning/sip/stores/status-history/preservation-planning-sip-status-history.state.ts @@ -54,11 +54,11 @@ export interface PreservationPlanningSipStatusHistoryStateModel extends StatusHi }) export class PreservationPlanningSipStatusHistoryState extends StatusHistoryState<PreservationPlanningSipStatusHistoryStateModel, Sip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningSipStatusHistoryNamespace, }); } diff --git a/src/app/features/preservation-planning/stores/order/preservation-planning-order.state.ts b/src/app/features/preservation-planning/stores/order/preservation-planning-order.state.ts index bb5144afa..f9853dee5 100644 --- a/src/app/features/preservation-planning/stores/order/preservation-planning-order.state.ts +++ b/src/app/features/preservation-planning/stores/order/preservation-planning-order.state.ts @@ -77,11 +77,11 @@ export interface PreservationPlanningOrderStateModel extends ResourceStateModel< ], }) export class PreservationPlanningOrderState extends ResourceState<PreservationPlanningOrderStateModel, Order> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningOrderNamespace, }); } diff --git a/src/app/features/preservation-planning/stores/order/status-history/preservation-planning-order-status-history.state.ts b/src/app/features/preservation-planning/stores/order/status-history/preservation-planning-order-status-history.state.ts index 600b59859..d334f05bf 100644 --- a/src/app/features/preservation-planning/stores/order/status-history/preservation-planning-order-status-history.state.ts +++ b/src/app/features/preservation-planning/stores/order/status-history/preservation-planning-order-status-history.state.ts @@ -58,11 +58,11 @@ export interface PreservationPlanningOrderStatusHistoryStateModel extends Status }) export class PreservationPlanningOrderStatusHistoryState extends StatusHistoryState<PreservationPlanningOrderStatusHistoryStateModel, Order> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationPlanningOrderStatusHistoryNamespace, }); } diff --git a/src/app/features/preservation-planning/stores/preservation-planning.state.ts b/src/app/features/preservation-planning/stores/preservation-planning.state.ts index bb7e94b93..ea318b018 100644 --- a/src/app/features/preservation-planning/stores/preservation-planning.state.ts +++ b/src/app/features/preservation-planning/stores/preservation-planning.state.ts @@ -91,6 +91,6 @@ export interface PreservationPlanningStateModel extends BaseStateModel { ], }) export class PreservationPlanningState { - constructor(protected store: Store) { + constructor(protected readonly _store: Store) { } } diff --git a/src/app/features/preservation-space/aip-steward/components/routables/aip-steward-not-found/preservation-space-aip-steward-not-found.routable.ts b/src/app/features/preservation-space/aip-steward/components/routables/aip-steward-not-found/preservation-space-aip-steward-not-found.routable.ts index 8abcd741e..6636d0ed1 100644 --- a/src/app/features/preservation-space/aip-steward/components/routables/aip-steward-not-found/preservation-space-aip-steward-not-found.routable.ts +++ b/src/app/features/preservation-space/aip-steward/components/routables/aip-steward-not-found/preservation-space-aip-steward-not-found.routable.ts @@ -48,10 +48,10 @@ export class PreservationSpaceAipStewardNotFoundRoutable extends SharedAbstractR } back(): void { - this.navigate([RoutesEnum.preservationPlanningAipDownloaded]); + this._navigate([RoutesEnum.preservationPlanningAipDownloaded]); } - private navigate(path: (string | number)[]): void { + private _navigate(path: (string | number)[]): void { this._store.dispatch(new Navigate(path)); } } diff --git a/src/app/features/preservation-space/components/routables/preservation-space-home/preservation-space-home.routable.ts b/src/app/features/preservation-space/components/routables/preservation-space-home/preservation-space-home.routable.ts index 117a493c5..9500fffd3 100644 --- a/src/app/features/preservation-space/components/routables/preservation-space-home/preservation-space-home.routable.ts +++ b/src/app/features/preservation-space/components/routables/preservation-space-home/preservation-space-home.routable.ts @@ -53,8 +53,6 @@ import { changeDetection: ChangeDetectionStrategy.OnPush, }) export class PreservationSpaceHomeRoutable extends SharedAbstractPresentational { - - //isLoadingObs: Observable<boolean> = MemoizedUtil.isLoading(this.store, PreservationSpaceState); isLoadingObs: Observable<boolean>; @Input() @@ -62,7 +60,9 @@ export class PreservationSpaceHomeRoutable extends SharedAbstractPresentational userRolesObs: Enums.UserApplicationRole.UserApplicationRoleEnum[]; - private get rootUrl(): string[] { + private _currentTab: Tab; + + private get _rootUrl(): string[] { return [RoutesEnum.preservationSpace]; } @@ -72,7 +72,7 @@ export class PreservationSpaceHomeRoutable extends SharedAbstractPresentational icon: IconNameEnum.organizationalUnit, titleToTranslate: LabelTranslateEnum.organizationalUnits, suffixUrl: PreservationSpaceRoutesEnum.organizationalUnit, - route: () => [...this.rootUrl, PreservationSpaceRoutesEnum.organizationalUnit], + route: () => [...this._rootUrl, PreservationSpaceRoutesEnum.organizationalUnit], dataTest: DataTestEnum.preservationSpaceTabOrgUnit, }, { @@ -80,7 +80,7 @@ export class PreservationSpaceHomeRoutable extends SharedAbstractPresentational icon: IconNameEnum.contributor, titleToTranslate: LabelTranslateEnum.contributors, suffixUrl: PreservationSpaceRoutesEnum.contributor, - route: () => [...this.rootUrl, PreservationSpaceRoutesEnum.contributor], + route: () => [...this._rootUrl, PreservationSpaceRoutesEnum.contributor], dataTest: DataTestEnum.preservationSpaceTabContributor, }, { @@ -88,8 +88,8 @@ export class PreservationSpaceHomeRoutable extends SharedAbstractPresentational icon: IconNameEnum.requestInbox, titleToTranslate: LabelTranslateEnum.notifications, suffixUrl: PreservationSpaceRoutesEnum.notificationInbox, - route: () => [...this.rootUrl, PreservationSpaceRoutesEnum.notificationInbox], - numberNew: () => MemoizedUtil.total(this.store, AppNotificationInboxState), + route: () => [...this._rootUrl, PreservationSpaceRoutesEnum.notificationInbox], + numberNew: () => MemoizedUtil.total(this._store, AppNotificationInboxState), dataTest: DataTestEnum.preservationSpaceTabRequestReceived, }, { @@ -97,7 +97,7 @@ export class PreservationSpaceHomeRoutable extends SharedAbstractPresentational icon: IconNameEnum.requestSent, titleToTranslate: LabelTranslateEnum.sentRequests, suffixUrl: PreservationSpaceRoutesEnum.notificationSent, - route: () => [...this.rootUrl, PreservationSpaceRoutesEnum.notificationSent], + route: () => [...this._rootUrl, PreservationSpaceRoutesEnum.notificationSent], dataTest: DataTestEnum.preservationSpaceTabRequestSent, }, ]; @@ -106,19 +106,17 @@ export class PreservationSpaceHomeRoutable extends SharedAbstractPresentational return TourEnum; } - constructor(private store: Store) { + constructor(private readonly _store: Store) { super(); - this.userRolesObs = this.store.selectSnapshot((state: LocalStateModel) => state.application.userRoles); + this.userRolesObs = this._store.selectSnapshot((state: LocalStateModel) => state.application.userRoles); } navigate(path: RoutesEnum): void { - this.store.dispatch(new Navigate([path])); + this._store.dispatch(new Navigate([path])); } - private currentTab: Tab; - setCurrentTab($event: Tab): void { - this.currentTab = $event; + this._currentTab = $event; } } diff --git a/src/app/features/preservation-space/contributor/components/presentationals/contributor-form/preservation-space-contributor-form.presentational.ts b/src/app/features/preservation-space/contributor/components/presentationals/contributor-form/preservation-space-contributor-form.presentational.ts index cf153db41..06430778f 100644 --- a/src/app/features/preservation-space/contributor/components/presentationals/contributor-form/preservation-space-contributor-form.presentational.ts +++ b/src/app/features/preservation-space/contributor/components/presentationals/contributor-form/preservation-space-contributor-form.presentational.ts @@ -83,7 +83,7 @@ export class PreservationSpaceContributorFormPresentational extends AbstractForm super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.lastName]: [""], [this.formDefinition.firstName]: [""], @@ -91,7 +91,7 @@ export class PreservationSpaceContributorFormPresentational extends AbstractForm }); } - protected bindFormTo(contributor: Contributor): void { + protected _bindFormTo(contributor: Contributor): void { this.form = this._fb.group({ [this.formDefinition.lastName]: [contributor.lastName], [this.formDefinition.firstName]: [contributor.firstName], @@ -99,7 +99,7 @@ export class PreservationSpaceContributorFormPresentational extends AbstractForm }); } - protected treatmentBeforeSubmit(model: Contributor): Contributor { + protected _treatmentBeforeSubmit(model: Contributor): Contributor { return undefined; } diff --git a/src/app/features/preservation-space/contributor/components/routables/contributor-detail-edit/preservation-space-contributor-detail-edit.routable.ts b/src/app/features/preservation-space/contributor/components/routables/contributor-detail-edit/preservation-space-contributor-detail-edit.routable.ts index 63dad31c5..e6ca5ff8d 100644 --- a/src/app/features/preservation-space/contributor/components/routables/contributor-detail-edit/preservation-space-contributor-detail-edit.routable.ts +++ b/src/app/features/preservation-space/contributor/components/routables/contributor-detail-edit/preservation-space-contributor-detail-edit.routable.ts @@ -146,11 +146,11 @@ export class PreservationSpaceContributorDetailEditRoutable extends AbstractDeta }, ]; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.preservationSpace_contributor, _injector, preservationSpaceContributorActionNameSpace, StateEnum.preservationSpace); } @@ -159,7 +159,7 @@ export class PreservationSpaceContributorDetailEditRoutable extends AbstractDeta super.ngOnInit(); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new PreservationSpaceContributorDepositAction.GetAll(id)); } diff --git a/src/app/features/preservation-space/contributor/stores/contributor-deposit/preservation-space-contributor-deposit.state.ts b/src/app/features/preservation-space/contributor/stores/contributor-deposit/preservation-space-contributor-deposit.state.ts index b4be5c51e..721831272 100644 --- a/src/app/features/preservation-space/contributor/stores/contributor-deposit/preservation-space-contributor-deposit.state.ts +++ b/src/app/features/preservation-space/contributor/stores/contributor-deposit/preservation-space-contributor-deposit.state.ts @@ -59,11 +59,11 @@ export interface PreservationSpaceContributorDepositStateModel extends Compositi }, }) export class PreservationSpaceContributorDepositState extends CompositionState<PreservationSpaceContributorDepositStateModel, Deposit> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationSpaceContributorDepositActionNameSpace, resourceName: ApiResourceNameEnum.DEPOSIT, }); diff --git a/src/app/features/preservation-space/contributor/stores/preservation-space-contributor.state.ts b/src/app/features/preservation-space/contributor/stores/preservation-space-contributor.state.ts index c0d413485..a26ee98d0 100644 --- a/src/app/features/preservation-space/contributor/stores/preservation-space-contributor.state.ts +++ b/src/app/features/preservation-space/contributor/stores/preservation-space-contributor.state.ts @@ -69,13 +69,13 @@ export interface PreservationSpaceContributorStateModel extends ResourceLogoStat }) export class PreservationSpaceContributorState extends ResourceLogoState<PreservationSpaceContributorStateModel, Contributor> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - private _securityService: SecurityService, + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + private readonly _securityService: SecurityService, protected readonly _httpClient: HttpClient) { - super(apiService, store, notificationService, actions$, {nameSpace: preservationSpaceContributorActionNameSpace}, + super(_apiService, _store, _notificationService, _actions$, {nameSpace: preservationSpaceContributorActionNameSpace}, _httpClient, ResourceLogoStateModeEnum.avatar); } diff --git a/src/app/features/preservation-space/notification/components/routables/preservation-space-notification-detail-edit/preservation-space-notification-detail-edit.routable.ts b/src/app/features/preservation-space/notification/components/routables/preservation-space-notification-detail-edit/preservation-space-notification-detail-edit.routable.ts index 128e12f23..4ccc3eaf3 100644 --- a/src/app/features/preservation-space/notification/components/routables/preservation-space-notification-detail-edit/preservation-space-notification-detail-edit.routable.ts +++ b/src/app/features/preservation-space/notification/components/routables/preservation-space-notification-detail-edit/preservation-space-notification-detail-edit.routable.ts @@ -139,12 +139,12 @@ export class PreservationSpaceNotificationDetailEditRoutable extends AbstractDet }, ]; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, private readonly _notificationService: NotificationService, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.preservationSpace_notification, _injector, preservationSpaceNotificationActionNameSpace, StateEnum.preservationSpace); } @@ -155,7 +155,7 @@ export class PreservationSpaceNotificationDetailEditRoutable extends AbstractDet this.subscribe(this.modeObs, mode => this.mode = mode); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } private _retrieveModeFromUrl(): void { diff --git a/src/app/features/preservation-space/notification/components/routables/preservation-space-notification-list/preservation-space-notification-list.routable.ts b/src/app/features/preservation-space/notification/components/routables/preservation-space-notification-list/preservation-space-notification-list.routable.ts index d861863f6..4643319c0 100644 --- a/src/app/features/preservation-space/notification/components/routables/preservation-space-notification-list/preservation-space-notification-list.routable.ts +++ b/src/app/features/preservation-space/notification/components/routables/preservation-space-notification-list/preservation-space-notification-list.routable.ts @@ -166,7 +166,7 @@ export class PreservationSpaceNotificationListRoutable extends AbstractListRouta this._store.dispatch(new PreservationSpaceNotificationAction.SetPending(notification.resId, notification.notificationType.notificationCategory, ViewModeEnum.list)); } - private defineActionsInbox(): DataTableActions<NotificationDlcm>[] { + private _defineActionsInbox(): DataTableActions<NotificationDlcm>[] { return [ { logo: IconNameEnum.markAsUnread, @@ -191,9 +191,9 @@ export class PreservationSpaceNotificationListRoutable extends AbstractListRouta this._store.dispatch(new Navigate([route, model.resId])); } - protected defineActions(): DataTableActions<NotificationDlcm>[] { + protected _defineActions(): DataTableActions<NotificationDlcm>[] { if (this.mode === NotificationModeEnum.inbox) { - return this.defineActionsInbox(); + return this._defineActionsInbox(); } else { return []; } diff --git a/src/app/features/preservation-space/notification/stores/preservation-space-notification.state.ts b/src/app/features/preservation-space/notification/stores/preservation-space-notification.state.ts index c0451c0eb..8e80c59e4 100644 --- a/src/app/features/preservation-space/notification/stores/preservation-space-notification.state.ts +++ b/src/app/features/preservation-space/notification/stores/preservation-space-notification.state.ts @@ -105,11 +105,11 @@ export interface PreservationSpaceNotificationStateModel extends ResourceStateMo ], }) export class PreservationSpaceNotificationState extends ResourceState<PreservationSpaceNotificationStateModel, NotificationDlcm> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationSpaceNotificationActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.preservationSpaceNotificationInboxDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.preservationSpaceNotificationInboxDetail + urlSeparator + resId, @@ -163,8 +163,8 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati { action: new SharedRoleAction.GetAll(undefined, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllFail)), ], }, ]).pipe( @@ -213,9 +213,9 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati if (ctx.getState().mode === NotificationModeEnum.sent) { mode = ApiActionNameEnum.SENT; } - return this.apiService.get<NotificationDlcm>(this._urlResource + urlSeparator + mode, ctx.getState().queryParameters) + return this._apiService.get<NotificationDlcm>(this._urlResource + urlSeparator + mode, ctx.getState().queryParameters) .pipe( - action.cancelIncomplete ? StoreUtil.cancelUncompleted(ctx, this.actions$, [this._nameSpace.GetAll, Navigate]) : pipe(), + action.cancelIncomplete ? StoreUtil.cancelUncompleted(ctx, this._actions$, [this._nameSpace.GetAll, Navigate]) : pipe(), tap((collection: CollectionTyped<NotificationDlcm>) => { ctx.dispatch(new PreservationSpaceNotificationAction.GetAllSuccess(action, collection)); }), @@ -244,7 +244,7 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati if (ctx.getState().mode === NotificationModeEnum.sent) { mode = ApiActionNameEnum.SENT; } - return this.apiService.getById<NotificationDlcm>(this._urlResource + urlSeparator + mode, action.id) + return this._apiService.getById<NotificationDlcm>(this._urlResource + urlSeparator + mode, action.id) .pipe( tap((model: NotificationDlcm) => { ctx.dispatch(new PreservationSpaceNotificationAction.GetByIdSuccess(action, model)); @@ -258,7 +258,7 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati @Action(PreservationSpaceNotificationAction.SetProcessed) setProcessed(ctx: StateContext<PreservationSpaceNotificationStateModel>, action: PreservationSpaceNotificationAction.SetProcessed): Observable<Result> { - return this.apiService.post<Result>(this._urlResource + urlSeparator + action.notificationId + urlSeparator + ApiActionNameEnum.SET_PROCESSED) + return this._apiService.post<Result>(this._urlResource + urlSeparator + action.notificationId + urlSeparator + ApiActionNameEnum.SET_PROCESSED) .pipe( tap(result => ctx.dispatch(new PreservationSpaceNotificationAction.SetProcessedSuccess(action))), catchError((error: SolidifyHttpErrorResponseModel) => { @@ -270,30 +270,30 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati @Action(PreservationSpaceNotificationAction.SetProcessedSuccess) setProcessedSuccess(ctx: StateContext<PreservationSpaceNotificationStateModel>, action: PreservationSpaceNotificationAction.SetProcessedSuccess): void { - this.removeNotificationPendingListAndRefresh(ctx, (action.parentAction as PreservationSpaceNotificationAction.SetRefuse).notificationId, (action.parentAction as PreservationSpaceNotificationAction.SetRefuse).mode); + this._removeNotificationPendingListAndRefresh(ctx, (action.parentAction as PreservationSpaceNotificationAction.SetRefuse).notificationId, (action.parentAction as PreservationSpaceNotificationAction.SetRefuse).mode); const notificationCategory = action.parentAction.notificationCategory; if (notificationCategory === Enums.Notification.CategoryEnum.REQUEST) { - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setProcessed.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setProcessed.success")); } else if (notificationCategory === Enums.Notification.CategoryEnum.INFO) { - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setRead.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setRead.success")); } LocalStorageHelper.removeItemInList(LocalStorageEnum.notificationInboxPending, action.parentAction.notificationId); - this.store.dispatch(new appActionNameSpace.UpdateNotificationInbox()); + this._store.dispatch(new appActionNameSpace.UpdateNotificationInbox()); } @Action(PreservationSpaceNotificationAction.SetProcessedFail) setProcessedFail(ctx: StateContext<PreservationSpaceNotificationStateModel>, action: PreservationSpaceNotificationAction.SetProcessedFail): void { const notificationCategory = action.parentAction.notificationCategory; if (notificationCategory === Enums.Notification.CategoryEnum.REQUEST) { - this.notificationService.showError(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setProcessed.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setProcessed.fail")); } else if (notificationCategory === Enums.Notification.CategoryEnum.INFO) { - this.notificationService.showError(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setRead.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setRead.fail")); } } @Action(PreservationSpaceNotificationAction.SetRefuse) setRefuse(ctx: StateContext<PreservationSpaceNotificationStateModel>, action: PreservationSpaceNotificationAction.SetRefuse): Observable<Result> { - return this.apiService.post<Result>(this._urlResource + urlSeparator + action.notificationId + urlSeparator + ApiActionNameEnum.SET_REFUSED) + return this._apiService.post<Result>(this._urlResource + urlSeparator + action.notificationId + urlSeparator + ApiActionNameEnum.SET_REFUSED) .pipe( tap(result => ctx.dispatch(new PreservationSpaceNotificationAction.SetRefuseSuccess(action))), catchError((error: SolidifyHttpErrorResponseModel) => { @@ -305,20 +305,20 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati @Action(PreservationSpaceNotificationAction.SetRefuseSuccess) setRefuseSuccess(ctx: StateContext<PreservationSpaceNotificationStateModel>, action: PreservationSpaceNotificationAction.SetRefuseSuccess): void { - this.removeNotificationPendingListAndRefresh(ctx, action.parentAction.notificationId, action.parentAction.mode); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setRefuse.success")); + this._removeNotificationPendingListAndRefresh(ctx, action.parentAction.notificationId, action.parentAction.mode); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setRefuse.success")); LocalStorageHelper.removeItemInList(LocalStorageEnum.notificationInboxPending, action.parentAction.notificationId); - this.store.dispatch(new appActionNameSpace.UpdateNotificationInbox()); + this._store.dispatch(new appActionNameSpace.UpdateNotificationInbox()); } @Action(PreservationSpaceNotificationAction.SetRefuseFail) setRefuseFail(ctx: StateContext<PreservationSpaceNotificationStateModel>, action: PreservationSpaceNotificationAction.SetRefuseFail): void { - this.notificationService.showError(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setRefuse.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setRefuse.fail")); } @Action(PreservationSpaceNotificationAction.SetPending) setPending(ctx: StateContext<PreservationSpaceNotificationStateModel>, action: PreservationSpaceNotificationAction.SetPending): Observable<Result> { - return this.apiService.post<Result>(this._urlResource + urlSeparator + action.notificationId + urlSeparator + ApiActionNameEnum.SET_PENDING) + return this._apiService.post<Result>(this._urlResource + urlSeparator + action.notificationId + urlSeparator + ApiActionNameEnum.SET_PENDING) .pipe( tap(result => ctx.dispatch(new PreservationSpaceNotificationAction.SetPendingSuccess(action))), catchError((error: SolidifyHttpErrorResponseModel) => { @@ -330,20 +330,20 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati @Action(PreservationSpaceNotificationAction.SetPendingSuccess) setPendingSuccess(ctx: StateContext<PreservationSpaceNotificationStateModel>, action: PreservationSpaceNotificationAction.SetPendingSuccess): void { - this.removeNotificationPendingListAndRefresh(ctx, action.parentAction.notificationId, action.parentAction.mode); + this._removeNotificationPendingListAndRefresh(ctx, action.parentAction.notificationId, action.parentAction.mode); const notificationCategory = action.parentAction.notificationCategory; if (notificationCategory === Enums.Notification.CategoryEnum.REQUEST) { - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setPending.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setPending.success")); } else if (notificationCategory === Enums.Notification.CategoryEnum.INFO) { - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setUnread.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setUnread.success")); } if (CookieConsentUtil.isFeatureAuthorized(CookieType.localStorage, LocalStorageEnum.notificationInboxPending)) { LocalStorageHelper.addItemInList(LocalStorageEnum.notificationInboxPending, action.parentAction.notificationId); } - this.store.dispatch(new appActionNameSpace.UpdateNotificationInbox()); + this._store.dispatch(new appActionNameSpace.UpdateNotificationInbox()); } - private removeNotificationPendingListAndRefresh(ctx: StateContext<PreservationSpaceNotificationStateModel>, + private _removeNotificationPendingListAndRefresh(ctx: StateContext<PreservationSpaceNotificationStateModel>, notificationId: string, mode: ViewModeEnum): void { LocalStorageHelper.removeItemInList(LocalStorageEnum.notificationInboxPending, notificationId); @@ -358,13 +358,13 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati setPendingFail(ctx: StateContext<PreservationSpaceNotificationStateModel>, action: PreservationSpaceNotificationAction.SetPendingFail): void { const notificationCategory = action.parentAction.notificationCategory; if (notificationCategory === Enums.Notification.CategoryEnum.REQUEST) { - this.notificationService.showError(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setPending.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setPending.fail")); } else if (notificationCategory === Enums.Notification.CategoryEnum.INFO) { - this.notificationService.showError(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setUnread.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setUnread.fail")); } } - private redirectToNotificationDetail(ctx: StateContext<PreservationSpaceNotificationStateModel>, notificationId: string): void { + private _redirectToNotificationDetail(ctx: StateContext<PreservationSpaceNotificationStateModel>, notificationId: string): void { ctx.dispatch(new PreservationSpaceNotificationAction.GetById(notificationId)); } diff --git a/src/app/features/preservation-space/notification/stores/status-history/preservation-space-notification-status-history.state.ts b/src/app/features/preservation-space/notification/stores/status-history/preservation-space-notification-status-history.state.ts index bcd716ca2..1fc3f0f3c 100644 --- a/src/app/features/preservation-space/notification/stores/status-history/preservation-space-notification-status-history.state.ts +++ b/src/app/features/preservation-space/notification/stores/status-history/preservation-space-notification-status-history.state.ts @@ -54,11 +54,11 @@ export interface PreservationSpaceNotificationStatusHistoryStateModel extends St }) export class PreservationSpaceNotificationStatusHistoryState extends StatusHistoryState<PreservationSpaceNotificationStatusHistoryStateModel, NotificationDlcm> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationSpaceNotificationStatusHistoryActionNameSpace, }); } diff --git a/src/app/features/preservation-space/organizational-unit/components/dialogs/organizational-unit-request-access/preservation-space-organizational-unit-request-access.dialog.ts b/src/app/features/preservation-space/organizational-unit/components/dialogs/organizational-unit-request-access/preservation-space-organizational-unit-request-access.dialog.ts index c63a72840..8faa2a520 100644 --- a/src/app/features/preservation-space/organizational-unit/components/dialogs/organizational-unit-request-access/preservation-space-organizational-unit-request-access.dialog.ts +++ b/src/app/features/preservation-space/organizational-unit/components/dialogs/organizational-unit-request-access/preservation-space-organizational-unit-request-access.dialog.ts @@ -77,7 +77,7 @@ export class PreservationSpaceOrganizationalUnitRequestAccessDialog extends Shar private readonly _actions$: Actions, protected readonly _dialogRef: MatDialogRef<PreservationSpaceOrganizationalUnitRequestAccessDialog>, private readonly _fb: FormBuilder, - @Inject(MAT_DIALOG_DATA) public data: PreservationSpaceOrganizationalUnitRequestAccessDialogData, + @Inject(MAT_DIALOG_DATA) public readonly data: PreservationSpaceOrganizationalUnitRequestAccessDialogData, private readonly _changeDetector: ChangeDetectorRef, ) { super(_dialogRef, data); diff --git a/src/app/features/preservation-space/organizational-unit/components/presentationals/organizational-unit-archive-acl-form/preservation-space-organizational-unit-archive-acl-form.presentational.ts b/src/app/features/preservation-space/organizational-unit/components/presentationals/organizational-unit-archive-acl-form/preservation-space-organizational-unit-archive-acl-form.presentational.ts index e673a71bc..bdcfa53b2 100644 --- a/src/app/features/preservation-space/organizational-unit/components/presentationals/organizational-unit-archive-acl-form/preservation-space-organizational-unit-archive-acl-form.presentational.ts +++ b/src/app/features/preservation-space/organizational-unit/components/presentationals/organizational-unit-archive-acl-form/preservation-space-organizational-unit-archive-acl-form.presentational.ts @@ -145,7 +145,7 @@ export class PreservationSpaceOrganizationalUnitArchiveAclFormPresentational ext formControl.updateValueAndValidity(); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.aipId]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.user]: ["", [Validators.required, SolidifyValidator]], @@ -153,7 +153,7 @@ export class PreservationSpaceOrganizationalUnitArchiveAclFormPresentational ext }); } - protected bindFormTo(archiveAcl: ArchiveACL): void { + protected _bindFormTo(archiveAcl: ArchiveACL): void { this.form = this._fb.group({ [this.formDefinition.aipId]: [archiveAcl.aipId, [Validators.required, SolidifyValidator]], [this.formDefinition.user]: [archiveAcl.user.resId, [Validators.required, SolidifyValidator]], @@ -161,7 +161,7 @@ export class PreservationSpaceOrganizationalUnitArchiveAclFormPresentational ext }); } - protected treatmentBeforeSubmit(archiveAcl: ArchiveACL): ArchiveACL { + protected _treatmentBeforeSubmit(archiveAcl: ArchiveACL): ArchiveACL { return { resId: this.model?.resId, aipId: this.form.get(this.formDefinition.aipId).value, diff --git a/src/app/features/preservation-space/organizational-unit/components/presentationals/organizational-unit-form/preservation-space-organizational-unit-form.presentational.ts b/src/app/features/preservation-space/organizational-unit/components/presentationals/organizational-unit-form/preservation-space-organizational-unit-form.presentational.ts index a369cf89b..8ceff79a9 100644 --- a/src/app/features/preservation-space/organizational-unit/components/presentationals/organizational-unit-form/preservation-space-organizational-unit-form.presentational.ts +++ b/src/app/features/preservation-space/organizational-unit/components/presentationals/organizational-unit-form/preservation-space-organizational-unit-form.presentational.ts @@ -99,8 +99,8 @@ import { changeDetection: ChangeDetectionStrategy.OnPush, }) export class PreservationSpaceOrganizationalUnitFormPresentational extends AbstractFormPresentational<OrganizationalUnit> implements OnInit { - private readonly KEY_SOURCE: keyof ResearchDomain = "source"; - private readonly KEY_DEFAULT: string = "default"; + private readonly _KEY_SOURCE: keyof ResearchDomain = "source"; + private readonly _KEY_DEFAULT: string = "default"; readonly TIME_BEFORE_DISPLAY_TOOLTIP: number = environment.timeBeforeDisplayTooltip; formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition(); @@ -236,7 +236,7 @@ export class PreservationSpaceOrganizationalUnitFormPresentational extends Abstr isFilterable: false, }, { - field: this.KEY_DEFAULT, + field: this._KEY_DEFAULT, header: LabelTranslateEnum.defaultValue, type: DataTableFieldTypeEnum.boolean, order: OrderEnum.none, @@ -254,7 +254,7 @@ export class PreservationSpaceOrganizationalUnitFormPresentational extends Abstr isFilterable: false, }, { - field: this.KEY_DEFAULT, + field: this._KEY_DEFAULT, header: LabelTranslateEnum.defaultValue, type: DataTableFieldTypeEnum.boolean, order: OrderEnum.none, @@ -280,7 +280,7 @@ export class PreservationSpaceOrganizationalUnitFormPresentational extends Abstr isFilterable: false, }, { - field: this.KEY_DEFAULT, + field: this._KEY_DEFAULT, header: LabelTranslateEnum.defaultValue, type: DataTableFieldTypeEnum.boolean, order: OrderEnum.none, @@ -309,7 +309,7 @@ export class PreservationSpaceOrganizationalUnitFormPresentational extends Abstr ngOnInit(): void { if (this.isTour) { - this.bindFormTo({ + this._bindFormTo({ name: "Tour organizational unit", }); return; @@ -317,7 +317,7 @@ export class PreservationSpaceOrganizationalUnitFormPresentational extends Abstr super.ngOnInit(); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.name]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.description]: ["", [SolidifyValidator]], @@ -332,7 +332,7 @@ export class PreservationSpaceOrganizationalUnitFormPresentational extends Abstr }); } - protected bindFormTo(organizationalUnit: OrganizationalUnit): void { + protected _bindFormTo(organizationalUnit: OrganizationalUnit): void { this.form = this._fb.group({ [this.formDefinition.name]: [organizationalUnit.name, [Validators.required, SolidifyValidator]], [this.formDefinition.description]: [organizationalUnit.description, [SolidifyValidator]], @@ -374,7 +374,7 @@ export class PreservationSpaceOrganizationalUnitFormPresentational extends Abstr } } - protected treatmentBeforeSubmit(organizationalUnit: OrganizationalUnit): OrganizationalUnit { + protected _treatmentBeforeSubmit(organizationalUnit: OrganizationalUnit): OrganizationalUnit { delete organizationalUnit[this.formDefinition.filterResearchDomains]; organizationalUnit.openingDate = DateUtil.convertToLocalDateDateSimple(organizationalUnit.openingDate); organizationalUnit.closingDate = DateUtil.convertToLocalDateDateSimple(organizationalUnit.closingDate); @@ -407,7 +407,7 @@ export class PreservationSpaceOrganizationalUnitFormPresentational extends Abstr return list; } const defaultItem = {...list[defaultItemIndex]}; - defaultItem[this.KEY_DEFAULT] = true; + defaultItem[this._KEY_DEFAULT] = true; list[defaultItemIndex] = defaultItem; return list; } @@ -442,10 +442,10 @@ export class PreservationSpaceOrganizationalUnitFormPresentational extends Abstr private _computeExtraSearchParameterCategory(value: string): void { if (isNullOrUndefined(value) || isEmptyString(value)) { - MappingObjectUtil.delete(this.extraSearchParameterSource, this.KEY_SOURCE as string); + MappingObjectUtil.delete(this.extraSearchParameterSource, this._KEY_SOURCE as string); return; } - MappingObjectUtil.set(this.extraSearchParameterSource, this.KEY_SOURCE as string, value); + MappingObjectUtil.set(this.extraSearchParameterSource, this._KEY_SOURCE as string, value); } } diff --git a/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-archive-acl-create/preservation-space-organizational-unit-archive-acl-create.routable.ts b/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-archive-acl-create/preservation-space-organizational-unit-archive-acl-create.routable.ts index 471f45850..e08713e15 100644 --- a/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-archive-acl-create/preservation-space-organizational-unit-archive-acl-create.routable.ts +++ b/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-archive-acl-create/preservation-space-organizational-unit-archive-acl-create.routable.ts @@ -76,11 +76,11 @@ export class PreservationSpaceOrganizationalUnitArchiveAclCreateRoutable extends } ngOnInit(): void { - this.retrieveResIdFromUrl(); + this._retrieveResIdFromUrl(); this.urlQueryParameters = UrlQueryParamHelper.getQueryParamMappingObject(); } - protected retrieveResIdFromUrl(): void { + protected _retrieveResIdFromUrl(): void { this.orgUnitId = this._route.snapshot.parent.parent.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); } @@ -99,6 +99,6 @@ export class PreservationSpaceOrganizationalUnitArchiveAclCreateRoutable extends this._store.dispatch(new Navigate([RoutesEnum.preservationSpaceOrganizationalUnitDetail, this.orgUnitId, PreservationSpaceOrganizationalUnitRoutesEnum.manageAcl])); } - protected override cleanState(): void { + protected override _cleanState(): void { } } diff --git a/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-archive-acl-detail-edit/preservation-space-organizational-unit-archive-acl-detail-edit.routable.ts b/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-archive-acl-detail-edit/preservation-space-organizational-unit-archive-acl-detail-edit.routable.ts index 6fdf92637..463fe60f0 100644 --- a/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-archive-acl-detail-edit/preservation-space-organizational-unit-archive-acl-detail-edit.routable.ts +++ b/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-archive-acl-detail-edit/preservation-space-organizational-unit-archive-acl-detail-edit.routable.ts @@ -82,24 +82,24 @@ export class PreservationSpaceOrganizationalUnitArchiveAclDetailEditRoutable ext readonly KEY_PARAM_NAME: keyof ArchiveACL & string = "aipId"; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.preservationSpace_organizationalUnit_archiveAcl, _injector, preservationSpaceOrganizationalUnitArchiveAclActionNameSpace as any, StateEnum.preservationSpace_organizationalUnit); } ngOnInit(): void { - this.retrieveResIdFromUrl(); + this._retrieveResIdFromUrl(); super.ngOnInit(); } - protected getSubResourceWithParentId(id: string): void { + protected _getSubResourceWithParentId(id: string): void { } - protected retrieveResIdFromUrl(): void { + protected _retrieveResIdFromUrl(): void { this._resId = this._route.snapshot.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); this.orgUnitId = this._route.snapshot.parent.parent.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); } @@ -125,7 +125,7 @@ export class PreservationSpaceOrganizationalUnitArchiveAclDetailEditRoutable ext }); } - protected override cleanState(): void { + protected override _cleanState(): void { } override backToList(): void { diff --git a/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-archive-acl-list/preservation-space-organizational-unit-archive-acl-list.routable.ts b/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-archive-acl-list/preservation-space-organizational-unit-archive-acl-list.routable.ts index 58858ae32..8bf6da855 100644 --- a/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-archive-acl-list/preservation-space-organizational-unit-archive-acl-list.routable.ts +++ b/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-archive-acl-list/preservation-space-organizational-unit-archive-acl-list.routable.ts @@ -166,7 +166,7 @@ export class PreservationSpaceOrganizationalUnitArchiveAclListRoutable extends A ngOnInit(): void { super.ngOnInit(); - this.retrieveResIdFromUrl(); + this._retrieveResIdFromUrl(); this._store.dispatch(new PreservationSpaceOrganizationalUnitAction.GetById(this._orgUnitId)); this.extraQueryParameters = {[PARAM_QUERY_ORGUNIT]: this._orgUnitId}; @@ -212,7 +212,7 @@ export class PreservationSpaceOrganizationalUnitArchiveAclListRoutable extends A ]; } - protected retrieveResIdFromUrl(): void { + protected _retrieveResIdFromUrl(): void { this._orgUnitId = this._route.snapshot.parent.parent.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); } diff --git a/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-detail-edit/preservation-space-organizational-unit-detail-edit.routable.ts b/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-detail-edit/preservation-space-organizational-unit-detail-edit.routable.ts index 87f808a37..3a10dcdbd 100644 --- a/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-detail-edit/preservation-space-organizational-unit-detail-edit.routable.ts +++ b/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-detail-edit/preservation-space-organizational-unit-detail-edit.routable.ts @@ -124,12 +124,12 @@ export class PreservationSpaceOrganizationalUnitDetailEditRoutable extends Abstr @ViewChild(RouterOutlet) outlet: RouterOutlet; - constructor(protected _store: Store, - protected _route: ActivatedRoute, + constructor(protected readonly _store: Store, + protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, protected readonly _securityService: SecurityService, - public _dialog: MatDialog, + public readonly _dialog: MatDialog, protected readonly _injector: Injector, private readonly _scrollService: ScrollService) { super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.preservationSpace_organizationalUnit, _injector, preservationSpaceOrganizationalUnitActionNameSpace, StateEnum.preservationSpace); @@ -159,7 +159,7 @@ export class PreservationSpaceOrganizationalUnitDetailEditRoutable extends Abstr )); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { if (this._securityService.isManagerOfOrgUnit(id)) { this._store.dispatch(new PreservationSpaceOrganizationalUnitSubmissionPolicyAction.GetAll(id)); this._store.dispatch(new PreservationSpaceOrganizationalUnitPreservationPolicyAction.GetAll(id)); diff --git a/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-list/preservation-space-organizational-unit-list.routable.ts b/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-list/preservation-space-organizational-unit-list.routable.ts index 90f73492d..b0020d996 100644 --- a/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-list/preservation-space-organizational-unit-list.routable.ts +++ b/src/app/features/preservation-space/organizational-unit/components/routables/organizational-unit-list/preservation-space-organizational-unit-list.routable.ts @@ -91,7 +91,7 @@ export class PreservationSpaceOrganizationalUnitListRoutable extends AbstractLis preservationSpaceOrganizationalUnitState: typeof PreservationSpaceOrganizationalUnitState = PreservationSpaceOrganizationalUnitState; - protected onlyMyOrgUnits: boolean = false; + protected _onlyMyOrgUnits: boolean = false; override stickyTopPosition: number = 0; @@ -133,18 +133,18 @@ export class PreservationSpaceOrganizationalUnitListRoutable extends AbstractLis if (checked) { //show only authorized org units this._store.dispatch(new PreservationSpaceOrganizationalUnitAction.LoadOnlyMyOrgUnits()); - this.onlyMyOrgUnits = true; + this._onlyMyOrgUnits = true; } else { // all org units this._store.dispatch(new PreservationSpaceOrganizationalUnitAction.GetAll()); - this.onlyMyOrgUnits = false; + this._onlyMyOrgUnits = false; } this.defineColumns(); this._changeDetector.detectChanges(); } override onQueryParametersEvent(queryParameters: QueryParameters): void { - if (this.onlyMyOrgUnits) { + if (this._onlyMyOrgUnits) { this._store.dispatch(new PreservationSpaceOrganizationalUnitAction.LoadOnlyMyOrgUnits(queryParameters)); } else { this._store.dispatch(new PreservationSpaceOrganizationalUnitAction.ChangeQueryParameters(queryParameters, true)); @@ -173,7 +173,7 @@ export class PreservationSpaceOrganizationalUnitListRoutable extends AbstractLis })); } - protected defineActions(): DataTableActions<OrganizationalUnit>[] { + protected _defineActions(): DataTableActions<OrganizationalUnit>[] { return [ { logo: IconNameEnum.edit, @@ -239,8 +239,8 @@ export class PreservationSpaceOrganizationalUnitListRoutable extends AbstractLis header: LabelTranslateEnum.nameLabel, type: DataTableFieldTypeEnum.string, order: OrderEnum.ascending, - isFilterable: !this.onlyMyOrgUnits, - isSortable: !this.onlyMyOrgUnits, + isFilterable: !this._onlyMyOrgUnits, + isSortable: !this._onlyMyOrgUnits, dataTest: DataTestEnum.preservationSpaceOrgUnitListSearchName, }, { @@ -249,7 +249,7 @@ export class PreservationSpaceOrganizationalUnitListRoutable extends AbstractLis type: DataTableFieldTypeEnum.date, order: OrderEnum.none, isFilterable: false, - isSortable: !this.onlyMyOrgUnits, + isSortable: !this._onlyMyOrgUnits, }, { field: "closingDate" as any, @@ -257,7 +257,7 @@ export class PreservationSpaceOrganizationalUnitListRoutable extends AbstractLis type: DataTableFieldTypeEnum.date, order: OrderEnum.none, isFilterable: false, - isSortable: !this.onlyMyOrgUnits, + isSortable: !this._onlyMyOrgUnits, }, { field: "resId", diff --git a/src/app/features/preservation-space/organizational-unit/stores/archive-acl/preservation-space-organizational-unit-archive-acl.state.ts b/src/app/features/preservation-space/organizational-unit/stores/archive-acl/preservation-space-organizational-unit-archive-acl.state.ts index 7905ac709..405e30137 100644 --- a/src/app/features/preservation-space/organizational-unit/stores/archive-acl/preservation-space-organizational-unit-archive-acl.state.ts +++ b/src/app/features/preservation-space/organizational-unit/stores/archive-acl/preservation-space-organizational-unit-archive-acl.state.ts @@ -55,11 +55,11 @@ export interface PreservationSpaceOrganizationalUnitArchiveAclStateModel extends children: [], }) export class PreservationSpaceOrganizationalUnitArchiveAclState extends ResourceState<PreservationSpaceOrganizationalUnitArchiveAclStateModel, ArchiveACL> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationSpaceOrganizationalUnitArchiveAclActionNameSpace, notificationResourceCreateSuccessTextToTranslate: MARK_AS_TRANSLATABLE("admin.archive-acl.notification.resource.create"), notificationResourceDeleteSuccessTextToTranslate: MARK_AS_TRANSLATABLE("admin.archive-acl.notification.resource.delete"), diff --git a/src/app/features/preservation-space/organizational-unit/stores/dissemination-policy/preservation-space-organizational-unit-dissemination-policy.state.ts b/src/app/features/preservation-space/organizational-unit/stores/dissemination-policy/preservation-space-organizational-unit-dissemination-policy.state.ts index abbda90d0..2ced3deb8 100644 --- a/src/app/features/preservation-space/organizational-unit/stores/dissemination-policy/preservation-space-organizational-unit-dissemination-policy.state.ts +++ b/src/app/features/preservation-space/organizational-unit/stores/dissemination-policy/preservation-space-organizational-unit-dissemination-policy.state.ts @@ -73,11 +73,11 @@ export interface PreservationSpaceOrganizationalUnitDisseminationPolicyStateMode }, }) export class PreservationSpaceOrganizationalUnitDisseminationPolicyState extends Relation2TiersState<PreservationSpaceOrganizationalUnitDisseminationPolicyStateModel, DisseminationPolicy, OrganizationalUnitDisseminationPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationSpaceOrganizationalUnitDisseminationPolicyActionNameSpace, resourceName: ApiResourceNameEnum.DISSEMINATION_POLICY, }); @@ -90,14 +90,14 @@ export class PreservationSpaceOrganizationalUnitDisseminationPolicyState extends @OverrideDefaultAction() @Action(PreservationSpaceOrganizationalUnitDisseminationPolicyAction.Update) update(ctx: StateContext<PreservationSpaceOrganizationalUnitDisseminationPolicyStateModel>, action: PreservationSpaceOrganizationalUnitDisseminationPolicyAction.Update): Observable<boolean> { - return super.internalUpdate(ctx, action) + return super._internalUpdate(ctx, action) .pipe( tap((isSuccess: boolean) => { if (!isSuccess) { ctx.dispatch(new PreservationSpaceOrganizationalUnitDisseminationPolicyAction.UpdateFail(action, action.parentId)); return; } - this.updateSubResource(action, ctx) + this._updateSubResource(action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new PreservationSpaceOrganizationalUnitDisseminationPolicyAction.UpdateSuccess(action, action.parentId)); @@ -109,7 +109,7 @@ export class PreservationSpaceOrganizationalUnitDisseminationPolicyState extends ); } - private updateSubResource(action: PreservationSpaceOrganizationalUnitDisseminationPolicyAction.Update, ctx: StateContext<PreservationSpaceOrganizationalUnitDisseminationPolicyStateModel>): Observable<boolean> { + private _updateSubResource(action: PreservationSpaceOrganizationalUnitDisseminationPolicyAction.Update, ctx: StateContext<PreservationSpaceOrganizationalUnitDisseminationPolicyStateModel>): Observable<boolean> { const orgUnitId = action.parentId; const listActionSubActionCompletionsWrapper: ActionSubActionCompletionsWrapper[] = []; @@ -118,14 +118,14 @@ export class PreservationSpaceOrganizationalUnitDisseminationPolicyState extends if (isNotNullNorUndefined(action.oldDefaultResId) && action.newResId.includes(action.oldDefaultResId)) { listActionSubActionCompletionsWrapper.push({ action: new PreservationSpaceOrganizationalUnitDisseminationPolicyAction.UpdateRelation(orgUnitId, action.oldDefaultResId, {defaultPolicy: false} as OrganizationalUnitDisseminationPolicy), - subActionCompletions: this.getSubActionCompletions(), + subActionCompletions: this._getSubActionCompletions(), }); } if (isNotNullNorUndefined(action.newDefaultResId)) { listActionSubActionCompletionsWrapper.push({ action: new PreservationSpaceOrganizationalUnitDisseminationPolicyAction.UpdateRelation(orgUnitId, action.newDefaultResId, {defaultPolicy: true} as OrganizationalUnitDisseminationPolicy), - subActionCompletions: this.getSubActionCompletions(), + subActionCompletions: this._getSubActionCompletions(), }); } } @@ -137,10 +137,10 @@ export class PreservationSpaceOrganizationalUnitDisseminationPolicyState extends ); } - private getSubActionCompletions(): Observable<ActionCompletion<BaseSubAction<PreservationSpaceOrganizationalUnitDisseminationPolicyAction.UpdateRelation>, Error>>[] | undefined { + private _getSubActionCompletions(): Observable<ActionCompletion<BaseSubAction<PreservationSpaceOrganizationalUnitDisseminationPolicyAction.UpdateRelation>, Error>>[] | undefined { return [ - this.actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitDisseminationPolicyAction.UpdateRelationSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitDisseminationPolicyAction.UpdateRelationFail)), + this._actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitDisseminationPolicyAction.UpdateRelationSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitDisseminationPolicyAction.UpdateRelationFail)), ]; } } diff --git a/src/app/features/preservation-space/organizational-unit/stores/institution/preservation-space-organizational-unit-institution.state.ts b/src/app/features/preservation-space/organizational-unit/stores/institution/preservation-space-organizational-unit-institution.state.ts index d2166399c..03822560b 100644 --- a/src/app/features/preservation-space/organizational-unit/stores/institution/preservation-space-organizational-unit-institution.state.ts +++ b/src/app/features/preservation-space/organizational-unit/stores/institution/preservation-space-organizational-unit-institution.state.ts @@ -51,11 +51,11 @@ export interface PreservationSpaceOrganizationalUnitInstitutionStateModel extend }, }) export class PreservationSpaceOrganizationalUnitInstitutionState extends AssociationState<PreservationSpaceOrganizationalUnitInstitutionStateModel, Institution> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationSpaceOrganizationalUnitInstitutionNamespace, resourceName: ApiResourceNameEnum.INSTITUTION, }); diff --git a/src/app/features/preservation-space/organizational-unit/stores/person-role/preservation-space-organizational-unit-person-role.state.ts b/src/app/features/preservation-space/organizational-unit/stores/person-role/preservation-space-organizational-unit-person-role.state.ts index 482decacc..dde130974 100644 --- a/src/app/features/preservation-space/organizational-unit/stores/person-role/preservation-space-organizational-unit-person-role.state.ts +++ b/src/app/features/preservation-space/organizational-unit/stores/person-role/preservation-space-organizational-unit-person-role.state.ts @@ -58,11 +58,11 @@ export interface PreservationSpaceOrganizationalUnitPersonRoleStateModel extends }) // OrganizationalUnitPersonController export class PreservationSpaceOrganizationalUnitPersonRoleState extends Relation3TiersState<PreservationSpaceOrganizationalUnitPersonRoleStateModel, PersonRole, OrganizationalUnitPersonRole> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationSpaceOrganizationalUnitPersonRoleActionNameSpace, resourceName: ApiResourceNameEnum.PERSON, }); @@ -72,7 +72,7 @@ export class PreservationSpaceOrganizationalUnitPersonRoleState extends Relation return ApiEnum.adminOrganizationalUnits; } - protected convertResourceInForm(resource: PersonRole): Relation3TiersForm { + protected _convertResourceInForm(resource: PersonRole): Relation3TiersForm { return {id: resource.resId, listId: resource.roles.map(r => r.resId)}; } } diff --git a/src/app/features/preservation-space/organizational-unit/stores/preservation-policy/preservation-space-organizational-unit-preservation-policy.state.ts b/src/app/features/preservation-space/organizational-unit/stores/preservation-policy/preservation-space-organizational-unit-preservation-policy.state.ts index 69edfadf1..aff546b5e 100644 --- a/src/app/features/preservation-space/organizational-unit/stores/preservation-policy/preservation-space-organizational-unit-preservation-policy.state.ts +++ b/src/app/features/preservation-space/organizational-unit/stores/preservation-policy/preservation-space-organizational-unit-preservation-policy.state.ts @@ -73,11 +73,11 @@ export interface PreservationSpaceOrganizationalUnitPreservationPolicyStateModel }, }) export class PreservationSpaceOrganizationalUnitPreservationPolicyState extends Relation2TiersState<PreservationSpaceOrganizationalUnitPreservationPolicyStateModel, PreservationPolicy, OrganizationalUnitPreservationPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationSpaceOrganizationalUnitPreservationPolicyActionNameSpace, resourceName: ApiResourceNameEnum.PRES_POLICY, }); @@ -90,14 +90,14 @@ export class PreservationSpaceOrganizationalUnitPreservationPolicyState extends @OverrideDefaultAction() @Action(PreservationSpaceOrganizationalUnitPreservationPolicyAction.Update) update(ctx: StateContext<PreservationSpaceOrganizationalUnitPreservationPolicyStateModel>, action: PreservationSpaceOrganizationalUnitPreservationPolicyAction.Update): Observable<boolean> { - return super.internalUpdate(ctx, action) + return super._internalUpdate(ctx, action) .pipe( tap((isSuccess: boolean) => { if (!isSuccess) { ctx.dispatch(new PreservationSpaceOrganizationalUnitPreservationPolicyAction.UpdateFail(action, action.parentId)); return; } - this.updateSubResource(action, ctx) + this._updateSubResource(action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new PreservationSpaceOrganizationalUnitPreservationPolicyAction.UpdateSuccess(action, action.parentId)); @@ -109,7 +109,7 @@ export class PreservationSpaceOrganizationalUnitPreservationPolicyState extends ); } - private updateSubResource(action: PreservationSpaceOrganizationalUnitPreservationPolicyAction.Update, ctx: StateContext<PreservationSpaceOrganizationalUnitPreservationPolicyStateModel>): Observable<boolean> { + private _updateSubResource(action: PreservationSpaceOrganizationalUnitPreservationPolicyAction.Update, ctx: StateContext<PreservationSpaceOrganizationalUnitPreservationPolicyStateModel>): Observable<boolean> { const orgUnitId = action.parentId; const listActionSubActionCompletionsWrapper: ActionSubActionCompletionsWrapper[] = []; @@ -118,14 +118,14 @@ export class PreservationSpaceOrganizationalUnitPreservationPolicyState extends if (isNotNullNorUndefined(action.oldDefaultResId) && action.newResId.includes(action.oldDefaultResId)) { listActionSubActionCompletionsWrapper.push({ action: new PreservationSpaceOrganizationalUnitPreservationPolicyAction.UpdateRelation(orgUnitId, action.oldDefaultResId, {defaultPolicy: false} as OrganizationalUnitPreservationPolicy), - subActionCompletions: this.getSubActionCompletions(), + subActionCompletions: this._getSubActionCompletions(), }); } if (isNotNullNorUndefined(action.newDefaultResId)) { listActionSubActionCompletionsWrapper.push({ action: new PreservationSpaceOrganizationalUnitPreservationPolicyAction.UpdateRelation(orgUnitId, action.newDefaultResId, {defaultPolicy: true} as OrganizationalUnitPreservationPolicy), - subActionCompletions: this.getSubActionCompletions(), + subActionCompletions: this._getSubActionCompletions(), }); } } @@ -137,10 +137,10 @@ export class PreservationSpaceOrganizationalUnitPreservationPolicyState extends ); } - private getSubActionCompletions(): Observable<ActionCompletion<BaseSubAction<PreservationSpaceOrganizationalUnitPreservationPolicyAction.UpdateRelation>, Error>>[] | undefined { + private _getSubActionCompletions(): Observable<ActionCompletion<BaseSubAction<PreservationSpaceOrganizationalUnitPreservationPolicyAction.UpdateRelation>, Error>>[] | undefined { return [ - this.actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitPreservationPolicyAction.UpdateRelationSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitPreservationPolicyAction.UpdateRelationFail)), + this._actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitPreservationPolicyAction.UpdateRelationSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitPreservationPolicyAction.UpdateRelationFail)), ]; } } diff --git a/src/app/features/preservation-space/organizational-unit/stores/preservation-space-organizational-unit.state.ts b/src/app/features/preservation-space/organizational-unit/stores/preservation-space-organizational-unit.state.ts index ebc87a612..acd969c80 100644 --- a/src/app/features/preservation-space/organizational-unit/stores/preservation-space-organizational-unit.state.ts +++ b/src/app/features/preservation-space/organizational-unit/stores/preservation-space-organizational-unit.state.ts @@ -142,14 +142,14 @@ export interface PreservationSpaceOrganizationalUnitStateModel extends ResourceL }) export class PreservationSpaceOrganizationalUnitState extends ResourceLogoState<PreservationSpaceOrganizationalUnitStateModel, OrganizationalUnit> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - protected errorsSkipperService: ErrorsSkipperService, - private _securityService: SecurityService, + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + protected readonly _errorsSkipperService: ErrorsSkipperService, + private readonly _securityService: SecurityService, protected readonly _httpClient: HttpClient) { - super(apiService, store, notificationService, actions$, { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationSpaceOrganizationalUnitActionNameSpace, routeRedirectUrlAfterSuccessCreateAction: (resId: string) => RoutesEnum.preservationSpaceOrganizationalUnitDetail + urlSeparator + resId, routeRedirectUrlAfterSuccessUpdateAction: (resId: string) => RoutesEnum.preservationSpaceOrganizationalUnitDetail + urlSeparator + resId, @@ -164,10 +164,10 @@ export class PreservationSpaceOrganizationalUnitState extends ResourceLogoState< protected get _urlResource(): string { const accessResourceApiEnum = ApiEnum.accessOrganizationalUnits; const adminResourceApiEnum = ApiEnum.adminOrganizationalUnits; - if (isNullOrUndefined(this.store)) { + if (isNullOrUndefined(this._store)) { return accessResourceApiEnum; } - const organizationalUnit = MemoizedUtil.currentSnapshot(this.store, PreservationSpaceOrganizationalUnitState); + const organizationalUnit = MemoizedUtil.currentSnapshot(this._store, PreservationSpaceOrganizationalUnitState); return this._securityService.isManagerOfOrgUnit(organizationalUnit?.resId) ? adminResourceApiEnum : accessResourceApiEnum; } @@ -244,8 +244,8 @@ export class PreservationSpaceOrganizationalUnitState extends ResourceLogoState< { action: new SharedRoleAction.GetAll(undefined, false, false), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedRoleAction.GetAllFail)), ], }, ]).pipe( @@ -294,17 +294,17 @@ export class PreservationSpaceOrganizationalUnitState extends ResourceLogoState< ctx.dispatch(new PreservationSpaceOrganizationalUnitAction.SaveCurrentUserIsManager(action.isManager)); if (isTrue(action.isManager)) { const orgUnitId = ctx.getState().current.resId; - this.store.dispatch(new PreservationSpaceOrganizationalUnitPersonRoleAction.GetAll(orgUnitId)); + this._store.dispatch(new PreservationSpaceOrganizationalUnitPersonRoleAction.GetAll(orgUnitId)); } } @OverrideDefaultAction() @Action(PreservationSpaceOrganizationalUnitAction.Create) create(ctx: StateContext<PreservationSpaceOrganizationalUnitStateModel>, action: PreservationSpaceOrganizationalUnitAction.Create): Observable<OrganizationalUnit> { - return super.internalCreate(ctx, action) + return super._internalCreate(ctx, action) .pipe( tap(model => { - this.updateSubResource(model, action, ctx) + this._updateSubResource(model, action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new PreservationSpaceOrganizationalUnitAction.CreateSuccess(action, model)); @@ -319,10 +319,10 @@ export class PreservationSpaceOrganizationalUnitState extends ResourceLogoState< @OverrideDefaultAction() @Action(PreservationSpaceOrganizationalUnitAction.Update) update(ctx: StateContext<PreservationSpaceOrganizationalUnitStateModel>, action: PreservationSpaceOrganizationalUnitAction.Update): Observable<OrganizationalUnit> { - return super.internalUpdate(ctx, action) + return super._internalUpdate(ctx, action) .pipe( tap(model => { - this.updateSubResource(model, action, ctx) + this._updateSubResource(model, action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new PreservationSpaceOrganizationalUnitAction.UpdateSuccess(action, model)); @@ -341,7 +341,7 @@ export class PreservationSpaceOrganizationalUnitState extends ResourceLogoState< queryParameters: StoreUtil.getQueryParametersToApply(action.queryParameters, ctx), }); - return this.apiService.get<OrganizationalUnit>(ApiEnum.adminAuthorizedOrganizationalUnits, ctx.getState().queryParameters) + return this._apiService.get<OrganizationalUnit>(ApiEnum.adminAuthorizedOrganizationalUnits, ctx.getState().queryParameters) .pipe( tap((collection: CollectionTyped<OrganizationalUnit>) => { ctx.dispatch(new PreservationSpaceOrganizationalUnitAction.LoadOnlyMyOrgUnitsSuccess(action, collection)); @@ -372,7 +372,7 @@ export class PreservationSpaceOrganizationalUnitState extends ResourceLogoState< }); } - private updateSubResource(model: OrganizationalUnit, action: PreservationSpaceOrganizationalUnitAction.Create | PreservationSpaceOrganizationalUnitAction.Update, ctx: StateContext<PreservationSpaceOrganizationalUnitStateModel>): Observable<boolean> { + private _updateSubResource(model: OrganizationalUnit, action: PreservationSpaceOrganizationalUnitAction.Create | PreservationSpaceOrganizationalUnitAction.Update, ctx: StateContext<PreservationSpaceOrganizationalUnitStateModel>): Observable<boolean> { const orgUnitId = model.resId; const newPersonRole = action.modelFormControlEvent.formControl.get("personRole").value as Relation3TiersForm[]; newPersonRole.forEach((elem) => { @@ -387,15 +387,15 @@ export class PreservationSpaceOrganizationalUnitState extends ResourceLogoState< { action: new PreservationSpaceOrganizationalUnitPersonRoleAction.Update(orgUnitId, newPersonRole), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitPersonRoleAction.UpdateSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitPersonRoleAction.UpdateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitPersonRoleAction.UpdateSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitPersonRoleAction.UpdateFail)), ], }, { action: new PreservationSpaceOrganizationalUnitInstitutionAction.Update(orgUnitId, newInstitutionsIds), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitInstitutionAction.UpdateSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitInstitutionAction.UpdateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitInstitutionAction.UpdateSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitInstitutionAction.UpdateFail)), ], }, ]).pipe( diff --git a/src/app/features/preservation-space/organizational-unit/stores/submission-policy/preservation-space-organizational-unit-submission-policy.state.ts b/src/app/features/preservation-space/organizational-unit/stores/submission-policy/preservation-space-organizational-unit-submission-policy.state.ts index 5d62aac91..61efd2a3b 100644 --- a/src/app/features/preservation-space/organizational-unit/stores/submission-policy/preservation-space-organizational-unit-submission-policy.state.ts +++ b/src/app/features/preservation-space/organizational-unit/stores/submission-policy/preservation-space-organizational-unit-submission-policy.state.ts @@ -73,11 +73,11 @@ export interface PreservationSpaceOrganizationalUnitSubmissionPolicyStateModel e }, }) export class PreservationSpaceOrganizationalUnitSubmissionPolicyState extends Relation2TiersState<PreservationSpaceOrganizationalUnitSubmissionPolicyStateModel, SubmissionPolicy, OrganizationalUnitSubmissionPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: preservationSpaceOrganizationalUnitSubmissionPolicyActionNameSpace, resourceName: ApiResourceNameEnum.SUB_POLICY, }); @@ -90,14 +90,14 @@ export class PreservationSpaceOrganizationalUnitSubmissionPolicyState extends Re @OverrideDefaultAction() @Action(PreservationSpaceOrganizationalUnitSubmissionPolicyAction.Update) update(ctx: StateContext<PreservationSpaceOrganizationalUnitSubmissionPolicyStateModel>, action: PreservationSpaceOrganizationalUnitSubmissionPolicyAction.Update): Observable<boolean> { - return super.internalUpdate(ctx, action) + return super._internalUpdate(ctx, action) .pipe( tap((isSuccess: boolean) => { if (!isSuccess) { ctx.dispatch(new PreservationSpaceOrganizationalUnitSubmissionPolicyAction.UpdateFail(action, action.parentId)); return; } - this.updateSubResource(action, ctx) + this._updateSubResource(action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new PreservationSpaceOrganizationalUnitSubmissionPolicyAction.UpdateSuccess(action, action.parentId)); @@ -109,7 +109,7 @@ export class PreservationSpaceOrganizationalUnitSubmissionPolicyState extends Re ); } - private updateSubResource(action: PreservationSpaceOrganizationalUnitSubmissionPolicyAction.Update, ctx: StateContext<PreservationSpaceOrganizationalUnitSubmissionPolicyStateModel>): Observable<boolean> { + private _updateSubResource(action: PreservationSpaceOrganizationalUnitSubmissionPolicyAction.Update, ctx: StateContext<PreservationSpaceOrganizationalUnitSubmissionPolicyStateModel>): Observable<boolean> { const orgUnitId = action.parentId; const listActionSubActionCompletionsWrapper: ActionSubActionCompletionsWrapper[] = []; @@ -118,14 +118,14 @@ export class PreservationSpaceOrganizationalUnitSubmissionPolicyState extends Re if (isNotNullNorUndefined(action.oldDefaultResId) && action.newResId.includes(action.oldDefaultResId)) { listActionSubActionCompletionsWrapper.push({ action: new PreservationSpaceOrganizationalUnitSubmissionPolicyAction.UpdateRelation(orgUnitId, action.oldDefaultResId, {defaultPolicy: false} as OrganizationalUnitSubmissionPolicy), - subActionCompletions: this.getSubActionCompletions(), + subActionCompletions: this._getSubActionCompletions(), }); } if (isNotNullNorUndefined(action.newDefaultResId)) { listActionSubActionCompletionsWrapper.push({ action: new PreservationSpaceOrganizationalUnitSubmissionPolicyAction.UpdateRelation(orgUnitId, action.newDefaultResId, {defaultPolicy: true} as OrganizationalUnitSubmissionPolicy), - subActionCompletions: this.getSubActionCompletions(), + subActionCompletions: this._getSubActionCompletions(), }); } } @@ -137,10 +137,10 @@ export class PreservationSpaceOrganizationalUnitSubmissionPolicyState extends Re ); } - private getSubActionCompletions(): Observable<ActionCompletion<BaseSubAction<PreservationSpaceOrganizationalUnitSubmissionPolicyAction.UpdateRelation>, Error>>[] | undefined { + private _getSubActionCompletions(): Observable<ActionCompletion<BaseSubAction<PreservationSpaceOrganizationalUnitSubmissionPolicyAction.UpdateRelation>, Error>>[] | undefined { return [ - this.actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitSubmissionPolicyAction.UpdateRelationSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitSubmissionPolicyAction.UpdateRelationFail)), + this._actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitSubmissionPolicyAction.UpdateRelationSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(PreservationSpaceOrganizationalUnitSubmissionPolicyAction.UpdateRelationFail)), ]; } } diff --git a/src/app/features/preservation-space/stores/preservation-space.state.ts b/src/app/features/preservation-space/stores/preservation-space.state.ts index 091982277..c953bd595 100644 --- a/src/app/features/preservation-space/stores/preservation-space.state.ts +++ b/src/app/features/preservation-space/stores/preservation-space.state.ts @@ -66,6 +66,6 @@ export interface PreservationSpaceStateModel extends BaseStateModel { ], }) export class PreservationSpaceState { - constructor(protected store: Store) { + constructor(protected readonly _store: Store) { } } diff --git a/src/app/in-memory.storage.ts b/src/app/in-memory.storage.ts index cd84943c7..6fcdc40a7 100644 --- a/src/app/in-memory.storage.ts +++ b/src/app/in-memory.storage.ts @@ -24,27 +24,27 @@ import {isNullOrUndefined} from "solidify-frontend"; export class InMemoryStorage implements Storage { - private storage: Map<string, string> = new Map<string, string>(); + private _storage: Map<string, string> = new Map<string, string>(); - readonly length: number = isNullOrUndefined(this.storage) ? 0 : this.storage.size; + readonly length: number = isNullOrUndefined(this._storage) ? 0 : this._storage.size; clear(): void { - this.storage.clear(); + this._storage.clear(); } getItem(key: string): string | null { - return this.storage.get(key); + return this._storage.get(key); } key(index: number): string | null { - return this.storage[index]; + return this._storage[index]; } removeItem(key: string): void { - this.storage.delete(key); + this._storage.delete(key); } setItem(key: string, value: string): void { - this.storage.set(key, value); + this._storage.set(key, value); } } diff --git a/src/app/shared/components/containers/shared-archive-name/shared-archive-name.container.ts b/src/app/shared/components/containers/shared-archive-name/shared-archive-name.container.ts index 65595e512..76a10343f 100644 --- a/src/app/shared/components/containers/shared-archive-name/shared-archive-name.container.ts +++ b/src/app/shared/components/containers/shared-archive-name/shared-archive-name.container.ts @@ -68,15 +68,15 @@ export class SharedArchiveNameContainer extends SharedAbstractContainer { return; } const listSnapshot = MemoizedUtil.listSnapshot(this._store, SharedArchiveState); - const archive = this.getArchive(listSnapshot); + const archive = this._getArchive(listSnapshot); if (isNullOrUndefined(archive)) { this.name = StringUtil.stringEmpty; this.subscribe(this.listArchiveObs.pipe( distinctUntilChanged(), - filter(list => isNotNullNorUndefined(this.getArchive(list))), + filter(list => isNotNullNorUndefined(this._getArchive(list))), take(1), ), list => { - this.name = this.getArchive(list)?.title; + this.name = this._getArchive(list)?.title; this.isLoading = false; this._changeDetector.detectChanges(); }); @@ -96,7 +96,7 @@ export class SharedArchiveNameContainer extends SharedAbstractContainer { super(); } - private getArchive(list: Archive[]): Archive { + private _getArchive(list: Archive[]): Archive { if (isNullOrUndefined(list)) { return undefined; } diff --git a/src/app/shared/components/containers/shared-avatar-upload-wrapper/shared-avatar-upload-wrapper.container.ts b/src/app/shared/components/containers/shared-avatar-upload-wrapper/shared-avatar-upload-wrapper.container.ts index 6d452420b..9953bdb0b 100644 --- a/src/app/shared/components/containers/shared-avatar-upload-wrapper/shared-avatar-upload-wrapper.container.ts +++ b/src/app/shared/components/containers/shared-avatar-upload-wrapper/shared-avatar-upload-wrapper.container.ts @@ -101,7 +101,7 @@ export class SharedAvatarUploadWrapperContainer extends SharedAbstractImageUploa ngOnInit(): void { super.ngOnInit(); - this.getUserPhoto(); + this._getUserPhoto(); } override openModal(): void { @@ -122,7 +122,7 @@ export class SharedAvatarUploadWrapperContainer extends SharedAbstractImageUploa }; } - private getUserPhoto(): void { + private _getUserPhoto(): void { if (this.isAvatarMissing) { return; } @@ -149,13 +149,13 @@ export class SharedAvatarUploadWrapperContainer extends SharedAbstractImageUploa override fileChangeEvent(event: any): void { if (this.resourceLogoNameSpace === adminUserActionNameSpace && this.userInfo.externalUid === MemoizedUtil.selectSnapshot(this._store, AppUserState, state => state.current.externalUid)) { // need to refresh user profile - this.dispatchFileEventAndRefreshProfile(event); + this._dispatchFileEventAndRefreshProfile(event); } else { super.fileChangeEvent(event); } } - private dispatchFileEventAndRefreshProfile(event: any): void { + private _dispatchFileEventAndRefreshProfile(event: any): void { if (isNullOrUndefined(event.target.value) || isEmptyString(event.target.value)) { return; } diff --git a/src/app/shared/components/containers/shared-file-and-aip-information/shared-file-and-aip-information.container.ts b/src/app/shared/components/containers/shared-file-and-aip-information/shared-file-and-aip-information.container.ts index 2e7b6a341..f5c93f57b 100644 --- a/src/app/shared/components/containers/shared-file-and-aip-information/shared-file-and-aip-information.container.ts +++ b/src/app/shared/components/containers/shared-file-and-aip-information/shared-file-and-aip-information.container.ts @@ -99,12 +99,12 @@ export class SharedFileAndAipInformationContainer<TResource extends BaseResource previewAvailable: boolean; visualizationErrorMessage: string; - private readonly LOGO_SIP: string = "SIP"; - private readonly LOGO_AIP: string = "AIP"; - private readonly LOGO_DIP: string = "DIP"; - private readonly FILENAME_SIP_PACKAGE: string = "sip-package"; - private readonly FILENAME_AIP_PACKAGE: string = "aip-package"; - private readonly FILENAME_DOWNLOAD: string = "download"; + private readonly _LOGO_SIP: string = "SIP"; + private readonly _LOGO_AIP: string = "AIP"; + private readonly _LOGO_DIP: string = "DIP"; + private readonly _FILENAME_SIP_PACKAGE: string = "sip-package"; + private readonly _FILENAME_AIP_PACKAGE: string = "aip-package"; + private readonly _FILENAME_DOWNLOAD: string = "download"; private readonly _fullScreenBS: BehaviorSubject<boolean | undefined> = new BehaviorSubject<boolean | undefined>(undefined); readonly fullScreenObs: Observable<boolean | undefined> = ObservableUtil.asObservable(this._fullScreenBS); @@ -386,16 +386,16 @@ export class SharedFileAndAipInformationContainer<TResource extends BaseResource const mode = this.data.mode; switch (mode) { case SharedFileAndAipDetailDialogModeEnum.aip: - return this.LOGO_AIP; + return this._LOGO_AIP; case SharedFileAndAipDetailDialogModeEnum.file: const fileName = (this.getData() as DataFile)?.fileName; - if (fileName === this.FILENAME_SIP_PACKAGE) { - return this.LOGO_SIP; + if (fileName === this._FILENAME_SIP_PACKAGE) { + return this._LOGO_SIP; } - if (fileName === this.FILENAME_AIP_PACKAGE || fileName === this.FILENAME_DOWNLOAD) { - return this.LOGO_AIP; + if (fileName === this._FILENAME_AIP_PACKAGE || fileName === this._FILENAME_DOWNLOAD) { + return this._LOGO_AIP; } - return this.LOGO_DIP; + return this._LOGO_DIP; default: return "?"; } diff --git a/src/app/shared/components/containers/shared-logo-wrapper/shared-logo-wrapper.container.ts b/src/app/shared/components/containers/shared-logo-wrapper/shared-logo-wrapper.container.ts index 0629f9a10..f34feec38 100644 --- a/src/app/shared/components/containers/shared-logo-wrapper/shared-logo-wrapper.container.ts +++ b/src/app/shared/components/containers/shared-logo-wrapper/shared-logo-wrapper.container.ts @@ -129,19 +129,19 @@ export class SharedLogoWrapperContainer<TResource extends BaseResource> extends this.photo = undefined; this.isLoading = true; this.listPhotosObs = MemoizedUtil.select(this._store, this.logoState, (state: ResourceLogoStateModel<TResource>) => state.listLogo); - this.getLogo(); + this._getLogo(); } } - protected getLogo(): void { + protected _getLogo(): void { this._store.dispatch(new this.logoNamespace.GetPhotoByResId(this._idResource)); const listPhotos = this._store.selectSnapshot((state: ResourceLogoStateModel<TResource>) => state.listLogo); - const photo = this.getPhoto(listPhotos); + const photo = this._getPhoto(listPhotos); if (isNullOrUndefined(photo)) { this.subscribe(this.listPhotosObs.pipe( distinctUntilChanged(), - filter(list => isNotNullNorUndefined(this.getPhoto(list))), + filter(list => isNotNullNorUndefined(this._getPhoto(list))), takeWhile((list) => this.isLoading === true), tap((list) => { this.photo = MappingObjectUtil.get(MemoizedUtil.selectSnapshot(this._store, this.logoState, (state: ResourceLogoStateModel<TResource>) => state.listLogo), this._idResource); @@ -161,7 +161,7 @@ export class SharedLogoWrapperContainer<TResource extends BaseResource> extends } } - protected getPhoto(list: MappingObject<string>): string | undefined { + protected _getPhoto(list: MappingObject<string>): string | undefined { if (isNullOrUndefined(list)) { return undefined; } diff --git a/src/app/shared/components/containers/shared-organizational-unit-member/shared-organizational-unit-member.container.ts b/src/app/shared/components/containers/shared-organizational-unit-member/shared-organizational-unit-member.container.ts index e42ea00c9..fea727fe8 100644 --- a/src/app/shared/components/containers/shared-organizational-unit-member/shared-organizational-unit-member.container.ts +++ b/src/app/shared/components/containers/shared-organizational-unit-member/shared-organizational-unit-member.container.ts @@ -49,14 +49,14 @@ export class SharedOrganizationalUnitMemberContainer extends SharedAbstractPrese @Input() set organizationalUnit(value: OrganizationalUnit) { this._organizationalUnit = value; - this.computeLogoAndTootlip(); + this._computeLogoAndTooltip(); } get organizationalUnit(): OrganizationalUnit { return this._organizationalUnit; } - private computeLogoAndTootlip(): void { + private _computeLogoAndTooltip(): void { if (isNullOrUndefined(this.organizationalUnit)) { return; } @@ -84,7 +84,7 @@ export class SharedOrganizationalUnitMemberContainer extends SharedAbstractPrese } } - constructor(public _securityService: SecurityService) { + constructor(public readonly _securityService: SecurityService) { super(); } } diff --git a/src/app/shared/components/containers/shared-organizational-unit-name/shared-organizational-unit-name.container.ts b/src/app/shared/components/containers/shared-organizational-unit-name/shared-organizational-unit-name.container.ts index b9e6ac6bb..08f39c60b 100644 --- a/src/app/shared/components/containers/shared-organizational-unit-name/shared-organizational-unit-name.container.ts +++ b/src/app/shared/components/containers/shared-organizational-unit-name/shared-organizational-unit-name.container.ts @@ -69,15 +69,15 @@ export class SharedOrganizationalUnitNameContainer extends SharedAbstractContain return; } const listSnapshot = MemoizedUtil.listSnapshot(this._store, SharedOrganizationalUnitState); - const orgUnit = this.getOrgUnit(listSnapshot); + const orgUnit = this._getOrgUnit(listSnapshot); if (isNullOrUndefined(orgUnit)) { this.name = StringUtil.stringEmpty; this.subscribe(this.listOrgUnitObs.pipe( distinctUntilChanged(), - filter(list => isNotNullNorUndefined(this.getOrgUnit(list))), + filter(list => isNotNullNorUndefined(this._getOrgUnit(list))), take(1), ), list => { - this.name = this.getOrgUnit(list)?.name; + this.name = this._getOrgUnit(list)?.name; this.isLoading = false; this._changeDetector.detectChanges(); }); @@ -100,7 +100,7 @@ export class SharedOrganizationalUnitNameContainer extends SharedAbstractContain super(); } - private getOrgUnit(list: OrganizationalUnit[]): OrganizationalUnit { + private _getOrgUnit(list: OrganizationalUnit[]): OrganizationalUnit { if (isNullOrUndefined(list)) { return undefined; } diff --git a/src/app/shared/components/containers/shared-table-orgunit/shared-table-orgunit.container.ts b/src/app/shared/components/containers/shared-table-orgunit/shared-table-orgunit.container.ts index 7b2cad1dc..1f04dc60f 100644 --- a/src/app/shared/components/containers/shared-table-orgunit/shared-table-orgunit.container.ts +++ b/src/app/shared/components/containers/shared-table-orgunit/shared-table-orgunit.container.ts @@ -124,7 +124,7 @@ export class SharedTableOrgunitContainer extends SharedAbstractContainer impleme @Input() set readonly(value: boolean) { this._readonly = value; - this.updateFormReadonlyState(); + this._updateFormReadonlyState(); } get readonly(): boolean { @@ -147,8 +147,8 @@ export class SharedTableOrgunitContainer extends SharedAbstractContainer impleme return formControl.get(key); } - constructor(private translate: TranslateService, - private store: Store, + constructor(private readonly _translate: TranslateService, + private readonly _store: Store, private readonly _fb: FormBuilder, private readonly _changeDetector: ChangeDetectorRef, private readonly _elementRef: ElementRef) { @@ -168,7 +168,7 @@ export class SharedTableOrgunitContainer extends SharedAbstractContainer impleme setDisabledState?(isDisabled: boolean): void { } - private markAsTouched(value: OrgUnitModel[]): void { + private _markAsTouched(value: OrgUnitModel[]): void { this.propagateChange(value); this._valueBS.next(value); this.formControl.markAllAsTouched(); @@ -185,14 +185,14 @@ export class SharedTableOrgunitContainer extends SharedAbstractContainer impleme }); } - this.updateFormReadonlyState(); + this._updateFormReadonlyState(); this.formControl.setValue(this.formArray.value); const valueBefore: OrgUnitModel[] = this.formArray.value; this.subscribe(this.formArray.valueChanges.pipe( tap((value: OrgUnitModel[]) => { if (valueBefore.length !== value.length) { - this.markAsTouched(value); + this._markAsTouched(value); return; } @@ -202,7 +202,7 @@ export class SharedTableOrgunitContainer extends SharedAbstractContainer impleme return; } if (valBefore.id !== value[index].id) { - this.markAsTouched(value); + this._markAsTouched(value); isDiff = true; return; } @@ -225,7 +225,7 @@ export class SharedTableOrgunitContainer extends SharedAbstractContainer impleme )); } - private updateFormReadonlyState(): void { + private _updateFormReadonlyState(): void { if (isNullOrUndefined(this.formArray) || isNullOrUndefined(this.formControl)) { return; } diff --git a/src/app/shared/components/containers/shared-table-person-orgunit-role/shared-table-person-orgunit-role.container.ts b/src/app/shared/components/containers/shared-table-person-orgunit-role/shared-table-person-orgunit-role.container.ts index 79a2eb709..24d118f3b 100644 --- a/src/app/shared/components/containers/shared-table-person-orgunit-role/shared-table-person-orgunit-role.container.ts +++ b/src/app/shared/components/containers/shared-table-person-orgunit-role/shared-table-person-orgunit-role.container.ts @@ -67,7 +67,6 @@ import { DataTableColumns, DataTableFieldTypeEnum, FormValidationHelper, - isEmptyArray, isNullOrUndefined, isUndefined, MARK_AS_TRANSLATABLE, @@ -192,7 +191,7 @@ export class SharedTablePersonOrgunitRoleContainer extends SharedAbstractContain @Input() set readonly(value: boolean) { this._readonly = value; - this.updateFormReadonlyState(); + this._updateFormReadonlyState(); } get readonly(): boolean { @@ -224,15 +223,15 @@ export class SharedTablePersonOrgunitRoleContainer extends SharedAbstractContain return isNullOrUndefined(errors) ? false : errors.required; } - constructor(private translate: TranslateService, - private store: Store, + constructor(private readonly _translate: TranslateService, + private readonly _store: Store, private readonly _fb: FormBuilder, private readonly _changeDetector: ChangeDetectorRef, private readonly _elementRef: ElementRef) { super(); } - private markAsTouched(value: Model[]): void { + private _markAsTouched(value: Model[]): void { this.propagateChange(value); this._valueBS.next(value); this.formControl.markAllAsTouched(); @@ -250,14 +249,14 @@ export class SharedTablePersonOrgunitRoleContainer extends SharedAbstractContain }); } - this.updateFormReadonlyState(); + this._updateFormReadonlyState(); this.formControl.setValue(this.formArray.value); const valueBefore: Model[] = this.formArray.value; this.subscribe(this.formArray.valueChanges.pipe( tap((value: Model[]) => { if (valueBefore.length !== value.length) { - this.markAsTouched(value); + this._markAsTouched(value); return; } @@ -267,7 +266,7 @@ export class SharedTablePersonOrgunitRoleContainer extends SharedAbstractContain return; } if (valBefore.id !== value[index].id || valBefore.listId !== value[index].listId) { - this.markAsTouched(value); + this._markAsTouched(value); isDiff = true; return; } @@ -290,7 +289,7 @@ export class SharedTablePersonOrgunitRoleContainer extends SharedAbstractContain )); } - private updateFormReadonlyState(): void { + private _updateFormReadonlyState(): void { if (isNullOrUndefined(this.formArray) || isNullOrUndefined(this.formControl)) { return; } @@ -313,7 +312,7 @@ export class SharedTablePersonOrgunitRoleContainer extends SharedAbstractContain }); } else { // We transform here list of roles into unique role because we hide the multiples roles to the final user - const listId = person.roles.length > 0 ? this.getMostImportantRole(person.roles.map(r => r.resId) as Enums.Role.RoleEnum[]) : ""; + const listId = person.roles.length > 0 ? this._getMostImportantRole(person.roles.map(r => r.resId) as Enums.Role.RoleEnum[]) : ""; const form = this._fb.group({ [this.formDefinition.id]: [person.resId, [Validators.required]], [this.formDefinition.listId]: [listId, [Validators.required]], @@ -347,14 +346,6 @@ export class SharedTablePersonOrgunitRoleContainer extends SharedAbstractContain this.formArray.removeAt(index); } - private filter(listPersonOrOrgUnit: OrganizationalUnit[], formControl: AbstractControl): any { - if (isNullOrUndefined(listPersonOrOrgUnit) || isEmptyArray(listPersonOrOrgUnit)) { - return listPersonOrOrgUnit; - } - const personOrOrgUnitAlreadySelected = this.formArray.controls.map(c => c.get(this.formDefinition.id).value); - return listPersonOrOrgUnit.filter(p => p.resId === formControl.value || !personOrOrgUnitAlreadySelected.includes(p.resId)); - } - propagateChange: (__: any) => void = (__: any): void => {}; registerOnChange(fn: any): void { @@ -382,7 +373,7 @@ export class SharedTablePersonOrgunitRoleContainer extends SharedAbstractContain } } - private getMostImportantRole(listRoles: Enums.Role.RoleEnum[]): Enums.Role.RoleEnum | string { + private _getMostImportantRole(listRoles: Enums.Role.RoleEnum[]): Enums.Role.RoleEnum | string { if (listRoles.length === 0) { return ""; } diff --git a/src/app/shared/components/dialogs/shared-abstract-create-edit/shared-abstract-create-edit.dialog.ts b/src/app/shared/components/dialogs/shared-abstract-create-edit/shared-abstract-create-edit.dialog.ts index f5a9c2b8b..e450e1fd4 100644 --- a/src/app/shared/components/dialogs/shared-abstract-create-edit/shared-abstract-create-edit.dialog.ts +++ b/src/app/shared/components/dialogs/shared-abstract-create-edit/shared-abstract-create-edit.dialog.ts @@ -88,13 +88,13 @@ export abstract class SharedAbstractCreateEditDialog<TResourceModel extends Base } get isCreateMode(): boolean { - return isNullOrUndefined(this.data.current); + return isNullOrUndefined(this._data.current); } @ViewChild("formPresentational") readonly formPresentational: AbstractFormPresentational<any>; - protected constructor(@Inject(MAT_DIALOG_DATA) protected readonly data: CreateEditDialog<TResourceModel>, + protected constructor(@Inject(MAT_DIALOG_DATA) protected readonly _data: CreateEditDialog<TResourceModel>, protected readonly _store: Store, protected readonly _route: ActivatedRoute, protected readonly _actions$: Actions, @@ -110,10 +110,10 @@ export abstract class SharedAbstractCreateEditDialog<TResourceModel extends Base ngOnInit(): void { super.ngOnInit(); - this.current = this.data.current; - this.retrieveResource(); + this.current = this._data.current; + this._retrieveResource(); if (!isNullOrUndefined(this.current)) { - this.getSubResourceWithParentId(this.current.resId); + this._getSubResourceWithParentId(this.current.resId); } } @@ -121,15 +121,15 @@ export abstract class SharedAbstractCreateEditDialog<TResourceModel extends Base super.ngOnDestroy(); } - protected retrieveResource(): void { + protected _retrieveResource(): void { this._store.dispatch(ResourceActionHelper.loadResource(this._resourceNameSpace)); } - protected cleanState(): void { + protected _cleanState(): void { this._store.dispatch(ResourceActionHelper.clean(this._resourceNameSpace, false, new QueryParameters())); } - protected abstract getSubResourceWithParentId(id: string): void; + protected abstract _getSubResourceWithParentId(id: string): void; update(model: ModelFormControlEvent<TResourceModel>): Observable<any> { super.saveInProgress(); @@ -148,7 +148,7 @@ export abstract class SharedAbstractCreateEditDialog<TResourceModel extends Base this.subscribe(this._actions$.pipe( ofSolidifyActionCompleted(this._resourceNameSpace.UpdateSuccess), tap((result) => { - this.closeDialogIfSuccess(result); + this._closeDialogIfSuccess(result); }), )); } @@ -157,13 +157,13 @@ export abstract class SharedAbstractCreateEditDialog<TResourceModel extends Base this.subscribe(this._actions$.pipe( ofSolidifyActionCompleted(this._resourceNameSpace.CreateSuccess), tap((result) => { - this.closeDialogIfSuccess(result); + this._closeDialogIfSuccess(result); }), )); } } - private closeDialogIfSuccess(result: ActionCompletion<boolean>): void { + private _closeDialogIfSuccess(result: ActionCompletion<boolean>): void { if (isTrue(result.result.successful)) { this.submit(); } diff --git a/src/app/shared/components/dialogs/shared-upload-image/shared-upload-image.dialog.ts b/src/app/shared/components/dialogs/shared-upload-image/shared-upload-image.dialog.ts index 001410c82..e17676546 100644 --- a/src/app/shared/components/dialogs/shared-upload-image/shared-upload-image.dialog.ts +++ b/src/app/shared/components/dialogs/shared-upload-image/shared-upload-image.dialog.ts @@ -56,7 +56,7 @@ export class SharedUploadImageDialog extends SharedAbstractDialog<SharedUploadIm protected readonly _dialogRef: MatDialogRef<SharedUploadImageDialog>, private readonly _actions$: Actions, private readonly _notificationService: NotificationService, - @Inject(MAT_DIALOG_DATA) public data: SharedUploadImageDialogData) { + @Inject(MAT_DIALOG_DATA) public readonly data: SharedUploadImageDialogData) { super(_dialogRef, data); } diff --git a/src/app/shared/components/presentationals/shared-admin-research-domain-label/shared-admin-research-domain-label.presentational.ts b/src/app/shared/components/presentationals/shared-admin-research-domain-label/shared-admin-research-domain-label.presentational.ts index ace459e8f..bccfb390a 100644 --- a/src/app/shared/components/presentationals/shared-admin-research-domain-label/shared-admin-research-domain-label.presentational.ts +++ b/src/app/shared/components/presentationals/shared-admin-research-domain-label/shared-admin-research-domain-label.presentational.ts @@ -47,7 +47,7 @@ export class SharedAdminResearchDomainLabelPresentational extends SharedAbstract @Input() set researchDomain(value: ResearchDomain) { this._researchDomain = value; - this.computeLabel(); + this._computeLabel(); } get researchDomain(): ResearchDomain { @@ -57,7 +57,7 @@ export class SharedAdminResearchDomainLabelPresentational extends SharedAbstract @Input() set language(value: string) { this._language = value; - this.computeLabel(); + this._computeLabel(); } get language(): string { @@ -66,14 +66,14 @@ export class SharedAdminResearchDomainLabelPresentational extends SharedAbstract value: ResearchDomainLabel | undefined; - private computeLabel(): void { + private _computeLabel(): void { if (isNullOrUndefined(this.language) || isNullOrUndefined(this.researchDomain)) { return; } this.value = this.researchDomain.labels.find(label => label.language.resId === this.language); } - constructor(public _fb: FormBuilder) { + constructor(public readonly _fb: FormBuilder) { super(); } } diff --git a/src/app/shared/components/presentationals/shared-aip-status-name/shared-aip-status-name.presentational.ts b/src/app/shared/components/presentationals/shared-aip-status-name/shared-aip-status-name.presentational.ts index 2bf750377..c033f2084 100644 --- a/src/app/shared/components/presentationals/shared-aip-status-name/shared-aip-status-name.presentational.ts +++ b/src/app/shared/components/presentationals/shared-aip-status-name/shared-aip-status-name.presentational.ts @@ -45,7 +45,7 @@ export class SharedAipStatusNamePresentational extends SharedAbstractPresentatio @Input() set aipCopyList(value: AipCopyList) { this._aipCopyList = value; - this.computeName(); + this._computeName(); } get aipCopyList(): AipCopyList { @@ -54,7 +54,7 @@ export class SharedAipStatusNamePresentational extends SharedAbstractPresentatio name: string | undefined; - private computeName(): void { + private _computeName(): void { if (isNullOrUndefined(this.aipCopyList) || isEmptyArray(this.aipCopyList)) { this.name = undefined; return; diff --git a/src/app/shared/components/presentationals/shared-aip-status-orgunit-name/shared-aip-status-orgunit-name.presentational.ts b/src/app/shared/components/presentationals/shared-aip-status-orgunit-name/shared-aip-status-orgunit-name.presentational.ts index 043dea9dd..efa32fdf2 100644 --- a/src/app/shared/components/presentationals/shared-aip-status-orgunit-name/shared-aip-status-orgunit-name.presentational.ts +++ b/src/app/shared/components/presentationals/shared-aip-status-orgunit-name/shared-aip-status-orgunit-name.presentational.ts @@ -45,7 +45,7 @@ export class SharedAipStatusOrgunitNamePresentational extends SharedAbstractPres @Input() set aipCopyList(value: AipCopyList) { this._aipCopyList = value; - this.computeOrgUnitId(); + this._computeOrgUnitId(); } get aipCopyList(): AipCopyList { @@ -54,7 +54,7 @@ export class SharedAipStatusOrgunitNamePresentational extends SharedAbstractPres orgUnitId: string | undefined; - private computeOrgUnitId(): void { + private _computeOrgUnitId(): void { if (isNullOrUndefined(this.aipCopyList) || isEmptyArray(this.aipCopyList)) { this.orgUnitId = undefined; return; diff --git a/src/app/shared/components/presentationals/shared-aip-status-summary/shared-aip-status-summary.presentational.ts b/src/app/shared/components/presentationals/shared-aip-status-summary/shared-aip-status-summary.presentational.ts index 41fc149e0..9c7ee20b5 100644 --- a/src/app/shared/components/presentationals/shared-aip-status-summary/shared-aip-status-summary.presentational.ts +++ b/src/app/shared/components/presentationals/shared-aip-status-summary/shared-aip-status-summary.presentational.ts @@ -73,7 +73,7 @@ export class SharedAipStatusSummaryPresentational extends SharedAbstractPresenta aipCopySorted: AipCopy[] = []; - private readonly PATH_TO_AIP_STORAGION: string = urlSeparator + AppRoutesEnum.preservationPlanning + urlSeparator + PreservationPlanningRoutesEnum.aip + urlSeparator; + private readonly _PATH_TO_AIP_STORAGION: string = urlSeparator + AppRoutesEnum.preservationPlanning + urlSeparator + PreservationPlanningRoutesEnum.aip + urlSeparator; get packageStatusEnum(): typeof Enums.Package.StatusEnum { return Enums.Package.StatusEnum; @@ -112,6 +112,6 @@ export class SharedAipStatusSummaryPresentational extends SharedAbstractPresenta return undefined; } - return this.PATH_TO_AIP_STORAGION + this.getStoragionNumber(aipCopy) + urlSeparator + SharedAipRoutesEnum.aipDetail + urlSeparator + aipCopy.aip.resId; + return this._PATH_TO_AIP_STORAGION + this.getStoragionNumber(aipCopy) + urlSeparator + SharedAipRoutesEnum.aipDetail + urlSeparator + aipCopy.aip.resId; } } diff --git a/src/app/shared/components/presentationals/shared-avatar/shared-avatar.presentational.ts b/src/app/shared/components/presentationals/shared-avatar/shared-avatar.presentational.ts index b4e0ed65b..3ad5f4009 100644 --- a/src/app/shared/components/presentationals/shared-avatar/shared-avatar.presentational.ts +++ b/src/app/shared/components/presentationals/shared-avatar/shared-avatar.presentational.ts @@ -77,9 +77,9 @@ export class SharedAvatarPresentational extends SharedAbstractPresentational { @HostBinding("class.is-large") large: boolean = false; - private readonly DEFAULT_INITIAL: string = ""; + private readonly _DEFAULT_INITIAL: string = ""; - initial: string = this.DEFAULT_INITIAL; + initial: string = this._DEFAULT_INITIAL; constructor(private readonly _sanitizer: DomSanitizer) { super(); @@ -87,7 +87,7 @@ export class SharedAvatarPresentational extends SharedAbstractPresentational { computeInitial(): void { if (isNullOrUndefined(this._userInfo)) { - this.initial = this.DEFAULT_INITIAL; + this.initial = this._DEFAULT_INITIAL; } else { const firstNameInitial = isNotNullNorUndefinedNorWhiteString(this._userInfo.firstName) ? this._userInfo.firstName.substring(0, 1) : ""; const lastNameInitial = isNotNullNorUndefinedNorWhiteString(this._userInfo.lastName) ? this._userInfo.lastName.substring(0, 1) : ""; diff --git a/src/app/shared/components/presentationals/shared-datafile-quick-status/shared-datafile-quick-status.presentational.ts b/src/app/shared/components/presentationals/shared-datafile-quick-status/shared-datafile-quick-status.presentational.ts index d795c1a12..0013c64c6 100644 --- a/src/app/shared/components/presentationals/shared-datafile-quick-status/shared-datafile-quick-status.presentational.ts +++ b/src/app/shared/components/presentationals/shared-datafile-quick-status/shared-datafile-quick-status.presentational.ts @@ -41,11 +41,11 @@ import {DialogUtil} from "solidify-frontend"; }) export class SharedDatafileQuickStatusPresentational extends SharedAbstractPresentational { - private readonly CLASS_READY: string = "ready"; - private readonly CLASS_ERROR: string = "error"; - private readonly CLASS_WARNING: string = "warning"; - private readonly CLASS_CLEANED: string = "cleaned"; - private readonly CLASS_CAN_SEE_DETAIL: string = "can-see-detail"; + private readonly _CLASS_READY: string = "ready"; + private readonly _CLASS_ERROR: string = "error"; + private readonly _CLASS_WARNING: string = "warning"; + private readonly _CLASS_CLEANED: string = "cleaned"; + private readonly _CLASS_CAN_SEE_DETAIL: string = "can-see-detail"; readonly CLASS_PENDING: string = "pending"; @@ -83,15 +83,15 @@ export class SharedDatafileQuickStatusPresentational extends SharedAbstractPrese getColor(): string { switch (this.value) { case Enums.DataFile.StatusEnum.READY: - return this.CLASS_READY; + return this._CLASS_READY; case Enums.DataFile.StatusEnum.IN_ERROR: - return this.CLASS_ERROR; + return this._CLASS_ERROR; case Enums.DataFile.StatusEnum.EXCLUDED_FILE: - return this.CLASS_ERROR + " " + this.CLASS_CAN_SEE_DETAIL; + return this._CLASS_ERROR + " " + this._CLASS_CAN_SEE_DETAIL; case Enums.DataFile.StatusEnum.IGNORED_FILE: - return this.CLASS_WARNING + " " + this.CLASS_CAN_SEE_DETAIL; + return this._CLASS_WARNING + " " + this._CLASS_CAN_SEE_DETAIL; case Enums.DataFile.StatusEnum.CLEANED: - return this.CLASS_CLEANED; + return this._CLASS_CLEANED; default: return this.CLASS_PENDING; } diff --git a/src/app/shared/components/presentationals/shared-doi-menu/shared-doi-menu.presentational.ts b/src/app/shared/components/presentationals/shared-doi-menu/shared-doi-menu.presentational.ts index 8fd930fa3..a66fbf647 100644 --- a/src/app/shared/components/presentationals/shared-doi-menu/shared-doi-menu.presentational.ts +++ b/src/app/shared/components/presentationals/shared-doi-menu/shared-doi-menu.presentational.ts @@ -62,7 +62,7 @@ export class SharedDoiMenuPresentational extends SharedAbstractPresentational { @Output("getShortDoi") readonly shortDoiObs: Observable<GetShortDoiWrapper | undefined> = ObservableUtil.asObservable(this._shortDoiBS); - constructor(private readonly notificationService: NotificationService) { + constructor(private readonly _notificationService: NotificationService) { super(); } @@ -75,7 +75,7 @@ export class SharedDoiMenuPresentational extends SharedAbstractPresentational { copyLongDoi(): void { ClipboardUtil.copyStringToClipboard(this.doi); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("doi.notification.longDoiCopyToClipboard")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("doi.notification.longDoiCopyToClipboard")); } copyUrlShortDoi(): void { @@ -87,7 +87,7 @@ export class SharedDoiMenuPresentational extends SharedAbstractPresentational { copyUrlLongDoi(): void { ClipboardUtil.copyStringToClipboard(environment.doiLink + this.doi); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("doi.notification.urlLongDoiCopyToClipboard")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("doi.notification.urlLongDoiCopyToClipboard")); } } diff --git a/src/app/shared/components/presentationals/shared-folder-tree/shared-folder-tree.presentational.ts b/src/app/shared/components/presentationals/shared-folder-tree/shared-folder-tree.presentational.ts index d07536f58..b0045aa5e 100644 --- a/src/app/shared/components/presentationals/shared-folder-tree/shared-folder-tree.presentational.ts +++ b/src/app/shared/components/presentationals/shared-folder-tree/shared-folder-tree.presentational.ts @@ -136,7 +136,7 @@ export class SharedFolderTreePresentational extends SharedAbstractPresentational set foldersWithIntermediateFolders(value: string[]) { this._foldersWithIntermediateFolders = value; if (this.isReady) { - this.setupFoldersWithIntermediateFolders(); + this._setupFoldersWithIntermediateFolders(); } else { this.triggerInitIfReady(); } @@ -146,18 +146,18 @@ export class SharedFolderTreePresentational extends SharedAbstractPresentational return this._foldersWithIntermediateFolders; } - private init(): void { - this.setupFoldersWithIntermediateFolders(); + private _init(): void { + this._setupFoldersWithIntermediateFolders(); } - private setupFoldersWithIntermediateFolders(): void { + private _setupFoldersWithIntermediateFolders(): void { this.saveExpandedNodes(); if (isNullOrUndefined(this._foldersWithIntermediateFolders)) { return; } const listFolders = [...this._foldersWithIntermediateFolders]; this.dataSource.data = listFolders; - this.expandFirstLevelTree(); + this._expandFirstLevelTree(); this.restoreExpandedNodes(); } @@ -180,11 +180,11 @@ export class SharedFolderTreePresentational extends SharedAbstractPresentational } private _transformer = (fullFolderName: string): FlatNode => ({ - expandable: this.existChild(fullFolderName), + expandable: this._existChild(fullFolderName), folderName: this.getFolderName(fullFolderName), fullFolderName: fullFolderName, level: this.getLevel(fullFolderName), - postCreation: this.isIntermediateFolderCreate(fullFolderName), + postCreation: this._isIntermediateFolderCreate(fullFolderName), }); treeFlattener: MatTreeFlattener<string, FlatNode>; @@ -212,7 +212,7 @@ export class SharedFolderTreePresentational extends SharedAbstractPresentational if (this.isReady === false) { if (isNotNullNorUndefined(this.treeControl) && isNotNullNorUndefined(this.treeFlattener) && isNotNullNorUndefined(this.dataSource) && isNotNullNorUndefined(this.intermediateFolders) && isNotNullNorUndefined(this.foldersWithIntermediateFolders)) { this.isReady = true; - this.init(); + this._init(); } } } @@ -222,23 +222,23 @@ export class SharedFolderTreePresentational extends SharedAbstractPresentational if (isNullOrUndefined(this.treeControl.dataNodes) || this.treeControl.dataNodes.length === 0) { return; } - this.expandFirstLevelTree(); + this._expandFirstLevelTree(); } - private expandFirstLevelTree(): void { + private _expandFirstLevelTree(): void { if (this.currentFolder !== this._ROOT) { const node = this.treeControl.dataNodes.find(d => d.fullFolderName === this.currentFolder); - this.expandRecursivelyParent(node); + this._expandRecursivelyParent(node); this.treeControl.expand(node); return; } - if (this.expandFirstLevelTree) { + if (this._expandFirstLevelTree) { const firstNode = this.treeControl.dataNodes[0]; this.treeControl.expand(firstNode); } } - private expandRecursivelyParent(node: FlatNode): void { + private _expandRecursivelyParent(node: FlatNode): void { if (isNullOrUndefined(node)) { return; } @@ -251,7 +251,7 @@ export class SharedFolderTreePresentational extends SharedAbstractPresentational } const parentNode = this.treeControl.dataNodes.find(d => d.fullFolderName === parentPath); this.treeControl.expand(parentNode); - this.expandRecursivelyParent(parentNode); + this._expandRecursivelyParent(parentNode); } expandAllOrCollapseAll(): void { @@ -291,7 +291,7 @@ export class SharedFolderTreePresentational extends SharedAbstractPresentational this._selectBS.next(node.fullFolderName); } - private existChild(currentFullFolderName: string): boolean { + private _existChild(currentFullFolderName: string): boolean { if (currentFullFolderName === this._ROOT) { return true; } @@ -299,7 +299,7 @@ export class SharedFolderTreePresentational extends SharedAbstractPresentational return !isNullOrUndefined(item); } - private isIntermediateFolderCreate(fullFolderName: string): boolean { + private _isIntermediateFolderCreate(fullFolderName: string): boolean { return isNullOrUndefined(this.intermediateFolders) || this.intermediateFolders.includes(fullFolderName); } diff --git a/src/app/shared/components/presentationals/shared-image/shared-avatar.presentational.ts b/src/app/shared/components/presentationals/shared-image/shared-avatar.presentational.ts index 19be50420..26d9e5ca2 100644 --- a/src/app/shared/components/presentationals/shared-image/shared-avatar.presentational.ts +++ b/src/app/shared/components/presentationals/shared-image/shared-avatar.presentational.ts @@ -70,9 +70,9 @@ export class SharedAvatarPresentational extends SharedAbstractPresentational { return this._photoUserSanitize; } - private readonly DEFAULT_INITIAL: string = ""; + private readonly _DEFAULT_INITIAL: string = ""; - initial: string = this.DEFAULT_INITIAL; + initial: string = this._DEFAULT_INITIAL; constructor(private readonly _sanitizer: DomSanitizer) { super(); @@ -80,7 +80,7 @@ export class SharedAvatarPresentational extends SharedAbstractPresentational { computeInitial(): void { if (isNullOrUndefined(this._user)) { - this.initial = this.DEFAULT_INITIAL; + this.initial = this._DEFAULT_INITIAL; } else { this.initial = this._user.firstName.substring(0, 1) + this._user.lastName.substring(0, 1); } diff --git a/src/app/shared/components/presentationals/shared-notification-form/shared-notification-form.presentational.ts b/src/app/shared/components/presentationals/shared-notification-form/shared-notification-form.presentational.ts index bcdda3d72..43192686a 100644 --- a/src/app/shared/components/presentationals/shared-notification-form/shared-notification-form.presentational.ts +++ b/src/app/shared/components/presentationals/shared-notification-form/shared-notification-form.presentational.ts @@ -128,7 +128,7 @@ export class SharedNotificationFormPresentational extends AbstractFormPresentati super(_changeDetectorRef, _elementRef, _injector); } - protected bindFormTo(notificationDlcm: NotificationDlcm): void { + protected _bindFormTo(notificationDlcm: NotificationDlcm): void { this.form = this._fb.group({ [this.formDefinition.notificationCategory]: [notificationDlcm.notificationType?.notificationCategory, [Validators.required, SolidifyValidator]], [this.formDefinition.notificationType]: [notificationDlcm.notificationType?.resId, [Validators.required, SolidifyValidator]], @@ -143,7 +143,7 @@ export class SharedNotificationFormPresentational extends AbstractFormPresentati }); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.notificationCategory]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.notificationType]: ["", [Validators.required, SolidifyValidator]], @@ -158,12 +158,12 @@ export class SharedNotificationFormPresentational extends AbstractFormPresentati }); } - protected treatmentBeforeSubmit(notificationDlcm: NotificationDlcm): NotificationDlcm { + protected _treatmentBeforeSubmit(notificationDlcm: NotificationDlcm): NotificationDlcm { delete notificationDlcm[this.formDefinition.emitterEmail]; return notificationDlcm; } - protected disableSpecificField(): void { + protected _disableSpecificField(): void { this.form.get(this.formDefinition.emitterEmail).disable(); } diff --git a/src/app/shared/components/presentationals/shared-person-form/shared-person-form.presentational.ts b/src/app/shared/components/presentationals/shared-person-form/shared-person-form.presentational.ts index 9a880a1dc..8b5682139 100644 --- a/src/app/shared/components/presentationals/shared-person-form/shared-person-form.presentational.ts +++ b/src/app/shared/components/presentationals/shared-person-form/shared-person-form.presentational.ts @@ -88,7 +88,7 @@ export class SharedPersonFormPresentational extends AbstractFormPresentational<P super(_changeDetectorRef, _elementRef, _injector); } - protected bindFormTo(person: Person): void { + protected _bindFormTo(person: Person): void { this.form = this._fb.group({ [this.formDefinition.firstName]: [person.firstName, [Validators.required, SolidifyValidator]], [this.formDefinition.lastName]: [person.lastName, [Validators.required, SolidifyValidator]], @@ -100,7 +100,7 @@ export class SharedPersonFormPresentational extends AbstractFormPresentational<P } } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({ [this.formDefinition.firstName]: ["", [Validators.required, SolidifyValidator]], [this.formDefinition.lastName]: ["", [Validators.required, SolidifyValidator]], @@ -112,7 +112,7 @@ export class SharedPersonFormPresentational extends AbstractFormPresentational<P } } - protected treatmentBeforeSubmit(person: Person): Person { + protected _treatmentBeforeSubmit(person: Person): Person { if (this.withNotification) { person.notificationTypes = []; const listNotificationTypes = this.form.get(this.formDefinition.notificationTypes).value; diff --git a/src/app/shared/components/presentationals/shared-preservation-duration/shared-preservation-duration.presentational.ts b/src/app/shared/components/presentationals/shared-preservation-duration/shared-preservation-duration.presentational.ts index 3aa61c26d..4bde820e6 100644 --- a/src/app/shared/components/presentationals/shared-preservation-duration/shared-preservation-duration.presentational.ts +++ b/src/app/shared/components/presentationals/shared-preservation-duration/shared-preservation-duration.presentational.ts @@ -70,8 +70,8 @@ export class SharedPreservationDurationPresentational extends SharedAbstractPres formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition(); listUnits: KeyValue[] = Enums.RetentionPolicy.RetentionPolicyEnumTranslate; - private readonly DAYS_BY_YEAR: number = 365; - private readonly YEARS_BY_CENTURY: number = 100; + private readonly _DAYS_BY_YEAR: number = 365; + private readonly _YEARS_BY_CENTURY: number = 100; @Input() formControl: FormControl; @@ -102,11 +102,11 @@ export class SharedPreservationDurationPresentational extends SharedAbstractPres }); } else { this.form = this._fb.group({ - [this.formDefinition.retention]: [this.adaptRetentionWithUnits(value), [Validators.required, SolidifyValidator]], - [this.formDefinition.retentionUnits]: [this.getUnitsFromRetention(value), [Validators.required, SolidifyValidator]], + [this.formDefinition.retention]: [this._adaptRetentionWithUnits(value), [Validators.required, SolidifyValidator]], + [this.formDefinition.retentionUnits]: [this._getUnitsFromRetention(value), [Validators.required, SolidifyValidator]], }); } - this.addValidators(); + this._addValidators(); this.subscribe(this.form.get(this.formDefinition.retention).valueChanges, v => { this.formControl.setValue(this.calculateRetention()); @@ -149,21 +149,21 @@ export class SharedPreservationDurationPresentational extends SharedAbstractPres case Enums.RetentionPolicy.RetentionPolicyEnum.days: return retention; case Enums.RetentionPolicy.RetentionPolicyEnum.years: - return retention * this.DAYS_BY_YEAR; + return retention * this._DAYS_BY_YEAR; case Enums.RetentionPolicy.RetentionPolicyEnum.centuries: - return retention * this.DAYS_BY_YEAR * this.YEARS_BY_CENTURY; + return retention * this._DAYS_BY_YEAR * this._YEARS_BY_CENTURY; default: return; } } - private getUnitsFromRetention(retention: number): string { + private _getUnitsFromRetention(retention: number): string { let unit: string; if (retention === 0) { unit = Enums.RetentionPolicy.RetentionPolicyEnum.forever; - } else if (retention < this.DAYS_BY_YEAR) { + } else if (retention < this._DAYS_BY_YEAR) { unit = Enums.RetentionPolicy.RetentionPolicyEnum.days; - } else if (retention < (this.DAYS_BY_YEAR * this.YEARS_BY_CENTURY)) { + } else if (retention < (this._DAYS_BY_YEAR * this._YEARS_BY_CENTURY)) { unit = Enums.RetentionPolicy.RetentionPolicyEnum.years; } else { unit = Enums.RetentionPolicy.RetentionPolicyEnum.centuries; @@ -171,37 +171,37 @@ export class SharedPreservationDurationPresentational extends SharedAbstractPres return unit; } - private adaptRetentionWithUnits(retention: number): number { + private _adaptRetentionWithUnits(retention: number): number { let newRetention: number; if (retention === 0) { newRetention = 0; - } else if (retention < this.DAYS_BY_YEAR) { + } else if (retention < this._DAYS_BY_YEAR) { return retention; - } else if (retention >= this.DAYS_BY_YEAR && retention < (this.DAYS_BY_YEAR * this.YEARS_BY_CENTURY)) { - newRetention = retention / this.DAYS_BY_YEAR; + } else if (retention >= this._DAYS_BY_YEAR && retention < (this._DAYS_BY_YEAR * this._YEARS_BY_CENTURY)) { + newRetention = retention / this._DAYS_BY_YEAR; } else { - newRetention = retention / (this.DAYS_BY_YEAR * this.YEARS_BY_CENTURY); + newRetention = retention / (this._DAYS_BY_YEAR * this._YEARS_BY_CENTURY); } return newRetention; } - private addValidators(): void { + private _addValidators(): void { const retentionUnitsFormControl = this.form.get(this.formDefinition.retentionUnits); this.subscribe(retentionUnitsFormControl.valueChanges.pipe( distinctUntilChanged(), tap(value => { - this.setValidator(value); + this._setValidator(value); }), )); - this.setValidator(retentionUnitsFormControl.value); + this._setValidator(retentionUnitsFormControl.value); } - private setValidator(value: Enums.RetentionPolicy.RetentionPolicyEnum): void { + private _setValidator(value: Enums.RetentionPolicy.RetentionPolicyEnum): void { const retentionFormControl = this.form.get(this.formDefinition.retention); if (value === Enums.RetentionPolicy.RetentionPolicyEnum.days) { - retentionFormControl.setValidators([Validators.min(1), Validators.max(this.DAYS_BY_YEAR)]); + retentionFormControl.setValidators([Validators.min(1), Validators.max(this._DAYS_BY_YEAR)]); } else if (value === Enums.RetentionPolicy.RetentionPolicyEnum.years) { - retentionFormControl.setValidators([Validators.min(1), Validators.max(this.YEARS_BY_CENTURY)]); + retentionFormControl.setValidators([Validators.min(1), Validators.max(this._YEARS_BY_CENTURY)]); } else if (value === Enums.RetentionPolicy.RetentionPolicyEnum.centuries) { retentionFormControl.setValidators([Validators.min(1)]); } else { diff --git a/src/app/shared/features/aip/components/presentationals/aip-form/shared-aip-form.presentational.ts b/src/app/shared/features/aip/components/presentationals/aip-form/shared-aip-form.presentational.ts index ece21bbe0..2659caa85 100644 --- a/src/app/shared/features/aip/components/presentationals/aip-form/shared-aip-form.presentational.ts +++ b/src/app/shared/features/aip/components/presentationals/aip-form/shared-aip-form.presentational.ts @@ -115,11 +115,11 @@ export class SharedAipFormPresentational extends AbstractFormPresentational<Aip> super(_changeDetectorRef, _elementRef, _injector); } - protected initNewForm(): void { + protected _initNewForm(): void { this.form = this._fb.group({}); } - protected bindFormTo(aip: Aip): void { + protected _bindFormTo(aip: Aip): void { this.form = this._fb.group({ [this.formDefinition.id]: [aip.resId, []], [this.formDefinition.organizationalUnitId]: [aip.info.organizationalUnitId, []], @@ -146,7 +146,7 @@ export class SharedAipFormPresentational extends AbstractFormPresentational<Aip> }); } - protected treatmentBeforeSubmit(aip: Aip): Aip { + protected _treatmentBeforeSubmit(aip: Aip): Aip { return aip; } diff --git a/src/app/shared/features/aip/components/routables/aip-collection/shared-aip-collection.routable.ts b/src/app/shared/features/aip/components/routables/aip-collection/shared-aip-collection.routable.ts index 4f307cb7e..99e175a3f 100644 --- a/src/app/shared/features/aip/components/routables/aip-collection/shared-aip-collection.routable.ts +++ b/src/app/shared/features/aip/components/routables/aip-collection/shared-aip-collection.routable.ts @@ -165,7 +165,7 @@ export class SharedAipCollectionRoutable extends AbstractDetailEditRoutable<Aip, this.actions = [ { logo: IconNameEnum.download, - callback: (aip: Aip) => this.downloadAipAip(this._resId, aip), + callback: (aip: Aip) => this._downloadAipAip(this._resId, aip), placeholder: current => LabelTranslateEnum.download, displayOnCondition: (aip: Aip) => this.mode !== AipMode.DOWNLOADED_AIP, }, @@ -181,19 +181,19 @@ export class SharedAipCollectionRoutable extends AbstractDetailEditRoutable<Aip, ngOnInit(): void { super.ngOnInit(); this.mode = AipHelper.determineMode(this._store); - this.getCurrentModelOnParent(); + this._getCurrentModelOnParent(); } - private getCurrentModelOnParent(): void { + private _getCurrentModelOnParent(): void { this._resId = this._route.snapshot.parent.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); - this.getAipById(this._resId); + this._getAipById(this._resId); } - private getAipById(id: string): void { - this.getSubResourceWithParentId(id); + private _getAipById(id: string): void { + this._getSubResourceWithParentId(id); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new SharedAipCollectionAction.GetAll(id, null, true)); } @@ -213,7 +213,7 @@ export class SharedAipCollectionRoutable extends AbstractDetailEditRoutable<Aip, this._store.dispatch(new Navigate([this._store.selectSnapshot((s: LocalStateModel) => s.router.state.url), aip.resId])); } - private downloadAipAip(parentId: string, aip: Aip): void { + private _downloadAipAip(parentId: string, aip: Aip): void { this._store.dispatch(new SharedAipCollectionAction.DownloadAip(parentId, aip)); } diff --git a/src/app/shared/features/aip/components/routables/aip-detail-edit/shared-aip-detail-edit.routable.ts b/src/app/shared/features/aip/components/routables/aip-detail-edit/shared-aip-detail-edit.routable.ts index 126bb8269..13fae5528 100644 --- a/src/app/shared/features/aip/components/routables/aip-detail-edit/shared-aip-detail-edit.routable.ts +++ b/src/app/shared/features/aip/components/routables/aip-detail-edit/shared-aip-detail-edit.routable.ts @@ -108,7 +108,7 @@ import { changeDetection: ChangeDetectionStrategy.OnPush, }) export class SharedAipDetailEditRoutable extends AbstractDetailEditCommonRoutable<Aip, SharedAipStateModel> implements OnInit { - private readonly STATUS_TO_STOP_POLLING_REFRESH_STATUS: Enums.Package.StatusEnum[] = [ + private readonly _STATUS_TO_STOP_POLLING_REFRESH_STATUS: Enums.Package.StatusEnum[] = [ Enums.Package.StatusEnum.IN_ERROR, Enums.Package.StatusEnum.COMPLETED, Enums.Package.StatusEnum.PRESERVATION_ERROR, @@ -141,11 +141,11 @@ export class SharedAipDetailEditRoutable extends AbstractDetailEditCommonRoutabl mode: AipMode; backButtonLabel: string; - private readonly KEY_ARCHIVAL_UNIT: keyof Aip = "archivalUnit"; + private readonly _KEY_ARCHIVAL_UNIT: keyof Aip = "archivalUnit"; - private currentTab: Tab; + private _currentTab: Tab; - private get rootUrl(): string[] { + private get _rootUrl(): string[] { switch (this.mode) { case AipMode.AIP: return [RoutesEnum.preservationPlanningAip, this.storagion_number + "", SharedAipRoutesEnum.aipDetail, this._resId]; @@ -163,14 +163,14 @@ export class SharedAipDetailEditRoutable extends AbstractDetailEditCommonRoutabl suffixUrl: SharedAipRoutesEnum.aipMetadata, icon: IconNameEnum.metadata, titleToTranslate: LabelTranslateEnum.metadata, - route: () => [...this.rootUrl, SharedAipRoutesEnum.aipMetadata], + route: () => [...this._rootUrl, SharedAipRoutesEnum.aipMetadata], }, { id: TabEnum.FILES, suffixUrl: SharedAipRoutesEnum.aipFiles, icon: IconNameEnum.files, titleToTranslate: LabelTranslateEnum.files, - route: () => [...this.rootUrl, SharedAipRoutesEnum.aipFiles], + route: () => [...this._rootUrl, SharedAipRoutesEnum.aipFiles], conditionDisplay: () => this.currentObs.pipe(map(current => current?.dataFileNumber > 0)), }, { @@ -178,7 +178,7 @@ export class SharedAipDetailEditRoutable extends AbstractDetailEditCommonRoutabl suffixUrl: SharedAipRoutesEnum.aipCollections, icon: IconNameEnum.collection, titleToTranslate: LabelTranslateEnum.collection, - route: () => [...this.rootUrl, SharedAipRoutesEnum.aipCollections], + route: () => [...this._rootUrl, SharedAipRoutesEnum.aipCollections], conditionDisplay: () => this.currentObs.pipe(map(current => current?.collectionSize > 0)), }, ]; @@ -325,12 +325,12 @@ export class SharedAipDetailEditRoutable extends AbstractDetailEditCommonRoutabl protected readonly _actions$: Actions, protected readonly _changeDetector: ChangeDetectorRef, protected readonly _router: Router, - protected readonly dialog: MatDialog, + protected readonly _dialog: MatDialog, protected readonly _injector: Injector, private readonly _location: Location, private readonly _securityService: SecurityService, private readonly _scrollService: ScrollService) { - super(_store, _route, _actions$, _changeDetector, dialog, StateEnum.shared_aip, _injector, sharedAipActionNameSpace, StateEnum.shared); + super(_store, _route, _actions$, _changeDetector, _dialog, StateEnum.shared_aip, _injector, sharedAipActionNameSpace, StateEnum.shared); } ngOnInit(): void { @@ -348,7 +348,7 @@ export class SharedAipDetailEditRoutable extends AbstractDetailEditCommonRoutabl filter(event => event instanceof NavigationCancel || event instanceof NavigationEnd), distinctUntilChanged(), tap(event => { - this.retrieveResIdFromUrl(); + this._retrieveResIdFromUrl(); }), ), ); @@ -356,7 +356,7 @@ export class SharedAipDetailEditRoutable extends AbstractDetailEditCommonRoutabl this._createPollingListenerCompletedStatus(); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { } backToList(): void { @@ -372,7 +372,7 @@ export class SharedAipDetailEditRoutable extends AbstractDetailEditCommonRoutabl private _getTabRoute(): string { const queryParameters = MemoizedUtil.selectSnapshot(this._store, SharedAipState, state => state.queryParameters); const searchItems = QueryParametersUtil.getSearchItems(queryParameters); - const archivalUnit = MappingObjectUtil.get(searchItems, this.KEY_ARCHIVAL_UNIT); + const archivalUnit = MappingObjectUtil.get(searchItems, this._KEY_ARCHIVAL_UNIT); if (archivalUnit === "true") { return SharedAipRoutesEnum.aipTabUnit; } else if (archivalUnit === "false") { @@ -464,7 +464,7 @@ export class SharedAipDetailEditRoutable extends AbstractDetailEditCommonRoutabl } setCurrentTab($event: Tab): void { - this.currentTab = $event; + this._currentTab = $event; } showHistory(): void { @@ -502,7 +502,7 @@ export class SharedAipDetailEditRoutable extends AbstractDetailEditCommonRoutabl private _shouldContinuePollingWaitCompletedStatus(): boolean { const status = MemoizedUtil.selectSnapshot(this._store, SharedAipState, state => state.current?.info?.status) as Enums.Package.StatusEnum; - return isNotNullNorUndefined(status) && this.STATUS_TO_STOP_POLLING_REFRESH_STATUS.indexOf(status) === -1; + return isNotNullNorUndefined(status) && this._STATUS_TO_STOP_POLLING_REFRESH_STATUS.indexOf(status) === -1; } } diff --git a/src/app/shared/features/aip/components/routables/aip-file/shared-aip-file.routable.ts b/src/app/shared/features/aip/components/routables/aip-file/shared-aip-file.routable.ts index de170559a..89dd3b230 100644 --- a/src/app/shared/features/aip/components/routables/aip-file/shared-aip-file.routable.ts +++ b/src/app/shared/features/aip/components/routables/aip-file/shared-aip-file.routable.ts @@ -158,13 +158,13 @@ export class SharedAipFileRoutable extends AbstractDetailEditRoutable<AipDataFil this.actions = [ { logo: IconNameEnum.download, - callback: (aipDataFile: AipDataFile) => this.downloadFile(this._resId, aipDataFile), + callback: (aipDataFile: AipDataFile) => this._downloadFile(this._resId, aipDataFile), placeholder: current => LabelTranslateEnum.download, displayOnCondition: (current: AipDataFile) => current.status === Enums.DataFile.StatusEnum.PROCESSED || current.status === Enums.DataFile.StatusEnum.READY || current.status === Enums.DataFile.StatusEnum.VIRUS_CHECKED, }, { logo: IconNameEnum.resume, - callback: (aipDataFile: AipDataFile) => this.resumeFile(this._resId, aipDataFile), + callback: (aipDataFile: AipDataFile) => this._resumeFile(this._resId, aipDataFile), placeholder: current => LabelTranslateEnum.resume, displayOnCondition: (aipDataFile: AipDataFile) => isNotNullNorUndefined(aipDataFile) && aipDataFile.status === Enums.DataFile.StatusEnum.IN_ERROR, }, @@ -173,19 +173,19 @@ export class SharedAipFileRoutable extends AbstractDetailEditRoutable<AipDataFil ngOnInit(): void { super.ngOnInit(); - this.getCurrentModelOnParent(); + this._getCurrentModelOnParent(); } - private getCurrentModelOnParent(): void { + private _getCurrentModelOnParent(): void { this._resId = this._route.snapshot.parent.paramMap.get(AppRoutesEnum.paramIdWithoutPrefixParam); - this.getAipById(this._resId); + this._getAipById(this._resId); } - private getAipById(id: string): void { - this.getSubResourceWithParentId(id); + private _getAipById(id: string): void { + this._getSubResourceWithParentId(id); } - getSubResourceWithParentId(id: string): void { + _getSubResourceWithParentId(id: string): void { this._store.dispatch(new SharedAipDataFileAction.GetAll(id, null, true)); } @@ -205,11 +205,11 @@ export class SharedAipFileRoutable extends AbstractDetailEditRoutable<AipDataFil this._store.dispatch(new Navigate([this._store.selectSnapshot((s: LocalStateModel) => s.router.state.url), dataFile.resId])); } - private downloadFile(parentId: string, dataFile: AipDataFile): void { + private _downloadFile(parentId: string, dataFile: AipDataFile): void { this._store.dispatch(new SharedAipDataFileAction.Download(parentId, dataFile)); } - private resumeFile(parentId: string, dataFile: AipDataFile): void { + private _resumeFile(parentId: string, dataFile: AipDataFile): void { this._store.dispatch(new SharedAipDataFileAction.Resume(parentId, dataFile)); } diff --git a/src/app/shared/features/aip/components/routables/aip-list/shared-aip-list.routable.ts b/src/app/shared/features/aip/components/routables/aip-list/shared-aip-list.routable.ts index 97736bb88..6a72023d9 100644 --- a/src/app/shared/features/aip/components/routables/aip-list/shared-aip-list.routable.ts +++ b/src/app/shared/features/aip/components/routables/aip-list/shared-aip-list.routable.ts @@ -117,10 +117,10 @@ export class SharedAipListRoutable extends AbstractListRoutable<Aip, SharedAipSt override skipInitialQuery: boolean = true; - private readonly KEY_ARCHIVAL_UNIT: keyof Aip = "archivalUnit"; + private readonly _KEY_ARCHIVAL_UNIT: keyof Aip = "archivalUnit"; columnsSkippedToClear: string[] = [ - this.KEY_ARCHIVAL_UNIT, + this._KEY_ARCHIVAL_UNIT, ]; storagion_number: number | undefined = undefined; @@ -135,7 +135,7 @@ export class SharedAipListRoutable extends AbstractListRoutable<Aip, SharedAipSt } } - constructor(protected readonly store: Store, + constructor(protected readonly _store: Store, protected readonly _route: ActivatedRoute, protected readonly _routerExt: RouterExtensionService, protected readonly _changeDetector: ChangeDetectorRef, @@ -143,7 +143,7 @@ export class SharedAipListRoutable extends AbstractListRoutable<Aip, SharedAipSt protected readonly _dialog: MatDialog, protected readonly _injector: Injector, protected readonly _router: Router) { - super(store, _changeDetector, _route, _routerExt, _actions$, _dialog, StateEnum.shared_aip, sharedAipActionNameSpace, _injector, { + super(_store, _changeDetector, _route, _routerExt, _actions$, _dialog, StateEnum.shared_aip, sharedAipActionNameSpace, _injector, { canCreate: false, historyState: SharedAipCollectionStatusHistoryState, historyStateAction: sharedAipCollectionStatusHistoryNamespace, @@ -164,8 +164,8 @@ export class SharedAipListRoutable extends AbstractListRoutable<Aip, SharedAipSt super.ngOnInit(); this.mode = AipHelper.determineMode(this._store); this._computeBackButtonLabel(); - this.updateListWithCurrentTab(); - this.subscribe(this.observeRoutingUpdate()); + this._updateListWithCurrentTab(); + this.subscribe(this._observeRoutingUpdate()); if (this.mode === AipMode.AIP) { this.storagion_number = +this._route.snapshot.parent.parent.paramMap.get(PreservationPlanningRoutesEnum.storagionNumberWithoutPrefixParam); } @@ -186,27 +186,27 @@ export class SharedAipListRoutable extends AbstractListRoutable<Aip, SharedAipSt } } - private observeRoutingUpdate(): Observable<any> { + private _observeRoutingUpdate(): Observable<any> { return this._router.events .pipe( filter(event => event instanceof NavigationCancel || event instanceof NavigationEnd), distinctUntilChanged(), tap(event => { - this.updateListWithCurrentTab(); + this._updateListWithCurrentTab(); }), ); } - private updateListWithCurrentTab(): void { + private _updateListWithCurrentTab(): void { const tab = this._route.snapshot.paramMap.get(SharedAipRoutesEnum.tabWithoutPrefixParam); this.archivalUnit(tab as SharedAipRoutesEnum); } override showDetail(model: Aip): void { if (this.mode === AipMode.AIP) { - this.store.dispatch(new Navigate([RoutesEnum.preservationPlanningAip + urlSeparator + this.storagion_number + urlSeparator + SharedAipRoutesEnum.aipDetail, model.resId])); + this._store.dispatch(new Navigate([RoutesEnum.preservationPlanningAip + urlSeparator + this.storagion_number + urlSeparator + SharedAipRoutesEnum.aipDetail, model.resId])); } else { - this.store.dispatch(new Navigate([RoutesEnum.preservationPlanningAipDownloadedDetail, model.resId])); + this._store.dispatch(new Navigate([RoutesEnum.preservationPlanningAipDownloadedDetail, model.resId])); } } @@ -284,7 +284,7 @@ export class SharedAipListRoutable extends AbstractListRoutable<Aip, SharedAipSt } getAipListWithParameter(isArchivalUnit: boolean | undefined): void { - let queryParameter = MemoizedUtil.queryParametersSnapshot(this.store, SharedAipState); + let queryParameter = MemoizedUtil.queryParametersSnapshot(this._store, SharedAipState); queryParameter = QueryParametersUtil.clone(queryParameter); if (isNullOrUndefined(queryParameter.sort?.field)) { const columnToSort = this.columns.find(c => c.order !== OrderEnum.none); @@ -296,11 +296,11 @@ export class SharedAipListRoutable extends AbstractListRoutable<Aip, SharedAipSt } } if (isNullOrUndefined(isArchivalUnit)) { - MappingObjectUtil.delete(queryParameter.search.searchItems, this.KEY_ARCHIVAL_UNIT); + MappingObjectUtil.delete(queryParameter.search.searchItems, this._KEY_ARCHIVAL_UNIT); } else { - MappingObjectUtil.set(queryParameter.search.searchItems, this.KEY_ARCHIVAL_UNIT, isArchivalUnit.toString()); + MappingObjectUtil.set(queryParameter.search.searchItems, this._KEY_ARCHIVAL_UNIT, isArchivalUnit.toString()); } - this.store.dispatch(new SharedAipAction.GetAll(queryParameter, false)); + this._store.dispatch(new SharedAipAction.GetAll(queryParameter, false)); } conditionDisplayEditButton(model: Aip): boolean { diff --git a/src/app/shared/features/aip/components/routables/aip-metadata/shared-aip-metadata.routable.ts b/src/app/shared/features/aip/components/routables/aip-metadata/shared-aip-metadata.routable.ts index 222c25e2b..c7ccc45dc 100644 --- a/src/app/shared/features/aip/components/routables/aip-metadata/shared-aip-metadata.routable.ts +++ b/src/app/shared/features/aip/components/routables/aip-metadata/shared-aip-metadata.routable.ts @@ -87,6 +87,6 @@ export class SharedAipMetadataRoutable extends AbstractDetailEditRoutable<Aip, S super.ngOnDestroy(); } - protected getSubResourceWithParentId(id: string): void { + protected _getSubResourceWithParentId(id: string): void { } } diff --git a/src/app/shared/features/aip/components/routables/aip-not-found/shared-aip-not-found.routable.ts b/src/app/shared/features/aip/components/routables/aip-not-found/shared-aip-not-found.routable.ts index 6c3884626..16b02f3d8 100644 --- a/src/app/shared/features/aip/components/routables/aip-not-found/shared-aip-not-found.routable.ts +++ b/src/app/shared/features/aip/components/routables/aip-not-found/shared-aip-not-found.routable.ts @@ -88,14 +88,14 @@ export class SharedAipNotFoundRoutable extends SharedAbstractRoutable implements } back(): void { - this.navigate([RoutesEnum.preservationPlanningAip]); + this._navigate([RoutesEnum.preservationPlanningAip]); } navigateToStorageAipDetail(storage: Storage): void { - this.navigate([RoutesEnum.preservationPlanningAip, storage.index, SharedAipRoutesEnum.aipDetail, this.aipId]); + this._navigate([RoutesEnum.preservationPlanningAip, storage.index, SharedAipRoutesEnum.aipDetail, this.aipId]); } - private navigate(path: (string | number)[]): void { + private _navigate(path: (string | number)[]): void { this._store.dispatch(new Navigate(path)); } } diff --git a/src/app/shared/features/aip/components/routables/aip-tabs/shared-aip-tabs.routable.ts b/src/app/shared/features/aip/components/routables/aip-tabs/shared-aip-tabs.routable.ts index 3607f552a..c63f7e032 100644 --- a/src/app/shared/features/aip/components/routables/aip-tabs/shared-aip-tabs.routable.ts +++ b/src/app/shared/features/aip/components/routables/aip-tabs/shared-aip-tabs.routable.ts @@ -52,8 +52,8 @@ import {Tab} from "solidify-frontend"; changeDetection: ChangeDetectionStrategy.OnPush, }) export class SharedAipTabsRoutable extends SharedAbstractRoutable implements OnInit { - private storagionNode: number | undefined = undefined; - private currentTab: Tab; + private _storagionNode: number | undefined = undefined; + private _currentTab: Tab; mode: AipMode; @@ -66,14 +66,14 @@ export class SharedAipTabsRoutable extends SharedAbstractRoutable implements OnI ngOnInit(): void { this.mode = AipHelper.determineMode(this._store); if (this.mode === AipMode.AIP) { - this.storagionNode = +this._route.snapshot.parent.paramMap.get(PreservationPlanningRoutesEnum.storagionNumberWithoutPrefixParam); + this._storagionNode = +this._route.snapshot.parent.paramMap.get(PreservationPlanningRoutesEnum.storagionNumberWithoutPrefixParam); } } - private get rootUrl(): string[] { + private get _rootUrl(): string[] { switch (this.mode) { case AipMode.AIP: - return [RoutesEnum.preservationPlanningAip, this.storagionNode + "", SharedAipRoutesEnum.aipList]; + return [RoutesEnum.preservationPlanningAip, this._storagionNode + "", SharedAipRoutesEnum.aipList]; case AipMode.AIP_STEWARD: return [RoutesEnum.preservationSpaceAipStewardList]; case AipMode.DOWNLOADED_AIP: @@ -88,26 +88,26 @@ export class SharedAipTabsRoutable extends SharedAbstractRoutable implements OnI suffixUrl: SharedAipRoutesEnum.aipTabAll, icon: IconNameEnum.metadata, titleToTranslate: LabelTranslateEnum.all, - route: () => [...this.rootUrl, SharedAipRoutesEnum.aipTabAll], + route: () => [...this._rootUrl, SharedAipRoutesEnum.aipTabAll], }, { id: TabEnum.UNIT_TAB_INDEX, suffixUrl: SharedAipRoutesEnum.aipTabUnit, icon: IconNameEnum.files, titleToTranslate: LabelTranslateEnum.units, - route: () => [...this.rootUrl, SharedAipRoutesEnum.aipTabUnit], + route: () => [...this._rootUrl, SharedAipRoutesEnum.aipTabUnit], }, { id: TabEnum.COLLECTION_TAB_INDEX, suffixUrl: SharedAipRoutesEnum.aipTabCollections, icon: IconNameEnum.collection, titleToTranslate: LabelTranslateEnum.collection, - route: () => [...this.rootUrl, SharedAipRoutesEnum.aipTabCollections], + route: () => [...this._rootUrl, SharedAipRoutesEnum.aipTabCollections], }, ]; setCurrentTab($event: Tab): void { - this.currentTab = $event; + this._currentTab = $event; } } diff --git a/src/app/shared/features/aip/stores/aip-collection/shared-aip-collection.state.ts b/src/app/shared/features/aip/stores/aip-collection/shared-aip-collection.state.ts index 2a870a52e..de8c32194 100644 --- a/src/app/shared/features/aip/stores/aip-collection/shared-aip-collection.state.ts +++ b/src/app/shared/features/aip/stores/aip-collection/shared-aip-collection.state.ts @@ -81,20 +81,20 @@ export interface SharedAipCollectionStateModel extends CompositionStateModel<Aip ], }) export class SharedAipCollectionState extends CompositionState<SharedAipCollectionStateModel, Aip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - @Inject(WINDOW) private _window: Window, - private downloadService: DownloadService) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + @Inject(WINDOW) private readonly _window: Window, + private readonly _downloadService: DownloadService) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedAipCollectionActionNameSpace, resourceName: ApiResourceNameEnum.AIP, }); } protected get _urlResource(): string { - return AipHelper.generateUrlResource(this.store); + return AipHelper.generateUrlResource(this._store); } @Action(SharedAipCollectionAction.Refresh) @@ -105,7 +105,7 @@ export class SharedAipCollectionState extends CompositionState<SharedAipCollecti @Action(SharedAipCollectionAction.DownloadAip) downloadAip(ctx: StateContext<SharedAipCollectionStateModel>, action: SharedAipCollectionAction.DownloadAip): void { const url = `${this._urlResource}/${action.aip.resId}/${ApiActionNameEnum.DL}`; - this.downloadService.download(url, action.aip.info.name, action.aip.archiveSize); + this._downloadService.download(url, action.aip.info.name, action.aip.archiveSize); } @Action(SharedAipCollectionAction.GoToAip) diff --git a/src/app/shared/features/aip/stores/aip-collection/status-history/shared-aip-collection-status-history.state.ts b/src/app/shared/features/aip/stores/aip-collection/status-history/shared-aip-collection-status-history.state.ts index 3ba1c0371..f268019df 100644 --- a/src/app/shared/features/aip/stores/aip-collection/status-history/shared-aip-collection-status-history.state.ts +++ b/src/app/shared/features/aip/stores/aip-collection/status-history/shared-aip-collection-status-history.state.ts @@ -54,16 +54,16 @@ export interface SharedAipCollectionStatusHistoryStateModel extends StatusHistor }) export class SharedAipCollectionStatusHistoryState extends StatusHistoryState<SharedAipCollectionStatusHistoryStateModel, Aip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedAipCollectionStatusHistoryNamespace, }); } protected get _urlResource(): string { - return AipHelper.generateUrlResource(this.store); + return AipHelper.generateUrlResource(this._store); } } diff --git a/src/app/shared/features/aip/stores/aip-data-file/shared-aip-data-file.state.ts b/src/app/shared/features/aip/stores/aip-data-file/shared-aip-data-file.state.ts index 435af1b57..593a6d558 100644 --- a/src/app/shared/features/aip/stores/aip-data-file/shared-aip-data-file.state.ts +++ b/src/app/shared/features/aip/stores/aip-data-file/shared-aip-data-file.state.ts @@ -85,20 +85,20 @@ export interface SharedAipDataFileStateModel extends CompositionStateModel<AipDa ], }) export class SharedAipDataFileState extends CompositionState<SharedAipDataFileStateModel, AipDataFile> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - @Inject(WINDOW) private _window: Window, - private downloadService: DownloadService) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + @Inject(WINDOW) private readonly _window: Window, + private readonly _downloadService: DownloadService) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedAipDataFileActionNameSpace, resourceName: ApiResourceNameEnum.DATAFILE, }); } protected get _urlResource(): string { - return AipHelper.generateUrlResource(this.store); + return AipHelper.generateUrlResource(this._store); } @Action(SharedAipDataFileAction.Refresh) @@ -109,23 +109,23 @@ export class SharedAipDataFileState extends CompositionState<SharedAipDataFileSt @Action(SharedAipDataFileAction.Download) download(ctx: StateContext<SharedAipDataFileStateModel>, action: SharedAipDataFileAction.Download): void { const url = `${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.DL}`; - this.downloadService.download(url, action.dataFile.fileName, action.dataFile.fileSize); + this._downloadService.download(url, action.dataFile.fileName, action.dataFile.fileSize); } @Action(SharedAipDataFileAction.Resume) resume(ctx: StateContext<SharedAipDataFileStateModel>, action: SharedAipDataFileAction.Resume): Observable<Result> { - return this.apiService.post<any, Result>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.RESUME}`) + return this._apiService.post<any, Result>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.RESUME}`) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { - this.notificationService.showInformation(LabelTranslateEnum.resourceResumed); + this._notificationService.showInformation(LabelTranslateEnum.resourceResumed); ctx.dispatch(new SharedAipDataFileAction.GetAll(action.parentId, undefined, true)); } else { - this.notificationService.showInformation(LabelTranslateEnum.unableResumedResource); + this._notificationService.showInformation(LabelTranslateEnum.unableResumedResource); } }), catchError((error: SolidifyHttpErrorResponseModel) => { - this.notificationService.showInformation(LabelTranslateEnum.unableResumedResource); + this._notificationService.showInformation(LabelTranslateEnum.unableResumedResource); throw new SolidifyStateError(this, error); }), ); diff --git a/src/app/shared/features/aip/stores/aip-data-file/status-history/shared-aip-data-file-status-history.state.ts b/src/app/shared/features/aip/stores/aip-data-file/status-history/shared-aip-data-file-status-history.state.ts index 0f52defce..79dfe40af 100644 --- a/src/app/shared/features/aip/stores/aip-data-file/status-history/shared-aip-data-file-status-history.state.ts +++ b/src/app/shared/features/aip/stores/aip-data-file/status-history/shared-aip-data-file-status-history.state.ts @@ -54,16 +54,16 @@ export interface SharedAipDataFileStatusHistoryStateModel extends StatusHistoryS }) export class SharedAipDataFileStatusHistoryState extends StatusHistoryState<SharedAipDataFileStatusHistoryStateModel, AipDataFile> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedAipDataFileStatusHistoryNamespace, }); } protected get _urlResource(): string { - return AipHelper.generateUrlResourceHistoryDataFile(this.store); + return AipHelper.generateUrlResourceHistoryDataFile(this._store); } } diff --git a/src/app/shared/features/aip/stores/organizational-unit/shared-aip-organizational-unit.state.ts b/src/app/shared/features/aip/stores/organizational-unit/shared-aip-organizational-unit.state.ts index 9a59a4ab3..13ef5fed4 100644 --- a/src/app/shared/features/aip/stores/organizational-unit/shared-aip-organizational-unit.state.ts +++ b/src/app/shared/features/aip/stores/organizational-unit/shared-aip-organizational-unit.state.ts @@ -61,11 +61,11 @@ export interface SharedAipOrganizationalUnitStateModel extends ResourceStateMode }) export class SharedAipOrganizationalUnitState extends ResourceState<SharedAipOrganizationalUnitStateModel, AccessOrganizationalUnit> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedAipOrgUnitActionNameSpace, }); } diff --git a/src/app/shared/features/aip/stores/shared-aip.state.ts b/src/app/shared/features/aip/stores/shared-aip.state.ts index 1f087bcbe..cadc32390 100644 --- a/src/app/shared/features/aip/stores/shared-aip.state.ts +++ b/src/app/shared/features/aip/stores/shared-aip.state.ts @@ -117,17 +117,17 @@ export interface SharedAipStateModel extends ResourceStateModel<Aip> { ], }) export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { - private readonly KEY_QUERY_PARAM_REASON: string = "reason"; - private readonly KEY_QUERY_PARAM_DURATION: string = "duration"; + private readonly _KEY_QUERY_PARAM_REASON: string = "reason"; + private readonly _KEY_QUERY_PARAM_DURATION: string = "duration"; - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, private readonly _router: Router, private readonly _route: ActivatedRoute, - private downloadService: DownloadService) { - super(apiService, store, notificationService, actions$, { + private readonly _downloadService: DownloadService) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedAipActionNameSpace, routeRedirectUrlAfterSuccessDeleteAction: RoutesEnum.preservationPlanningAipDownloaded, notificationResourceDeleteSuccessTextToTranslate: MARK_AS_TRANSLATABLE("aipDownloaded.notification.resource.delete.success"), @@ -136,7 +136,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { } protected get _urlResource(): string { - return AipHelper.generateUrlResource(this.store); + return AipHelper.generateUrlResource(this._store); } @Selector() @@ -162,7 +162,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { @Action(SharedAipAction.Download) download(ctx: StateContext<SharedAipStateModel>, action: SharedAipAction.Download): void { const fileName = "aip_" + action.id + ".zip"; - this.downloadService.download(`${this._urlResource}/${action.id}/${ApiActionNameEnum.DL}`, fileName); + this._downloadService.download(`${this._urlResource}/${action.id}/${ApiActionNameEnum.DL}`, fileName); } @OverrideDefaultAction() @@ -179,8 +179,8 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ...reset, }); - const url = AipHelper.generateUrlResource(this.store, action.storagionNumber, action.url); - return this.apiService.getById<Aip>(url, action.id) + const url = AipHelper.generateUrlResource(this._store, action.storagionNumber, action.url); + return this._apiService.getById<Aip>(url, action.id) .pipe( tap((model: Aip) => { ctx.dispatch(new SharedAipAction.GetByIdSuccess(action, model)); @@ -197,7 +197,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.REINDEX}`) + return this._apiService.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.REINDEX}`) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -218,7 +218,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.reindex.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.reindex.success")); ctx.dispatch(new SharedAipAction.GetById(action.parentAction.id, true)); } @@ -227,7 +227,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.reindex.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.reindex.fail")); } @Action(SharedAipAction.DeepChecksum) @@ -236,7 +236,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); const params = new HttpParams().set("level", "deep"); - return this.apiService.post<any, Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.CHECK_FIXITY}`, {params: params}) + return this._apiService.post<any, Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.CHECK_FIXITY}`, {params: params}) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -257,7 +257,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.deepChecksum.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.deepChecksum.success")); ctx.dispatch(new SharedAipAction.GetById(action.parentAction.id, true)); } @@ -266,7 +266,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.deepChecksum.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.deepChecksum.fail")); } @Action(SharedAipAction.SimpleChecksum) @@ -275,7 +275,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); const params = new HttpParams().set("level", "simple"); - return this.apiService.post<any, Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.CHECK_FIXITY}`, {params: params}) + return this._apiService.post<any, Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.CHECK_FIXITY}`, {params: params}) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -296,7 +296,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.simpleChecksum.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.simpleChecksum.success")); ctx.dispatch(new SharedAipAction.GetById(action.parentAction.id, true)); } @@ -305,7 +305,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.simpleChecksum.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.simpleChecksum.fail")); } @Action(SharedAipAction.Resume) @@ -313,7 +313,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<any, Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.RESUME}`, null) + return this._apiService.post<any, Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.RESUME}`, null) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -334,7 +334,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.resume.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.resume.success")); ctx.dispatch(new SharedAipAction.GetById(action.parentAction.id, true)); } @@ -343,7 +343,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.resume.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.resume.fail")); } @Action(SharedAipAction.GoToAip) @@ -361,7 +361,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<any, Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.CHECK}`, null) + return this._apiService.post<any, Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.CHECK}`, null) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -382,7 +382,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.check.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.check.success")); ctx.dispatch(new SharedAipAction.GetById(action.parentAction.id, true)); } @@ -391,7 +391,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.check.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.check.fail")); } @Action(SharedAipAction.Dispose) @@ -399,7 +399,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.delete<string>(`${this._urlResource}/${action.id}`, null) + return this._apiService.delete<string>(`${this._urlResource}/${action.id}`, null) .pipe( tap(result => { ctx.dispatch(new SharedAipAction.DisposeSuccess(action)); @@ -416,7 +416,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.dispose.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.dispose.success")); ctx.dispatch(new SharedAipAction.GetById(action.parentAction.id, true)); } @@ -425,7 +425,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.dispose.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.dispose.fail")); } @Action(SharedAipAction.ApproveDisposal) @@ -434,9 +434,9 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); const customParams = { - [this.KEY_QUERY_PARAM_REASON]: action.reason, + [this._KEY_QUERY_PARAM_REASON]: action.reason, }; - return this.apiService.post<any, Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.APPROVE_DISPOSAL}`, null, customParams) + return this._apiService.post<any, Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.APPROVE_DISPOSAL}`, null, customParams) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -457,7 +457,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.approveDisposal.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.approveDisposal.success")); ctx.dispatch(new SharedAipAction.GetById(action.parentAction.id, true)); } @@ -466,7 +466,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.approveDisposal.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.approveDisposal.fail")); } @Action(SharedAipAction.ApproveDisposalByOrgunit) @@ -474,8 +474,8 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<any, Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.APPROVE_DISPOSAL_BY_ORGUNIT}`, null, { - [this.KEY_QUERY_PARAM_REASON]: action.reason, + return this._apiService.post<any, Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.APPROVE_DISPOSAL_BY_ORGUNIT}`, null, { + [this._KEY_QUERY_PARAM_REASON]: action.reason, }) .pipe( tap(result => { @@ -497,7 +497,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.approveDisposalByOrgunit.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.approveDisposalByOrgunit.success")); ctx.dispatch(new SharedAipAction.GetById(action.parentAction.id, true)); } @@ -506,7 +506,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.approveDisposalByOrgunit.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.approveDisposalByOrgunit.fail")); } @Action(SharedAipAction.ExtendRetention) @@ -514,8 +514,8 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<any, Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.EXTEND_RETENTION}`, null, { - [this.KEY_QUERY_PARAM_DURATION]: action.duration + "", + return this._apiService.post<any, Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.EXTEND_RETENTION}`, null, { + [this._KEY_QUERY_PARAM_DURATION]: action.duration + "", }) .pipe( tap(result => { @@ -537,7 +537,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.extendRetention.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.extendRetention.success")); ctx.dispatch(new SharedAipAction.GetById(action.parentAction.id, true)); } @@ -546,7 +546,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.extendRetention.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.extendRetention.fail")); } @Action(SharedAipAction.PutInError) @@ -554,7 +554,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.PUT_IN_ERROR}`, null) + return this._apiService.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.PUT_IN_ERROR}`, null) .pipe( tap(result => { if (result?.status === ResultActionStatusEnum.EXECUTED) { @@ -575,7 +575,7 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.put-in-error.success")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.put-in-error.success")); ctx.dispatch(new SharedAipAction.GetById(action.parentAction.id, true)); } @@ -584,6 +584,6 @@ export class SharedAipState extends ResourceState<SharedAipStateModel, Aip> { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.put-in-error.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("notification.aip.action.put-in-error.fail")); } } diff --git a/src/app/shared/features/aip/stores/status-history/shared-aip-status-history.state.ts b/src/app/shared/features/aip/stores/status-history/shared-aip-status-history.state.ts index f2bf1ef1e..83c669f84 100644 --- a/src/app/shared/features/aip/stores/status-history/shared-aip-status-history.state.ts +++ b/src/app/shared/features/aip/stores/status-history/shared-aip-status-history.state.ts @@ -54,16 +54,16 @@ export interface SharedAipStatusHistoryStateModel extends StatusHistoryStateMode }) export class SharedAipStatusHistoryState extends StatusHistoryState<SharedAipStatusHistoryStateModel, Aip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedAipStatusHistoryNamespace, }); } protected get _urlResource(): string { - return AipHelper.generateUrlResource(this.store); + return AipHelper.generateUrlResource(this._store); } } diff --git a/src/app/shared/guards/application-maintenance-guard.service.ts b/src/app/shared/guards/application-maintenance-guard.service.ts index 3e65ef082..8c77610e7 100644 --- a/src/app/shared/guards/application-maintenance-guard.service.ts +++ b/src/app/shared/guards/application-maintenance-guard.service.ts @@ -54,8 +54,8 @@ import { providedIn: "root", }) export class ApplicationMaintenanceGuardService implements CanActivate { - constructor(public _router: Router, - public _store: Store) { + constructor(public readonly _router: Router, + public readonly _store: Store) { } canActivate(route: ActivatedRouteSnapshot): Observable<boolean> { diff --git a/src/app/shared/guards/application-role-guard.service.ts b/src/app/shared/guards/application-role-guard.service.ts index 1ef1926d0..658ca8301 100644 --- a/src/app/shared/guards/application-role-guard.service.ts +++ b/src/app/shared/guards/application-role-guard.service.ts @@ -57,7 +57,7 @@ import { providedIn: "root", }) export class ApplicationRoleGuardService implements CanActivate { - constructor(public router: Router, public store: Store, private readonly _oauthService: OAuth2Service) { + constructor(public readonly router: Router, public readonly store: Store, private readonly _oauthService: OAuth2Service) { } canActivate(route: ActivatedRouteSnapshot, state1: RouterStateSnapshot): Observable<boolean> { diff --git a/src/app/shared/guards/archive-guard.service.ts b/src/app/shared/guards/archive-guard.service.ts index 2bb6bacdb..3b7d0f779 100644 --- a/src/app/shared/guards/archive-guard.service.ts +++ b/src/app/shared/guards/archive-guard.service.ts @@ -52,10 +52,10 @@ import { providedIn: "root", }) export class ArchiveGuardService implements CanActivate { - constructor(public router: Router, - private _store: Store, - public apiService: ApiService, - private _actions$: Actions) { + constructor(public readonly router: Router, + private readonly _store: Store, + public readonly apiService: ApiService, + private readonly _actions$: Actions) { } canActivate(route: ActivatedRouteSnapshot): Observable<boolean> { diff --git a/src/app/shared/guards/deposit-role-guard-detail.service.ts b/src/app/shared/guards/deposit-role-guard-detail.service.ts index 02c43b663..7ee502f67 100644 --- a/src/app/shared/guards/deposit-role-guard-detail.service.ts +++ b/src/app/shared/guards/deposit-role-guard-detail.service.ts @@ -49,9 +49,9 @@ import { providedIn: "root", }) export class DepositRoleGuardDetailService implements CanActivate { - constructor(public router: Router, - public store: Store, - public apiService: ApiService, + constructor(public readonly router: Router, + public readonly store: Store, + public readonly apiService: ApiService, private readonly _securityService: SecurityService) { } diff --git a/src/app/shared/guards/deposit-role-guard-edit.service.ts b/src/app/shared/guards/deposit-role-guard-edit.service.ts index cb977b892..109406878 100644 --- a/src/app/shared/guards/deposit-role-guard-edit.service.ts +++ b/src/app/shared/guards/deposit-role-guard-edit.service.ts @@ -40,9 +40,9 @@ import { providedIn: "root", }) export class DepositRoleGuardEditService implements CanActivate { - constructor(public router: Router, - public store: Store, - public apiService: ApiService, + constructor(public readonly router: Router, + public readonly store: Store, + public readonly apiService: ApiService, private readonly _securityService: SecurityService) { } diff --git a/src/app/shared/guards/organizational-unit-compute-is-manager.service.ts b/src/app/shared/guards/organizational-unit-compute-is-manager.service.ts index 967e167d2..dd8dee8a2 100644 --- a/src/app/shared/guards/organizational-unit-compute-is-manager.service.ts +++ b/src/app/shared/guards/organizational-unit-compute-is-manager.service.ts @@ -50,9 +50,9 @@ import { providedIn: "root", }) export class OrganizationalUnitComputeIsManagerGuardService implements CanActivate { - constructor(public router: Router, - public store: Store, - public apiService: ApiService, + constructor(public readonly router: Router, + public readonly store: Store, + public readonly apiService: ApiService, private readonly _securityService: SecurityService, private readonly _notificationService: NotificationService, private readonly _actions$: Actions) { diff --git a/src/app/shared/guards/organizational-unit-role-guard.service.ts b/src/app/shared/guards/organizational-unit-role-guard.service.ts index 4c276e451..fc560c98a 100644 --- a/src/app/shared/guards/organizational-unit-role-guard.service.ts +++ b/src/app/shared/guards/organizational-unit-role-guard.service.ts @@ -42,9 +42,9 @@ import { providedIn: "root", }) export class OrganizationalUnitRoleGuardService implements CanActivate { - constructor(public router: Router, - public store: Store, - public apiService: ApiService, + constructor(public readonly router: Router, + public readonly store: Store, + public readonly apiService: ApiService, private readonly _securityService: SecurityService, private readonly _notificationService: NotificationService) { } diff --git a/src/app/shared/pipes/translate-facet.pipe.ts b/src/app/shared/pipes/translate-facet.pipe.ts index ab6d56005..21bb33bdf 100644 --- a/src/app/shared/pipes/translate-facet.pipe.ts +++ b/src/app/shared/pipes/translate-facet.pipe.ts @@ -56,7 +56,7 @@ export class TranslateFacetPipe extends SharedAbstractPipe implements PipeTransf lastReturnedValue: string; lastReturnLanguage: Enums.Language.LanguageEnum; - constructor(private _store: Store) { + constructor(private readonly _store: Store) { super(); this.subscribe(this.appLanguageObs.pipe(tap(value => { this.currentLanguage = value; diff --git a/src/app/shared/services/mat-dialog-override.service.ts b/src/app/shared/services/mat-dialog-override.service.ts index b563a2c8f..94ff28328 100644 --- a/src/app/shared/services/mat-dialog-override.service.ts +++ b/src/app/shared/services/mat-dialog-override.service.ts @@ -59,7 +59,7 @@ export class MatDialogOverrideService extends MatDialog implements OnDestroy { constructor(_overlay: Overlay, _injector: Injector, @Optional() _location: Location, - private _ngZone: NgZone, + private readonly _ngZone: NgZone, @Optional() @Inject(MAT_DIALOG_DEFAULT_OPTIONS) _defaultOptions: MatDialogConfig, @Inject(MAT_DIALOG_SCROLL_STRATEGY) scrollStrategy: any, @Optional() @SkipSelf() _parentDialog: MatDialog, diff --git a/src/app/shared/services/orcid.service.ts b/src/app/shared/services/orcid.service.ts index cd42d819d..7de12130e 100644 --- a/src/app/shared/services/orcid.service.ts +++ b/src/app/shared/services/orcid.service.ts @@ -52,10 +52,10 @@ export class OrcidService extends AbstractBaseService { } this._apiService.get<string>(startOrcidAuthUrl, {}, {originUrl: originUrl + orcidQueryParam}) - .subscribe(val => this.getOrcid(val["authTransactionId"])); + .subscribe(val => this._getOrcid(val["authTransactionId"])); } - private getOrcid(authTransactionId: string): void { + private _getOrcid(authTransactionId: string): void { const authorizeUrl: string = environment.orcidAuthorizeUrl; const clientId: string = MemoizedUtil.selectSnapshot(this._store, AppSystemPropertyState, state => state.current.orcidClientId); const redirectUri: string = ApiEnum.adminOrcid + "/landing?authTransactionId=" + authTransactionId; diff --git a/src/app/shared/services/security.service.ts b/src/app/shared/services/security.service.ts index 731fd25d9..b1775e2ed 100644 --- a/src/app/shared/services/security.service.ts +++ b/src/app/shared/services/security.service.ts @@ -56,14 +56,14 @@ import { }) export class SecurityService extends SolidifySecurityService { - private readonly ORGUNIT_ROLE_NEED_ACCESS_TO_CLOSED_DATASET: Enums.Role.RoleEnum[] = [Enums.Role.RoleEnum.STEWARD, Enums.Role.RoleEnum.MANAGER]; - private readonly ORGUNIT_ROLE_NEED_TO_EDIT: Enums.Role.RoleEnum[] = [Enums.Role.RoleEnum.MANAGER]; - private readonly DEPOSIT_ROLE_NEED_TO_CREATE: Enums.Role.RoleEnum[] = [Enums.Role.RoleEnum.MANAGER, Enums.Role.RoleEnum.STEWARD, Enums.Role.RoleEnum.APPROVER, Enums.Role.RoleEnum.CREATOR]; - private readonly DEPOSIT_ROLE_NEED_TO_EDIT: Enums.Role.RoleEnum[] = [Enums.Role.RoleEnum.MANAGER, Enums.Role.RoleEnum.STEWARD, Enums.Role.RoleEnum.APPROVER, Enums.Role.RoleEnum.CREATOR]; - private readonly DEPOSIT_ROLE_NEED_TO_VALIDATE: Enums.Role.RoleEnum[] = [Enums.Role.RoleEnum.MANAGER, Enums.Role.RoleEnum.STEWARD, Enums.Role.RoleEnum.APPROVER]; - private readonly DEPOSIT_STATUS_ALLOW_FULL_ALTERATION: Enums.Deposit.StatusEnum[] = [Enums.Deposit.StatusEnum.IN_PROGRESS]; - private readonly DEPOSIT_STATUS_ALLOW_METADATA_ALTERATION: Enums.Deposit.StatusEnum[] = [Enums.Deposit.StatusEnum.EDITING_METADATA]; - private readonly DEPOSIT_STATUS_ALLOW_VALIDATION: Enums.Deposit.StatusEnum[] = [Enums.Deposit.StatusEnum.IN_VALIDATION]; + private readonly _ORGUNIT_ROLE_NEED_ACCESS_TO_CLOSED_DATASET: Enums.Role.RoleEnum[] = [Enums.Role.RoleEnum.STEWARD, Enums.Role.RoleEnum.MANAGER]; + private readonly _ORGUNIT_ROLE_NEED_TO_EDIT: Enums.Role.RoleEnum[] = [Enums.Role.RoleEnum.MANAGER]; + private readonly _DEPOSIT_ROLE_NEED_TO_CREATE: Enums.Role.RoleEnum[] = [Enums.Role.RoleEnum.MANAGER, Enums.Role.RoleEnum.STEWARD, Enums.Role.RoleEnum.APPROVER, Enums.Role.RoleEnum.CREATOR]; + private readonly _DEPOSIT_ROLE_NEED_TO_EDIT: Enums.Role.RoleEnum[] = [Enums.Role.RoleEnum.MANAGER, Enums.Role.RoleEnum.STEWARD, Enums.Role.RoleEnum.APPROVER, Enums.Role.RoleEnum.CREATOR]; + private readonly _DEPOSIT_ROLE_NEED_TO_VALIDATE: Enums.Role.RoleEnum[] = [Enums.Role.RoleEnum.MANAGER, Enums.Role.RoleEnum.STEWARD, Enums.Role.RoleEnum.APPROVER]; + private readonly _DEPOSIT_STATUS_ALLOW_FULL_ALTERATION: Enums.Deposit.StatusEnum[] = [Enums.Deposit.StatusEnum.IN_PROGRESS]; + private readonly _DEPOSIT_STATUS_ALLOW_METADATA_ALTERATION: Enums.Deposit.StatusEnum[] = [Enums.Deposit.StatusEnum.EDITING_METADATA]; + private readonly _DEPOSIT_STATUS_ALLOW_VALIDATION: Enums.Deposit.StatusEnum[] = [Enums.Deposit.StatusEnum.IN_VALIDATION]; constructor(protected readonly _store: Store, protected readonly _actions$: Actions) { @@ -77,7 +77,7 @@ export class SecurityService extends SolidifySecurityService { if (!this.isMemberOfOrgUnit(orgUnitId)) { return false; } - return this.currentUserHaveRoleInListForOrgUnit(orgUnitId, this.DEPOSIT_ROLE_NEED_TO_CREATE); + return this._currentUserHaveRoleInListForOrgUnit(orgUnitId, this._DEPOSIT_ROLE_NEED_TO_CREATE); } isStewardOfAnyOrgUnit(orgUnitList: OrganizationalUnit[]): boolean { @@ -95,7 +95,7 @@ export class SecurityService extends SolidifySecurityService { if (!this.isMemberOfOrgUnit(orgUnitId)) { return false; } - return this.currentUserHaveRoleInListForOrgUnit(orgUnitId, this.ORGUNIT_ROLE_NEED_TO_EDIT); + return this._currentUserHaveRoleInListForOrgUnit(orgUnitId, this._ORGUNIT_ROLE_NEED_TO_EDIT); } isStewardOfOrgUnit(orgUnitId: string): boolean { @@ -105,7 +105,7 @@ export class SecurityService extends SolidifySecurityService { if (!this.isMemberOfOrgUnit(orgUnitId)) { return false; } - return this.currentUserHaveRoleInListForOrgUnit(orgUnitId, this.ORGUNIT_ROLE_NEED_ACCESS_TO_CLOSED_DATASET); + return this._currentUserHaveRoleInListForOrgUnit(orgUnitId, this._ORGUNIT_ROLE_NEED_ACCESS_TO_CLOSED_DATASET); } isApproverOfOrgUnit(orgUnitId: string): boolean { @@ -115,7 +115,7 @@ export class SecurityService extends SolidifySecurityService { if (!this.isMemberOfOrgUnit(orgUnitId)) { return false; } - return this.currentUserHaveRoleInListForOrgUnit(orgUnitId, this.DEPOSIT_ROLE_NEED_TO_VALIDATE); + return this._currentUserHaveRoleInListForOrgUnit(orgUnitId, this._DEPOSIT_ROLE_NEED_TO_VALIDATE); } isActiveArchiveAcl(archiveId: string): boolean { @@ -161,7 +161,7 @@ export class SecurityService extends SolidifySecurityService { if (isNullOrUndefined(currentRoleOnOrgUnit)) { return DepositEditModeEnum.none; } - if (SecurityService._isCurrentRoleOnOrgUnitAuthorized(currentRoleOnOrgUnit, this.DEPOSIT_ROLE_NEED_TO_EDIT)) { + if (SecurityService._isCurrentRoleOnOrgUnitAuthorized(currentRoleOnOrgUnit, this._DEPOSIT_ROLE_NEED_TO_EDIT)) { return depositEditMode; } return DepositEditModeEnum.none; @@ -178,18 +178,18 @@ export class SecurityService extends SolidifySecurityService { if (isNullOrUndefined(currentRoleOnOrgUnit)) { return false; } - return SecurityService._isCurrentRoleOnOrgUnitAuthorized(currentRoleOnOrgUnit, this.DEPOSIT_ROLE_NEED_TO_VALIDATE); + return SecurityService._isCurrentRoleOnOrgUnitAuthorized(currentRoleOnOrgUnit, this._DEPOSIT_ROLE_NEED_TO_VALIDATE); } private _depositInValidationStep(deposit: Deposit): boolean { - return SecurityService._depositInState(deposit, this.DEPOSIT_STATUS_ALLOW_VALIDATION); + return SecurityService._depositInState(deposit, this._DEPOSIT_STATUS_ALLOW_VALIDATION); } private _depositEditionModeStep(deposit: Deposit): DepositEditModeEnum { - if (SecurityService._depositInState(deposit, this.DEPOSIT_STATUS_ALLOW_METADATA_ALTERATION)) { + if (SecurityService._depositInState(deposit, this._DEPOSIT_STATUS_ALLOW_METADATA_ALTERATION)) { return DepositEditModeEnum.metadata; } - if (SecurityService._depositInState(deposit, this.DEPOSIT_STATUS_ALLOW_FULL_ALTERATION)) { + if (SecurityService._depositInState(deposit, this._DEPOSIT_STATUS_ALLOW_FULL_ALTERATION)) { return DepositEditModeEnum.full; } return DepositEditModeEnum.none; @@ -217,12 +217,12 @@ export class SecurityService extends SolidifySecurityService { if (!this._depositEditionModeStep(currentDeposit)) { return false; } - return this.currentUserHaveRoleInListForOrgUnit(currentDeposit.organizationalUnitId, this.DEPOSIT_ROLE_NEED_TO_EDIT); + return this._currentUserHaveRoleInListForOrgUnit(currentDeposit.organizationalUnitId, this._DEPOSIT_ROLE_NEED_TO_EDIT); }), ); } - private currentUserHaveRoleInListForOrgUnit(orgUnitId: string, listRolesAuthorized: Enums.Role.RoleEnum[]): boolean { + private _currentUserHaveRoleInListForOrgUnit(orgUnitId: string, listRolesAuthorized: Enums.Role.RoleEnum[]): boolean { const currentRoleInOrgUnit = this.getRoleInOrgUnit(orgUnitId); if (isNullOrUndefined(currentRoleInOrgUnit)) { return false; diff --git a/src/app/shared/services/store-dialog.service.ts b/src/app/shared/services/store-dialog.service.ts index 593b6ff71..61eef8016 100644 --- a/src/app/shared/services/store-dialog.service.ts +++ b/src/app/shared/services/store-dialog.service.ts @@ -63,7 +63,7 @@ export class StoreDialogService extends AbstractStoreDialogService { super(environment); } - protected deleteDataInternal(state: StateEnum): DeleteDialogData | undefined { + protected _deleteDataInternal(state: StateEnum): DeleteDialogData | undefined { const sharedDeleteDialogData = {} as DeleteDialogData; if (state === StateEnum.deposit) { diff --git a/src/app/shared/services/store-route.service.ts b/src/app/shared/services/store-route.service.ts index 9198dd1e5..9b53bbab5 100644 --- a/src/app/shared/services/store-route.service.ts +++ b/src/app/shared/services/store-route.service.ts @@ -35,7 +35,7 @@ export class StoreRouteService extends AbstractStoreRouteService { super(environment); } - protected getCreateRouteInternal(state: StateEnum): string | undefined { + protected _getCreateRouteInternal(state: StateEnum): string | undefined { if (state === StateEnum.deposit) { return RoutesEnum.depositCreate; } @@ -99,7 +99,7 @@ export class StoreRouteService extends AbstractStoreRouteService { return undefined; } - protected getDetailRouteInternal(state: StateEnum): string | undefined { + protected _getDetailRouteInternal(state: StateEnum): string | undefined { if (state === StateEnum.deposit) { return RoutesEnum.depositDetail; } @@ -184,7 +184,7 @@ export class StoreRouteService extends AbstractStoreRouteService { return undefined; } - protected getRootRouteInternal(state: StateEnum): string | undefined { + protected _getRootRouteInternal(state: StateEnum): string | undefined { if (state === StateEnum.deposit) { return RoutesEnum.deposit; } diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 28079d528..cf2c0f7db 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -257,8 +257,8 @@ const modules = [ ], }) export class SharedModule { - constructor(private library: FaIconLibrary) { + constructor(private readonly _library: FaIconLibrary) { // Fontawesome library - library.addIconPacks(fas); + _library.addIconPacks(fas); } } diff --git a/src/app/shared/stores/archive-acl/shared-archive-acl.state.ts b/src/app/shared/stores/archive-acl/shared-archive-acl.state.ts index 2e44a4e6d..9ec60eb55 100644 --- a/src/app/shared/stores/archive-acl/shared-archive-acl.state.ts +++ b/src/app/shared/stores/archive-acl/shared-archive-acl.state.ts @@ -52,11 +52,11 @@ export interface SharedArchiveAclStateModel extends ResourceStateModel<ArchiveAC children: [], }) export class SharedArchiveAclState extends ResourceState<SharedArchiveAclStateModel, ArchiveACL> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedArchiveAclActionNameSpace, notificationResourceCreateFailTextToTranslate: MARK_AS_TRANSLATABLE("archiveAcl.create.notification.fail"), notificationResourceCreateSuccessTextToTranslate: MARK_AS_TRANSLATABLE("archiveAcl.create.notification.success"), diff --git a/src/app/shared/stores/archive-type/shared-archive-type.state.ts b/src/app/shared/stores/archive-type/shared-archive-type.state.ts index 0b8abb9d9..856f1a1a1 100644 --- a/src/app/shared/stores/archive-type/shared-archive-type.state.ts +++ b/src/app/shared/stores/archive-type/shared-archive-type.state.ts @@ -77,11 +77,11 @@ export interface SharedArchiveTypeStateModel extends ResourceStateModel<ArchiveT children: [], }) export class SharedArchiveTypeState extends ResourceState<SharedArchiveTypeStateModel, ArchiveType> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedArchiveTypeActionNameSpace, }); } @@ -95,7 +95,7 @@ export class SharedArchiveTypeState extends ResourceState<SharedArchiveTypeState ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.getByIdInPath<string[]>(this._urlResource + urlSeparator + ApiActionNameEnum.LIST_REFERENCE_TYPES) + return this._apiService.getByIdInPath<string[]>(this._urlResource + urlSeparator + ApiActionNameEnum.LIST_REFERENCE_TYPES) .pipe( tap(listMasterTypesNames => ctx.dispatch(new SharedArchiveTypeAction.GetListMasterTypesNamesSuccess(action, listMasterTypesNames))), catchError((error: SolidifyHttpErrorResponseModel) => { @@ -128,7 +128,7 @@ export class SharedArchiveTypeState extends ResourceState<SharedArchiveTypeState const queryParameters = new QueryParameters(environment.maximalPageSizeToRetrievePaginationInfo); const search = QueryParametersUtil.getSearchItems(queryParameters); MappingObjectUtil.set(search, "masterType.resId", "true"); - return this.apiService.get<ArchiveType>(this._urlResource, queryParameters) + return this._apiService.get<ArchiveType>(this._urlResource, queryParameters) .pipe( tap(listMasterTypes => ctx.dispatch(new SharedArchiveTypeAction.GetListMasterTypesSuccess(action, listMasterTypes._data))), catchError((error: SolidifyHttpErrorResponseModel) => { diff --git a/src/app/shared/stores/archive/shared-archive.state.ts b/src/app/shared/stores/archive/shared-archive.state.ts index 9f06860f1..05e794996 100644 --- a/src/app/shared/stores/archive/shared-archive.state.ts +++ b/src/app/shared/stores/archive/shared-archive.state.ts @@ -121,27 +121,27 @@ export interface SharedArchiveStateModel extends ResourceStateModel<Archive> { children: [], }) export class SharedArchiveState extends ResourceState<SharedArchiveStateModel, Archive> { - constructor(protected apiService: ApiService, - protected store: Store, - protected httpClient: HttpClient, - protected notificationService: NotificationService, - protected actions$: Actions, + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _httpClient: HttpClient, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, private readonly _downloadService: DownloadService, private readonly _cookieConsentService: CookieConsentService) { - super(apiService, store, notificationService, actions$, { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedArchiveActionNameSpace, }); } - private readonly PATH_FILTER: string = "query"; + private readonly _PATH_FILTER: string = "query"; protected get _urlResource(): string { return ApiEnum.accessPublicMetadata; } - private readonly IS_POOLING_KEY: keyof SharedArchiveStateModel = "isPooling"; - private readonly IS_PENDING_REQUEST_KEY: keyof SharedArchiveStateModel = "isPendingRequest"; - private readonly IS_FIRST_TIME_ERROR_KEY: keyof SharedArchiveStateModel = "isFirstTimeError"; + private readonly _IS_POOLING_KEY: keyof SharedArchiveStateModel = "isPooling"; + private readonly _IS_PENDING_REQUEST_KEY: keyof SharedArchiveStateModel = "isPendingRequest"; + private readonly _IS_FIRST_TIME_ERROR_KEY: keyof SharedArchiveStateModel = "isFirstTimeError"; @Selector() static isLoading(state: SharedArchiveStateModel): boolean { @@ -183,7 +183,7 @@ export class SharedArchiveState extends ResourceState<SharedArchiveStateModel, A // }]; } - MappingObjectUtil.set(queryParameters.search.searchItems, this.PATH_FILTER, searchValue); + MappingObjectUtil.set(queryParameters.search.searchItems, this._PATH_FILTER, searchValue); MappingObjectUtil.delete(queryParameters.search.searchItems, PARAM_QUERY_SEARCH); MappingObjectUtil.delete(queryParameters.search.searchItems, PARAM_QUERY_ORGUNIT); queryParameters.paging.pageSize = 5; @@ -207,9 +207,9 @@ export class SharedArchiveState extends ResourceState<SharedArchiveStateModel, A // params: queryParametersHttp, // }, // ).pipe( - return this.apiService.get<Metadata>(this._urlResource + urlSeparator + ApiActionNameEnum.SEARCH, queryParameters) + return this._apiService.get<Metadata>(this._urlResource + urlSeparator + ApiActionNameEnum.SEARCH, queryParameters) .pipe( - action.cancelIncomplete ? StoreUtil.cancelUncompleted(ctx, this.actions$, [this._nameSpace.GetAll, Navigate]) : pipe(), + action.cancelIncomplete ? StoreUtil.cancelUncompleted(ctx, this._actions$, [this._nameSpace.GetAll, Navigate]) : pipe(), map((collection: CollectionTyped<Metadata>) => { // TODO ADD ON SOLIDIFY METHOD THAT ALLOW TO TRANSFORM RESULT RETURNED FROM BACKEND const collectionArchive = { @@ -242,9 +242,9 @@ export class SharedArchiveState extends ResourceState<SharedArchiveStateModel, A queryParameters: queryParameters, }); - return this.apiService.get<Metadata>(this._urlResource + urlSeparator + ApiActionNameEnum.SEARCH, ctx.getState().queryParameters) + return this._apiService.get<Metadata>(this._urlResource + urlSeparator + ApiActionNameEnum.SEARCH, ctx.getState().queryParameters) .pipe( - StoreUtil.cancelUncompleted(ctx, this.actions$, [this._nameSpace.GetAll, Navigate]), + StoreUtil.cancelUncompleted(ctx, this._actions$, [this._nameSpace.GetAll, Navigate]), map((collection: CollectionTyped<Metadata>) => { // TODO ADD ON SOLIDIFY METHOD THAT ALLOW TO TRANSFORM RESULT RETURNED FROM BACKEND const collectionArchive = { @@ -271,7 +271,7 @@ export class SharedArchiveState extends ResourceState<SharedArchiveStateModel, A current: undefined, }); - return this.apiService.getById<Metadata>(this._urlResource, action.id) + return this._apiService.getById<Metadata>(this._urlResource, action.id) .pipe( tap(model => ctx.dispatch(new SharedArchiveAction.GetByIdSuccess(action, ArchiveHelper.adaptArchiveMetadataInArchive(model)))), catchError((error: SolidifyHttpErrorResponseModel) => { @@ -298,7 +298,7 @@ export class SharedArchiveState extends ResourceState<SharedArchiveStateModel, A isLoadingCounter: ctx.getState().isLoadingCounter + 1, listPendingResId: [...(isNullOrUndefined(ctx.getState().listPendingResId) ? [] : ctx.getState().listPendingResId), action.resId], }); - return this.apiService.getById<Metadata>(this._urlResource, action.resId) + return this._apiService.getById<Metadata>(this._urlResource, action.resId) .pipe( map((model: Metadata) => { const archive = ArchiveHelper.adaptArchiveMetadataInArchive(model); @@ -318,7 +318,7 @@ export class SharedArchiveState extends ResourceState<SharedArchiveStateModel, A this._cookieConsentService.notifyFeatureDisabledBecauseCookieDeclined(CookieType.cookie, CookiePartialEnum.downloadToken); return; } - this.notificationService.show({ + this._notificationService.show({ durationInSecond: 10, data: { message: MARK_AS_TRANSLATABLE("home.archive.browsing.download.notification.inPreparation"), @@ -385,7 +385,7 @@ export class SharedArchiveState extends ResourceState<SharedArchiveStateModel, A let headers = new HttpHeaders(); headers = headers.set("Content-Type", "text/plain;charset=UTF-8"); - return this.httpClient.get(this._urlResource + urlSeparator + resId + return this._httpClient.get(this._urlResource + urlSeparator + resId + urlSeparator + ApiActionNameEnum.DOWNLOAD_STATUS, { headers, responseType: "text", @@ -402,7 +402,7 @@ export class SharedArchiveState extends ResourceState<SharedArchiveStateModel, A private _prepareDownload(ctx: StateContext<SharedArchiveStateModel>, resId: string): Observable<any> { let headers = new HttpHeaders(); headers = headers.set("Content-Type", "text/plain;charset=UTF-8"); - return this.httpClient.post(this._urlResource + urlSeparator + resId + return this._httpClient.post(this._urlResource + urlSeparator + resId + urlSeparator + ApiActionNameEnum.PREPARE_DOWNLOAD, { headers, responseType: "text", @@ -419,31 +419,31 @@ export class SharedArchiveState extends ResourceState<SharedArchiveStateModel, A @Action(SharedArchiveAction.DownloadFail) downloadFail(ctx: StateContext<SharedArchiveStateModel>, action: SharedArchiveAction.DownloadFail): void { - this.notificationService.showError(action.customMessageToTranslate ?? LabelTranslateEnum.fileDownloadFail); + this._notificationService.showError(action.customMessageToTranslate ?? LabelTranslateEnum.fileDownloadFail); } private _getIsPooling(ctx: StateContext<SharedArchiveStateModel>, action: SharedArchiveAction.Download): boolean { - return this._isIncludedInList(ctx, action, this.IS_POOLING_KEY); + return this._isIncludedInList(ctx, action, this._IS_POOLING_KEY); } private _setIsPooling(ctx: StateContext<SharedArchiveStateModel>, action: SharedArchiveAction.Download, toAdd: boolean): void { - return this._setInList(ctx, action, this.IS_POOLING_KEY, toAdd); + return this._setInList(ctx, action, this._IS_POOLING_KEY, toAdd); } private _getIsPendingRequest(ctx: StateContext<SharedArchiveStateModel>, action: SharedArchiveAction.Download): boolean { - return this._isIncludedInList(ctx, action, this.IS_PENDING_REQUEST_KEY); + return this._isIncludedInList(ctx, action, this._IS_PENDING_REQUEST_KEY); } private _setIsPendingRequest(ctx: StateContext<SharedArchiveStateModel>, action: SharedArchiveAction.Download, toAdd: boolean): void { - return this._setInList(ctx, action, this.IS_PENDING_REQUEST_KEY, toAdd); + return this._setInList(ctx, action, this._IS_PENDING_REQUEST_KEY, toAdd); } private _getIsFirstTimeError(ctx: StateContext<SharedArchiveStateModel>, action: SharedArchiveAction.Download): boolean { - return this._isIncludedInList(ctx, action, this.IS_FIRST_TIME_ERROR_KEY); + return this._isIncludedInList(ctx, action, this._IS_FIRST_TIME_ERROR_KEY); } private _setIsFirstTimeError(ctx: StateContext<SharedArchiveStateModel>, action: SharedArchiveAction.Download, toAdd: boolean): void { - return this._setInList(ctx, action, this.IS_FIRST_TIME_ERROR_KEY, toAdd); + return this._setInList(ctx, action, this._IS_FIRST_TIME_ERROR_KEY, toAdd); } private _isIncludedInList(ctx: StateContext<SharedArchiveStateModel>, action: SharedArchiveAction.Download, key: keyof SharedArchiveStateModel): boolean { diff --git a/src/app/shared/stores/contributor/shared-contributor.state.ts b/src/app/shared/stores/contributor/shared-contributor.state.ts index c0e424b5a..a5627314c 100644 --- a/src/app/shared/stores/contributor/shared-contributor.state.ts +++ b/src/app/shared/stores/contributor/shared-contributor.state.ts @@ -55,11 +55,11 @@ export interface SharedContributorStateModel extends ResourceStateModel<Contribu }, }) export class SharedContributorState extends ResourceState<SharedContributorStateModel, Contributor> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedContributorActionNameSpace, }); } diff --git a/src/app/shared/stores/deposit/shared-deposit.state.ts b/src/app/shared/stores/deposit/shared-deposit.state.ts index d249a4d16..f06e513d5 100644 --- a/src/app/shared/stores/deposit/shared-deposit.state.ts +++ b/src/app/shared/stores/deposit/shared-deposit.state.ts @@ -55,11 +55,11 @@ export interface SharedDepositStateModel extends ResourceStateModel<Deposit> { }, }) export class SharedDepositState extends ResourceState<SharedDepositStateModel, Deposit> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedDepositActionNameSpace, }); } diff --git a/src/app/shared/stores/dissemination-policy/shared-dissemination-policy.state.ts b/src/app/shared/stores/dissemination-policy/shared-dissemination-policy.state.ts index 8135e0f7a..be574cf08 100644 --- a/src/app/shared/stores/dissemination-policy/shared-dissemination-policy.state.ts +++ b/src/app/shared/stores/dissemination-policy/shared-dissemination-policy.state.ts @@ -57,11 +57,11 @@ export interface SharedDisseminationPolicyStateModel extends ResourceStateModel< }, }) export class SharedDisseminationPolicyState extends ResourceState<SharedDisseminationPolicyStateModel, DisseminationPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedDisseminationPolicyActionNameSpace, }); } diff --git a/src/app/shared/stores/dlcm-resource/dlcm-resource.state.ts b/src/app/shared/stores/dlcm-resource/dlcm-resource.state.ts index 581da247d..3ddcdaf6d 100644 --- a/src/app/shared/stores/dlcm-resource/dlcm-resource.state.ts +++ b/src/app/shared/stores/dlcm-resource/dlcm-resource.state.ts @@ -60,12 +60,12 @@ export const defaultDlcmResourceStateInitValue: DlcmResourceStateModel<BaseResou export abstract class DlcmResourceState<TResource extends BaseResourceType> extends ResourceState<BaseStateModel, TResource> { protected readonly _nameSpace: DlcmResourceNameSpace; - protected constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - protected options: DlcmResourceOptions) { - super(apiService, store, notificationService, actions$, options); + protected constructor(protected _apiService: ApiService, + protected _store: Store, + protected _notificationService: NotificationService, + protected _actions$: Actions, + protected _options: DlcmResourceOptions) { + super(_apiService, _store, _notificationService, _actions$, _options); } @RegisterDefaultAction((dlcmResourceNameSpace: DlcmResourceNameSpace) => dlcmResourceNameSpace.History, {}, ResourceState) @@ -73,7 +73,7 @@ export abstract class DlcmResourceState<TResource extends BaseResourceType> exte ctx.patchState({ isLoadingHistoryCounter: ctx.getState().isLoadingHistoryCounter + 1, }); - return this.apiService.get<StatusHistory>(`${this._urlResource}/${action.id}/${ApiResourceNameEnum.HISTORY}`, null) + return this._apiService.get<StatusHistory>(`${this._urlResource}/${action.id}/${ApiResourceNameEnum.HISTORY}`, null) .pipe( tap((list: CollectionTyped<StatusHistory>) => { ctx.dispatch(DlcmResourceActionHelper.historySuccess(this._nameSpace, action, list)); diff --git a/src/app/shared/stores/funding-agency/shared-funding-agency.state.ts b/src/app/shared/stores/funding-agency/shared-funding-agency.state.ts index 424a227bf..0896f0e18 100644 --- a/src/app/shared/stores/funding-agency/shared-funding-agency.state.ts +++ b/src/app/shared/stores/funding-agency/shared-funding-agency.state.ts @@ -53,11 +53,11 @@ export interface SharedFundingAgencyStateModel extends ResourceStateModel<Fundin }, }) export class SharedFundingAgencyState extends ResourceState<SharedFundingAgencyStateModel, FundingAgency> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedFundingAgencyActionNameSpace, }); } diff --git a/src/app/shared/stores/index-field-alias/shared-index-field-alias.state.ts b/src/app/shared/stores/index-field-alias/shared-index-field-alias.state.ts index 7c0372fd8..c72d977b0 100644 --- a/src/app/shared/stores/index-field-alias/shared-index-field-alias.state.ts +++ b/src/app/shared/stores/index-field-alias/shared-index-field-alias.state.ts @@ -53,11 +53,11 @@ export interface SharedIndexFieldAliasStateModel extends ResourceStateModel<Inde }, }) export class SharedIndexFieldAliasState extends ResourceState<SharedIndexFieldAliasStateModel, IndexFieldAlias> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedIndexFieldAliasActionNameSpace, }); } diff --git a/src/app/shared/stores/institution/shared-institution.state.ts b/src/app/shared/stores/institution/shared-institution.state.ts index ed94bb3a5..80a40820b 100644 --- a/src/app/shared/stores/institution/shared-institution.state.ts +++ b/src/app/shared/stores/institution/shared-institution.state.ts @@ -53,11 +53,11 @@ export interface SharedInstitutionStateModel extends ResourceStateModel<Institut }, }) export class SharedInstitutionState extends ResourceState<SharedInstitutionStateModel, Institution> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedInstitutionActionNameSpace, }); } diff --git a/src/app/shared/stores/language/shared-language.state.ts b/src/app/shared/stores/language/shared-language.state.ts index e797b2464..78d7a13ce 100644 --- a/src/app/shared/stores/language/shared-language.state.ts +++ b/src/app/shared/stores/language/shared-language.state.ts @@ -53,11 +53,11 @@ export interface SharedLanguageStateModel extends ResourceStateModel<Language> { }, }) export class SharedLanguageState extends ResourceState<SharedLanguageStateModel, Language> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedLanguageActionNameSpace, }); } diff --git a/src/app/shared/stores/license/shared-license.state.ts b/src/app/shared/stores/license/shared-license.state.ts index a3d079c86..dbd5f8654 100644 --- a/src/app/shared/stores/license/shared-license.state.ts +++ b/src/app/shared/stores/license/shared-license.state.ts @@ -55,11 +55,11 @@ export interface SharedLicenseStateModel extends ResourceStateModel<License> { }, }) export class SharedLicenseState extends ResourceState<SharedLicenseStateModel, License> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedLicenseActionNameSpace, }); } diff --git a/src/app/shared/stores/metadata-type/shared-metadata-type.state.ts b/src/app/shared/stores/metadata-type/shared-metadata-type.state.ts index d23153ec2..a04047335 100644 --- a/src/app/shared/stores/metadata-type/shared-metadata-type.state.ts +++ b/src/app/shared/stores/metadata-type/shared-metadata-type.state.ts @@ -55,11 +55,11 @@ export interface SharedMetadataTypeStateModel extends ResourceStateModel<Metadat }, }) export class SharedMetadataTypeState extends ResourceState<SharedMetadataTypeStateModel, MetadataType> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedMetadataTypeActionNameSpace, }); } diff --git a/src/app/shared/stores/notification/shared-notification.state.ts b/src/app/shared/stores/notification/shared-notification.state.ts index 438a6971c..29e66d311 100644 --- a/src/app/shared/stores/notification/shared-notification.state.ts +++ b/src/app/shared/stores/notification/shared-notification.state.ts @@ -68,11 +68,11 @@ export interface SharedNotificationStateModel extends ResourceStateModel<Notific }, }) export class SharedNotificationState extends ResourceState<SharedNotificationStateModel, NotificationDlcm> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedNotificationActionNameSpace, notificationResourceCreateSuccessTextToTranslate: MARK_AS_TRANSLATABLE("notification.notification.requestSendWithSuccess"), notificationResourceCreateFailTextToTranslate: MARK_AS_TRANSLATABLE("notification.notification.unableToSendRequest"), @@ -90,7 +90,7 @@ export class SharedNotificationState extends ResourceState<SharedNotificationSta isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); const url = this._urlResource; - return this.apiService.post<NotificationDlcm>(url, action.modelFormControlEvent.model) + return this._apiService.post<NotificationDlcm>(url, action.modelFormControlEvent.model) .pipe( tap(() => { ctx.dispatch(new SharedNotificationAction.CreateSuccess(action, action.modelFormControlEvent.model)); @@ -99,7 +99,7 @@ export class SharedNotificationState extends ResourceState<SharedNotificationSta ctx.dispatch(new SharedNotificationAction.CreateFail(action, error)); throw new SolidifyStateError(this, error); }), - StoreUtil.catchValidationErrors(ctx, action.modelFormControlEvent, this.notifierService), + StoreUtil.catchValidationErrors(ctx, action.modelFormControlEvent, this._notificationService), ); } diff --git a/src/app/shared/stores/oai-metadata-prefix/shared-oai-metadata-prefix.state.ts b/src/app/shared/stores/oai-metadata-prefix/shared-oai-metadata-prefix.state.ts index b2bd8ab86..c50416b5b 100644 --- a/src/app/shared/stores/oai-metadata-prefix/shared-oai-metadata-prefix.state.ts +++ b/src/app/shared/stores/oai-metadata-prefix/shared-oai-metadata-prefix.state.ts @@ -55,11 +55,11 @@ export interface SharedOaiMetadataPrefixStateModel extends ResourceStateModel<Oa }, }) export class SharedOaiMetadataPrefixState extends ResourceState<SharedOaiMetadataPrefixStateModel, OaiMetadataPrefix> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedOaiMetadataPrefixActionNameSpace, }); } diff --git a/src/app/shared/stores/oai-set/shared-oai-set.state.ts b/src/app/shared/stores/oai-set/shared-oai-set.state.ts index da9beb1c4..8efccc5fa 100644 --- a/src/app/shared/stores/oai-set/shared-oai-set.state.ts +++ b/src/app/shared/stores/oai-set/shared-oai-set.state.ts @@ -55,11 +55,11 @@ export interface SharedOaiSetStateModel extends ResourceStateModel<OaiSet> { }, }) export class SharedOaiSetState extends ResourceState<SharedOaiSetStateModel, OaiSet> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedOaiSetActionNameSpace, }); } diff --git a/src/app/shared/stores/order/shared-order.state.ts b/src/app/shared/stores/order/shared-order.state.ts index d3455fcd5..c38d99499 100644 --- a/src/app/shared/stores/order/shared-order.state.ts +++ b/src/app/shared/stores/order/shared-order.state.ts @@ -55,11 +55,11 @@ export interface SharedOrderStateModel extends ResourceStateModel<Order> { }, }) export class SharedOrderState extends ResourceState<SharedOrderStateModel, Order> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedOrderActionNameSpace, }); } diff --git a/src/app/shared/stores/organizational-unit/dissemination-policy/shared-organizational.unit-dissemination-policy.state.ts b/src/app/shared/stores/organizational-unit/dissemination-policy/shared-organizational.unit-dissemination-policy.state.ts index d5119c4ff..06e2d9ad1 100644 --- a/src/app/shared/stores/organizational-unit/dissemination-policy/shared-organizational.unit-dissemination-policy.state.ts +++ b/src/app/shared/stores/organizational-unit/dissemination-policy/shared-organizational.unit-dissemination-policy.state.ts @@ -59,11 +59,11 @@ export interface SharedOrganizationalUnitDisseminationPolicyStateModel extends R }, }) export class SharedOrganizationalUnitDisseminationPolicyState extends Relation2TiersState<SharedOrganizationalUnitDisseminationPolicyStateModel, DisseminationPolicy, OrganizationalUnitDisseminationPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedOrgUnitDisseminationPolicyActionNameSpace, resourceName: ApiResourceNameEnum.DISSEMINATION_POLICY, }); diff --git a/src/app/shared/stores/organizational-unit/preservation-policy/shared-organizational-unit-preservation-policy.state.ts b/src/app/shared/stores/organizational-unit/preservation-policy/shared-organizational-unit-preservation-policy.state.ts index 50b0f1977..02d0fe3d0 100644 --- a/src/app/shared/stores/organizational-unit/preservation-policy/shared-organizational-unit-preservation-policy.state.ts +++ b/src/app/shared/stores/organizational-unit/preservation-policy/shared-organizational-unit-preservation-policy.state.ts @@ -57,11 +57,11 @@ export interface SharedOrganizationalUnitPreservationPolicyStateModel extends Re }, }) export class SharedOrganizationalUnitPreservationPolicyState extends Relation2TiersState<SharedOrganizationalUnitPreservationPolicyStateModel, PreservationPolicy, OrganizationalUnitPreservationPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedOrgUnitPreservationPolicyActionNameSpace, resourceName: ApiResourceNameEnum.PRES_POLICY, }); diff --git a/src/app/shared/stores/organizational-unit/shared-organizational-unit.state.ts b/src/app/shared/stores/organizational-unit/shared-organizational-unit.state.ts index 6ba0e2bf0..029901615 100644 --- a/src/app/shared/stores/organizational-unit/shared-organizational-unit.state.ts +++ b/src/app/shared/stores/organizational-unit/shared-organizational-unit.state.ts @@ -88,17 +88,17 @@ export interface SharedOrganizationalUnitStateModel extends ResourceStateModel<O }) export class SharedOrganizationalUnitState extends ResourceState<SharedOrganizationalUnitStateModel, OrganizationalUnit> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedOrganizationalUnitActionNameSpace, }); } protected get _urlResource(): string { - let isLogged = MemoizedUtil.selectSnapshot(this.store, AppState, state => state.isLoggedIn); + let isLogged = MemoizedUtil.selectSnapshot(this._store, AppState, state => state.isLoggedIn); if (isNullOrUndefined(isLogged)) { isLogged = false; } diff --git a/src/app/shared/stores/organizational-unit/submission-policy/shared-organizational-unit-submission-policy.state.ts b/src/app/shared/stores/organizational-unit/submission-policy/shared-organizational-unit-submission-policy.state.ts index c710d38c1..61f0b7cac 100644 --- a/src/app/shared/stores/organizational-unit/submission-policy/shared-organizational-unit-submission-policy.state.ts +++ b/src/app/shared/stores/organizational-unit/submission-policy/shared-organizational-unit-submission-policy.state.ts @@ -57,11 +57,11 @@ export interface SharedOrganizationalUnitSubmissionPolicyStateModel extends Rela }, }) export class SharedOrganizationalUnitSubmissionPolicyState extends Relation2TiersState<SharedOrganizationalUnitSubmissionPolicyStateModel, SubmissionPolicy, OrganizationalUnitSubmissionPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedOrgUnitSubmissionPolicyStateNamespace, resourceName: ApiResourceNameEnum.SUB_POLICY, }); diff --git a/src/app/shared/stores/person/shared-person.state.ts b/src/app/shared/stores/person/shared-person.state.ts index 14ed92081..bc6de5d52 100644 --- a/src/app/shared/stores/person/shared-person.state.ts +++ b/src/app/shared/stores/person/shared-person.state.ts @@ -86,11 +86,11 @@ export interface SharedPersonStateModel extends ResourceStateModel<Person> { }, }) export class SharedPersonState extends ResourceState<SharedPersonStateModel, Person> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedPersonActionNameSpace, notificationResourceCreateSuccessTextToTranslate: MARK_AS_TRANSLATABLE("shared.person.notification.resource.create"), notificationResourceDeleteSuccessTextToTranslate: MARK_AS_TRANSLATABLE("shared.person.notification.resource.delete"), @@ -116,15 +116,15 @@ export class SharedPersonState extends ResourceState<SharedPersonStateModel, Per { action: new SharedPersonAction.SearchPerson(action.person), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.SearchPersonSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.SearchPersonFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.SearchPersonSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.SearchPersonFail)), ], }, { action: new SharedPersonAction.SearchInstitutions(), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.SearchInstitutionsSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.SearchInstitutionsFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.SearchInstitutionsSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.SearchInstitutionsFail)), ], }, ]).pipe( @@ -162,7 +162,7 @@ export class SharedPersonState extends ResourceState<SharedPersonStateModel, Per queryParameters.search = { searchItems: searchItems, }; - return this.apiService.get<Person>(this._urlResource, queryParameters) + return this._apiService.get<Person>(this._urlResource, queryParameters) .pipe( tap(collection => { ctx.dispatch(new SharedPersonAction.SearchPersonSuccess(action, collection._data)); @@ -190,8 +190,8 @@ export class SharedPersonState extends ResourceState<SharedPersonStateModel, Per listActionSubActionCompletionsWrapper.push({ action: new SharedPersonAction.SearchPersonInstitution(p), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.SearchPersonInstitutionSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.SearchPersonInstitutionFail)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.SearchPersonInstitutionSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(SharedPersonAction.SearchPersonInstitutionFail)), ], } as ActionSubActionCompletionsWrapper); }); @@ -216,7 +216,7 @@ export class SharedPersonState extends ResourceState<SharedPersonStateModel, Per @Action(SharedPersonAction.SearchPersonInstitution) searchPersonInstitutions(ctx: StateContext<SharedPersonStateModel>, action: SharedPersonAction.SearchPersonInstitution): Observable<CollectionTyped<Institution>> { - return this.apiService.get<Institution>(this._urlResource + urlSeparator + action.person.resId + urlSeparator + ApiResourceNameEnum.INSTITUTION, null) + return this._apiService.get<Institution>(this._urlResource + urlSeparator + action.person.resId + urlSeparator + ApiResourceNameEnum.INSTITUTION, null) .pipe( tap(collectionInstitutions => { ctx.dispatch(new SharedPersonAction.SearchPersonInstitutionSuccess(action, action.person, collectionInstitutions._data)); @@ -279,9 +279,9 @@ export class SharedPersonState extends ResourceState<SharedPersonStateModel, Per if (onlyWithUser) { url = this._urlResource + urlSeparator + ApiActionNameEnum.SEARCH_WITH_USER; } - return this.apiService.get<Person>(url, ctx.getState().queryParameters) + return this._apiService.get<Person>(url, ctx.getState().queryParameters) .pipe( - StoreUtil.cancelUncompleted(ctx, this.actions$, [SharedPersonAction.GetAll]), + StoreUtil.cancelUncompleted(ctx, this._actions$, [SharedPersonAction.GetAll]), tap((collection: CollectionTyped<Person>) => { ctx.dispatch(new SharedPersonAction.GetAllSuccess(action, collection)); }), diff --git a/src/app/shared/stores/preservation-policy/shared-preservation-policy.state.ts b/src/app/shared/stores/preservation-policy/shared-preservation-policy.state.ts index 4b81891ea..20d841dbb 100644 --- a/src/app/shared/stores/preservation-policy/shared-preservation-policy.state.ts +++ b/src/app/shared/stores/preservation-policy/shared-preservation-policy.state.ts @@ -57,11 +57,11 @@ export interface SharedPreservationPolicyStateModel extends ResourceStateModel<P }, }) export class SharedPreservationPolicyState extends ResourceState<SharedPreservationPolicyStateModel, PreservationPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedPreservationPolicyActionNameSpace, }); } diff --git a/src/app/shared/stores/research-domain/shared-research-domain.state.ts b/src/app/shared/stores/research-domain/shared-research-domain.state.ts index 80f695945..3833d9e29 100644 --- a/src/app/shared/stores/research-domain/shared-research-domain.state.ts +++ b/src/app/shared/stores/research-domain/shared-research-domain.state.ts @@ -73,11 +73,11 @@ export interface SharedResearchDomainStateModel extends ResourceStateModel<Resea }, }) export class SharedResearchDomainState extends ResourceState<SharedResearchDomainStateModel, ResearchDomain> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedResearchDomainActionNameSpace, }); } @@ -92,7 +92,7 @@ export class SharedResearchDomainState extends ResourceState<SharedResearchDomai isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.getByIdInPath<string[]>(`${this._urlResource}/${ApiActionNameEnum.LIST_RESEARCH_DOMAIN_SOURCES}`) + return this._apiService.getByIdInPath<string[]>(`${this._urlResource}/${ApiActionNameEnum.LIST_RESEARCH_DOMAIN_SOURCES}`) .pipe( tap(result => { ctx.dispatch(new SharedResearchDomainAction.GetSourceSuccess(action, result)); @@ -135,9 +135,9 @@ export class SharedResearchDomainState extends ResourceState<SharedResearchDomai isLoadingCounter: ctx.getState().isLoadingCounter + 1, queryParameters: StoreUtil.getQueryParametersToApply(action.queryParameters, ctx), }); - return this.apiService.get<ResearchDomain>(url, ctx.getState().queryParameters) + return this._apiService.get<ResearchDomain>(url, ctx.getState().queryParameters) .pipe( - StoreUtil.cancelUncompleted(ctx, this.actions$, [SharedResearchDomainAction.GetAll]), + StoreUtil.cancelUncompleted(ctx, this._actions$, [SharedResearchDomainAction.GetAll]), tap((collection: CollectionTyped<ResearchDomain>) => { ctx.dispatch(new SharedResearchDomainAction.GetAllSuccess(action, collection)); }), diff --git a/src/app/shared/stores/resource-logo/resource-logo.state.ts b/src/app/shared/stores/resource-logo/resource-logo.state.ts index ae63de9f5..345513851 100644 --- a/src/app/shared/stores/resource-logo/resource-logo.state.ts +++ b/src/app/shared/stores/resource-logo/resource-logo.state.ts @@ -75,14 +75,14 @@ export abstract class ResourceLogoState<TStateModel extends BaseStateModel, TRes protected readonly _nameSpace: ResourceLogoNameSpace; - protected constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - protected options: ResourceLogoOptions, + protected constructor(protected _apiService: ApiService, + protected _store: Store, + protected _notificationService: NotificationService, + protected _actions$: Actions, + protected _options: ResourceLogoOptions, protected _httpClient: HttpClient, protected _mode: ResourceLogoStateModeEnum) { - super(apiService, store, notificationService, actions$, options); + super(_apiService, _store, _notificationService, _actions$, _options); } private _getDownloadAction(): ApiActionNameEnum { @@ -202,7 +202,7 @@ export abstract class ResourceLogoState<TStateModel extends BaseStateModel, TRes const formData = new FormData(); formData.append(this._FILE_KEY, action.file, action.file.name); - return this.apiService.upload(`${this._urlLogoResource}/${action.resId}/${this._getUploadAction()}`, formData) + return this._apiService.upload(`${this._urlLogoResource}/${action.resId}/${this._getUploadAction()}`, formData) .pipe( map((event: UploadEventModel) => { switch (event.type) { @@ -249,7 +249,7 @@ export abstract class ResourceLogoState<TStateModel extends BaseStateModel, TRes deletePhoto(ctx: StateContext<ResourceLogoStateModel<TResource>>, action: ResourceLogoAction.DeletePhoto): Observable<any> { this._isLoadingLogo(ctx, true); - return this.apiService.delete(`${this._urlLogoResource}/${action.resId}/${this._getDeleteAction()}`) + return this._apiService.delete(`${this._urlLogoResource}/${action.resId}/${this._getDeleteAction()}`) .pipe( tap((result: any) => { ctx.dispatch(ResourceLogoActionHelper.deletePhotoSuccess(this._nameSpace, action)); diff --git a/src/app/shared/stores/role/shared-role.state.ts b/src/app/shared/stores/role/shared-role.state.ts index 18683dff2..2c3c18c6f 100644 --- a/src/app/shared/stores/role/shared-role.state.ts +++ b/src/app/shared/stores/role/shared-role.state.ts @@ -55,11 +55,11 @@ export interface SharedRoleStateModel extends ResourceStateModel<Role> { }, }) export class SharedRoleState extends ResourceState<SharedRoleStateModel, Role> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedRoleActionNameSpace, }); } diff --git a/src/app/shared/stores/shared.state.ts b/src/app/shared/stores/shared.state.ts index 2abd3b465..b8f572a86 100644 --- a/src/app/shared/stores/shared.state.ts +++ b/src/app/shared/stores/shared.state.ts @@ -50,10 +50,7 @@ import { SharedSubmissionPolicyState, SharedSubmissionPolicyStateModel, } from "@app/shared/stores/submission-policy/shared-submission-policy.state"; -import { - Actions, - State, -} from "@ngxs/store"; +import {State} from "@ngxs/store"; import {StateEnum} from "@shared/enums/state.enum"; import {SharedAipState} from "@shared/features/aip/stores/shared-aip.state"; import { @@ -173,10 +170,4 @@ export interface SharedStateModel extends BaseStateModel { ], }) export class SharedState { - - constructor(private actions$: Actions) { - } } - - - diff --git a/src/app/shared/stores/status-history/status-history.state.ts b/src/app/shared/stores/status-history/status-history.state.ts index 9b28fb70b..8f1f2141f 100644 --- a/src/app/shared/stores/status-history/status-history.state.ts +++ b/src/app/shared/stores/status-history/status-history.state.ts @@ -69,17 +69,17 @@ export abstract class StatusHistoryState<TStateModel extends BaseStateModel, TRe protected abstract get _urlResource(): string; - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - protected options: BaseOptions) { - super(apiService, store, notificationService, actions$, { - nameSpace: options.nameSpace, + constructor(protected _apiService: ApiService, + protected _store: Store, + protected _notificationService: NotificationService, + protected _actions$: Actions, + protected _options: BaseOptions) { + super(_apiService, _store, _notificationService, _actions$, { + nameSpace: _options.nameSpace, }, StatusHistoryState); } - private evaluateSubResourceUrl(parentId: string): string { + private _evaluateSubResourceUrl(parentId: string): string { if (parentId !== null) { return this._urlResource.toString().replace(`{${ApiKeyword.PARENT_ID}}`, parentId); } else { @@ -94,8 +94,8 @@ export abstract class StatusHistoryState<TStateModel extends BaseStateModel, TRe isLoadingCounter: ctx.getState().isLoadingCounter + 1, queryParameters: this.getQueryParametersToApply(action.queryParameters, ctx), }); - const url = this.evaluateSubResourceUrl(action.parentId); - return this.apiService.get<StatusHistory>(`${url}/${action.id}/${ApiResourceNameEnum.HISTORY}`, ctx.getState().queryParameters) + const url = this._evaluateSubResourceUrl(action.parentId); + return this._apiService.get<StatusHistory>(`${url}/${action.id}/${ApiResourceNameEnum.HISTORY}`, ctx.getState().queryParameters) .pipe( tap((list: CollectionTyped<StatusHistory>) => { ctx.dispatch(new this._nameSpace.HistorySuccess(action, list)); diff --git a/src/app/shared/stores/submission-policy/shared-submission-policy.state.ts b/src/app/shared/stores/submission-policy/shared-submission-policy.state.ts index afda28425..b61215794 100644 --- a/src/app/shared/stores/submission-policy/shared-submission-policy.state.ts +++ b/src/app/shared/stores/submission-policy/shared-submission-policy.state.ts @@ -57,11 +57,11 @@ export interface SharedSubmissionPolicyStateModel extends ResourceStateModel<Sub }, }) export class SharedSubmissionPolicyState extends ResourceState<SharedSubmissionPolicyStateModel, SubmissionPolicy> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedSubmissionPolicyActionNameSpace, }); } diff --git a/src/app/shared/stores/user/shared-user.state.ts b/src/app/shared/stores/user/shared-user.state.ts index b2fefa44a..fd5078a0a 100644 --- a/src/app/shared/stores/user/shared-user.state.ts +++ b/src/app/shared/stores/user/shared-user.state.ts @@ -79,11 +79,11 @@ export interface SharedUserStateModel extends ResourceStateModel<User> { }, }) export class SharedUserState extends ResourceState<SharedUserStateModel, User> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: sharedUserActionNameSpace, }); } @@ -115,7 +115,7 @@ export class SharedUserState extends ResourceState<SharedUserStateModel, User> { }); const queryParameter = new QueryParameters(1); MappingObjectUtil.set(queryParameter.search.searchItems, "externalUid", action.externalUid); - return this.apiService.get<User>(this._urlResource, queryParameter) + return this._apiService.get<User>(this._urlResource, queryParameter) .pipe( tap((list) => { if (list._data.length === 0) { @@ -150,7 +150,7 @@ export class SharedUserState extends ResourceState<SharedUserStateModel, User> { list: list, total: list.length, isLoadingCounter: ctx.getState().isLoadingCounter - 1, - listPendingExternalUid: this.getListPendingExternalUidWithValueRemoved(ctx, action.parentAction.externalUid), + listPendingExternalUid: this._getListPendingExternalUidWithValueRemoved(ctx, action.parentAction.externalUid), }); } @@ -158,7 +158,7 @@ export class SharedUserState extends ResourceState<SharedUserStateModel, User> { getByExternalUidFail(ctx: StateContext<SharedUserStateModel>, action: SharedUserAction.GetByExternalUidFail): void { ctx.patchState({ isLoadingCounter: ctx.getState().isLoadingCounter - 1, - listPendingExternalUid: this.getListPendingExternalUidWithValueRemoved(ctx, action.parentAction.externalUid), + listPendingExternalUid: this._getListPendingExternalUidWithValueRemoved(ctx, action.parentAction.externalUid), }); } @@ -188,9 +188,9 @@ export class SharedUserState extends ResourceState<SharedUserStateModel, User> { isLoadingCounter: ctx.getState().isLoadingCounter + 1, queryParameters: StoreUtil.getQueryParametersToApply(action.queryParameters, ctx), }); - return this.apiService.get<User>(url, ctx.getState().queryParameters) + return this._apiService.get<User>(url, ctx.getState().queryParameters) .pipe( - StoreUtil.cancelUncompleted(ctx, this.actions$, [SharedUserAction.GetAll]), + StoreUtil.cancelUncompleted(ctx, this._actions$, [SharedUserAction.GetAll]), tap((collection: CollectionTyped<User>) => { ctx.dispatch(new SharedUserAction.GetAllSuccess(action, collection)); }), @@ -201,7 +201,7 @@ export class SharedUserState extends ResourceState<SharedUserStateModel, User> { ); } - private getListPendingExternalUidWithValueRemoved(ctx: StateContext<SharedUserStateModel>, externalUid: string): string[] { + private _getListPendingExternalUidWithValueRemoved(ctx: StateContext<SharedUserStateModel>, externalUid: string): string[] { let listPendingExternalUid = ctx.getState().listPendingExternalUid; const indexOf = listPendingExternalUid.indexOf(externalUid); if (indexOf === -1) { diff --git a/src/app/shared/utils/metadata.util.ts b/src/app/shared/utils/metadata.util.ts index d1f198f97..1b01a067b 100644 --- a/src/app/shared/utils/metadata.util.ts +++ b/src/app/shared/utils/metadata.util.ts @@ -40,13 +40,13 @@ const DLCM_URI_EMBARGO_ACCESS_LEVEL: string = "https://www.dlcm.ch/access-level/ const DLCM_URI_DATA_TAG: string = "https://www.dlcm.ch/data-tag"; export class MetadataUtil { - private static readonly domParser: DOMParser = new DOMParser(); + private static readonly _domParser: DOMParser = new DOMParser(); - private static parse(metadataXml: string): Document { - return this.domParser.parseFromString(metadataXml, "text/xml"); + private static _parse(metadataXml: string): Document { + return this._domParser.parseFromString(metadataXml, "text/xml"); } - private static prefixNSResolver(prefix: string): string | null { + private static _prefixNSResolver(prefix: string): string | null { if (prefix === "d") { return DATACITE_NAMESPACE; } else { @@ -54,21 +54,21 @@ export class MetadataUtil { } } - private static getInformation(xpath: string, metadata: Metadata): string { + private static _getInformation(xpath: string, metadata: Metadata): string { const metadataXml: string = metadata[MetadataEnum.dataciteXml]; if (isNullOrUndefined(metadataXml)) { // eslint-disable-next-line no-console console.error("metadataXml provided undefined"); return ""; } - const xmlDoc = this.parse(metadataXml); - const result = xmlDoc.evaluate(xpath, xmlDoc, this.prefixNSResolver, XPathResult.STRING_TYPE, null); + const xmlDoc = this._parse(metadataXml); + const result = xmlDoc.evaluate(xpath, xmlDoc, this._prefixNSResolver, XPathResult.STRING_TYPE, null); return result.stringValue; } static getTitle(metadata: Metadata): string { const xpath = "/d:resource/d:titles/d:title"; - return this.getInformation(xpath, metadata); + return this._getInformation(xpath, metadata); } static getOrganizationalUnitResId(metadata: Metadata): string { @@ -87,12 +87,12 @@ export class MetadataUtil { static getPublicationYear(metadata: Metadata): string { const xpath = "/d:resource/d:publicationYear"; - return this.getInformation(xpath, metadata); + return this._getInformation(xpath, metadata); } static getAccessLevel(metadata: Metadata): string { const xpath = `/d:resource/d:rightsList/d:rights[@rightsURI="${DLCM_URI_FINAL_ACCESS_LEVEL}"]`; - return this.getInformation(xpath, metadata); + return this._getInformation(xpath, metadata); } static getDataSensibility(metadata: Metadata): string { @@ -102,54 +102,54 @@ export class MetadataUtil { static getEmbargoAccessLevel(metadata: Metadata): string { const xpath = `/d:resource/d:rightsList/d:rights[@rightsURI="${DLCM_URI_EMBARGO_ACCESS_LEVEL}"]`; - return this.getInformation(xpath, metadata); + return this._getInformation(xpath, metadata); } static getLicenses(metadata: Metadata): string { const xpath = `/d:resource/d:rightsList/d:rights[@rightsURI!="${DLCM_URI_FINAL_ACCESS_LEVEL}" and @rightsURI!="${DLCM_URI_EMBARGO_ACCESS_LEVEL}" and @rightsURI!="${DLCM_URI_DATA_TAG}"]`; - return this.getInformation(xpath, metadata); + return this._getInformation(xpath, metadata); } static getDescriptionAbstract(metadata: Metadata): string { const xpath = `/d:resource/d:descriptions/d:description[@descriptionType="Abstract"]`; - return this.getInformation(xpath, metadata); + return this._getInformation(xpath, metadata); } static getDescriptionOther(metadata: Metadata): string { const xpath = `/d:resource/d:descriptions/d:description[@descriptionType="Other"]`; - return this.getInformation(xpath, metadata); + return this._getInformation(xpath, metadata); } static getDescriptionTechnicalInfo(metadata: Metadata): string { const xpath = `/d:resource/d:descriptions/d:description[@descriptionType="TechnicalInfo"]`; - return this.getInformation(xpath, metadata); + return this._getInformation(xpath, metadata); } static getDescriptionTableOfContents(metadata: Metadata): string { const xpath = `/d:resource/d:descriptions/d:description[@descriptionType="TableOfContents"]`; - return this.getInformation(xpath, metadata); + return this._getInformation(xpath, metadata); } static getDescriptionSeriesInformation(metadata: Metadata): string { const xpath = `/d:resource/d:descriptions/d:description[@descriptionType="SeriesInformation"]`; - return this.getInformation(xpath, metadata); + return this._getInformation(xpath, metadata); } static getDescriptionMethods(metadata: Metadata): string { const xpath = `/d:resource/d:descriptions/d:description[@descriptionType="Methods"]`; - return this.getInformation(xpath, metadata); + return this._getInformation(xpath, metadata); } static getDOI(metadata: Metadata): string { const xpath = "/d:resource/d:identifier[@identifierType='DOI']"; - return this.getInformation(xpath, metadata); + return this._getInformation(xpath, metadata); } static getContributors(metadata: Metadata): ArchiveContributor[] { const xpath = "/d:resource/d:creators/d:creator"; const results = []; - const xmlDoc = this.parse(metadata[MetadataEnum.dataciteXml]); - const result = xmlDoc.evaluate(xpath, xmlDoc, this.prefixNSResolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + const xmlDoc = this._parse(metadata[MetadataEnum.dataciteXml]); + const result = xmlDoc.evaluate(xpath, xmlDoc, this._prefixNSResolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (let i = 0, length = result.snapshotLength; i < length; ++i) { const contributor = { affiliation: [], @@ -178,23 +178,23 @@ export class MetadataUtil { static getType(metadata: Metadata): string { const xpath = "/d:resource/d:resourceType"; - return this.getInformation(xpath, metadata); + return this._getInformation(xpath, metadata); } static getEmbargoEndDate(metadata: Metadata): Date | null { - return this.getDate("Available", metadata); + return this._getDate("Available", metadata); } static getAcceptedDate(metadata: Metadata): Date | null { - return this.getDate("Accepted", metadata); + return this._getDate("Accepted", metadata); } static getIssuedDate(metadata: Metadata): Date | null { - return this.getDate("Issued", metadata); + return this._getDate("Issued", metadata); } static getSubmittedDate(metadata: Metadata): Date | null { - return this.getDate("Submitted", metadata); + return this._getDate("Submitted", metadata); } static getSize(metadata: Metadata): number | null { @@ -208,12 +208,12 @@ export class MetadataUtil { return metadata[MetadataEnum.aipFiles].toString(); } - private static getDate(name: string, metadata: Metadata): Date | null { + private static _getDate(name: string, metadata: Metadata): Date | null { if (isNullOrUndefined(metadata)) { return null; } const xpath = `/d:resource/d:dates/d:date[@dateType="${name}"]`; - const result = this.getInformation(xpath, metadata); + const result = this._getInformation(xpath, metadata); if (isNullOrUndefined(result)) { return null; } diff --git a/src/app/stores/app.state.ts b/src/app/stores/app.state.ts index e701259e6..96566eb05 100644 --- a/src/app/stores/app.state.ts +++ b/src/app/stores/app.state.ts @@ -183,7 +183,7 @@ export class AppState extends SolidifyAppState<AppStateModel> { protected readonly _apiService: ApiService, protected readonly _httpClient: HttpClient, protected readonly _notificationService: NotificationService, - public _dialog: MatDialog) { + public readonly _dialog: MatDialog) { super(_store, _translate, _oauthService, diff --git a/src/app/stores/archive-acl/app-archive-acl.state.ts b/src/app/stores/archive-acl/app-archive-acl.state.ts index 0b94a6202..1812bfb18 100644 --- a/src/app/stores/archive-acl/app-archive-acl.state.ts +++ b/src/app/stores/archive-acl/app-archive-acl.state.ts @@ -56,11 +56,11 @@ export interface AppArchiveAclStateModel extends ResourceStateModel<ArchiveACL> children: [], }) export class AppArchiveAclState extends ResourceState<AppArchiveAclStateModel, ArchiveACL> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: appArchiveAclActionNameSpace, }); } diff --git a/src/app/stores/authorized-organizational-unit/app-authorized-organizational-unit.state.ts b/src/app/stores/authorized-organizational-unit/app-authorized-organizational-unit.state.ts index beaf55960..4e1b494be 100644 --- a/src/app/stores/authorized-organizational-unit/app-authorized-organizational-unit.state.ts +++ b/src/app/stores/authorized-organizational-unit/app-authorized-organizational-unit.state.ts @@ -67,11 +67,11 @@ const getQueryParameter: () => QueryParameters = () => { }) export class AppAuthorizedOrganizationalUnitState extends ResourceState<AppAuthorizedOrganizationalUnitStateModel, OrganizationalUnit> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: appAuthorizedOrganizationalUnitNameSpace, }); } diff --git a/src/app/stores/banner/app-banner.state.ts b/src/app/stores/banner/app-banner.state.ts index 9d0b2f1ff..a452b7012 100644 --- a/src/app/stores/banner/app-banner.state.ts +++ b/src/app/stores/banner/app-banner.state.ts @@ -61,10 +61,10 @@ export interface AppBannerStateModel extends BaseStateModel { }, }) export class AppBannerState extends BasicState<AppBannerStateModel> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { super(); } diff --git a/src/app/stores/carousel/app-carousel.state.ts b/src/app/stores/carousel/app-carousel.state.ts index 8debaa6f1..d6790ef18 100644 --- a/src/app/stores/carousel/app-carousel.state.ts +++ b/src/app/stores/carousel/app-carousel.state.ts @@ -70,11 +70,11 @@ export interface AppCarouselStateModel extends BaseStateModel { }, }) export class AppCarouselState extends BasicState<AppCarouselStateModel> { - constructor(protected httpClient: HttpClient, - protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { + constructor(protected readonly _httpClient: HttpClient, + protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { super(); } @@ -84,7 +84,7 @@ export class AppCarouselState extends BasicState<AppCarouselStateModel> { isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - let language = MemoizedUtil.selectSnapshot(this.store, AppState, state => state.appLanguage); + let language = MemoizedUtil.selectSnapshot(this._store, AppState, state => state.appLanguage); if (isNullOrUndefined(language)) { language = environment.defaultLanguage; } @@ -96,7 +96,7 @@ export class AppCarouselState extends BasicState<AppCarouselStateModel> { if (isNonEmptyString(environment.carouselUrl)) { url = environment.carouselUrl; } - return this.httpClient.get(url + `carousel_${language}.html`, { + return this._httpClient.get(url + `carousel_${language}.html`, { headers, observe: "response", responseType: "text", diff --git a/src/app/stores/cart/app-cart.state.ts b/src/app/stores/cart/app-cart.state.ts index c07d03281..d159d7656 100644 --- a/src/app/stores/cart/app-cart.state.ts +++ b/src/app/stores/cart/app-cart.state.ts @@ -88,10 +88,10 @@ export interface AppCartStateModel extends BaseStateModel { ], }) export class AppCartState { - constructor(protected readonly apiService: ApiService, - protected readonly store: Store, - protected readonly notificationService: NotificationService, - protected readonly actions$: Actions, + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, private readonly _cookieConsentService: CookieConsentService) { } @@ -105,9 +105,9 @@ export class AppCartState { const numberAfter = LocalStorageHelper.addItemInList(LocalStorageEnum.cart, action.archive.resId).length; if (numberBefore < numberAfter) { ctx.dispatch(new AppCartArchiveAction.AddInList(action.archive)); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("home.archive.cart.notification.addWithSuccessInCart")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("home.archive.cart.notification.addWithSuccessInCart")); } else { - this.notificationService.showInformation(MARK_AS_TRANSLATABLE("home.archive.cart.notification.alreadyInCart")); + this._notificationService.showInformation(MARK_AS_TRANSLATABLE("home.archive.cart.notification.alreadyInCart")); } } @@ -151,7 +151,7 @@ export class AppCartState { isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("app.order.notification.cartSubmit.success")); + this._notificationService.showSuccess(MARK_AS_TRANSLATABLE("app.order.notification.cartSubmit.success")); if (CookieConsentUtil.isFeatureAuthorized(CookieType.localStorage, LocalStorageEnum.orderPending)) { LocalStorageHelper.addItemInList(LocalStorageEnum.orderPending, action.orderId); @@ -169,7 +169,7 @@ export class AppCartState { isLoadingCounter: ctx.getState().isLoadingCounter - 1, }); - this.notificationService.showError(MARK_AS_TRANSLATABLE("app.order.notification.cartSubmit.fail")); + this._notificationService.showError(MARK_AS_TRANSLATABLE("app.order.notification.cartSubmit.fail")); if (isNullOrUndefined(action.orderId)) { return; } diff --git a/src/app/stores/cart/archive/app-cart-archive.state.ts b/src/app/stores/cart/archive/app-cart-archive.state.ts index 5fb16cd01..608be3a85 100644 --- a/src/app/stores/cart/archive/app-cart-archive.state.ts +++ b/src/app/stores/cart/archive/app-cart-archive.state.ts @@ -65,11 +65,11 @@ export interface AppCartArchiveStateModel extends ResourceStateModel<Archive> { }, }) export class AppCartArchiveState extends ResourceState<AppCartArchiveStateModel, Archive> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: appCartArchiveNamespace, }); } @@ -92,7 +92,7 @@ export class AppCartArchiveState extends ResourceState<AppCartArchiveStateModel, ...reset, }); - return this.apiService.getById<Metadata>(this._urlResource, action.id) + return this._apiService.getById<Metadata>(this._urlResource, action.id) .pipe( tap((model: any) => { ctx.dispatch(new AppCartArchiveAction.GetByIdSuccess(action, ArchiveHelper.adaptArchiveMetadataInArchive(model))); diff --git a/src/app/stores/cart/dip/app-cart-dip.state.ts b/src/app/stores/cart/dip/app-cart-dip.state.ts index f796ada90..46d012e74 100644 --- a/src/app/stores/cart/dip/app-cart-dip.state.ts +++ b/src/app/stores/cart/dip/app-cart-dip.state.ts @@ -66,13 +66,13 @@ export interface AppCartDipStateModel extends ResourceStateModel<Dip> { ], }) export class AppCartDipState extends ResourceState<AppCartDipStateModel, Dip> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - protected httpClient: HttpClient, - private downloadService: DownloadService) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + protected readonly _httpClient: HttpClient, + private readonly _downloadService: DownloadService) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: appCartDipActionNameSpace, }); } @@ -84,9 +84,9 @@ export class AppCartDipState extends ResourceState<AppCartDipStateModel, Dip> { @Action(AppCartDipAction.Download) download(ctx: StateContext<AppCartDipStateModel>, action: AppCartDipAction.Download): Observable<AppCartDipDataFileAction.GetAllSuccess> { const fileName = "dip_" + action.id + ".zip"; - this.notificationService.showInformation(LabelTranslateEnum.fileDownloadStart); + this._notificationService.showInformation(LabelTranslateEnum.fileDownloadStart); - return StoreUtil.dispatchActionAndWaitForSubActionCompletion(ctx, this.actions$, + return StoreUtil.dispatchActionAndWaitForSubActionCompletion(ctx, this._actions$, new AppCartDipDataFileAction.GetAll(action.id), AppCartDipDataFileAction.GetAllSuccess, resultAction => { @@ -95,7 +95,7 @@ export class AppCartDipState extends ResourceState<AppCartDipStateModel, Dip> { listDipDataFile._data.forEach(dipDataFile => { size += dipDataFile.fileSize; }); - this.downloadService.download(`${this._urlResource}/${action.id}/${ApiActionNameEnum.DL}`, fileName, size); + this._downloadService.download(`${this._urlResource}/${action.id}/${ApiActionNameEnum.DL}`, fileName, size); }); } } diff --git a/src/app/stores/cart/dip/data-file/app-cart-dip-data-file.state.ts b/src/app/stores/cart/dip/data-file/app-cart-dip-data-file.state.ts index cc369aab1..2074687c4 100644 --- a/src/app/stores/cart/dip/data-file/app-cart-dip-data-file.state.ts +++ b/src/app/stores/cart/dip/data-file/app-cart-dip-data-file.state.ts @@ -64,12 +64,12 @@ export interface AppCartDipDataFileStateModel extends CompositionStateModel<DipD children: [], }) export class AppCartDipDataFileState extends CompositionState<AppCartDipDataFileStateModel, DipDataFile> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions, - private downloadService: DownloadService) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, + private readonly _downloadService: DownloadService) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: appCartDipDataFileActionNameSpace, resourceName: ApiResourceNameEnum.DATAFILE, }); @@ -82,6 +82,6 @@ export class AppCartDipDataFileState extends CompositionState<AppCartDipDataFile @Action(AppCartDipDataFileAction.Download) download(ctx: StateContext<AppCartDipDataFileStateModel>, action: AppCartDipDataFileAction.Download): void { const url = `${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.DL}`; - this.downloadService.download(url, action.dataFile.fileName, action.dataFile.fileSize); + this._downloadService.download(url, action.dataFile.fileName, action.dataFile.fileSize); } } diff --git a/src/app/stores/cart/order/app-cart-order.state.ts b/src/app/stores/cart/order/app-cart-order.state.ts index 4944ba23d..b236f52dc 100644 --- a/src/app/stores/cart/order/app-cart-order.state.ts +++ b/src/app/stores/cart/order/app-cart-order.state.ts @@ -73,11 +73,11 @@ export interface AppCartOrderStateModel extends ResourceStateModel<Order> { children: [], }) export class AppCartOrderState extends ResourceState<AppCartOrderStateModel, Order> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: appCartOrderActionNameSpace, }); } @@ -139,7 +139,7 @@ export class AppCartOrderState extends ResourceState<AppCartOrderStateModel, Ord isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post<OrderArchive>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.SAVE}`) + return this._apiService.post<OrderArchive>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.SAVE}`) .pipe( tap(() => { ctx.dispatch(new AppCartOrderAction.SaveSuccess(action)); @@ -173,7 +173,7 @@ export class AppCartOrderState extends ResourceState<AppCartOrderStateModel, Ord isLoadingCounter: ctx.getState().isLoadingCounter + 1, }); - return this.apiService.post(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.SUBMIT}`, null) + return this._apiService.post(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.SUBMIT}`, null) .pipe( tap(() => { ctx.dispatch(new AppCartOrderAction.SubmitSuccess(action)); diff --git a/src/app/stores/notification-inbox/app-notification-inbox.state.ts b/src/app/stores/notification-inbox/app-notification-inbox.state.ts index b09b769b3..0e1171f24 100644 --- a/src/app/stores/notification-inbox/app-notification-inbox.state.ts +++ b/src/app/stores/notification-inbox/app-notification-inbox.state.ts @@ -53,11 +53,11 @@ export interface AppNotificationInboxStateModel extends ResourceStateModel<Notif }, }) export class AppNotificationInboxState extends ResourceState<AppNotificationInboxStateModel, NotificationDlcm> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: appNotificationInboxActionNameSpace, keepCurrentStateAfterUpdate: true, }); diff --git a/src/app/stores/person/app-person.state.ts b/src/app/stores/person/app-person.state.ts index c964cc9fc..a07a1c1dd 100644 --- a/src/app/stores/person/app-person.state.ts +++ b/src/app/stores/person/app-person.state.ts @@ -82,11 +82,11 @@ export interface AppPersonStateModel extends ResourceStateModel<Person> { ], }) export class AppPersonState extends ResourceState<AppPersonStateModel, Person> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: appPersonActionNameSpace, keepCurrentStateAfterUpdate: true, }); @@ -117,7 +117,7 @@ export class AppPersonState extends ResourceState<AppPersonStateModel, Person> { current: null, }); - return this.apiService.getById<Person>(ApiEnum.adminPeople, action.id) + return this._apiService.getById<Person>(ApiEnum.adminPeople, action.id) .pipe( tap((model: Person) => { ctx.dispatch(new AppPersonAction.GetByIdSuccess(action, model)); @@ -139,10 +139,10 @@ export class AppPersonState extends ResourceState<AppPersonStateModel, Person> { @OverrideDefaultAction() @Action(AppPersonAction.Update) update(ctx: StateContext<AppPersonStateModel>, action: AppPersonAction.Update): Observable<Person> { - return super.internalUpdate(ctx, action) + return super._internalUpdate(ctx, action) .pipe( tap(model => { - this.updateSubResource(model, action, ctx) + this._updateSubResource(model, action, ctx) .subscribe(success => { if (success) { ctx.dispatch(new AppPersonAction.UpdateSuccess(action, model)); @@ -158,7 +158,7 @@ export class AppPersonState extends ResourceState<AppPersonStateModel, Person> { ); } - private updateSubResource(model: Person, action: AppPersonAction.Create | AppPersonAction.Update, ctx: StateContext<AppPersonStateModel>): Observable<boolean> { + private _updateSubResource(model: Person, action: AppPersonAction.Create | AppPersonAction.Update, ctx: StateContext<AppPersonStateModel>): Observable<boolean> { const personId = model.resId; const newNotificationType = action.modelFormControlEvent.model.notificationTypes.map(o => o.resId); @@ -166,8 +166,8 @@ export class AppPersonState extends ResourceState<AppPersonStateModel, Person> { { action: new AppPersonNotificationTypeAction.Update(personId, newNotificationType), subActionCompletions: [ - this.actions$.pipe(ofSolidifyActionCompleted(AppPersonNotificationTypeAction.UpdateSuccess)), - this.actions$.pipe(ofSolidifyActionCompleted(AppPersonNotificationTypeAction.UpdateFail)), + this._actions$.pipe(ofSolidifyActionCompleted(AppPersonNotificationTypeAction.UpdateSuccess)), + this._actions$.pipe(ofSolidifyActionCompleted(AppPersonNotificationTypeAction.UpdateFail)), ], }, ]).pipe( diff --git a/src/app/stores/person/notification-type/app-person-notification-type.state.ts b/src/app/stores/person/notification-type/app-person-notification-type.state.ts index f35c4789c..f7f7d6e3c 100644 --- a/src/app/stores/person/notification-type/app-person-notification-type.state.ts +++ b/src/app/stores/person/notification-type/app-person-notification-type.state.ts @@ -65,11 +65,11 @@ export interface AppPersonNotificationTypeStateModel extends Relation2TiersState }, }) export class AppPersonNotificationTypeState extends Relation2TiersState<AppPersonNotificationTypeStateModel, NotificationTypeDlcm, Person> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: appPersonNotificationTypeActionNameSpace, resourceName: ApiResourceNameEnum.NOTIFICATION_TYPES, }); diff --git a/src/app/stores/system-property/app-system-property.state.ts b/src/app/stores/system-property/app-system-property.state.ts index db71128ef..ef98e9ed5 100644 --- a/src/app/stores/system-property/app-system-property.state.ts +++ b/src/app/stores/system-property/app-system-property.state.ts @@ -66,11 +66,11 @@ export interface AppSystemPropertyStateModel extends ResourceStateModel<SystemPr }, }) export class AppSystemPropertyState extends ResourceState<AppSystemPropertyStateModel, SystemProperty> { - constructor(protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { - super(apiService, store, notificationService, actions$, { + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: appSystemPropertyActionNameSpace, }); } @@ -90,7 +90,7 @@ export class AppSystemPropertyState extends ResourceState<AppSystemPropertyState environment.allowedUrls = []; } environment.allowedUrls.push(url); - return this.apiService.getByIdInPath<SystemProperty>(url) + return this._apiService.getByIdInPath<SystemProperty>(url) .pipe( tap((systemProperty: SystemProperty) => { ctx.dispatch(new AppSystemPropertyAction.GetSystemPropertiesSuccess(action, systemProperty)); diff --git a/src/app/stores/toc/app-toc.state.ts b/src/app/stores/toc/app-toc.state.ts index 4aa9b9812..ce9133aef 100644 --- a/src/app/stores/toc/app-toc.state.ts +++ b/src/app/stores/toc/app-toc.state.ts @@ -80,11 +80,11 @@ export interface AppTocStateModel extends BaseStateModel { }, }) export class AppTocState extends BasicState<AppTocStateModel> { - constructor(protected httpClient: HttpClient, - protected apiService: ApiService, - protected store: Store, - protected notificationService: NotificationService, - protected actions$: Actions) { + constructor(protected readonly _httpClient: HttpClient, + protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions) { super(); } @@ -143,7 +143,7 @@ export class AppTocState extends BasicState<AppTocStateModel> { let headers = new HttpHeaders(); headers = headers.set("Accept", ["application/xml"]); headers = headers.set("Content-Type", "text/xml"); - return this.httpClient.get(this._urlResource + urlSeparator + environment.documentationTocToolsGuide, { + return this._httpClient.get(this._urlResource + urlSeparator + environment.documentationTocToolsGuide, { headers, observe: "response", responseType: "text", @@ -188,7 +188,7 @@ export class AppTocState extends BasicState<AppTocStateModel> { headers = headers.set("Accept", ["application/xml"]); headers = headers.set("Content-Type", "text/xml"); - return this.httpClient.get(this._urlResource + urlSeparator + environment.documentationTocIntegrationGuide, { + return this._httpClient.get(this._urlResource + urlSeparator + environment.documentationTocIntegrationGuide, { headers, observe: "response", responseType: "text", @@ -232,7 +232,7 @@ export class AppTocState extends BasicState<AppTocStateModel> { headers = headers.set("Accept", ["application/xml"]); headers = headers.set("Content-Type", "text/xml"); - return this.httpClient.get(this._urlResource + urlSeparator + environment.documentationTocApisGuide, { + return this._httpClient.get(this._urlResource + urlSeparator + environment.documentationTocApisGuide, { headers, observe: "response", responseType: "text", @@ -277,7 +277,7 @@ export class AppTocState extends BasicState<AppTocStateModel> { headers = headers.set("Accept", ["application/xml"]); headers = headers.set("Content-Type", "text/xml"); - return this.httpClient.get((isNotNullNorUndefined(environment.documentationTocUserGuidePath) ? environment.documentationTocUserGuidePath : this._urlResource) + urlSeparator + environment.documentationTocUserGuide, { + return this._httpClient.get((isNotNullNorUndefined(environment.documentationTocUserGuidePath) ? environment.documentationTocUserGuidePath : this._urlResource) + urlSeparator + environment.documentationTocUserGuide, { headers, observe: "response", responseType: "text", diff --git a/src/app/stores/user/app-user.state.ts b/src/app/stores/user/app-user.state.ts index 617edc264..d184f2531 100644 --- a/src/app/stores/user/app-user.state.ts +++ b/src/app/stores/user/app-user.state.ts @@ -82,14 +82,14 @@ export interface AppUserStateModel extends ResourceLogoStateModel<User> { }, }) export class AppUserState extends ResourceLogoState<AppUserStateModel, User> { - constructor(protected readonly apiService: ApiService, - protected readonly store: Store, - protected readonly notificationService: NotificationService, - protected readonly actions$: Actions, + constructor(protected readonly _apiService: ApiService, + protected readonly _store: Store, + protected readonly _notificationService: NotificationService, + protected readonly _actions$: Actions, protected readonly _httpClient: HttpClient, protected readonly _appTourService: AppTourService, protected readonly _apmService: ApmService) { - super(apiService, store, notificationService, actions$, { + super(_apiService, _store, _notificationService, _actions$, { nameSpace: appUserActionNameSpace, }, _httpClient, ResourceLogoStateModeEnum.avatar); } @@ -104,7 +104,7 @@ export class AppUserState extends ResourceLogoState<AppUserStateModel, User> { @Action(AppUserAction.GetCurrentUser) getCurrentUser(ctx: StateContext<AppUserStateModel>, action: AppUserAction.GetCurrentUser): Observable<CollectionTyped<User>> { - return this.apiService.get<User>(ApiEnum.adminUsers + urlSeparator + ApiActionNameEnum.AUTHENTICATED, null) + return this._apiService.get<User>(ApiEnum.adminUsers + urlSeparator + ApiActionNameEnum.AUTHENTICATED, null) .pipe( tap((user: User | any) => { ctx.dispatch(new AppUserAction.GetCurrentUserSuccess(action, user)); diff --git a/src/test-helpers/activated-route-stub.ts b/src/test-helpers/activated-route-stub.ts index 2c548440e..b540149c2 100644 --- a/src/test-helpers/activated-route-stub.ts +++ b/src/test-helpers/activated-route-stub.ts @@ -34,17 +34,17 @@ import { export class ActivatedRouteStub { // Use a ReplaySubject to share previous values with subscribers // and pump new values into the `paramMap` observable - private subject: ReplaySubject<ParamMap> = new ReplaySubject<ParamMap>(); + private _subject: ReplaySubject<ParamMap> = new ReplaySubject<ParamMap>(); constructor(initialParams?: Params) { this.setParamMap(initialParams); } /** The mock paramMap observable */ - readonly paramMap: Observable<ParamMap> = this.subject.asObservable(); + readonly paramMap: Observable<ParamMap> = this._subject.asObservable(); /** Set the paramMap observables's next value */ setParamMap(params?: Params): void { - this.subject.next(convertToParamMap(params)); + this._subject.next(convertToParamMap(params)); } } -- GitLab From 0b027bcfa26cb91eca9bf4aaaf6611f41cd2f334 Mon Sep 17 00:00:00 2001 From: Florent Poittevin <florent.poittevin@unige.ch> Date: Wed, 2 Mar 2022 14:57:10 +0100 Subject: [PATCH 2/2] chore: update to solidify 3.0.12 --- package-lock.json | 86 +++++++++++++++++++++++++++++++++-------------- package.json | 2 +- 2 files changed, 62 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index d7c40014e..3062b69a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,7 +53,7 @@ "normalize.css": "8.0.1", "patch-package": "6.4.7", "rxjs": "7.5.2", - "solidify-frontend": "../solidify-frontend/projects/solidify-frontend", + "solidify-frontend": "3.0.12", "tiff.js": "1.0.0", "tslib": "2.3.1", "videojs-wavesurfer": "3.8.0", @@ -89,8 +89,8 @@ "eslint-plugin-import": "2.25.4", "eslint-plugin-jsdoc": "37.7.0", "eslint-plugin-prefer-arrow": "1.2.3", - "eslint-plugin-solidify": "../solidify-eslint-plugin/dist", - "eslint-plugin-unused-imports": "^2.0.0", + "eslint-plugin-solidify": "0.0.2", + "eslint-plugin-unused-imports": "2.0.0", "jasmine-core": "4.0.0", "jasmine-spec-reporter": "7.0.0", "karma": "6.3.13", @@ -115,7 +115,7 @@ "../solidify-eslint-plugin": { "name": "eslint-plugin-solidify", "version": "1.0.0", - "dev": true, + "extraneous": true, "license": "GPL-2.0-or-later", "devDependencies": { "@types/eslint": "8.4.1", @@ -132,8 +132,8 @@ }, "../solidify-eslint-plugin/dist": { "name": "eslint-plugin-solidify", - "version": "1.0.0", - "dev": true, + "version": "0.0.1", + "extraneous": true, "license": "GPL-2.0-or-later", "devDependencies": { "@types/eslint": "8.4.1", @@ -148,7 +148,8 @@ } }, "../solidify-frontend/projects/solidify-frontend": { - "version": "3.0.11", + "version": "3.0.12", + "extraneous": true, "license": "GPL-2.0-or-later", "devDependencies": { "standard-version": "^9.3.2" @@ -10405,8 +10406,11 @@ } }, "node_modules/eslint-plugin-solidify": { - "resolved": "../solidify-eslint-plugin/dist", - "link": true + "version": "0.0.2", + "resolved": "https://nexus.unige.ch/repository/npm-all/eslint-plugin-solidify/-/eslint-plugin-solidify-0.0.2.tgz", + "integrity": "sha512-MJ07LxDoLe7bGXpTHlawFvaq/qxe+0qliuZ0EnOMuj6X3KdpwTHSH7GsgHx2DOtZjgLc7TaNgBbem+bZqPZKEg==", + "dev": true, + "license": "GPL-2.0-or-later" }, "node_modules/eslint-plugin-unused-imports": { "version": "2.0.0", @@ -19670,8 +19674,46 @@ } }, "node_modules/solidify-frontend": { - "resolved": "../solidify-frontend/projects/solidify-frontend", - "link": true + "version": "3.0.12", + "resolved": "https://nexus.unige.ch/repository/npm-all/solidify-frontend/-/solidify-frontend-3.0.12.tgz", + "integrity": "sha512-YbWDp06LSOlOLd/5q7KVHv9PbJY/OG4tieZP4kEBBMM8iIAif0vN76XPKnrS6JDvd9bmmmQpHpXNFMFYcUrrYQ==", + "license": "GPL-2.0-or-later", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^16.0.0" + }, + "peerDependencies": { + "@angular-devkit/core": "^13.2.1", + "@angular/animations": "^13.2.1", + "@angular/cdk": "^13.2.1", + "@angular/common": "^13.2.1", + "@angular/compiler": "^13.2.1", + "@angular/core": "^13.2.1", + "@angular/forms": "^13.2.1", + "@angular/material": "^13.2.1", + "@angular/platform-browser": "^13.2.1", + "@angular/platform-browser-dynamic": "^13.2.1", + "@angular/router": "^13.2.1", + "@angular/service-worker": "^13.2.1", + "@elastic/apm-rum-angular": "2.1.3", + "@ngx-translate/core": "^14.0.0", + "@ngxs/router-plugin": "^3.7.3", + "@ngxs/store": "^3.7.3", + "change-case": "^4.1.2", + "core-js": "^3.21.0", + "docx-preview": "0.1.8", + "moment": "^2.29.1", + "ng2-pdf-viewer": "7.0.2", + "ngx-cookie": "5.0.2", + "ngx-highlightjs": "6.1.1", + "rxjs": "^7.5.2", + "tiff.js": "1.0.0", + "videojs-wavesurfer": "3.8.0", + "wavesurfer.js": "5.2.0", + "zone.js": "^0.11.4" + } }, "node_modules/source-map": { "version": "0.7.3", @@ -29456,18 +29498,10 @@ "requires": {} }, "eslint-plugin-solidify": { - "version": "file:../solidify-eslint-plugin/dist", - "requires": { - "@types/eslint": "8.4.1", - "@types/estree": "0.0.39", - "@types/node": "17.0.14", - "@typescript-eslint/eslint-plugin": "5.10.2", - "@typescript-eslint/parser": "5.10.2", - "@typescript-eslint/utils": "5.12.1", - "eslint": "8.8.0", - "standard-version": "9.3.2", - "typescript": "4.5.5" - } + "version": "0.0.2", + "resolved": "https://nexus.unige.ch/repository/npm-all/eslint-plugin-solidify/-/eslint-plugin-solidify-0.0.2.tgz", + "integrity": "sha512-MJ07LxDoLe7bGXpTHlawFvaq/qxe+0qliuZ0EnOMuj6X3KdpwTHSH7GsgHx2DOtZjgLc7TaNgBbem+bZqPZKEg==", + "dev": true }, "eslint-plugin-unused-imports": { "version": "2.0.0", @@ -35857,9 +35891,11 @@ } }, "solidify-frontend": { - "version": "file:../solidify-frontend/projects/solidify-frontend", + "version": "3.0.12", + "resolved": "https://nexus.unige.ch/repository/npm-all/solidify-frontend/-/solidify-frontend-3.0.12.tgz", + "integrity": "sha512-YbWDp06LSOlOLd/5q7KVHv9PbJY/OG4tieZP4kEBBMM8iIAif0vN76XPKnrS6JDvd9bmmmQpHpXNFMFYcUrrYQ==", "requires": { - "standard-version": "^9.3.2" + "tslib": "^2.3.0" } }, "source-map": { diff --git a/package.json b/package.json index 13dba10e8..8c3df3c07 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "normalize.css": "8.0.1", "patch-package": "6.4.7", "rxjs": "7.5.2", - "solidify-frontend": "3.0.11", + "solidify-frontend": "3.0.12", "tiff.js": "1.0.0", "tslib": "2.3.1", "videojs-wavesurfer": "3.8.0", -- GitLab