From b3e9d0eeb33c45c15b443c5bfdbe98f672dd407c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henry=20T=C3=A4schner?= <129834483+HenryT-CG@users.noreply.github.com> Date: Thu, 21 Mar 2024 14:51:59 +0100 Subject: [PATCH] Use local default image (#87) * feat: use local default image * feat: use local default image * fix: tests --- package-lock.json | 462 +++++++++++++----- package.json | 17 +- src/_mixins.scss | 1 - .../app-search/app-search.component.spec.ts | 32 ++ .../app-search/app-search.component.ts | 35 +- .../product-search.component.html | 4 +- .../image-container.component.ts | 22 +- src/app/shared/utils.spec.ts | 43 +- src/app/shared/utils.ts | 5 + src/assets/images/product.jpg | Bin 0 -> 4257 bytes src/environments/environment.prod.ts | 2 +- src/environments/environment.ts | 2 +- 12 files changed, 448 insertions(+), 177 deletions(-) create mode 100644 src/assets/images/product.jpg diff --git a/package-lock.json b/package-lock.json index eb6196c..59386e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,16 +20,15 @@ "@angular/platform-browser-dynamic": "15.2.7", "@angular/router": "15.2.7", "@ngneat/error-tailor": "^2.2.0", - "@ngneat/falso": "^6.4.0", + "@ngneat/falso": "^7.2.0", "@ngx-translate/core": "^14.0.0", "@ngx-translate/http-loader": "^7.0.0", - "@onecx/accelerator": "^4.5.1", - "@onecx/integration-interface": "^4.9.0", - "@onecx/keycloak-auth": "^4.9.0", - "@onecx/portal-integration-angular": "^4.9.0", - "@onecx/portal-layout-styles": "^4.9.0", + "@onecx/accelerator": "^4.11.0", + "@onecx/integration-interface": "^4.11.0", + "@onecx/keycloak-auth": "^4.11.0", + "@onecx/portal-integration-angular": "^4.11.0", + "@onecx/portal-layout-styles": "^4.11.0", "file-saver": "^2.0.5", - "i18n-iso-countries": "^7.10.0", "ngx-color": "^8.0.3", "primeflex": "^3.3.1", "primeicons": "^6.0.1", @@ -61,7 +60,7 @@ "@storybook/angular": "7.0.4", "@storybook/core-server": "7.6.17", "@svgr/webpack": "^7.0.0", - "@swc-node/register": "^1.8.0", + "@swc-node/register": "^1.9.0", "@swc/cli": "~0.1.63", "@swc/core": "^1.3.56", "@swc/helpers": "0.5.1", @@ -77,7 +76,7 @@ "eslint-config-prettier": "8.8.0", "eslint-plugin-cypress": "^2.13.3", "eslint-plugin-import": "2.29.1", - "eslint-plugin-jsx-a11y": "6.7.1", + "eslint-plugin-jsx-a11y": "6.8.0", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-storybook": "^0.6.12", "husky": "^8.0.3", @@ -6756,9 +6755,9 @@ "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "node_modules/@ngneat/falso": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@ngneat/falso/-/falso-6.4.0.tgz", - "integrity": "sha512-f6r036h2fX/AoHw1eV2t8+qWQwrbSrozs3zXMhhwoO7SJBc+DGMxRWEhFeYIinfwx0uhUH8ggx5+PDLzYESLOA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@ngneat/falso/-/falso-7.2.0.tgz", + "integrity": "sha512-283EXBFd05kCbGuGSXgmvhCsQYEYzvD/eJaE7lxd05qRB0tgREvZX7TRlJ1KSp8nHxoK6Ws029G1Y30mt4IVAA==", "dependencies": { "seedrandom": "3.0.5", "uuid": "8.3.2" @@ -7368,18 +7367,18 @@ } }, "node_modules/@onecx/accelerator": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@onecx/accelerator/-/accelerator-4.9.0.tgz", - "integrity": "sha512-fZtAPrwW6tH0lFTaLXmgHolf01pf4mnL8nVcYBPJjRU4tQuNR/HVj6msBMcG/1a5aJNDHGfsmuXbrUdbMslvpg==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@onecx/accelerator/-/accelerator-4.11.0.tgz", + "integrity": "sha512-5HI3MkRILu+KMD+tsdK0GSsg+1qLh38A+WlGEPsKLWuuzJ6tpbgkz3m7ylpZudqPtiJJaWjUgTb7sLWQ+NPQXQ==", "peerDependencies": { "rxjs": "7.8.1", "tslib": "^2.3.0" } }, "node_modules/@onecx/integration-interface": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@onecx/integration-interface/-/integration-interface-4.9.0.tgz", - "integrity": "sha512-PjNph0hn8VlVTLY3b0ZQ/M/yCxvWbQ3XqK/xc7FC+8NNT0uvfLPNShsFvOzkUKH60D68BEoF112tJFoTC5d4uA==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@onecx/integration-interface/-/integration-interface-4.11.0.tgz", + "integrity": "sha512-FJMdJkufwYe1p6nnt5QYYJv0f6je2S9ErV3xJwx0WpzdA4wrbm+Lx/p2EdjyFQ3STilkDYVVRwuplIJ/cMnMAQ==", "peerDependencies": { "@onecx/accelerator": "~4", "rxjs": "7.8.1", @@ -7387,9 +7386,9 @@ } }, "node_modules/@onecx/keycloak-auth": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@onecx/keycloak-auth/-/keycloak-auth-4.9.0.tgz", - "integrity": "sha512-VbhgIahqiwEZwLHBiVCWKgnGt5TCQP+fX5TfotjtvvXYdVeEcoRIIKBy/QBHk7Aj4OqUeWpU1dkoLWWJnOsjqA==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@onecx/keycloak-auth/-/keycloak-auth-4.11.0.tgz", + "integrity": "sha512-9qN7kWkrX+DpgX7Epzqp8X6pNnpCHZ6KrkzFnqK0IcFhWzUJVlwTxpwj9KgXoBnzw9hBSBVQnNmGy21mmcVbPQ==", "dependencies": { "tslib": "^2.3.0" }, @@ -7403,9 +7402,9 @@ } }, "node_modules/@onecx/portal-integration-angular": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@onecx/portal-integration-angular/-/portal-integration-angular-4.9.0.tgz", - "integrity": "sha512-wMLfyCOhYy5wbPP1bzEBu56czfz5Meds98lq0I77fLJIQZV2L19dU7MYYH7Fum7EgYbSG4AMTt9Fh6UkKHBMcg==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@onecx/portal-integration-angular/-/portal-integration-angular-4.11.0.tgz", + "integrity": "sha512-a9jPSA89cDqIAn2mKH0XNptLTUCUX9tcoihOFnZBhR8p/Vi2rO8+HC8DcH+TA7ENFCLcsaUGrYjK3Erf4iZjug==", "dependencies": { "tslib": "^2.3.0" }, @@ -7436,9 +7435,9 @@ } }, "node_modules/@onecx/portal-layout-styles": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@onecx/portal-layout-styles/-/portal-layout-styles-4.9.0.tgz", - "integrity": "sha512-7/KnGiQXb15Q7Y9Lgai5xX1rrvK6tnLAEZ7q5lWDZRgl1Z2UY4f1A00yNrKAUOoF0r+lV+frLSC8bDCKhNplrQ==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@onecx/portal-layout-styles/-/portal-layout-styles-4.11.0.tgz", + "integrity": "sha512-ngH9PWgI3o9oreMBH7jlTOYiQRsbS3w2O8EtxSZFROdCC88siAg3Stl84YxfKjf94ZLY3RQJG7GWzH5BIcbmrg==", "peerDependencies": { "tslib": "^2.5.0" } @@ -11485,9 +11484,9 @@ } }, "node_modules/@swc-node/core": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@swc-node/core/-/core-1.12.0.tgz", - "integrity": "sha512-AYrEmPL2BT46wbikHwSMR5IK98SelBEYH+ycjalUxJ5xYjEupjF8Fd+NkadKoZAzf5zDtysFKd5R1PY4QBHIiw==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@swc-node/core/-/core-1.13.0.tgz", + "integrity": "sha512-lFPD4nmy4ifAOVMChFjwlpXN5KQXvegqeyuzz1KQz42q1lf+cL3Qux1/GteGuZjh8HC+Rj1RdNrHpE/MCfJSTw==", "dev": true, "engines": { "node": ">= 10" @@ -11502,13 +11501,13 @@ } }, "node_modules/@swc-node/register": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@swc-node/register/-/register-1.8.0.tgz", - "integrity": "sha512-8K3589HoBSmVmrEVrtr4K5sWEithpGDzcFGic81OW0A9sZY38IV5EGRODQWCk0SBDyLhaF+pid120vJAtsHo1A==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@swc-node/register/-/register-1.9.0.tgz", + "integrity": "sha512-i0iYInD4q5v3xQC6bKvs0QtfUxu197CU5qKALmpxEqTYs7sIhQ7KFLe3kP+eAR4gRkJTvAgjQgrokXLN2jZrOw==", "dev": true, "dependencies": { - "@swc-node/core": "^1.12.0", - "@swc-node/sourcemap-support": "^0.4.0", + "@swc-node/core": "^1.13.0", + "@swc-node/sourcemap-support": "^0.5.0", "colorette": "^2.0.20", "debug": "^4.3.4", "pirates": "^4.0.6", @@ -11524,9 +11523,9 @@ } }, "node_modules/@swc-node/sourcemap-support": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@swc-node/sourcemap-support/-/sourcemap-support-0.4.0.tgz", - "integrity": "sha512-weuRmYTO+4yOtHtPZHXlPdA1dJJJp3QOoZAFZ6uZidu992F2X5v1fQdnb26xs1o3Ex/e2sYhRyY5R6NGNuoATQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@swc-node/sourcemap-support/-/sourcemap-support-0.5.0.tgz", + "integrity": "sha512-fbhjL5G0YvFoWwNhWleuBUfotiX+USiA9oJqu9STFw+Hb0Cgnddn+HVS/K5fI45mn92e8V+cHD2jgFjk4w2T9Q==", "dev": true, "dependencies": { "source-map-support": "^0.5.21", @@ -13573,9 +13572,9 @@ } }, "node_modules/ast-types-flow": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", - "integrity": "sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", + "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", "dev": true }, "node_modules/astral-regex": { @@ -13686,9 +13685,9 @@ "dev": true }, "node_modules/axe-core": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.8.4.tgz", - "integrity": "sha512-CZLSKisu/bhJ2awW4kJndluz2HLZYIHh5Uy1+ZwDRkJi69811xgIXXfdU9HSLX0Th+ILrHj8qfL/5wzamsFtQg==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.0.tgz", + "integrity": "sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ==", "dev": true, "engines": { "node": ">=4" @@ -16706,6 +16705,57 @@ "node": ">=0.10" } }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", @@ -17131,11 +17181,6 @@ "integrity": "sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA==", "dev": true }, - "node_modules/diacritics": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/diacritics/-/diacritics-1.3.0.tgz", - "integrity": "sha512-wlwEkqcsaxvPJML+rDh/2iS824jbREk6DUMUKkEaSlxdYHeS43cClJtsWglvw2RfeXGm6ohKDqsXteJ5sP5enA==" - }, "node_modules/didyoumean": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", @@ -17652,17 +17697,21 @@ } }, "node_modules/es-abstract": { - "version": "1.22.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.5.tgz", - "integrity": "sha512-oW69R+4q2wG+Hc3KZePPZxOiisRIqfKBVo/HLx94QcJeWGU/8sZhCvc829rd1kS366vlJbzBfXf9yWwf0+Ko7w==", + "version": "1.23.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.2.tgz", + "integrity": "sha512-60s3Xv2T2p1ICykc7c+DNDPLDMm9t4QxCOUU0K9JxiLjM3C1zB9YVdN7tjxrFd4+AkZ8CdX1ovUga4P2+1e+/w==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.1", "arraybuffer.prototype.slice": "^1.0.3", "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", "es-define-property": "^1.0.0", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", "function.prototype.name": "^1.1.6", @@ -17673,10 +17722,11 @@ "has-property-descriptors": "^1.0.2", "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "hasown": "^2.0.1", + "hasown": "^2.0.2", "internal-slot": "^1.0.7", "is-array-buffer": "^3.0.4", "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.3", @@ -17687,17 +17737,17 @@ "object-keys": "^1.1.1", "object.assign": "^4.1.5", "regexp.prototype.flags": "^1.5.2", - "safe-array-concat": "^1.1.0", + "safe-array-concat": "^1.1.2", "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.8", - "string.prototype.trimend": "^1.0.7", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", "string.prototype.trimstart": "^1.0.7", "typed-array-buffer": "^1.0.2", "typed-array-byte-length": "^1.0.1", "typed-array-byte-offset": "^1.0.2", "typed-array-length": "^1.0.5", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.14" + "which-typed-array": "^1.1.15" }, "engines": { "node": ">= 0.4" @@ -17751,12 +17801,49 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-iterator-helpers": { + "version": "1.0.18", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.18.tgz", + "integrity": "sha512-scxAJaewsahbqTYrGKJihhViaM6DDZDDoucfvzNbK0pOren1g/daDQ3IAhzn+1G14rBG7w+i5N+qul60++zlKA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "globalthis": "^1.0.3", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.7", + "iterator.prototype": "^1.1.2", + "safe-array-concat": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-module-lexer": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==", "dev": true }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-set-tostringtag": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", @@ -18139,27 +18226,27 @@ } }, "node_modules/eslint-plugin-jsx-a11y": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.7.1.tgz", - "integrity": "sha512-63Bog4iIethyo8smBklORknVjB0T2dwB8Mr/hIC+fBS0uyHdYYpzM/Ed+YC8VxTjlXHEWFOdmgwcDn1U2L9VCA==", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz", + "integrity": "sha512-Hdh937BS3KdwwbBaKd5+PLCOmYY6U4f2h9Z2ktwtNKvIdIEu137rjYbcb9ApSbVJfWxANNuiKTD/9tOKjK9qOA==", "dev": true, "dependencies": { - "@babel/runtime": "^7.20.7", - "aria-query": "^5.1.3", - "array-includes": "^3.1.6", - "array.prototype.flatmap": "^1.3.1", - "ast-types-flow": "^0.0.7", - "axe-core": "^4.6.2", - "axobject-query": "^3.1.1", + "@babel/runtime": "^7.23.2", + "aria-query": "^5.3.0", + "array-includes": "^3.1.7", + "array.prototype.flatmap": "^1.3.2", + "ast-types-flow": "^0.0.8", + "axe-core": "=4.7.0", + "axobject-query": "^3.2.1", "damerau-levenshtein": "^1.0.8", "emoji-regex": "^9.2.2", - "has": "^1.0.3", - "jsx-ast-utils": "^3.3.3", - "language-tags": "=1.0.5", + "es-iterator-helpers": "^1.0.15", + "hasown": "^2.0.0", + "jsx-ast-utils": "^3.3.5", + "language-tags": "^1.0.9", "minimatch": "^3.1.2", - "object.entries": "^1.1.6", - "object.fromentries": "^2.0.6", - "semver": "^6.3.0" + "object.entries": "^1.1.7", + "object.fromentries": "^2.0.7" }, "engines": { "node": ">=4.0" @@ -18168,6 +18255,36 @@ "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" } }, + "node_modules/eslint-plugin-jsx-a11y/node_modules/@babel/runtime": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.1.tgz", + "integrity": "sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ==", + "dev": true, + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/eslint-plugin-jsx-a11y/node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dev": true, + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/eslint-plugin-jsx-a11y/node_modules/axobject-query": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", + "integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==", + "dev": true, + "dependencies": { + "dequal": "^2.0.3" + } + }, "node_modules/eslint-plugin-jsx-a11y/node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -18190,14 +18307,11 @@ "node": "*" } }, - "node_modules/eslint-plugin-jsx-a11y/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } + "node_modules/eslint-plugin-jsx-a11y/node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true }, "node_modules/eslint-plugin-prettier": { "version": "4.2.1", @@ -20346,15 +20460,6 @@ "node": ">=6" } }, - "node_modules/has": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", - "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", - "dev": true, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -20427,9 +20532,9 @@ "dev": true }, "node_modules/hasown": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", - "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dependencies": { "function-bind": "^1.1.2" }, @@ -20912,17 +21017,6 @@ "url": "https://github.com/sponsors/typicode" } }, - "node_modules/i18n-iso-countries": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/i18n-iso-countries/-/i18n-iso-countries-7.10.0.tgz", - "integrity": "sha512-Y4wkIS2MzYk7cvaV665qcHpBUK4FaMcAhSfsggu9SPV9VpWvmH8NklofWvPPFWG1ZXmxqZ0Ubgr+ZtqddxG4ag==", - "dependencies": { - "diacritics": "1.3.0" - }, - "engines": { - "node": ">= 12" - } - }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -21302,6 +21396,21 @@ "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, + "node_modules/is-async-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", + "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -21391,6 +21500,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -21445,6 +21569,18 @@ "node": ">=0.10.0" } }, + "node_modules/is-finalizationregistry": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", + "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -22010,6 +22146,19 @@ "node": ">=6" } }, + "node_modules/iterator.prototype": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.2.tgz", + "integrity": "sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "reflect.getprototypeof": "^1.0.4", + "set-function-name": "^2.0.1" + } + }, "node_modules/jackspeak": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", @@ -23026,12 +23175,15 @@ "dev": true }, "node_modules/language-tags": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.5.tgz", - "integrity": "sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz", + "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==", "dev": true, "dependencies": { - "language-subtag-registry": "~0.3.2" + "language-subtag-registry": "^0.3.20" + }, + "engines": { + "node": ">=0.10" } }, "node_modules/lazy-ass": { @@ -29506,6 +29658,27 @@ "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A==", "dev": true }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", + "integrity": "sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.1", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "globalthis": "^1.0.3", + "which-builtin-type": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -30128,13 +30301,13 @@ } }, "node_modules/safe-array-concat": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.0.tgz", - "integrity": "sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", "dev": true, "dependencies": { - "call-bind": "^1.0.5", - "get-intrinsic": "^1.2.2", + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", "has-symbols": "^1.0.3", "isarray": "^2.0.5" }, @@ -31481,14 +31654,15 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/string.prototype.trim": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", - "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -31498,14 +31672,14 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", - "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -34237,6 +34411,32 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/which-builtin-type": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.3.tgz", + "integrity": "sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw==", + "dev": true, + "dependencies": { + "function.prototype.name": "^1.1.5", + "has-tostringtag": "^1.0.0", + "is-async-function": "^2.0.0", + "is-date-object": "^1.0.5", + "is-finalizationregistry": "^1.0.2", + "is-generator-function": "^1.0.10", + "is-regex": "^1.1.4", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/which-collection": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", @@ -34253,15 +34453,15 @@ } }, "node_modules/which-typed-array": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", - "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", "dependencies": { - "available-typed-arrays": "^1.0.6", - "call-bind": "^1.0.5", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.1" + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" diff --git a/package.json b/package.json index 3a50f57..3bd93b6 100644 --- a/package.json +++ b/package.json @@ -46,16 +46,15 @@ "@angular/platform-browser-dynamic": "15.2.7", "@angular/router": "15.2.7", "@ngneat/error-tailor": "^2.2.0", - "@ngneat/falso": "^6.4.0", + "@ngneat/falso": "^7.2.0", "@ngx-translate/core": "^14.0.0", "@ngx-translate/http-loader": "^7.0.0", - "@onecx/accelerator": "^4.5.1", - "@onecx/integration-interface": "^4.9.0", - "@onecx/keycloak-auth": "^4.9.0", - "@onecx/portal-integration-angular": "^4.9.0", - "@onecx/portal-layout-styles": "^4.9.0", + "@onecx/accelerator": "^4.11.0", + "@onecx/integration-interface": "^4.11.0", + "@onecx/keycloak-auth": "^4.11.0", + "@onecx/portal-integration-angular": "^4.11.0", + "@onecx/portal-layout-styles": "^4.11.0", "file-saver": "^2.0.5", - "i18n-iso-countries": "^7.10.0", "ngx-color": "^8.0.3", "primeflex": "^3.3.1", "primeicons": "^6.0.1", @@ -87,7 +86,7 @@ "@storybook/angular": "7.0.4", "@storybook/core-server": "7.6.17", "@svgr/webpack": "^7.0.0", - "@swc-node/register": "^1.8.0", + "@swc-node/register": "^1.9.0", "@swc/cli": "~0.1.63", "@swc/core": "^1.3.56", "@swc/helpers": "0.5.1", @@ -103,7 +102,7 @@ "eslint-config-prettier": "8.8.0", "eslint-plugin-cypress": "^2.13.3", "eslint-plugin-import": "2.29.1", - "eslint-plugin-jsx-a11y": "6.7.1", + "eslint-plugin-jsx-a11y": "6.8.0", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-storybook": "^0.6.12", "husky": "^8.0.3", diff --git a/src/_mixins.scss b/src/_mixins.scss index 4d8243a..e3af8ba 100644 --- a/src/_mixins.scss +++ b/src/_mixins.scss @@ -78,7 +78,6 @@ .data-view-control * { color: var(--emphasis-medium); } - // correction for data-view-control component .data-view-control-border.p-dropdown { .p-inputtext { color: var(--emphasis-medium); diff --git a/src/app/product-store/app-search/app-search.component.spec.ts b/src/app/product-store/app-search/app-search.component.spec.ts index b86a0a7..d928228 100644 --- a/src/app/product-store/app-search/app-search.component.spec.ts +++ b/src/app/product-store/app-search/app-search.component.spec.ts @@ -6,6 +6,7 @@ import { Router, ActivatedRoute } from '@angular/router' import { of, throwError } from 'rxjs' import { FormControl, FormGroup, Validators } from '@angular/forms' import { TranslateTestingModule } from 'ngx-translate-testing' +import { TranslateService } from '@ngx-translate/core' import { UserService } from '@onecx/portal-integration-angular' import { AppAbstract, AppType, AppSearchComponent, AppSearchCriteria } from './app-search.component' @@ -120,6 +121,37 @@ describe('AppSearchComponent', () => { expect(component).toBeTruthy() }) + xit('should prepare dialog translations', async () => { + const translateService = TestBed.inject(TranslateService) + const actionsTranslations = { + 'ACTIONS.NAVIGATION.BACK': 'back', + 'ACTIONS.NAVIGATION.BACK.TOOLTIP': 'backTooltip', + 'ACTIONS.CREATE.MS.LABEL': 'msLabel', + 'ACTIONS.CREATE.MFE.LABEL': 'mfeLabel', + 'ACTIONS.CREATE.APP.TOOLTIP': 'appTooltip' + } + const dialogTranslations = { + 'ACTIONS.DATAVIEW.FILTER_OF': 'searchFilterOf', + 'APP.APP_ID': 'appId', + 'APP.APP_TYPE': 'appType', + 'APP.PRODUCT_NAME': 'productName' + } + spyOn(translateService, 'get').and.returnValues(of(actionsTranslations), of(dialogTranslations)) + + await component.ngOnInit() + + expect(component.dataViewControlsTranslations).toEqual({ + filterInputTooltip: + dialogTranslations['ACTIONS.DATAVIEW.FILTER_OF'] + + ': ' + + dialogTranslations['APP.APP_ID'] + + ', ' + + dialogTranslations['APP.APP_TYPE'] + + ', ' + + dialogTranslations['APP.PRODUCT_NAME'] + }) + }) + it('should call onBack when actionCallback is executed', () => { spyOn(component, 'onBack') diff --git a/src/app/product-store/app-search/app-search.component.ts b/src/app/product-store/app-search/app-search.component.ts index 80791e4..3edbbdc 100644 --- a/src/app/product-store/app-search/app-search.component.ts +++ b/src/app/product-store/app-search/app-search.component.ts @@ -241,43 +241,22 @@ export class AppSearchComponent implements OnInit, OnDestroy { }) ) } - private prepareDialogTranslations(): void { - this.translate - .get([ - 'APP.APP_ID', - 'APP.APP_TYPE', - 'APP.PRODUCT_NAME', - 'ACTIONS.DATAVIEW.VIEW_MODE_GRID', - 'ACTIONS.DATAVIEW.VIEW_MODE_LIST', - 'ACTIONS.DATAVIEW.VIEW_MODE_TABLE', - 'ACTIONS.DATAVIEW.SORT_BY', - 'ACTIONS.DATAVIEW.FILTER', - 'ACTIONS.DATAVIEW.FILTER_OF', - 'ACTIONS.DATAVIEW.SORT_DIRECTION_ASC', - 'ACTIONS.DATAVIEW.SORT_DIRECTION_DESC' - ]) - .subscribe((data) => { + + public prepareDialogTranslations(): void { + this.translate.get(['APP.APP_ID', 'APP.APP_TYPE', 'APP.PRODUCT_NAME', 'ACTIONS.DATAVIEW.FILTER_OF']).pipe( + map((data) => { this.dataViewControlsTranslations = { - sortDropdownPlaceholder: data['ACTIONS.DATAVIEW.SORT_BY'], - filterInputPlaceholder: data['ACTIONS.DATAVIEW.FILTER'], filterInputTooltip: data['ACTIONS.DATAVIEW.FILTER_OF'] + + ': ' + data['APP.APP_ID'] + ', ' + data['APP.APP_TYPE'] + ', ' + - data['APP.PRODUCT_NAME'], - viewModeToggleTooltips: { - grid: data['ACTIONS.DATAVIEW.VIEW_MODE_GRID'], - list: data['ACTIONS.DATAVIEW.VIEW_MODE_LIST'] - }, - sortOrderTooltips: { - ascending: data['ACTIONS.DATAVIEW.SORT_DIRECTION_ASC'], - descending: data['ACTIONS.DATAVIEW.SORT_DIRECTION_DESC'] - }, - sortDropdownTooltip: data['ACTIONS.DATAVIEW.SORT_BY'] + data['APP.PRODUCT_NAME'] } }) + ) } /** diff --git a/src/app/product-store/product-search/product-search.component.html b/src/app/product-store/product-search/product-search.component.html index 5038fdb..26a2017 100644 --- a/src/app/product-store/product-search/product-search.component.html +++ b/src/app/product-store/product-search/product-search.component.html @@ -123,10 +123,10 @@ [small]="false" > -
+
{{ limitText(product.displayName, 20) }} diff --git a/src/app/shared/image-container/image-container.component.ts b/src/app/shared/image-container/image-container.component.ts index 3161e76..8601007 100644 --- a/src/app/shared/image-container/image-container.component.ts +++ b/src/app/shared/image-container/image-container.component.ts @@ -1,6 +1,9 @@ import { Component, Input, OnChanges, SimpleChanges } from '@angular/core' -import { prepareUrl } from 'src/app/shared/utils' +import { map } from 'rxjs' + +import { prepareUrl, prepareUrlPath } from 'src/app/shared/utils' import { environment } from 'src/environments/environment' +import { AppStateService } from '@onecx/portal-integration-angular' @Component({ selector: 'app-image-container', @@ -12,10 +15,23 @@ export class ImageContainerComponent implements OnChanges { @Input() public imageUrl: string | undefined @Input() public small = false - public defaultImageUrl = environment.DEFAULT_LOGO_URL + public defaultImageUrl = '' public displayPlaceHolder = false - public onImageError() { + prepareUrl = prepareUrl + prepareUrlPath = prepareUrlPath + + constructor(private appState: AppStateService) { + appState.currentMfe$ + .pipe( + map((mfe) => { + this.defaultImageUrl = this.prepareUrlPath(mfe.remoteBaseUrl, environment.DEFAULT_LOGO_URL) + }) + ) + .subscribe() + } + + public onImageError(): void { this.displayPlaceHolder = true } diff --git a/src/app/shared/utils.spec.ts b/src/app/shared/utils.spec.ts index 39b83c1..5ea3c05 100644 --- a/src/app/shared/utils.spec.ts +++ b/src/app/shared/utils.spec.ts @@ -5,7 +5,9 @@ import { dropDownSortItemsByLabel, dropDownGetLabelByValue, sortByLocale, - convertToUniqueStringArray + convertToUniqueStringArray, + prepareUrl, + prepareUrlPath } from './utils' describe('utils', () => { @@ -82,4 +84,43 @@ describe('utils', () => { expect(sortedArray[0]).toEqual('a') }) }) + + describe('prepareUrl', () => { + it('should prepare internal url', () => { + const url = 'url' + + const preparedUrl = prepareUrl(url) ?? '' + + expect(preparedUrl).toEqual('bff/url') + }) + }) + + describe('prepareUrl', () => { + it('should prepare external url', () => { + const url = 'http://url' + + const preparedUrl = prepareUrl(url) ?? '' + + expect(preparedUrl).toEqual(url) + }) + }) + + describe('prepareUrlPath', () => { + it('should prepare urls', () => { + const url = 'http://url' + const path = 'path' + + let urlPath = prepareUrlPath(url, path) + + expect(urlPath).toEqual(url + '/' + path) + + urlPath = prepareUrlPath(url) + + expect(urlPath).toEqual(urlPath) + + urlPath = prepareUrlPath() + + expect(urlPath).toEqual('') + }) + }) }) diff --git a/src/app/shared/utils.ts b/src/app/shared/utils.ts index f582682..0eb5503 100644 --- a/src/app/shared/utils.ts +++ b/src/app/shared/utils.ts @@ -17,6 +17,11 @@ export function prepareUrl(url: string | undefined): string | undefined { return url } } +export function prepareUrlPath(url?: string, path?: string): string { + if (url && path) return Location.joinWithSlash(url, path) + else if (url) return url + else return '' +} export function dropDownSortItemsByLabel(a: SelectItem, b: SelectItem): number { return (a.label ? (a.label as string).toUpperCase() : '').localeCompare( diff --git a/src/assets/images/product.jpg b/src/assets/images/product.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b1309eb6572acfe9c737723426aed5d61f487033 GIT binary patch literal 4257 zcmb7E2UybU_x~a)N@ng-Q4uw_fC&mY5=TmbhUP%)Mu3XS5XjLqZ$ryW&5?T~nXAl^ zX11)fwCQS?{&HlQtFpS4_vR0@ai8CFpZkCQFAqGN_ngn?bIyCt`z}0LcmXI8-96m_ zka$^uEC66(7|?KwWrY9$i3FGd03av+ir2!hbY7TH$ipL%9Dx;$!QIZZqI22ESQ-zB zwn8BRd#6|)jUK@i!nZR+SsVw%?4_#+IE&$c@W+r)B%TX1jODSD&-B?z_NDKPpyL<_ zC&%Sb`&fJ|o5yAfY4BKfBu9XcbwDh#>QfN++`!UIU&a2GD03CCEW zEa@mL8jiKGLffElHaH8oH42SFqOFlATT3(wkFmw0(D3gIA(oT3=QBd^6j%4}YGTU) z@x88?m>8>=HC9}HC=!js;gBe6q_wrBIKom8#}U$EEja>%MUEvBSEhi@XYqtAE(b0l zrETZ#5IP{l=`Pj5=22LoVM4)A{(n3-{$h-z$R8*Y>E97-_Rna6kiz_x|3C5zeB*db zB!wy9?%>mz;&6i>QVjY}9o`Op6wVz3x^EQVl9z}dKA zFc>r%?Y71ayT;ZXjX^u(Y_PTjtoskFCr2Qpap=q+Sk^DB>%U_0E_^0U$mRQTxsg8x z%R7uKli|+ivf+#8k7xZY2b?%@Yb+Y; zg2mWk-Q1j=aRhfeTQ{sT2DN65tF;Z{JBIPMn*UD>QZl&m^7afmp1zdz(#Fyp`Y@xu zn@e^i%h8p^kAS=J#kY}TkCe=&cyEzHe#!g^u}A(dr$j`^5=JtA03>kdNa6oTNX8W( zN#lfyTV}~%hR}9I3K5QI6xvQ)JjU)HRe!Q9s{RsL3jW)5l4vb$iZ80zut)xUBqY|) zhla^vI2gwmJ2@^)10KJcx5f$u*bzKQ($b4B*9sVj3V^kZ*2AO#KuY{s^cgMsl>Qvn zOS;{3Cl+b5-3Ag6Gr2GTxB#-!GO{w#va&L=5QwZCR0%3ReW;q^3I(N=YO7YQRMXJV z(lOH0(l&r;XuvJt2CI!t%}h1*EK!ywC?gY76A1|j0)ar~psG-)s)?3{mdXEnEnEYX z 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 RB9jA@j8f%)HB}d${uc@ewWR<6 literal 0 HcmV?d00001 diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 5071f7e..b9dd801 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -2,5 +2,5 @@ export const environment = { production: true, BASE_PATH: '/bff', apiPrefix: 'bff', - DEFAULT_LOGO_URL: 'http://pragmaticscrum.info/wp-content/uploads/2016/06/t1.jpg' + DEFAULT_LOGO_URL: 'assets/images/product.jpg' } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 4adbe3a..a68ab04 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -9,5 +9,5 @@ export const environment = { KEYCLOAK_REALM: 'OneCX', skipRemoteConfigLoad: true, apiPrefix: 'bff', - DEFAULT_LOGO_URL: 'http://pragmaticscrum.info/wp-content/uploads/2016/06/t1.jpg' + DEFAULT_LOGO_URL: './assets/images/product.jpg' }