Compare commits

...

15 Commits

Author SHA1 Message Date
Tim Donohue
1fa00ac3ef Merge pull request #4772 from DSpace/backport-4638-to-main
[Port main] Client side rendering (CSR) ignores `nameSpace` configuration causing broken resource loading
2025-10-13 15:52:09 -05:00
Tim Donohue
f63131e286 In DSpace 8+ "environment.universal" is renamed "environment.ssr" 2025-10-13 15:03:16 -05:00
milanmajchrak
938dd8966e Added rendering namespace when client side
(cherry picked from commit 75c9112023)
2025-10-13 20:01:14 +00:00
Tim Donohue
80a252aef3 Merge pull request #4723 from LaisRast/main
Adding all missing Arabic translations
2025-10-13 11:18:14 -05:00
kshepherd
4c0c537175 Merge pull request #4725 from the-library-code/TLC-1202_submission_validation_matchers-main
Fix type-bind submission form validation handling
2025-10-09 13:15:09 +02:00
Tim Donohue
36fea8222c Merge pull request #4762 from alanorth/undeclared-deps
Add undeclared dependencies to package.json
2025-10-06 16:35:17 -05:00
Alan Orth
54d44e62c1 Add undeclared dependency md5
This is used directly in webpack/helpers.ts. It is a transitive de-
pendency of orejime but we are using it directly in our code so we
should declare it.
2025-10-02 07:31:17 +03:00
Alan Orth
e359da52a4 Add undeclared xhr2 dependency
This used directly in src/app/core/services/server-xhr.service.ts.
We have been relying on this being available by virtue of it being
a transitive dependency of some other package.
2025-10-02 07:31:17 +03:00
Alan Orth
803381c756 Add undeclared body-parser dependency
We explicitly use this in server.ts. It has always been available
because it is a dependency of express, and therefore a transitive
dependency of ours. Because we are using it directly in *our* code
we should declare the dependency.

I am using version ^1.20.3 because that is the one used by the
version of Express we are using.
2025-10-02 07:31:17 +03:00
Alan Orth
62f4cbd5cd Add glob dependency and update syntax
This undeclared dependency is used by lint/src/util/theme-support.ts.
2025-10-02 07:31:16 +03:00
Alan Orth
e72b93ba76 Add commander dependency
We use this explicitly in the following scripts:

- scripts/merge-i18n-files.ts
- scripts/sync-i18n-files.ts

Previously it was assumed that `commander` was available in the en-
vironment, which seems to have been provided by cypress.
2025-10-02 07:31:13 +03:00
Kim Shepherd
f16dda8255 [TLC-1202] Move getTypeBindRelations to util function 2025-09-18 16:39:32 +02:00
Kim Shepherd
9244c24d11 [TLC-1202] Centralise getTypeBindRelations to single static method 2025-09-18 16:14:24 +02:00
Kim Shepherd
c47d988bca [TLC-1202] Disable fields hidden by type bind, so they are not validated 2025-09-18 15:30:33 +02:00
Laith Rastanawi
68284cd837 Adding all missing Arabic translations 2025-09-15 18:45:42 +02:00
9 changed files with 1263 additions and 1916 deletions

View File

@@ -150,10 +150,10 @@ class ThemeableComponentRegistry {
traverse(source); traverse(source);
} }
const glob = require('glob'); const { globSync } = require('glob');
// note: this outputs Unix-style paths on Windows // note: this outputs Unix-style paths on Windows
const wrappers: string[] = glob.GlobSync(prefix + 'src/app/**/themed-*.component.ts', { ignore: 'node_modules/**' }).found; const wrappers: string[] = globSync(prefix + 'src/app/**/themed-*.component.ts', { ignore: 'node_modules/**' });
for (const wrapper of wrappers) { for (const wrapper of wrappers) {
registerWrapper(wrapper); registerWrapper(wrapper);

300
package-lock.json generated
View File

@@ -33,6 +33,7 @@
"@terraformer/wkt": "^2.2.1", "@terraformer/wkt": "^2.2.1",
"altcha": "^0.9.0", "altcha": "^0.9.0",
"angulartics2": "^12.2.0", "angulartics2": "^12.2.0",
"body-parser": "^1.20.3",
"bootstrap": "^5.3", "bootstrap": "^5.3",
"cerialize": "0.1.18", "cerialize": "0.1.18",
"cli-progress": "^3.12.0", "cli-progress": "^3.12.0",
@@ -79,6 +80,7 @@
"reflect-metadata": "^0.2.2", "reflect-metadata": "^0.2.2",
"rxjs": "^7.8.0", "rxjs": "^7.8.0",
"uuid": "^8.3.2", "uuid": "^8.3.2",
"xhr2": "^0.2.1",
"zone.js": "~0.14.10" "zone.js": "~0.14.10"
}, },
"devDependencies": { "devDependencies": {
@@ -110,6 +112,7 @@
"@typescript-eslint/rule-tester": "^7.18.0", "@typescript-eslint/rule-tester": "^7.18.0",
"@typescript-eslint/utils": "^7.18.0", "@typescript-eslint/utils": "^7.18.0",
"axe-core": "^4.10.2", "axe-core": "^4.10.2",
"commander": "^14.0.1",
"compression-webpack-plugin": "^9.2.0", "compression-webpack-plugin": "^9.2.0",
"copy-webpack-plugin": "^6.4.1", "copy-webpack-plugin": "^6.4.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
@@ -129,6 +132,7 @@
"eslint-plugin-simple-import-sort": "^10.0.0", "eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^3.2.0", "eslint-plugin-unused-imports": "^3.2.0",
"express-static-gzip": "^2.2.0", "express-static-gzip": "^2.2.0",
"glob": "^11.0.3",
"jasmine": "^3.8.0", "jasmine": "^3.8.0",
"jasmine-core": "^3.8.0", "jasmine-core": "^3.8.0",
"jasmine-marbles": "0.9.2", "jasmine-marbles": "0.9.2",
@@ -138,6 +142,7 @@
"karma-jasmine": "~4.0.0", "karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0", "karma-jasmine-html-reporter": "^1.5.0",
"karma-mocha-reporter": "2.2.5", "karma-mocha-reporter": "2.2.5",
"md5": "^2.3.0",
"ng-mocks": "^14.13.5", "ng-mocks": "^14.13.5",
"ngx-mask": "14.2.4", "ngx-mask": "14.2.4",
"postcss": "^8.5", "postcss": "^8.5",
@@ -4943,6 +4948,29 @@
"node": ">=18" "node": ">=18"
} }
}, },
"node_modules/@isaacs/balanced-match": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz",
"integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": "20 || >=22"
}
},
"node_modules/@isaacs/brace-expansion": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz",
"integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@isaacs/balanced-match": "^4.0.1"
},
"engines": {
"node": "20 || >=22"
}
},
"node_modules/@isaacs/cliui": { "node_modules/@isaacs/cliui": {
"version": "8.0.2", "version": "8.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
@@ -8950,6 +8978,28 @@
"node": ">= 10" "node": ">= 10"
} }
}, },
"node_modules/cacache/node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"deprecated": "Glob versions prior to v9 are no longer supported",
"dev": true,
"license": "ISC",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/cacache/node_modules/lru-cache": { "node_modules/cacache/node_modules/lru-cache": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
@@ -9407,12 +9457,13 @@
} }
}, },
"node_modules/commander": { "node_modules/commander": {
"version": "6.2.1", "version": "14.0.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.1.tgz",
"integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "integrity": "sha512-2JkV3gUZUVrbNA+1sjBOYLsMZ5cEEl8GTFP2a4AVz5hvasAMCQ1D2l2le/cX+pV4N6ZU17zjUahLpIXRrnWL8A==",
"dev": true, "dev": true,
"license": "MIT",
"engines": { "engines": {
"node": ">= 6" "node": ">=20"
} }
}, },
"node_modules/comment-parser": { "node_modules/comment-parser": {
@@ -10286,6 +10337,16 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/cypress/node_modules/commander": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz",
"integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 6"
}
},
"node_modules/cypress/node_modules/is-fullwidth-code-point": { "node_modules/cypress/node_modules/is-fullwidth-code-point": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
@@ -12728,7 +12789,8 @@
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
"dev": true "dev": true,
"license": "ISC"
}, },
"node_modules/fscreen": { "node_modules/fscreen": {
"version": "1.2.0", "version": "1.2.0",
@@ -12900,21 +12962,24 @@
} }
}, },
"node_modules/glob": { "node_modules/glob": {
"version": "7.2.3", "version": "11.0.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "integrity": "sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==",
"deprecated": "Glob versions prior to v9 are no longer supported",
"dev": true, "dev": true,
"license": "ISC",
"dependencies": { "dependencies": {
"fs.realpath": "^1.0.0", "foreground-child": "^3.3.1",
"inflight": "^1.0.4", "jackspeak": "^4.1.1",
"inherits": "2", "minimatch": "^10.0.3",
"minimatch": "^3.1.1", "minipass": "^7.1.2",
"once": "^1.3.0", "package-json-from-dist": "^1.0.0",
"path-is-absolute": "^1.0.0" "path-scurry": "^2.0.0"
},
"bin": {
"glob": "dist/esm/bin.mjs"
}, },
"engines": { "engines": {
"node": "*" "node": "20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
@@ -12937,6 +13002,75 @@
"integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==",
"dev": true "dev": true
}, },
"node_modules/glob/node_modules/jackspeak": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz",
"integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"@isaacs/cliui": "^8.0.2"
},
"engines": {
"node": "20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/glob/node_modules/lru-cache": {
"version": "11.2.2",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.2.tgz",
"integrity": "sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==",
"dev": true,
"license": "ISC",
"engines": {
"node": "20 || >=22"
}
},
"node_modules/glob/node_modules/minimatch": {
"version": "10.0.3",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz",
"integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==",
"dev": true,
"license": "ISC",
"dependencies": {
"@isaacs/brace-expansion": "^5.0.0"
},
"engines": {
"node": "20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/glob/node_modules/minipass": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
"integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
"dev": true,
"license": "ISC",
"engines": {
"node": ">=16 || 14 >=14.17"
}
},
"node_modules/glob/node_modules/path-scurry": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz",
"integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"lru-cache": "^11.0.0",
"minipass": "^7.1.2"
},
"engines": {
"node": "20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/global-dirs": { "node_modules/global-dirs": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz",
@@ -13664,6 +13798,7 @@
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
"deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
"dev": true, "dev": true,
"license": "ISC",
"dependencies": { "dependencies": {
"once": "^1.3.0", "once": "^1.3.0",
"wrappy": "1" "wrappy": "1"
@@ -14414,6 +14549,28 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/istanbul-lib-source-maps/node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"deprecated": "Glob versions prior to v9 are no longer supported",
"dev": true,
"license": "ISC",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage": { "node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage": {
"version": "2.0.5", "version": "2.0.5",
"resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz",
@@ -14552,6 +14709,28 @@
"rxjs": "^7.0.0" "rxjs": "^7.0.0"
} }
}, },
"node_modules/jasmine/node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"deprecated": "Glob versions prior to v9 are no longer supported",
"dev": true,
"license": "ISC",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/jest-worker": { "node_modules/jest-worker": {
"version": "27.5.1", "version": "27.5.1",
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz",
@@ -15115,6 +15294,28 @@
"wrap-ansi": "^7.0.0" "wrap-ansi": "^7.0.0"
} }
}, },
"node_modules/karma/node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"deprecated": "Glob versions prior to v9 are no longer supported",
"dev": true,
"license": "ISC",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/karma/node_modules/mkdirp": { "node_modules/karma/node_modules/mkdirp": {
"version": "0.5.6", "version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
@@ -17880,6 +18081,7 @@
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"dev": true, "dev": true,
"license": "MIT",
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
} }
@@ -19983,6 +20185,28 @@
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
} }
}, },
"node_modules/rimraf/node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"deprecated": "Glob versions prior to v9 are no longer supported",
"dev": true,
"license": "ISC",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/roarr": { "node_modules/roarr": {
"version": "7.21.1", "version": "7.21.1",
"resolved": "https://registry.npmjs.org/roarr/-/roarr-7.21.1.tgz", "resolved": "https://registry.npmjs.org/roarr/-/roarr-7.21.1.tgz",
@@ -20099,6 +20323,28 @@
"rxjs-report-usage": "bin/rxjs-report-usage" "rxjs-report-usage": "bin/rxjs-report-usage"
} }
}, },
"node_modules/rxjs-report-usage/node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"deprecated": "Glob versions prior to v9 are no longer supported",
"dev": true,
"license": "ISC",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/safe-array-concat": { "node_modules/safe-array-concat": {
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz",
@@ -20254,6 +20500,28 @@
"loader-utils": "^2.0.0" "loader-utils": "^2.0.0"
} }
}, },
"node_modules/sass-resources-loader/node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"deprecated": "Glob versions prior to v9 are no longer supported",
"dev": true,
"license": "ISC",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/sass-resources-loader/node_modules/loader-utils": { "node_modules/sass-resources-loader/node_modules/loader-utils": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",

View File

@@ -114,6 +114,7 @@
"@terraformer/wkt": "^2.2.1", "@terraformer/wkt": "^2.2.1",
"altcha": "^0.9.0", "altcha": "^0.9.0",
"angulartics2": "^12.2.0", "angulartics2": "^12.2.0",
"body-parser": "^1.20.3",
"bootstrap": "^5.3", "bootstrap": "^5.3",
"cerialize": "0.1.18", "cerialize": "0.1.18",
"cli-progress": "^3.12.0", "cli-progress": "^3.12.0",
@@ -160,6 +161,7 @@
"reflect-metadata": "^0.2.2", "reflect-metadata": "^0.2.2",
"rxjs": "^7.8.0", "rxjs": "^7.8.0",
"uuid": "^8.3.2", "uuid": "^8.3.2",
"xhr2": "^0.2.1",
"zone.js": "~0.14.10" "zone.js": "~0.14.10"
}, },
"devDependencies": { "devDependencies": {
@@ -191,6 +193,7 @@
"@typescript-eslint/rule-tester": "^7.18.0", "@typescript-eslint/rule-tester": "^7.18.0",
"@typescript-eslint/utils": "^7.18.0", "@typescript-eslint/utils": "^7.18.0",
"axe-core": "^4.10.2", "axe-core": "^4.10.2",
"commander": "^14.0.1",
"compression-webpack-plugin": "^9.2.0", "compression-webpack-plugin": "^9.2.0",
"copy-webpack-plugin": "^6.4.1", "copy-webpack-plugin": "^6.4.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
@@ -210,6 +213,7 @@
"eslint-plugin-simple-import-sort": "^10.0.0", "eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^3.2.0", "eslint-plugin-unused-imports": "^3.2.0",
"express-static-gzip": "^2.2.0", "express-static-gzip": "^2.2.0",
"glob": "^11.0.3",
"jasmine": "^3.8.0", "jasmine": "^3.8.0",
"jasmine-core": "^3.8.0", "jasmine-core": "^3.8.0",
"jasmine-marbles": "0.9.2", "jasmine-marbles": "0.9.2",
@@ -219,6 +223,7 @@
"karma-jasmine": "~4.0.0", "karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0", "karma-jasmine-html-reporter": "^1.5.0",
"karma-mocha-reporter": "2.2.5", "karma-mocha-reporter": "2.2.5",
"md5": "^2.3.0",
"ng-mocks": "^14.13.5", "ng-mocks": "^14.13.5",
"ngx-mask": "14.2.4", "ngx-mask": "14.2.4",
"postcss": "^8.5", "postcss": "^8.5",

View File

@@ -309,13 +309,24 @@ function serverSideRender(req, res, next, sendToUser: boolean = true) {
}); });
} }
/** // Read file once at startup
* Send back response to user to trigger direct client-side rendering (CSR) const indexHtmlContent = readFileSync(indexHtml, 'utf8');
* @param req current request
* @param res current response
*/
function clientSideRender(req, res) { function clientSideRender(req, res) {
res.sendFile(indexHtml); const namespace = environment.ui.nameSpace || '/';
let html = indexHtmlContent;
// Replace base href dynamically
html = html.replace(
/<base href="[^"]*">/,
`<base href="${namespace.endsWith('/') ? namespace : namespace + '/'}">`
);
// Replace REST URL with UI URL
if (environment.ssr.replaceRestUrl && REST_BASE_URL !== environment.rest.baseUrl) {
html = html.replace(new RegExp(REST_BASE_URL, 'g'), environment.rest.baseUrl);
}
res.send(html);
} }

View File

@@ -9,12 +9,9 @@ import {
} from '@angular/forms'; } from '@angular/forms';
import { import {
DISABLED_MATCHER_PROVIDER, DISABLED_MATCHER_PROVIDER,
DynamicFormControlRelation,
DynamicFormRelationService, DynamicFormRelationService,
HIDDEN_MATCHER, HIDDEN_MATCHER,
HIDDEN_MATCHER_PROVIDER, HIDDEN_MATCHER_PROVIDER,
MATCH_VISIBLE,
OR_OPERATOR,
REQUIRED_MATCHER_PROVIDER, REQUIRED_MATCHER_PROVIDER,
} from '@ng-dynamic-forms/core'; } from '@ng-dynamic-forms/core';
@@ -26,6 +23,7 @@ import {
import { FormBuilderService } from '../form-builder.service'; import { FormBuilderService } from '../form-builder.service';
import { FormFieldMetadataValueObject } from '../models/form-field-metadata-value.model'; import { FormFieldMetadataValueObject } from '../models/form-field-metadata-value.model';
import { DsDynamicTypeBindRelationService } from './ds-dynamic-type-bind-relation.service'; import { DsDynamicTypeBindRelationService } from './ds-dynamic-type-bind-relation.service';
import { getTypeBindRelations } from './type-bind.utils';
describe('DSDynamicTypeBindRelationService test suite', () => { describe('DSDynamicTypeBindRelationService test suite', () => {
let service: DsDynamicTypeBindRelationService; let service: DsDynamicTypeBindRelationService;
@@ -85,7 +83,7 @@ describe('DSDynamicTypeBindRelationService test suite', () => {
}); });
it('Should get 1 related form models for mock relation model data', () => { it('Should get 1 related form models for mock relation model data', () => {
const testModel = mockInputWithTypeBindModel; const testModel = mockInputWithTypeBindModel;
testModel.typeBindRelations = getTypeBindRelations(['boundType']); testModel.typeBindRelations = getTypeBindRelations(['boundType'], 'dc.type');
const relatedModels = service.getRelatedFormModel(testModel); const relatedModels = service.getRelatedFormModel(testModel);
expect(relatedModels).toHaveSize(1); expect(relatedModels).toHaveSize(1);
}); });
@@ -94,7 +92,7 @@ describe('DSDynamicTypeBindRelationService test suite', () => {
describe('Test matchesCondition method', () => { describe('Test matchesCondition method', () => {
it('Should receive one subscription to dc.type type binding"', () => { it('Should receive one subscription to dc.type type binding"', () => {
const testModel = mockInputWithTypeBindModel; const testModel = mockInputWithTypeBindModel;
testModel.typeBindRelations = getTypeBindRelations(['boundType']); testModel.typeBindRelations = getTypeBindRelations(['boundType'], 'dc.type');
const dcTypeControl = new UntypedFormControl(); const dcTypeControl = new UntypedFormControl();
dcTypeControl.setValue('boundType'); dcTypeControl.setValue('boundType');
let subscriptions = service.subscribeRelations(testModel, dcTypeControl); let subscriptions = service.subscribeRelations(testModel, dcTypeControl);
@@ -103,7 +101,7 @@ describe('DSDynamicTypeBindRelationService test suite', () => {
it('Expect hasMatch to be true (ie. this should be hidden)', () => { it('Expect hasMatch to be true (ie. this should be hidden)', () => {
const testModel = mockInputWithTypeBindModel; const testModel = mockInputWithTypeBindModel;
testModel.typeBindRelations = getTypeBindRelations(['boundType']); testModel.typeBindRelations = getTypeBindRelations(['boundType'], 'dc.type');
const dcTypeControl = new UntypedFormControl(); const dcTypeControl = new UntypedFormControl();
dcTypeControl.setValue('boundType'); dcTypeControl.setValue('boundType');
testModel.typeBindRelations[0].when[0].value = 'anotherType'; testModel.typeBindRelations[0].when[0].value = 'anotherType';
@@ -118,7 +116,7 @@ describe('DSDynamicTypeBindRelationService test suite', () => {
it('Expect hasMatch to be false (ie. this should NOT be hidden)', () => { it('Expect hasMatch to be false (ie. this should NOT be hidden)', () => {
const testModel = mockInputWithTypeBindModel; const testModel = mockInputWithTypeBindModel;
testModel.typeBindRelations = getTypeBindRelations(['boundType']); testModel.typeBindRelations = getTypeBindRelations(['boundType'], 'dc.type');
const dcTypeControl = new UntypedFormControl(); const dcTypeControl = new UntypedFormControl();
dcTypeControl.setValue('boundType'); dcTypeControl.setValue('boundType');
testModel.typeBindRelations[0].when[0].value = 'boundType'; testModel.typeBindRelations[0].when[0].value = 'boundType';
@@ -134,18 +132,3 @@ describe('DSDynamicTypeBindRelationService test suite', () => {
}); });
}); });
function getTypeBindRelations(configuredTypeBindValues: string[]): DynamicFormControlRelation[] {
const bindValues = [];
configuredTypeBindValues.forEach((value) => {
bindValues.push({
id: 'dc.type',
value: value,
});
});
return [{
match: MATCH_VISIBLE,
operator: OR_OPERATOR,
when: bindValues,
}];
}

View File

@@ -13,7 +13,6 @@ import {
DynamicFormControlModel, DynamicFormControlModel,
DynamicFormControlRelation, DynamicFormControlRelation,
DynamicFormRelationService, DynamicFormRelationService,
MATCH_VISIBLE,
OR_OPERATOR, OR_OPERATOR,
} from '@ng-dynamic-forms/core'; } from '@ng-dynamic-forms/core';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
@@ -216,23 +215,4 @@ export class DsDynamicTypeBindRelationService {
return subscriptions; return subscriptions;
} }
/**
* Helper function to construct a typeBindRelations array
* @param configuredTypeBindValues
*/
public getTypeBindRelations(configuredTypeBindValues: string[]): DynamicFormControlRelation[] {
const bindValues = [];
configuredTypeBindValues.forEach((value) => {
bindValues.push({
id: 'dc.type',
value: value,
});
});
return [{
match: MATCH_VISIBLE,
operator: OR_OPERATOR,
when: bindValues,
}];
}
} }

View File

@@ -0,0 +1,48 @@
import {
DynamicFormControlRelation,
MATCH_ENABLED,
MATCH_VISIBLE,
OR_OPERATOR,
} from '@ng-dynamic-forms/core';
/**
* Get the type bind values from the REST data for a specific field
* The return value is any[] in the method signature but in reality it's
* returning the 'relation' that'll be used for a dynamic matcher when filtering
* fields in type bind, made up of a 'match' outcome (make this field visible), an 'operator'
* (OR) and a 'when' condition (the bindValues array).
* @param configuredTypeBindValues array of types from the submission definition (CONFIG_DATA)
* @param typeField
* @private
* @return DynamicFormControlRelation[] array with one relation in it, for type bind matching to show a field
*/
export function getTypeBindRelations(configuredTypeBindValues: string[], typeField: string): DynamicFormControlRelation[] {
const bindValues = [];
configuredTypeBindValues.forEach((value) => {
bindValues.push({
id: typeField,
value: value,
});
});
// match: MATCH_VISIBLE means that if true, the field / component will be visible
// operator: OR means that all the values in the 'when' condition will be compared with OR, not AND
// when: the list of values to match against, in this case the list of strings from <type-bind>...</type-bind>
// Example: Field [x] will be VISIBLE if item type = book OR item type = book_part
//
// The opposing match value will be the dc.type for the workspace item
//
// MATCH_ENABLED is now also returned, so that hidden type-bound fields that are 'required'
// do not trigger false validation errors
return [
{
match: MATCH_ENABLED,
operator: OR_OPERATOR,
when: bindValues,
},
{
match: MATCH_VISIBLE,
operator: OR_OPERATOR,
when: bindValues,
},
];
}

View File

@@ -2,12 +2,7 @@ import {
Inject, Inject,
InjectionToken, InjectionToken,
} from '@angular/core'; } from '@angular/core';
import { import { DynamicFormControlLayout } from '@ng-dynamic-forms/core';
DynamicFormControlLayout,
DynamicFormControlRelation,
MATCH_VISIBLE,
OR_OPERATOR,
} from '@ng-dynamic-forms/core';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import uniqueId from 'lodash/uniqueId'; import uniqueId from 'lodash/uniqueId';
@@ -28,6 +23,7 @@ import {
DynamicRowArrayModel, DynamicRowArrayModel,
DynamicRowArrayModelConfig, DynamicRowArrayModelConfig,
} from '../ds-dynamic-form-ui/models/ds-dynamic-row-array-model'; } from '../ds-dynamic-form-ui/models/ds-dynamic-row-array-model';
import { getTypeBindRelations } from '../ds-dynamic-form-ui/type-bind.utils';
import { FormFieldModel } from '../models/form-field.model'; import { FormFieldModel } from '../models/form-field.model';
import { FormFieldMetadataValueObject } from '../models/form-field-metadata-value.model'; import { FormFieldMetadataValueObject } from '../models/form-field-metadata-value.model';
import { RelationshipOptions } from '../models/relationship-options.model'; import { RelationshipOptions } from '../models/relationship-options.model';
@@ -98,7 +94,7 @@ export abstract class FieldParser {
metadataFields: this.getAllFieldIds(), metadataFields: this.getAllFieldIds(),
hasSelectableMetadata: isNotEmpty(this.configData.selectableMetadata), hasSelectableMetadata: isNotEmpty(this.configData.selectableMetadata),
isDraggable, isDraggable,
typeBindRelations: isNotEmpty(this.configData.typeBind) ? this.getTypeBindRelations(this.configData.typeBind, typeBindRelations: isNotEmpty(this.configData.typeBind) ? getTypeBindRelations(this.configData.typeBind,
this.parserOptions.typeField) : null, this.parserOptions.typeField) : null,
groupFactory: () => { groupFactory: () => {
let model; let model;
@@ -327,7 +323,7 @@ export abstract class FieldParser {
// If typeBind is configured // If typeBind is configured
if (isNotEmpty(this.configData.typeBind)) { if (isNotEmpty(this.configData.typeBind)) {
(controlModel as DsDynamicInputModel).typeBindRelations = this.getTypeBindRelations(this.configData.typeBind, (controlModel as DsDynamicInputModel).typeBindRelations = getTypeBindRelations(this.configData.typeBind,
this.parserOptions.typeField); this.parserOptions.typeField);
} }
@@ -356,38 +352,6 @@ export abstract class FieldParser {
); );
} }
/**
* Get the type bind values from the REST data for a specific field
* The return value is any[] in the method signature but in reality it's
* returning the 'relation' that'll be used for a dynamic matcher when filtering
* fields in type bind, made up of a 'match' outcome (make this field visible), an 'operator'
* (OR) and a 'when' condition (the bindValues array).
* @param configuredTypeBindValues array of types from the submission definition (CONFIG_DATA)
* @param typeField
* @private
* @return DynamicFormControlRelation[] array with one relation in it, for type bind matching to show a field
*/
private getTypeBindRelations(configuredTypeBindValues: string[], typeField: string): DynamicFormControlRelation[] {
const bindValues = [];
configuredTypeBindValues.forEach((value) => {
bindValues.push({
id: typeField,
value: value,
});
});
// match: MATCH_VISIBLE means that if true, the field / component will be visible
// operator: OR means that all the values in the 'when' condition will be compared with OR, not AND
// when: the list of values to match against, in this case the list of strings from <type-bind>...</type-bind>
// Example: Field [x] will be VISIBLE if item type = book OR item type = book_part
//
// The opposing match value will be the dc.type for the workspace item
return [{
match: MATCH_VISIBLE,
operator: OR_OPERATOR,
when: bindValues,
}];
}
protected hasRegex() { protected hasRegex() {
return hasValue(this.configData.input.regex); return hasValue(this.configData.input.regex);
} }

File diff suppressed because it is too large Load Diff