From 4ffecb1d3d17aa2dfba77f607e0c9a9593728f15 Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Thu, 11 Jan 2024 16:35:52 +0100 Subject: [PATCH 01/15] chore(i18n): add dependencies and script for extraction --- package-lock.json | 453 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 451 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index b1ed445c..52600fda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4717,6 +4717,20 @@ "rxjs": "^6.5.3 || ^7.5.0" } }, + "node_modules/@ngrx/component": { + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/@ngrx/component/-/component-17.0.1.tgz", + "integrity": "sha512-B38NyH18gxTjrTJOu1fc+AMwOpAaRly6hgWx7zZZtbIwo0sd/bYTZGgMrJkw/CjmvjpAVBE14fB9qI+pSUsl4A==", + "peer": true, + "dependencies": { + "tslib": "^2.0.0" + }, + "peerDependencies": { + "@angular/common": "^17.0.0", + "@angular/core": "^17.0.0", + "rxjs": "^6.5.3 || ^7.5.0" + } + }, "node_modules/@ngrx/component-store": { "version": "17.0.1", "resolved": "https://registry.npmjs.org/@ngrx/component-store/-/component-store-17.0.1.tgz", @@ -4786,8 +4800,7 @@ "node_modules/@ngrx/schematics": { "version": "17.0.1", "resolved": "https://registry.npmjs.org/@ngrx/schematics/-/schematics-17.0.1.tgz", - "integrity": "sha512-yOQxy6PWKbxS2JhE54Li5qAJVruZGkUrsVCcx6pFKssKMGBG1R0EHBZ0BAmFtkiHvyHz3P/RUiaNf+UbWPPgIw==", - "dev": true + "integrity": "sha512-yOQxy6PWKbxS2JhE54Li5qAJVruZGkUrsVCcx6pFKssKMGBG1R0EHBZ0BAmFtkiHvyHz3P/RUiaNf+UbWPPgIw==" }, "node_modules/@ngrx/store": { "version": "17.0.1", @@ -4828,6 +4841,172 @@ "webpack": "^5.54.0" } }, + "node_modules/@nguniversal/express-engine": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/@nguniversal/express-engine/-/express-engine-16.2.0.tgz", + "integrity": "sha512-Pg77DfDvKtLzRUTahjv3WxWUldpNQTHIlyoU0wYrwoi/7qnHzoXdrvI1tqzC+DqPwxOmkGySoiRa2jJ+9IgvKw==", + "peer": true, + "dependencies": { + "@nguniversal/common": "16.2.0", + "tslib": "^2.3.0" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/common": "^16.0.0 || ^16.1.0-next.0", + "@angular/core": "^16.0.0 || ^16.1.0-next.0", + "express": "^4.15.2" + } + }, + "node_modules/@nguniversal/express-engine/node_modules/@nguniversal/common": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/@nguniversal/common/-/common-16.2.0.tgz", + "integrity": "sha512-b3dQAwD2iI2kzF3O1mhwh6bhDg1SlT46K9lOSzNZNXy0bvV4WrSpVmfN7YKINZLFal5uwHn4j1LNdrDR4Qohlw==", + "peer": true, + "dependencies": { + "critters": "0.0.20", + "jsdom": "22.1.0", + "tslib": "^2.3.0" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/common": "^16.0.0 || ^16.1.0-next.0", + "@angular/core": "^16.0.0 || ^16.1.0-next.0" + } + }, + "node_modules/@nguniversal/express-engine/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "peer": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/@nguniversal/express-engine/node_modules/cssstyle": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", + "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", + "peer": true, + "dependencies": { + "rrweb-cssom": "^0.6.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@nguniversal/express-engine/node_modules/data-urls": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", + "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", + "peer": true, + "dependencies": { + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^12.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@nguniversal/express-engine/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "peer": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@nguniversal/express-engine/node_modules/jsdom": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", + "integrity": "sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==", + "peer": true, + "dependencies": { + "abab": "^2.0.6", + "cssstyle": "^3.0.0", + "data-urls": "^4.0.0", + "decimal.js": "^10.4.3", + "domexception": "^4.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.4", + "parse5": "^7.1.2", + "rrweb-cssom": "^0.6.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^12.0.1", + "ws": "^8.13.0", + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/@nguniversal/express-engine/node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "peer": true, + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/@nguniversal/express-engine/node_modules/tr46": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "peer": true, + "dependencies": { + "punycode": "^2.3.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@nguniversal/express-engine/node_modules/whatwg-url": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", + "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", + "peer": true, + "dependencies": { + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/@ngx-translate/core": { "version": "15.0.0", "resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-15.0.0.tgz", @@ -16977,6 +17156,64 @@ "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "peer": true }, + "node_modules/geonetwork-ui/node_modules/loader-utils": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.1.tgz", + "integrity": "sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==", + "peer": true, + "engines": { + "node": ">= 12.13.0" + } + }, + "node_modules/geonetwork-ui/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "peer": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/geonetwork-ui/node_modules/magic-string": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.1.tgz", + "integrity": "sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==", + "peer": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/geonetwork-ui/node_modules/mini-css-extract-plugin": { + "version": "2.7.6", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.6.tgz", + "integrity": "sha512-Qk7HcgaPkGG6eD77mLvZS1nmxlao3j+9PkrT9Uc7HAE1id3F41+DdBRYRYkbyfNRGzm8/YWtzhw7nVPmwhqTQw==", + "peer": true, + "dependencies": { + "schema-utils": "^4.0.0" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + } + }, + "node_modules/geonetwork-ui/node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "peer": true + }, "node_modules/geonetwork-ui/node_modules/nx": { "version": "16.6.0", "resolved": "https://registry.npmjs.org/nx/-/nx-16.6.0.tgz", @@ -17116,6 +17353,55 @@ "nice-napi": "^1.0.2" } }, + "node_modules/geonetwork-ui/node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "peer": true, + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/geonetwork-ui/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "peer": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/geonetwork-ui/node_modules/piscina": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/piscina/-/piscina-4.0.0.tgz", + "integrity": "sha512-641nAmJS4k4iqpNUqfggqUBUMmlw0ZoM5VZKdQkV2e970Inn3Tk9kroCc1wpsYLD07vCwpys5iY0d3xI/9WkTg==", + "peer": true, + "dependencies": { + "eventemitter-asyncresource": "^1.0.0", + "hdr-histogram-js": "^2.0.1", + "hdr-histogram-percentiles-obj": "^3.0.0" + }, + "optionalDependencies": { + "nice-napi": "^1.0.2" + } + }, "node_modules/geonetwork-ui/node_modules/postcss": { "version": "8.4.31", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", @@ -17143,6 +17429,77 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/geonetwork-ui/node_modules/postcss-loader": { + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-7.3.3.tgz", + "integrity": "sha512-YgO/yhtevGO/vJePCQmTxiaEwER94LABZN0ZMT4A0vsak9TpO+RvKRs7EmJ8peIlB9xfXCsS7M8LjqncsUZ5HA==", + "peer": true, + "dependencies": { + "cosmiconfig": "^8.2.0", + "jiti": "^1.18.2", + "semver": "^7.3.8" + }, + "engines": { + "node": ">= 14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "postcss": "^7.0.0 || ^8.0.1", + "webpack": "^5.0.0" + } + }, + "node_modules/geonetwork-ui/node_modules/postcss-loader/node_modules/cosmiconfig": { + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", + "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", + "peer": true, + "dependencies": { + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0", + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/geonetwork-ui/node_modules/proxy-from-env": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", + "integrity": "sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==", + "optional": true, + "peer": true + }, + "node_modules/geonetwork-ui/node_modules/qs": { + "version": "6.10.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.4.tgz", + "integrity": "sha512-OQiU+C+Ds5qiH91qh/mg0w+8nwQuLjM4F4M/PbmhDOoYehPh+Fb0bDjtR1sOvy7YKxvj28Y/M0PhP5uVX0kB+g==", + "optional": true, + "peer": true, + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/geonetwork-ui/node_modules/regenerator-runtime": { "version": "0.13.11", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", @@ -17173,6 +17530,43 @@ "node": ">=14.0.0" } }, + "node_modules/geonetwork-ui/node_modules/sass-loader": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-13.3.2.tgz", + "integrity": "sha512-CQbKl57kdEv+KDLquhC+gE3pXt74LEAzm+tzywcA0/aHZuub8wTErbjAoNI57rPUWRYRNC5WUnNl8eGJNbDdwg==", + "peer": true, + "dependencies": { + "neo-async": "^2.6.2" + }, + "engines": { + "node": ">= 14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "fibers": ">= 3.1.0", + "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", + "sass": "^1.3.0", + "sass-embedded": "*", + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "fibers": { + "optional": true + }, + "node-sass": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + } + } + }, "node_modules/geonetwork-ui/node_modules/slash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", @@ -17283,6 +17677,34 @@ } } }, + "node_modules/geonetwork-ui/node_modules/webpack-dev-middleware": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-6.1.1.tgz", + "integrity": "sha512-y51HrHaFeeWir0YO4f0g+9GwZawuigzcAdRNon6jErXy/SqV/+O6eaVAzDqE6t3e3NpGeR5CS+cCDaTC+V3yEQ==", + "peer": true, + "dependencies": { + "colorette": "^2.0.10", + "memfs": "^3.4.12", + "mime-types": "^2.1.31", + "range-parser": "^1.2.1", + "schema-utils": "^4.0.0" + }, + "engines": { + "node": ">= 14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true + } + } + }, "node_modules/geonetwork-ui/node_modules/webpack-merge": { "version": "5.9.0", "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.9.0.tgz", @@ -24529,6 +24951,12 @@ "fsevents": "~2.3.2" } }, + "node_modules/rrweb-cssom": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", + "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", + "peer": true + }, "node_modules/run-async": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", @@ -25768,6 +26196,18 @@ "node": ">=8" } }, + "node_modules/supports-hyperlinks": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz", + "integrity": "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==", + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -28367,6 +28807,15 @@ } } }, + "node_modules/xhr2": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.2.1.tgz", + "integrity": "sha512-sID0rrVCqkVNUn8t6xuv9+6FViXjUVXq8H5rWOH2rz9fDNQEd4g0EA2XlcEdJXRz5BMEn4O1pJFdT+z4YHhoWw==", + "peer": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/xlsx": { "version": "0.17.5", "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.17.5.tgz", From 6913c9207b0cfa625bab7bc8319f7d2015f0bae9 Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Tue, 16 Jan 2024 14:25:52 +0100 Subject: [PATCH 02/15] feat(home): add last-created.component with proper search state --- apps/datahub/src/app/app.module.ts | 2 ++ .../home-header/home-header.component.html | 4 ++- .../last-created/last-created.component.css | 0 .../last-created/last-created.component.html | 3 ++ .../last-created.component.spec.ts | 22 +++++++++++++ .../last-created/last-created.component.ts | 33 +++++++++++++++++++ 6 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 apps/datahub/src/app/home/last-created/last-created.component.css create mode 100644 apps/datahub/src/app/home/last-created/last-created.component.html create mode 100644 apps/datahub/src/app/home/last-created/last-created.component.spec.ts create mode 100644 apps/datahub/src/app/home/last-created/last-created.component.ts diff --git a/apps/datahub/src/app/app.module.ts b/apps/datahub/src/app/app.module.ts index 7ce9f36e..36ec7037 100644 --- a/apps/datahub/src/app/app.module.ts +++ b/apps/datahub/src/app/app.module.ts @@ -34,6 +34,7 @@ import { AppRouterService } from './app.router.service' import { HomeHeaderComponent } from './home/home-header/home-header.component' import { MatIconModule } from '@angular/material/icon' import { MelEmbeddedTranslateLoader } from './common/embedded.translate.loader' +import { LastCreatedComponent } from './home/last-created/last-created.component' @NgModule({ declarations: [ @@ -44,6 +45,7 @@ import { MelEmbeddedTranslateLoader } from './common/embedded.translate.loader' HeaderComponent, HomePageComponent, HomeHeaderComponent, + LastCreatedComponent, ], imports: [ BrowserModule, diff --git a/apps/datahub/src/app/home/home-header/home-header.component.html b/apps/datahub/src/app/home/home-header/home-header.component.html index 5af737a1..680d5879 100644 --- a/apps/datahub/src/app/home/home-header/home-header.component.html +++ b/apps/datahub/src/app/home/home-header/home-header.component.html @@ -10,6 +10,8 @@

[autoFocus]="true" > -
+
+ +
diff --git a/apps/datahub/src/app/home/last-created/last-created.component.css b/apps/datahub/src/app/home/last-created/last-created.component.css new file mode 100644 index 00000000..e69de29b diff --git a/apps/datahub/src/app/home/last-created/last-created.component.html b/apps/datahub/src/app/home/last-created/last-created.component.html new file mode 100644 index 00000000..d0748b72 --- /dev/null +++ b/apps/datahub/src/app/home/last-created/last-created.component.html @@ -0,0 +1,3 @@ +
+ {{ result.title }} +
diff --git a/apps/datahub/src/app/home/last-created/last-created.component.spec.ts b/apps/datahub/src/app/home/last-created/last-created.component.spec.ts new file mode 100644 index 00000000..5a29b055 --- /dev/null +++ b/apps/datahub/src/app/home/last-created/last-created.component.spec.ts @@ -0,0 +1,22 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing' + +import { LastCreatedComponent } from './last-created.component' + +describe('LastCreatedComponent', () => { + let component: LastCreatedComponent + let fixture: ComponentFixture + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [LastCreatedComponent], + }).compileComponents() + + fixture = TestBed.createComponent(LastCreatedComponent) + component = fixture.componentInstance + fixture.detectChanges() + }) + + it('should create', () => { + expect(component).toBeTruthy() + }) +}) diff --git a/apps/datahub/src/app/home/last-created/last-created.component.ts b/apps/datahub/src/app/home/last-created/last-created.component.ts new file mode 100644 index 00000000..b963383d --- /dev/null +++ b/apps/datahub/src/app/home/last-created/last-created.component.ts @@ -0,0 +1,33 @@ +import { Component, OnInit } from '@angular/core' +import { Store } from '@ngrx/store' +import { + FIELDS_BRIEF, + RouterFacade, + SearchFacade, + SearchState, +} from 'geonetwork-ui' +import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/record' + +@Component({ + selector: 'mel-datahub-last-created', + templateUrl: './last-created.component.html', + styleUrl: './last-created.component.css', +}) +export class LastCreatedComponent implements OnInit { + constructor( + protected searchFacade: SearchFacade, + private routerFacade: RouterFacade, + private store: Store + ) {} + + ngOnInit() { + this.searchFacade + .setConfigRequestFields([...FIELDS_BRIEF, 'createDate', 'changeDate']) + .setPageSize(10) + .setSortBy(['desc', 'createDate']) + } + + onMetadataSelection(metadata: CatalogRecord): void { + this.routerFacade.goToMetadata(metadata) + } +} From a7b854c0ef5668d98c50fea414cce2d2b0de3f42 Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Tue, 16 Jan 2024 15:20:32 +0100 Subject: [PATCH 03/15] feat(catalog): add favorites.component that lists favorites --- apps/datahub/src/app/app.module.ts | 2 ++ .../search/favorites/favorites.component.css | 0 .../search/favorites/favorites.component.html | 3 ++ .../favorites/favorites.component.spec.ts | 22 ++++++++++++ .../search/favorites/favorites.component.ts | 34 +++++++++++++++++++ .../search-header.component.html | 4 ++- 6 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 apps/datahub/src/app/search/favorites/favorites.component.css create mode 100644 apps/datahub/src/app/search/favorites/favorites.component.html create mode 100644 apps/datahub/src/app/search/favorites/favorites.component.spec.ts create mode 100644 apps/datahub/src/app/search/favorites/favorites.component.ts diff --git a/apps/datahub/src/app/app.module.ts b/apps/datahub/src/app/app.module.ts index 36ec7037..4dbdfaea 100644 --- a/apps/datahub/src/app/app.module.ts +++ b/apps/datahub/src/app/app.module.ts @@ -35,6 +35,7 @@ import { HomeHeaderComponent } from './home/home-header/home-header.component' import { MatIconModule } from '@angular/material/icon' import { MelEmbeddedTranslateLoader } from './common/embedded.translate.loader' import { LastCreatedComponent } from './home/last-created/last-created.component' +import { FavoritesComponent } from './search/favorites/favorites.component' @NgModule({ declarations: [ @@ -46,6 +47,7 @@ import { LastCreatedComponent } from './home/last-created/last-created.component HomePageComponent, HomeHeaderComponent, LastCreatedComponent, + FavoritesComponent, ], imports: [ BrowserModule, diff --git a/apps/datahub/src/app/search/favorites/favorites.component.css b/apps/datahub/src/app/search/favorites/favorites.component.css new file mode 100644 index 00000000..e69de29b diff --git a/apps/datahub/src/app/search/favorites/favorites.component.html b/apps/datahub/src/app/search/favorites/favorites.component.html new file mode 100644 index 00000000..d0748b72 --- /dev/null +++ b/apps/datahub/src/app/search/favorites/favorites.component.html @@ -0,0 +1,3 @@ +
+ {{ result.title }} +
diff --git a/apps/datahub/src/app/search/favorites/favorites.component.spec.ts b/apps/datahub/src/app/search/favorites/favorites.component.spec.ts new file mode 100644 index 00000000..1398a665 --- /dev/null +++ b/apps/datahub/src/app/search/favorites/favorites.component.spec.ts @@ -0,0 +1,22 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing' + +import { FavoritesComponent } from './favorites.component' + +describe('FavoritesComponent', () => { + let component: FavoritesComponent + let fixture: ComponentFixture + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [FavoritesComponent], + }).compileComponents() + + fixture = TestBed.createComponent(FavoritesComponent) + component = fixture.componentInstance + fixture.detectChanges() + }) + + it('should create', () => { + expect(component).toBeTruthy() + }) +}) diff --git a/apps/datahub/src/app/search/favorites/favorites.component.ts b/apps/datahub/src/app/search/favorites/favorites.component.ts new file mode 100644 index 00000000..e13e2f4c --- /dev/null +++ b/apps/datahub/src/app/search/favorites/favorites.component.ts @@ -0,0 +1,34 @@ +import { Component, OnInit } from '@angular/core' +import { Store } from '@ngrx/store' +import { + FIELDS_BRIEF, + RouterFacade, + SearchFacade, + SearchState, +} from 'geonetwork-ui' +import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/record' + +@Component({ + selector: 'mel-datahub-favorites', + templateUrl: './favorites.component.html', + styleUrl: './favorites.component.css', +}) +export class FavoritesComponent implements OnInit { + constructor( + protected searchFacade: SearchFacade, + private routerFacade: RouterFacade, + private store: Store + ) {} + + ngOnInit() { + this.searchFacade.setFavoritesOnly(true) + this.searchFacade + .setConfigRequestFields([...FIELDS_BRIEF, 'createDate', 'changeDate']) + .setPageSize(10) + .setSortBy(['desc', 'createDate']) + } + + onMetadataSelection(metadata: CatalogRecord): void { + this.routerFacade.goToMetadata(metadata) + } +} diff --git a/apps/datahub/src/app/search/search-header/search-header.component.html b/apps/datahub/src/app/search/search-header/search-header.component.html index 5a928300..c3eee4c5 100644 --- a/apps/datahub/src/app/search/search-header/search-header.component.html +++ b/apps/datahub/src/app/search/search-header/search-header.component.html @@ -1,6 +1,8 @@

mel.datahub.search.title

-
+
+ +
From fb6e1f175dce8487c7e2e4eeb5f9fcef311ff6c1 Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Tue, 16 Jan 2024 16:09:07 +0100 Subject: [PATCH 04/15] refactor(results-list): add results-list.component to list last created records and favorites --- apps/datahub/src/app/app.module.ts | 6 ++-- .../results-list/results-list.component.css} | 0 .../results-list/results-list.component.html} | 0 .../results-list.component.spec.ts | 23 +++++++++++++ .../results-list/results-list.component.ts} | 12 ++++--- .../home-header/home-header.component.html | 4 +-- .../last-created.component.spec.ts | 22 ------------ .../search/favorites/favorites.component.css | 0 .../search/favorites/favorites.component.html | 3 -- .../favorites/favorites.component.spec.ts | 22 ------------ .../search/favorites/favorites.component.ts | 34 ------------------- .../search-header.component.html | 4 ++- 12 files changed, 37 insertions(+), 93 deletions(-) rename apps/datahub/src/app/{home/last-created/last-created.component.css => common/results-list/results-list.component.css} (100%) rename apps/datahub/src/app/{home/last-created/last-created.component.html => common/results-list/results-list.component.html} (100%) create mode 100644 apps/datahub/src/app/common/results-list/results-list.component.spec.ts rename apps/datahub/src/app/{home/last-created/last-created.component.ts => common/results-list/results-list.component.ts} (65%) delete mode 100644 apps/datahub/src/app/home/last-created/last-created.component.spec.ts delete mode 100644 apps/datahub/src/app/search/favorites/favorites.component.css delete mode 100644 apps/datahub/src/app/search/favorites/favorites.component.html delete mode 100644 apps/datahub/src/app/search/favorites/favorites.component.spec.ts delete mode 100644 apps/datahub/src/app/search/favorites/favorites.component.ts diff --git a/apps/datahub/src/app/app.module.ts b/apps/datahub/src/app/app.module.ts index 4dbdfaea..ea05245b 100644 --- a/apps/datahub/src/app/app.module.ts +++ b/apps/datahub/src/app/app.module.ts @@ -34,8 +34,7 @@ import { AppRouterService } from './app.router.service' import { HomeHeaderComponent } from './home/home-header/home-header.component' import { MatIconModule } from '@angular/material/icon' import { MelEmbeddedTranslateLoader } from './common/embedded.translate.loader' -import { LastCreatedComponent } from './home/last-created/last-created.component' -import { FavoritesComponent } from './search/favorites/favorites.component' +import { ResultsListComponent } from './common/results-list/results-list.component' @NgModule({ declarations: [ @@ -46,8 +45,7 @@ import { FavoritesComponent } from './search/favorites/favorites.component' HeaderComponent, HomePageComponent, HomeHeaderComponent, - LastCreatedComponent, - FavoritesComponent, + ResultsListComponent, ], imports: [ BrowserModule, diff --git a/apps/datahub/src/app/home/last-created/last-created.component.css b/apps/datahub/src/app/common/results-list/results-list.component.css similarity index 100% rename from apps/datahub/src/app/home/last-created/last-created.component.css rename to apps/datahub/src/app/common/results-list/results-list.component.css diff --git a/apps/datahub/src/app/home/last-created/last-created.component.html b/apps/datahub/src/app/common/results-list/results-list.component.html similarity index 100% rename from apps/datahub/src/app/home/last-created/last-created.component.html rename to apps/datahub/src/app/common/results-list/results-list.component.html diff --git a/apps/datahub/src/app/common/results-list/results-list.component.spec.ts b/apps/datahub/src/app/common/results-list/results-list.component.spec.ts new file mode 100644 index 00000000..a8d4423d --- /dev/null +++ b/apps/datahub/src/app/common/results-list/results-list.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ResultsListComponent } from './results-list.component'; + +describe('ResultsListComponent', () => { + let component: ResultsListComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ResultsListComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ResultsListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/apps/datahub/src/app/home/last-created/last-created.component.ts b/apps/datahub/src/app/common/results-list/results-list.component.ts similarity index 65% rename from apps/datahub/src/app/home/last-created/last-created.component.ts rename to apps/datahub/src/app/common/results-list/results-list.component.ts index b963383d..b4d7cbd4 100644 --- a/apps/datahub/src/app/home/last-created/last-created.component.ts +++ b/apps/datahub/src/app/common/results-list/results-list.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core' +import { Component, Input, OnInit } from '@angular/core' import { Store } from '@ngrx/store' import { FIELDS_BRIEF, @@ -9,11 +9,12 @@ import { import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/record' @Component({ - selector: 'mel-datahub-last-created', - templateUrl: './last-created.component.html', - styleUrl: './last-created.component.css', + selector: 'mel-datahub-results-list', + templateUrl: './results-list.component.html', + styleUrl: './results-list.component.css', }) -export class LastCreatedComponent implements OnInit { +export class ResultsListComponent implements OnInit { + @Input() favoritesOnly = false constructor( protected searchFacade: SearchFacade, private routerFacade: RouterFacade, @@ -21,6 +22,7 @@ export class LastCreatedComponent implements OnInit { ) {} ngOnInit() { + if (this.favoritesOnly) this.searchFacade.setFavoritesOnly(true) this.searchFacade .setConfigRequestFields([...FIELDS_BRIEF, 'createDate', 'changeDate']) .setPageSize(10) diff --git a/apps/datahub/src/app/home/home-header/home-header.component.html b/apps/datahub/src/app/home/home-header/home-header.component.html index 680d5879..7b7b6bff 100644 --- a/apps/datahub/src/app/home/home-header/home-header.component.html +++ b/apps/datahub/src/app/home/home-header/home-header.component.html @@ -10,8 +10,8 @@

[autoFocus]="true" > -
- +
+
diff --git a/apps/datahub/src/app/home/last-created/last-created.component.spec.ts b/apps/datahub/src/app/home/last-created/last-created.component.spec.ts deleted file mode 100644 index 5a29b055..00000000 --- a/apps/datahub/src/app/home/last-created/last-created.component.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing' - -import { LastCreatedComponent } from './last-created.component' - -describe('LastCreatedComponent', () => { - let component: LastCreatedComponent - let fixture: ComponentFixture - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [LastCreatedComponent], - }).compileComponents() - - fixture = TestBed.createComponent(LastCreatedComponent) - component = fixture.componentInstance - fixture.detectChanges() - }) - - it('should create', () => { - expect(component).toBeTruthy() - }) -}) diff --git a/apps/datahub/src/app/search/favorites/favorites.component.css b/apps/datahub/src/app/search/favorites/favorites.component.css deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/datahub/src/app/search/favorites/favorites.component.html b/apps/datahub/src/app/search/favorites/favorites.component.html deleted file mode 100644 index d0748b72..00000000 --- a/apps/datahub/src/app/search/favorites/favorites.component.html +++ /dev/null @@ -1,3 +0,0 @@ -
- {{ result.title }} -
diff --git a/apps/datahub/src/app/search/favorites/favorites.component.spec.ts b/apps/datahub/src/app/search/favorites/favorites.component.spec.ts deleted file mode 100644 index 1398a665..00000000 --- a/apps/datahub/src/app/search/favorites/favorites.component.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing' - -import { FavoritesComponent } from './favorites.component' - -describe('FavoritesComponent', () => { - let component: FavoritesComponent - let fixture: ComponentFixture - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [FavoritesComponent], - }).compileComponents() - - fixture = TestBed.createComponent(FavoritesComponent) - component = fixture.componentInstance - fixture.detectChanges() - }) - - it('should create', () => { - expect(component).toBeTruthy() - }) -}) diff --git a/apps/datahub/src/app/search/favorites/favorites.component.ts b/apps/datahub/src/app/search/favorites/favorites.component.ts deleted file mode 100644 index e13e2f4c..00000000 --- a/apps/datahub/src/app/search/favorites/favorites.component.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Component, OnInit } from '@angular/core' -import { Store } from '@ngrx/store' -import { - FIELDS_BRIEF, - RouterFacade, - SearchFacade, - SearchState, -} from 'geonetwork-ui' -import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/record' - -@Component({ - selector: 'mel-datahub-favorites', - templateUrl: './favorites.component.html', - styleUrl: './favorites.component.css', -}) -export class FavoritesComponent implements OnInit { - constructor( - protected searchFacade: SearchFacade, - private routerFacade: RouterFacade, - private store: Store - ) {} - - ngOnInit() { - this.searchFacade.setFavoritesOnly(true) - this.searchFacade - .setConfigRequestFields([...FIELDS_BRIEF, 'createDate', 'changeDate']) - .setPageSize(10) - .setSortBy(['desc', 'createDate']) - } - - onMetadataSelection(metadata: CatalogRecord): void { - this.routerFacade.goToMetadata(metadata) - } -} diff --git a/apps/datahub/src/app/search/search-header/search-header.component.html b/apps/datahub/src/app/search/search-header/search-header.component.html index c3eee4c5..78856136 100644 --- a/apps/datahub/src/app/search/search-header/search-header.component.html +++ b/apps/datahub/src/app/search/search-header/search-header.component.html @@ -2,7 +2,9 @@

mel.datahub.search.title

- +
From 296f6f95d848e5571a67a00570df60f80dc3d74d Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Tue, 16 Jan 2024 16:09:34 +0100 Subject: [PATCH 05/15] chore(proxy-config): use local backend --- proxy-config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy-config.js b/proxy-config.js index ba215c6e..7b016202 100644 --- a/proxy-config.js +++ b/proxy-config.js @@ -1,6 +1,6 @@ module.exports = { '/geonetwork': { - target: 'https://mel.integration.apps.gs-fr-prod.camptocamp.com/', + target: 'http://localhost:8080/', secure: true, logLevel: 'debug', changeOrigin: true, @@ -36,4 +36,4 @@ module.exports = { 'sec-orgname': 'myOrg', }, }, -}; +} From dc37c877237357a2c420be6d03ef454cc1be459b Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Wed, 17 Jan 2024 15:40:33 +0100 Subject: [PATCH 06/15] feat(results-list): implement custom result-list and items --- apps/datahub/src/app/app.module.ts | 4 ++++ .../results-list-item.component.css | 0 .../results-list-item.component.html | 21 +++++++++++++++++ .../results-list-item.component.spec.ts | 23 +++++++++++++++++++ .../results-list-item.component.ts | 12 ++++++++++ .../results-list/results-list.component.html | 14 +++++++++-- .../results-list/results-list.component.ts | 8 +++---- .../search-results.component.html | 7 ++++-- 8 files changed, 80 insertions(+), 9 deletions(-) create mode 100644 apps/datahub/src/app/common/results-list-item/results-list-item.component.css create mode 100644 apps/datahub/src/app/common/results-list-item/results-list-item.component.html create mode 100644 apps/datahub/src/app/common/results-list-item/results-list-item.component.spec.ts create mode 100644 apps/datahub/src/app/common/results-list-item/results-list-item.component.ts diff --git a/apps/datahub/src/app/app.module.ts b/apps/datahub/src/app/app.module.ts index ea05245b..3891512d 100644 --- a/apps/datahub/src/app/app.module.ts +++ b/apps/datahub/src/app/app.module.ts @@ -12,6 +12,7 @@ import { RouterService, ThemeService, TRANSLATE_DEFAULT_CONFIG, + UiElementsModule, UiWidgetsModule, } from 'geonetwork-ui' import { @@ -35,6 +36,7 @@ import { HomeHeaderComponent } from './home/home-header/home-header.component' import { MatIconModule } from '@angular/material/icon' import { MelEmbeddedTranslateLoader } from './common/embedded.translate.loader' import { ResultsListComponent } from './common/results-list/results-list.component' +import { ResultsListItemComponent } from './common/results-list-item/results-list-item.component' @NgModule({ declarations: [ @@ -46,11 +48,13 @@ import { ResultsListComponent } from './common/results-list/results-list.compone HomePageComponent, HomeHeaderComponent, ResultsListComponent, + ResultsListItemComponent, ], imports: [ BrowserModule, BrowserAnimationsModule, UiWidgetsModule, + UiElementsModule, FeatureSearchModule, FeatureCatalogModule, MatIconModule, diff --git a/apps/datahub/src/app/common/results-list-item/results-list-item.component.css b/apps/datahub/src/app/common/results-list-item/results-list-item.component.css new file mode 100644 index 00000000..e69de29b diff --git a/apps/datahub/src/app/common/results-list-item/results-list-item.component.html b/apps/datahub/src/app/common/results-list-item/results-list-item.component.html new file mode 100644 index 00000000..d6aa55f3 --- /dev/null +++ b/apps/datahub/src/app/common/results-list-item/results-list-item.component.html @@ -0,0 +1,21 @@ + diff --git a/apps/datahub/src/app/common/results-list-item/results-list-item.component.spec.ts b/apps/datahub/src/app/common/results-list-item/results-list-item.component.spec.ts new file mode 100644 index 00000000..8b369cd2 --- /dev/null +++ b/apps/datahub/src/app/common/results-list-item/results-list-item.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ResultsListItemComponent } from './results-list-item.component'; + +describe('ResultsListItemComponent', () => { + let component: ResultsListItemComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ResultsListItemComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ResultsListItemComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/apps/datahub/src/app/common/results-list-item/results-list-item.component.ts b/apps/datahub/src/app/common/results-list-item/results-list-item.component.ts new file mode 100644 index 00000000..7b3f354a --- /dev/null +++ b/apps/datahub/src/app/common/results-list-item/results-list-item.component.ts @@ -0,0 +1,12 @@ +import { Component, EventEmitter, Input, Output } from '@angular/core' +import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/record' + +@Component({ + selector: 'mel-datahub-results-list-item', + templateUrl: './results-list-item.component.html', + styleUrl: './results-list-item.component.css', +}) +export class ResultsListItemComponent { + @Input() record: CatalogRecord + @Output() mdSelect = new EventEmitter() +} diff --git a/apps/datahub/src/app/common/results-list/results-list.component.html b/apps/datahub/src/app/common/results-list/results-list.component.html index d0748b72..7e050636 100644 --- a/apps/datahub/src/app/common/results-list/results-list.component.html +++ b/apps/datahub/src/app/common/results-list/results-list.component.html @@ -1,3 +1,13 @@ -
- {{ result.title }} +
+
+
+ +
+
diff --git a/apps/datahub/src/app/common/results-list/results-list.component.ts b/apps/datahub/src/app/common/results-list/results-list.component.ts index b4d7cbd4..3dc69237 100644 --- a/apps/datahub/src/app/common/results-list/results-list.component.ts +++ b/apps/datahub/src/app/common/results-list/results-list.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnInit } from '@angular/core' +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' import { Store } from '@ngrx/store' import { FIELDS_BRIEF, @@ -15,6 +15,8 @@ import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/record' }) export class ResultsListComponent implements OnInit { @Input() favoritesOnly = false + @Output() mdSelect = new EventEmitter() + constructor( protected searchFacade: SearchFacade, private routerFacade: RouterFacade, @@ -28,8 +30,4 @@ export class ResultsListComponent implements OnInit { .setPageSize(10) .setSortBy(['desc', 'createDate']) } - - onMetadataSelection(metadata: CatalogRecord): void { - this.routerFacade.goToMetadata(metadata) - } } diff --git a/apps/datahub/src/app/search/search-results/search-results.component.html b/apps/datahub/src/app/search/search-results/search-results.component.html index f586a80d..da21f763 100644 --- a/apps/datahub/src/app/search/search-results/search-results.component.html +++ b/apps/datahub/src/app/search/search-results/search-results.component.html @@ -3,10 +3,13 @@
- +
From a74934cd4120ed0080d70f633555ec4b02a32338 Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Wed, 17 Jan 2024 16:14:51 +0100 Subject: [PATCH 07/15] feat(results-list): add different components for carousel and grid --- apps/datahub/src/app/app.module.ts | 4 ++++ .../results-list-carousel.component.css} | 0 .../results-list-carousel.component.html} | 0 .../results-list-carousel.component.spec.ts | 23 +++++++++++++++++++ .../results-list-carousel.component.ts | 9 ++++++++ .../results-list-grid.component.css | 0 .../results-list-grid.component.html | 13 +++++++++++ .../results-list-grid.component.spec.ts | 23 +++++++++++++++++++ .../results-list-grid.component.ts | 9 ++++++++ .../results-list/results-list.component.ts | 6 ++--- .../home-header/home-header.component.html | 6 +++-- .../search-header.component.html | 7 +++--- .../search-results.component.html | 5 ++-- 13 files changed, 95 insertions(+), 10 deletions(-) rename apps/datahub/src/app/common/results-list/{results-list.component.css => results-list-carousel/results-list-carousel.component.css} (100%) rename apps/datahub/src/app/common/results-list/{results-list.component.html => results-list-carousel/results-list-carousel.component.html} (100%) create mode 100644 apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.spec.ts create mode 100644 apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.ts create mode 100644 apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.css create mode 100644 apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.html create mode 100644 apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.spec.ts create mode 100644 apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.ts diff --git a/apps/datahub/src/app/app.module.ts b/apps/datahub/src/app/app.module.ts index 3891512d..2dbba359 100644 --- a/apps/datahub/src/app/app.module.ts +++ b/apps/datahub/src/app/app.module.ts @@ -37,6 +37,8 @@ import { MatIconModule } from '@angular/material/icon' import { MelEmbeddedTranslateLoader } from './common/embedded.translate.loader' import { ResultsListComponent } from './common/results-list/results-list.component' import { ResultsListItemComponent } from './common/results-list-item/results-list-item.component' +import { ResultsListCarouselComponent } from './common/results-list/results-list-carousel/results-list-carousel.component' +import { ResultsListGridComponent } from './common/results-list/results-list-grid/results-list-grid.component' @NgModule({ declarations: [ @@ -49,6 +51,8 @@ import { ResultsListItemComponent } from './common/results-list-item/results-lis HomeHeaderComponent, ResultsListComponent, ResultsListItemComponent, + ResultsListCarouselComponent, + ResultsListGridComponent, ], imports: [ BrowserModule, diff --git a/apps/datahub/src/app/common/results-list/results-list.component.css b/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.css similarity index 100% rename from apps/datahub/src/app/common/results-list/results-list.component.css rename to apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.css diff --git a/apps/datahub/src/app/common/results-list/results-list.component.html b/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.html similarity index 100% rename from apps/datahub/src/app/common/results-list/results-list.component.html rename to apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.html diff --git a/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.spec.ts b/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.spec.ts new file mode 100644 index 00000000..651eb045 --- /dev/null +++ b/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ResultsListCarouselComponent } from './results-list-carousel.component'; + +describe('ResultsListCarouselComponent', () => { + let component: ResultsListCarouselComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ResultsListCarouselComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ResultsListCarouselComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.ts b/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.ts new file mode 100644 index 00000000..f6f05f05 --- /dev/null +++ b/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.ts @@ -0,0 +1,9 @@ +import { Component } from '@angular/core' +import { ResultsListComponent } from '../results-list.component' + +@Component({ + selector: 'mel-datahub-results-list-carousel', + templateUrl: './results-list-carousel.component.html', + styleUrl: './results-list-carousel.component.css', +}) +export class ResultsListCarouselComponent extends ResultsListComponent {} diff --git a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.css b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.css new file mode 100644 index 00000000..e69de29b diff --git a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.html b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.html new file mode 100644 index 00000000..7e050636 --- /dev/null +++ b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.html @@ -0,0 +1,13 @@ +
+
+
+ +
+
+
diff --git a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.spec.ts b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.spec.ts new file mode 100644 index 00000000..60a9938d --- /dev/null +++ b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ResultsListGridComponent } from './results-list-grid.component'; + +describe('ResultsListGridComponent', () => { + let component: ResultsListGridComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ResultsListGridComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ResultsListGridComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.ts b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.ts new file mode 100644 index 00000000..3f5a25fb --- /dev/null +++ b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.ts @@ -0,0 +1,9 @@ +import { Component } from '@angular/core' +import { ResultsListComponent } from '../results-list.component' + +@Component({ + selector: 'mel-datahub-results-list-grid', + templateUrl: './results-list-grid.component.html', + styleUrl: './results-list-grid.component.css', +}) +export class ResultsListGridComponent extends ResultsListComponent {} diff --git a/apps/datahub/src/app/common/results-list/results-list.component.ts b/apps/datahub/src/app/common/results-list/results-list.component.ts index 3dc69237..bbe3e2e1 100644 --- a/apps/datahub/src/app/common/results-list/results-list.component.ts +++ b/apps/datahub/src/app/common/results-list/results-list.component.ts @@ -10,11 +10,11 @@ import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/record' @Component({ selector: 'mel-datahub-results-list', - templateUrl: './results-list.component.html', - styleUrl: './results-list.component.css', + template: '', }) export class ResultsListComponent implements OnInit { @Input() favoritesOnly = false + @Input() numberOfResults = 10 @Output() mdSelect = new EventEmitter() constructor( @@ -27,7 +27,7 @@ export class ResultsListComponent implements OnInit { if (this.favoritesOnly) this.searchFacade.setFavoritesOnly(true) this.searchFacade .setConfigRequestFields([...FIELDS_BRIEF, 'createDate', 'changeDate']) - .setPageSize(10) + .setPageSize(this.numberOfResults) .setSortBy(['desc', 'createDate']) } } diff --git a/apps/datahub/src/app/home/home-header/home-header.component.html b/apps/datahub/src/app/home/home-header/home-header.component.html index 7b7b6bff..354bf753 100644 --- a/apps/datahub/src/app/home/home-header/home-header.component.html +++ b/apps/datahub/src/app/home/home-header/home-header.component.html @@ -10,8 +10,10 @@

[autoFocus]="true" > -
- +
+
diff --git a/apps/datahub/src/app/search/search-header/search-header.component.html b/apps/datahub/src/app/search/search-header/search-header.component.html index 78856136..278d381f 100644 --- a/apps/datahub/src/app/search/search-header/search-header.component.html +++ b/apps/datahub/src/app/search/search-header/search-header.component.html @@ -1,10 +1,11 @@

mel.datahub.search.title

-
- + + >
diff --git a/apps/datahub/src/app/search/search-results/search-results.component.html b/apps/datahub/src/app/search/search-results/search-results.component.html index da21f763..8f03eabd 100644 --- a/apps/datahub/src/app/search/search-results/search-results.component.html +++ b/apps/datahub/src/app/search/search-results/search-results.component.html @@ -3,9 +3,10 @@
- + >
diff --git a/apps/datahub/src/app/search/search-results/search-results.component.ts b/apps/datahub/src/app/search/search-results/search-results.component.ts index 84d3494b..5eeea439 100644 --- a/apps/datahub/src/app/search/search-results/search-results.component.ts +++ b/apps/datahub/src/app/search/search-results/search-results.component.ts @@ -18,8 +18,4 @@ export class SearchResultsComponent implements OnInit { ngOnInit() { this.searchFacade.setResultsLayout('CARD') } - - onMetadataSelection(metadata: CatalogRecord): void { - this.searchRouter.goToMetadata(metadata) - } } From 17d80ddfff6937465398c6f79d8c4ae7a1f3cfe6 Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Wed, 17 Jan 2024 17:50:16 +0100 Subject: [PATCH 09/15] fix(results-list): fix imports/rebase --- .../common/results-list-item/results-list-item.component.ts | 2 +- .../src/app/common/results-list/results-list.component.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/datahub/src/app/common/results-list-item/results-list-item.component.ts b/apps/datahub/src/app/common/results-list-item/results-list-item.component.ts index 8235f5a4..2722b995 100644 --- a/apps/datahub/src/app/common/results-list-item/results-list-item.component.ts +++ b/apps/datahub/src/app/common/results-list-item/results-list-item.component.ts @@ -1,5 +1,5 @@ import { Component, EventEmitter, Input, Output } from '@angular/core' -import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/record' +import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/model/record' @Component({ selector: 'mel-datahub-results-list-item', diff --git a/apps/datahub/src/app/common/results-list/results-list.component.ts b/apps/datahub/src/app/common/results-list/results-list.component.ts index 20a771fe..41e036b7 100644 --- a/apps/datahub/src/app/common/results-list/results-list.component.ts +++ b/apps/datahub/src/app/common/results-list/results-list.component.ts @@ -1,4 +1,4 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' +import { Component, Input, OnInit } from '@angular/core' import { Store } from '@ngrx/store' import { FIELDS_BRIEF, @@ -6,7 +6,7 @@ import { SearchFacade, SearchState, } from 'geonetwork-ui' -import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/record' +import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/model/record' @Component({ selector: 'mel-datahub-results-list', From 2e5e630ac0f34e108f3c67f54503a7a7beae813f Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Wed, 17 Jan 2024 17:51:15 +0100 Subject: [PATCH 10/15] chore(format): npm run format --- .../results-card-favorite.component.spec.ts | 29 +++++++++---------- ...esults-card-last-created.component.spec.ts | 29 +++++++++---------- .../results-card-search.component.spec.ts | 29 +++++++++---------- .../results-list-item.component.spec.ts | 29 +++++++++---------- .../results-list-carousel.component.spec.ts | 29 +++++++++---------- .../results-list-grid.component.spec.ts | 29 +++++++++---------- .../results-list.component.spec.ts | 29 +++++++++---------- 7 files changed, 98 insertions(+), 105 deletions(-) diff --git a/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.spec.ts b/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.spec.ts index a5561e87..9f954290 100644 --- a/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.spec.ts +++ b/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.spec.ts @@ -1,23 +1,22 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing' -import { ResultsCardFavoriteComponent } from './results-card-favorite.component'; +import { ResultsCardFavoriteComponent } from './results-card-favorite.component' describe('ResultsCardFavoriteComponent', () => { - let component: ResultsCardFavoriteComponent; - let fixture: ComponentFixture; + let component: ResultsCardFavoriteComponent + let fixture: ComponentFixture beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ResultsCardFavoriteComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(ResultsCardFavoriteComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + imports: [ResultsCardFavoriteComponent], + }).compileComponents() + + fixture = TestBed.createComponent(ResultsCardFavoriteComponent) + component = fixture.componentInstance + fixture.detectChanges() + }) it('should create', () => { - expect(component).toBeTruthy(); - }); -}); + expect(component).toBeTruthy() + }) +}) diff --git a/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.spec.ts b/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.spec.ts index e64cfcd8..f371062f 100644 --- a/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.spec.ts +++ b/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.spec.ts @@ -1,23 +1,22 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing' -import { ResultsCardLastCreatedComponent } from './results-card-last-created.component'; +import { ResultsCardLastCreatedComponent } from './results-card-last-created.component' describe('ResultsCardLastCreatedComponent', () => { - let component: ResultsCardLastCreatedComponent; - let fixture: ComponentFixture; + let component: ResultsCardLastCreatedComponent + let fixture: ComponentFixture beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ResultsCardLastCreatedComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(ResultsCardLastCreatedComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + imports: [ResultsCardLastCreatedComponent], + }).compileComponents() + + fixture = TestBed.createComponent(ResultsCardLastCreatedComponent) + component = fixture.componentInstance + fixture.detectChanges() + }) it('should create', () => { - expect(component).toBeTruthy(); - }); -}); + expect(component).toBeTruthy() + }) +}) diff --git a/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.spec.ts b/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.spec.ts index 1721fbf7..a8a57f7a 100644 --- a/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.spec.ts +++ b/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.spec.ts @@ -1,23 +1,22 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing' -import { ResultsCardSearchComponent } from './results-card-search.component'; +import { ResultsCardSearchComponent } from './results-card-search.component' describe('ResultsCardSearchComponent', () => { - let component: ResultsCardSearchComponent; - let fixture: ComponentFixture; + let component: ResultsCardSearchComponent + let fixture: ComponentFixture beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ResultsCardSearchComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(ResultsCardSearchComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + imports: [ResultsCardSearchComponent], + }).compileComponents() + + fixture = TestBed.createComponent(ResultsCardSearchComponent) + component = fixture.componentInstance + fixture.detectChanges() + }) it('should create', () => { - expect(component).toBeTruthy(); - }); -}); + expect(component).toBeTruthy() + }) +}) diff --git a/apps/datahub/src/app/common/results-list-item/results-list-item.component.spec.ts b/apps/datahub/src/app/common/results-list-item/results-list-item.component.spec.ts index 8b369cd2..c931e510 100644 --- a/apps/datahub/src/app/common/results-list-item/results-list-item.component.spec.ts +++ b/apps/datahub/src/app/common/results-list-item/results-list-item.component.spec.ts @@ -1,23 +1,22 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing' -import { ResultsListItemComponent } from './results-list-item.component'; +import { ResultsListItemComponent } from './results-list-item.component' describe('ResultsListItemComponent', () => { - let component: ResultsListItemComponent; - let fixture: ComponentFixture; + let component: ResultsListItemComponent + let fixture: ComponentFixture beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ResultsListItemComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(ResultsListItemComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + imports: [ResultsListItemComponent], + }).compileComponents() + + fixture = TestBed.createComponent(ResultsListItemComponent) + component = fixture.componentInstance + fixture.detectChanges() + }) it('should create', () => { - expect(component).toBeTruthy(); - }); -}); + expect(component).toBeTruthy() + }) +}) diff --git a/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.spec.ts b/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.spec.ts index 651eb045..df762997 100644 --- a/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.spec.ts +++ b/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.spec.ts @@ -1,23 +1,22 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing' -import { ResultsListCarouselComponent } from './results-list-carousel.component'; +import { ResultsListCarouselComponent } from './results-list-carousel.component' describe('ResultsListCarouselComponent', () => { - let component: ResultsListCarouselComponent; - let fixture: ComponentFixture; + let component: ResultsListCarouselComponent + let fixture: ComponentFixture beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ResultsListCarouselComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(ResultsListCarouselComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + imports: [ResultsListCarouselComponent], + }).compileComponents() + + fixture = TestBed.createComponent(ResultsListCarouselComponent) + component = fixture.componentInstance + fixture.detectChanges() + }) it('should create', () => { - expect(component).toBeTruthy(); - }); -}); + expect(component).toBeTruthy() + }) +}) diff --git a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.spec.ts b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.spec.ts index 60a9938d..05165cb2 100644 --- a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.spec.ts +++ b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.spec.ts @@ -1,23 +1,22 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing' -import { ResultsListGridComponent } from './results-list-grid.component'; +import { ResultsListGridComponent } from './results-list-grid.component' describe('ResultsListGridComponent', () => { - let component: ResultsListGridComponent; - let fixture: ComponentFixture; + let component: ResultsListGridComponent + let fixture: ComponentFixture beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ResultsListGridComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(ResultsListGridComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + imports: [ResultsListGridComponent], + }).compileComponents() + + fixture = TestBed.createComponent(ResultsListGridComponent) + component = fixture.componentInstance + fixture.detectChanges() + }) it('should create', () => { - expect(component).toBeTruthy(); - }); -}); + expect(component).toBeTruthy() + }) +}) diff --git a/apps/datahub/src/app/common/results-list/results-list.component.spec.ts b/apps/datahub/src/app/common/results-list/results-list.component.spec.ts index a8d4423d..91157465 100644 --- a/apps/datahub/src/app/common/results-list/results-list.component.spec.ts +++ b/apps/datahub/src/app/common/results-list/results-list.component.spec.ts @@ -1,23 +1,22 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing' -import { ResultsListComponent } from './results-list.component'; +import { ResultsListComponent } from './results-list.component' describe('ResultsListComponent', () => { - let component: ResultsListComponent; - let fixture: ComponentFixture; + let component: ResultsListComponent + let fixture: ComponentFixture beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ResultsListComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(ResultsListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + imports: [ResultsListComponent], + }).compileComponents() + + fixture = TestBed.createComponent(ResultsListComponent) + component = fixture.componentInstance + fixture.detectChanges() + }) it('should create', () => { - expect(component).toBeTruthy(); - }); -}); + expect(component).toBeTruthy() + }) +}) From 40465a9056bc1fa504e995ed0bf32c73c39bb90d Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Thu, 18 Jan 2024 16:08:07 +0100 Subject: [PATCH 11/15] chore(cleanup): remove unused files and code --- .../results-card-favorite.component.css | 0 .../results-card-favorite.component.spec.ts | 22 ------------------- .../results-card-favorite.component.ts | 5 +++-- .../results-card-last-created.component.css | 0 ...esults-card-last-created.component.spec.ts | 22 ------------------- .../results-card-last-created.component.ts | 5 +++-- .../results-card-search.component.css | 0 .../results-card-search.component.spec.ts | 22 ------------------- .../results-card-search.component.ts | 5 +++-- .../results-list-item.component.html | 21 ------------------ .../results-list-item.component.spec.ts | 22 ------------------- .../results-list-carousel.component.css | 0 .../results-list-carousel.component.spec.ts | 22 ------------------- .../results-list-carousel.component.ts | 5 +++-- .../results-list-grid.component.css | 0 .../results-list-grid.component.spec.ts | 22 ------------------- .../results-list-grid.component.ts | 5 +++-- .../results-list.component.spec.ts | 22 ------------------- .../results-list/results-list.component.ts | 1 + .../search-page/search-page.component.ts | 3 +-- .../search-results.component.ts | 16 ++------------ 21 files changed, 19 insertions(+), 201 deletions(-) delete mode 100644 apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.css delete mode 100644 apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.spec.ts delete mode 100644 apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.css delete mode 100644 apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.spec.ts delete mode 100644 apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.css delete mode 100644 apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.spec.ts delete mode 100644 apps/datahub/src/app/common/results-list-item/results-list-item.component.html delete mode 100644 apps/datahub/src/app/common/results-list-item/results-list-item.component.spec.ts delete mode 100644 apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.css delete mode 100644 apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.spec.ts delete mode 100644 apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.css delete mode 100644 apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.spec.ts delete mode 100644 apps/datahub/src/app/common/results-list/results-list.component.spec.ts diff --git a/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.css b/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.css deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.spec.ts b/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.spec.ts deleted file mode 100644 index 9f954290..00000000 --- a/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing' - -import { ResultsCardFavoriteComponent } from './results-card-favorite.component' - -describe('ResultsCardFavoriteComponent', () => { - let component: ResultsCardFavoriteComponent - let fixture: ComponentFixture - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ResultsCardFavoriteComponent], - }).compileComponents() - - fixture = TestBed.createComponent(ResultsCardFavoriteComponent) - component = fixture.componentInstance - fixture.detectChanges() - }) - - it('should create', () => { - expect(component).toBeTruthy() - }) -}) diff --git a/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.ts b/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.ts index a6f50cad..a63bf346 100644 --- a/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.ts +++ b/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core' +import { ChangeDetectionStrategy, Component } from '@angular/core' import { ResultsListItemComponent } from '../results-list-item.component' @Component({ selector: 'mel-datahub-results-card-favorite', templateUrl: './results-card-favorite.component.html', - styleUrl: './results-card-favorite.component.css', + styles: ``, + changeDetection: ChangeDetectionStrategy.OnPush, }) export class ResultsCardFavoriteComponent extends ResultsListItemComponent {} diff --git a/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.css b/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.css deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.spec.ts b/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.spec.ts deleted file mode 100644 index f371062f..00000000 --- a/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing' - -import { ResultsCardLastCreatedComponent } from './results-card-last-created.component' - -describe('ResultsCardLastCreatedComponent', () => { - let component: ResultsCardLastCreatedComponent - let fixture: ComponentFixture - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ResultsCardLastCreatedComponent], - }).compileComponents() - - fixture = TestBed.createComponent(ResultsCardLastCreatedComponent) - component = fixture.componentInstance - fixture.detectChanges() - }) - - it('should create', () => { - expect(component).toBeTruthy() - }) -}) diff --git a/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.ts b/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.ts index 585f06af..e3833877 100644 --- a/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.ts +++ b/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core' +import { ChangeDetectionStrategy, Component } from '@angular/core' import { ResultsListItemComponent } from '../results-list-item.component' @Component({ selector: 'mel-datahub-results-card-last-created', templateUrl: './results-card-last-created.component.html', - styleUrl: './results-card-last-created.component.css', + styles: ``, + changeDetection: ChangeDetectionStrategy.OnPush, }) export class ResultsCardLastCreatedComponent extends ResultsListItemComponent {} diff --git a/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.css b/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.css deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.spec.ts b/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.spec.ts deleted file mode 100644 index a8a57f7a..00000000 --- a/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing' - -import { ResultsCardSearchComponent } from './results-card-search.component' - -describe('ResultsCardSearchComponent', () => { - let component: ResultsCardSearchComponent - let fixture: ComponentFixture - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ResultsCardSearchComponent], - }).compileComponents() - - fixture = TestBed.createComponent(ResultsCardSearchComponent) - component = fixture.componentInstance - fixture.detectChanges() - }) - - it('should create', () => { - expect(component).toBeTruthy() - }) -}) diff --git a/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.ts b/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.ts index 669139db..75503f05 100644 --- a/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.ts +++ b/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core' +import { ChangeDetectionStrategy, Component } from '@angular/core' import { ResultsListItemComponent } from '../results-list-item.component' @Component({ selector: 'mel-datahub-results-card-search', templateUrl: './results-card-search.component.html', - styleUrl: './results-card-search.component.css', + styles: ``, + changeDetection: ChangeDetectionStrategy.OnPush, }) export class ResultsCardSearchComponent extends ResultsListItemComponent {} diff --git a/apps/datahub/src/app/common/results-list-item/results-list-item.component.html b/apps/datahub/src/app/common/results-list-item/results-list-item.component.html deleted file mode 100644 index d6aa55f3..00000000 --- a/apps/datahub/src/app/common/results-list-item/results-list-item.component.html +++ /dev/null @@ -1,21 +0,0 @@ - diff --git a/apps/datahub/src/app/common/results-list-item/results-list-item.component.spec.ts b/apps/datahub/src/app/common/results-list-item/results-list-item.component.spec.ts deleted file mode 100644 index c931e510..00000000 --- a/apps/datahub/src/app/common/results-list-item/results-list-item.component.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing' - -import { ResultsListItemComponent } from './results-list-item.component' - -describe('ResultsListItemComponent', () => { - let component: ResultsListItemComponent - let fixture: ComponentFixture - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ResultsListItemComponent], - }).compileComponents() - - fixture = TestBed.createComponent(ResultsListItemComponent) - component = fixture.componentInstance - fixture.detectChanges() - }) - - it('should create', () => { - expect(component).toBeTruthy() - }) -}) diff --git a/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.css b/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.css deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.spec.ts b/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.spec.ts deleted file mode 100644 index df762997..00000000 --- a/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing' - -import { ResultsListCarouselComponent } from './results-list-carousel.component' - -describe('ResultsListCarouselComponent', () => { - let component: ResultsListCarouselComponent - let fixture: ComponentFixture - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ResultsListCarouselComponent], - }).compileComponents() - - fixture = TestBed.createComponent(ResultsListCarouselComponent) - component = fixture.componentInstance - fixture.detectChanges() - }) - - it('should create', () => { - expect(component).toBeTruthy() - }) -}) diff --git a/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.ts b/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.ts index f6f05f05..7f263b53 100644 --- a/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.ts +++ b/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core' +import { ChangeDetectionStrategy, Component } from '@angular/core' import { ResultsListComponent } from '../results-list.component' @Component({ selector: 'mel-datahub-results-list-carousel', templateUrl: './results-list-carousel.component.html', - styleUrl: './results-list-carousel.component.css', + styles: ``, + changeDetection: ChangeDetectionStrategy.OnPush, }) export class ResultsListCarouselComponent extends ResultsListComponent {} diff --git a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.css b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.css deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.spec.ts b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.spec.ts deleted file mode 100644 index 05165cb2..00000000 --- a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing' - -import { ResultsListGridComponent } from './results-list-grid.component' - -describe('ResultsListGridComponent', () => { - let component: ResultsListGridComponent - let fixture: ComponentFixture - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ResultsListGridComponent], - }).compileComponents() - - fixture = TestBed.createComponent(ResultsListGridComponent) - component = fixture.componentInstance - fixture.detectChanges() - }) - - it('should create', () => { - expect(component).toBeTruthy() - }) -}) diff --git a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.ts b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.ts index 3f5a25fb..3db97b6b 100644 --- a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.ts +++ b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core' +import { ChangeDetectionStrategy, Component } from '@angular/core' import { ResultsListComponent } from '../results-list.component' @Component({ selector: 'mel-datahub-results-list-grid', templateUrl: './results-list-grid.component.html', - styleUrl: './results-list-grid.component.css', + styles: ``, + changeDetection: ChangeDetectionStrategy.OnPush, }) export class ResultsListGridComponent extends ResultsListComponent {} diff --git a/apps/datahub/src/app/common/results-list/results-list.component.spec.ts b/apps/datahub/src/app/common/results-list/results-list.component.spec.ts deleted file mode 100644 index 91157465..00000000 --- a/apps/datahub/src/app/common/results-list/results-list.component.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing' - -import { ResultsListComponent } from './results-list.component' - -describe('ResultsListComponent', () => { - let component: ResultsListComponent - let fixture: ComponentFixture - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ResultsListComponent], - }).compileComponents() - - fixture = TestBed.createComponent(ResultsListComponent) - component = fixture.componentInstance - fixture.detectChanges() - }) - - it('should create', () => { - expect(component).toBeTruthy() - }) -}) diff --git a/apps/datahub/src/app/common/results-list/results-list.component.ts b/apps/datahub/src/app/common/results-list/results-list.component.ts index 41e036b7..6afa7c6c 100644 --- a/apps/datahub/src/app/common/results-list/results-list.component.ts +++ b/apps/datahub/src/app/common/results-list/results-list.component.ts @@ -2,6 +2,7 @@ import { Component, Input, OnInit } from '@angular/core' import { Store } from '@ngrx/store' import { FIELDS_BRIEF, + FavoritesService, RouterFacade, SearchFacade, SearchState, diff --git a/apps/datahub/src/app/search/search-page/search-page.component.ts b/apps/datahub/src/app/search/search-page/search-page.component.ts index aac21a51..1cf8e3a8 100644 --- a/apps/datahub/src/app/search/search-page/search-page.component.ts +++ b/apps/datahub/src/app/search/search-page/search-page.component.ts @@ -1,8 +1,7 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core' @Component({ selector: 'mel-datahub-search-page', - providers: [], templateUrl: './search-page.component.html', styles: ``, changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/apps/datahub/src/app/search/search-results/search-results.component.ts b/apps/datahub/src/app/search/search-results/search-results.component.ts index 5eeea439..acff04a2 100644 --- a/apps/datahub/src/app/search/search-results/search-results.component.ts +++ b/apps/datahub/src/app/search/search-results/search-results.component.ts @@ -1,6 +1,4 @@ -import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core' -import { RouterFacade, SearchFacade } from 'geonetwork-ui' -import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/model/record' +import { ChangeDetectionStrategy, Component } from '@angular/core' @Component({ selector: 'mel-datahub-search-results', @@ -8,14 +6,4 @@ import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/model/re styles: ``, changeDetection: ChangeDetectionStrategy.OnPush, }) -export class SearchResultsComponent implements OnInit { - isQualitySortable = true - - constructor( - private searchRouter: RouterFacade, - private searchFacade: SearchFacade - ) {} - ngOnInit() { - this.searchFacade.setResultsLayout('CARD') - } -} +export class SearchResultsComponent {} From 2d789dc68fef0f13a4e0bdb6d2b7f61ee45649cc Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Thu, 18 Jan 2024 16:09:21 +0100 Subject: [PATCH 12/15] chore(readme): add handy nx g c command --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index da03a6a1..11508899 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,20 @@ ✨ **This workspace has been generated by [Nx, a Smart, fast and extensible build system.](https://nx.dev)** ✨ - ## Start the app To start the development server run `nx serve datahub`. Open your browser and navigate to http://localhost:4200/. Happy coding! - ## Generate code If you happen to use Nx plugins, you can leverage code generators that might come with it. +To generate a component from the root dir for instance, run the following command: + +``` +npx nx g @nx/angular:component [my-component] --module=app.module --directory=apps/datahub/src/app/[my-component-location] +``` + Run `nx list` to get a list of available plugins and whether they have generators. Then run `nx list ` to see what generators are available. Learn more about [Nx generators on the docs](https://nx.dev/plugin-features/use-code-generators). From c1760e4111634f5887cab90fa053ff00c3c984be Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Thu, 18 Jan 2024 16:10:32 +0100 Subject: [PATCH 13/15] refactor(results-list): update ngFor, ngIf with control-flow syntax --- .../results-list-carousel.component.html | 27 +++++++++---------- .../results-list-grid.component.html | 15 +++++------ 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.html b/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.html index ed894bd1..10a551dc 100644 --- a/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.html +++ b/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.html @@ -1,19 +1,18 @@
-
- - -
+ [record]="record" + (mdSelect)="onMetadataSelection($event)" + > + } @else { + + } }
diff --git a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.html b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.html index a167a04e..9b4bb23f 100644 --- a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.html +++ b/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.html @@ -1,13 +1,12 @@
-
- -
+ [record]="record" + (mdSelect)="onMetadataSelection($event)" + > + }
From 26a8eb5f0515f50853c3b26f197074ccccf5ec39 Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Thu, 18 Jan 2024 16:36:31 +0100 Subject: [PATCH 14/15] fix(deps): fix npm install removing @ngx-translate/http-loader overriding gn-ui version for @ngx-translate/core --- package-lock.json | 331 +++++----------------------------------------- package.json | 6 +- 2 files changed, 39 insertions(+), 298 deletions(-) diff --git a/package-lock.json b/package-lock.json index 52600fda..08b8bfcd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,6 @@ "@ngrx/router-store": "~17.0.0", "@ngrx/store": "~17.0.0", "@ngx-translate/core": "^15.0.0", - "@ngx-translate/http-loader": "^8.0.0", "@nx/angular": "17.2.8", "geonetwork-ui": "^2.2.0-dev.f866474c", "rxjs": "~7.8.0", @@ -4717,20 +4716,6 @@ "rxjs": "^6.5.3 || ^7.5.0" } }, - "node_modules/@ngrx/component": { - "version": "17.0.1", - "resolved": "https://registry.npmjs.org/@ngrx/component/-/component-17.0.1.tgz", - "integrity": "sha512-B38NyH18gxTjrTJOu1fc+AMwOpAaRly6hgWx7zZZtbIwo0sd/bYTZGgMrJkw/CjmvjpAVBE14fB9qI+pSUsl4A==", - "peer": true, - "dependencies": { - "tslib": "^2.0.0" - }, - "peerDependencies": { - "@angular/common": "^17.0.0", - "@angular/core": "^17.0.0", - "rxjs": "^6.5.3 || ^7.5.0" - } - }, "node_modules/@ngrx/component-store": { "version": "17.0.1", "resolved": "https://registry.npmjs.org/@ngrx/component-store/-/component-store-17.0.1.tgz", @@ -4800,7 +4785,8 @@ "node_modules/@ngrx/schematics": { "version": "17.0.1", "resolved": "https://registry.npmjs.org/@ngrx/schematics/-/schematics-17.0.1.tgz", - "integrity": "sha512-yOQxy6PWKbxS2JhE54Li5qAJVruZGkUrsVCcx6pFKssKMGBG1R0EHBZ0BAmFtkiHvyHz3P/RUiaNf+UbWPPgIw==" + "integrity": "sha512-yOQxy6PWKbxS2JhE54Li5qAJVruZGkUrsVCcx6pFKssKMGBG1R0EHBZ0BAmFtkiHvyHz3P/RUiaNf+UbWPPgIw==", + "dev": true }, "node_modules/@ngrx/store": { "version": "17.0.1", @@ -4841,172 +4827,6 @@ "webpack": "^5.54.0" } }, - "node_modules/@nguniversal/express-engine": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/@nguniversal/express-engine/-/express-engine-16.2.0.tgz", - "integrity": "sha512-Pg77DfDvKtLzRUTahjv3WxWUldpNQTHIlyoU0wYrwoi/7qnHzoXdrvI1tqzC+DqPwxOmkGySoiRa2jJ+9IgvKw==", - "peer": true, - "dependencies": { - "@nguniversal/common": "16.2.0", - "tslib": "^2.3.0" - }, - "engines": { - "node": "^16.14.0 || >=18.10.0" - }, - "peerDependencies": { - "@angular/common": "^16.0.0 || ^16.1.0-next.0", - "@angular/core": "^16.0.0 || ^16.1.0-next.0", - "express": "^4.15.2" - } - }, - "node_modules/@nguniversal/express-engine/node_modules/@nguniversal/common": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/@nguniversal/common/-/common-16.2.0.tgz", - "integrity": "sha512-b3dQAwD2iI2kzF3O1mhwh6bhDg1SlT46K9lOSzNZNXy0bvV4WrSpVmfN7YKINZLFal5uwHn4j1LNdrDR4Qohlw==", - "peer": true, - "dependencies": { - "critters": "0.0.20", - "jsdom": "22.1.0", - "tslib": "^2.3.0" - }, - "engines": { - "node": "^16.14.0 || >=18.10.0" - }, - "peerDependencies": { - "@angular/common": "^16.0.0 || ^16.1.0-next.0", - "@angular/core": "^16.0.0 || ^16.1.0-next.0" - } - }, - "node_modules/@nguniversal/express-engine/node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "peer": true, - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/@nguniversal/express-engine/node_modules/cssstyle": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", - "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", - "peer": true, - "dependencies": { - "rrweb-cssom": "^0.6.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nguniversal/express-engine/node_modules/data-urls": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", - "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", - "peer": true, - "dependencies": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nguniversal/express-engine/node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "peer": true, - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/@nguniversal/express-engine/node_modules/jsdom": { - "version": "22.1.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", - "integrity": "sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==", - "peer": true, - "dependencies": { - "abab": "^2.0.6", - "cssstyle": "^3.0.0", - "data-urls": "^4.0.0", - "decimal.js": "^10.4.3", - "domexception": "^4.0.0", - "form-data": "^4.0.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.1", - "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.4", - "parse5": "^7.1.2", - "rrweb-cssom": "^0.6.0", - "saxes": "^6.0.0", - "symbol-tree": "^3.2.4", - "tough-cookie": "^4.1.2", - "w3c-xmlserializer": "^4.0.0", - "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^2.0.0", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.1", - "ws": "^8.13.0", - "xml-name-validator": "^4.0.0" - }, - "engines": { - "node": ">=16" - }, - "peerDependencies": { - "canvas": "^2.5.0" - }, - "peerDependenciesMeta": { - "canvas": { - "optional": true - } - } - }, - "node_modules/@nguniversal/express-engine/node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", - "peer": true, - "dependencies": { - "entities": "^4.4.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/@nguniversal/express-engine/node_modules/tr46": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", - "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", - "peer": true, - "dependencies": { - "punycode": "^2.3.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nguniversal/express-engine/node_modules/whatwg-url": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", - "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", - "peer": true, - "dependencies": { - "tr46": "^4.1.1", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=14" - } - }, "node_modules/@ngx-translate/core": { "version": "15.0.0", "resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-15.0.0.tgz", @@ -5021,17 +4841,17 @@ } }, "node_modules/@ngx-translate/http-loader": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@ngx-translate/http-loader/-/http-loader-8.0.0.tgz", - "integrity": "sha512-SFMsdUcmHF5OdZkL1CHEoSAwbP5EbAOPTLLboOCRRoOg21P4GJx+51jxGdJeGve6LSKLf4Pay7BkTwmE6vxYlg==", - "engines": { - "node": "^16.13.0 || >=18.10.0" + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@ngx-translate/http-loader/-/http-loader-7.0.0.tgz", + "integrity": "sha512-j+NpXXlcGVdyUNyY/qsJrqqeAdJdizCd+GKh3usXExSqy1aE9866jlAIL+xrfDU4w+LiMoma5pgE4emvFebZmA==", + "peer": true, + "dependencies": { + "tslib": "^2.3.0" }, "peerDependencies": { - "@angular/common": ">=16.0.0", - "@angular/core": ">=16.0.0", - "@ngx-translate/core": ">=15.0.0", - "rxjs": "^6.5.5 || ^7.4.0" + "@angular/common": ">=13.0.0", + "@ngx-translate/core": ">=14.0.0", + "rxjs": "^6.5.3 || ^7.4.0" } }, "node_modules/@nodelib/fs.scandir": { @@ -17105,6 +16925,15 @@ "node": ">=0.10.0" } }, + "node_modules/geonetwork-ui/node_modules/loader-utils": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.1.tgz", + "integrity": "sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==", + "peer": true, + "engines": { + "node": ">= 12.13.0" + } + }, "node_modules/geonetwork-ui/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -17150,45 +16979,6 @@ "semver": "bin/semver" } }, - "node_modules/geonetwork-ui/node_modules/mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", - "peer": true - }, - "node_modules/geonetwork-ui/node_modules/loader-utils": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.1.tgz", - "integrity": "sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==", - "peer": true, - "engines": { - "node": ">= 12.13.0" - } - }, - "node_modules/geonetwork-ui/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "peer": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/geonetwork-ui/node_modules/magic-string": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.1.tgz", - "integrity": "sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==", - "peer": true, - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/geonetwork-ui/node_modules/mini-css-extract-plugin": { "version": "2.7.6", "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.6.tgz", @@ -17313,46 +17103,6 @@ "node": ">=10" } }, - "node_modules/geonetwork-ui/node_modules/parse5": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==" - }, - "node_modules/geonetwork-ui/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "peer": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/geonetwork-ui/node_modules/pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/geonetwork-ui/node_modules/piscina": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/piscina/-/piscina-4.0.0.tgz", - "integrity": "sha512-641nAmJS4k4iqpNUqfggqUBUMmlw0ZoM5VZKdQkV2e970Inn3Tk9kroCc1wpsYLD07vCwpys5iY0d3xI/9WkTg==", - "peer": true, - "dependencies": { - "eventemitter-asyncresource": "^1.0.0", - "hdr-histogram-js": "^2.0.1", - "hdr-histogram-percentiles-obj": "^3.0.0" - }, - "optionalDependencies": { - "nice-napi": "^1.0.2" - } - }, "node_modules/geonetwork-ui/node_modules/ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", @@ -17376,6 +17126,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/geonetwork-ui/node_modules/parse5": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==" + }, "node_modules/geonetwork-ui/node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -17388,6 +17143,15 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/geonetwork-ui/node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "optional": true, + "engines": { + "node": ">=6" + } + }, "node_modules/geonetwork-ui/node_modules/piscina": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/piscina/-/piscina-4.0.0.tgz", @@ -24951,12 +24715,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/rrweb-cssom": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", - "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", - "peer": true - }, "node_modules/run-async": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", @@ -26196,18 +25954,6 @@ "node": ">=8" } }, - "node_modules/supports-hyperlinks": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz", - "integrity": "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==", - "dependencies": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -28807,15 +28553,6 @@ } } }, - "node_modules/xhr2": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.2.1.tgz", - "integrity": "sha512-sID0rrVCqkVNUn8t6xuv9+6FViXjUVXq8H5rWOH2rz9fDNQEd4g0EA2XlcEdJXRz5BMEn4O1pJFdT+z4YHhoWw==", - "peer": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/xlsx": { "version": "0.17.5", "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.17.5.tgz", diff --git a/package.json b/package.json index 9b243355..4a827784 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "@ngrx/router-store": "~17.0.0", "@ngrx/store": "~17.0.0", "@ngx-translate/core": "^15.0.0", - "@ngx-translate/http-loader": "^8.0.0", "@nx/angular": "17.2.8", "geonetwork-ui": "^2.2.0-dev.f866474c", "rxjs": "~7.8.0", @@ -79,5 +78,10 @@ "ts-jest": "^29.1.0", "ts-node": "10.9.1", "typescript": "~5.2.2" + }, + "overrides": { + "geonetwork-ui": { + "@ngx-translate/core": "^15.0.0" + } } } From bf8fc972a0a26f51d6b4cd62120fa4638b727dcb Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Thu, 18 Jan 2024 17:31:47 +0100 Subject: [PATCH 15/15] fix(lint): fix syntax --- apps/datahub/src/app/app.component.ts | 6 +++--- apps/datahub/src/app/common/embedded.translate.loader.ts | 2 +- .../src/app/common/results-list/results-list.component.ts | 1 - apps/datahub/src/index.html | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/datahub/src/app/app.component.ts b/apps/datahub/src/app/app.component.ts index 373f4bec..d433be62 100644 --- a/apps/datahub/src/app/app.component.ts +++ b/apps/datahub/src/app/app.component.ts @@ -1,10 +1,10 @@ -import { Component } from '@angular/core'; +import { Component } from '@angular/core' @Component({ - selector: 'mel-dataplatform-root', + selector: 'mel-datahub-root', templateUrl: './app.component.html', styleUrl: './app.component.css', }) export class AppComponent { - title = 'datahub'; + title = 'datahub' } diff --git a/apps/datahub/src/app/common/embedded.translate.loader.ts b/apps/datahub/src/app/common/embedded.translate.loader.ts index a32db9f8..d185a248 100644 --- a/apps/datahub/src/app/common/embedded.translate.loader.ts +++ b/apps/datahub/src/app/common/embedded.translate.loader.ts @@ -7,7 +7,7 @@ import fr from 'node_modules/geonetwork-ui/translations/fr.json' import { dropEmptyTranslations } from 'geonetwork-ui' export class MelEmbeddedTranslateLoader implements TranslateLoader { - getTranslation(lang: string): Observable { + getTranslation(lang: string): Observable> { const langs = { en: { ...en, ...en_MEL }, fr: { ...fr, ...fr_MEL } } const translations = langs[lang.substring(0, 2)] return of(translations).pipe(map(dropEmptyTranslations)) diff --git a/apps/datahub/src/app/common/results-list/results-list.component.ts b/apps/datahub/src/app/common/results-list/results-list.component.ts index 6afa7c6c..41e036b7 100644 --- a/apps/datahub/src/app/common/results-list/results-list.component.ts +++ b/apps/datahub/src/app/common/results-list/results-list.component.ts @@ -2,7 +2,6 @@ import { Component, Input, OnInit } from '@angular/core' import { Store } from '@ngrx/store' import { FIELDS_BRIEF, - FavoritesService, RouterFacade, SearchFacade, SearchState, diff --git a/apps/datahub/src/index.html b/apps/datahub/src/index.html index 943b78ff..9127bc6b 100644 --- a/apps/datahub/src/index.html +++ b/apps/datahub/src/index.html @@ -17,6 +17,6 @@ /> - +