new-front-common-library 16.1.32-ROY-1 → 16.1.32-ROY-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/karma.conf.js +44 -0
- package/ng-package.json +10 -0
- package/package.json +2 -19
- package/src/lib/new-front-common-library.component.spec.ts +25 -0
- package/src/lib/new-front-common-library.component.ts +20 -0
- package/src/lib/new-front-common-library.module.ts +26 -0
- package/src/lib/new-front-common-library.service.spec.ts +16 -0
- package/src/lib/new-front-common-library.service.ts +10 -0
- package/src/lib/util/animations/actions.animation.ts +16 -0
- package/src/lib/util/animations/fade.animation.ts +16 -0
- package/src/lib/util/array.service.ts +14 -0
- package/src/lib/util/component/header/header.component.html +389 -0
- package/src/lib/util/component/header/header.component.scss +265 -0
- package/src/lib/util/component/header/header.component.ts +245 -0
- package/src/lib/util/component/header/menu/menu.component.html +52 -0
- package/src/lib/util/component/header/menu/menu.component.scss +127 -0
- package/src/lib/util/component/header/menu/menu.component.spec.ts +21 -0
- package/src/lib/util/component/header/menu/menu.component.ts +94 -0
- package/src/lib/util/component/header/menu/menu.const.ts +546 -0
- package/src/lib/util/component/header/menu/menu.model.ts +26 -0
- package/src/lib/util/component/overlay/overlay.component.css +20 -0
- package/src/lib/util/component/overlay/overlay.component.html +10 -0
- package/src/lib/util/component/overlay/overlay.component.ts +42 -0
- package/src/lib/util/component/overlay/overlay.service.ts +23 -0
- package/src/lib/util/component/popup/popup-login/popup-login.component.css +3 -0
- package/src/lib/util/component/popup/popup-login/popup-login.component.html +29 -0
- package/src/lib/util/component/popup/popup-login/popup-login.component.ts +96 -0
- package/src/lib/util/component/sub-header/sub-header.component.css +136 -0
- package/src/lib/util/component/sub-header/sub-header.component.html +20 -0
- package/src/lib/util/component/sub-header/sub-header.component.spec.ts +25 -0
- package/src/lib/util/component/sub-header/sub-header.component.ts +37 -0
- package/src/lib/util/config.ts +15 -0
- package/src/lib/util/date/PeriodModel.ts +7 -0
- package/src/lib/util/date/date-format-constants.ts +12 -0
- package/src/lib/util/date/date.util.ts +222 -0
- package/src/lib/util/decorators/theme.decorator.ts +24 -0
- package/src/lib/util/decorators/user.decorator.ts +30 -0
- package/src/lib/util/directives/my-number-formatter-directive.ts +32 -0
- package/src/lib/util/directives/show-if-truncated.directive.ts +19 -0
- package/src/lib/util/enums/family.enum.ts +4 -0
- package/src/lib/util/enums/rapid-search-item-type.enum.ts +11 -0
- package/src/lib/util/enums/status-color.enum.ts +9 -0
- package/src/lib/util/event/header/header-events.service.ts +20 -0
- package/src/lib/util/event/storage/local-storage-events.service.ts +15 -0
- package/src/lib/util/event/storage/session-storage-events.service.ts +15 -0
- package/src/lib/util/http/http-params.builder.ts +33 -0
- package/src/lib/util/i18n/de.ts +173 -0
- package/src/lib/util/i18n/en.ts +173 -0
- package/src/lib/util/i18n/fr.ts +174 -0
- package/src/lib/util/i18n/multi-translate-http-loader.ts +31 -0
- package/src/lib/util/models/any-line.model.ts +45 -0
- package/src/lib/util/models/audio-content.model.ts +40 -0
- package/src/lib/util/models/authPermission.model.ts +17 -0
- package/src/lib/util/models/authUser.model.ts +28 -0
- package/src/lib/util/models/basic-hierarchy.model.ts +8 -0
- package/src/lib/util/models/basic.model.ts +31 -0
- package/src/lib/util/models/box-set-item.model.ts +23 -0
- package/src/lib/util/models/commercial/deal-rapid-search-model.ts +10 -0
- package/src/lib/util/models/commercial/invoice-rapid-search-model.ts +25 -0
- package/src/lib/util/models/commercial/work-record-rapid-search-model.ts +28 -0
- package/src/lib/util/models/custom-typings.d.ts +166 -0
- package/src/lib/util/models/disc-program.model.ts +29 -0
- package/src/lib/util/models/disc.model.ts +26 -0
- package/src/lib/util/models/eventType.model.ts +7 -0
- package/src/lib/util/models/expenditure-commitment/purchase-order-file.model.ts +27 -0
- package/src/lib/util/models/expenditure-commitment/purchase-order-rapid-search.model.ts +10 -0
- package/src/lib/util/models/family.model.ts +6 -0
- package/{lib/util/models/index.d.ts → src/lib/util/models/index.ts} +1 -0
- package/src/lib/util/models/lang-line.model.ts +31 -0
- package/src/lib/util/models/legal/contract-rapid-search-model.ts +13 -0
- package/src/lib/util/models/legal/contract-work.model.ts +43 -0
- package/src/lib/util/models/legal/contract-work2.model.ts +39 -0
- package/src/lib/util/models/legal/type-status-rapid-search.model.ts +5 -0
- package/src/lib/util/models/media-line.model.ts +20 -0
- package/src/lib/util/models/menu-language.model.ts +16 -0
- package/src/lib/util/models/milo/territory.model.ts +19 -0
- package/src/lib/util/models/module.model.ts +9 -0
- package/src/lib/util/models/permission.model.ts +21 -0
- package/src/lib/util/models/product-box-set.model.ts +19 -0
- package/src/lib/util/models/product-disc-detail.model.ts +25 -0
- package/src/lib/util/models/product-disc.model.ts +31 -0
- package/src/lib/util/models/product-division.model.ts +35 -0
- package/src/lib/util/models/product-type.model.ts +26 -0
- package/src/lib/util/models/product.model.ts +73 -0
- package/src/lib/util/models/program.model.ts +34 -0
- package/src/lib/util/models/purchase-order/purchase-order.model.ts +61 -0
- package/src/lib/util/models/referential/WorkVersionArticleDto.ts +20 -0
- package/src/lib/util/models/referential/adress-type.model.ts +13 -0
- package/src/lib/util/models/referential/adress.model.ts +31 -0
- package/src/lib/util/models/referential/attached-file.model.ts +21 -0
- package/src/lib/util/models/referential/bank-account.model.ts +25 -0
- package/src/lib/util/models/referential/bank-accounts.model.ts +34 -0
- package/src/lib/util/models/referential/basic-hierarchy.model.ts +8 -0
- package/src/lib/util/models/referential/broadcast-list-item.model.ts +19 -0
- package/src/lib/util/models/referential/color.model.ts +16 -0
- package/src/lib/util/models/referential/company.model.ts +17 -0
- package/src/lib/util/models/referential/content-type.model.ts +22 -0
- package/src/lib/util/models/referential/content.model.ts +26 -0
- package/src/lib/util/models/referential/cost-center-criteria-values.model.ts +17 -0
- package/src/lib/util/models/referential/cost-center-criteria.model.ts +23 -0
- package/src/lib/util/models/referential/cost-center.model.ts +37 -0
- package/src/lib/util/models/referential/coutry.model.ts +17 -0
- package/src/lib/util/models/referential/currency.model.ts +22 -0
- package/src/lib/util/models/referential/editorial-content.model.ts +37 -0
- package/src/lib/util/models/referential/fixing.model.ts +21 -0
- package/src/lib/util/models/referential/flat-media.model.ts +19 -0
- package/src/lib/util/models/referential/format-image.model.ts +17 -0
- package/src/lib/util/models/referential/format-type.model.ts +16 -0
- package/src/lib/util/models/referential/format.model.ts +17 -0
- package/src/lib/util/models/referential/fsk-index.model.ts +36 -0
- package/src/lib/util/models/referential/fsk.model.ts +53 -0
- package/src/lib/util/models/referential/function.model.ts +25 -0
- package/src/lib/util/models/referential/genre.model.ts +17 -0
- package/src/lib/util/models/referential/invoice-product-type.model.ts +24 -0
- package/src/lib/util/models/referential/keywords.model.ts +16 -0
- package/src/lib/util/models/referential/language.model.ts +22 -0
- package/src/lib/util/models/referential/media-filter.model.ts +10 -0
- package/src/lib/util/models/referential/media.model.ts +21 -0
- package/src/lib/util/models/referential/module.model.ts +21 -0
- package/{lib/util/models/referential/parameter.model.d.ts → src/lib/util/models/referential/parameter.model.ts} +2 -0
- package/src/lib/util/models/referential/participant.model.ts +31 -0
- package/src/lib/util/models/referential/person.model.ts +30 -0
- package/src/lib/util/models/referential/po/WorkRestrictionPO.ts +11 -0
- package/src/lib/util/models/referential/project-status.model.ts +16 -0
- package/src/lib/util/models/referential/quota.model.ts +17 -0
- package/src/lib/util/models/referential/referential-entity-state.model.ts +22 -0
- package/src/lib/util/models/referential/referential-value.model.ts +21 -0
- package/src/lib/util/models/referential/referentiel.model.ts +29 -0
- package/src/lib/util/models/referential/restriction.model.ts +26 -0
- package/src/lib/util/models/referential/sap-order.model.ts +48 -0
- package/src/lib/util/models/referential/service-error.model.ts +16 -0
- package/src/lib/util/models/referential/sound.model.ts +16 -0
- package/src/lib/util/models/referential/territories-languages.model.ts +19 -0
- package/src/lib/util/models/referential/territory-filter.model.ts +6 -0
- package/src/lib/util/models/referential/territory.model.ts +27 -0
- package/src/lib/util/models/referential/theme.model.ts +17 -0
- package/src/lib/util/models/referential/third-party-address-rapid-search.model.ts +8 -0
- package/src/lib/util/models/referential/third-party-creation-request.model.ts +59 -0
- package/src/lib/util/models/referential/third-party-module.model.ts +21 -0
- package/src/lib/util/models/referential/third-party-rapid-search.model.ts +10 -0
- package/src/lib/util/models/referential/third-party.model.ts +100 -0
- package/src/lib/util/models/referential/translated-value-model.ts +20 -0
- package/src/lib/util/models/referential/tva.model.ts +17 -0
- package/src/lib/util/models/referential/type-export.model.ts +17 -0
- package/src/lib/util/models/referential/type-tva-company-territory.model.ts +36 -0
- package/src/lib/util/models/referential/type-tva.model.ts +29 -0
- package/{lib/util/models/referential/user-form.model.d.ts → src/lib/util/models/referential/user-form.model.ts} +2 -0
- package/src/lib/util/models/referential/work-addons-model.ts +36 -0
- package/src/lib/util/models/referential/work-appartenance.model.ts +17 -0
- package/src/lib/util/models/referential/work-genre.model.ts +21 -0
- package/src/lib/util/models/referential/work-language.model.ts +21 -0
- package/src/lib/util/models/referential/work-milo.model.ts +65 -0
- package/src/lib/util/models/referential/work-participant.model.ts +28 -0
- package/src/lib/util/models/referential/work-restrictions-model.ts +34 -0
- package/src/lib/util/models/referential/work-theme.model.ts +21 -0
- package/src/lib/util/models/referential/work-title.model.ts +27 -0
- package/src/lib/util/models/referential/work-version-origin.model.ts +20 -0
- package/src/lib/util/models/referential/work-version-rapid-search.model.ts +10 -0
- package/src/lib/util/models/referential/work-versions-used.model.ts +22 -0
- package/src/lib/util/models/referential/work-versions.model.ts +47 -0
- package/src/lib/util/models/referential/work-year-production.model.ts +16 -0
- package/src/lib/util/models/referential/work.model.ts +88 -0
- package/src/lib/util/models/referential/zone.model.ts +16 -0
- package/src/lib/util/models/referentiel.model.ts +29 -0
- package/src/lib/util/models/search-response.model.ts +7 -0
- package/src/lib/util/models/section.model.ts +11 -0
- package/src/lib/util/models/select/options.model.ts +8 -0
- package/src/lib/util/models/select/select.model.ts +4 -0
- package/src/lib/util/models/subsidiary.model.ts +10 -0
- package/src/lib/util/models/subtitle-content.model.ts +39 -0
- package/src/lib/util/models/user-video.model.ts +29 -0
- package/src/lib/util/models/user.model.ts +41 -0
- package/src/lib/util/models/video/product-rapid-search.model.ts +10 -0
- package/src/lib/util/models/video/support-rapid-search.model.ts +7 -0
- package/src/lib/util/models/video-content.model.ts +37 -0
- package/src/lib/util/number.validator.ts +123 -0
- package/src/lib/util/paginator/custom-paginator-configuration.ts +68 -0
- package/src/lib/util/permissions/permissions.service.ts +47 -0
- package/src/lib/util/pipes/capitalizefirst.pipe.ts +39 -0
- package/src/lib/util/pipes/comma-separated-number.pipe.ts +9 -0
- package/src/lib/util/pipes/common-translate.pipe.ts +37 -0
- package/src/lib/util/pipes/display-html.pipe.ts +15 -0
- package/src/lib/util/pipes/display-null.pipe.ts +19 -0
- package/src/lib/util/pipes/format-currency.pipe.ts +26 -0
- package/src/lib/util/pipes/format-duration.pipe.ts +16 -0
- package/src/lib/util/pipes/format-number-input.pipe.ts +19 -0
- package/src/lib/util/pipes/local-date.pipe.ts +29 -0
- package/src/lib/util/pipes/my-number.pipe.ts +51 -0
- package/src/lib/util/pipes/third-party-address-search.pipe.ts +12 -0
- package/src/lib/util/pipes/third-party-address.pipe.ts +13 -0
- package/src/lib/util/pipes/trim-string.pipe.ts +24 -0
- package/src/lib/util/regex/regex.service.ts +94 -0
- package/src/lib/util/regex/regex.spec.ts +45 -0
- package/src/lib/util/services/api/commercial-api.service.ts +23 -0
- package/src/lib/util/services/api/common-api.service.ts +121 -0
- package/src/lib/util/services/api/legal-api.service.ts +27 -0
- package/src/lib/util/services/api/video-api.service.ts +45 -0
- package/src/lib/util/services/auth/auth.service.spec.ts +16 -0
- package/src/lib/util/services/auth/auth.service.ts +14 -0
- package/src/lib/util/services/elasticsearch/elasticsearch.service.ts +179 -0
- package/src/lib/util/services/elasticsearch/subsidiaries.service.ts +48 -0
- package/src/lib/util/services/form-action/form-actions-events.service.ts +25 -0
- package/src/lib/util/services/guard/auth.guard.ts +44 -0
- package/src/lib/util/services/guard/login.guard.ts +26 -0
- package/src/lib/util/services/history/history.service.ts +38 -0
- package/src/lib/util/services/interceptor/auth.interceptor.ts +66 -0
- package/src/lib/util/services/jwt-security/aes.service.ts +48 -0
- package/src/lib/util/services/jwt-security/interceptorhttp.service.ts +98 -0
- package/src/lib/util/services/jwt-security/jwt.helpher.ts +38 -0
- package/src/lib/util/services/storage/local-storage.service.ts +36 -0
- package/src/lib/util/services/storage/session-storage.service.ts +39 -0
- package/src/lib/util/services/translate-language/lang.service.ts +26 -0
- package/src/lib/util/services/user/user-subsidiary.service.spec.ts +207 -0
- package/src/lib/util/services/user/user-subsidiary.service.ts +21 -0
- package/src/lib/util/sort.ts +27 -0
- package/src/lib/util/theme/theme-event.service.ts +15 -0
- package/src/lib/util/toaster/toaster-events.service.ts +32 -0
- package/src/lib/util/util.module.ts +185 -0
- package/{public-api.d.ts → src/public-api.ts} +17 -2
- package/src/test.ts +13 -0
- package/tsconfig.lib.json +19 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/esm2022/lib/util/array.service.mjs +0 -19
- package/esm2022/lib/util/component/header/header.component.mjs +0 -221
- package/esm2022/lib/util/component/header/menu/menu.component.mjs +0 -96
- package/esm2022/lib/util/component/header/menu/menu.const.mjs +0 -544
- package/esm2022/lib/util/component/header/menu/menu.model.mjs +0 -2
- package/esm2022/lib/util/component/overlay/overlay.component.mjs +0 -40
- package/esm2022/lib/util/component/overlay/overlay.service.mjs +0 -24
- package/esm2022/lib/util/component/popup/popup-login/popup-login.component.mjs +0 -90
- package/esm2022/lib/util/component/sub-header/sub-header.component.mjs +0 -44
- package/esm2022/lib/util/config.mjs +0 -8
- package/esm2022/lib/util/date/PeriodModel.mjs +0 -8
- package/esm2022/lib/util/date/date-format-constants.mjs +0 -12
- package/esm2022/lib/util/date/date.util.mjs +0 -218
- package/esm2022/lib/util/decorators/theme.decorator.mjs +0 -22
- package/esm2022/lib/util/decorators/user.decorator.mjs +0 -25
- package/esm2022/lib/util/directives/my-number-formatter-directive.mjs +0 -34
- package/esm2022/lib/util/directives/show-if-truncated.directive.mjs +0 -25
- package/esm2022/lib/util/enums/family.enum.mjs +0 -6
- package/esm2022/lib/util/enums/rapid-search-item-type.enum.mjs +0 -12
- package/esm2022/lib/util/enums/status-color.enum.mjs +0 -11
- package/esm2022/lib/util/event/header/header-events.service.mjs +0 -21
- package/esm2022/lib/util/event/storage/local-storage-events.service.mjs +0 -17
- package/esm2022/lib/util/event/storage/session-storage-events.service.mjs +0 -18
- package/esm2022/lib/util/http/http-params.builder.mjs +0 -27
- package/esm2022/lib/util/i18n/de.mjs +0 -158
- package/esm2022/lib/util/i18n/en.mjs +0 -158
- package/esm2022/lib/util/i18n/fr.mjs +0 -158
- package/esm2022/lib/util/i18n/multi-translate-http-loader.mjs +0 -21
- package/esm2022/lib/util/interfaces/permissions.interface.mjs +0 -2
- package/esm2022/lib/util/models/any-line.model.mjs +0 -37
- package/esm2022/lib/util/models/audio-content.model.mjs +0 -27
- package/esm2022/lib/util/models/authPermission.model.mjs +0 -16
- package/esm2022/lib/util/models/authUser.model.mjs +0 -21
- package/esm2022/lib/util/models/basic.model.mjs +0 -14
- package/esm2022/lib/util/models/box-set-item.model.mjs +0 -19
- package/esm2022/lib/util/models/commercial/deal-rapid-search-model.mjs +0 -3
- package/esm2022/lib/util/models/commercial/invoice-rapid-search-model.mjs +0 -9
- package/esm2022/lib/util/models/commercial/work-record-rapid-search-model.mjs +0 -13
- package/esm2022/lib/util/models/disc-program.model.mjs +0 -26
- package/esm2022/lib/util/models/disc.model.mjs +0 -22
- package/esm2022/lib/util/models/eventType.model.mjs +0 -7
- package/esm2022/lib/util/models/expenditure-commitment/purchase-order-file.model.mjs +0 -22
- package/esm2022/lib/util/models/expenditure-commitment/purchase-order-rapid-search.model.mjs +0 -3
- package/esm2022/lib/util/models/family.model.mjs +0 -7
- package/esm2022/lib/util/models/index.mjs +0 -101
- package/esm2022/lib/util/models/lang-line.model.mjs +0 -27
- package/esm2022/lib/util/models/legal/contract-rapid-search-model.mjs +0 -3
- package/esm2022/lib/util/models/legal/contract-work.model.mjs +0 -23
- package/esm2022/lib/util/models/legal/contract-work2.model.mjs +0 -21
- package/esm2022/lib/util/models/legal/type-status-rapid-search.model.mjs +0 -3
- package/esm2022/lib/util/models/media-line.model.mjs +0 -18
- package/esm2022/lib/util/models/menu-language.model.mjs +0 -15
- package/esm2022/lib/util/models/permission.model.mjs +0 -20
- package/esm2022/lib/util/models/product-box-set.model.mjs +0 -16
- package/esm2022/lib/util/models/product-disc-detail.model.mjs +0 -22
- package/esm2022/lib/util/models/product-disc.model.mjs +0 -27
- package/esm2022/lib/util/models/product-division.model.mjs +0 -29
- package/esm2022/lib/util/models/product-type.model.mjs +0 -22
- package/esm2022/lib/util/models/product.model.mjs +0 -62
- package/esm2022/lib/util/models/program.model.mjs +0 -28
- package/esm2022/lib/util/models/purchase-order/purchase-order.model.mjs +0 -53
- package/esm2022/lib/util/models/referential/WorkVersionArticleDto.mjs +0 -17
- package/esm2022/lib/util/models/referential/adress-type.model.mjs +0 -14
- package/esm2022/lib/util/models/referential/adress.model.mjs +0 -28
- package/esm2022/lib/util/models/referential/attached-file.model.mjs +0 -17
- package/esm2022/lib/util/models/referential/bank-account.model.mjs +0 -24
- package/esm2022/lib/util/models/referential/bank-accounts.model.mjs +0 -31
- package/esm2022/lib/util/models/referential/basic-hierarchy.model.mjs +0 -8
- package/esm2022/lib/util/models/referential/broadcast-list-item.model.mjs +0 -13
- package/esm2022/lib/util/models/referential/color.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/company.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/content-type.model.mjs +0 -17
- package/esm2022/lib/util/models/referential/content.model.mjs +0 -22
- package/esm2022/lib/util/models/referential/cost-center-criteria-values.model.mjs +0 -14
- package/esm2022/lib/util/models/referential/cost-center-criteria.model.mjs +0 -13
- package/esm2022/lib/util/models/referential/cost-center.model.mjs +0 -28
- package/esm2022/lib/util/models/referential/coutry.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/currency.model.mjs +0 -20
- package/esm2022/lib/util/models/referential/editorial-content.model.mjs +0 -18
- package/esm2022/lib/util/models/referential/fixing.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/flat-media.model.mjs +0 -18
- package/esm2022/lib/util/models/referential/format-image.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/format-type.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/format.model.mjs +0 -17
- package/esm2022/lib/util/models/referential/fsk-index.model.mjs +0 -20
- package/esm2022/lib/util/models/referential/fsk.model.mjs +0 -22
- package/esm2022/lib/util/models/referential/function.model.mjs +0 -23
- package/esm2022/lib/util/models/referential/genre.model.mjs +0 -17
- package/esm2022/lib/util/models/referential/invoice-product-type.model.mjs +0 -22
- package/esm2022/lib/util/models/referential/keywords.model.mjs +0 -13
- package/esm2022/lib/util/models/referential/language.model.mjs +0 -18
- package/esm2022/lib/util/models/referential/media-filter.model.mjs +0 -3
- package/esm2022/lib/util/models/referential/media.model.mjs +0 -20
- package/esm2022/lib/util/models/referential/module.model.mjs +0 -20
- package/esm2022/lib/util/models/referential/parameter.model.mjs +0 -2
- package/esm2022/lib/util/models/referential/participant.model.mjs +0 -20
- package/esm2022/lib/util/models/referential/person.model.mjs +0 -23
- package/esm2022/lib/util/models/referential/project-status.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/quota.model.mjs +0 -17
- package/esm2022/lib/util/models/referential/referential-entity-state.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/referential-value.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/referentiel.model.mjs +0 -26
- package/esm2022/lib/util/models/referential/restriction.model.mjs +0 -20
- package/esm2022/lib/util/models/referential/sap-order.model.mjs +0 -20
- package/esm2022/lib/util/models/referential/service-error.model.mjs +0 -15
- package/esm2022/lib/util/models/referential/sound.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/territories-languages.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/territory-filter.model.mjs +0 -3
- package/esm2022/lib/util/models/referential/territory.model.mjs +0 -17
- package/esm2022/lib/util/models/referential/theme.model.mjs +0 -17
- package/esm2022/lib/util/models/referential/third-party-address-rapid-search.model.mjs +0 -3
- package/esm2022/lib/util/models/referential/third-party-creation-request.model.mjs +0 -44
- package/esm2022/lib/util/models/referential/third-party-module.model.mjs +0 -20
- package/esm2022/lib/util/models/referential/third-party-rapid-search.model.mjs +0 -3
- package/esm2022/lib/util/models/referential/third-party.model.mjs +0 -83
- package/esm2022/lib/util/models/referential/translated-value-model.mjs +0 -16
- package/esm2022/lib/util/models/referential/tva.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/type-export.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/type-tva-company-territory.model.mjs +0 -32
- package/esm2022/lib/util/models/referential/type-tva.model.mjs +0 -25
- package/esm2022/lib/util/models/referential/user-form.model.mjs +0 -2
- package/esm2022/lib/util/models/referential/work-addons-model.mjs +0 -16
- package/esm2022/lib/util/models/referential/work-appartenance.model.mjs +0 -17
- package/esm2022/lib/util/models/referential/work-genre.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/work-language.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/work-milo.model.mjs +0 -61
- package/esm2022/lib/util/models/referential/work-participant.model.mjs +0 -21
- package/esm2022/lib/util/models/referential/work-restrictions-model.mjs +0 -13
- package/esm2022/lib/util/models/referential/work-theme.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/work-title.model.mjs +0 -20
- package/esm2022/lib/util/models/referential/work-version-origin.model.mjs +0 -16
- package/esm2022/lib/util/models/referential/work-version-rapid-search.model.mjs +0 -3
- package/esm2022/lib/util/models/referential/work-versions-used.model.mjs +0 -19
- package/esm2022/lib/util/models/referential/work-versions.model.mjs +0 -27
- package/esm2022/lib/util/models/referential/work-year-production.model.mjs +0 -13
- package/esm2022/lib/util/models/referential/work.model.mjs +0 -22
- package/esm2022/lib/util/models/referential/zone.model.mjs +0 -14
- package/esm2022/lib/util/models/referentiel.model.mjs +0 -26
- package/esm2022/lib/util/models/search-response.model.mjs +0 -10
- package/esm2022/lib/util/models/section.model.mjs +0 -8
- package/esm2022/lib/util/models/select/options.model.mjs +0 -8
- package/esm2022/lib/util/models/select/select.model.mjs +0 -7
- package/esm2022/lib/util/models/subsidiary.model.mjs +0 -8
- package/esm2022/lib/util/models/subtitle-content.model.mjs +0 -28
- package/esm2022/lib/util/models/user-video.model.mjs +0 -22
- package/esm2022/lib/util/models/user.model.mjs +0 -35
- package/esm2022/lib/util/models/video/product-rapid-search.model.mjs +0 -3
- package/esm2022/lib/util/models/video/support-rapid-search.model.mjs +0 -3
- package/esm2022/lib/util/models/video-content.model.mjs +0 -18
- package/esm2022/lib/util/number.validator.mjs +0 -129
- package/esm2022/lib/util/paginator/custom-paginator-configuration.mjs +0 -59
- package/esm2022/lib/util/permissions/permissions.service.mjs +0 -49
- package/esm2022/lib/util/pipes/capitalizefirst.pipe.mjs +0 -41
- package/esm2022/lib/util/pipes/comma-separated-number.pipe.mjs +0 -15
- package/esm2022/lib/util/pipes/common-translate.pipe.mjs +0 -38
- package/esm2022/lib/util/pipes/display-html.pipe.mjs +0 -20
- package/esm2022/lib/util/pipes/display-null.pipe.mjs +0 -24
- package/esm2022/lib/util/pipes/format-currency.pipe.mjs +0 -31
- package/esm2022/lib/util/pipes/format-duration.pipe.mjs +0 -23
- package/esm2022/lib/util/pipes/format-number-input.pipe.mjs +0 -22
- package/esm2022/lib/util/pipes/local-date.pipe.mjs +0 -27
- package/esm2022/lib/util/pipes/my-number.pipe.mjs +0 -44
- package/esm2022/lib/util/pipes/third-party-address-search.pipe.mjs +0 -15
- package/esm2022/lib/util/pipes/third-party-address.pipe.mjs +0 -16
- package/esm2022/lib/util/pipes/trim-string.pipe.mjs +0 -25
- package/esm2022/lib/util/regex/regex.service.mjs +0 -94
- package/esm2022/lib/util/services/api/commercial-api.service.mjs +0 -28
- package/esm2022/lib/util/services/api/common-api.service.mjs +0 -98
- package/esm2022/lib/util/services/api/legal-api.service.mjs +0 -32
- package/esm2022/lib/util/services/api/video-api.service.mjs +0 -45
- package/esm2022/lib/util/services/auth/auth.service.mjs +0 -18
- package/esm2022/lib/util/services/elasticsearch/elasticsearch.service.mjs +0 -166
- package/esm2022/lib/util/services/elasticsearch/subsidiaries.service.mjs +0 -48
- package/esm2022/lib/util/services/form-action/form-actions-events.service.mjs +0 -25
- package/esm2022/lib/util/services/guard/auth.guard.mjs +0 -32
- package/esm2022/lib/util/services/guard/login.guard.mjs +0 -23
- package/esm2022/lib/util/services/history/history.service.mjs +0 -39
- package/esm2022/lib/util/services/interceptor/auth.interceptor.mjs +0 -53
- package/esm2022/lib/util/services/jwt-security/aes.service.mjs +0 -34
- package/esm2022/lib/util/services/jwt-security/interceptorhttp.service.mjs +0 -18
- package/esm2022/lib/util/services/jwt-security/jwt.helpher.mjs +0 -34
- package/esm2022/lib/util/services/storage/local-storage.service.mjs +0 -36
- package/esm2022/lib/util/services/storage/session-storage.service.mjs +0 -38
- package/esm2022/lib/util/services/translate-language/lang.service.mjs +0 -31
- package/esm2022/lib/util/services/user/user-subsidiary.service.mjs +0 -22
- package/esm2022/lib/util/sort.mjs +0 -22
- package/esm2022/lib/util/theme/theme-event.service.mjs +0 -17
- package/esm2022/lib/util/toaster/toaster-events.service.mjs +0 -32
- package/esm2022/lib/util/util.module.mjs +0 -281
- package/esm2022/new-front-common-library.mjs +0 -5
- package/esm2022/public-api.mjs +0 -59
- package/fesm2022/new-front-common-library.mjs +0 -5695
- package/fesm2022/new-front-common-library.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/util/array.service.d.ts +0 -7
- package/lib/util/component/header/header.component.d.ts +0 -74
- package/lib/util/component/header/menu/menu.component.d.ts +0 -27
- package/lib/util/component/header/menu/menu.const.d.ts +0 -2
- package/lib/util/component/header/menu/menu.model.d.ts +0 -23
- package/lib/util/component/overlay/overlay.component.d.ts +0 -17
- package/lib/util/component/overlay/overlay.service.d.ts +0 -13
- package/lib/util/component/popup/popup-login/popup-login.component.d.ts +0 -35
- package/lib/util/component/sub-header/sub-header.component.d.ts +0 -13
- package/lib/util/config.d.ts +0 -8
- package/lib/util/date/PeriodModel.d.ts +0 -6
- package/lib/util/date/date-format-constants.d.ts +0 -25
- package/lib/util/date/date.util.d.ts +0 -16
- package/lib/util/decorators/theme.decorator.d.ts +0 -1
- package/lib/util/decorators/user.decorator.d.ts +0 -1
- package/lib/util/directives/my-number-formatter-directive.d.ts +0 -15
- package/lib/util/directives/show-if-truncated.directive.d.ts +0 -11
- package/lib/util/enums/family.enum.d.ts +0 -4
- package/lib/util/enums/rapid-search-item-type.enum.d.ts +0 -10
- package/lib/util/enums/status-color.enum.d.ts +0 -9
- package/lib/util/event/header/header-events.service.d.ts +0 -11
- package/lib/util/event/storage/local-storage-events.service.d.ts +0 -9
- package/lib/util/event/storage/session-storage-events.service.d.ts +0 -10
- package/lib/util/http/http-params.builder.d.ts +0 -9
- package/lib/util/i18n/de.d.ts +0 -141
- package/lib/util/i18n/en.d.ts +0 -141
- package/lib/util/i18n/fr.d.ts +0 -141
- package/lib/util/i18n/multi-translate-http-loader.d.ts +0 -14
- package/lib/util/models/any-line.model.d.ts +0 -24
- package/lib/util/models/audio-content.model.d.ts +0 -27
- package/lib/util/models/authPermission.model.d.ts +0 -7
- package/lib/util/models/authUser.model.d.ts +0 -16
- package/lib/util/models/basic.model.d.ts +0 -11
- package/lib/util/models/box-set-item.model.d.ts +0 -12
- package/lib/util/models/commercial/deal-rapid-search-model.d.ts +0 -10
- package/lib/util/models/commercial/invoice-rapid-search-model.d.ts +0 -18
- package/lib/util/models/commercial/work-record-rapid-search-model.d.ts +0 -21
- package/lib/util/models/disc-program.model.d.ts +0 -9
- package/lib/util/models/disc.model.d.ts +0 -15
- package/lib/util/models/eventType.model.d.ts +0 -5
- package/lib/util/models/expenditure-commitment/purchase-order-file.model.d.ts +0 -8
- package/lib/util/models/expenditure-commitment/purchase-order-rapid-search.model.d.ts +0 -10
- package/lib/util/models/family.model.d.ts +0 -5
- package/lib/util/models/lang-line.model.d.ts +0 -18
- package/lib/util/models/legal/contract-rapid-search-model.d.ts +0 -10
- package/lib/util/models/legal/contract-work.model.d.ts +0 -27
- package/lib/util/models/legal/contract-work2.model.d.ts +0 -23
- package/lib/util/models/legal/type-status-rapid-search.model.d.ts +0 -5
- package/lib/util/models/media-line.model.d.ts +0 -9
- package/lib/util/models/menu-language.model.d.ts +0 -6
- package/lib/util/models/permission.model.d.ts +0 -12
- package/lib/util/models/product-box-set.model.d.ts +0 -8
- package/lib/util/models/product-disc-detail.model.d.ts +0 -14
- package/lib/util/models/product-disc.model.d.ts +0 -11
- package/lib/util/models/product-division.model.d.ts +0 -15
- package/lib/util/models/product-type.model.d.ts +0 -7
- package/lib/util/models/product.model.d.ts +0 -52
- package/lib/util/models/program.model.d.ts +0 -21
- package/lib/util/models/purchase-order/purchase-order.model.d.ts +0 -40
- package/lib/util/models/referential/WorkVersionArticleDto.d.ts +0 -10
- package/lib/util/models/referential/adress-type.model.d.ts +0 -5
- package/lib/util/models/referential/adress.model.d.ts +0 -20
- package/lib/util/models/referential/attached-file.model.d.ts +0 -11
- package/lib/util/models/referential/bank-account.model.d.ts +0 -15
- package/lib/util/models/referential/bank-accounts.model.d.ts +0 -17
- package/lib/util/models/referential/basic-hierarchy.model.d.ts +0 -6
- package/lib/util/models/referential/broadcast-list-item.model.d.ts +0 -8
- package/lib/util/models/referential/color.model.d.ts +0 -6
- package/lib/util/models/referential/company.model.d.ts +0 -7
- package/lib/util/models/referential/content-type.model.d.ts +0 -12
- package/lib/util/models/referential/content.model.d.ts +0 -7
- package/lib/util/models/referential/cost-center-criteria-values.model.d.ts +0 -7
- package/lib/util/models/referential/cost-center-criteria.model.d.ts +0 -12
- package/lib/util/models/referential/cost-center.model.d.ts +0 -18
- package/lib/util/models/referential/coutry.model.d.ts +0 -7
- package/lib/util/models/referential/currency.model.d.ts +0 -11
- package/lib/util/models/referential/editorial-content.model.d.ts +0 -25
- package/lib/util/models/referential/fixing.model.d.ts +0 -10
- package/lib/util/models/referential/flat-media.model.d.ts +0 -9
- package/lib/util/models/referential/format-image.model.d.ts +0 -7
- package/lib/util/models/referential/format-type.model.d.ts +0 -6
- package/lib/util/models/referential/format.model.d.ts +0 -7
- package/lib/util/models/referential/fsk-index.model.d.ts +0 -22
- package/lib/util/models/referential/fsk.model.d.ts +0 -37
- package/lib/util/models/referential/function.model.d.ts +0 -8
- package/lib/util/models/referential/genre.model.d.ts +0 -7
- package/lib/util/models/referential/invoice-product-type.model.d.ts +0 -7
- package/lib/util/models/referential/keywords.model.d.ts +0 -6
- package/lib/util/models/referential/language.model.d.ts +0 -11
- package/lib/util/models/referential/media-filter.model.d.ts +0 -10
- package/lib/util/models/referential/media.model.d.ts +0 -11
- package/lib/util/models/referential/module.model.d.ts +0 -11
- package/lib/util/models/referential/participant.model.d.ts +0 -11
- package/lib/util/models/referential/person.model.d.ts +0 -13
- package/lib/util/models/referential/project-status.model.d.ts +0 -6
- package/lib/util/models/referential/quota.model.d.ts +0 -7
- package/lib/util/models/referential/referential-entity-state.model.d.ts +0 -11
- package/lib/util/models/referential/referential-value.model.d.ts +0 -11
- package/lib/util/models/referential/referentiel.model.d.ts +0 -12
- package/lib/util/models/referential/restriction.model.d.ts +0 -9
- package/lib/util/models/referential/sap-order.model.d.ts +0 -27
- package/lib/util/models/referential/service-error.model.d.ts +0 -13
- package/lib/util/models/referential/sound.model.d.ts +0 -6
- package/lib/util/models/referential/territories-languages.model.d.ts +0 -8
- package/lib/util/models/referential/territory-filter.model.d.ts +0 -6
- package/lib/util/models/referential/territory.model.d.ts +0 -12
- package/lib/util/models/referential/theme.model.d.ts +0 -7
- package/lib/util/models/referential/third-party-address-rapid-search.model.d.ts +0 -8
- package/lib/util/models/referential/third-party-creation-request.model.d.ts +0 -48
- package/lib/util/models/referential/third-party-module.model.d.ts +0 -11
- package/lib/util/models/referential/third-party-rapid-search.model.d.ts +0 -8
- package/lib/util/models/referential/third-party.model.d.ts +0 -45
- package/lib/util/models/referential/translated-value-model.d.ts +0 -10
- package/lib/util/models/referential/tva.model.d.ts +0 -7
- package/lib/util/models/referential/type-export.model.d.ts +0 -7
- package/lib/util/models/referential/type-tva-company-territory.model.d.ts +0 -18
- package/lib/util/models/referential/type-tva.model.d.ts +0 -10
- package/lib/util/models/referential/work-addons-model.d.ts +0 -25
- package/lib/util/models/referential/work-appartenance.model.d.ts +0 -7
- package/lib/util/models/referential/work-genre.model.d.ts +0 -11
- package/lib/util/models/referential/work-language.model.d.ts +0 -11
- package/lib/util/models/referential/work-milo.model.d.ts +0 -46
- package/lib/util/models/referential/work-participant.model.d.ts +0 -10
- package/lib/util/models/referential/work-restrictions-model.d.ts +0 -18
- package/lib/util/models/referential/work-theme.model.d.ts +0 -11
- package/lib/util/models/referential/work-title.model.d.ts +0 -10
- package/lib/util/models/referential/work-version-origin.model.d.ts +0 -10
- package/lib/util/models/referential/work-version-rapid-search.model.d.ts +0 -9
- package/lib/util/models/referential/work-versions-used.model.d.ts +0 -12
- package/lib/util/models/referential/work-versions.model.d.ts +0 -29
- package/lib/util/models/referential/work-year-production.model.d.ts +0 -6
- package/lib/util/models/referential/work.model.d.ts +0 -74
- package/lib/util/models/referential/zone.model.d.ts +0 -6
- package/lib/util/models/referentiel.model.d.ts +0 -12
- package/lib/util/models/search-response.model.d.ts +0 -7
- package/lib/util/models/section.model.d.ts +0 -7
- package/lib/util/models/select/options.model.d.ts +0 -6
- package/lib/util/models/select/select.model.d.ts +0 -5
- package/lib/util/models/subsidiary.model.d.ts +0 -7
- package/lib/util/models/subtitle-content.model.d.ts +0 -26
- package/lib/util/models/user-video.model.d.ts +0 -10
- package/lib/util/models/user.model.d.ts +0 -27
- package/lib/util/models/video/product-rapid-search.model.d.ts +0 -8
- package/lib/util/models/video/support-rapid-search.model.d.ts +0 -6
- package/lib/util/models/video-content.model.d.ts +0 -24
- package/lib/util/number.validator.d.ts +0 -14
- package/lib/util/paginator/custom-paginator-configuration.d.ts +0 -16
- package/lib/util/permissions/permissions.service.d.ts +0 -15
- package/lib/util/pipes/capitalizefirst.pipe.d.ts +0 -8
- package/lib/util/pipes/comma-separated-number.pipe.d.ts +0 -7
- package/lib/util/pipes/common-translate.pipe.d.ts +0 -12
- package/lib/util/pipes/display-html.pipe.d.ts +0 -10
- package/lib/util/pipes/display-null.pipe.d.ts +0 -8
- package/lib/util/pipes/format-currency.pipe.d.ts +0 -10
- package/lib/util/pipes/format-duration.pipe.d.ts +0 -7
- package/lib/util/pipes/format-number-input.pipe.d.ts +0 -7
- package/lib/util/pipes/local-date.pipe.d.ts +0 -9
- package/lib/util/pipes/my-number.pipe.d.ts +0 -11
- package/lib/util/pipes/third-party-address-search.pipe.d.ts +0 -8
- package/lib/util/pipes/third-party-address.pipe.d.ts +0 -8
- package/lib/util/pipes/trim-string.pipe.d.ts +0 -7
- package/lib/util/regex/regex.service.d.ts +0 -12
- package/lib/util/services/api/commercial-api.service.d.ts +0 -12
- package/lib/util/services/api/common-api.service.d.ts +0 -27
- package/lib/util/services/api/legal-api.service.d.ts +0 -15
- package/lib/util/services/api/video-api.service.d.ts +0 -17
- package/lib/util/services/auth/auth.service.d.ts +0 -9
- package/lib/util/services/elasticsearch/elasticsearch.service.d.ts +0 -35
- package/lib/util/services/elasticsearch/subsidiaries.service.d.ts +0 -12
- package/lib/util/services/form-action/form-actions-events.service.d.ts +0 -14
- package/lib/util/services/guard/auth.guard.d.ts +0 -2
- package/lib/util/services/guard/login.guard.d.ts +0 -1
- package/lib/util/services/history/history.service.d.ts +0 -10
- package/lib/util/services/interceptor/auth.interceptor.d.ts +0 -16
- package/lib/util/services/jwt-security/aes.service.d.ts +0 -12
- package/lib/util/services/jwt-security/interceptorhttp.service.d.ts +0 -8
- package/lib/util/services/jwt-security/jwt.helpher.d.ts +0 -4
- package/lib/util/services/storage/local-storage.service.d.ts +0 -13
- package/lib/util/services/storage/session-storage.service.d.ts +0 -13
- package/lib/util/services/translate-language/lang.service.d.ts +0 -14
- package/lib/util/services/user/user-subsidiary.service.d.ts +0 -9
- package/lib/util/sort.d.ts +0 -4
- package/lib/util/theme/theme-event.service.d.ts +0 -9
- package/lib/util/toaster/toaster-events.service.d.ts +0 -15
- package/lib/util/util.module.d.ts +0 -49
- /package/{lib/util/interfaces/permissions.interface.d.ts → src/lib/util/interfaces/permissions.interface.ts} +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
const PADDING = '000000';
|
|
4
|
+
|
|
5
|
+
@Pipe({name: 'myNumberFormat'})
|
|
6
|
+
export class MyNumberPipe implements PipeTransform {
|
|
7
|
+
private DECIMAL_SEPARATOR: string;
|
|
8
|
+
private THOUSANDS_SEPARATOR: string;
|
|
9
|
+
|
|
10
|
+
constructor() {
|
|
11
|
+
// TODO comes from configuration settings
|
|
12
|
+
this.DECIMAL_SEPARATOR = '.';
|
|
13
|
+
this.THOUSANDS_SEPARATOR = ' ';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public transform(value: number | string, fractionSize: number): string {
|
|
17
|
+
if (value !== '' && value !== null) {
|
|
18
|
+
let [integer, fraction = ''] = value
|
|
19
|
+
.toString()
|
|
20
|
+
.split(this.DECIMAL_SEPARATOR);
|
|
21
|
+
|
|
22
|
+
fraction =
|
|
23
|
+
fractionSize > 0
|
|
24
|
+
? this.DECIMAL_SEPARATOR +
|
|
25
|
+
(fraction + PADDING).substring(0, fractionSize)
|
|
26
|
+
: '';
|
|
27
|
+
|
|
28
|
+
integer = integer.replace(
|
|
29
|
+
/\B(?=(\d{3})+(?!\d))/g,
|
|
30
|
+
this.THOUSANDS_SEPARATOR
|
|
31
|
+
);
|
|
32
|
+
return integer + fraction;
|
|
33
|
+
} else {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public parse(value: string, fractionSize: number): string {
|
|
39
|
+
let [integer, fraction = ''] = (value || '').split(this.DECIMAL_SEPARATOR);
|
|
40
|
+
|
|
41
|
+
integer = integer.replace(new RegExp(this.THOUSANDS_SEPARATOR, 'g'), '');
|
|
42
|
+
|
|
43
|
+
fraction =
|
|
44
|
+
parseInt(fraction, 10) > 0 && fractionSize > 0
|
|
45
|
+
? this.DECIMAL_SEPARATOR +
|
|
46
|
+
(fraction + PADDING).substring(0, fractionSize)
|
|
47
|
+
: '';
|
|
48
|
+
|
|
49
|
+
return integer + fraction;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {Pipe, PipeTransform} from '@angular/core';
|
|
2
|
+
import {ThirdPartyAddressRapidSearchModel} from "../models/referential/third-party-address-rapid-search.model";
|
|
3
|
+
|
|
4
|
+
@Pipe({name: 'thirdPartyAddressSearch'})
|
|
5
|
+
export class ThirdPartyAddressSearchPipe implements PipeTransform {
|
|
6
|
+
|
|
7
|
+
transform(thirdPartyAddressSearch: ThirdPartyAddressRapidSearchModel, lang?: string): string {
|
|
8
|
+
const countryLabelMap = new Map<string, string>([['en', thirdPartyAddressSearch.countryEn], ['fr', thirdPartyAddressSearch.countryFr], ['de', thirdPartyAddressSearch.countryDe]]);
|
|
9
|
+
return thirdPartyAddressSearch?.street + '-' + thirdPartyAddressSearch?.zipCode + '-' + thirdPartyAddressSearch?.city + '-' + countryLabelMap.get(lang);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
|
+
import { AdressModel } from "../models";
|
|
3
|
+
|
|
4
|
+
@Pipe({
|
|
5
|
+
name: 'thirdPartyAddress'
|
|
6
|
+
})
|
|
7
|
+
export class ThirdPartyAddressPipe implements PipeTransform {
|
|
8
|
+
|
|
9
|
+
transform(thirdPartyAddress: AdressModel, ...args: unknown[]): unknown {
|
|
10
|
+
return thirdPartyAddress?.street1 + '-' + thirdPartyAddress?.zipCode + '-' + thirdPartyAddress?.city + '-' + thirdPartyAddress?.country?.label;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Pipe({name: 'myTrimString'})
|
|
4
|
+
export class TrimStringPipe implements PipeTransform {
|
|
5
|
+
|
|
6
|
+
public transform(value: string, size: number, message: string): string {
|
|
7
|
+
// Case 1: test value param
|
|
8
|
+
if (value === null || value === undefined || value === '') {
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (value.length < size) {
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let posSpace = value.indexOf(' ', size);
|
|
17
|
+
if (posSpace !== -1) {
|
|
18
|
+
return value.substring(0, posSpace) + ' ' + message;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return value.substring(0, size) + ' ' + message;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Injectable()
|
|
4
|
+
export class RegexService {
|
|
5
|
+
public isDecimalOrNegative(numberToCheck: number = null): boolean {
|
|
6
|
+
if (numberToCheck == null) {
|
|
7
|
+
return false;
|
|
8
|
+
} else {
|
|
9
|
+
const myRegexNoDecimal = new RegExp(/^\d+$/, 'i');
|
|
10
|
+
if (!myRegexNoDecimal.test(numberToCheck.toString())) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public isMiloCode(value: string = null): boolean {
|
|
18
|
+
if (value == null) {
|
|
19
|
+
return false;
|
|
20
|
+
} else {
|
|
21
|
+
const regex = new RegExp(/^[C0-9][0-9]{5}$/, 'i');
|
|
22
|
+
if (regex.test(value.toString())) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public isAmount(value: string = null): boolean {
|
|
30
|
+
if (value == null) {
|
|
31
|
+
return false;
|
|
32
|
+
} else {
|
|
33
|
+
const regex = new RegExp(/^\d+\.?\d*$/, 'i');
|
|
34
|
+
if (regex.test(value.toString())) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public isYesNo(value: string = null): boolean {
|
|
42
|
+
if (value == null) {
|
|
43
|
+
return false;
|
|
44
|
+
} else {
|
|
45
|
+
const regex = new RegExp(/^(y|Y|n|N|o|O)$/, 'i');
|
|
46
|
+
if (regex.test(value.toString())) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public isFinancialCondition(value: string = null): boolean {
|
|
54
|
+
if (value == null) {
|
|
55
|
+
return false;
|
|
56
|
+
} else {
|
|
57
|
+
const regex = new RegExp(/^(f|F|s|S|g|G)$/, 'i');
|
|
58
|
+
if (regex.test(value.toString())) {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public isOrderNumber(value: string = null): boolean {
|
|
66
|
+
if (value == null) {
|
|
67
|
+
return false;
|
|
68
|
+
} else {
|
|
69
|
+
const regex = new RegExp(
|
|
70
|
+
/^[5](6|8)(2|4|9)(N|O|Y)[0-9]{1}[C0-9][0-9]{5}[0-9]{1}$/,
|
|
71
|
+
'i'
|
|
72
|
+
);
|
|
73
|
+
if (regex.test(value.toString())) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public isDate(value: string = null): boolean {
|
|
81
|
+
if (value == null) {
|
|
82
|
+
return false;
|
|
83
|
+
} else {
|
|
84
|
+
const regex = new RegExp(
|
|
85
|
+
/^([0-9]{2}[-][0-9]{2}[-][0-9]{4}|[0-9]{4}[-][0-9]{2}[-][0-9]{2})$/,
|
|
86
|
+
'i'
|
|
87
|
+
);
|
|
88
|
+
if (regex.test(value.toString())) {
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by dstoian on 09/03/2017.
|
|
3
|
+
*/
|
|
4
|
+
import { RegexService } from './regex.service';
|
|
5
|
+
|
|
6
|
+
describe('RegexService', () => {
|
|
7
|
+
let service: RegexService;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
service = new RegexService();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should have method checkDecimalNumber()', () => {
|
|
14
|
+
expect(service.isDecimalOrNegative).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
describe('which', () => {
|
|
18
|
+
|
|
19
|
+
it('should return false if method has no param ', () => {
|
|
20
|
+
expect(service.isDecimalOrNegative()).toBeFalsy();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should return false if number is null', () => {
|
|
24
|
+
expect(service.isDecimalOrNegative(null)).toBeFalsy();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should return false if number is not decimal and not negative', () => {
|
|
28
|
+
expect(service.isDecimalOrNegative(10)).toBeFalsy();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('should return true if number is negative', () => {
|
|
32
|
+
expect(service.isDecimalOrNegative(-10)).toBeTruthy();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('should return true if number is decimal', () => {
|
|
36
|
+
expect(service.isDecimalOrNegative(10.5)).toBeTruthy();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('should return true if number is decimal and negative', () => {
|
|
40
|
+
expect(service.isDecimalOrNegative(-10.5)).toBeTruthy();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {Inject, Injectable} from '@angular/core';
|
|
2
|
+
import {throwError} from "rxjs";
|
|
3
|
+
import {Config, WEB_CONFIG} from "../../config";
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class CommercialApiService {
|
|
7
|
+
public apiUrl: string = this.config.api_url + '/commercial-api/';
|
|
8
|
+
|
|
9
|
+
public header: Headers = new Headers({
|
|
10
|
+
'Content-Type': 'application/json'
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
constructor(@Inject(WEB_CONFIG) private config: Config) {
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public static handleError(error: Response) {
|
|
17
|
+
return throwError(error.json() || 'api error');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public getAccountWrittingDownload() {
|
|
21
|
+
window.open(this.apiUrl + 'accounting-writing/get-account-writting-file');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { ProductModel, PurchaseOrderModel } from '../../models';
|
|
2
|
+
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
3
|
+
// Angular2
|
|
4
|
+
import { Inject, Injectable } from '@angular/core';
|
|
5
|
+
import { Observable, throwError } from 'rxjs';
|
|
6
|
+
import { Config, WEB_CONFIG } from '../../config';
|
|
7
|
+
import { catchError } from 'rxjs/operators';
|
|
8
|
+
import { CookieService } from 'ngx-cookie-service';
|
|
9
|
+
import { JwtHelper } from '../jwt-security/jwt.helpher';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
const TOKEN_NAME = 'authToken';
|
|
13
|
+
const SECONDARY_TOKEN_NAME = 'authTokenSecondary';
|
|
14
|
+
|
|
15
|
+
@Injectable()
|
|
16
|
+
export class CommonApiService {
|
|
17
|
+
|
|
18
|
+
public headers: HttpHeaders = new HttpHeaders({
|
|
19
|
+
'Content-Type': 'application/json'
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
public jwtHelper = new JwtHelper();
|
|
23
|
+
|
|
24
|
+
constructor(
|
|
25
|
+
@Inject(WEB_CONFIG) private config: Config,
|
|
26
|
+
private cookieService: CookieService,
|
|
27
|
+
private http: HttpClient
|
|
28
|
+
) {
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public static handleError(error) {
|
|
32
|
+
return throwError(error || 'api error');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Global product search
|
|
36
|
+
public getProductGlobalSearch(
|
|
37
|
+
searchInput: string,
|
|
38
|
+
language: string
|
|
39
|
+
): Observable<ProductModel[]> {
|
|
40
|
+
return this.http
|
|
41
|
+
.get<ProductModel[]>(
|
|
42
|
+
this.config.api_url +
|
|
43
|
+
'/video-api/products/globalSearch?searchInput=' +
|
|
44
|
+
searchInput +
|
|
45
|
+
'&language=' +
|
|
46
|
+
language
|
|
47
|
+
)
|
|
48
|
+
.pipe(catchError(CommonApiService.handleError));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public getPurchaseOrderByGlobalSearch(
|
|
52
|
+
searchInput: string,
|
|
53
|
+
language: string
|
|
54
|
+
): Observable<PurchaseOrderModel[]> {
|
|
55
|
+
return this.http
|
|
56
|
+
.get<PurchaseOrderModel[]>(
|
|
57
|
+
this.config.api_url +
|
|
58
|
+
'/video-api/purchaseOrders/globalSearch?searchInput=' +
|
|
59
|
+
searchInput +
|
|
60
|
+
'&language=' +
|
|
61
|
+
language
|
|
62
|
+
)
|
|
63
|
+
.pipe(catchError(CommonApiService.handleError));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public setToken(token: string): void {
|
|
67
|
+
sessionStorage.removeItem(TOKEN_NAME);
|
|
68
|
+
sessionStorage.setItem(TOKEN_NAME, token);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
public setSecondaryToken(token: string): void {
|
|
72
|
+
sessionStorage.removeItem(SECONDARY_TOKEN_NAME);
|
|
73
|
+
sessionStorage.setItem(SECONDARY_TOKEN_NAME, token);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
getToken() {
|
|
77
|
+
const user = this.decodeToken(TOKEN_NAME);
|
|
78
|
+
if (user && user.superAdmin && sessionStorage.hasOwnProperty(SECONDARY_TOKEN_NAME)) {
|
|
79
|
+
return sessionStorage.getItem(SECONDARY_TOKEN_NAME);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return sessionStorage.getItem(TOKEN_NAME);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public decodeToken(tokenName: string) {
|
|
86
|
+
return sessionStorage.hasOwnProperty(tokenName) ? this.jwtHelper.decodeToken(sessionStorage.getItem(tokenName)) : {};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public getUserDataFromToken(): any {
|
|
90
|
+
const user = this.decodeToken(TOKEN_NAME);
|
|
91
|
+
|
|
92
|
+
if (user && user.superAdmin && sessionStorage.hasOwnProperty(SECONDARY_TOKEN_NAME)) {
|
|
93
|
+
return Object.assign({secondary: true}, this.decodeToken(SECONDARY_TOKEN_NAME));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return user;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
public isTokenValid() {
|
|
100
|
+
let payload: any;
|
|
101
|
+
try {
|
|
102
|
+
payload = this.getUserDataFromToken();
|
|
103
|
+
} catch (e) {
|
|
104
|
+
payload = {};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (!payload.exp) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return payload.exp * 1000 > Date.now();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public ssoLogin(email: string): Observable<any> {
|
|
115
|
+
const url: string = this.config.api_url + '/authorization-api/login/email';
|
|
116
|
+
|
|
117
|
+
return this.http
|
|
118
|
+
.post(url, email, {headers: this.headers})
|
|
119
|
+
.pipe(catchError(CommonApiService.handleError));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {Inject, Injectable} from '@angular/core';
|
|
2
|
+
import {Observable, throwError} from "rxjs";
|
|
3
|
+
import {Config, WEB_CONFIG} from "../../config";
|
|
4
|
+
import {catchError} from "rxjs/operators";
|
|
5
|
+
import {HttpClient} from "@angular/common/http";
|
|
6
|
+
|
|
7
|
+
@Injectable()
|
|
8
|
+
export class LegalApiService {
|
|
9
|
+
public apiUrl: string = this.config.api_url + '/legal-api/';
|
|
10
|
+
|
|
11
|
+
public header: Headers = new Headers({
|
|
12
|
+
'Content-Type': 'application/json'
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
constructor(@Inject(WEB_CONFIG) private config: Config,
|
|
16
|
+
private http: HttpClient
|
|
17
|
+
) {
|
|
18
|
+
}
|
|
19
|
+
public getMappingSocietesSubsidiaries(): Observable<Record<number, number[]>> {
|
|
20
|
+
return this.http.get<Record<number, number[]>>(this.apiUrl + 'subsidiaries/societe_mapping')
|
|
21
|
+
.pipe(catchError(this.handleError));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public handleError(error) {
|
|
25
|
+
return throwError(error || 'api error');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {Inject, Injectable} from '@angular/core';
|
|
2
|
+
import {HttpClient, HttpErrorResponse} from "@angular/common/http";
|
|
3
|
+
import {Config, WEB_CONFIG} from "../../config";
|
|
4
|
+
import {CookieService} from "ngx-cookie-service";
|
|
5
|
+
import {Observable, throwError} from "rxjs";
|
|
6
|
+
import {catchError} from "rxjs/operators";
|
|
7
|
+
|
|
8
|
+
@Injectable()
|
|
9
|
+
export class VideoApiService {
|
|
10
|
+
|
|
11
|
+
public apiUrl: string = this.config.api_url + '/video-api/';
|
|
12
|
+
|
|
13
|
+
public header: Headers = new Headers({
|
|
14
|
+
'Content-Type': 'application/json'
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
constructor(
|
|
18
|
+
@Inject(WEB_CONFIG) private config: Config,
|
|
19
|
+
private cookieService: CookieService,
|
|
20
|
+
private http: HttpClient
|
|
21
|
+
) {
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public static handleError(error: HttpErrorResponse) {
|
|
25
|
+
if (error.error instanceof ErrorEvent) {
|
|
26
|
+
// A client-side or network error occurred. Handle it accordingly.
|
|
27
|
+
console.error('An error occurred:', error.error.message);
|
|
28
|
+
} else {
|
|
29
|
+
// The backend returned an unsuccessful response code.
|
|
30
|
+
// The response body may contain clues as to what went wrong,
|
|
31
|
+
console.error(
|
|
32
|
+
`Backend returned code ${error.status}, ` +
|
|
33
|
+
`body was: ${error.ok}`);
|
|
34
|
+
}
|
|
35
|
+
// return an observable with a user-facing error message
|
|
36
|
+
return throwError(
|
|
37
|
+
'Something bad happened; please try again later.');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public getProductExtractionXlsx(lang: string): Observable<any> {
|
|
41
|
+
return this.http.get(this.apiUrl + `products/all-products-to-xlsx?language=${lang}`, { responseType: 'blob' })
|
|
42
|
+
.pipe(catchError(VideoApiService.handleError));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { AuthService } from './auth.service';
|
|
4
|
+
|
|
5
|
+
xdescribe('AuthService', () => {
|
|
6
|
+
let service: AuthService;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
TestBed.configureTestingModule({});
|
|
10
|
+
service = TestBed.inject(AuthService);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should be created', () => {
|
|
14
|
+
expect(service).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
@Injectable()
|
|
5
|
+
export class AuthService {
|
|
6
|
+
|
|
7
|
+
private isAuthenticatedSubject = new BehaviorSubject<boolean>(false);
|
|
8
|
+
|
|
9
|
+
isAuthenticated$: Observable<boolean> = this.isAuthenticatedSubject.asObservable();
|
|
10
|
+
|
|
11
|
+
public setAuthenticated(isAuthenticated: boolean): void {
|
|
12
|
+
this.isAuthenticatedSubject.next(isAuthenticated);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import {Inject, Injectable} from '@angular/core';
|
|
2
|
+
import {from, Observable} from 'rxjs';
|
|
3
|
+
import {Client as ClientJs} from 'elasticsearch-browser';
|
|
4
|
+
import {Client, MSearchResponse} from 'elasticsearch';
|
|
5
|
+
import {PurchaseOrderRapidSearchModel} from "../../models/expenditure-commitment/purchase-order-rapid-search.model";
|
|
6
|
+
import {ProductRapidSearchModel} from "../../models/video/product-rapid-search.model";
|
|
7
|
+
import {Config, WEB_CONFIG} from '../../config';
|
|
8
|
+
import {WorkVersionRapidSearchModel} from "../../models/referential/work-version-rapid-search.model";
|
|
9
|
+
import {DealRapidSearchModel} from '../../models/commercial/deal-rapid-search-model';
|
|
10
|
+
import {ThirdPartyRapidSearchModel} from "../../models/referential/third-party-rapid-search.model";
|
|
11
|
+
import {WorkRecordRapidSearchModel} from "../../models/commercial/work-record-rapid-search-model";
|
|
12
|
+
import {ContractRapidSearchModel} from "../../models/legal/contract-rapid-search-model";
|
|
13
|
+
import {InvoiceRapidSearchModel} from "../../models/commercial/invoice-rapid-search-model";
|
|
14
|
+
import {AuthUserModel} from "../../models";
|
|
15
|
+
import {SubsidiariesService} from "./subsidiaries.service";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@Injectable()
|
|
19
|
+
export class ElasticsearchService {
|
|
20
|
+
|
|
21
|
+
constructor(@Inject(WEB_CONFIG) private config: Config,
|
|
22
|
+
private subsidiariesMappingService: SubsidiariesService) {
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private client: Client;
|
|
26
|
+
PROFILE_SEARCH_CONFIG = {
|
|
27
|
+
'COMMERCIAL': ['unity-invoice*', 'unity-deal*', 'unity-work-record*'],
|
|
28
|
+
'ACCOUNTANT': ['unity-invoice*', 'unity-deal*', 'unity-work-record*'],
|
|
29
|
+
'ADMINISTRATIVE_CONTROLLER': ['unity-invoice*', 'unity-deal*', 'unity-work-record*'],
|
|
30
|
+
'VIDEO_CONSULT': ['unity-product*'],
|
|
31
|
+
'BDC': ['unity-purchase-order*'],
|
|
32
|
+
'LEGAL': ['unity-contract*'],
|
|
33
|
+
'ROYALTY': ['unity-royalty-contract'],
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private getElasticsearchClient(): Client {
|
|
37
|
+
if (!this.client) {
|
|
38
|
+
this.client = new ClientJs({
|
|
39
|
+
host: this.config.elasticsearch_url
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return this.client;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public getSearchResponse(text: string, user: AuthUserModel): Observable<MSearchResponse<any>> {
|
|
46
|
+
const allIndexes: Set<string> = new Set<string>();
|
|
47
|
+
allIndexes.add('unity-work-version*')
|
|
48
|
+
allIndexes.add('unity-third-party*')
|
|
49
|
+
|
|
50
|
+
for (const permission of user.permissions) {
|
|
51
|
+
const indexes = this.PROFILE_SEARCH_CONFIG[permission.code];
|
|
52
|
+
indexes?.forEach(idx => allIndexes.add(idx));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const body: any[] = [];
|
|
56
|
+
for (const index of allIndexes) {
|
|
57
|
+
body.push({index});
|
|
58
|
+
switch (index) {
|
|
59
|
+
case 'unity-work-version*' :
|
|
60
|
+
body.push({
|
|
61
|
+
query: {
|
|
62
|
+
dis_max: {
|
|
63
|
+
queries: [{wildcard: {miloCode: {value: '*' + text + '*'}}}, {wildcard: {title: {value: '*' + text + '*'}}}, {wildcard: {title: {value: text + '*'}}}, {wildcard: {title: {value: text}}}],
|
|
64
|
+
tie_breaker: 0.5
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
sort: [{_score: {order: 'desc'}}, {title: {order: "asc"}}],
|
|
68
|
+
size: 50
|
|
69
|
+
});
|
|
70
|
+
break;
|
|
71
|
+
case 'unity-product*' :
|
|
72
|
+
body.push({
|
|
73
|
+
query: {dis_max: {queries: [{wildcard: {ean: {value: '*' + text + '*'}}}, {wildcard: {title: {value: '*' + text + '*'}}}]}},
|
|
74
|
+
sort: {releaseDate: {order: 'desc'}},
|
|
75
|
+
size: 50
|
|
76
|
+
});
|
|
77
|
+
break;
|
|
78
|
+
case 'unity-purchase-order*' :
|
|
79
|
+
body.push({
|
|
80
|
+
query: {dis_max: {queries: [{wildcard: {poNumber: {value: '*' + text + '*'}}}, {wildcard: {ean: {value: '*' + text + '*'}}}, {wildcard: {basketNumber: {value: '*' + text + '*'}}}]}},
|
|
81
|
+
size: 50
|
|
82
|
+
});
|
|
83
|
+
break;
|
|
84
|
+
case 'unity-deal*' :
|
|
85
|
+
body.push({
|
|
86
|
+
query: {dis_max: {queries: [{wildcard: {dealNumber: {value: '*' + text + '*'}}}]}},
|
|
87
|
+
sort: [{_score: {order: 'desc'}}, {'dealNumber.keyword': {order: 'asc'}}],
|
|
88
|
+
size: 50
|
|
89
|
+
});
|
|
90
|
+
break;
|
|
91
|
+
case 'unity-work-record*' :
|
|
92
|
+
body.push({
|
|
93
|
+
query: {dis_max: {queries: [{wildcard: {workRecordId: {value: '*' + text + '*'}}}]}},
|
|
94
|
+
sort: [{'workRecordId.keyword': {order: 'asc'}}],
|
|
95
|
+
size: 50
|
|
96
|
+
});
|
|
97
|
+
break;
|
|
98
|
+
case 'unity-invoice*' :
|
|
99
|
+
body.push({
|
|
100
|
+
query: {dis_max: {queries: [{wildcard: {number: {value: '*' + text + '*'}}}]}},
|
|
101
|
+
sort: [{'number.keyword': {order: 'asc'}}],
|
|
102
|
+
size: 50
|
|
103
|
+
});
|
|
104
|
+
break;
|
|
105
|
+
case 'unity-third-party*' :
|
|
106
|
+
body.push({
|
|
107
|
+
query: {
|
|
108
|
+
dis_max: {
|
|
109
|
+
queries: [{wildcard: {companyOrPersonName: {value: '*' + text + '*'}}}, {wildcard: {companyOrPersonName: {value: text + '*'}}}, {wildcard: {companyOrPersonName: {value: text}}}],
|
|
110
|
+
tie_breaker: 0.5
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
sort: [{_score: {order: 'desc'}}, {companyOrPersonName: {order: 'asc'}}],
|
|
114
|
+
size: 50
|
|
115
|
+
});
|
|
116
|
+
break;
|
|
117
|
+
case 'unity-contract*' :
|
|
118
|
+
body.push({
|
|
119
|
+
query: {bool: this.composeContractQuery(text, user.subsidiaries)},
|
|
120
|
+
sort: [{'lisaId.keyword': {order: 'asc'}}],
|
|
121
|
+
size: 50
|
|
122
|
+
});
|
|
123
|
+
break;
|
|
124
|
+
case 'unity-royalty-contract' :
|
|
125
|
+
body.push({
|
|
126
|
+
query: {dis_max: {queries: [{wildcard: {contractNumber: {value: '*' + text + '*'}}}]}},
|
|
127
|
+
sort: [{'contractNumber.keyword': {order: 'asc'}}],
|
|
128
|
+
size: 50
|
|
129
|
+
});
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return from(this.getElasticsearchClient().msearch({body}));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
public getDocuments(searchResponse: any): (PurchaseOrderRapidSearchModel | ProductRapidSearchModel |
|
|
137
|
+
WorkVersionRapidSearchModel | DealRapidSearchModel | WorkRecordRapidSearchModel | ThirdPartyRapidSearchModel | ContractRapidSearchModel)[] {
|
|
138
|
+
let results = [];
|
|
139
|
+
if (searchResponse && searchResponse.responses) {
|
|
140
|
+
for (const r of searchResponse.responses) {
|
|
141
|
+
if (r.error || !r.hits) {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const item = r.hits.hits && r.hits.hits.length > 0 ? r.hits.hits.map(v => this.mapDocument(v)) : [];
|
|
146
|
+
results = results.concat(item);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return results;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
mapDocument(doc: any): any {
|
|
153
|
+
switch (doc._source.docType) {
|
|
154
|
+
case 'INVOICE':
|
|
155
|
+
return Object.assign(new InvoiceRapidSearchModel(), doc._source);
|
|
156
|
+
case 'WORK_RECORD':
|
|
157
|
+
return Object.assign(new WorkRecordRapidSearchModel(), doc._source);
|
|
158
|
+
default:
|
|
159
|
+
return doc._source;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
private composeContractQuery(text: string, subsidiadies) {
|
|
164
|
+
const societes = this.subsidiariesMappingService.getSocieteAppartenance(subsidiadies);
|
|
165
|
+
const must: any[] = [
|
|
166
|
+
{wildcard: {lisaId: {value: '*' + text + '*'}}}
|
|
167
|
+
];
|
|
168
|
+
const should: any[] = [];
|
|
169
|
+
should.push({bool: {must_not: {exists: {field: 'societeAppartenance'}}}});
|
|
170
|
+
if (societes && societes.length > 0) {
|
|
171
|
+
should.push({terms: {societeAppartenance: societes}});
|
|
172
|
+
}
|
|
173
|
+
const boolQuery: any = {must};
|
|
174
|
+
boolQuery.should = should;
|
|
175
|
+
boolQuery.minimum_should_match = 1;
|
|
176
|
+
return boolQuery
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
}
|