Compare commits

..

252 Commits

Author SHA1 Message Date
Tim Donohue
38e0fe2f5d Update version tag for release 2025-07-14 15:29:43 -05:00
Tim Donohue
215dd37c89 Sync i18n files to prepare for 8.2 release. 2025-07-11 13:38:57 -05:00
Tim Donohue
2b9d3a0dc2 Merge pull request #4531 from atmire/w2p-119612_export-item-limit-8_x
[Port dspace-8_x] UI warning for export item limit
2025-07-07 13:07:35 -05:00
Jens Vannerum
2e26b4a50d 119612: fix spec test
(cherry picked from commit 6232d4e9cf)
2025-07-04 10:28:17 +02:00
Jens Vannerum
df8859d976 119612: aria-label to also include warning message if applicable
(cherry picked from commit 8eaff78737)
2025-07-04 10:28:12 +02:00
Jens Vannerum
c36c8d726e 119612: Check if a warning should be shown on changes to the total elements of the search, default to 500 if no value for the configuration property was returned
(cherry picked from commit e1b773c097)
2025-07-04 10:28:10 +02:00
Jens Vannerum
93200d6b3c 119612: UI warning that only first part of configured items will be exported
(cherry picked from commit b69b21af6c)
2025-07-04 10:27:56 +02:00
Tim Donohue
aabc0a199e Merge pull request #4436 from TexasDigitalLibrary/dspace-8_x-port-config-default-comcol-tab
[Port dspace-8_x] Make the default tab for browsing communities and collections configurable in DSpace 8
2025-07-03 15:37:41 -05:00
Tim Donohue
3c99183504 Merge pull request #4415 from atmire/w2p-131442_backport-4335-to-dspace-8_x
[Port dspace-8_x] Improve accessibility for screen readers
2025-07-03 14:21:17 -05:00
Tim Donohue
c3edf911ac Merge pull request #4441 from atmire/w2p-131442_backport-3888-to-dspace-8_x
[Port dspace-8_x] Fixed search page still returning stale data after invalidating a request
2025-07-03 14:06:30 -05:00
Tim Donohue
b815737710 Merge pull request #3820 from atmire/vocabulary-preloadlevel-fix-8_x
[Port dspace-8_x] Vocabulary preloadlevel fix
2025-07-01 17:02:51 -05:00
Tim Donohue
524de36043 Merge pull request #3614 from atmire/accessibility-settings-8_x
[Port dspace-8_x] Accessibility settings page
2025-07-01 13:56:05 -05:00
Andreas Awouters
86b4ce2cf9 119602: Fix SSR error by making klaroService optional
KlaroService handles cookies which are not applicable during SSR. By
making the service optional, and handling the case when it is not
available, SSR can do its work without throwing NullInjectorErrors.
2025-07-01 10:06:08 +02:00
Tim Donohue
2f986bb0a6 Merge pull request #4371 from qultoltd/dspace-8_x
Improve Hungarian translations in DSpace 8.1
2025-06-30 13:46:07 -05:00
Andreas Awouters
9070ad62a4 119602: Port disabling of cookie popup from main
# Conflicts:
#	src/app/footer/footer.component.spec.ts
#	src/app/footer/footer.component.ts
#	src/config/default-app-config.ts
#	src/config/info-config.interface.ts
#	src/environments/environment.test.ts
2025-06-30 15:05:16 +02:00
Andreas Awouters
9e39b01c6c Merge branch 'dspace-8_x' into accessibility-settings-8_x 2025-06-30 13:45:00 +02:00
Andreas Awouters
991dc0a0e5 119602: Open tooltip to left of info icon 2025-06-30 13:44:01 +02:00
Andreas Awouters
31fcfda622 119602: Align accessibility link with other footer links 2025-06-30 13:11:29 +02:00
Tim Donohue
1ec2df1017 Merge pull request #4440 from alexandrevryghem/w2p-117573_remove-observable-function-calls-from-template-8_x
[Port dspace-8_x] Removed observable function calls from template (part 2)
2025-06-24 16:49:22 -05:00
Alan Orth
763871a5c0 Merge pull request #4496 from DSpace/dependabot/npm_and_yarn/dspace-8_x/postcss-bff535204e 2025-06-24 22:17:54 +02:00
dependabot[bot]
510c0ae367 Bump postcss from 8.5.5 to 8.5.6 in the postcss group
---
updated-dependencies:
- dependency-name: postcss
  dependency-version: 8.5.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: postcss
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-23 06:44:27 +00:00
Zoltán Kanász-Nagy
c05586a7ea Merge branch 'DSpace:dspace-8_x' into dspace-8_x 2025-06-17 08:34:29 +02:00
Alan Orth
33b3f1a8e6 Merge pull request #4459 from DSpace/dependabot/npm_and_yarn/dspace-8_x/postcss-ff1e1e588d 2025-06-17 09:25:28 +03:00
Alan Orth
39ddebede7 Merge pull request #4462 from DSpace/dependabot/npm_and_yarn/dspace-8_x/sass-63defccb8e 2025-06-17 09:09:14 +03:00
Alan Orth
e048d3bc7d Merge pull request #4467 from DSpace/dependabot/npm_and_yarn/dspace-8_x/axios-1.10.0 2025-06-17 07:04:17 +03:00
dependabot[bot]
d6cccf1c1d Bump axios from 1.9.0 to 1.10.0
Bumps [axios](https://github.com/axios/axios) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-16 05:41:28 +00:00
dependabot[bot]
5d8785e804 Bump sass from 1.89.1 to 1.89.2 in the sass group
Bumps the sass group with 1 update: [sass](https://github.com/sass/dart-sass).


Updates `sass` from 1.89.1 to 1.89.2
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.89.1...1.89.2)

---
updated-dependencies:
- dependency-name: sass
  dependency-version: 1.89.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: sass
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-16 05:39:45 +00:00
dependabot[bot]
05d0743c0e Bump postcss from 8.5.4 to 8.5.5 in the postcss group
Bumps the postcss group with 1 update: [postcss](https://github.com/postcss/postcss).


Updates `postcss` from 8.5.4 to 8.5.5
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.5.4...8.5.5)

---
updated-dependencies:
- dependency-name: postcss
  dependency-version: 8.5.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: postcss
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-16 05:39:27 +00:00
Tim Donohue
f525461099 Merge pull request #4451 from DSpace/backport-4434-to-dspace-8_x
[Port dspace-8_x] Resolve field instance models using index when filtering errors
2025-06-12 12:47:50 -05:00
Kim Shepherd
6b38f5c0ac Resolve field instance models using index when filtering errors
(cherry picked from commit d218e22944)
2025-06-12 16:40:45 +00:00
Alan Orth
7a5cad9ff7 Merge pull request #4443 from DSpace/dependabot/npm_and_yarn/dspace-8_x/babel/runtime-7.27.6
Bump @babel/runtime from 7.27.4 to 7.27.6
2025-06-11 12:22:43 +03:00
dependabot[bot]
76486e285c Bump @babel/runtime from 7.27.4 to 7.27.6
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.27.4 to 7.27.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.27.6/packages/babel-runtime)

---
updated-dependencies:
- dependency-name: "@babel/runtime"
  dependency-version: 7.27.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 05:38:51 +00:00
Joran De Braekeleer
a1ef2e9e84 Merge remote-tracking branch 'upstream/dspace-8_x' into w2p-131442_backport-3888-to-dspace-8_x 2025-06-06 11:01:53 +02:00
Alexandre Vryghem
84ad762b32 Merge branch 'theme-fixes_contribute-7.6' into dspace-8_x 2025-06-05 19:18:13 +02:00
Alexandre Vryghem
d1fdd6110e 117287: Fixed various layout issues
- The unthemed home news didn't stick to the header like the dspace theme
- Impersonate user button has additional margin
- Submission form loading icon is not translatable
- Create resource policy page doesn't have the correct heading

(cherry picked from commit 56e45a9f08)
2025-06-05 19:17:54 +02:00
Alexandre Vryghem
ea81165fc5 Merge branch 'w2p-117573_remove-observable-function-calls-from-template-7.6' into dspace-8_x 2025-06-05 19:06:20 +02:00
nwoodward
c2c23dfa99 lint fixes 2025-06-05 09:53:38 -05:00
nwoodward
8a3a2026da make the default tab for browsing communities and collections configurable 2025-06-05 09:23:26 -05:00
Alan Orth
c608ba6ea3 Merge pull request #4431 from DSpace/dependabot/npm_and_yarn/dspace-8_x/sass-d83863101d
Bump sass from 1.89.0 to 1.89.1 in the sass group
2025-06-05 08:53:47 +03:00
dependabot[bot]
2ad5c98a00 Bump sass from 1.89.0 to 1.89.1 in the sass group
Bumps the sass group with 1 update: [sass](https://github.com/sass/dart-sass).


Updates `sass` from 1.89.0 to 1.89.1
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.89.0...1.89.1)

---
updated-dependencies:
- dependency-name: sass
  dependency-version: 1.89.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: sass
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-04 13:49:32 +00:00
Tim Donohue
fde7e464b0 Merge pull request #4423 from alanorth/zone.js-dep
Pin zone.js dependency for DSpace 8.x
2025-06-04 08:46:59 -05:00
Alan Orth
2956f4ae67 Merge pull request #4428 from DSpace/backport-4076-to-dspace-8_x
[Port dspace-8_x] fix typo in German translation of bitstream.edit.form.description.hint
2025-06-04 14:06:25 +03:00
Sascha Szott
8143114996 fix typo in German translation of bitstream.edit.form.description.hint
(cherry picked from commit c72af8edb5)
2025-06-04 09:52:33 +00:00
Alan Orth
418bf7d4ea Pin zone.js dependency to ~0.14.0
This is a peer dependency of Angular so we should keep it in sync
to avoid dependency conflicts. DSpace 8.x uses Angular 17.x so we
can pin the same version.

See: https://github.com/angular/angular/blob/17.3.x/packages/core/package.json
2025-06-04 09:34:34 +03:00
Alan Orth
4855772489 Merge pull request #4404 from DSpace/dependabot/npm_and_yarn/dspace-8_x/postcss-3f4fa9ea8d
Bump postcss from 8.5.3 to 8.5.4 in the postcss group
2025-06-03 09:06:47 +03:00
Alan Orth
bd6a5db73e Merge pull request #4403 from DSpace/dependabot/npm_and_yarn/dspace-8_x/babel/runtime-7.27.4
Bump @babel/runtime from 7.27.3 to 7.27.4
2025-06-03 09:02:49 +03:00
Alexandre Vryghem
9e8bc95acc 129964: Fixed the header role structure being invalid in the custom theme
- Replaced the menubar role from the parent of all the header buttons like lang switch, auth menu & help toggle with toolbar
- Replaced the remaining `<a>` buttons in the header with `<button>` to make them expandable with space
- Fixed accessibility issues flagged by axe DevTools in the user menu dropdown
2025-06-02 15:27:12 +02:00
Joran De Braekeleer
29a13ef518 Merge remote-tracking branch 'upstream/dspace-8_x' into w2p-131442_backport-4335-to-dspace-8_x 2025-06-02 10:28:06 +02:00
dependabot[bot]
0e12c5bdec Bump postcss from 8.5.3 to 8.5.4 in the postcss group
Bumps the postcss group with 1 update: [postcss](https://github.com/postcss/postcss).


Updates `postcss` from 8.5.3 to 8.5.4
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.5.3...8.5.4)

---
updated-dependencies:
- dependency-name: postcss
  dependency-version: 8.5.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: postcss
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-02 05:56:45 +00:00
dependabot[bot]
2699e81684 Bump @babel/runtime from 7.27.3 to 7.27.4
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.27.3 to 7.27.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.27.4/packages/babel-runtime)

---
updated-dependencies:
- dependency-name: "@babel/runtime"
  dependency-version: 7.27.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-02 05:53:14 +00:00
Tim Donohue
46394d4bba Merge pull request #4385 from atmire/w2p-131441_backport-3065-8
[Port dspace-8_x] Made AdminSearchPageComponent themeable
2025-05-30 10:16:56 -05:00
abhinav
3f413af65e fix theming for DS8 2025-05-30 11:58:23 +02:00
Alexandre Vryghem
bb17ce42ed Fixed search facet deadlock
Also fixed minor issue in MetadataService, but this doesn't cause any issues in the current code

(cherry picked from commit 446280b59a)
2025-05-30 11:44:01 +02:00
Tim Donohue
4b7c95a766 Merge pull request #4373 from DSpace/dependabot/npm_and_yarn/dspace-8_x/testing-ff22ddd0c9
Bump ng-mocks from 14.13.4 to 14.13.5 in the testing group
2025-05-29 08:50:26 -05:00
Alan Orth
1c6e54909e Merge pull request #4376 from DSpace/dependabot/npm_and_yarn/dspace-8_x/zone.js-0.15.1
Bump zone.js from 0.15.0 to 0.15.1
2025-05-29 08:55:05 +03:00
Alan Orth
aca2b3370a Merge pull request #4393 from DSpace/dependabot/npm_and_yarn/dspace-8_x/babel/runtime-7.27.3
Bump @babel/runtime from 7.27.1 to 7.27.3
2025-05-29 08:42:56 +03:00
Tim Donohue
cfec1c8b8a Merge pull request #4375 from DSpace/dependabot/npm_and_yarn/dspace-8_x/types/lodash-4.17.17
Bump @types/lodash from 4.17.16 to 4.17.17
2025-05-28 16:10:26 -05:00
Tim Donohue
8208f886f2 Merge pull request #4374 from DSpace/dependabot/npm_and_yarn/dspace-8_x/webpack-51a062295f
Bump webpack from 5.99.8 to 5.99.9 in the webpack group
2025-05-28 15:50:30 -05:00
dependabot[bot]
af29e5e3df Bump webpack from 5.99.8 to 5.99.9 in the webpack group
Bumps the webpack group with 1 update: [webpack](https://github.com/webpack/webpack).


Updates `webpack` from 5.99.8 to 5.99.9
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.99.8...v5.99.9)

---
updated-dependencies:
- dependency-name: webpack
  dependency-version: 5.99.9
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: webpack
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-28 18:12:53 +00:00
dependabot[bot]
5de271ef94 Bump ng-mocks from 14.13.4 to 14.13.5 in the testing group
Bumps the testing group with 1 update: [ng-mocks](https://github.com/help-me-mom/ng-mocks).


Updates `ng-mocks` from 14.13.4 to 14.13.5
- [Release notes](https://github.com/help-me-mom/ng-mocks/releases)
- [Changelog](https://github.com/help-me-mom/ng-mocks/blob/master/CHANGELOG.md)
- [Commits](https://github.com/help-me-mom/ng-mocks/compare/v14.13.4...v14.13.5)

---
updated-dependencies:
- dependency-name: ng-mocks
  dependency-version: 14.13.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: testing
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-28 18:08:42 +00:00
dependabot[bot]
fb28098ece Bump @babel/runtime from 7.27.1 to 7.27.3
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.27.1 to 7.27.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.27.3/packages/babel-runtime)

---
updated-dependencies:
- dependency-name: "@babel/runtime"
  dependency-version: 7.27.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-28 18:07:01 +00:00
Tim Donohue
83d5400c1c Merge pull request #4388 from atmire/backport-4060-submission-form-getting-stuck-in-loop-contribute-8
[Port dspace-8_x] Fix infinite loading submission forms
2025-05-27 16:41:55 -05:00
Tim Donohue
7c45c78082 Merge pull request #4370 from atmire/w2p-130424_impossible-to-add-new-values-for-fields-without-qualifiers_contribute-8
[Port dspace-8_x] Fix unqualified metadata field validation in Edit Metadata tab by sorting fields in validation request
2025-05-27 14:53:58 -05:00
abhinav
c38711d8a9 Merge remote-tracking branch 'alex-upstream/w2p-127655_fix-submission-form-getting-stuck-in-loop_contribute-7.6' into backport-4060-submission-form-getting-stuck-in-loop-contribute-8 2025-05-26 11:44:13 +02:00
abhinav
b18260f8ae Merge remote-tracking branch 'alex-upstream/w2p-115051_themed-admin-search-page_contribute-7.4' into w2p-131441_backport-3065-8 2025-05-26 11:03:50 +02:00
dependabot[bot]
97bf3c2b79 Bump zone.js from 0.15.0 to 0.15.1
Bumps [zone.js](https://github.com/angular/angular/tree/HEAD/packages/zone.js) from 0.15.0 to 0.15.1.
- [Release notes](https://github.com/angular/angular/releases)
- [Changelog](https://github.com/angular/angular/blob/main/packages/zone.js/CHANGELOG.md)
- [Commits](https://github.com/angular/angular/commits/zone.js-0.15.1/packages/zone.js)

---
updated-dependencies:
- dependency-name: zone.js
  dependency-version: 0.15.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-26 02:21:45 +00:00
dependabot[bot]
cd4de478bc Bump @types/lodash from 4.17.16 to 4.17.17
Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.17.16 to 4.17.17.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash)

---
updated-dependencies:
- dependency-name: "@types/lodash"
  dependency-version: 4.17.17
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-26 02:21:21 +00:00
Kanász-Nagy Zoltán
72a3872b51 QREPO-0 adding missing translations and correcting existing ones 2025-05-23 21:29:57 +02:00
abhinav
65c47fbdfc Merge remote-tracking branch 'alex-upstream/w2p-130424_impossible-to-add-new-values-for-fields-without-qualifiers_contribute-7.6' into w2p-130424_impossible-to-add-new-values-for-fields-without-qualifiers_contribute-8 2025-05-23 17:59:56 +02:00
Tim Donohue
eb6759817f Merge pull request #4366 from DSpace/backport-4364-to-dspace-8_x
[Port dspace-8_x] Remove stray comma from `config.example.yml` which makes example config invalid
2025-05-22 13:58:53 -05:00
Tim Donohue
d2cc002af0 Remove stray comma
(cherry picked from commit bcd2081ee3)
2025-05-22 17:05:17 +00:00
Tim Donohue
09182f9cee Merge pull request #4361 from DSpace/backport-4360-to-dspace-8_x
[Port dspace-8_x] Fix and simplify submission section 'enabled' logic
2025-05-21 15:53:05 -05:00
Kim Shepherd
3ee1983426 Fix and simplify submission section 'enabled' logic
Fixes cases where a section needs to be disabled on save/init
because it is empty and non-mandatory

(cherry picked from commit f77dfa37da)
2025-05-21 20:13:11 +00:00
Tim Donohue
ed4dfdad1d Merge pull request #4348 from DSpace/dependabot/npm_and_yarn/dspace-8_x/eslint-1ccb09f07e
Bump eslint-plugin-jsonc from 2.20.0 to 2.20.1 in the eslint group
2025-05-19 11:07:45 -05:00
Tim Donohue
fdeb1d0963 Merge pull request #4349 from DSpace/dependabot/npm_and_yarn/dspace-8_x/sass-5219375de9
Bump sass from 1.88.0 to 1.89.0 in the sass group
2025-05-19 11:06:13 -05:00
Tim Donohue
ff95c2303b Merge pull request #4350 from DSpace/dependabot/npm_and_yarn/dspace-8_x/isbot-5.1.28
Bump isbot from 5.1.27 to 5.1.28
2025-05-19 10:23:21 -05:00
dependabot[bot]
94097dd636 Bump isbot from 5.1.27 to 5.1.28
Bumps [isbot](https://github.com/omrilotan/isbot) from 5.1.27 to 5.1.28.
- [Changelog](https://github.com/omrilotan/isbot/blob/main/CHANGELOG.md)
- [Commits](https://github.com/omrilotan/isbot/compare/v5.1.27...v5.1.28)

---
updated-dependencies:
- dependency-name: isbot
  dependency-version: 5.1.28
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-19 02:34:29 +00:00
dependabot[bot]
5c5aef86c6 Bump sass from 1.88.0 to 1.89.0 in the sass group
Bumps the sass group with 1 update: [sass](https://github.com/sass/dart-sass).


Updates `sass` from 1.88.0 to 1.89.0
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.88.0...1.89.0)

---
updated-dependencies:
- dependency-name: sass
  dependency-version: 1.89.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: sass
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-19 02:34:10 +00:00
dependabot[bot]
8c38380bbd Bump eslint-plugin-jsonc from 2.20.0 to 2.20.1 in the eslint group
Bumps the eslint group with 1 update: [eslint-plugin-jsonc](https://github.com/ota-meshi/eslint-plugin-jsonc).


Updates `eslint-plugin-jsonc` from 2.20.0 to 2.20.1
- [Release notes](https://github.com/ota-meshi/eslint-plugin-jsonc/releases)
- [Changelog](https://github.com/ota-meshi/eslint-plugin-jsonc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ota-meshi/eslint-plugin-jsonc/compare/v2.20.0...v2.20.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsonc
  dependency-version: 2.20.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: eslint
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-19 02:33:36 +00:00
Tim Donohue
c2246d50fe Merge pull request #4345 from 4Science/task/dspace-8_x/DURACOM-226
[Port dspace-8_x] fix submission footer wrapping on medium screens
2025-05-16 11:41:28 -05:00
Andrea Barbasso
c9338ad362 [DURACOM-226] fix submission footer wrapping on medium screens 2025-05-16 12:48:59 +02:00
Tim Donohue
6e63e8e372 Merge pull request #4343 from DSpace/backport-4341-to-dspace-8_x
[Port dspace-8_x] Use ellipsis for truncatable parts
2025-05-15 15:54:23 -05:00
Andrea Barbasso
3ef7adff79 [CST-19327] use ellipsis for truncatable parts
(cherry picked from commit 6703a07207)
2025-05-15 19:55:50 +00:00
Tim Donohue
c7d5611a4e Merge pull request #4320 from DSpace/dependabot/npm_and_yarn/dspace-8_x/sass-d0f2b75659
Bump sass from 1.87.0 to 1.88.0 in the sass group
2025-05-14 10:03:01 -05:00
Alexandre Vryghem
c58b398e43 129964: Restored language button border on focus 2025-05-14 13:49:16 +02:00
Tim Donohue
2428dfeb4b Merge pull request #4337 from DSpace/backport-3373-to-dspace-8_x
[Port dspace-8_x] Adjust the font size of the 'No thumbnails available' text.
2025-05-13 17:34:23 -05:00
dependabot[bot]
2a5905d7f4 Bump sass from 1.87.0 to 1.88.0 in the sass group
Bumps the sass group with 1 update: [sass](https://github.com/sass/dart-sass).


Updates `sass` from 1.87.0 to 1.88.0
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.87.0...1.88.0)

---
updated-dependencies:
- dependency-name: sass
  dependency-version: 1.88.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: sass
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-13 22:08:51 +00:00
Tim Donohue
67563e37ff Merge pull request #4321 from DSpace/dependabot/npm_and_yarn/dspace-8_x/webpack-ab0e10ec03
Bump webpack from 5.99.7 to 5.99.8 in the webpack group
2025-05-13 17:05:21 -05:00
DanGastardelli
e579725dfb Adjust thumb text for smaller resolutions
(cherry picked from commit fa723c17a9)
2025-05-13 21:41:26 +00:00
DanGastardelli
490bf758ac Key spacing adjustment
(cherry picked from commit 829d406808)
2025-05-13 21:41:26 +00:00
DanGastardelli
6e9018a01d Adding treatment for the use of the thumb-font-2 class
(cherry picked from commit e06db4cbab)
2025-05-13 21:41:26 +00:00
DanGastardelli
2eed8f13d0 Changed the implementation of changing the text font size when there is no thumbnail.
(cherry picked from commit 3cd5432034)
2025-05-13 21:41:26 +00:00
DanGastardelli
be2bf9897a Adjust the font size of the 'No thumbnails available' text.
(cherry picked from commit c4dfed0e02)
2025-05-13 21:41:26 +00:00
Tim Donohue
d6f75af9d3 Merge pull request #4313 from oscar-escire/Issue/4201-DS-8
[Port dspace-8_x] Keyboard 'tab' key navigation improved
2025-05-13 12:02:12 -05:00
Tim Donohue
3d7ba529c1 Merge pull request #4333 from tdonohue/port_4326_to_8x
[Port dspace-8_x] Add basic automated tests to ensure common HTTP Return Codes do not break
2025-05-13 11:35:56 -05:00
Tim Donohue
e5047f52ac Add basic tests to our build to verify correct HTTP return codes for 301, 403, 404 and 500. 2025-05-13 09:37:41 -05:00
Tim Donohue
ce44a89f8e Merge pull request #4325 from DSpace/backport-4227-to-dspace-8_x
[Port dspace-8_x] Remove `ssr.paths` configuration and replace with `ssr.excludePathPatterns` which excludes specific paths from SSR
2025-05-12 15:58:45 -05:00
FrancescoMolinaro
5cbec3719b [DURACOM-344] refactor solution to avoid double slashes
(cherry picked from commit c442d35505)
2025-05-12 19:11:55 +00:00
FrancescoMolinaro
d4231e0e3e [DURACOM-344] adapt patterns and example file, fix possible error from YAML
(cherry picked from commit 4c9638150a)
2025-05-12 19:11:55 +00:00
FrancescoMolinaro
4bb7b54be9 [DURACOM-344] Adapt SSR page filtering mechanism to a not allowed list
(cherry picked from commit b1c5460bbb)
2025-05-12 19:11:55 +00:00
dependabot[bot]
c6bb829ac2 Bump webpack from 5.99.7 to 5.99.8 in the webpack group
Bumps the webpack group with 1 update: [webpack](https://github.com/webpack/webpack).


Updates `webpack` from 5.99.7 to 5.99.8
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.99.7...v5.99.8)

---
updated-dependencies:
- dependency-name: webpack
  dependency-version: 5.99.8
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: webpack
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-12 03:05:11 +00:00
Oscar Chacón
499b49e6bf Merge branch 'dspace-8_x' into Issue/4201-DS-8 2025-05-09 13:35:40 -06:00
Tim Donohue
d6c8be6983 Merge pull request #4312 from DSpace/backport-3513-to-dspace-8_x
[Port dspace-8_x] Fix navbar wrapping on medium screens
2025-05-09 13:37:59 -05:00
Andrea Barbasso
4a4c01b80b [DSC-1847][DSC-1966] fix navbar ui error
(cherry picked from commit 49b329edb1)
2025-05-09 17:33:37 +00:00
Tim Donohue
40e213f926 Merge pull request #4297 from DSpace/dependabot/npm_and_yarn/dspace-8_x/angular-06b757f997
Bump the angular group with 3 updates
2025-05-08 16:30:29 -05:00
Tim Donohue
d92aeb6d09 Merge pull request #4251 from atmire/fix-embargoed-thumbnails_contribute-8.1
[Port dspace-8_x] Show restricted thumbnails to users with access rights
2025-05-08 16:08:52 -05:00
Tim Donohue
6148a66ab6 Merge pull request #4308 from DSpace/backport-4288-to-dspace-8_x
[Port dspace-8_x] Bitstream upload failure during the workflow editing process when impersonating an editor
2025-05-08 08:43:46 -05:00
Oscar Chacón
fb6626904a improved "tab" navigation on DSpace 8 2025-05-07 22:19:41 -06:00
Adamo
577d241379 [DURACOM-312] lint fix
(cherry picked from commit c68e5a181d)
2025-05-07 21:42:20 +00:00
Adamo
0c564cb9c2 [DURACOM-312] set the X-On-Behalf-Of header with impersonatingID in FileUploader.
(cherry picked from commit 727bcdc2cb23ae7fcff1d9ddfa794f872f1d1b8c)
(cherry picked from commit 0574c8ed98)
2025-05-07 21:42:20 +00:00
Adamo
0439d07374 [DURACOM-312] set the newly created impersonatingID filed in UploaderOptions.
(cherry picked from commit c70fe184208805be8657d4373f50f193e2c6e85f)
(cherry picked from commit 70c6af3630)
2025-05-07 21:42:20 +00:00
Adamo
5792c4f32d [DURACOM-312] updated UploaderOptions to include impersonatingID.
(cherry picked from commit 2c79be1456c753665e27b58563e56accc87b0383)
(cherry picked from commit 4b0ab8161f)
2025-05-07 21:42:20 +00:00
Tim Donohue
4fa6a7e7df Merge pull request #4299 from DSpace/dependabot/npm_and_yarn/dspace-8_x/core-js-3.42.0
Bump core-js from 3.41.0 to 3.42.0
2025-05-06 17:07:23 -05:00
dependabot[bot]
1683905053 Bump the angular group with 3 updates
Bumps the angular group with 3 updates: [@angular/ssr](https://github.com/angular/angular-cli), [@angular-devkit/build-angular](https://github.com/angular/angular-cli) and [@angular/cli](https://github.com/angular/angular-cli).


Updates `@angular/ssr` from 17.3.16 to 17.3.17
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/17.3.16...17.3.17)

Updates `@angular-devkit/build-angular` from 17.3.16 to 17.3.17
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/17.3.16...17.3.17)

Updates `@angular/cli` from 17.3.16 to 17.3.17
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/17.3.16...17.3.17)

---
updated-dependencies:
- dependency-name: "@angular/ssr"
  dependency-version: 17.3.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: angular
- dependency-name: "@angular-devkit/build-angular"
  dependency-version: 17.3.17
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: angular
- dependency-name: "@angular/cli"
  dependency-version: 17.3.17
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: angular
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-06 04:55:01 +00:00
Alan Orth
dbdf84fc15 Merge pull request #4298 from DSpace/dependabot/npm_and_yarn/dspace-8_x/babel/runtime-7.27.1
Bump @babel/runtime from 7.27.0 to 7.27.1
2025-05-06 07:51:42 +03:00
Tim Donohue
25004d3578 Merge pull request #4301 from DSpace/backport-4289-to-dspace-8_x
[Port dspace-8_x] [DURACOM-326] fix possible issue on missing value for eperson patch
2025-05-05 12:17:36 -05:00
FrancescoMolinaro
d02c06d8db [DURACOM-326] fix possible issue on missing value for eperson patch
(cherry picked from commit 7b9cd73ee0)
2025-05-05 16:49:25 +00:00
dependabot[bot]
dd4c736d5e Bump core-js from 3.41.0 to 3.42.0
Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.41.0 to 3.42.0.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/commits/v3.42.0/packages/core-js)

---
updated-dependencies:
- dependency-name: core-js
  dependency-version: 3.42.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-05 03:25:25 +00:00
dependabot[bot]
3d95a7138b Bump @babel/runtime from 7.27.0 to 7.27.1
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.27.0 to 7.27.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.27.1/packages/babel-runtime)

---
updated-dependencies:
- dependency-name: "@babel/runtime"
  dependency-version: 7.27.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-05 03:24:51 +00:00
Tim Donohue
d95974a042 Merge pull request #4285 from tdonohue/port_4282_to_8x
[Port dspace-8_x] Fixed Missing Tags in Import Popup from External Sources - 4220
2025-05-01 12:59:33 -05:00
guillermo2519
eeb4009664 Fixed Missing Tags in Import Popup from External Sources - 4220 2025-05-01 12:18:44 -05:00
Tim Donohue
78b230b82f Merge pull request #4263 from DSpace/dependabot/npm_and_yarn/dspace-8_x/sass-f1c32079c7
Bump sass from 1.86.3 to 1.87.0 in the sass group
2025-05-01 10:03:49 -05:00
Tim Donohue
a1cbc7c83e Merge pull request #4265 from DSpace/dependabot/npm_and_yarn/dspace-8_x/axios-1.9.0
Bump axios from 1.8.4 to 1.9.0
2025-04-30 17:18:33 -05:00
Tim Donohue
977a6334b6 Merge pull request #4272 from the-library-code/de_language_updates-8_x
German de.json5 additions, fixes and updates (port of https://github.com/DSpace/dspace-angular/pull/3980)
2025-04-30 13:40:35 -05:00
kshepherd
ca61d55c03 Merge pull request #4280 from atmire/w2p-130484_bitstreams-tables-keep-being-duplicated-8_x
[Port dspace-8_x] Fix bitstream tables being duplicated
2025-04-30 16:54:49 +02:00
Andreas Awouters
2b2aebffd9 130484: Filter new bundles 2025-04-30 15:50:47 +02:00
Andreas Awouters
50f7ebf1b9 130484: Correctly update the 'showLoadMoreLink$' observable 2025-04-30 14:08:37 +02:00
Andreas Awouters
7f5000f840 130484: Only add bundles when they are missing from the subject 2025-04-30 13:42:51 +02:00
Yannick Paulsen
2ee74041a0 Translation and typo corrections 2025-04-29 16:35:38 +02:00
Yannick Paulsen
e2a06f8a73 Translation additions, fixes and updates for German message catalogue
Made with results of the i18n-sync tool against en.json5
2025-04-29 12:08:39 +02:00
dependabot[bot]
fce9382260 Bump sass from 1.86.3 to 1.87.0 in the sass group
Bumps the sass group with 1 update: [sass](https://github.com/sass/dart-sass).


Updates `sass` from 1.86.3 to 1.87.0
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.86.3...1.87.0)

---
updated-dependencies:
- dependency-name: sass
  dependency-version: 1.87.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: sass
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-28 15:32:58 +00:00
Tim Donohue
a4c77ea51e Merge pull request #4264 from DSpace/dependabot/npm_and_yarn/dspace-8_x/webpack-cee3a23860
Bump webpack from 5.99.6 to 5.99.7 in the webpack group
2025-04-28 10:17:09 -05:00
Tim Donohue
ad93c22fb8 Merge pull request #4266 from DSpace/dependabot/npm_and_yarn/dspace-8_x/isbot-5.1.27
Bump isbot from 5.1.26 to 5.1.27
2025-04-28 10:16:32 -05:00
dependabot[bot]
7ad05559b7 Bump isbot from 5.1.26 to 5.1.27
Bumps [isbot](https://github.com/omrilotan/isbot) from 5.1.26 to 5.1.27.
- [Changelog](https://github.com/omrilotan/isbot/blob/main/CHANGELOG.md)
- [Commits](https://github.com/omrilotan/isbot/compare/v5.1.26...v5.1.27)

---
updated-dependencies:
- dependency-name: isbot
  dependency-version: 5.1.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-28 03:04:59 +00:00
dependabot[bot]
4e538447eb Bump axios from 1.8.4 to 1.9.0
Bumps [axios](https://github.com/axios/axios) from 1.8.4 to 1.9.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.8.4...v1.9.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-28 03:04:49 +00:00
dependabot[bot]
783d0add3a Bump webpack from 5.99.6 to 5.99.7 in the webpack group
Bumps the webpack group with 1 update: [webpack](https://github.com/webpack/webpack).


Updates `webpack` from 5.99.6 to 5.99.7
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.99.6...v5.99.7)

---
updated-dependencies:
- dependency-name: webpack
  dependency-version: 5.99.7
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: webpack
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-28 03:04:10 +00:00
Tim Donohue
d3c1f93215 Merge pull request #4252 from DSpace/backport-4212-to-dspace-8_x
[Port dspace-8_x] Fix: prevent bitstream format cache issue by disabling cached version
2025-04-25 17:15:31 -05:00
Jesiel Viana
2787baa176 fix unit tests for bitstream-data.service.ts
(cherry picked from commit bb536192c2)
2025-04-25 21:43:03 +00:00
Jesiel Viana
416bfedc66 fix: invalidate cache only for the modified bitstream
(cherry picked from commit 4f48f39f7b)
2025-04-25 21:43:03 +00:00
Jesiel Viana
a7a7fa5511 fix: prevent bitstream format cache issue by disabling cached version
(cherry picked from commit 6001652101)
2025-04-25 21:43:03 +00:00
Tim Donohue
535653fff5 Merge pull request #4248 from DSpace/backport-4243-to-dspace-8_x
[Port dspace-8_x] Add translation keys for journal submission volume lookup
2025-04-25 12:23:29 -05:00
Joran De Braekeleer
7088d78b93 130405: Add translations for journal submission volume lookup
(cherry picked from commit fef16bca14)
2025-04-25 15:31:48 +00:00
Tim Donohue
05da2056f9 Merge pull request #4245 from DSpace/backport-4234-to-dspace-8_x
[Port dspace-8_x] [DURACOM-350] fix cache issue after mydspace action
2025-04-24 16:24:16 -05:00
FrancescoMolinaro
32a4c4a070 [DURACOM-350] Fix filter skeleton missing update
(cherry picked from commit 7998d2d8b9)
2025-04-24 20:07:24 +00:00
FrancescoMolinaro
67d71e6da4 [DURACOM-350] prevent unnecessary reload
(cherry picked from commit 1b112dd887)
2025-04-24 20:07:24 +00:00
FrancescoMolinaro
44f46a9a8a [DURACOM-350] fix cache issue after mydspace action
(cherry picked from commit e84af6ab91)
2025-04-24 20:07:23 +00:00
Tim Donohue
208e7791f1 Merge pull request #4232 from atmire/4099-duplicate-view-events_contibute-8.x
[Port to dspace-8_x] Fix for double view events when using dynamic themes
2025-04-23 16:58:17 -05:00
Tim Donohue
fcef3c6d60 Merge pull request #4239 from DSpace/backport-3968-to-dspace-8_x
[Port dspace-8_x] Fix - previously entered qualdrop value field is deleted when adding a new (emtpy) line with the same(!) qualifier and then deleting it
2025-04-23 12:53:14 -05:00
VictorDuranEscire
564a0f41a7 Fix - Validate value on remove item for submission form only for qualdrop component
(cherry picked from commit 1e73fa626d)
2025-04-23 16:38:44 +00:00
Tim Donohue
e9a32721af Merge pull request #4167 from atmire/w2p-129621_submission-form-field-type-name-null-issue_contribute-8.1
Fix unable to remove data from a submission form field of type "name"
2025-04-23 11:06:47 -05:00
lotte
eefc502d8c 129694: fixed lint issues 2025-04-22 14:58:06 +02:00
lotte
a71b3442ae 129694: resolver fix after merge 2025-04-22 12:29:44 +02:00
lotte
494f0fb987 Merge branch 'w2p-129694_4099-PoC-solution-with-resolvers' into 4099-duplicate-view-events_contibute-8.x 2025-04-22 12:14:20 +02:00
Tim Donohue
5e7309986b Merge pull request #4224 from DSpace/dependabot/npm_and_yarn/dspace-8_x/webpack-753b40408c
Bump webpack from 5.99.5 to 5.99.6 in the webpack group
2025-04-21 08:52:08 -05:00
dependabot[bot]
24899229b2 Bump webpack from 5.99.5 to 5.99.6 in the webpack group
Bumps the webpack group with 1 update: [webpack](https://github.com/webpack/webpack).


Updates `webpack` from 5.99.5 to 5.99.6
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.99.5...v5.99.6)

---
updated-dependencies:
- dependency-name: webpack
  dependency-version: 5.99.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: webpack
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-21 03:37:03 +00:00
Tim Donohue
5382315ca5 Merge pull request #4209 from DSpace/backport-2317-to-dspace-8_x
[Port dspace-8_x] Update ESLint configuration for json5 files
2025-04-16 17:07:31 -05:00
Alan Orth
a07b7b1f70 .eslintrc.json: remove second eslint-plugin-jsonc
This seems to have been added twice at some point.

(cherry picked from commit 9896eab6ac)
2025-04-16 19:54:49 +00:00
Alan Orth
4c1220df30 .eslintrc.json: use jsonc/no-irregular-whitespace
The eslint-plugin-jsonc documentation recommends turning ESLint's
own no-irregular-whitespace plugin off for JSON files in favor of
its own jsonc/no-irregular-whitespace plugin.

See: https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-irregular-whitespace.html
(cherry picked from commit 5e8571de80)
2025-04-16 19:54:49 +00:00
Alan Orth
8eb98ce914 .eslintrc.json: use plugin:jsonc/recommended-with-json5
The eslint-plugin-jsonc has a recommended configuration for json5.

See: https://ota-meshi.github.io/eslint-plugin-jsonc/user-guide/#usage
(cherry picked from commit 3a05733256)
2025-04-16 19:54:49 +00:00
Tim Donohue
005655a461 Merge pull request #4182 from DSpace/dependabot/npm_and_yarn/dspace-8_x/http-proxy-middleware-2.0.9
Bump http-proxy-middleware from 2.0.7 to 2.0.9
2025-04-15 14:13:45 -05:00
Tim Donohue
e1430cdf0d Merge pull request #4118 from DSpace/dependabot/npm_and_yarn/dspace-8_x/babel/runtime-7.27.0
Bump @babel/runtime from 7.26.7 to 7.27.0
2025-04-15 14:04:19 -05:00
Tim Donohue
a20594abfc Merge pull request #4196 from tdonohue/port_4189_to_8x
[Port dspace-8_x] Add additional automated server-side rendering (SSR) tests for all Entity Types
2025-04-15 13:14:27 -05:00
dependabot[bot]
6263a39a91 Bump http-proxy-middleware from 2.0.7 to 2.0.9
Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.7 to 2.0.9.
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.9/CHANGELOG.md)
- [Commits](https://github.com/chimurai/http-proxy-middleware/compare/v2.0.7...v2.0.9)

---
updated-dependencies:
- dependency-name: http-proxy-middleware
  dependency-version: 2.0.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-15 15:06:41 +00:00
Tim Donohue
b0daab23bb Merge pull request #4152 from DSpace/dependabot/npm_and_yarn/dspace-8_x/isbot-5.1.26
Bump isbot from 5.1.25 to 5.1.26
2025-04-15 09:50:53 -05:00
Tim Donohue
f74ffcee7a Merge pull request #4025 from DSpace/dependabot/npm_and_yarn/dspace-8_x/rxjs-7.8.2
Bump rxjs from 7.8.1 to 7.8.2
2025-04-15 09:49:42 -05:00
Tim Donohue
17c974fbbd Add additional automated SSR tests for Community, Collection, Publication/Item, Person, OrgUnit and all Journal entities 2025-04-15 09:35:00 -05:00
Tim Donohue
d32d64040a Merge pull request #4177 from atmire/w2p-130081_access-control-bitstreams-pagination-fix-8.x
[Port dspace-8_x] Fix pagination on the "Select bitstreams" modal of the "Access Control" tab
2025-04-14 11:32:22 -05:00
Tim Donohue
bdf62ab52e Merge pull request #4154 from DSpace/dependabot/npm_and_yarn/dspace-8_x/types/lodash-4.17.16
Bump @types/lodash from 4.17.15 to 4.17.16
2025-04-11 17:14:02 -05:00
Tim Donohue
345a995b51 Merge pull request #4178 from DSpace/backport-4168-to-dspace-8_x
[Port dspace-8_x] Fix export button enabled in bulk access management without selecting step 2
2025-04-11 16:58:36 -05:00
Tim Donohue
9fe2ad988b Merge pull request #4179 from arvoConsultores/DS-4097-dspace8
[Port dspace-8_x] Store the state of the computed filters
2025-04-11 15:55:28 -05:00
Tim Donohue
9f3b941e8e Merge pull request #4151 from DSpace/dependabot/npm_and_yarn/dspace-8_x/webpack-0542bd02c8
Bump webpack from 5.98.0 to 5.99.5 in the webpack group
2025-04-11 15:02:45 -05:00
Sergio Fernández Celorio
dbb8748190 Lint errors 2025-04-11 21:51:39 +02:00
abhinav
11d09d6033 Fix export button enabled in bulk access management without selecting step 2
(cherry picked from commit 4b3b660354)
2025-04-11 19:43:40 +00:00
Nona Luypaert
9aac463e94 Merge remote-tracking branch 'contributions/w2p-130081_access-control-bitstreams-pagination-fix-7.6' into w2p-130081_access-control-bitstreams-pagination-fix-8.x
Conflicts:
	src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.ts
2025-04-11 21:41:27 +02:00
Sergio Fernández Celorio
881fc4d39f Use take instead unsubscribe 2025-04-11 21:40:17 +02:00
Sergio Fernández Celorio
19e14a3d2a Store the state of the computed filters 2025-04-11 21:39:30 +02:00
Tim Donohue
60f1007915 Merge pull request #4113 from DSpace/dependabot/npm_and_yarn/dspace-8_x/axios-1.8.4
Bump axios from 1.7.9 to 1.8.4
2025-04-10 17:15:55 -05:00
dependabot[bot]
e9a1da5bb8 Bump webpack from 5.98.0 to 5.99.5 in the webpack group
Bumps the webpack group with 1 update: [webpack](https://github.com/webpack/webpack).


Updates `webpack` from 5.98.0 to 5.99.5
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.98.0...v5.99.5)

---
updated-dependencies:
- dependency-name: webpack
  dependency-version: 5.99.5
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: webpack
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-10 15:59:03 +00:00
Tim Donohue
847a74eac2 Merge pull request #4149 from DSpace/dependabot/npm_and_yarn/dspace-8_x/testing-d0d6209c31
Bump the testing group with 2 updates
2025-04-10 10:55:45 -05:00
Tim Donohue
275e848aa9 Merge pull request #4147 from DSpace/dependabot/npm_and_yarn/dspace-8_x/eslint-7904436953
Bump eslint-plugin-jsonc from 2.19.1 to 2.20.0 in the eslint group
2025-04-10 10:54:49 -05:00
dependabot[bot]
5bade1b73e Bump @types/lodash from 4.17.15 to 4.17.16
Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.17.15 to 4.17.16.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash)

---
updated-dependencies:
- dependency-name: "@types/lodash"
  dependency-version: 4.17.16
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-09 22:27:30 +00:00
dependabot[bot]
d2a9894e64 Bump isbot from 5.1.25 to 5.1.26
Bumps [isbot](https://github.com/omrilotan/isbot) from 5.1.25 to 5.1.26.
- [Changelog](https://github.com/omrilotan/isbot/blob/main/CHANGELOG.md)
- [Commits](https://github.com/omrilotan/isbot/compare/v5.1.25...v5.1.26)

---
updated-dependencies:
- dependency-name: isbot
  dependency-version: 5.1.26
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-09 22:27:16 +00:00
dependabot[bot]
fe7773d915 Bump the testing group with 2 updates
Bumps the testing group with 2 updates: [axe-core](https://github.com/dequelabs/axe-core) and [ng-mocks](https://github.com/help-me-mom/ng-mocks).


Updates `axe-core` from 4.10.2 to 4.10.3
- [Release notes](https://github.com/dequelabs/axe-core/releases)
- [Changelog](https://github.com/dequelabs/axe-core/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/dequelabs/axe-core/compare/v4.10.2...v4.10.3)

Updates `ng-mocks` from 14.13.2 to 14.13.4
- [Release notes](https://github.com/help-me-mom/ng-mocks/releases)
- [Changelog](https://github.com/help-me-mom/ng-mocks/blob/master/CHANGELOG.md)
- [Commits](https://github.com/help-me-mom/ng-mocks/compare/v14.13.2...v14.13.4)

---
updated-dependencies:
- dependency-name: axe-core
  dependency-version: 4.10.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: testing
- dependency-name: ng-mocks
  dependency-version: 14.13.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: testing
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-09 22:26:47 +00:00
dependabot[bot]
0e9de91280 Bump eslint-plugin-jsonc from 2.19.1 to 2.20.0 in the eslint group
Bumps the eslint group with 1 update: [eslint-plugin-jsonc](https://github.com/ota-meshi/eslint-plugin-jsonc).


Updates `eslint-plugin-jsonc` from 2.19.1 to 2.20.0
- [Release notes](https://github.com/ota-meshi/eslint-plugin-jsonc/releases)
- [Changelog](https://github.com/ota-meshi/eslint-plugin-jsonc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ota-meshi/eslint-plugin-jsonc/compare/v2.19.1...v2.20.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsonc
  dependency-version: 2.20.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: eslint
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-09 22:26:17 +00:00
Tim Donohue
437234b2ac Merge pull request #4003 from DSpace/dependabot/npm_and_yarn/dspace-8_x/compression-1.8.0
Bump compression from 1.7.5 to 1.8.0
2025-04-09 17:16:07 -05:00
dependabot[bot]
7e41f75666 Bump @babel/runtime from 7.26.7 to 7.27.0
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.26.7 to 7.27.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.27.0/packages/babel-runtime)

---
updated-dependencies:
- dependency-name: "@babel/runtime"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-09 22:13:34 +00:00
Tim Donohue
6fd6313608 Merge pull request #3998 from DSpace/dependabot/npm_and_yarn/dspace-8_x/angular-969bc97dc4
Bump the angular group with 3 updates
2025-04-09 17:04:36 -05:00
Tim Donohue
120e767f51 Merge pull request #4047 from DSpace/dependabot/npm_and_yarn/dspace-8_x/core-js-3.41.0
Bump core-js from 3.40.0 to 3.41.0
2025-04-09 16:31:16 -05:00
Tim Donohue
72c630af47 Merge pull request #4045 from DSpace/dependabot/npm_and_yarn/dspace-8_x/sass-b0ce3413d9
Bump sass from 1.84.0 to 1.85.1 in the sass group across 1 directory
2025-04-09 16:15:32 -05:00
dependabot[bot]
0c0081581a Bump the angular group with 3 updates
Bumps the angular group with 3 updates: [@angular/ssr](https://github.com/angular/angular-cli), [@angular-devkit/build-angular](https://github.com/angular/angular-cli) and [@angular/cli](https://github.com/angular/angular-cli).


Updates `@angular/ssr` from 17.3.11 to 17.3.12
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/17.3.11...17.3.12)

Updates `@angular-devkit/build-angular` from 17.3.11 to 17.3.12
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/17.3.11...17.3.12)

Updates `@angular/cli` from 17.3.11 to 17.3.12
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/17.3.11...17.3.12)

---
updated-dependencies:
- dependency-name: "@angular/ssr"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: angular
- dependency-name: "@angular-devkit/build-angular"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: angular
- dependency-name: "@angular/cli"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: angular
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-09 20:59:59 +00:00
Tim Donohue
4a337beeb8 Merge pull request #4001 from DSpace/dependabot/npm_and_yarn/dspace-8_x/webpack-a5e48b3f33
Bump webpack from 5.97.1 to 5.98.0 in the webpack group
2025-04-09 15:14:23 -05:00
Tim Donohue
03703a69c5 Merge pull request #4114 from DSpace/dependabot/npm_and_yarn/dspace-8_x/isbot-5.1.25
Bump isbot from 5.1.22 to 5.1.25
2025-04-09 12:32:05 -05:00
Tim Donohue
442668d866 Merge pull request #4144 from DSpace/backport-4075-to-dspace-8_x
[Port dspace-8_x] Adding missing french labels
2025-04-09 09:36:13 -05:00
Pierre Lasou
42b3773919 Fix lint errors
(cherry picked from commit c2b702427c)
2025-04-09 14:35:04 +00:00
Pierre Lasou
4670496695 Adding missing french labels
Addition of french translations for Duplicate detection, ROR and Advanced search features.

(cherry picked from commit 9b7ccd9dfe)
2025-04-09 14:35:04 +00:00
dependabot[bot]
1b2a0e19ad Bump sass from 1.84.0 to 1.85.1 in the sass group across 1 directory
Bumps the sass group with 1 update in the / directory: [sass](https://github.com/sass/dart-sass).


Updates `sass` from 1.84.0 to 1.85.1
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.84.0...1.85.1)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: sass
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-07 02:50:27 +00:00
dependabot[bot]
8b82bb5a7a Bump webpack from 5.97.1 to 5.98.0 in the webpack group
Bumps the webpack group with 1 update: [webpack](https://github.com/webpack/webpack).


Updates `webpack` from 5.97.1 to 5.98.0
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.97.1...v5.98.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: webpack
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-07 02:50:22 +00:00
Tim Donohue
7099d42767 Merge pull request #4130 from tdonohue/add_release_notes_8x
[Port dspace-8_x] Add note with link to Release Notes on homepage
2025-04-04 11:40:16 -05:00
Tim Donohue
1ea30ecb0a Add note with link to Release Notes on homepage 2025-04-04 11:08:52 -05:00
Tim Donohue
8ad50df607 Merge pull request #3982 from atmire/no-platform-specific-code-in-abstract-services-8_x
No platform specific code in abstract services 8_x
2025-04-03 12:10:40 -05:00
abhinav
0b28789e4f 129621: Add a not empty check
This check is present in the other event handlers above so adding it here as well.
2025-03-27 19:16:40 +01:00
lotte
f3065bcbfc 129694: PoC #4099 solution with resolvers 2025-03-26 18:11:17 +01:00
dependabot[bot]
e5f41d9a31 Bump isbot from 5.1.22 to 5.1.25
Bumps [isbot](https://github.com/omrilotan/isbot) from 5.1.22 to 5.1.25.
- [Changelog](https://github.com/omrilotan/isbot/blob/main/CHANGELOG.md)
- [Commits](https://github.com/omrilotan/isbot/compare/v5.1.22...v5.1.25)

---
updated-dependencies:
- dependency-name: isbot
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 03:02:53 +00:00
dependabot[bot]
edac96a064 Bump axios from 1.7.9 to 1.8.4
Bumps [axios](https://github.com/axios/axios) from 1.7.9 to 1.8.4.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.7.9...v1.8.4)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 03:02:29 +00:00
Tim Donohue
70e6e515a2 Merge pull request #4037 from amgciadev/port-10053-b
[Port dspace-8_x] #10053: Add support for PCI Endorsement workflow
2025-03-17 10:46:16 -05:00
Andreas Awouters
a8ac4f21ba Merge branch 'accessibility-settings-7.6' into accessibility-settings-8_x
# Conflicts:
#	src/app/accessibility/accessibility-settings.service.ts
2025-03-07 13:16:36 +01:00
DSpace Bot
682fd99ebb [Port dspace-8_x] remove custom theme dependency in base component SuggestionListElementComponent (#4059)
* remove custom theme dependency

(cherry picked from commit 0c63c1720e)

* remove custom theme component

(cherry picked from commit 469164f00b)

* remove obsolete constructor

(cherry picked from commit b54638c863)

* fix lint error

(cherry picked from commit b0407fecc0)

* fix lint error

(cherry picked from commit c6d83ec600)

---------

Co-authored-by: Sascha Szott <szott@gmx.de>
2025-03-06 11:21:39 -06:00
Tim Donohue
c20526aa8b Merge pull request #4036 from alanorth/8x-citation-doi-tag
[Port dspace-8_x] Add citation_doi tag to head meta
2025-03-06 10:12:32 -06:00
Alan Orth
9633fa875c Merge pull request #4054 from DSpace/backport-3957-to-dspace-8_x
[Port dspace-8_x] fixed deprecated import of TransferState
2025-03-06 08:54:08 +03:00
Sascha Szott
08ec6e000e fixed deprecated import of TransferState
(cherry picked from commit 4d85639f31)
2025-03-06 05:23:53 +00:00
Alan Orth
be3e6ef7bd src/app/core: remove unnecessary comment
Remove commented out this.setCitationDOITag() since it is not used
and we use camel case with this.setCitationDoiTag() now anyway.
2025-03-05 17:00:39 +03:00
Alan Orth
c0402bd540 src/app/core: add citation_doi tag to head meta
This is used by harvesters like Altmetric and was present in DSpace
version 6 and previous.
2025-03-05 17:00:38 +03:00
dependabot[bot]
a5357c7083 Bump core-js from 3.40.0 to 3.41.0
Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.40.0 to 3.41.0.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/commits/v3.41.0/packages/core-js)

---
updated-dependencies:
- dependency-name: core-js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-03 02:34:46 +00:00
Agustina Martinez
1b0e9927a8 Change label quality-assurance.event.table.event.message.serviceUrl to generic "Actor" 2025-02-27 13:36:16 +00:00
Agustina Martinez
a1037d8b0e Port #10053: Notify PCI endorsement support (DSpace 8.x) 2025-02-26 08:32:22 +00:00
Tim Donohue
e2bea80d3f Merge pull request #4032 from DSpace/backport-4020-to-dspace-8_x
[Port dspace-8_x] Changes to fr.json5 following version 8.1
2025-02-24 15:07:26 -06:00
Pierre Lasou
3364e6e2cb Addtion to the fr.json5 following version 8.1
Adding and changing parameters after upgrading to 8.1.

(cherry picked from commit 0437ec4c3f)
2025-02-24 21:06:54 +00:00
dependabot[bot]
44f28ecf43 Bump rxjs from 7.8.1 to 7.8.2
Bumps [rxjs](https://github.com/reactivex/rxjs) from 7.8.1 to 7.8.2.
- [Release notes](https://github.com/reactivex/rxjs/releases)
- [Changelog](https://github.com/ReactiveX/rxjs/blob/7.8.2/CHANGELOG.md)
- [Commits](https://github.com/reactivex/rxjs/compare/7.8.1...7.8.2)

---
updated-dependencies:
- dependency-name: rxjs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 02:21:03 +00:00
Andreas Awouters
957d4bc770 119602: Fix tests after merge 2025-02-21 13:58:54 +01:00
Andreas Awouters
a5f68a3626 Merge branch 'dspace-8_x' into accessibility-settings-8_x 2025-02-21 13:40:53 +01:00
Andreas Awouters
da5a4f3a0d Merge branch 'accessibility-settings-7.6' into accessibility-settings-8_x
# Conflicts:
#	src/app/accessibility/accessibility-settings.service.spec.ts
#	src/app/accessibility/accessibility-settings.service.ts
#	src/app/info/accessibility-settings/accessibility-settings.component.spec.ts
#	src/app/info/accessibility-settings/accessibility-settings.component.ts
#	src/app/shared/cookies/klaro-configuration.ts
2025-02-21 13:38:29 +01:00
dependabot[bot]
bb6ddcbeab Bump compression from 1.7.5 to 1.8.0
Bumps [compression](https://github.com/expressjs/compression) from 1.7.5 to 1.8.0.
- [Release notes](https://github.com/expressjs/compression/releases)
- [Changelog](https://github.com/expressjs/compression/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/compression/compare/1.7.5...1.8.0)

---
updated-dependencies:
- dependency-name: compression
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 02:21:14 +00:00
Tim Donohue
8f7e9aac5b Merge pull request #3673 from Peredwel/patch-1
Update fr.json5
2025-02-14 10:29:04 -06:00
Tim Donohue
3908253fca Merge pull request #3991 from DSpace/backport-3960-to-dspace-8_x
[Port dspace-8_x] Update fr.json5 to add identifiers deposit's step translations in french
2025-02-14 10:25:57 -06:00
Carolyn Sullivan
e32d9feaf5 Update fr.json5
Ajouté les corrections faites par Pierre Lasou :)
2025-02-14 09:53:21 -05:00
Pierre Lasou
b2af22014d Update fr.json5
(cherry picked from commit f721028d81)
2025-02-14 14:43:44 +00:00
Andreas Awouters
dc8590a69a Merge branch 'no-platform-specific-code-in-abstract-services-7.6' into dspace-8_x
# Conflicts:
#	src/app/core/auth/auth.service.ts
#	src/app/core/auth/server-auth.service.ts
#	src/app/core/services/cookie.service.ts
#	src/app/core/services/server-cookie.service.ts
2025-02-13 14:29:32 +01:00
Tim Donohue
e898216844 Merge pull request #3977 from DSpace/backport-3976-to-dspace-8_x
[Port dspace-8_x] Added missing line to enable access to Content Reports
2025-02-11 16:19:45 -06:00
Jean-François Morin
3d9774a86a Added missing line for Content Reports section
(cherry picked from commit a33afbef2b)
2025-02-11 20:19:24 +00:00
Tim Donohue
72e0f48267 Merge pull request #3971 from DSpace/dependabot/npm_and_yarn/dspace-8_x/sass-fd5fd03206
Bump sass from 1.83.4 to 1.84.0 in the sass group
2025-02-10 15:36:52 -06:00
Tim Donohue
733cbb4a27 Merge pull request #3902 from DSpace/dependabot/npm_and_yarn/dspace-8_x/babel/runtime-7.26.7
Bump @babel/runtime from 7.26.0 to 7.26.7
2025-02-10 15:24:41 -06:00
Tim Donohue
3555dccdfd Merge pull request #3901 from DSpace/dependabot/npm_and_yarn/dspace-8_x/eslint-82f73a5bca
Bump eslint-plugin-jsonc from 2.18.2 to 2.19.1 in the eslint group
2025-02-10 12:08:54 -06:00
Tim Donohue
6a5d7afcbf Merge pull request #3944 from DSpace/dependabot/npm_and_yarn/dspace-8_x/types/lodash-4.17.15
Bump @types/lodash from 4.17.14 to 4.17.15
2025-02-10 09:38:37 -06:00
Tim Donohue
e90759d74b Merge pull request #3945 from DSpace/dependabot/npm_and_yarn/dspace-8_x/isbot-5.1.22
Bump isbot from 5.1.21 to 5.1.22
2025-02-10 09:36:10 -06:00
Tim Donohue
fa6120c42f Merge pull request #3943 from DSpace/dependabot/npm_and_yarn/dspace-8_x/testing-206d00ed14
Bump cypress-axe from 1.5.0 to 1.6.0 in the testing group
2025-02-10 09:34:00 -06:00
dependabot[bot]
7d046d404c Bump sass from 1.83.4 to 1.84.0 in the sass group
Bumps the sass group with 1 update: [sass](https://github.com/sass/dart-sass).


Updates `sass` from 1.83.4 to 1.84.0
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.83.4...1.84.0)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: sass
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 03:12:07 +00:00
dependabot[bot]
cd810c52e9 Bump eslint-plugin-jsonc from 2.18.2 to 2.19.1 in the eslint group
Bumps the eslint group with 1 update: [eslint-plugin-jsonc](https://github.com/ota-meshi/eslint-plugin-jsonc).


Updates `eslint-plugin-jsonc` from 2.18.2 to 2.19.1
- [Release notes](https://github.com/ota-meshi/eslint-plugin-jsonc/releases)
- [Changelog](https://github.com/ota-meshi/eslint-plugin-jsonc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ota-meshi/eslint-plugin-jsonc/compare/v2.18.2...v2.19.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsonc
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: eslint
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 03:11:43 +00:00
dependabot[bot]
4430d48452 Bump cypress-axe from 1.5.0 to 1.6.0 in the testing group
Bumps the testing group with 1 update: [cypress-axe](https://github.com/component-driven/cypress-axe).


Updates `cypress-axe` from 1.5.0 to 1.6.0
- [Release notes](https://github.com/component-driven/cypress-axe/releases)
- [Commits](https://github.com/component-driven/cypress-axe/compare/v1.5.0...v1.6.0)

---
updated-dependencies:
- dependency-name: cypress-axe
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: testing
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 03:11:41 +00:00
Tim Donohue
0d39406f60 Merge tag 'dspace-7.6.3' into dspace-8_x 2025-02-07 14:06:56 -06:00
Tim Donohue
7949330071 Update version tag for development of next release 2025-02-07 12:24:44 -06:00
dependabot[bot]
5b3c7cec88 Bump isbot from 5.1.21 to 5.1.22
Bumps [isbot](https://github.com/omrilotan/isbot) from 5.1.21 to 5.1.22.
- [Changelog](https://github.com/omrilotan/isbot/blob/main/CHANGELOG.md)
- [Commits](https://github.com/omrilotan/isbot/compare/v5.1.21...v5.1.22)

---
updated-dependencies:
- dependency-name: isbot
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-03 03:11:28 +00:00
dependabot[bot]
b8fcc27504 Bump @types/lodash from 4.17.14 to 4.17.15
Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.17.14 to 4.17.15.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash)

---
updated-dependencies:
- dependency-name: "@types/lodash"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-03 03:10:53 +00:00
dependabot[bot]
cfcbef2ec1 Bump @babel/runtime from 7.26.0 to 7.26.7
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.26.0 to 7.26.7.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.26.7/packages/babel-runtime)

---
updated-dependencies:
- dependency-name: "@babel/runtime"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-27 02:32:59 +00:00
Andreas Awouters
f4fb0b312d Merge remote-tracking branch 'dspace/dspace-8_x' into accessibility-settings-8_x
# Conflicts:
#	src/app/profile-page/profile-page.component.html
#	src/app/profile-page/profile-page.component.ts
#	src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts
#	src/app/shared/notifications/notifications-board/notifications-board.component.ts
#	src/themes/custom/app/profile-page/profile-page.component.ts
2025-01-23 09:38:01 +01:00
Andreas Awouters
9052509fd2 Merge branch 'accessibility-settings-7.6' into accessibility-settings-8_x
# Conflicts:
#	src/app/accessibility/accessibility-settings.service.spec.ts
2025-01-22 16:08:24 +01:00
Andreas Awouters
64fa1e455e Merge branch 'w2p-122839_vocabulary-preloadlevel-fix' into vocabulary-preloadlevel-fix-8_x
# Conflicts:
#	src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts
#	src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts
2025-01-02 16:16:49 +01:00
Andreas Awouters
4ffde928d4 122839: Fix vocabulary-treeview component tests 2025-01-02 14:42:17 +01:00
Andreas Awouters
9406f7b085 122839: Retrieve preloadLevel from vocabulary before creating tree 2025-01-02 12:04:40 +01:00
Andreas Awouters
cee9d0422b 122839: Load nodes up to defined preloadLevel 2024-12-24 15:17:27 +01:00
Andreas Awouters
fe4dcf0b24 Merge branch 'accessibility-settings-7.6' into accessibility-settings-8_x
# Conflicts:
#	src/app/accessibility/accessibility-settings.service.spec.ts
#	src/app/accessibility/accessibility-settings.service.ts
#	src/app/info/accessibility-settings/accessibility-settings.component.spec.ts
#	src/app/info/accessibility-settings/accessibility-settings.component.ts
#	src/app/info/info.module.ts
#	src/app/shared/live-region/live-region.service.ts
#	src/app/shared/notifications/notifications-board/notifications-board.component.ts
2024-12-11 10:35:25 +01:00
Carolyn Sullivan
477ca5e712 Update fr.json5
Ajouté des traductions/noté quelques étiquettes sans traductions
2024-11-18 15:21:25 -05:00
Andreas Awouters
6319c9b300 Merge branch 'accessibility-settings-7.6' into accessibility-settings-8_x
# Conflicts:
#	src/app/core/auth/auth.service.ts
#	src/app/info/info-routing-paths.ts
#	src/app/info/info-routing.module.ts
#	src/app/info/info.module.ts
#	src/app/shared/live-region/live-region.service.spec.ts
#	src/app/shared/live-region/live-region.service.ts
#	src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts
#	src/app/shared/notifications/notifications-board/notifications-board.component.ts
#	src/config/app-config.interface.ts
#	src/config/default-app-config.ts
2024-11-06 13:11:17 +01:00
2273 changed files with 44168 additions and 90381 deletions

View File

@@ -25,6 +25,4 @@ npm-debug.log.*
# Webpack files
webpack.records.json
# Yarn no longer used
yarn.lock
package-lock.json

View File

@@ -15,10 +15,6 @@ trim_trailing_whitespace = false
[*.ts]
quote_type = single
ij_typescript_enforce_trailing_comma = whenmultiline
[*.js]
ij_javascript_enforce_trailing_comma = whenmultiline
[*.json5]
ij_json_keep_blank_lines_in_code = 3

View File

@@ -160,9 +160,6 @@
]
}
],
"@angular-eslint/prefer-standalone": [
"error"
],
"@angular-eslint/no-attribute-decorator": "error",
"@angular-eslint/no-output-native": "warn",
"@angular-eslint/no-output-on-prefix": "warn",
@@ -263,48 +260,9 @@
"rxjs/no-nested-subscribe": "off", // todo: go over _all_ cases
// Custom DSpace Angular rules
"dspace-angular-ts/alias-imports": [
"error",
{
"aliases": [
{
"package": "rxjs",
"imported": "of",
"local": "of"
}
]
}
],
"dspace-angular-ts/themed-component-classes": "error",
"dspace-angular-ts/themed-component-selectors": "error",
"dspace-angular-ts/themed-component-usages": "error",
"dspace-angular-ts/themed-decorators": [
"off",
{
"decorators": {
"listableObjectComponent": 3,
"rendersSectionForMenu": 2
}
}
],
"dspace-angular-ts/themed-wrapper-no-input-defaults": "error",
"dspace-angular-ts/unique-decorators": [
"off",
{
"decorators": [
"listableObjectComponent"
]
}
],
"dspace-angular-ts/sort-standalone-imports": [
"error",
{
"locale": "en-US",
"maxItems": 0,
"indent": 2,
"trailingComma": true
}
]
"dspace-angular-ts/themed-component-usages": "error"
}
},
{
@@ -335,8 +293,7 @@
"rules": {
// Custom DSpace Angular rules
"dspace-angular-html/themed-component-usages": "error",
"dspace-angular-html/no-disabled-attribute-on-button": "error",
"@angular-eslint/template/prefer-control-flow": "error"
"dspace-angular-html/no-disabled-attribute-on-button": "error"
}
},
{

View File

@@ -7,16 +7,16 @@ assignees: ''
---
## Describe the bug
**Describe the bug**
A clear and concise description of what the bug is. Include the version(s) of DSpace where you've seen this problem & what *web browser* you were using. Link to examples if they are public.
## To Reproduce
**To Reproduce**
Steps to reproduce the behavior:
1. Do this
2. Then this...
## Expected behavior
**Expected behavior**
A clear and concise description of what you expected to happen.
## Related work
**Related work**
Link to any related tickets or PRs here.

View File

@@ -7,14 +7,14 @@ assignees: ''
---
## Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem or use case is. For example, I'm always frustrated when [...]
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
## Describe the solution you'd like
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
## Describe alternatives or workarounds you've considered
**Describe alternatives or workarounds you've considered**
A clear and concise description of any alternative solutions or features you've considered.
## Additional information
Add any other information, related tickets or screenshots about the feature request here.
**Additional context**
Add any other context or screenshots about the feature request here.

298
.github/dependabot.yml vendored
View File

@@ -1,298 +0,0 @@
#-------------------
# DSpace's dependabot rules. Enables npm updates for all dependencies on a weekly basis
# for main and any maintenance branches. Security updates only apply to main.
#-------------------
version: 2
updates:
###############
## Main branch
###############
# NOTE: At this time, "security-updates" rules only apply if "target-branch" is unspecified
# So, only this first section can include "applies-to: security-updates"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
# Allow up to 10 open PRs for dependencies
open-pull-requests-limit: 10
# Group together Angular package upgrades
groups:
# Group together all minor/patch version updates for Angular in a single PR
angular:
applies-to: version-updates
patterns:
- "@angular*"
update-types:
- "minor"
- "patch"
# Group together all security updates for Angular. Only accept minor/patch types.
angular-security:
applies-to: security-updates
patterns:
- "@angular*"
update-types:
- "minor"
- "patch"
# Group together all minor/patch version updates for NgRx in a single PR
ngrx:
applies-to: version-updates
patterns:
- "@ngrx*"
update-types:
- "minor"
- "patch"
# Group together all security updates for NgRx. Only accept minor/patch types.
ngrx-security:
applies-to: security-updates
patterns:
- "@ngrx*"
update-types:
- "minor"
- "patch"
# Group together all patch version updates for eslint in a single PR
eslint:
applies-to: version-updates
patterns:
- "@typescript-eslint*"
- "eslint*"
update-types:
- "minor"
- "patch"
# Group together all security updates for eslint.
eslint-security:
applies-to: security-updates
patterns:
- "@typescript-eslint*"
- "eslint*"
update-types:
- "minor"
- "patch"
# Group together any testing related version updates
testing:
applies-to: version-updates
patterns:
- "@cypress*"
- "axe-*"
- "cypress*"
- "jasmine*"
- "karma*"
- "ng-mocks"
update-types:
- "minor"
- "patch"
# Group together any testing related security updates
testing-security:
applies-to: security-updates
patterns:
- "@cypress*"
- "axe-*"
- "cypress*"
- "jasmine*"
- "karma*"
- "ng-mocks"
update-types:
- "minor"
- "patch"
# Group together any postcss related version updates
postcss:
applies-to: version-updates
patterns:
- "postcss*"
update-types:
- "minor"
- "patch"
# Group together any postcss related security updates
postcss-security:
applies-to: security-updates
patterns:
- "postcss*"
update-types:
- "minor"
- "patch"
# Group together any sass related version updates
sass:
applies-to: version-updates
patterns:
- "sass*"
update-types:
- "minor"
- "patch"
# Group together any sass related security updates
sass-security:
applies-to: security-updates
patterns:
- "sass*"
update-types:
- "minor"
- "patch"
# Group together any webpack related version updates
webpack:
applies-to: version-updates
patterns:
- "webpack*"
update-types:
- "minor"
- "patch"
# Group together any webpack related seurity updates
webpack-security:
applies-to: security-updates
patterns:
- "webpack*"
update-types:
- "minor"
- "patch"
ignore:
# Ignore all major version updates for all dependencies. We'll only automate minor/patch updates.
- dependency-name: "*"
update-types: ["version-update:semver-major"]
#####################
## dspace-8_x branch
#####################
- package-ecosystem: "npm"
directory: "/"
target-branch: dspace-8_x
schedule:
interval: "weekly"
# Allow up to 10 open PRs for dependencies
open-pull-requests-limit: 10
# Group together Angular package upgrades
groups:
# Group together all patch version updates for Angular in a single PR
angular:
applies-to: version-updates
patterns:
- "@angular*"
update-types:
- "minor"
- "patch"
# Group together all minor/patch version updates for NgRx in a single PR
ngrx:
applies-to: version-updates
patterns:
- "@ngrx*"
update-types:
- "minor"
- "patch"
# Group together all patch version updates for eslint in a single PR
eslint:
applies-to: version-updates
patterns:
- "@typescript-eslint*"
- "eslint*"
update-types:
- "minor"
- "patch"
# Group together any testing related version updates
testing:
applies-to: version-updates
patterns:
- "@cypress*"
- "axe-*"
- "cypress*"
- "jasmine*"
- "karma*"
- "ng-mocks"
update-types:
- "minor"
- "patch"
# Group together any postcss related version updates
postcss:
applies-to: version-updates
patterns:
- "postcss*"
update-types:
- "minor"
- "patch"
# Group together any sass related version updates
sass:
applies-to: version-updates
patterns:
- "sass*"
update-types:
- "minor"
- "patch"
# Group together any webpack related version updates
webpack:
applies-to: version-updates
patterns:
- "webpack*"
update-types:
- "minor"
- "patch"
ignore:
# Ignore all major version updates for all dependencies. We'll only automate minor/patch updates.
- dependency-name: "*"
update-types: ["version-update:semver-major"]
#####################
## dspace-7_x branch
#####################
- package-ecosystem: "npm"
directory: "/"
target-branch: dspace-7_x
schedule:
interval: "weekly"
# Allow up to 10 open PRs for dependencies
open-pull-requests-limit: 10
# Group together Angular package upgrades
groups:
# Group together all minor/patch version updates for Angular in a single PR
angular:
applies-to: version-updates
patterns:
- "@angular*"
update-types:
- "minor"
- "patch"
# Group together all minor/patch version updates for NgRx in a single PR
ngrx:
applies-to: version-updates
patterns:
- "@ngrx*"
update-types:
- "minor"
- "patch"
# Group together all patch version updates for eslint in a single PR
eslint:
applies-to: version-updates
patterns:
- "@typescript-eslint*"
- "eslint*"
update-types:
- "minor"
- "patch"
# Group together any testing related version updates
testing:
applies-to: version-updates
patterns:
- "@cypress*"
- "axe-*"
- "cypress*"
- "jasmine*"
- "karma*"
- "ng-mocks"
update-types:
- "minor"
- "patch"
# Group together any postcss related version updates
postcss:
applies-to: version-updates
patterns:
- "postcss*"
update-types:
- "minor"
- "patch"
# Group together any sass related version updates
sass:
applies-to: version-updates
patterns:
- "sass*"
update-types:
- "minor"
- "patch"
ignore:
# 7.x Cannot update Webpack past v5.76.1 as later versions not supported by Angular 15
# See also https://github.com/DSpace/dspace-angular/pull/3283#issuecomment-2372488489
- dependency-name: "webpack"
# Ignore all major version updates for all dependencies. We'll only automate minor/patch updates.
- dependency-name: "*"
update-types: ["version-update:semver-major"]

View File

@@ -1,7 +1,7 @@
## References
_Add references/links to any related issues or PRs. These may include:_
* Fixes #issue-number (if this fixes an issue ticket)
* Requires DSpace/DSpace#pr-number (if a REST API PR is required to test this)
* Fixes #`issue-number` (if this fixes an issue ticket)
* Requires DSpace/DSpace#`pr-number` (if a REST API PR is required to test this)
## Description
Short summary of changes (1-2 sentences).
@@ -16,18 +16,13 @@ List of changes in this PR:
**Include guidance for how to test or review your PR.** This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.
## Checklist
_This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!_
_This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!_
- [ ] My PR is **created against the `main` branch** of code (unless it is a backport or is fixing an issue specific to an older branch).
- [ ] My PR is **small in size** (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
- [ ] My PR **passes [ESLint](https://eslint.org/)** validation using `npm run lint`
- [ ] My PR **doesn't introduce circular dependencies** (verified via `npm run check-circ-deps`)
- [ ] My PR **includes [TypeDoc](https://typedoc.org/) comments** for _all new (or modified) public methods and classes_. It also includes TypeDoc for large or complex private methods.
- [ ] My PR **passes all specs/tests and includes new/updated specs or tests** based on the [Code Testing Guide](https://wiki.lyrasis.org/display/DSPACE/Code+Testing+Guide).
- [ ] My PR **aligns with [Accessibility guidelines](https://wiki.lyrasis.org/display/DSDOC8x/Accessibility)** if it makes changes to the user interface.
- [ ] My PR **uses i18n (internationalization) keys** instead of hardcoded English text, to allow for translations.
- [ ] My PR **includes details on how to test it**. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
- [ ] My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
- [ ] My PR passes [ESLint](https://eslint.org/) validation using `yarn lint`
- [ ] My PR doesn't introduce circular dependencies (verified via `yarn check-circ-deps`)
- [ ] My PR includes [TypeDoc](https://typedoc.org/) comments for _all new (or modified) public methods and classes_. It also includes TypeDoc for large or complex private methods.
- [ ] My PR passes all specs/tests and includes new/updated specs or tests based on the [Code Testing Guide](https://wiki.lyrasis.org/display/DSPACE/Code+Testing+Guide).
- [ ] If my PR includes new libraries/dependencies (in `package.json`), I've made sure their licenses align with the [DSpace BSD License](https://github.com/DSpace/DSpace/blob/main/LICENSE) based on the [Licensing of Contributions](https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines#CodeContributionGuidelines-LicensingofContributions) documentation.
- [ ] If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
- [ ] If my PR fixes an issue ticket, I've [linked them together](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).

View File

@@ -75,39 +75,39 @@ jobs:
fi
google-chrome --version
# https://github.com/actions/cache/blob/main/examples.md#node---npm
- name: Get NPM cache directory
id: npm-cache-dir
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- name: Cache NPM dependencies
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Get Yarn cache directory
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache Yarn dependencies
uses: actions/cache@v4
with:
# Cache entire NPM cache directory (see previous step)
path: ${{ steps.npm-cache-dir.outputs.dir }}
# Cache key is hash of package-lock.json. Therefore changes to package-lock.json will invalidate cache
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-
# Cache entire Yarn cache directory (see previous step)
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# Cache key is hash of yarn.lock. Therefore changes to yarn.lock will invalidate cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Install NPM dependencies
run: npm clean-install
- name: Install Yarn dependencies
run: yarn install --frozen-lockfile
- name: Build lint plugins
run: npm run build:lint
run: yarn run build:lint
- name: Run lint plugin tests
run: npm run test:lint:nobuild
run: yarn run test:lint:nobuild
- name: Run lint
run: npm run lint:nobuild -- --quiet
run: yarn run lint:nobuild --quiet
- name: Check for circular dependencies
run: npm run check-circ-deps
run: yarn run check-circ-deps
- name: Run build
run: npm run build:prod
run: yarn run build:prod
- name: Run specs (unit tests)
run: npm run test:headless
run: yarn run test:headless
# Upload code coverage report to artifact (for one version of Node only),
# so that it can be shared with the 'codecov' job (see below)
@@ -145,7 +145,7 @@ jobs:
# Run tests in Chrome, headless mode (default)
browser: chrome
# Start app before running tests (will be stopped automatically after tests finish)
start: npm run serve:ssr
start: yarn run serve:ssr
# Wait for backend & frontend to be available
# NOTE: We use the 'sites' REST endpoint to also ensure the database is ready
wait-on: http://127.0.0.1:8080/server/api/core/sites, http://127.0.0.1:4000
@@ -181,7 +181,7 @@ jobs:
# Start up the app with SSR enabled (run in background)
- name: Start app in SSR (server-side rendering) mode
run: |
nohup npm run serve:ssr &
nohup yarn run serve:ssr &
printf 'Waiting for app to start'
until curl --output /dev/null --silent --head --fail http://127.0.0.1:4000/home; do
printf '.'

4
.gitignore vendored
View File

@@ -28,12 +28,12 @@ webpack.records.json
morgan.log
# Yarn no longer used
yarn.lock
yarn-error.log
*.css
package-lock.json
.java-version
.env

View File

@@ -10,7 +10,7 @@ DSpace is a community built and supported project. We do not have a centralized
## Contribute new code via a Pull Request
We accept [GitHub Pull Requests (PRs)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) at any time from anyone.
Contributors to each release are recognized in our [Release Notes](https://wiki.lyrasis.org/display/DSDOC8x/Release+Notes).
Contributors to each release are recognized in our [Release Notes](https://wiki.lyrasis.org/display/DSDOC7x/Release+Notes).
Code Contribution Checklist
- [ ] PRs _should_ be smaller in size (ideally less than 1,000 lines of code, not including comments & tests)
@@ -18,9 +18,6 @@ Code Contribution Checklist
- [ ] PRs **must** not introduce circular dependencies (verified via `yarn check-circ-deps`)
- [ ] PRs **must** include [TypeDoc](https://typedoc.org/) comments for _all new (or modified) public methods and classes_. Large or complex private methods should also have TypeDoc.
- [ ] PRs **must** pass all automated pecs/tests and includes new/updated specs or tests based on the [Code Testing Guide](https://wiki.lyrasis.org/display/DSPACE/Code+Testing+Guide).
- [ ] User interface changes **must** align with [Accessibility guidelines](https://wiki.lyrasis.org/display/DSDOC8x/Accessibility)
- [ ] PRs **must** use i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
- [ ] Details on how to test the PR **must** be provided. Reviewers must be aware of any steps they need to take to successfully test your fix or feature.
- [ ] If a PR includes new libraries/dependencies (in `package.json`), then their software licenses **must** align with the [DSpace BSD License](https://github.com/DSpace/dspace-angular/blob/main/LICENSE) based on the [Licensing of Contributions](https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines#CodeContributionGuidelines-LicensingofContributions) documentation.
- [ ] Basic technical documentation _should_ be provided for any new features or configuration, either in the PR itself or in the DSpace Wiki documentation.
- [ ] If a PR fixes an issue ticket, please [link them together](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).
@@ -29,7 +26,7 @@ Additional details on the code contribution process can be found in our [Code Co
## Contribute documentation
DSpace Documentation is a collaborative effort in a shared Wiki. The latest documentation is at https://wiki.lyrasis.org/display/DSDOC
DSpace Documentation is a collaborative effort in a shared Wiki. The latest documentation is at https://wiki.lyrasis.org/display/DSDOC7x
If you find areas of the DSpace Documentation which you wish to improve, please request a Wiki account by emailing wikihelp@lyrasis.org.
Once you have an account setup, contact @tdonohue (via [Slack](https://wiki.lyrasis.org/display/DSPACE/Slack) or email) for access to edit our Documentation.
@@ -37,7 +34,7 @@ Once you have an account setup, contact @tdonohue (via [Slack](https://wiki.lyra
## Help others on mailing lists or Slack
DSpace has our own [Slack](https://wiki.lyrasis.org/display/DSPACE/Slack) community and [Mailing Lists](https://wiki.lyrasis.org/display/DSPACE/Mailing+Lists) where discussions take place and questions are answered.
Anyone is welcome to join and help others. We just ask you to follow our [Code of Conduct](https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx) (adopted via Lyrasis).
Anyone is welcome to join and help others. We just ask you to follow our [Code of Conduct](https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx) (adopted via LYRASIS).
## Join a working or interest group
@@ -45,5 +42,5 @@ Most of the work in building/improving DSpace comes via [Working Groups](https:/
All working/interest groups are open to anyone to join and participate. A few key groups to be aware of include:
* [DSpace Developer Team](https://wiki.lyrasis.org/display/DSPACE/Developer+Meetings) - This is the primary, volunteer development team. We meet weekly to review our current development [project board](https://github.com/orgs/DSpace/projects), assigning tickets and/or PRs. This is also were discussions of the next release or major issues occur. Anyone is welcome to attend.
* [DSpace Community Advisory Team (DCAT)](https://wiki.lyrasis.org/display/cmtygp/DSpace+Community+Advisory+Team) - This is an interest group for repository managers/administrators. We meet monthly to discuss DSpace, share tips & provide feedback back to developers. Anyone is welcome to attend.
* [DSpace 7 Working Group](https://wiki.lyrasis.org/display/DSPACE/DSpace+7+Working+Group) - This is the main (mostly volunteer) development team. We meet weekly to review our current development [project board](https://github.com/orgs/DSpace/projects), assigning tickets and/or PRs.
* [DSpace Community Advisory Team (DCAT)](https://wiki.lyrasis.org/display/cmtygp/DSpace+Community+Advisory+Team) - This is an interest group for repository managers/administrators. We meet monthly to discuss DSpace, share tips & provide feedback back to developers.

View File

@@ -11,7 +11,9 @@ WORKDIR /app
ADD . /app/
EXPOSE 4000
RUN npm install
# We run yarn install with an increased network timeout (5min) to avoid "ESOCKETTIMEDOUT" errors from hub.docker.com
# See, for example https://github.com/yarnpkg/yarn/issues/5540
RUN yarn install --network-timeout 300000
# When running in dev mode, 4GB of memory is required to build & launch the app.
# This default setting can be overridden as needed in your shell, via an env file or in docker-compose.
@@ -23,4 +25,4 @@ ENV NODE_OPTIONS="--max_old_space_size=4096"
# NOTE: At this time it is only possible to run Docker container in Production mode
# if you have a public URL. See https://github.com/DSpace/dspace-angular/issues/1485
ENV NODE_ENV=development
CMD npm run serve -- --host 0.0.0.0
CMD yarn serve --host 0.0.0.0

View File

@@ -2,7 +2,7 @@
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details
# Test build:
# docker build -f Dockerfile.dist -t dspace/dspace-angular:latest-dist .
# docker build -f Dockerfile.dist -t dspace/dspace-angular:dspace-8_x-dist .
FROM docker.io/node:18-alpine AS build
@@ -11,11 +11,11 @@ FROM docker.io/node:18-alpine AS build
RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/*
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY package.json yarn.lock ./
RUN yarn install --network-timeout 300000
ADD . /app/
RUN npm run build:prod
RUN yarn build:prod
FROM node:18-alpine
RUN npm install --global pm2

View File

@@ -35,7 +35,7 @@ https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace
Quick start
-----------
**Ensure you're running [Node](https://nodejs.org) `v18.x` or `v20.x`, [npm](https://www.npmjs.com/) >= `v10.x`**
**Ensure you're running [Node](https://nodejs.org) `v18.x` or `v20.x`, [npm](https://www.npmjs.com/) >= `v10.x` and [yarn](https://yarnpkg.com) == `v1.x`**
```bash
# clone the repo
@@ -45,10 +45,10 @@ git clone https://github.com/DSpace/dspace-angular.git
cd dspace-angular
# install the local dependencies
npm install
yarn install
# start the server
npm start
yarn start
```
Then go to [http://localhost:4000](http://localhost:4000) in your browser
@@ -77,7 +77,7 @@ Table of Contents
- [Recommended Editors/IDEs](#recommended-editorsides)
- [Collaborating](#collaborating)
- [File Structure](#file-structure)
- [Managing Dependencies (via npm)](#managing-dependencies-via-npm)
- [Managing Dependencies (via yarn)](#managing-dependencies-via-yarn)
- [Frequently asked questions](#frequently-asked-questions)
- [License](#license)
@@ -89,15 +89,15 @@ You can find more information on the technologies used in this project (Angular.
Requirements
------------
- [Node.js](https://nodejs.org)
- Ensure you're running node `v18.x` or `v20.x`
- [Node.js](https://nodejs.org) and [yarn](https://yarnpkg.com)
- Ensure you're running node `v18.x` or `v20.x` and yarn == `v1.x`
If you have [`nvm`](https://github.com/creationix/nvm#install-script) or [`nvm-windows`](https://github.com/coreybutler/nvm-windows) installed, which is highly recommended, you can run `nvm install --lts && nvm use` to install and start using the latest Node LTS.
Installing
----------
- `npm install` to install the local dependencies
- `yarn install` to install the local dependencies
### Configuring
@@ -202,7 +202,7 @@ import { environment } from '../environment.ts';
Running the app
---------------
After you have installed all dependencies you can now run the app. Run `npm run start:dev` to start a local server which will watch for changes, rebuild the code, and reload the server for you. You can visit it at `http://localhost:4000`.
After you have installed all dependencies you can now run the app. Run `yarn run start:dev` to start a local server which will watch for changes, rebuild the code, and reload the server for you. You can visit it at `http://localhost:4000`.
### Running in production mode
@@ -211,20 +211,20 @@ When building for production we're using Ahead of Time (AoT) compilation. With A
To build the app for production and start the server (in one command) run:
```bash
npm start
yarn start
```
This will run the application in an instance of the Express server, which is included.
If you only want to build for production, without starting, run:
```bash
npm run build:prod
yarn run build:prod
```
This will build the application and put the result in the `dist` folder. You can copy this folder to wherever you need it for your application server. If you will be using the built-in Express server, you'll also need a copy of the `node_modules` folder tucked inside your copy of `dist`.
After building the app for production, it can be started by running:
```bash
npm run serve:ssr
yarn run serve:ssr
```
### Running the application with Docker
@@ -238,14 +238,14 @@ Cleaning
--------
```bash
# clean everything, including node_modules. You'll need to run npm install again afterwards.
npm run clean
# clean everything, including node_modules. You'll need to run yarn install again afterwards.
yarn run clean
# clean files generated by the production build (.ngfactory files, css files, etc)
npm run clean:prod
yarn run clean:prod
# cleans the distribution directory
npm run clean:dist
yarn run clean:dist
```
@@ -259,9 +259,9 @@ If you would like to contribute by testing a Pull Request (PR), here's how to do
1. Pull down the branch that the Pull Request was built from. Easy instructions for doing so can be found on the Pull Request itself.
* Next to the "Merge" button, you'll see a link that says "command line instructions".
* Click it, and follow "Step 1" of those instructions to checkout the pull down the PR branch.
2. `npm run clean` (This resets your local dependencies to ensure you are up-to-date with this PR)
3. `npm install` (Updates your local dependencies to those in the PR)
4. `npm start` (Rebuilds the project, and deploys to localhost:4000, by default)
2. `yarn run clean` (This resets your local dependencies to ensure you are up-to-date with this PR)
3. `yarn install` (Updates your local dependencies to those in the PR)
4. `yarn start` (Rebuilds the project, and deploys to localhost:4000, by default)
5. At this point, the code from the PR will be deployed to http://localhost:4000. Test it out, and ensure that it does what is described in the PR (or fixes the bug described in the ticket linked to the PR).
Once you have tested the Pull Request, please add a comment and/or approval to the PR to let us know whether you found it to be successful (or not). Thanks!
@@ -271,13 +271,13 @@ Once you have tested the Pull Request, please add a comment and/or approval to t
Unit tests use the [Jasmine test framework](https://jasmine.github.io/), and are run via [Karma](https://karma-runner.github.io/).
You can find the Karma configuration file at the same level of this README file:`./karma.conf.js` If you are going to use a remote test environment you need to edit the `./karma.conf.js`. Follow the instructions you will find inside it. To executing tests whenever any file changes you can modify the 'autoWatch' option to 'true' and 'singleRun' option to 'false'. A coverage report is also available at: http://localhost:9876/ after you run: `npm run coverage`.
You can find the Karma configuration file at the same level of this README file:`./karma.conf.js` If you are going to use a remote test environment you need to edit the `./karma.conf.js`. Follow the instructions you will find inside it. To executing tests whenever any file changes you can modify the 'autoWatch' option to 'true' and 'singleRun' option to 'false'. A coverage report is also available at: http://localhost:9876/ after you run: `yarn run coverage`.
The default browser is Google Chrome.
Place your tests in the same location of the application source code files that they test, e.g. ending with `*.component.spec.ts`
and run: `npm test`
and run: `yarn test`
If you run into odd test errors, see the Angular guide to debugging tests: https://angular.io/guide/test-debugging
@@ -330,9 +330,9 @@ All E2E tests must be created under the `./cypress/integration/` folder, and mus
* In the [Cypress Test Runner](https://docs.cypress.io/guides/core-concepts/test-runner), you'll Cypress automatically visit the page. This first test will succeed, as all you are doing is making sure the _page exists_.
* From here, you can use the [Selector Playground](https://docs.cypress.io/guides/core-concepts/test-runner#Selector-Playground) in the Cypress Test Runner window to determine how to tell Cypress to interact with a specific HTML element on that page.
* Most commands start by telling Cypress to [get()](https://docs.cypress.io/api/commands/get) a specific element, using a CSS or jQuery style selector
* It's generally best not to rely on attributes like `class` and `id` in tests, as those are likely to change later on. Instead, you can add a `data-test` attribute to makes it clear that it's required for a test.
* It's generally best not to rely on attributes like `class` and `id` in tests, as those are likely to change later on. Instead, you can add a `data-test` attribute to makes it clear that it's required for a test.
* Cypress can then do actions like [click()](https://docs.cypress.io/api/commands/click) an element, or [type()](https://docs.cypress.io/api/commands/type) text in an input field, etc.
* When running with server-side rendering enabled, the client first receives HTML without the JS; only once the page is rendered client-side do some elements (e.g. a button that toggles a Bootstrap dropdown) become fully interactive. This can trip up Cypress in some cases as it may try to `click` or `type` in an element that's not fully loaded yet, causing tests to fail.
* When running with server-side rendering enabled, the client first receives HTML without the JS; only once the page is rendered client-side do some elements (e.g. a button that toggles a Bootstrap dropdown) become fully interactive. This can trip up Cypress in some cases as it may try to `click` or `type` in an element that's not fully loaded yet, causing tests to fail.
* To work around this issue, define the attributes you use for Cypress selectors as `[attr.data-test]="'button' | ngBrowserOnly"`. This will only show the attribute in CSR HTML, forcing Cypress to wait until CSR is complete before interacting with the element.
* Cypress can also validate that something occurs, using [should()](https://docs.cypress.io/api/commands/should) assertions.
* Any time you save your test file, the Cypress Test Runner will reload & rerun it. This allows you can see your results quickly as you write the tests & correct any broken tests rapidly.
@@ -357,14 +357,14 @@ Some UI specific configuration documentation is also found in the [`./docs`](doc
To build the code documentation we use [TYPEDOC](http://typedoc.org). TYPEDOC is a documentation generator for TypeScript projects. It extracts information from properly formatted comments that can be written within the code files. Follow the instructions [here](http://typedoc.org/guides/doccomments/) to know how to make those comments.
Run:`npm run docs` to produce the documentation that will be available in the 'doc' folder.
Run:`yarn run docs` to produce the documentation that will be available in the 'doc' folder.
Other commands
--------------
There are many more commands in the `scripts` section of `package.json`. Most of these are executed by one of the commands mentioned above.
A command with a name that starts with `pre` or `post` will be executed automatically before or after the script with the matching name. e.g. if you type `npm run start` the `prestart` script will run first, then the `start` script will trigger.
A command with a name that starts with `pre` or `post` will be executed automatically before or after the script with the matching name. e.g. if you type `yarn run start` the `prestart` script will run first, then the `start` script will trigger.
Recommended Editors/IDEs
------------------------
@@ -456,7 +456,6 @@ dspace-angular
├── LICENSES_THIRD_PARTY *
├── nodemon.json * Nodemon (https://nodemon.io/) configuration
├── package.json * This file describes the npm package for this project, its dependencies, scripts, etc.
├── package-lock.json * npm lockfile (https://docs.npmjs.com/cli/v10/configuring-npm/package-lock-json)
├── postcss.config.js * PostCSS (http://postcss.org/) configuration
├── README.md * This document
├── SECURITY.md *
@@ -467,29 +466,30 @@ dspace-angular
├── tsconfig.spec.json * TypeScript config for tests
├── tsconfig.ts-node.json * TypeScript config for using ts-node directly
├── tslint.json * TSLint (https://palantir.github.io/tslint/) configuration
── typedoc.json * TYPEDOC configuration
── typedoc.json * TYPEDOC configuration
└── yarn.lock * Yarn lockfile (https://yarnpkg.com/en/docs/yarn-lock)
```
Managing Dependencies (via npm)
Managing Dependencies (via yarn)
-------------
This project makes use of [`npm`](https://docs.npmjs.com/about-npm) to ensure that the exact same dependency versions are used every time you install it.
This project makes use of [`yarn`](https://yarnpkg.com/en/) to ensure that the exact same dependency versions are used every time you install it.
* `npm` creates a [`package-lock.json`](https://docs.npmjs.com/cli/v10/configuring-npm/package-lock-json) to track those versions. That file is updated automatically by whenever dependencies are added/updated/removed via npm.
* **Adding new dependencies**: To install/add a new dependency (third party library), use [`npm install`](https://docs.npmjs.com/cli/v10/commands/npm-install). For example: `npm install some-lib`.
* If you are adding a new build tool dependency (to `devDependencies`), use `npm install some-lib --save--dev`
* **Upgrading existing dependencies**: To upgrade existing dependencies, you can use [`npm update`](https://docs.npmjs.com/cli/v10/commands/npm-update). For example: `npm update some-lib` or `npm update some-lib@version`
* **Removing dependencies**: If a dependency is no longer needed, or replaced, use [`npm uninstall`](https://docs.npmjs.com/cli/v10/commands/npm-uninstall) to remove it.
* `yarn` creates a [`yarn.lock`](https://yarnpkg.com/en/docs/yarn-lock) to track those versions. That file is updated automatically by whenever dependencies are added/updated/removed via yarn.
* **Adding new dependencies**: To install/add a new dependency (third party library), use [`yarn add`](https://yarnpkg.com/en/docs/cli/add). For example: `yarn add some-lib`.
* If you are adding a new build tool dependency (to `devDependencies`), use `yarn add some-lib --dev`
* **Upgrading existing dependencies**: To upgrade existing dependencies, you can use [`yarn upgrade`](https://yarnpkg.com/en/docs/cli/upgrade). For example: `yarn upgrade some-lib` or `yarn upgrade some-lib@version`
* **Removing dependencies**: If a dependency is no longer needed, or replaced, use [`yarn remove`](https://yarnpkg.com/en/docs/cli/remove) to remove it.
As you can see above, using `npm` commandline tools means that you should never need to modify the `package.json` manually. *We recommend always using `npm` to keep dependencies updated / in sync.*
As you can see above, using `yarn` commandline tools means that you should never need to modify the `package.json` manually. *We recommend always using `yarn` to keep dependencies updated / in sync.*
### Adding Typings for libraries
If the library does not include typings, you can install them using npm:
If the library does not include typings, you can install them using yarn:
```bash
npm install d3
npm install @types/d3 --save-dev
yarn add d3
yarn add @types/d3 --dev
```
If the library doesn't have typings available at `@types/`, you can still use it by manually adding typings for it:
@@ -527,13 +527,13 @@ Frequently asked questions
- What are the naming conventions for Angular?
- See [the official angular style guide](https://angular.io/styleguide)
- Why is the size of my app larger in development?
- The production build uses a whole host of techniques (ahead-of-time compilation, rollup to remove unreachable code, minification, etc.) to reduce the size, that aren't used during development in the interest of build speed.
- node-pre-gyp ERR in npm install (Windows)
- The production build uses a whole host of techniques (ahead-of-time compilation, rollup to remove unreachable code, minification, etc.) to reduce the size, that aren't used during development in the intrest of build speed.
- node-pre-gyp ERR in yarn install (Windows)
- install Python x86 version between 2.5 and 3.0 on windows. See [this issue](https://github.com/AngularClass/angular2-webpack-starter/issues/626)
- How do I handle merge conflicts in package-lock.json?
- first check out the package-lock.json file from the branch you're merging in to yours: e.g. `git checkout --theirs package-lock.json`
- now run `npm install` again. NPM will create a new lockfile that contains both sets of changes.
- then run `git add package-lock.json` to stage the lockfile for commit
- How do I handle merge conflicts in yarn.lock?
- first check out the yarn.lock file from the branch you're merging in to yours: e.g. `git checkout --theirs yarn.lock`
- now run `yarn install` again. Yarn will create a new lockfile that contains both sets of changes.
- then run `git add yarn.lock` to stage the lockfile for commit
- and `git commit` to conclude the merge
Getting Help

View File

@@ -58,10 +58,7 @@
"input": "src/themes/dspace/styles/theme.scss",
"inject": false,
"bundleName": "dspace-theme"
},
"node_modules/leaflet/dist/leaflet.css",
"node_modules/leaflet.markercluster/dist/MarkerCluster.Default.css",
"node_modules/leaflet.markercluster/dist/MarkerCluster.css"
}
],
"scripts": [],
"baseHref": "/"

View File

@@ -101,7 +101,7 @@ cache:
# Set to true to see all cache hits/misses/refreshes in your console logs. Useful for debugging SSR caching issues.
debug: false
# When enabled (i.e. max > 0), known bots will be sent pages from a server side cache specific for bots.
# (Keep in mind, bot detection cannot be guaranteed. It is possible some bots will bypass this cache.)
# (Keep in mind, bot detection cannot be guarranteed. It is possible some bots will bypass this cache.)
botCache:
# Maximum number of pages to cache for known bots. Set to zero (0) to disable server side caching for bots.
# Default is 1000, which means the 1000 most recently accessed public pages will be cached.
@@ -364,8 +364,6 @@ item:
# Rounded to the nearest size in the list of selectable sizes on the
# settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'.
pageSize: 5
# Show the bitstream access status label on the item page
showAccessStatuses: false
# Community Page Config
community:
@@ -467,8 +465,6 @@ info:
enableEndUserAgreement: true
enablePrivacyStatement: true
enableCOARNotifySupport: true
# Whether to show the cookie consent popup and the cookie settings footer link or not.
enableCookieConsentPopup: true
# Whether to enable Markdown (https://commonmark.org/) and MathJax (https://www.mathjax.org/)
# display in supported metadata fields. By default, only dc.description.abstract is supported.
@@ -562,6 +558,7 @@ notifyMetrics:
config: 'NOTIFY.outgoing.delivered'
description: 'admin-notify-dashboard.NOTIFY.outgoing.delivered.description'
# Live Region configuration
# Live Region as defined by w3c, https://www.w3.org/TR/wai-aria-1.1/#terms:
# Live regions are perceivable regions of a web page that are typically updated as a
@@ -576,40 +573,6 @@ liveRegion:
# The visibility of the live region. Setting this to true is only useful for debugging purposes.
isVisible: false
# Geospatial Map display options
geospatialMapViewer:
# Which fields to use for parsing as geospatial points in search maps
# (note, the item page field component allows any field(s) to be used
# and is set as an input when declaring the component)
spatialMetadataFields:
- 'dcterms.spatial'
# Which discovery configuration to use for 'geospatial search', used
# in the browse map
spatialFacetDiscoveryConfiguration: 'geospatial'
# Which filter / facet name to use for faceted geospatial search
# used in the browse map
spatialPointFilterName: 'point'
# Whether item page geospatial metadata should be displayed
# (assumes they are wrapped in a test for this config in the template as
# per the default templates supplied with DSpace for untyped-item and publication)
enableItemPageFields: false
# Whether the browse map should be enabled and included in the browse menu
enableBrowseMap: false
# Whether a 'map view' mode should be included alongside list and grid views
# in search result pages
enableSearchViewMode: false
# The tile provider(s) to use for the map tiles drawn in the leaflet maps.
# (see https://leaflet-extras.github.io/leaflet-providers/preview/) for a full list
tileProviders:
- 'OpenStreetMap.Mapnik'
# Starting centre point for the map, as lat and lng coordinates. This is useful
# to set the centre of the map when the map is first loaded and if there are no
# points, shapes or markers to display.
# Defaults to the centre of Istanbul
defaultCentrePoint:
lat: 41.015137
lng: 28.979530
# Configuration for storing accessibility settings, used by the AccessibilitySettingsService
accessibility:
# The duration in days after which the accessibility settings cookie expires

View File

@@ -34,7 +34,6 @@ export default defineConfig({
DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME: 'People',
// Account used to test basic submission process
DSPACE_TEST_SUBMIT_USER: 'dspacedemo+submit@gmail.com',
DSPACE_TEST_SUBMIT_USER_UUID: '914955b1-cf2e-4884-8af7-a166aa24cf73',
DSPACE_TEST_SUBMIT_USER_PASSWORD: 'dspace',
// Administrator users group
DSPACE_ADMINISTRATOR_GROUP: 'e59f5659-bff9-451e-b28f-439e7bd467e4'

View File

@@ -9,12 +9,12 @@ describe('Admin Add New Modals', () => {
it('Add new Community modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
cy.get('#sidebar-collapse-toggle').click();
// Click on entry of menu
cy.get('[data-test="admin-menu-section-new-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-new-title"]').click();
cy.get('#admin-menu-section-new-title').should('be.visible');
cy.get('#admin-menu-section-new-title').click();
cy.get('a[data-test="menu.section.new_community"]').click();
@@ -24,12 +24,12 @@ describe('Admin Add New Modals', () => {
it('Add new Collection modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
cy.get('#sidebar-collapse-toggle').click();
// Click on entry of menu
cy.get('[data-test="admin-menu-section-new-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-new-title"]').click();
cy.get('#admin-menu-section-new-title').should('be.visible');
cy.get('#admin-menu-section-new-title').click();
cy.get('a[data-test="menu.section.new_collection"]').click();
@@ -39,12 +39,12 @@ describe('Admin Add New Modals', () => {
it('Add new Item modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
cy.get('#sidebar-collapse-toggle').click();
// Click on entry of menu
cy.get('[data-test="admin-menu-section-new-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-new-title"]').click();
cy.get('#admin-menu-section-new-title').should('be.visible');
cy.get('#admin-menu-section-new-title').click();
cy.get('a[data-test="menu.section.new_item"]').click();

View File

@@ -9,12 +9,12 @@ describe('Admin Edit Modals', () => {
it('Edit Community modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
cy.get('#sidebar-collapse-toggle').click();
// Click on entry of menu
cy.get('[data-test="admin-menu-section-edit-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-edit-title"]').click();
cy.get('#admin-menu-section-edit-title').should('be.visible');
cy.get('#admin-menu-section-edit-title').click();
cy.get('a[data-test="menu.section.edit_community"]').click();
@@ -24,12 +24,12 @@ describe('Admin Edit Modals', () => {
it('Edit Collection modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
cy.get('#sidebar-collapse-toggle').click();
// Click on entry of menu
cy.get('[data-test="admin-menu-section-edit-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-edit-title"]').click();
cy.get('#admin-menu-section-edit-title').should('be.visible');
cy.get('#admin-menu-section-edit-title').click();
cy.get('a[data-test="menu.section.edit_collection"]').click();
@@ -39,12 +39,12 @@ describe('Admin Edit Modals', () => {
it('Edit Item modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
cy.get('#sidebar-collapse-toggle').click();
// Click on entry of menu
cy.get('[data-test="admin-menu-section-edit-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-edit-title"]').click();
cy.get('#admin-menu-section-edit-title').should('be.visible');
cy.get('#admin-menu-section-edit-title').click();
cy.get('a[data-test="menu.section.edit_item"]').click();

View File

@@ -9,12 +9,12 @@ describe('Admin Export Modals', () => {
it('Export metadata modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
cy.get('#sidebar-collapse-toggle').click();
// Click on entry of menu
cy.get('[data-test="admin-menu-section-export-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-export-title"]').click();
cy.get('#admin-menu-section-export-title').should('be.visible');
cy.get('#admin-menu-section-export-title').click();
cy.get('a[data-test="menu.section.export_metadata"]').click();
@@ -24,12 +24,12 @@ describe('Admin Export Modals', () => {
it('Export batch modal should pass accessibility tests', () => {
// Pin the sidebar open
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
cy.get('[data-test="sidebar-collapse-toggle"]').click();
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
cy.get('#sidebar-collapse-toggle').click();
// Click on entry of menu
cy.get('[data-test="admin-menu-section-export-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-export-title"]').click();
cy.get('#admin-menu-section-export-title').should('be.visible');
cy.get('#admin-menu-section-export-title').click();
cy.get('a[data-test="menu.section.export_batch"]').click();

View File

@@ -1,4 +1,5 @@
import { testA11y } from 'cypress/support/utils';
import { Options } from 'cypress-axe';
describe('Admin Sidebar', () => {
beforeEach(() => {
@@ -9,12 +10,19 @@ describe('Admin Sidebar', () => {
it('should be pinnable and pass accessibility tests', () => {
// Pin the sidebar open
cy.get('[data-test="sidebar-collapse-toggle"]').click();
cy.get('#sidebar-collapse-toggle').click();
// Click on every expandable section to open all menus
cy.get('ds-expandable-admin-sidebar-section').click({ multiple: true });
// Analyze <ds-admin-sidebar> for accessibility
testA11y('ds-admin-sidebar');
testA11y('ds-admin-sidebar',
{
rules: {
// Currently all expandable sections have nested interactive elements
// See https://github.com/DSpace/dspace-angular/issues/2178
'nested-interactive': { enabled: false },
},
} as Options);
});
});

View File

@@ -12,13 +12,6 @@ describe('Community List Page', () => {
cy.get('[data-test="expand-button"]').click({ multiple: true });
// Analyze <ds-community-list-page> for accessibility issues
testA11y('ds-community-list-page', {
rules: {
// When expanding a cdk node on the community-list page, the 'aria-posinset' property becomes 0.
// 0 is not a valid value for 'aria-posinset' so the test fails.
// see https://github.com/DSpace/dspace-angular/issues/4068
'aria-valid-attr-value': { enabled: false },
},
});
testA11y('ds-community-list-page');
});
});

View File

@@ -4,14 +4,13 @@ import { Options } from 'cypress-axe';
beforeEach(() => {
// Must login as an Admin to see the page
cy.intercept('GET', '/server/actuator/health').as('status');
cy.intercept('GET', '/server/actuator/info').as('info');
cy.visit('/health');
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
});
describe('Health Page > Status Tab', () => {
it('should pass accessibility tests', () => {
cy.intercept('GET', '/server/actuator/health').as('status');
cy.wait('@status');
cy.get('a[data-test="health-page.status-tab"]').click();
@@ -37,6 +36,7 @@ describe('Health Page > Status Tab', () => {
describe('Health Page > Info Tab', () => {
it('should pass accessibility tests', () => {
cy.intercept('GET', '/server/actuator/info').as('info');
cy.wait('@info');
cy.get('a[data-test="health-page.info-tab"]').click();

View File

@@ -17,7 +17,7 @@ describe('Site Statistics Page', () => {
cy.visit('/statistics');
// <ds-site-statistics-page> tag must be visible
// <ds-site-statistics-page> tag must be visable
cy.get('ds-site-statistics-page').should('be.visible');
// Verify / wait until "Total Visits" table's *last* label is non-empty

View File

@@ -26,12 +26,6 @@ describe('Homepage', () => {
// Wait for homepage tag to appear
cy.get('ds-home-page').should('be.visible');
// Wait for at least one loading component to show up
cy.get('ds-loading').should('exist');
// Wait until all loading components have disappeared
cy.get('ds-loading').should('not.exist');
// Analyze <ds-home-page> for accessibility issues
testA11y('ds-home-page');
});

View File

@@ -7,7 +7,7 @@ describe('Item Statistics Page', () => {
it('should load if you click on "Statistics" from an Item/Entity page', () => {
cy.visit('/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));
cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click();
cy.location('pathname').should('eq', '/statistics/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));
cy.location('pathname').should('eq', ITEMSTATISTICSPAGE);
});
it('should contain element ds-item-statistics-page when navigating to an item statistics page', () => {

View File

@@ -142,7 +142,7 @@ describe('Login Modal', () => {
page.submitLoginAndPasswordByPressingButton(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
cy.get('ds-log-in').should('not.exist');
// Open user menu, verify user menu accessibility
// Open user menu, verify user menu accesibility
page.openUserMenu();
cy.get('ds-user-menu').should('be.visible');
testA11y('ds-user-menu');

View File

@@ -1,7 +1,7 @@
import { testA11y } from 'cypress/support/utils';
describe('PageNotFound', () => {
it('should contain element ds-pagenotfound when navigating to page that does not exist', () => {
it('should contain element ds-pagenotfound when navigating to page that doesnt exist', () => {
// request an invalid page (UUIDs at root path aren't valid)
cy.visit('/e9019a69-d4f1-4773-b6a3-bd362caa46f2', { failOnStatusCode: false });
cy.get('ds-pagenotfound').should('be.visible');

View File

@@ -34,7 +34,7 @@ describe('New Submission page', () => {
// Author & Subject fields have invalid "aria-multiline" attrs.
// See https://github.com/DSpace/dspace-angular/issues/1272
'aria-allowed-attr': { enabled: false },
// All panels are accordions & fail "aria-required-children" and "nested-interactive".
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
'aria-required-children': { enabled: false },
'nested-interactive': { enabled: false },
@@ -192,7 +192,7 @@ describe('New Submission page', () => {
testA11y('ds-submission-edit',
{
rules: {
// All panels are accordions & fail "aria-required-children" and "nested-interactive".
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
'aria-required-children': { enabled: false },
'nested-interactive': { enabled: false },
@@ -217,7 +217,7 @@ describe('New Submission page', () => {
});
// Close popup window
cy.get('ds-dynamic-lookup-relation-modal button.btn-close').click();
cy.get('ds-dynamic-lookup-relation-modal button.close').click();
// Back on the form, click the discard button to remove new submission
// Clicking it will display a confirmation, which we will confirm with another click

View File

@@ -54,9 +54,9 @@ before(() => {
// Runs once before the first test in each "block"
beforeEach(() => {
// Pre-agree to all Orejime cookies by setting the orejime-anonymous cookie
// Pre-agree to all Klaro cookies by setting the klaro-anonymous cookie
// This just ensures it doesn't get in the way of matching other objects in the page.
cy.setCookie('orejime-anonymous', '{"authentication":true,"preferences":true,"acknowledgement":true,"google-analytics":true,"correlation-id":true,"accessibility":true}');
cy.setCookie('klaro-anonymous', '{%22authentication%22:true%2C%22preferences%22:true%2C%22acknowledgement%22:true%2C%22google-analytics%22:true%2C%22google-recaptcha%22:true}');
// Remove any CSRF cookies saved from prior tests
cy.clearCookie(DSPACE_XSRF_COOKIE);

View File

@@ -1,16 +1,10 @@
{
"extends": "../tsconfig.json",
"include": [
"**/*.ts",
"../cypress.config.ts"
"**/*.ts"
],
"compilerOptions": {
"sourceMap": false,
"typeRoots": [
"../node_modules",
"../node_modules/@types",
"../src/typings.d.ts"
],
"types": [
"cypress",
"cypress-axe",

View File

@@ -23,14 +23,14 @@ the Docker compose scripts in this 'docker' folder.
This Dockerfile is used to build a *development* DSpace Angular UI image, published as 'dspace/dspace-angular'
```
docker build -t dspace/dspace-angular:latest .
docker build -t dspace/dspace-angular:dspace-8_x .
```
This image is built *automatically* after each commit is made to the `main` branch.
Admins to our DockerHub repo can manually publish with the following command.
```
docker push dspace/dspace-angular:latest
docker push dspace/dspace-angular:dspace-8_x
```
### Dockerfile.dist
@@ -39,7 +39,7 @@ The `Dockerfile.dist` is used to generate a *production* build and runtime envir
```bash
# build the latest image
docker build -f Dockerfile.dist -t dspace/dspace-angular:latest-dist .
docker build -f Dockerfile.dist -t dspace/dspace-angular:dspace-8_x-dist .
```
A default/demo version of this image is built *automatically*.

View File

@@ -14,14 +14,14 @@
# Therefore, it should be kept in sync with that file
networks:
# Default to using network named 'dspacenet' from docker-compose-rest.yml.
# Its full name will be prepended with the project name (e.g. "-p d7" means it will be named "d7_dspacenet")
# Its full name will be prepended with the project name (e.g. "-p d8" means it will be named "d8_dspacenet")
# If COMPOSITE_PROJECT_NAME is missing, default value will be "docker" (name of folder this file is in)
default:
name: ${COMPOSE_PROJECT_NAME:-docker}_dspacenet
external: true
services:
dspace-cli:
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-cli:${DSPACE_VER:-latest}"
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-cli:${DSPACE_VER:-dspace-8_x}"
container_name: dspace-cli
environment:
# Below syntax may look odd, but it is how to override dspace.cfg settings via env variables.

View File

@@ -14,10 +14,11 @@
# # Therefore, it should be kept in sync with that file
services:
dspacedb:
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}-loadsql"
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-dspace-8_x}-loadsql"
environment:
# This LOADSQL should be kept in sync with the URL in DSpace/DSpace
# This SQL is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
# NOTE: currently there is no dspace8 version
- LOADSQL=https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-data.sql
dspace:
### OVERRIDE default 'entrypoint' in 'docker-compose-rest.yml' ####

View File

@@ -33,7 +33,7 @@ services:
# This allows us to generate statistics in e2e tests so that statistics pages can be tested thoroughly.
solr__D__statistics__P__autoCommit: 'false'
LOGGING_CONFIG: /dspace/config/log4j2-container.xml
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-latest-test}"
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-dspace-8_x-test}"
depends_on:
- dspacedb
networks:
@@ -60,11 +60,12 @@ services:
# NOTE: This is customized to use our loadsql image, so that we are using a database with existing test data
dspacedb:
container_name: dspacedb
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}-loadsql"
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-dspace-8_x}-loadsql"
environment:
# This LOADSQL should be kept in sync with the LOADSQL in
# https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/db.entities.yml
# This SQL is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
# NOTE: currently there is no dspace8 version
LOADSQL: https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-data.sql
PGDATA: /pgdata
POSTGRES_PASSWORD: dspace
@@ -81,7 +82,7 @@ services:
# DSpace Solr container
dspacesolr:
container_name: dspacesolr
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-latest}"
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-dspace-8_x}"
networks:
- dspacenet
ports:
@@ -93,10 +94,7 @@ services:
volumes:
# Keep Solr data directory between reboots
- solr_data:/var/solr/data
# NOTE: We are not running Solr as "root", but we need root permissions to copy our cores to the mounted
# /var/solr/data directory. Then we start Solr as the "solr" user.
user: root
# Initialize all DSpace Solr cores, then start Solr
# Initialize all DSpace Solr cores using the mounted configsets (see above), then start Solr
entrypoint:
- /bin/bash
- '-c'
@@ -114,8 +112,7 @@ services:
cp -r /opt/solr/server/solr/configsets/qaevent/* qaevent
precreate-core suggestion /opt/solr/server/solr/configsets/suggestion
cp -r /opt/solr/server/solr/configsets/suggestion/* suggestion
chown -R solr:solr /var/solr
runuser -u solr -- solr-foreground
exec solr -f
volumes:
assetstore:
pgdata:

View File

@@ -26,7 +26,7 @@ services:
DSPACE_REST_HOST: sandbox.dspace.org
DSPACE_REST_PORT: 443
DSPACE_REST_NAMESPACE: /server
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-latest}-dist"
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-dspace-8_x}-dist"
build:
context: ..
dockerfile: Dockerfile.dist

View File

@@ -40,7 +40,7 @@ services:
# from the host machine. This IP range MUST correspond to the 'dspacenet' subnet defined above.
proxies__P__trusted__P__ipranges: '172.23.0'
LOGGING_CONFIG: /dspace/config/log4j2-container.xml
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-latest-test}"
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-dspace-8_x-test}"
depends_on:
- dspacedb
networks:
@@ -68,7 +68,7 @@ services:
dspacedb:
container_name: dspacedb
# Uses a custom Postgres image with pgcrypto installed
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}"
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-dspace-8_x}"
environment:
PGDATA: /pgdata
POSTGRES_PASSWORD: dspace
@@ -85,7 +85,7 @@ services:
# DSpace Solr container
dspacesolr:
container_name: dspacesolr
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-latest}"
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-dspace-8_x}"
networks:
- dspacenet
ports:
@@ -97,16 +97,11 @@ services:
volumes:
# Keep Solr data directory between reboots
- solr_data:/var/solr/data
# NOTE: We are not running Solr as "root", but we need root permissions to copy our cores to the mounted
# /var/solr/data directory. Then we start Solr as the "solr" user.
user: root
# Initialize all DSpace Solr cores using the mounted local configsets (see above), then start Solr
# * First, run precreate-core to create the core (if it doesn't yet exist). If exists already, this is a no-op
# * Second, copy configsets to this core:
# Updates to Solr configs require the container to be rebuilt/restarted:
# `docker compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d --build dspacesolr`
# * Third, ensure all new folders are owned by "solr" user
# * Finally, start Solr as the "solr" user via the provided solr-foreground script
entrypoint:
- /bin/bash
- '-c'
@@ -124,8 +119,7 @@ services:
cp -r /opt/solr/server/solr/configsets/qaevent/* qaevent
precreate-core suggestion /opt/solr/server/solr/configsets/suggestion
cp -r /opt/solr/server/solr/configsets/suggestion/* suggestion
chown -R solr:solr /var/solr
runuser -u solr -- solr-foreground
exec solr -f
volumes:
assetstore:
pgdata:

View File

@@ -23,7 +23,7 @@ services:
DSPACE_REST_HOST: localhost
DSPACE_REST_PORT: 8080
DSPACE_REST_NAMESPACE: /server
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-latest}"
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-dspace-8_x}"
build:
context: ..
dockerfile: Dockerfile

View File

@@ -15,7 +15,7 @@ DSPACE_APP_CONFIG_PATH=/usr/local/dspace/config/config.yml
Configuration options can be overridden by setting environment variables.
## Nodejs server
When you start dspace-angular on node, it spins up an http server on which it listens for incoming connections. You can define the ip address and port the server should bind itself to, and if ssl should be enabled not. By default it listens on `localhost:4000`. If you want it to listen on all your network connections, configure it to bind itself to `0.0.0.0`.
When you start dspace-angular on node, it spins up an http server on which it listens for incoming connections. You can define the ip address and port the server should bind itsself to, and if ssl should be enabled not. By default it listens on `localhost:4000`. If you want it to listen on all your network connections, configure it to bind itself to `0.0.0.0`.
To change this configuration, change the options `ui.host`, `ui.port` and `ui.ssl` in the appropriate configuration file (see above):

View File

@@ -9,8 +9,6 @@ _______
[Source code](../../../../lint/src/rules/html/no-disabled-attribute-on-button.ts)
### Examples
@@ -21,28 +19,24 @@ _______
```html
<button [dsBtnDisabled]="true">Submit</button>
```
##### disabled attribute is still valid on non-button elements
```html
<input disabled>
```
##### [disabled] attribute is still valid on non-button elements
```html
<input [disabled]="true">
```
##### angular dynamic attributes that use disabled are still valid
```html
<button [class.disabled]="isDisabled">Submit</button>
```
@@ -53,9 +47,6 @@ _______
```html
<button disabled>Submit</button>
```
Will produce the following error(s):
```
@@ -72,9 +63,6 @@ Result of `yarn lint --fix`:
```html
<button [disabled]="true">Submit</button>
```
Will produce the following error(s):
```

View File

@@ -11,8 +11,6 @@ _______
[Source code](../../../../lint/src/rules/html/themed-component-usages.ts)
### Examples
@@ -25,7 +23,6 @@ _______
<ds-test-themeable></ds-test-themeable>
<ds-test-themeable [test]="something"></ds-test-themeable>
```
##### use no-prefix selectors in TypeScript templates
@@ -36,7 +33,6 @@ _______
class Test {
}
```
##### use no-prefix selectors in TypeScript test templates
@@ -49,7 +45,6 @@ Filename: `lint/test/fixture/src/test.spec.ts`
class Test {
}
```
##### base selectors are also allowed in TypeScript test templates
@@ -62,7 +57,6 @@ Filename: `lint/test/fixture/src/test.spec.ts`
class Test {
}
```
@@ -75,9 +69,6 @@ class Test {
<ds-themed-test-themeable/>
<ds-themed-test-themeable></ds-themed-test-themeable>
<ds-themed-test-themeable [test]="something"></ds-themed-test-themeable>
```
Will produce the following error(s):
```
@@ -100,9 +91,6 @@ Result of `yarn lint --fix`:
<ds-base-test-themeable/>
<ds-base-test-themeable></ds-base-test-themeable>
<ds-base-test-themeable [test]="something"></ds-base-test-themeable>
```
Will produce the following error(s):
```

View File

@@ -1,11 +1,6 @@
[DSpace ESLint plugins](../../../lint/README.md) > TypeScript rules
_______
- [`dspace-angular-ts/alias-imports`](./rules/alias-imports.md): Unclear imports should be aliased for clarity
- [`dspace-angular-ts/sort-standalone-imports`](./rules/sort-standalone-imports.md): Sorts the standalone `@Component` imports alphabetically
- [`dspace-angular-ts/themed-component-classes`](./rules/themed-component-classes.md): Formatting rules for themeable component classes
- [`dspace-angular-ts/themed-component-selectors`](./rules/themed-component-selectors.md): Themeable component selectors should follow the DSpace convention
- [`dspace-angular-ts/themed-component-usages`](./rules/themed-component-usages.md): Themeable components should be used via their `ThemedComponent` wrapper class
- [`dspace-angular-ts/themed-decorators`](./rules/themed-decorators.md): Entry components with theme support should declare the correct theme
- [`dspace-angular-ts/themed-wrapper-no-input-defaults`](./rules/themed-wrapper-no-input-defaults.md): ThemedComponent wrappers should not declare input defaults (see [DSpace Angular #2164](https://github.com/DSpace/dspace-angular/pull/2164))
- [`dspace-angular-ts/unique-decorators`](./rules/unique-decorators.md): Some decorators must be called with unique arguments (e.g. when they construct a mapping based on the argument values)

View File

@@ -1,148 +0,0 @@
[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/alias-imports`
_______
Unclear imports should be aliased for clarity
_______
[Source code](../../../../lint/src/rules/ts/alias-imports.ts)
### Options
#### `aliases`
A list of all the imports that you want to alias for clarity. Every alias should be declared in the following format:
```json
{
"package": "rxjs",
"imported": "of",
"local": "observableOf"
}
```
### Examples
#### Valid code
##### correctly aliased imports
```typescript
import { of as observableOf } from 'rxjs';
```
With options:
```json
{
"aliases": [
{
"package": "rxjs",
"imported": "of",
"local": "observableOf"
}
]
}
```
##### enforce unaliased import
```typescript
import { combineLatest } from 'rxjs';
```
With options:
```json
{
"aliases": [
{
"package": "rxjs",
"imported": "combineLatest",
"local": "combineLatest"
}
]
}
```
#### Invalid code &amp; automatic fixes
##### imports without alias
```typescript
import { of } from 'rxjs';
```
Will produce the following error(s):
```
This import must be aliased
```
Result of `yarn lint --fix`:
```typescript
import { of as observableOf } from 'rxjs';
```
##### imports under the wrong alias
```typescript
import { of as ofSomething } from 'rxjs';
```
Will produce the following error(s):
```
This import uses the wrong alias (should be {{ local }})
```
Result of `yarn lint --fix`:
```typescript
import { of as observableOf } from 'rxjs';
```
##### disallow aliasing import
```typescript
import { combineLatest as observableCombineLatest } from 'rxjs';
With options:
```json
{
"aliases": [
{
"package": "rxjs",
"imported": "combineLatest",
"local": "combineLatest"
}
]
}
```
```
Will produce the following error(s):
```
This import should not use an alias
```
Result of `yarn lint --fix`:
```typescript
import { combineLatest } from 'rxjs';
```

View File

@@ -1,245 +0,0 @@
[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/sort-standalone-imports`
_______
Sorts the standalone `@Component` imports alphabetically
_______
[Source code](../../../../lint/src/rules/ts/sort-standalone-imports.ts)
### Options
#### `locale`
The locale used to sort the imports.,
#### `maxItems`
The maximum number of imports that should be displayed before each import is separated onto its own line.,
#### `indent`
The indent used for the project.,
#### `trailingComma`
Whether the last import should have a trailing comma (only applicable for multiline imports).
### Examples
#### Valid code
##### should sort multiple imports on separate lines
```typescript
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
AsyncPipe,
RootComponent,
],
})
export class AppComponent {}
```
##### should not inlines singular imports when maxItems is 0
```typescript
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
RootComponent,
],
})
export class AppComponent {}
```
##### should inline singular imports when maxItems is 1
```typescript
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [RootComponent],
})
export class AppComponent {}
```
With options:
```json
{
"maxItems": 1
}
```
#### Invalid code &amp; automatic fixes
##### should sort multiple imports alphabetically
```typescript
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
RootComponent,
AsyncPipe,
],
})
export class AppComponent {}
```
Will produce the following error(s):
```
Standalone imports should be sorted alphabetically
```
Result of `yarn lint --fix`:
```typescript
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
AsyncPipe,
RootComponent,
],
})
export class AppComponent {}
```
##### should not put singular imports on one line when maxItems is 0
```typescript
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [RootComponent],
})
export class AppComponent {}
```
Will produce the following error(s):
```
Standalone imports should be sorted alphabetically
```
Result of `yarn lint --fix`:
```typescript
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
RootComponent,
],
})
export class AppComponent {}
```
##### should not put singular imports on a separate line when maxItems is 1
```typescript
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
RootComponent,
],
})
export class AppComponent {}
With options:
```json
{
"maxItems": 1
}
```
```
Will produce the following error(s):
```
Standalone imports should be sorted alphabetically
```
Result of `yarn lint --fix`:
```typescript
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [RootComponent],
})
export class AppComponent {}
```
##### should not display multiple imports on the same line
```typescript
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [AsyncPipe, RootComponent],
})
export class AppComponent {}
```
Will produce the following error(s):
```
Standalone imports should be sorted alphabetically
```
Result of `yarn lint --fix`:
```typescript
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
AsyncPipe,
RootComponent,
],
})
export class AppComponent {}
```

View File

@@ -11,8 +11,6 @@ _______
[Source code](../../../../lint/src/rules/ts/themed-component-classes.ts)
### Examples
@@ -28,7 +26,6 @@ _______
class Something {
}
```
##### Base component
@@ -37,10 +34,9 @@ class Something {
selector: 'ds-base-test-themable',
standalone: true,
})
class TestThemeableComponent {
class TestThemeableTomponent {
}
```
##### Wrapper component
@@ -54,10 +50,9 @@ Filename: `lint/test/fixture/src/app/test/themed-test-themeable.component.ts`
TestThemeableComponent,
],
})
class ThemedTestThemeableComponent extends ThemedComponent<TestThemeableComponent> {
class ThemedTestThemeableTomponent extends ThemedComponent<TestThemeableComponent> {
}
```
##### Override component
@@ -71,7 +66,6 @@ Filename: `lint/test/fixture/src/themes/test/app/test/test-themeable.component.t
class Override extends BaseComponent {
}
```
@@ -86,9 +80,6 @@ class Override extends BaseComponent {
})
class TestThemeableComponent {
}
```
Will produce the following error(s):
```
@@ -116,9 +107,6 @@ Filename: `lint/test/fixture/src/app/test/themed-test-themeable.component.ts`
})
class ThemedTestThemeableComponent extends ThemedComponent<TestThemeableComponent> {
}
```
Will produce the following error(s):
```
@@ -149,9 +137,6 @@ Filename: `lint/test/fixture/src/app/test/themed-test-themeable.component.ts`
})
class ThemedTestThemeableComponent extends ThemedComponent<TestThemeableComponent> {
}
```
Will produce the following error(s):
```
@@ -186,9 +171,6 @@ import { SomethingElse } from './somewhere-else';
})
class ThemedTestThemeableComponent extends ThemedComponent<TestThemeableComponent> {
}
```
Will produce the following error(s):
```
@@ -225,9 +207,6 @@ import { Something, SomethingElse } from './somewhere-else';
})
class ThemedTestThemeableComponent extends ThemedComponent<TestThemeableComponent> {
}
```
Will produce the following error(s):
```
@@ -258,9 +237,6 @@ Filename: `lint/test/fixture/src/themes/test/app/test/test-themeable.component.t
})
class Override extends BaseComponent {
}
```
Will produce the following error(s):
```

View File

@@ -17,8 +17,6 @@ _______
[Source code](../../../../lint/src/rules/ts/themed-component-selectors.ts)
### Examples
@@ -33,7 +31,6 @@ _______
class Something {
}
```
##### Themeable component selector should replace the original version, unthemed version should be changed to ds-base-
@@ -56,7 +53,6 @@ class ThemedSomething extends ThemedComponent<Something> {
class OverrideSomething extends Something {
}
```
##### Other themed component wrappers should not interfere
@@ -73,7 +69,6 @@ class Something {
class ThemedSomethingElse extends ThemedComponent<SomethingElse> {
}
```
@@ -90,9 +85,6 @@ Filename: `lint/test/fixture/src/app/test/test-themeable.component.ts`
})
class TestThemeableComponent {
}
```
Will produce the following error(s):
```
@@ -119,9 +111,6 @@ Filename: `lint/test/fixture/src/app/test/themed-test-themeable.component.ts`
})
class ThemedTestThemeableComponent extends ThemedComponent<TestThemeableComponent> {
}
```
Will produce the following error(s):
```
@@ -148,9 +137,6 @@ Filename: `lint/test/fixture/src/themes/test/app/test/test-themeable.component.t
})
class TestThememeableComponent extends BaseComponent {
}
```
Will produce the following error(s):
```

View File

@@ -15,8 +15,6 @@ _______
[Source code](../../../../lint/src/rules/ts/themed-component-usages.ts)
### Examples
@@ -32,7 +30,6 @@ const config = {
b: ChipsComponent,
}
```
##### allow base class in class declaration
@@ -40,7 +37,6 @@ const config = {
export class TestThemeableComponent {
}
```
##### allow inheriting from base class
@@ -50,7 +46,6 @@ import { TestThemeableComponent } from './app/test/test-themeable.component';
export class ThemedAdminSidebarComponent extends ThemedComponent<TestThemeableComponent> {
}
```
##### allow base class in ViewChild
@@ -61,7 +56,6 @@ export class Something {
@ViewChild(TestThemeableComponent) test: TestThemeableComponent;
}
```
##### allow wrapper selectors in test queries
@@ -71,7 +65,6 @@ Filename: `lint/test/fixture/src/app/test/test.component.spec.ts`
By.css('ds-themeable');
By.css('#test > ds-themeable > #nest');
```
##### allow wrapper selectors in cypress queries
@@ -81,7 +74,6 @@ Filename: `lint/test/fixture/src/app/test/test.component.cy.ts`
By.css('ds-themeable');
By.css('#test > ds-themeable > #nest');
```
@@ -98,9 +90,6 @@ const config = {
a: TestThemeableComponent,
b: TestComponent,
}
```
Will produce the following error(s):
```
@@ -131,9 +120,6 @@ const config = {
b: TestComponent,
c: Something,
}
```
Will produce the following error(s):
```
@@ -164,9 +150,6 @@ const DECLARATIONS = [
Something,
ThemedTestThemeableComponent,
];
```
Will produce the following error(s):
```
@@ -190,9 +173,6 @@ Filename: `lint/test/fixture/src/app/test/test.component.spec.ts`
```typescript
By.css('ds-themed-themeable');
By.css('#test > ds-themed-themeable > #nest');
```
Will produce the following error(s):
```
@@ -214,9 +194,6 @@ Filename: `lint/test/fixture/src/app/test/test.component.spec.ts`
```typescript
By.css('ds-base-themeable');
By.css('#test > ds-base-themeable > #nest');
```
Will produce the following error(s):
```
@@ -238,9 +215,6 @@ Filename: `lint/test/fixture/src/app/test/test.component.cy.ts`
```typescript
cy.get('ds-themed-themeable');
cy.get('#test > ds-themed-themeable > #nest');
```
Will produce the following error(s):
```
@@ -262,9 +236,6 @@ Filename: `lint/test/fixture/src/app/test/test.component.cy.ts`
```typescript
cy.get('ds-base-themeable');
cy.get('#test > ds-base-themeable > #nest');
```
Will produce the following error(s):
```
@@ -295,9 +266,6 @@ import { TestThemeableComponent } from '../../../../app/test/test-themeable.comp
})
export class UsageComponent {
}
```
Will produce the following error(s):
```
@@ -338,9 +306,6 @@ import { ThemedTestThemeableComponent } from '../../../../app/test/themed-test-t
})
export class UsageComponent {
}
```
Will produce the following error(s):
```

View File

@@ -1,183 +0,0 @@
[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/themed-decorators`
_______
Entry components with theme support should declare the correct theme
_______
[Source code](../../../../lint/src/rules/ts/themed-decorators.ts)
### Options
#### `decorators`
A mapping for all the existing themeable decorators, with the decorator name as the key and the index of the `theme` argument as the value.
### Examples
#### Valid code
##### theme file declares the correct theme in @listableObjectComponent
Filename: `lint/test/fixture/src/themes/test/app/dynamic-component/dynamic-component.ts`
```typescript
@listableObjectComponent(something, somethingElse, undefined, 'test')
export class Something extends SomethingElse {
}
```
##### plain file declares no theme in @listableObjectComponent
Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.ts`
```typescript
@listableObjectComponent(something, somethingElse, undefined)
export class Something extends SomethingElse {
}
```
##### plain file declares explicit undefined theme in @listableObjectComponent
Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.ts`
```typescript
@listableObjectComponent(something, somethingElse, undefined, undefined)
export class Something extends SomethingElse {
}
```
##### test file declares theme outside of theme directory
Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.spec.ts`
```typescript
@listableObjectComponent(something, somethingElse, undefined, 'test')
export class Something extends SomethingElse {
}
```
##### only track configured decorators
Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.ts`
```typescript
@something('test')
export class Something extends SomethingElse {
}
```
#### Invalid code &amp; automatic fixes
##### theme file declares the wrong theme in @listableObjectComponent
Filename: `lint/test/fixture/src/themes/test/app/dynamic-component/dynamic-component.ts`
```typescript
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
export class Something extends SomethingElse {
}
```
Will produce the following error(s):
```
Wrong theme declaration in decorator
```
Result of `yarn lint --fix`:
```typescript
@listableObjectComponent(something, somethingElse, undefined, 'test')
export class Something extends SomethingElse {
}
```
##### plain file declares a theme in @listableObjectComponent
Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.ts`
```typescript
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
export class Something extends SomethingElse {
}
```
Will produce the following error(s):
```
There is a theme declaration in decorator, but this file is not part of a theme
```
Result of `yarn lint --fix`:
```typescript
@listableObjectComponent(something, somethingElse, undefined)
export class Something extends SomethingElse {
}
```
##### theme file declares no theme in @listableObjectComponent
Filename: `lint/test/fixture/src/themes/test-2/app/dynamic-component/dynamic-component.ts`
```typescript
@listableObjectComponent(something, somethingElse, undefined)
export class Something extends SomethingElse {
}
```
Will produce the following error(s):
```
No theme declaration in decorator
```
Result of `yarn lint --fix`:
```typescript
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
export class Something extends SomethingElse {
}
```
##### theme file declares explicit undefined theme in @listableObjectComponent
Filename: `lint/test/fixture/src/themes/test-2/app/dynamic-component/dynamic-component.ts`
```typescript
@listableObjectComponent(something, somethingElse, undefined, undefined)
export class Something extends SomethingElse {
}
```
Will produce the following error(s):
```
No theme declaration in decorator
```
Result of `yarn lint --fix`:
```typescript
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
export class Something extends SomethingElse {
}
```

View File

@@ -1,92 +0,0 @@
[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/themed-wrapper-no-input-defaults`
_______
ThemedComponent wrappers should not declare input defaults (see [DSpace Angular #2164](https://github.com/DSpace/dspace-angular/pull/2164))
_______
[Source code](../../../../lint/src/rules/ts/themed-wrapper-no-input-defaults.ts)
### Examples
#### Valid code
##### ThemedComponent wrapper defines an input without a default value
```typescript
export class TTest extends ThemedComponent<Test> {
@Input()
test;
}
```
##### Regular class defines an input with a default value
```typescript
export class Test {
@Input()
test = 'test';
}
```
#### Invalid code
##### ThemedComponent wrapper defines an input with a default value
```typescript
export class TTest extends ThemedComponent<Test> {
@Input()
test1 = 'test';
@Input()
test2 = true;
@Input()
test2: number = 123;
@Input()
test3: number[] = [1,2,3];
}
```
Will produce the following error(s):
```
ThemedComponent wrapper declares inputs with defaults
ThemedComponent wrapper declares inputs with defaults
ThemedComponent wrapper declares inputs with defaults
ThemedComponent wrapper declares inputs with defaults
```
##### ThemedComponent wrapper defines an input with an undefined default value
```typescript
export class TTest extends ThemedComponent<Test> {
@Input()
test = undefined;
}
```
Will produce the following error(s):
```
ThemedComponent wrapper declares inputs with defaults
```

View File

@@ -1,86 +0,0 @@
[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/unique-decorators`
_______
Some decorators must be called with unique arguments (e.g. when they construct a mapping based on the argument values)
_______
[Source code](../../../../lint/src/rules/ts/unique-decorators.ts)
### Options
#### `decorators`
The list of all the decorators for which you want to enforce this behavior.
### Examples
#### Valid code
##### checked decorator, no repetitions
```typescript
@listableObjectComponent(a)
export class A {
}
@listableObjectComponent(a, 'b')
export class B {
}
@listableObjectComponent(a, 'b', 3)
export class C {
}
@listableObjectComponent(a, 'b', 3, Enum.TEST1)
export class C {
}
@listableObjectComponent(a, 'b', 3, Enum.TEST2)
export class C {
}
```
##### unchecked decorator, some repetitions
```typescript
@something(a)
export class A {
}
@something(a)
export class B {
}
```
#### Invalid code
##### checked decorator, some repetitions
```typescript
@listableObjectComponent(a)
export class A {
}
@listableObjectComponent(a)
export class B {
}
```
Will produce the following error(s):
```
Duplicate decorator call
```

View File

@@ -33,7 +33,6 @@ export const info = {
[Message.USE_DSBTN_DISABLED]: 'Buttons should use the `dsBtnDisabled` directive instead of the `disabled` attribute.',
},
},
optionDocs: [],
defaultOptions: [],
} as DSpaceESLintRuleInfo;

View File

@@ -45,7 +45,6 @@ The only exception to this rule are unit tests, where we may want to use the bas
[Message.WRONG_SELECTOR]: 'Themeable components should be used via their ThemedComponent wrapper\'s selector',
},
},
optionDocs: [],
defaultOptions: [],
} as DSpaceESLintRuleInfo;

View File

@@ -1,304 +0,0 @@
import {
AST_NODE_TYPES,
ESLintUtils,
TSESLint,
TSESTree,
} from '@typescript-eslint/utils';
import { Scope } from '@typescript-eslint/utils/ts-eslint';
import {
DSpaceESLintRuleInfo,
NamedTests,
OptionDoc,
} from '../../util/structure';
export enum Message {
MISSING_ALIAS = 'missingAlias',
WRONG_ALIAS = 'wrongAlias',
MULTIPLE_ALIASES = 'multipleAliases',
UNNECESSARY_ALIAS = 'unnecessaryAlias',
}
interface AliasImportOptions {
aliases: AliasImportOption[];
}
interface AliasImportOption {
package: string;
imported: string;
local: string;
}
interface AliasImportDocOptions {
aliases: OptionDoc;
}
export const info: DSpaceESLintRuleInfo<[AliasImportOptions], [AliasImportDocOptions]> = {
name: 'alias-imports',
meta: {
docs: {
description: 'Unclear imports should be aliased for clarity',
},
messages: {
[Message.MISSING_ALIAS]: 'This import must be aliased',
[Message.WRONG_ALIAS]: 'This import uses the wrong alias (should be {{ local }})',
[Message.MULTIPLE_ALIASES]: 'This import was used twice with a different alias (should be {{ local }})',
[Message.UNNECESSARY_ALIAS]: 'This import should not use an alias',
},
fixable: 'code',
type: 'problem',
schema: {
type: 'array',
items: {
type: 'object',
properties: {
package: { type: 'string' },
imported: { type: 'string' },
local: { type: 'string' },
},
},
},
},
optionDocs: [
{
aliases: {
title: '`aliases`',
description: `A list of all the imports that you want to alias for clarity. Every alias should be declared in the following format:
\`\`\`json
{
"package": "rxjs",
"imported": "of",
"local": "observableOf"
}
\`\`\``,
},
},
],
defaultOptions: [
{
aliases: [
{
package: 'rxjs',
imported: 'of',
local: 'observableOf',
},
],
},
],
};
export const rule = ESLintUtils.RuleCreator.withoutDocs({
...info,
create(context: TSESLint.RuleContext<Message, unknown[]>, options: any) {
return (options[0] as AliasImportOptions).aliases.reduce((selectors: any, option: AliasImportOption) => {
selectors[`ImportDeclaration[source.value = "${option.package}"] > ImportSpecifier[imported.name = "${option.imported}"][local.name != "${option.local}"]`] = (node: TSESTree.ImportSpecifier) => handleUnaliasedImport(context, option, node);
return selectors;
}, {});
},
});
export const tests: NamedTests = {
plugin: info.name,
valid: [
{
name: 'correctly aliased imports',
code: `
import { of as observableOf } from 'rxjs';
`,
options: [
{
aliases: [
{
package: 'rxjs',
imported: 'of',
local: 'observableOf',
},
],
},
],
},
{
name: 'enforce unaliased import',
code: `
import { combineLatest } from 'rxjs';
`,
options: [
{
aliases: [
{
package: 'rxjs',
imported: 'combineLatest',
local: 'combineLatest',
},
],
},
],
},
],
invalid: [
{
name: 'imports without alias',
code: `
import { of } from 'rxjs';
`,
errors: [
{
messageId: 'missingAlias',
},
],
output: `
import { of as observableOf } from 'rxjs';
`,
},
{
name: 'imports under the wrong alias',
code: `
import { of as ofSomething } from 'rxjs';
`,
errors: [
{
messageId: 'wrongAlias',
},
],
output: `
import { of as observableOf } from 'rxjs';
`,
},
{
name: 'disallow aliasing import',
code: `
import { combineLatest as observableCombineLatest } from 'rxjs';
`,
errors: [
{
messageId: 'unnecessaryAlias',
},
],
output: `
import { combineLatest } from 'rxjs';
`,
options: [
{
aliases: [
{
package: 'rxjs',
imported: 'combineLatest',
local: 'combineLatest',
},
],
},
],
},
],
};
/**
* Replaces the incorrectly aliased imports with the ones defined in the defaultOptions
*
* @param context The current {@link TSESLint.RuleContext}
* @param option The current {@link AliasImportOption} that needs to be handled
* @param node The incorrect import node that should be fixed
*/
function handleUnaliasedImport(context: TSESLint.RuleContext<Message, unknown[]>, option: AliasImportOption, node: TSESTree.ImportSpecifier): void {
const hasCorrectAliasedImport: boolean = (node.parent as TSESTree.ImportDeclaration).specifiers.find((specifier: TSESTree.ImportClause) => specifier.local.name === option.local && specifier.type === AST_NODE_TYPES.ImportSpecifier && (specifier as TSESTree.ImportSpecifier).imported.name === option.imported) !== undefined;
if (option.imported === option.local) {
if (hasCorrectAliasedImport) {
context.report({
messageId: Message.MULTIPLE_ALIASES,
data: { local: option.local },
node: node,
fix(fixer: TSESLint.RuleFixer) {
const fixes: TSESLint.RuleFix[] = [];
const commaAfter = context.sourceCode.getTokenAfter(node, {
filter: (token: TSESTree.Token) => token.value === ',',
});
if (commaAfter) {
fixes.push(fixer.removeRange([node.range[0], commaAfter.range[1]]));
} else {
fixes.push(fixer.remove(node));
}
fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local));
return fixes;
},
});
} else {
context.report({
messageId: Message.UNNECESSARY_ALIAS,
data: { local: option.local },
node: node,
fix(fixer: TSESLint.RuleFixer) {
const fixes: TSESLint.RuleFix[] = [];
fixes.push(fixer.replaceText(node, option.imported));
fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local));
return fixes;
},
});
}
} else {
if (hasCorrectAliasedImport) {
context.report({
messageId: Message.MULTIPLE_ALIASES,
data: { local: option.local },
node: node,
fix(fixer: TSESLint.RuleFixer) {
const fixes: TSESLint.RuleFix[] = [];
const commaAfter = context.sourceCode.getTokenAfter(node, {
filter: (token: TSESTree.Token) => token.value === ',',
});
if (commaAfter) {
fixes.push(fixer.removeRange([node.range[0], commaAfter.range[1]]));
} else {
fixes.push(fixer.remove(node));
}
fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local));
return fixes;
},
});
} else if (node.local.name === node.imported.name) {
context.report({
messageId: Message.MISSING_ALIAS,
node: node,
fix(fixer: TSESLint.RuleFixer) {
const fixes: TSESLint.RuleFix[] = [];
fixes.push(fixer.replaceText(node.local, `${option.imported} as ${option.local}`));
fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local));
return fixes;
},
});
} else {
context.report({
messageId: Message.WRONG_ALIAS,
data: { local: option.local },
node: node,
fix(fixer: TSESLint.RuleFixer) {
const fixes: TSESLint.RuleFix[] = [];
fixes.push(fixer.replaceText(node.local, option.local));
fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local));
return fixes;
},
});
}
}
}
/**
* Generates the {@link TSESLint.RuleFix}s for all the usages of the incorrect import.
*
* @param context The current {@link TSESLint.RuleContext}
* @param fixer The instance {@link TSESLint.RuleFixer}
* @param node The node which needs to be replaced
* @param newAlias The new import name
*/
function retrieveUsageReplacementFixes(context: TSESLint.RuleContext<Message, unknown[]>, fixer: TSESLint.RuleFixer, node: TSESTree.ImportSpecifier, newAlias: string): TSESLint.RuleFix[] {
return context.sourceCode.getDeclaredVariables(node)[0].references.map((reference: Scope.Reference) => fixer.replaceText(reference.identifier, newAlias));
}

View File

@@ -10,24 +10,14 @@ import {
RuleExports,
} from '../../util/structure';
/* eslint-disable import/no-namespace */
import * as aliasImports from './alias-imports';
import * as sortStandaloneImports from './sort-standalone-imports';
import * as themedComponentClasses from './themed-component-classes';
import * as themedComponentSelectors from './themed-component-selectors';
import * as themedComponentUsages from './themed-component-usages';
import * as themedDecorators from './themed-decorators';
import * as themedWrapperNoInputDefaults from './themed-wrapper-no-input-defaults';
import * as uniqueDecorators from './unique-decorators';
const index = [
aliasImports,
sortStandaloneImports,
themedComponentClasses,
themedComponentSelectors,
themedComponentUsages,
themedDecorators,
themedWrapperNoInputDefaults,
uniqueDecorators,
] as unknown as RuleExports[];
export = {

View File

@@ -1,306 +0,0 @@
import {
ASTUtils as TSESLintASTUtils,
ESLintUtils,
TSESLint,
TSESTree,
} from '@typescript-eslint/utils';
import {
DSpaceESLintRuleInfo,
NamedTests,
OptionDoc,
} from '../../util/structure';
const DEFAULT_LOCALE = 'en-US';
const DEFAULT_MAX_SIZE = 0;
const DEFAULT_SPACE_INDENT_AMOUNT = 2;
const DEFAULT_TRAILING_COMMA = true;
export enum Message {
SORT_STANDALONE_IMPORTS_ARRAYS = 'sortStandaloneImportsArrays',
}
export interface UniqueDecoratorsOptions {
locale: string;
maxItems: number;
indent: number;
trailingComma: boolean;
}
export interface UniqueDecoratorsDocOptions {
locale: OptionDoc;
maxItems: OptionDoc;
indent: OptionDoc;
trailingComma: OptionDoc;
}
export const info: DSpaceESLintRuleInfo<[UniqueDecoratorsOptions], [UniqueDecoratorsDocOptions]> = {
name: 'sort-standalone-imports',
meta: {
docs: {
description: 'Sorts the standalone `@Component` imports alphabetically',
},
messages: {
[Message.SORT_STANDALONE_IMPORTS_ARRAYS]: 'Standalone imports should be sorted alphabetically',
},
fixable: 'code',
type: 'problem',
schema: [
{
type: 'object',
properties: {
locale: {
type: 'string',
},
maxItems: {
type: 'number',
},
indent: {
type: 'number',
},
trailingComma: {
type: 'boolean',
},
},
additionalProperties: false,
},
],
},
optionDocs: [
{
locale: {
title: '`locale`',
description: 'The locale used to sort the imports.',
},
maxItems: {
title: '`maxItems`',
description: 'The maximum number of imports that should be displayed before each import is separated onto its own line.',
},
indent: {
title: '`indent`',
description: 'The indent used for the project.',
},
trailingComma: {
title: '`trailingComma`',
description: 'Whether the last import should have a trailing comma (only applicable for multiline imports).',
},
},
],
defaultOptions: [
{
locale: DEFAULT_LOCALE,
maxItems: DEFAULT_MAX_SIZE,
indent: DEFAULT_SPACE_INDENT_AMOUNT,
trailingComma: DEFAULT_TRAILING_COMMA,
},
],
};
export const rule = ESLintUtils.RuleCreator.withoutDocs({
...info,
create(context: TSESLint.RuleContext<Message, unknown[]>, [{ locale, maxItems, indent, trailingComma }]: any) {
return {
['ClassDeclaration > Decorator > CallExpression[callee.name="Component"] > ObjectExpression > Property[key.name="imports"] > ArrayExpression']: (node: TSESTree.ArrayExpression) => {
const elements = node.elements.filter((element) => element !== null && (TSESLintASTUtils.isIdentifier(element) || element?.type === TSESTree.AST_NODE_TYPES.CallExpression));
const sortedNames: string[] = elements
.map((element) => context.sourceCode.getText(element!))
.sort((a: string, b: string) => a.localeCompare(b, locale));
const isSorted: boolean = elements.every((identifier, index) => context.sourceCode.getText(identifier!) === sortedNames[index]);
const requiresMultiline: boolean = maxItems < node.elements.length;
const isMultiline: boolean = /\n/.test(context.sourceCode.getText(node));
const incorrectFormat: boolean = requiresMultiline !== isMultiline;
if (isSorted && !incorrectFormat) {
return;
}
context.report({
node: node.parent,
messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS,
fix: (fixer: TSESLint.RuleFixer) => {
if (requiresMultiline) {
const multilineImports: string = sortedNames
.map((name: string) => `${' '.repeat(2 * indent)}${name}${trailingComma ? ',' : ''}`)
.join(trailingComma ? '\n' : ',\n');
return fixer.replaceText(node, `[\n${multilineImports}\n${' '.repeat(indent)}]`);
} else {
return fixer.replaceText(node, `[${sortedNames.join(', ')}]`);
}
},
});
},
};
},
});
export const tests: NamedTests = {
plugin: info.name,
valid: [
{
name: 'should sort multiple imports on separate lines',
code: `
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
AsyncPipe,
RootComponent,
],
})
export class AppComponent {}`,
},
{
name: 'should not inlines singular imports when maxItems is 0',
code: `
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
RootComponent,
],
})
export class AppComponent {}`,
},
{
name: 'should inline singular imports when maxItems is 1',
options: [{ maxItems: 1 }],
code: `
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [RootComponent],
})
export class AppComponent {}`,
},
],
invalid: [
{
name: 'should sort multiple imports alphabetically',
code: `
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
RootComponent,
AsyncPipe,
],
})
export class AppComponent {}`,
errors: [
{
messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS,
},
],
output: `
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
AsyncPipe,
RootComponent,
],
})
export class AppComponent {}`,
},
{
name: 'should not put singular imports on one line when maxItems is 0',
code: `
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [RootComponent],
})
export class AppComponent {}`,
errors: [
{
messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS,
},
],
output: `
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
RootComponent,
],
})
export class AppComponent {}`,
},
{
name: 'should not put singular imports on a separate line when maxItems is 1',
options: [{ maxItems: 1 }],
code: `
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
RootComponent,
],
})
export class AppComponent {}`,
errors: [
{
messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS,
},
],
output: `
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [RootComponent],
})
export class AppComponent {}`,
},
{
name: 'should not display multiple imports on the same line',
code: `
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [AsyncPipe, RootComponent],
})
export class AppComponent {}`,
errors: [
{
messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS,
},
],
output: `
@Component({
selector: 'ds-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
AsyncPipe,
RootComponent,
],
})
export class AppComponent {}`,
},
],
};

View File

@@ -52,7 +52,6 @@ export const info = {
[Message.WRAPPER_IMPORTS_BASE]: 'Themed component wrapper classes must only import the base class',
},
},
optionDocs: [],
defaultOptions: [],
} as DSpaceESLintRuleInfo;
@@ -181,7 +180,7 @@ class Something {
selector: 'ds-base-test-themable',
standalone: true,
})
class TestThemeableComponent {
class TestThemeableTomponent {
}
`,
},
@@ -196,7 +195,7 @@ class TestThemeableComponent {
TestThemeableComponent,
],
})
class ThemedTestThemeableComponent extends ThemedComponent<TestThemeableComponent> {
class ThemedTestThemeableTomponent extends ThemedComponent<TestThemeableComponent> {
}
`,
},

View File

@@ -53,7 +53,6 @@ Unit tests are exempt from this rule, because they may redefine components using
[Message.THEMED]: 'Theme override of themeable component should have a selector starting with \'ds-themed-\'',
},
},
optionDocs: [],
defaultOptions: [],
} as DSpaceESLintRuleInfo;

View File

@@ -63,7 +63,6 @@ There are a few exceptions where the base class can still be used:
[Message.BASE_IN_MODULE]: 'Base themeable components shouldn\'t be declared in modules',
},
},
optionDocs: [],
defaultOptions: [],
} as DSpaceESLintRuleInfo;

View File

@@ -1,280 +0,0 @@
import {
AST_NODE_TYPES,
ESLintUtils,
TSESLint,
TSESTree,
} from '@typescript-eslint/utils';
import { fixture } from '../../../test/fixture';
import { isTestFile } from '../../util/filter';
import {
DSpaceESLintRuleInfo,
NamedTests,
OptionDoc,
} from '../../util/structure';
import { getFileTheme } from '../../util/theme-support';
export enum Message {
NO_THEME_DECLARED_IN_THEME_FILE = 'noThemeDeclaredInThemeFile',
THEME_DECLARED_IN_NON_THEME_FILE = 'themeDeclaredInNonThemeFile',
WRONG_THEME_DECLARED_IN_THEME_FILE = 'wrongThemeDeclaredInThemeFile',
}
interface ThemedDecoratorsOption {
decorators: { [name: string]: number };
}
interface ThemedDecoratorsDocsOption {
decorators: OptionDoc;
}
export const info: DSpaceESLintRuleInfo<[ThemedDecoratorsOption], [ThemedDecoratorsDocsOption]> = {
name: 'themed-decorators',
meta: {
docs: {
description: 'Entry components with theme support should declare the correct theme',
},
fixable: 'code',
messages: {
[Message.NO_THEME_DECLARED_IN_THEME_FILE]: 'No theme declaration in decorator',
[Message.THEME_DECLARED_IN_NON_THEME_FILE]: 'There is a theme declaration in decorator, but this file is not part of a theme',
[Message.WRONG_THEME_DECLARED_IN_THEME_FILE]: 'Wrong theme declaration in decorator',
},
type: 'problem',
schema: [
{
type: 'object',
properties: {
decorators: {
type: 'object',
},
},
},
],
},
optionDocs: [
{
decorators: {
title: '`decorators`',
description: 'A mapping for all the existing themeable decorators, with the decorator name as the key and the index of the `theme` argument as the value.',
},
},
],
defaultOptions: [
{
decorators: {
listableObjectComponent: 3,
rendersSectionForMenu: 2,
},
},
],
};
export const rule = ESLintUtils.RuleCreator.withoutDocs({
...info,
create(context: TSESLint.RuleContext<Message, unknown[]>, options: any) {
return {
[`ClassDeclaration > Decorator > CallExpression[callee.name=/^(${Object.keys(options[0].decorators).join('|')})$/]`]: (node: TSESTree.CallExpression) => {
if (isTestFile(context)) {
return;
}
if (node.callee.type !== AST_NODE_TYPES.Identifier) {
// We only support regular method identifiers
return;
}
const fileTheme = getFileTheme(context);
const themeDeclaration = getDeclaredTheme(options, node as TSESTree.CallExpression);
if (themeDeclaration === undefined) {
if (fileTheme !== undefined) {
context.report({
messageId: Message.NO_THEME_DECLARED_IN_THEME_FILE,
node: node,
fix(fixer) {
return fixer.insertTextAfter(node.arguments[node.arguments.length - 1], `, '${fileTheme as string}'`);
},
});
}
} else if (themeDeclaration?.type === AST_NODE_TYPES.Literal) {
if (fileTheme === undefined) {
context.report({
messageId: Message.THEME_DECLARED_IN_NON_THEME_FILE,
node: themeDeclaration,
fix(fixer) {
const idx = node.arguments.findIndex((v) => v.range === themeDeclaration.range);
if (idx === 0) {
return fixer.remove(themeDeclaration);
} else {
const previousArgument = node.arguments[idx - 1];
return fixer.removeRange([previousArgument.range[1], themeDeclaration.range[1]]); // todo: comma?
}
},
});
} else if (fileTheme !== themeDeclaration?.value) {
context.report({
messageId: Message.WRONG_THEME_DECLARED_IN_THEME_FILE,
node: themeDeclaration,
fix(fixer) {
return fixer.replaceText(themeDeclaration, `'${fileTheme as string}'`);
},
});
}
} else if (themeDeclaration?.type === AST_NODE_TYPES.Identifier && themeDeclaration.name === 'undefined') {
if (fileTheme !== undefined) {
context.report({
messageId: Message.NO_THEME_DECLARED_IN_THEME_FILE,
node: node,
fix(fixer) {
return fixer.replaceText(node.arguments[node.arguments.length - 1], `'${fileTheme as string}'`);
},
});
}
} else {
throw new Error('Unexpected theme declaration');
}
},
};
},
});
export const tests: NamedTests = {
plugin: info.name,
valid: [
{
name: 'theme file declares the correct theme in @listableObjectComponent',
code: `
@listableObjectComponent(something, somethingElse, undefined, 'test')
export class Something extends SomethingElse {
}
`,
filename: fixture('src/themes/test/app/dynamic-component/dynamic-component.ts'),
},
{
name: 'plain file declares no theme in @listableObjectComponent',
code: `
@listableObjectComponent(something, somethingElse, undefined)
export class Something extends SomethingElse {
}
`,
filename: fixture('src/app/dynamic-component/dynamic-component.ts'),
},
{
name: 'plain file declares explicit undefined theme in @listableObjectComponent',
code: `
@listableObjectComponent(something, somethingElse, undefined, undefined)
export class Something extends SomethingElse {
}
`,
filename: fixture('src/app/dynamic-component/dynamic-component.ts'),
},
{
name: 'test file declares theme outside of theme directory',
code: `
@listableObjectComponent(something, somethingElse, undefined, 'test')
export class Something extends SomethingElse {
}
`,
filename: fixture('src/app/dynamic-component/dynamic-component.spec.ts'),
},
{
name: 'only track configured decorators',
code: `
@something('test')
export class Something extends SomethingElse {
}
`,
filename: fixture('src/app/dynamic-component/dynamic-component.ts'),
},
],
invalid: [
{
name: 'theme file declares the wrong theme in @listableObjectComponent',
code: `
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
export class Something extends SomethingElse {
}
`,
filename: fixture('src/themes/test/app/dynamic-component/dynamic-component.ts'),
errors: [
{
messageId: 'wrongThemeDeclaredInThemeFile',
},
],
output: `
@listableObjectComponent(something, somethingElse, undefined, 'test')
export class Something extends SomethingElse {
}
`,
},
{
name: 'plain file declares a theme in @listableObjectComponent',
code: `
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
export class Something extends SomethingElse {
}
`,
filename: fixture('src/app/dynamic-component/dynamic-component.ts'),
errors: [
{
messageId: 'themeDeclaredInNonThemeFile',
},
],
output: `
@listableObjectComponent(something, somethingElse, undefined)
export class Something extends SomethingElse {
}
`,
},
{
name: 'theme file declares no theme in @listableObjectComponent',
code: `
@listableObjectComponent(something, somethingElse, undefined)
export class Something extends SomethingElse {
}
`,
filename: fixture('src/themes/test-2/app/dynamic-component/dynamic-component.ts'),
errors: [
{
messageId: 'noThemeDeclaredInThemeFile',
},
],
output: `
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
export class Something extends SomethingElse {
}
`,
},
{
name: 'theme file declares explicit undefined theme in @listableObjectComponent',
code: `
@listableObjectComponent(something, somethingElse, undefined, undefined)
export class Something extends SomethingElse {
}
`,
filename: fixture('src/themes/test-2/app/dynamic-component/dynamic-component.ts'),
errors: [
{
messageId: 'noThemeDeclaredInThemeFile',
},
],
output: `
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
export class Something extends SomethingElse {
}
`,
},
],
};
function getDeclaredTheme(options: [ThemedDecoratorsOption], decoratorCall: TSESTree.CallExpression): TSESTree.Node | undefined {
const index: number = options[0].decorators[(decoratorCall.callee as TSESTree.Identifier).name];
if (decoratorCall.arguments.length >= index + 1) {
return decoratorCall.arguments[index];
}
return undefined;
}

View File

@@ -1,158 +0,0 @@
import {
ESLintUtils,
TSESTree,
} from '@typescript-eslint/utils';
import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
import {
DSpaceESLintRuleInfo,
NamedTests,
} from '../../util/structure';
import { isThemedComponentWrapper } from '../../util/theme-support';
export enum Message {
WRAPPER_HAS_INPUT_DEFAULTS = 'wrapperHasInputDefaults',
}
export const info: DSpaceESLintRuleInfo = {
name: 'themed-wrapper-no-input-defaults',
meta: {
docs: {
description: 'ThemedComponent wrappers should not declare input defaults (see [DSpace Angular #2164](https://github.com/DSpace/dspace-angular/pull/2164))',
},
messages: {
[Message.WRAPPER_HAS_INPUT_DEFAULTS]: 'ThemedComponent wrapper declares inputs with defaults',
},
type: 'problem',
schema: [],
},
optionDocs: [],
defaultOptions: [],
};
export const rule = ESLintUtils.RuleCreator.withoutDocs({
...info,
create(context: RuleContext<any, any>, options: any) {
return {
'ClassBody > PropertyDefinition > Decorator > CallExpression[callee.name=\'Input\']': (node: TSESTree.CallExpression) => {
const classDeclaration = (node?.parent?.parent?.parent as TSESTree.Decorator); // todo: clean this up
if (!isThemedComponentWrapper(classDeclaration)) {
return;
}
const propertyDefinition: TSESTree.PropertyDefinition = (node.parent.parent as any); // todo: clean this up
if (propertyDefinition.value !== null) {
context.report({
messageId: Message.WRAPPER_HAS_INPUT_DEFAULTS,
node: propertyDefinition.value,
// fix(fixer) {
// // todo: don't strip type annotations!
// // todo: replace default with appropriate type annotation if not present!
// return fixer.removeRange([propertyDefinition.key.range[1], (propertyDefinition.value as any).range[1]]);
// }
});
}
},
};
},
});
export const tests: NamedTests = {
plugin: info.name,
valid: [
{
name: 'ThemedComponent wrapper defines an input without a default value',
code: `
export class TTest extends ThemedComponent<Test> {
@Input()
test;
}
`,
},
{
name: 'Regular class defines an input with a default value',
code: `
export class Test {
@Input()
test = 'test';
}
`,
},
],
invalid: [
{
name: 'ThemedComponent wrapper defines an input with a default value',
code: `
export class TTest extends ThemedComponent<Test> {
@Input()
test1 = 'test';
@Input()
test2 = true;
@Input()
test2: number = 123;
@Input()
test3: number[] = [1,2,3];
}
`,
errors: [
{
messageId: 'wrapperHasInputDefaults',
},
{
messageId: 'wrapperHasInputDefaults',
},
{
messageId: 'wrapperHasInputDefaults',
},
{
messageId: 'wrapperHasInputDefaults',
},
],
// output: `
// export class TTest extends ThemedComponent<Test> {
//
// @Input()
// test1: string;
//
// @Input()
// test2: boolean;
//
// @Input()
// test2: number;
//
// @Input()
// test3: number[];
// }
// `,
},
{
name: 'ThemedComponent wrapper defines an input with an undefined default value',
code: `
export class TTest extends ThemedComponent<Test> {
@Input()
test = undefined;
}
`,
errors: [
{
messageId: 'wrapperHasInputDefaults',
},
],
// output: `
// export class TTest extends ThemedComponent<Test> {
//
// @Input()
// test;
// }
// `,
},
],
};

View File

@@ -1,226 +0,0 @@
import {
AST_NODE_TYPES,
ESLintUtils,
TSESLint,
TSESTree,
} from '@typescript-eslint/utils';
import { isTestFile } from '../../util/filter';
import {
DSpaceESLintRuleInfo,
NamedTests,
OptionDoc,
} from '../../util/structure';
export enum Message {
DUPLICATE_DECORATOR_CALL = 'duplicateDecoratorCall',
}
/**
* Saves the decorators by decoratorName → file → Set<String>
*/
const decoratorCalls: Map<string, Map<string, Set<string>>> = new Map();
/**
* Keep a list of the files wo contain a decorator. This is done in order to prevent the `Program` selector from being
* run for every file.
*/
const fileWithDecorators: Set<string> = new Set();
export interface UniqueDecoratorsOptions {
decorators: string[];
}
export interface UniqueDecoratorsDocOptions {
decorators: OptionDoc;
}
export const info: DSpaceESLintRuleInfo<[UniqueDecoratorsOptions], [UniqueDecoratorsDocOptions]> = {
name: 'unique-decorators',
meta: {
docs: {
description: 'Some decorators must be called with unique arguments (e.g. when they construct a mapping based on the argument values)',
},
messages: {
[Message.DUPLICATE_DECORATOR_CALL]: 'Duplicate decorator call',
},
type: 'problem',
schema: [
{
type: 'object',
properties: {
decorators: {
type: 'array',
items: {
type: 'string',
},
},
},
},
],
},
optionDocs: [
{
decorators: {
title: '`decorators`',
description: 'The list of all the decorators for which you want to enforce this behavior.',
},
},
],
defaultOptions: [
{
decorators: [
'listableObjectComponent', // todo: must take default arguments into account!
],
},
],
};
export const rule = ESLintUtils.RuleCreator.withoutDocs({
...info,
create(context: TSESLint.RuleContext<Message, unknown[]>, options: any) {
return {
['Program']: () => {
if (fileWithDecorators.has(context.physicalFilename)) {
for (const decorator of options[0].decorators) {
decoratorCalls.get(decorator)?.get(context.physicalFilename)?.clear();
}
}
},
[`ClassDeclaration > Decorator > CallExpression[callee.name=/^(${options[0].decorators.join('|')})$/]`]: (node: TSESTree.CallExpression) => {
if (isTestFile(context)) {
return;
}
if (node.callee.type !== AST_NODE_TYPES.Identifier) {
// We only support regular method identifiers
return;
}
fileWithDecorators.add(context.physicalFilename);
if (!isUnique(node, context.physicalFilename)) {
context.report({
messageId: Message.DUPLICATE_DECORATOR_CALL,
node: node,
});
}
},
};
},
});
export const tests: NamedTests = {
plugin: info.name,
valid: [
{
name: 'checked decorator, no repetitions',
code: `
@listableObjectComponent(a)
export class A {
}
@listableObjectComponent(a, 'b')
export class B {
}
@listableObjectComponent(a, 'b', 3)
export class C {
}
@listableObjectComponent(a, 'b', 3, Enum.TEST1)
export class C {
}
@listableObjectComponent(a, 'b', 3, Enum.TEST2)
export class C {
}
`,
},
{
name: 'unchecked decorator, some repetitions',
code: `
@something(a)
export class A {
}
@something(a)
export class B {
}
`,
},
],
invalid: [
{
name: 'checked decorator, some repetitions',
code: `
@listableObjectComponent(a)
export class A {
}
@listableObjectComponent(a)
export class B {
}
`,
errors: [
{
messageId: 'duplicateDecoratorCall',
},
],
},
],
};
function callKey(node: TSESTree.CallExpression): string {
let key = '';
for (const arg of node.arguments) {
switch ((arg as TSESTree.Node).type) {
// todo: can we make this more generic somehow?
case AST_NODE_TYPES.Identifier:
key += (arg as TSESTree.Identifier).name;
break;
case AST_NODE_TYPES.Literal:
// eslint-disable-next-line @typescript-eslint/no-base-to-string
key += (arg as TSESTree.Literal).value;
break;
case AST_NODE_TYPES.MemberExpression:
key += (arg as any).object.name + '.' + (arg as any).property.name;
break;
default:
throw new Error(`Unrecognized decorator argument type: ${arg.type}`);
}
key += ', ';
}
return key;
}
function isUnique(node: TSESTree.CallExpression, filePath: string): boolean {
const decorator = (node.callee as TSESTree.Identifier).name;
if (!decoratorCalls.has(decorator)) {
decoratorCalls.set(decorator, new Map());
}
if (!decoratorCalls.get(decorator)!.has(filePath)) {
decoratorCalls.get(decorator)!.set(filePath, new Set());
}
const key = callKey(node);
let unique = true;
for (const decoratorCallsByFile of decoratorCalls.get(decorator)!.values()) {
if (decoratorCallsByFile.has(key)) {
unique = !unique;
break;
}
}
decoratorCalls.get(decorator)?.get(filePath)?.add(key);
return unique;
}

View File

@@ -1,10 +0,0 @@
import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
/**
* Determine whether the current file is a test file
* @param context the current ESLint rule context
*/
export function isTestFile(context: RuleContext<any, any>): boolean {
// note: shouldn't use plain .filename (doesn't work in DSpace Angular 7.4)
return context.getFilename()?.endsWith('.spec.ts') ;
}

View File

@@ -17,16 +17,10 @@ export type Meta = RuleMetaData<string, unknown[]>;
export type Valid = ValidTestCase<unknown[]>;
export type Invalid = InvalidTestCase<string, unknown[]>;
export interface DSpaceESLintRuleInfo<T = unknown[], D = unknown[]> {
export interface DSpaceESLintRuleInfo {
name: string;
meta: Meta,
optionDocs: D,
defaultOptions: T,
}
export interface OptionDoc {
title: string;
description: string;
defaultOptions: unknown[],
}
export interface NamedTests {

View File

@@ -7,11 +7,6 @@ _______
[Source code](../../../../lint/src/rules/<%- plugin.name.replace('dspace-angular-', '') %>/<%- rule.name %>.ts)
<% if (rule.optionDocs?.length > 0) { %>
### Options
<%- rule.optionDocs.map(optionDoc => Object.keys(optionDoc).map(option => '\n#### ' + optionDoc[option].title + '\n\n' + optionDoc[option].description)) %>
<% } %>
### Examples
<% if (tests.valid) {%>
@@ -24,13 +19,6 @@ Filename: `<%- test.filename %>`
```<%- plugin.language.toLowerCase() %>
<%- test.code.trim() %>
```
<% if (test?.options?.length > 0) { %>
With options:
```json
<%- JSON.stringify(test.options[0], null, 2) %>
```
<% }%>
<% }) %>
<% } %>
@@ -43,15 +31,6 @@ Filename: `<%- test.filename %>`
<% } %>
```<%- plugin.language.toLowerCase() %>
<%- test.code.trim() %>
<% if (test?.options?.length > 0) { %>
With options:
```json
<%- JSON.stringify(test.options[0], null, 2) %>
```
<% }%>
```
Will produce the following error(s):
```

View File

@@ -7,7 +7,6 @@
*/
import { TSESTree } from '@typescript-eslint/utils';
import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
import { readFileSync } from 'fs';
import { basename } from 'path';
import ts, { Identifier } from 'typescript';
@@ -264,18 +263,3 @@ export const DISALLOWED_THEME_SELECTORS = 'ds-(base|themed)-';
export function fixSelectors(text: string): string {
return text.replaceAll(/ds-(base|themed)-/g, 'ds-');
}
/**
* Determine the theme of the current file based on its path in the project.
* @param context the current ESLint rule context
*/
export function getFileTheme(context: RuleContext<any, any>): string | undefined {
// note: shouldn't use plain .filename (doesn't work in DSpace Angular 7.4)
const m = context.getFilename()?.match(/\/src\/themes\/([^/]+)\//);
if (m?.length === 2) {
return m[1];
}
return undefined;
}

View File

@@ -6,8 +6,6 @@
* http://www.dspace.org/license/
*/
import { RuleMetaData } from '@typescript-eslint/utils/ts-eslint';
import { default as html } from '../src/rules/html';
import { default as ts } from '../src/rules/ts';
@@ -71,16 +69,6 @@ describe('plugin structure', () => {
expect(ruleExports.tests.valid.length).toBeGreaterThan(0);
expect(ruleExports.tests.invalid.length).toBeGreaterThan(0);
});
it('should contain a valid ESLint rule', () => {
// we don't have a better way to enforce this, but it's something at least
expect((ruleExports.rule as any).name).toBeUndefined(
'Rules should be passed to RuleCreator, omitting info.name since it is not part of the RuleWithMeta interface',
);
expect(ruleExports.rule.create).toBeTruthy();
expect(ruleExports.rule.meta).toEqual(ruleExports.info.meta as RuleMetaData<string, []>);
});
});
}
});

23477
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,31 +1,30 @@
{
"name": "dspace-angular",
"version": "9.0.0",
"version": "8.2.0",
"scripts": {
"ng": "ng",
"config:watch": "nodemon",
"test:rest": "ts-node --project ./tsconfig.ts-node.json scripts/test-rest.ts",
"start": "npm run start:prod",
"start:dev": "nodemon --exec \"cross-env NODE_ENV=development npm run serve\"",
"start:prod": "npm run build:prod && cross-env NODE_ENV=production npm run serve:ssr",
"start:mirador:prod": "npm run build:mirador && npm run start:prod",
"preserve": "npm run base-href",
"start": "yarn run start:prod",
"start:dev": "nodemon --exec \"cross-env NODE_ENV=development yarn run serve\"",
"start:prod": "yarn run build:prod && cross-env NODE_ENV=production yarn run serve:ssr",
"start:mirador:prod": "yarn run build:mirador && yarn run start:prod",
"preserve": "yarn base-href",
"serve": "ts-node --project ./tsconfig.ts-node.json scripts/serve.ts",
"serve:ssr": "node dist/server/main",
"analyze": "webpack-bundle-analyzer dist/browser/stats.json",
"build": "ng build --configuration development",
"build:stats": "ng build --stats-json",
"build:prod": "cross-env NODE_ENV=production npm run build:ssr",
"build:prod": "cross-env NODE_ENV=production yarn run build:ssr",
"build:ssr": "ng build --configuration production && ng run dspace-angular:server:production",
"build:lint": "rimraf 'lint/dist/**/*.js' 'lint/dist/**/*.js.map' && tsc -b lint/tsconfig.json",
"test": "ng test --source-map=true --watch=false --configuration test",
"test:watch": "nodemon --exec \"ng test --source-map=true --watch=true --configuration test\"",
"test:headless": "ng test --source-map=true --watch=false --configuration test --browsers=ChromeHeadless --code-coverage",
"test:lint": "npm run build:lint && npm run test:lint:nobuild",
"test:lint": "yarn build:lint && yarn test:lint:nobuild",
"test:lint:nobuild": "jasmine --config=lint/jasmine.json",
"lint": "npm run build:lint && npm run lint:nobuild",
"lint": "yarn build:lint && yarn lint:nobuild",
"lint:nobuild": "ng lint",
"lint-fix": "npm run build:lint && ng lint --fix=true",
"lint-fix": "yarn build:lint && ng lint --fix=true",
"docs:lint": "ts-node --project ./lint/tsconfig.json ./lint/generate-docs.ts",
"e2e": "cross-env NODE_ENV=production ng e2e",
"clean:dev:config": "rimraf src/assets/config.json",
@@ -36,8 +35,8 @@
"clean:json": "rimraf *.records.json",
"clean:node": "rimraf node_modules",
"clean:cli": "rimraf .angular/cache",
"clean:prod": "npm run clean:dist && npm run clean:log && npm run clean:doc && npm run clean:coverage && npm run clean:json",
"clean": "npm run clean:prod && npm run clean:dev:config && npm run clean:cli && npm run clean:node",
"clean:prod": "yarn run clean:dist && yarn run clean:log && yarn run clean:doc && yarn run clean:coverage && yarn run clean:json",
"clean": "yarn run clean:prod && yarn run clean:dev:config && yarn run clean:cli && yarn run clean:node",
"sync-i18n": "ts-node --project ./tsconfig.ts-node.json scripts/sync-i18n-files.ts",
"build:mirador": "webpack --config webpack/webpack.mirador.config.ts",
"merge-i18n": "ts-node --project ./tsconfig.ts-node.json scripts/merge-i18n-files.ts",
@@ -46,7 +45,7 @@
"env:yaml": "ts-node --project ./tsconfig.ts-node.json scripts/env-to-yaml.ts",
"base-href": "ts-node --project ./tsconfig.ts-node.json scripts/base-href.ts",
"check-circ-deps": "npx madge --exclude '(bitstream|bundle|collection|config-submission-form|eperson|item|version)\\.model\\.ts$' --circular --extensions ts ./",
"postinstall": "npm run build:lint || echo 'Skipped DSpace ESLint plugins.'"
"postinstall": "yarn build:lint || echo 'Skipped DSpace ESLint plugins.'"
},
"browser": {
"fs": false,
@@ -55,74 +54,36 @@
"https": false
},
"private": true,
"overrides": {
"@kolkov/ngx-gallery": {
"@angular/animations": "^18.2.12",
"@angular/common": "^18.2.12",
"@angular/core": "^18.2.12"
},
"@ng-bootstrap/ng-bootstrap": {
"@angular/common": "^18.2.12",
"@angular/core": "^18.2.12",
"@angular/forms": "^18.2.12",
"@angular/localize": "^18.2.12"
},
"@ng-dynamic-forms/core": {
"@angular/common": "^18.2.12",
"@angular/core": "^18.2.12",
"@angular/forms": "^18.2.12"
},
"@ng-dynamic-forms/ui-ng-bootstrap": {
"ngx-mask": "14.2.4",
"@ng-bootstrap/ng-bootstrap": "^12.0.0",
"bootstrap": "^5.3"
},
"@nicky-lenaers/ngx-scroll-to": {
"@angular/common": "^18.2.12",
"@angular/core": "^18.2.12"
},
"eslint-plugin-unused-imports": {
"@typescript-eslint/eslint-plugin": "^7.2.0"
},
"ngx-infinite-scroll": {
"@angular/common": "^18.2.12",
"@angular/core": "^18.2.12"
},
"notistack": "3.0.1"
},
"dependencies": {
"@angular/animations": "^18.2.12",
"@angular/cdk": "^18.2.12",
"@angular/common": "^18.2.12",
"@angular/compiler": "^18.2.12",
"@angular/core": "^18.2.12",
"@angular/forms": "^18.2.12",
"@angular/localize": "^18.2.12",
"@angular/platform-browser": "^18.2.12",
"@angular/platform-browser-dynamic": "^18.2.12",
"@angular/platform-server": "^18.2.12",
"@angular/router": "^18.2.12",
"@angular/ssr": "^18.2.19",
"@babel/runtime": "7.27.1",
"@angular/animations": "^17.3.11",
"@angular/cdk": "^17.3.10",
"@angular/common": "^17.3.11",
"@angular/compiler": "^17.3.11",
"@angular/core": "^17.3.11",
"@angular/forms": "^17.3.11",
"@angular/localize": "17.3.12",
"@angular/platform-browser": "^17.3.11",
"@angular/platform-browser-dynamic": "^17.3.11",
"@angular/platform-server": "^17.3.11",
"@angular/router": "^17.3.11",
"@angular/ssr": "^17.3.17",
"@babel/runtime": "7.27.6",
"@kolkov/ngx-gallery": "^2.0.1",
"@ng-bootstrap/ng-bootstrap": "^12.0.0",
"@ng-bootstrap/ng-bootstrap": "^11.0.0",
"@ng-dynamic-forms/core": "^16.0.0",
"@ng-dynamic-forms/ui-ng-bootstrap": "^16.0.0",
"@ngrx/effects": "^18.1.1",
"@ngrx/operators": "^18.0.0",
"@ngrx/router-store": "^18.1.1",
"@ngrx/store": "^18.1.1",
"@ngx-translate/core": "^16.0.3",
"@ngrx/effects": "^17.1.1",
"@ngrx/router-store": "^17.1.1",
"@ngrx/store": "^17.1.1",
"@ngx-translate/core": "^14.0.0",
"@nicky-lenaers/ngx-scroll-to": "^14.0.0",
"@terraformer/wkt": "^2.2.1",
"altcha": "^0.9.0",
"angulartics2": "^12.2.0",
"axios": "^1.9.0",
"bootstrap": "^5.3",
"axios": "^1.10.0",
"bootstrap": "^4.6.1",
"cerialize": "0.1.18",
"cli-progress": "^3.12.0",
"colors": "^1.4.0",
"compression": "^1.7.5",
"compression": "^1.8.0",
"cookie-parser": "1.4.7",
"core-js": "^3.42.0",
"date-fns": "^2.29.3",
@@ -132,7 +93,7 @@
"express": "^4.21.2",
"express-rate-limit": "^5.1.3",
"fast-json-patch": "^3.1.1",
"filesize": "^10.1.6",
"filesize": "^6.1.0",
"http-proxy-middleware": "^2.0.9",
"http-terminator": "^3.2.0",
"isbot": "^5.1.28",
@@ -141,71 +102,69 @@
"json5": "^2.2.3",
"jsonschema": "1.5.0",
"jwt-decode": "^3.1.2",
"leaflet": "^1.9.4",
"leaflet-providers": "^2.0.0",
"leaflet.markercluster": "^1.5.3",
"lodash-es": "^4.17.21",
"klaro": "^0.7.18",
"lodash": "^4.17.21",
"lru-cache": "^7.14.1",
"markdown-it": "^13.0.1",
"mirador": "^3.4.3",
"mirador-dl-plugin": "^0.13.0",
"mirador-share-plugin": "^0.16.0",
"morgan": "^1.10.0",
"ng2-file-upload": "7.0.1",
"ng2-file-upload": "5.0.0",
"ng2-nouislider": "^2.0.0",
"ngx-infinite-scroll": "^18.0.0",
"ngx-matomo-client": "^6.4.1",
"ngx-infinite-scroll": "^16.0.0",
"ngx-pagination": "6.0.3",
"ngx-skeleton-loader": "^9.0.0",
"ngx-ui-switch": "^15.0.0",
"ngx-ui-switch": "^14.1.0",
"nouislider": "^15.7.1",
"orejime": "^2.3.1",
"pem": "1.14.8",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.0",
"rxjs": "^7.8.2",
"uuid": "^8.3.2",
"zone.js": "~0.14.10"
"zone.js": "~0.14.0"
},
"devDependencies": {
"@angular-builders/custom-webpack": "~18.0.0",
"@angular-devkit/build-angular": "^18.2.19",
"@angular-eslint/builder": "^18.4.1",
"@angular-eslint/bundled-angular-compiler": "^18.4.1",
"@angular-eslint/eslint-plugin": "^18.4.1",
"@angular-eslint/eslint-plugin-template": "^18.4.1",
"@angular-eslint/schematics": "^18.4.1",
"@angular-eslint/template-parser": "^18.4.1",
"@angular-eslint/utils": "^18.4.1",
"@angular/cli": "^18.2.19",
"@angular/compiler-cli": "^18.2.12",
"@angular/language-service": "^18.2.12",
"@angular-builders/custom-webpack": "~17.0.2",
"@angular-devkit/build-angular": "^17.3.17",
"@angular-eslint/builder": "17.5.3",
"@angular-eslint/bundled-angular-compiler": "17.5.3",
"@angular-eslint/eslint-plugin": "17.5.3",
"@angular-eslint/eslint-plugin-template": "17.5.3",
"@angular-eslint/schematics": "17.5.3",
"@angular-eslint/template-parser": "17.5.3",
"@angular/cli": "^17.3.17",
"@angular/compiler-cli": "^17.3.11",
"@angular/language-service": "^17.3.11",
"@cypress/schematic": "^1.5.0",
"@fortawesome/fontawesome-free": "^6.7.2",
"@ngrx/store-devtools": "^18.1.1",
"@ngtools/webpack": "^18.2.19",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"@ngrx/store-devtools": "^17.1.1",
"@ngtools/webpack": "^16.2.16",
"@types/deep-freeze": "0.1.5",
"@types/ejs": "^3.1.2",
"@types/express": "^4.17.17",
"@types/grecaptcha": "^3.0.9",
"@types/jasmine": "~3.6.0",
"@types/js-cookie": "2.2.6",
"@types/lodash-es": "^4.17.12",
"@types/lodash": "^4.17.17",
"@types/node": "^14.14.9",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@typescript-eslint/rule-tester": "^7.18.0",
"@typescript-eslint/utils": "^7.18.0",
"axe-core": "^4.10.2",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@typescript-eslint/rule-tester": "^7.2.0",
"@typescript-eslint/utils": "^7.2.0",
"axe-core": "^4.10.3",
"compression-webpack-plugin": "^9.2.0",
"copy-webpack-plugin": "^6.4.1",
"cross-env": "^7.0.3",
"csstype": "^3.1.3",
"cypress": "^13.17.0",
"cypress-axe": "^1.6.0",
"deep-freeze": "0.0.1",
"eslint": "^8.39.0",
"eslint-plugin-deprecation": "^1.4.1",
"eslint-plugin-dspace-angular-html": "file:./lint/dist/src/rules/html",
"eslint-plugin-dspace-angular-ts": "file:./lint/dist/src/rules/ts",
"eslint-plugin-dspace-angular-html": "link:./lint/dist/src/rules/html",
"eslint-plugin-dspace-angular-ts": "link:./lint/dist/src/rules/ts",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-import-newlines": "^1.3.1",
"eslint-plugin-jsdoc": "^45.0.0",
@@ -218,26 +177,30 @@
"jasmine": "^3.8.0",
"jasmine-core": "^3.8.0",
"jasmine-marbles": "0.9.2",
"karma": "^6.4.4",
"karma": "^6.4.2",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"karma-mocha-reporter": "2.2.5",
"ng-mocks": "^14.13.4",
"ng-mocks": "^14.13.5",
"ngx-mask": "14.2.4",
"nodemon": "^2.0.22",
"postcss": "^8.5",
"postcss-import": "^14.0.0",
"postcss-loader": "^4.0.3",
"postcss-preset-env": "^7.4.2",
"prop-types": "^15.8.1",
"react": "^16.14.0",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^16.14.0",
"rimraf": "^3.0.2",
"sass": "~1.89.0",
"sass": "~1.89.2",
"sass-loader": "^12.6.0",
"sass-resources-loader": "^2.2.5",
"ts-node": "^8.10.2",
"typescript": "~5.4.5",
"webpack": "5.99.8",
"webpack": "5.99.9",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
}

View File

@@ -38,7 +38,7 @@ parseCliInput();
function parseCliInput() {
program
.option('-d, --output-dir <output-dir>', 'output dir when running script on all language files', projectRoot(LANGUAGE_FILES_LOCATION))
.option('-s, --source-dir <source-dir>', 'source dir of translations to be merged')
.option('-s, --source-dir <source-dir>', 'source dir of transalations to be merged')
.usage('(-s <source-dir> [-d <output-dir>])')
.parse(process.argv);

View File

@@ -20,10 +20,10 @@ import 'reflect-metadata';
/* eslint-disable import/no-namespace */
import * as morgan from 'morgan';
import express from 'express';
import * as express from 'express';
import * as ejs from 'ejs';
import * as compression from 'compression';
import expressStaticGzip from 'express-static-gzip';
import * as expressStaticGzip from 'express-static-gzip';
/* eslint-enable import/no-namespace */
import axios from 'axios';
import LRU from 'lru-cache';
@@ -103,7 +103,7 @@ export function app() {
* If production mode is enabled in the environment file:
* - Enable Angular's production mode
* - Initialize caching of SSR rendered pages (if enabled in config.yml)
* - Enable compression for SSR responses. See [compression](https://github.com/expressjs/compression)
* - Enable compression for SSR reponses. See [compression](https://github.com/expressjs/compression)
*/
if (environment.production) {
enableProdMode();
@@ -437,7 +437,7 @@ function checkCacheForRequest(cacheName: string, cache: LRU<string, any>, req, r
if (environment.cache.serverSide.debug) { console.log(`CACHE EXPIRED FOR ${key} in ${cacheName} cache. Re-rendering...`); }
// Update cached copy by rerendering server-side
// NOTE: In this scenario the currently cached copy will be returned to the current user.
// This re-render is performed behind the scenes to update cached copy for next user.
// This re-render is peformed behind the scenes to update cached copy for next user.
serverSideRender(req, res, next, false);
}
} else {

View File

@@ -1,13 +1,19 @@
<ngb-accordion #acc="ngbAccordion" [activeIds]="'browse'">
<ngb-panel [id]="'browse'">
<ng-template ngbPanelTitle>
<div class="w-100 d-flex gap-3 justify-content-between collapse-toggle" (click)="acc.toggle('browse')"
data-test="browse">
<ng-template ngbPanelHeader>
<div class="w-100 d-flex gap-3 justify-content-between collapse-toggle" ngbPanelToggle (click)="acc.toggle('browse')"
data-test="browse">
<button type="button" class="btn btn-link p-0" (click)="$event.preventDefault()"
[attr.aria-expanded]="acc.isExpanded('browse')"
aria-controls="bulk-access-browse-panel-content">
[attr.aria-expanded]="acc.isExpanded('browse')"
aria-controls="bulk-access-browse-panel-content">
{{ 'admin.access-control.bulk-access-browse.header' | translate }}
</button>
<div class="text-right d-flex gap-2">
<div class="d-flex my-auto">
<span *ngIf="acc.isExpanded('browse')" class="fas fa-chevron-up fa-fw"></span>
<span *ngIf="!acc.isExpanded('browse')" class="fas fa-chevron-down fa-fw"></span>
</div>
</div>
</div>
</ng-template>
<ng-template ngbPanelContent>
@@ -16,11 +22,11 @@
<li [ngbNavItem]="'search'" role="presentation">
<a ngbNavLink>{{'admin.access-control.bulk-access-browse.search.header' | translate}}</a>
<ng-template ngbNavContent>
<div class="bulk-access-search">
<div class="mx-n3">
<ds-search [configuration]="'administrativeBulkAccess'"
[selectable]="true"
[selectionConfig]="{ repeatable: true, listId: listId }"
[showThumbnails]="false"></ds-search>
[selectable]="true"
[selectionConfig]="{ repeatable: true, listId: listId }"
[showThumbnails]="false"></ds-search>
</div>
</ng-template>
</li>
@@ -36,25 +42,21 @@
[showPaginator]="false"
(prev)="pagePrev()"
(next)="pageNext()">
@if ((objectsSelected$|async)?.hasSucceeded) {
<ul class="list-unstyled ms-4">
@for (object of (objectsSelected$|async)?.payload?.page | paginate: { itemsPerPage: (paginationOptions$ | async).pageSize,
currentPage: (paginationOptions$ | async).currentPage, totalItems: (objectsSelected$|async)?.payload?.page.length }; track object; let i = $index; let last = $last) {
<li
class="mt-4 mb-4 d-flex"
[attr.data-test]="'list-object' | dsBrowserOnly">
<ds-selectable-list-item-control [index]="i"
[object]="object"
[selectionConfig]="{ repeatable: true, listId: listId }"></ds-selectable-list-item-control>
<ds-listable-object-component-loader [listID]="listId"
[index]="i"
[object]="object"
[showThumbnails]="false"
[viewMode]="'list'"></ds-listable-object-component-loader>
</li>
}
</ul>
}
<ul *ngIf="(objectsSelected$|async)?.hasSucceeded" class="list-unstyled ml-4">
<li *ngFor='let object of (objectsSelected$|async)?.payload?.page | paginate: { itemsPerPage: (paginationOptions$ | async).pageSize,
currentPage: (paginationOptions$ | async).currentPage, totalItems: (objectsSelected$|async)?.payload?.page.length }; let i = index; let last = last '
class="mt-4 mb-4 d-flex"
[attr.data-test]="'list-object' | dsBrowserOnly">
<ds-selectable-list-item-control [index]="i"
[object]="object"
[selectionConfig]="{ repeatable: true, listId: listId }"></ds-selectable-list-item-control>
<ds-listable-object-component-loader [listID]="listId"
[index]="i"
[object]="object"
[showThumbnails]="false"
[viewMode]="'list'"></ds-listable-object-component-loader>
</li>
</ul>
</ds-pagination>
</ng-template>
</li>

View File

@@ -1,4 +0,0 @@
.bulk-access-search {
margin-right: calc(var(--bs-gutter-x, 1.5rem) / -2);
margin-left: calc(var(--bs-gutter-x, 1.5rem) / -2);
}

View File

@@ -1,4 +1,8 @@
import { AsyncPipe } from '@angular/common';
import {
AsyncPipe,
NgForOf,
NgIf,
} from '@angular/common';
import {
Component,
Input,
@@ -51,16 +55,18 @@ import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe';
},
],
imports: [
AsyncPipe,
BrowserOnlyPipe,
ListableObjectComponentLoaderComponent,
NgbAccordionModule,
NgbNavModule,
NgxPaginationModule,
PaginationComponent,
SelectableListItemControlComponent,
ThemedSearchComponent,
AsyncPipe,
NgbAccordionModule,
TranslateModule,
NgIf,
NgbNavModule,
ThemedSearchComponent,
BrowserOnlyPipe,
NgForOf,
NgxPaginationModule,
SelectableListItemControlComponent,
ListableObjectComponentLoaderComponent,
],
standalone: true,
})

View File

@@ -7,7 +7,7 @@
<hr>
<div class="d-flex justify-content-end">
<button class="btn btn-outline-primary me-3" (click)="reset()">
<button class="btn btn-outline-primary mr-3" (click)="reset()">
{{ 'access-control-cancel' | translate }}
</button>
<button class="btn btn-primary" [dsBtnDisabled]="!canExport()" (click)="submit()">

View File

@@ -26,10 +26,10 @@ import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.com
templateUrl: './bulk-access.component.html',
styleUrls: ['./bulk-access.component.scss'],
imports: [
BtnDisabledDirective,
BulkAccessBrowseComponent,
BulkAccessSettingsComponent,
TranslateModule,
BulkAccessSettingsComponent,
BulkAccessBrowseComponent,
BtnDisabledDirective,
],
standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush,

View File

@@ -1,11 +1,17 @@
<ngb-accordion #acc="ngbAccordion" [activeIds]="'settings'">
<ngb-panel [id]="'settings'">
<ng-template ngbPanelTitle>
<ng-template ngbPanelHeader>
<div class="w-100 d-flex gap-3 justify-content-between collapse-toggle" ngbPanelToggle (click)="acc.toggle('settings')" data-test="settings">
<button type="button" class="btn btn-link p-0" (click)="$event.preventDefault()" [attr.aria-expanded]="acc.isExpanded('settings')"
aria-controls="bulk-access-settings-panel-content">
{{ 'admin.access-control.bulk-access-settings.header' | translate }}
</button>
<div class="text-right d-flex gap-2">
<div class="d-flex my-auto">
<span *ngIf="acc.isExpanded('settings')" class="fas fa-chevron-up fa-fw"></span>
<span *ngIf="!acc.isExpanded('settings')" class="fas fa-chevron-down fa-fw"></span>
</div>
</div>
</div>
</ng-template>
<ng-template ngbPanelContent>

View File

@@ -1,4 +1,4 @@
import { NgIf } from '@angular/common';
import {
Component,
ViewChild,
@@ -14,9 +14,10 @@ import { AccessControlFormContainerComponent } from '../../../shared/access-cont
styleUrls: ['./bulk-access-settings.component.scss'],
exportAs: 'dsBulkSettings',
imports: [
AccessControlFormContainerComponent,
NgbAccordionModule,
TranslateModule,
NgIf,
AccessControlFormContainerComponent,
],
standalone: true,
})

View File

@@ -5,10 +5,10 @@
<h1 id="header" class="pb-2">{{labelPrefix + 'head' | translate}}</h1>
<div>
<button class="me-auto btn btn-success addEPerson-button"
[routerLink]="'create'">
<button class="mr-auto btn btn-success addEPerson-button"
[routerLink]="'create'">
<i class="fas fa-plus"></i>
<span class="d-none d-sm-inline ms-1">{{labelPrefix + 'button.add' | translate}}</span>
<span class="d-none d-sm-inline ml-1">{{labelPrefix + 'button.add' | translate}}</span>
</button>
</div>
</div>
@@ -18,84 +18,77 @@
</h2>
<form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)" class="d-flex justify-content-between">
<div>
<select name="scope" id="scope" formControlName="scope" class="form-select" aria-label="Search scope">
<select name="scope" id="scope" formControlName="scope" class="form-control" aria-label="Search scope">
<option value="metadata">{{labelPrefix + 'search.scope.metadata' | translate}}</option>
<option value="email">{{labelPrefix + 'search.scope.email' | translate}}</option>
</select>
</div>
<div class="flex-grow-1 me-3 ms-3">
<div class="mb-3 input-group">
<div class="flex-grow-1 mr-3 ml-3">
<div class="form-group input-group">
<input type="text" name="query" id="query" formControlName="query"
class="form-control" [attr.aria-label]="labelPrefix + 'search.placeholder' | translate"
[placeholder]="(labelPrefix + 'search.placeholder' | translate)">
class="form-control" [attr.aria-label]="labelPrefix + 'search.placeholder' | translate"
[placeholder]="(labelPrefix + 'search.placeholder' | translate)">
<span class="input-group-append">
<button type="submit" class="search-button btn btn-primary">
<i class="fas fa-search"></i> {{ labelPrefix + 'search.button' | translate }}
</button>
</span>
<button type="submit" class="search-button btn btn-primary">
<i class="fas fa-search"></i> {{ labelPrefix + 'search.button' | translate }}
</button>
</span>
</div>
</div>
<div>
<button (click)="clearFormAndResetResult();"
class="search-button btn btn-secondary">{{labelPrefix + 'button.see-all' | translate}}</button>
class="search-button btn btn-secondary">{{labelPrefix + 'button.see-all' | translate}}</button>
</div>
</form>
@if (searching$ | async) {
<ds-loading></ds-loading>
}
@if ((pageInfoState$ | async)?.totalElements > 0 && (searching$ | async) !== true) {
<ds-pagination
[paginationOptions]="config"
[collectionSize]="(pageInfoState$ | async)?.totalElements"
[hideGear]="true"
[hidePagerWhenSinglePage]="true">
<div class="table-responsive">
<table id="epeople" class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th scope="col">{{labelPrefix + 'table.id' | translate}}</th>
<th scope="col">{{labelPrefix + 'table.name' | translate}}</th>
<th scope="col">{{labelPrefix + 'table.email' | translate}}</th>
<th>{{labelPrefix + 'table.edit' | translate}}</th>
</tr>
</thead>
<tbody>
@for (epersonDto of (ePeopleDto$ | async)?.page; track epersonDto) {
<tr
[ngClass]="{'table-primary' : (activeEPerson$ | async) === epersonDto.eperson}">
<td>{{epersonDto.eperson.id}}</td>
<td>{{ dsoNameService.getName(epersonDto.eperson) }}</td>
<td>{{epersonDto.eperson.email}}</td>
<td>
<div class="btn-group edit-field">
<button [routerLink]="getEditEPeoplePage(epersonDto.eperson.id)"
<ds-loading *ngIf="searching$ | async"></ds-loading>
<ds-pagination
*ngIf="(pageInfoState$ | async)?.totalElements > 0 && (searching$ | async) !== true"
[paginationOptions]="config"
[collectionSize]="(pageInfoState$ | async)?.totalElements"
[hideGear]="true"
[hidePagerWhenSinglePage]="true">
<div class="table-responsive">
<table id="epeople" class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th scope="col">{{labelPrefix + 'table.id' | translate}}</th>
<th scope="col">{{labelPrefix + 'table.name' | translate}}</th>
<th scope="col">{{labelPrefix + 'table.email' | translate}}</th>
<th>{{labelPrefix + 'table.edit' | translate}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let epersonDto of (ePeopleDto$ | async)?.page"
[ngClass]="{'table-primary' : (activeEPerson$ | async) === epersonDto.eperson}">
<td>{{epersonDto.eperson.id}}</td>
<td>{{ dsoNameService.getName(epersonDto.eperson) }}</td>
<td>{{epersonDto.eperson.email}}</td>
<td>
<div class="btn-group edit-field">
<button [routerLink]="getEditEPeoplePage(epersonDto.eperson.id)"
class="btn btn-outline-primary btn-sm access-control-editEPersonButton"
title="{{labelPrefix + 'table.edit.buttons.edit' | translate: { name: dsoNameService.getName(epersonDto.eperson) } }}">
<i class="fas fa-edit fa-fw"></i>
</button>
@if (epersonDto.ableToDelete) {
<button (click)="deleteEPerson(epersonDto.eperson)"
class="delete-button btn btn-outline-danger btn-sm access-control-deleteEPersonButton"
title="{{labelPrefix + 'table.edit.buttons.remove' | translate: { name: dsoNameService.getName(epersonDto.eperson) } }}">
<i class="fas fa-trash-alt fa-fw"></i>
</button>
}
</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</ds-pagination>
}
@if ((pageInfoState$ | async)?.totalElements === 0) {
<div class="alert alert-info w-100 mb-2" role="alert">
{{labelPrefix + 'no-items' | translate}}
<i class="fas fa-edit fa-fw"></i>
</button>
<button *ngIf="epersonDto.ableToDelete" (click)="deleteEPerson(epersonDto.eperson)"
class="delete-button btn btn-outline-danger btn-sm access-control-deleteEPersonButton"
title="{{labelPrefix + 'table.edit.buttons.remove' | translate: { name: dsoNameService.getName(epersonDto.eperson) } }}">
<i class="fas fa-trash-alt fa-fw"></i>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
}
</ds-pagination>
<div *ngIf="(pageInfoState$ | async)?.totalElements === 0" class="alert alert-info w-100 mb-2" role="alert">
{{labelPrefix + 'no-items' | translate}}
</div>
</div>
</div>
</div>

View File

@@ -27,7 +27,7 @@ import {
import { TranslateModule } from '@ngx-translate/core';
import {
Observable,
of,
of as observableOf,
} from 'rxjs';
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
@@ -85,7 +85,7 @@ describe('EPeopleRegistryComponent', () => {
}), this.allEpeople));
},
getActiveEPerson(): Observable<EPerson> {
return of(this.activeEPerson);
return observableOf(this.activeEPerson);
},
searchByScope(scope: string, query: string, options: FindListOptions = {}): Observable<RemoteData<PaginatedList<EPerson>>> {
if (scope === 'email') {
@@ -129,7 +129,7 @@ describe('EPeopleRegistryComponent', () => {
this.allEpeople = this.allEpeople.filter((ePerson2: EPerson) => {
return (ePerson2.uuid !== ePerson.uuid);
});
return of(true);
return observableOf(true);
},
editEPerson(ePerson: EPerson) {
this.activeEPerson = ePerson;
@@ -145,7 +145,7 @@ describe('EPeopleRegistryComponent', () => {
},
};
authorizationService = jasmine.createSpyObj('authorizationService', {
isAuthorized: of(true),
isAuthorized: observableOf(true),
});
builderService = getMockFormBuilderService();
@@ -180,7 +180,7 @@ describe('EPeopleRegistryComponent', () => {
fixture = TestBed.createComponent(EPeopleRegistryComponent);
component = fixture.componentInstance;
modalService = TestBed.inject(NgbModal);
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: of(true) }) }));
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) }));
fixture.detectChanges();
});
@@ -261,7 +261,7 @@ describe('EPeopleRegistryComponent', () => {
it('should hide delete EPerson button when the isAuthorized returns false', () => {
spyOn(authorizationService, 'isAuthorized').and.returnValue(of(false));
spyOn(authorizationService, 'isAuthorized').and.returnValue(observableOf(false));
component.initialisePage();
fixture.detectChanges();

View File

@@ -1,6 +1,8 @@
import {
AsyncPipe,
NgClass,
NgForOf,
NgIf,
} from '@angular/common';
import {
Component,
@@ -67,14 +69,16 @@ import { EPersonFormComponent } from './eperson-form/eperson-form.component';
selector: 'ds-epeople-registry',
templateUrl: './epeople-registry.component.html',
imports: [
AsyncPipe,
EPersonFormComponent,
NgClass,
PaginationComponent,
ReactiveFormsModule,
RouterModule,
ThemedLoadingComponent,
TranslateModule,
RouterModule,
AsyncPipe,
NgIf,
EPersonFormComponent,
ReactiveFormsModule,
ThemedLoadingComponent,
PaginationComponent,
NgClass,
NgForOf,
],
standalone: true,
})

View File

@@ -2,111 +2,97 @@
<div class="group-form row">
<div class="col-12">
@if (activeEPerson$ | async) {
<h1 class="border-bottom pb-2">{{messagePrefix + '.edit' | translate}}</h1>
} @else {
<div *ngIf="activeEPerson$ | async; then editHeader; else createHeader"></div>
<ng-template #createHeader>
<h1 class="border-bottom pb-2">{{messagePrefix + '.create' | translate}}</h1>
}
</ng-template>
<ng-template #editHeader>
<h1 class="border-bottom pb-2">{{messagePrefix + '.edit' | translate}}</h1>
</ng-template>
<ds-form [formId]="formId"
[formModel]="formModel"
[formGroup]="formGroup"
[formLayout]="formLayout"
[displayCancel]="false"
[submitLabel]="submitLabel"
(submitForm)="onSubmit()">
[formModel]="formModel"
[formGroup]="formGroup"
[formLayout]="formLayout"
[displayCancel]="false"
[submitLabel]="submitLabel"
(submitForm)="onSubmit()">
<div before class="btn-group">
<button (click)="onCancel()" type="button" class="btn btn-outline-secondary">
<i class="fas fa-arrow-left"></i> {{messagePrefix + '.return' | translate}}
</button>
</div>
@if (displayResetPassword) {
<div between class="btn-group">
<button class="btn btn-primary" [dsBtnDisabled]="(canReset$ | async) !== true" type="button" (click)="resetPassword()">
<i class="fa fa-key"></i> {{'admin.access-control.epeople.actions.reset' | translate}}
</button>
</div>
}
@if (canImpersonate$ | async) {
<div between class="btn-group">
@if (!isImpersonated) {
<button class="btn btn-primary" type="button" (click)="impersonate()">
<i class="fa fa-user-secret"></i> {{'admin.access-control.epeople.actions.impersonate' | translate}}
</button>
}
@if (isImpersonated) {
<button class="btn btn-primary" type="button" (click)="stopImpersonating()">
<i class="fa fa-user-secret"></i> {{'admin.access-control.epeople.actions.stop-impersonating' | translate}}
</button>
}
</div>
}
@if (canDelete$ | async) {
<button after class="btn btn-danger delete-button" type="button" (click)="delete()">
<i class="fas fa-trash"></i> {{'admin.access-control.epeople.actions.delete' | translate}}
<div *ngIf="displayResetPassword" between class="btn-group">
<button class="btn btn-primary" [dsBtnDisabled]="(canReset$ | async) !== true" type="button" (click)="resetPassword()">
<i class="fa fa-key"></i> {{'admin.access-control.epeople.actions.reset' | translate}}
</button>
}
</div>
<div *ngIf="canImpersonate$ | async" between class="btn-group">
<button *ngIf="!isImpersonated" class="btn btn-primary" type="button" (click)="impersonate()">
<i class="fa fa-user-secret"></i> {{'admin.access-control.epeople.actions.impersonate' | translate}}
</button>
<button *ngIf="isImpersonated" class="btn btn-primary" type="button" (click)="stopImpersonating()">
<i class="fa fa-user-secret"></i> {{'admin.access-control.epeople.actions.stop-impersonating' | translate}}
</button>
</div>
<button *ngIf="canDelete$ | async" after class="btn btn-danger delete-button" type="button" (click)="delete()">
<i class="fas fa-trash"></i> {{'admin.access-control.epeople.actions.delete' | translate}}
</button>
</ds-form>
@if (!formGroup) {
<ds-loading [showMessage]="false"></ds-loading>
}
<ds-loading [showMessage]="false" *ngIf="!formGroup"></ds-loading>
@if (activeEPerson$ | async) {
<div>
<h2>{{messagePrefix + '.groupsEPersonIsMemberOf' | translate}}</h2>
@if (groups$ | async | dsHasNoValue) {
<ds-loading [showMessage]="false"></ds-loading>
}
@if ((groups$ | async)?.payload?.totalElements > 0) {
<ds-pagination
[paginationOptions]="config"
[collectionSize]="(groups$ | async)?.payload?.totalElements"
[hideGear]="true"
[hidePagerWhenSinglePage]="true"
(pageChange)="onPageChange($event)">
<div class="table-responsive">
<table id="groups" class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.collectionOrCommunity' | translate}}</th>
</tr>
</thead>
<tbody>
@for (group of (groups$ | async)?.payload?.page; track group) {
<tr>
<td class="align-middle">{{group.id}}</td>
<td class="align-middle">
<a (click)="groupsDataService.startEditingNewGroup(group)"
[routerLink]="[groupsDataService.getGroupEditPageRouterLink(group)]">
{{ dsoNameService.getName(group) }}
</a>
</td>
<td class="align-middle">
{{ dsoNameService.getName((group.object | async)?.payload) }}
</td>
</tr>
}
</tbody>
</table>
</div>
</ds-pagination>
}
@if ((groups$ | async)?.payload?.totalElements === 0) {
<div class="alert alert-info w-100 mb-2" role="alert">
<div>{{messagePrefix + '.memberOfNoGroups' | translate}}</div>
<div>
<button [routerLink]="[groupsDataService.getGroupRegistryRouterLink()]"
class="btn btn-primary">{{messagePrefix + '.goToGroups' | translate}}</button>
</div>
</div>
}
<div *ngIf="activeEPerson$ | async">
<h2>{{messagePrefix + '.groupsEPersonIsMemberOf' | translate}}</h2>
<ds-loading [showMessage]="false" *ngIf="groups$ | async | dsHasNoValue"></ds-loading>
<ds-pagination
*ngIf="(groups$ | async)?.payload?.totalElements > 0"
[paginationOptions]="config"
[collectionSize]="(groups$ | async)?.payload?.totalElements"
[hideGear]="true"
[hidePagerWhenSinglePage]="true"
(pageChange)="onPageChange($event)">
<div class="table-responsive">
<table id="groups" class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.collectionOrCommunity' | translate}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let group of (groups$ | async)?.payload?.page">
<td class="align-middle">{{group.id}}</td>
<td class="align-middle">
<a (click)="groupsDataService.startEditingNewGroup(group)"
[routerLink]="[groupsDataService.getGroupEditPageRouterLink(group)]">
{{ dsoNameService.getName(group) }}
</a>
</td>
<td class="align-middle">
{{ dsoNameService.getName((group.object | async)?.payload) }}
</td>
</tr>
</tbody>
</table>
</div>
</ds-pagination>
<div *ngIf="(groups$ | async)?.payload?.totalElements === 0" class="alert alert-info w-100 mb-2" role="alert">
<div>{{messagePrefix + '.memberOfNoGroups' | translate}}</div>
<div>
<button [routerLink]="[groupsDataService.getGroupRegistryRouterLink()]"
class="btn btn-primary">{{messagePrefix + '.goToGroups' | translate}}</button>
</div>
</div>
}
</div>
</div>
</div>
</div>

View File

@@ -25,7 +25,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { TranslateModule } from '@ngx-translate/core';
import {
Observable,
of,
of as observableOf,
} from 'rxjs';
import { AuthService } from '../../../core/auth/auth.service';
@@ -91,7 +91,7 @@ describe('EPersonFormComponent', () => {
activeEPerson: null,
allEpeople: mockEPeople,
getActiveEPerson(): Observable<EPerson> {
return of(this.activeEPerson);
return observableOf(this.activeEPerson);
},
searchByScope(scope: string, query: string, options: FindListOptions = {}): Observable<RemoteData<PaginatedList<EPerson>>> {
if (scope === 'email') {
@@ -115,7 +115,7 @@ describe('EPersonFormComponent', () => {
this.allEpeople = this.allEpeople.filter((ePerson2: EPerson) => {
return (ePerson2.uuid !== ePerson.uuid);
});
return of(true);
return observableOf(true);
},
create(ePerson: EPerson): Observable<RemoteData<EPerson>> {
this.allEpeople = [...this.allEpeople, ePerson];
@@ -210,7 +210,7 @@ describe('EPersonFormComponent', () => {
});
authService = new AuthServiceStub();
authorizationService = jasmine.createSpyObj('authorizationService', {
isAuthorized: of(true),
isAuthorized: observableOf(true),
});
groupsDataService = jasmine.createSpyObj('groupsDataService', {
@@ -389,7 +389,7 @@ describe('EPersonFormComponent', () => {
});
describe('without active EPerson', () => {
beforeEach(() => {
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(of(undefined));
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf(undefined));
component.onSubmit();
fixture.detectChanges();
});
@@ -429,7 +429,7 @@ describe('EPersonFormComponent', () => {
},
},
});
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(of(expectedWithId));
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf(expectedWithId));
component.ngOnInit();
component.onSubmit();
fixture.detectChanges();
@@ -485,10 +485,10 @@ describe('EPersonFormComponent', () => {
spyOn(authService, 'impersonate').and.callThrough();
eperson = EPersonMock;
component.epersonInitial = eperson;
component.canDelete$ = of(true);
spyOn(component.epersonService, 'getActiveEPerson').and.returnValue(of(eperson));
component.canDelete$ = observableOf(true);
spyOn(component.epersonService, 'getActiveEPerson').and.returnValue(observableOf(eperson));
modalService = (component as any).modalService;
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: of(true) }) }));
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) }));
component.ngOnInit();
fixture.detectChanges();
});
@@ -499,7 +499,7 @@ describe('EPersonFormComponent', () => {
});
it('the delete button should be hidden if the ePerson cannot be deleted', () => {
component.canDelete$ = of(false);
component.canDelete$ = observableOf(false);
fixture.detectChanges();
const deleteButton = fixture.debugElement.query(By.css('.delete-button'));
expect(deleteButton).toBeNull();

View File

@@ -1,4 +1,8 @@
import { AsyncPipe } from '@angular/common';
import {
AsyncPipe,
NgFor,
NgIf,
} from '@angular/common';
import {
ChangeDetectorRef,
Component,
@@ -27,7 +31,7 @@ import {
import {
combineLatest as observableCombineLatest,
Observable,
of,
of as observableOf,
Subscription,
} from 'rxjs';
import {
@@ -78,14 +82,16 @@ import { ValidateEmailNotTaken } from './validators/email-taken.validator';
selector: 'ds-eperson-form',
templateUrl: './eperson-form.component.html',
imports: [
AsyncPipe,
BtnDisabledDirective,
FormComponent,
HasNoValuePipe,
NgIf,
NgFor,
AsyncPipe,
TranslateModule,
ThemedLoadingComponent,
PaginationComponent,
RouterLink,
ThemedLoadingComponent,
TranslateModule,
HasNoValuePipe,
BtnDisabledDirective,
],
standalone: true,
})
@@ -357,7 +363,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
this.groups$ = this.activeEPerson$.pipe(
switchMap((eperson) => {
return observableCombineLatest([of(eperson), this.paginationService.getFindListOptions(this.config.id, {
return observableCombineLatest([observableOf(eperson), this.paginationService.getFindListOptions(this.config.id, {
currentPage: 1,
elementsPerPage: this.config.pageSize,
})]);
@@ -366,7 +372,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
if (eperson != null) {
return this.groupsDataService.findListByHref(eperson._links.groups.href, findListOptions, true, true, followLink('object'));
}
return of(undefined);
return observableOf(undefined);
}),
);
@@ -379,14 +385,14 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
if (hasValue(eperson)) {
return this.authorizationService.isAuthorized(FeatureID.LoginOnBehalfOf, eperson.self);
} else {
return of(false);
return observableOf(false);
}
}),
);
this.canDelete$ = this.activeEPerson$.pipe(
switchMap((eperson) => this.authorizationService.isAuthorized(FeatureID.CanDelete, hasValue(eperson) ? eperson.self : undefined)),
);
this.canReset$ = of(true);
this.canReset$ = observableOf(true);
}
/**
@@ -540,16 +546,16 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
take(1),
switchMap((confirm: boolean) => {
if (confirm && hasValue(eperson.id)) {
this.canDelete$ = of(false);
this.canDelete$ = observableOf(false);
return this.epersonService.deleteEPerson(eperson).pipe(
getFirstCompletedRemoteData(),
map((restResponse: RemoteData<NoContent>) => ({ restResponse, eperson })),
);
} else {
return of(null);
return observableOf(null);
}
}),
finalize(() => this.canDelete$ = of(true)),
finalize(() => this.canDelete$ = observableOf(true)),
);
}),
).subscribe(({ restResponse, eperson }: { restResponse: RemoteData<NoContent> | null, eperson: EPerson }) => {

View File

@@ -2,7 +2,13 @@
<div class="group-form row">
<div class="col-12">
@if (activeGroup$ | async) {
<div *ngIf="activeGroup$ | async; then editHeader; else createHeader"></div>
<ng-template #createHeader>
<h1 class="border-bottom pb-2">{{messagePrefix + '.head.create' | translate}}</h1>
</ng-template>
<ng-template #editHeader>
<h1 class="border-bottom pb-2">
<span
*dsContextHelp="{
@@ -11,61 +17,47 @@
iconPlacement: 'right',
tooltipPlacement: ['right', 'bottom']
}"
>
>
{{messagePrefix + '.head.edit' | translate}}
</span>
</h1>
} @else {
<h1 class="border-bottom pb-2">{{messagePrefix + '.head.create' | translate}}</h1>
}
</ng-template>
@if ((activeGroup$ | async); as groupBeingEdited) {
@if (groupBeingEdited?.permanent) {
<ds-alert [type]="AlertType.Warning"
[content]="messagePrefix + '.alert.permanent'"></ds-alert>
}
@if ((activeGroupLinkedDSO$ | async); as activeGroupLinkedDSO) {
@if ((canEdit$ | async) !== true) {
<ds-alert [type]="AlertType.Warning"
[content]="(messagePrefix + '.alert.workflowGroup' | translate:{ name: dsoNameService.getName(activeGroupLinkedDSO), comcol: activeGroupLinkedDSO.type, comcolEditRolesRoute: (linkedEditRolesRoute$ | async) })">
</ds-alert>
}
}
}
<ng-container *ngIf="(activeGroup$ | async) as groupBeingEdited">
<ds-alert *ngIf="groupBeingEdited?.permanent" [type]="AlertType.Warning"
[content]="messagePrefix + '.alert.permanent'"></ds-alert>
<ng-container *ngIf="(activeGroupLinkedDSO$ | async) as activeGroupLinkedDSO">
<ds-alert *ngIf="(canEdit$ | async) !== true" [type]="AlertType.Warning"
[content]="(messagePrefix + '.alert.workflowGroup' | translate:{ name: dsoNameService.getName(activeGroupLinkedDSO), comcol: activeGroupLinkedDSO.type, comcolEditRolesRoute: (linkedEditRolesRoute$ | async) })">
</ds-alert>
</ng-container>
</ng-container>
<ds-form [formId]="formId"
[formModel]="formModel"
[formGroup]="formGroup"
[formLayout]="formLayout"
[displayCancel]="false"
(submitForm)="onSubmit()">
[formModel]="formModel"
[formGroup]="formGroup"
[formLayout]="formLayout"
[displayCancel]="false"
(submitForm)="onSubmit()">
<div before class="btn-group">
<button (click)="onCancel()" type="button"
class="btn btn-outline-secondary"><i class="fas fa-arrow-left"></i> {{messagePrefix + '.return' | translate}}</button>
</div>
@if ((canEdit$ | async) && !(activeGroup$ | async)?.permanent) {
<div after class="btn-group">
<button (click)="delete()" class="btn btn-danger delete-button" type="button">
<i class="fa fa-trash"></i> {{ messagePrefix + '.actions.delete' | translate}}
</button>
</div>
}
</ds-form>
class="btn btn-outline-secondary"><i class="fas fa-arrow-left"></i> {{messagePrefix + '.return' | translate}}</button>
</div>
<div after *ngIf="(canEdit$ | async) && !(activeGroup$ | async)?.permanent" class="btn-group">
<button (click)="delete()" class="btn btn-danger delete-button" type="button">
<i class="fa fa-trash"></i> {{ messagePrefix + '.actions.delete' | translate}}
</button>
</div>
</ds-form>
@if ((activeGroup$ | async); as groupBeingEdited) {
<div class="mb-5">
@if (groupBeingEdited !== undefined) {
<ds-members-list
[messagePrefix]="messagePrefix + '.members-list'"></ds-members-list>
}
</div>
@if (groupBeingEdited !== undefined) {
<ds-subgroups-list
[messagePrefix]="messagePrefix + '.subgroups-list'"></ds-subgroups-list>
}
}
</div>
<ng-container *ngIf="(activeGroup$ | async) as groupBeingEdited">
<div class="mb-5">
<ds-members-list *ngIf="groupBeingEdited !== undefined"
[messagePrefix]="messagePrefix + '.members-list'"></ds-members-list>
</div>
<ds-subgroups-list *ngIf="groupBeingEdited !== undefined"
[messagePrefix]="messagePrefix + '.subgroups-list'"></ds-subgroups-list>
</ng-container>
</div>
</div>
</div>

View File

@@ -27,7 +27,7 @@ import { TranslateModule } from '@ngx-translate/core';
import { Operation } from 'fast-json-patch';
import {
Observable,
of,
of as observableOf,
} from 'rxjs';
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
@@ -116,7 +116,7 @@ describe('GroupFormComponent', () => {
activeGroup: null,
createdGroup: null,
getActiveGroup(): Observable<Group> {
return of(this.activeGroup);
return observableOf(this.activeGroup);
},
getGroupRegistryRouterLink(): string {
return '/access-control/groups';
@@ -137,7 +137,7 @@ describe('GroupFormComponent', () => {
this.activeGroup = null;
},
findById(id: string) {
return of({ payload: null, hasSucceeded: true });
return observableOf({ payload: null, hasSucceeded: true });
},
findByHref(href: string) {
return createSuccessfulRemoteDataObject$(this.createdGroup);
@@ -164,7 +164,7 @@ describe('GroupFormComponent', () => {
},
};
authorizationService = jasmine.createSpyObj('authorizationService', {
isAuthorized: of(true),
isAuthorized: observableOf(true),
});
dsoDataServiceStub = {
findByHref(href: string): Observable<RemoteData<DSpaceObject>> {
@@ -330,7 +330,7 @@ describe('GroupFormComponent', () => {
},
},
});
spyOn(groupsDataServiceStub, 'getActiveGroup').and.returnValue(of(expected));
spyOn(groupsDataServiceStub, 'getActiveGroup').and.returnValue(observableOf(expected));
spyOn(groupsDataServiceStub, 'patch').and.returnValue(createSuccessfulRemoteDataObject$(expected2));
component.ngOnInit();
});
@@ -417,7 +417,7 @@ describe('GroupFormComponent', () => {
},
});
spyOn(component.submitForm, 'emit');
spyOn(dsoDataServiceStub, 'findByHref').and.returnValue(of(expected));
spyOn(dsoDataServiceStub, 'findByHref').and.returnValue(observableOf(expected));
fixture.detectChanges();
component.initialisePage();
@@ -471,11 +471,11 @@ describe('GroupFormComponent', () => {
beforeEach(async () => {
spyOn(groupsDataServiceStub, 'delete').and.callThrough();
component.activeGroup$ = of({
component.activeGroup$ = observableOf({
id: 'active-group',
permanent: false,
} as Group);
component.canEdit$ = of(true);
component.canEdit$ = observableOf(true);
component.initialisePage();

View File

@@ -1,4 +1,7 @@
import { AsyncPipe } from '@angular/common';
import {
AsyncPipe,
NgIf,
} from '@angular/common';
import {
ChangeDetectorRef,
Component,
@@ -87,13 +90,14 @@ import { ValidateGroupExists } from './validators/group-exists.validator';
selector: 'ds-group-form',
templateUrl: './group-form.component.html',
imports: [
AlertComponent,
AsyncPipe,
ContextHelpDirective,
FormComponent,
AlertComponent,
NgIf,
AsyncPipe,
TranslateModule,
ContextHelpDirective,
MembersListComponent,
SubgroupsListComponent,
TranslateModule,
],
standalone: true,
})
@@ -500,7 +504,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
this.groupDataService.cancelEditGroup();
this.subs.filter((sub) => hasValue(sub)).forEach((sub) => sub.unsubscribe());
if ( hasValue(this.groupNameValueChangeSubscribe) ) {
if (hasValue(this.groupNameValueChangeSubscribe)) {
this.groupNameValueChangeSubscribe.unsubscribe();
}

View File

@@ -3,70 +3,63 @@
<h3>{{messagePrefix + '.headMembers' | translate}}</h3>
@if ((ePeopleMembersOfGroup | async)?.totalElements > 0) {
<ds-pagination
[paginationOptions]="config"
[collectionSize]="(ePeopleMembersOfGroup | async)?.totalElements"
[hideGear]="true"
[hidePagerWhenSinglePage]="true">
<div class="table-responsive">
<table id="ePeopleMembersOfGroup" class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.identity' | translate}}</th>
<th class="align-middle">{{messagePrefix + '.table.edit' | translate}}</th>
</tr>
</thead>
<tbody>
@for (epersonDTO of (ePeopleMembersOfGroup | async)?.page; track epersonDTO) {
<tr>
<td class="align-middle">{{epersonDTO.eperson.id}}</td>
<td class="align-middle">
<a [routerLink]="getEPersonEditRoute(epersonDTO.eperson.id)">
{{ dsoNameService.getName(epersonDTO.eperson) }}
</a>
</td>
<td class="align-middle">
{{messagePrefix + '.table.email' | translate}}: {{ epersonDTO.eperson.email ? epersonDTO.eperson.email : '-' }}<br/>
{{messagePrefix + '.table.netid' | translate}}: {{ epersonDTO.eperson.netid ? epersonDTO.eperson.netid : '-' }}
</td>
<td class="align-middle">
<div class="btn-group edit-field">
@if (epersonDTO.ableToDelete) {
<button (click)="deleteMemberFromGroup(epersonDTO.eperson)"
[dsBtnDisabled]="actionConfig.remove.disabled"
[ngClass]="['btn btn-sm', actionConfig.remove.css]"
title="{{messagePrefix + '.table.edit.buttons.remove' | translate: { name: dsoNameService.getName(epersonDTO.eperson) } }}">
<i [ngClass]="actionConfig.remove.icon"></i>
</button>
}
@if (!epersonDTO.ableToDelete) {
<button
(click)="addMemberToGroup(epersonDTO.eperson)"
[dsBtnDisabled]="actionConfig.add.disabled"
[ngClass]="['btn btn-sm', actionConfig.add.css]"
title="{{messagePrefix + '.table.edit.buttons.add' | translate: { name: dsoNameService.getName(epersonDTO.eperson) } }}">
<i [ngClass]="actionConfig.add.icon"></i>
</button>
}
</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</ds-pagination>
}
<ds-pagination *ngIf="(ePeopleMembersOfGroup | async)?.totalElements > 0"
[paginationOptions]="config"
[collectionSize]="(ePeopleMembersOfGroup | async)?.totalElements"
[hideGear]="true"
[hidePagerWhenSinglePage]="true">
@if ((ePeopleMembersOfGroup | async) === undefined || (ePeopleMembersOfGroup | async)?.totalElements === 0) {
<div class="alert alert-info w-100 mb-2"
role="alert">
{{messagePrefix + '.no-members-yet' | translate}}
<div class="table-responsive">
<table id="ePeopleMembersOfGroup" class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.identity' | translate}}</th>
<th class="align-middle">{{messagePrefix + '.table.edit' | translate}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let epersonDTO of (ePeopleMembersOfGroup | async)?.page">
<td class="align-middle">{{epersonDTO.eperson.id}}</td>
<td class="align-middle">
<a [routerLink]="getEPersonEditRoute(epersonDTO.eperson.id)">
{{ dsoNameService.getName(epersonDTO.eperson) }}
</a>
</td>
<td class="align-middle">
{{messagePrefix + '.table.email' | translate}}: {{ epersonDTO.eperson.email ? epersonDTO.eperson.email : '-' }}<br/>
{{messagePrefix + '.table.netid' | translate}}: {{ epersonDTO.eperson.netid ? epersonDTO.eperson.netid : '-' }}
</td>
<td class="align-middle">
<div class="btn-group edit-field">
<button (click)="deleteMemberFromGroup(epersonDTO.eperson)"
*ngIf="epersonDTO.ableToDelete"
[dsBtnDisabled]="actionConfig.remove.disabled"
[ngClass]="['btn btn-sm', actionConfig.remove.css]"
title="{{messagePrefix + '.table.edit.buttons.remove' | translate: { name: dsoNameService.getName(epersonDTO.eperson) } }}">
<i [ngClass]="actionConfig.remove.icon"></i>
</button>
<button *ngIf="!epersonDTO.ableToDelete"
(click)="addMemberToGroup(epersonDTO.eperson)"
[dsBtnDisabled]="actionConfig.add.disabled"
[ngClass]="['btn btn-sm', actionConfig.add.css]"
title="{{messagePrefix + '.table.edit.buttons.add' | translate: { name: dsoNameService.getName(epersonDTO.eperson) } }}">
<i [ngClass]="actionConfig.add.icon"></i>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
}
</ds-pagination>
<div *ngIf="(ePeopleMembersOfGroup | async) === undefined || (ePeopleMembersOfGroup | async)?.totalElements === 0" class="alert alert-info w-100 mb-2"
role="alert">
{{messagePrefix + '.no-members-yet' | translate}}
</div>
<h3 id="search" class="border-bottom pb-2">
<span
@@ -76,81 +69,77 @@
iconPlacement: 'right',
tooltipPlacement: ['top', 'right', 'bottom']
}"
>
>
{{messagePrefix + '.search.head' | translate}}
</span>
</h3>
<form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)" class="d-flex justify-content-between">
<div class="flex-grow-1 me-3">
<div class="form-group input-group me-3">
<div class="flex-grow-1 mr-3">
<div class="form-group input-group mr-3">
<input type="text" name="query" id="query" formControlName="query"
class="form-control" aria-label="Search input">
class="form-control" aria-label="Search input">
<span class="input-group-append">
<button type="submit" class="search-button btn btn-primary">
<i class="fas fa-search"></i> {{ messagePrefix + '.search.button' | translate }}</button>
</span>
</div>
<button type="submit" class="search-button btn btn-primary">
<i class="fas fa-search"></i> {{ messagePrefix + '.search.button' | translate }}</button>
</span>
</div>
<div>
<button (click)="clearFormAndResetResult();"
class="btn btn-secondary">{{messagePrefix + '.button.see-all' | translate}}</button>
</div>
</form>
</div>
<div>
<button (click)="clearFormAndResetResult();"
class="btn btn-secondary">{{messagePrefix + '.button.see-all' | translate}}</button>
</div>
</form>
@if ((ePeopleSearch | async)?.totalElements > 0) {
<ds-pagination
[paginationOptions]="configSearch"
[collectionSize]="(ePeopleSearch | async)?.totalElements"
[hideGear]="true"
[hidePagerWhenSinglePage]="true">
<div class="table-responsive">
<table id="epersonsSearch" class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.identity' | translate}}</th>
<th class="align-middle">{{messagePrefix + '.table.edit' | translate}}</th>
</tr>
</thead>
<tbody>
@for (eperson of (ePeopleSearch | async)?.page; track eperson) {
<tr>
<td class="align-middle">{{eperson.id}}</td>
<td class="align-middle">
<a [routerLink]="getEPersonEditRoute(eperson.id)">
{{ dsoNameService.getName(eperson) }}
</a>
</td>
<td class="align-middle">
{{messagePrefix + '.table.email' | translate}}: {{ eperson.email ? eperson.email : '-' }}<br/>
{{messagePrefix + '.table.netid' | translate}}: {{ eperson.netid ? eperson.netid : '-' }}
</td>
<td class="align-middle">
<div class="btn-group edit-field">
<button (click)="addMemberToGroup(eperson)"
[dsBtnDisabled]="actionConfig.add.disabled"
[ngClass]="['btn btn-sm', actionConfig.add.css]"
title="{{messagePrefix + '.table.edit.buttons.add' | translate: { name: dsoNameService.getName(eperson) } }}">
<i [ngClass]="actionConfig.add.icon"></i>
</button>
</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</ds-pagination>
}
<ds-pagination *ngIf="(ePeopleSearch | async)?.totalElements > 0"
[paginationOptions]="configSearch"
[collectionSize]="(ePeopleSearch | async)?.totalElements"
[hideGear]="true"
[hidePagerWhenSinglePage]="true">
@if ((ePeopleSearch | async)?.totalElements === 0 && searchDone) {
<div
class="alert alert-info w-100 mb-2"
role="alert">
{{messagePrefix + '.no-items' | translate}}
</div>
}
<div class="table-responsive">
<table id="epersonsSearch" class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.identity' | translate}}</th>
<th class="align-middle">{{messagePrefix + '.table.edit' | translate}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let eperson of (ePeopleSearch | async)?.page">
<td class="align-middle">{{eperson.id}}</td>
<td class="align-middle">
<a [routerLink]="getEPersonEditRoute(eperson.id)">
{{ dsoNameService.getName(eperson) }}
</a>
</td>
<td class="align-middle">
{{messagePrefix + '.table.email' | translate}}: {{ eperson.email ? eperson.email : '-' }}<br/>
{{messagePrefix + '.table.netid' | translate}}: {{ eperson.netid ? eperson.netid : '-' }}
</td>
<td class="align-middle">
<div class="btn-group edit-field">
<button (click)="addMemberToGroup(eperson)"
[dsBtnDisabled]="actionConfig.add.disabled"
[ngClass]="['btn btn-sm', actionConfig.add.css]"
title="{{messagePrefix + '.table.edit.buttons.add' | translate: { name: dsoNameService.getName(eperson) } }}">
<i [ngClass]="actionConfig.add.icon"></i>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</ng-container>
</ds-pagination>
<div *ngIf="(ePeopleSearch | async)?.totalElements === 0 && searchDone"
class="alert alert-info w-100 mb-2"
role="alert">
{{messagePrefix + '.no-items' | translate}}
</div>
</ng-container>

View File

@@ -32,7 +32,7 @@ import {
} from '@ngx-translate/core';
import {
Observable,
of,
of as observableOf,
} from 'rxjs';
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
@@ -113,7 +113,7 @@ describe('MembersListComponent', () => {
epersonMembers: epersonMembers,
epersonNonMembers: epersonNonMembers,
getActiveGroup(): Observable<Group> {
return of(activeGroup);
return observableOf(activeGroup);
},
getEPersonMembers() {
return this.epersonMembers;
@@ -127,7 +127,7 @@ describe('MembersListComponent', () => {
this.epersonNonMembers.splice(index, 1);
}
});
return of(new RestResponse(true, 200, 'Success'));
return observableOf(new RestResponse(true, 200, 'Success'));
},
clearGroupsRequests() {
// empty
@@ -147,7 +147,7 @@ describe('MembersListComponent', () => {
});
// Add eperson to list of non-members
this.epersonNonMembers = [...this.epersonNonMembers, epersonToDelete];
return of(new RestResponse(true, 200, 'Success'));
return observableOf(new RestResponse(true, 200, 'Success'));
},
};
builderService = getMockFormBuilderService();

View File

@@ -1,6 +1,8 @@
import {
AsyncPipe,
NgClass,
NgForOf,
NgIf,
} from '@angular/common';
import {
Component,
@@ -25,7 +27,7 @@ import {
combineLatest as observableCombineLatest,
Observable,
ObservedValueOf,
of,
of as observableOf,
Subscription,
} from 'rxjs';
import {
@@ -103,14 +105,16 @@ export interface EPersonListActionConfig {
selector: 'ds-members-list',
templateUrl: './members-list.component.html',
imports: [
AsyncPipe,
BtnDisabledDirective,
ContextHelpDirective,
NgClass,
PaginationComponent,
ReactiveFormsModule,
RouterLink,
TranslateModule,
ContextHelpDirective,
ReactiveFormsModule,
PaginationComponent,
NgIf,
AsyncPipe,
RouterLink,
NgClass,
NgForOf,
BtnDisabledDirective,
],
standalone: true,
})
@@ -260,7 +264,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
* @param possibleMember EPerson that is a possible member (being tested) of the group currently being edited
*/
isMemberOfGroup(possibleMember: EPerson): Observable<boolean> {
return of(true);
return observableOf(true);
}
/**

View File

@@ -3,56 +3,51 @@
<h4>{{messagePrefix + '.headSubgroups' | translate}}</h4>
@if ((subGroups$ | async)?.payload?.totalElements > 0) {
<ds-pagination
[paginationOptions]="config"
[collectionSize]="(subGroups$ | async)?.payload?.totalElements"
[hideGear]="true"
[hidePagerWhenSinglePage]="true">
<div class="table-responsive">
<table id="subgroupsOfGroup" class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.collectionOrCommunity' | translate}}</th>
<th>{{messagePrefix + '.table.edit' | translate}}</th>
</tr>
</thead>
<tbody>
@for (group of (subGroups$ | async)?.payload?.page; track group) {
<tr>
<td class="align-middle">{{group.id}}</td>
<td class="align-middle">
<a (click)="groupDataService.startEditingNewGroup(group)"
[routerLink]="[groupDataService.getGroupEditPageRouterLink(group)]">
{{ dsoNameService.getName(group) }}
</a>
</td>
<td class="align-middle">{{ dsoNameService.getName((group.object | async)?.payload)}}</td>
<td class="align-middle">
<div class="btn-group edit-field">
<button (click)="deleteSubgroupFromGroup(group)"
<ds-pagination *ngIf="(subGroups$ | async)?.payload?.totalElements > 0"
[paginationOptions]="config"
[collectionSize]="(subGroups$ | async)?.payload?.totalElements"
[hideGear]="true"
[hidePagerWhenSinglePage]="true">
<div class="table-responsive">
<table id="subgroupsOfGroup" class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.collectionOrCommunity' | translate}}</th>
<th>{{messagePrefix + '.table.edit' | translate}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let group of (subGroups$ | async)?.payload?.page">
<td class="align-middle">{{group.id}}</td>
<td class="align-middle">
<a (click)="groupDataService.startEditingNewGroup(group)"
[routerLink]="[groupDataService.getGroupEditPageRouterLink(group)]">
{{ dsoNameService.getName(group) }}
</a>
</td>
<td class="align-middle">{{ dsoNameService.getName((group.object | async)?.payload)}}</td>
<td class="align-middle">
<div class="btn-group edit-field">
<button (click)="deleteSubgroupFromGroup(group)"
class="btn btn-outline-danger btn-sm deleteButton"
title="{{messagePrefix + '.table.edit.buttons.remove' | translate: { name: dsoNameService.getName(group) } }}">
<i class="fas fa-trash-alt fa-fw"></i>
</button>
</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</ds-pagination>
}
@if ((subGroups$ | async)?.payload?.totalElements === 0) {
<div class="alert alert-info w-100 mb-2"
role="alert">
{{messagePrefix + '.no-subgroups-yet' | translate}}
<i class="fas fa-trash-alt fa-fw"></i>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
}
</ds-pagination>
<div *ngIf="(subGroups$ | async)?.payload?.totalElements === 0" class="alert alert-info w-100 mb-2"
role="alert">
{{messagePrefix + '.no-subgroups-yet' | translate}}
</div>
<h4 id="search" class="border-bottom pb-2">
<span *dsContextHelp="{
@@ -61,80 +56,75 @@
iconPlacement: 'right',
tooltipPlacement: ['top', 'right', 'bottom']
}"
>
>
{{messagePrefix + '.search.head' | translate}}
</span>
</h4>
<form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)" class="d-flex justify-content-between">
<div class="flex-grow-1 me-3">
<div class="mb-3 input-group me-3">
<div class="flex-grow-1 mr-3">
<div class="form-group input-group mr-3">
<input type="text" name="query" id="query" formControlName="query"
class="form-control" aria-label="Search input">
class="form-control" aria-label="Search input">
<span class="input-group-append">
<button type="submit" class="search-button btn btn-primary">
<i class="fas fa-search"></i> {{ messagePrefix + '.search.button' | translate }}
</button>
<button type="submit" class="search-button btn btn-primary">
<i class="fas fa-search"></i> {{ messagePrefix + '.search.button' | translate }}
</button>
</span>
</div>
</div>
<div>
<button (click)="clearFormAndResetResult();" class="btn btn-secondary float-end">
<button (click)="clearFormAndResetResult();" class="btn btn-secondary float-right">
{{messagePrefix + '.button.see-all' | translate}}
</button>
</div>
</form>
@if ((searchResults$ | async)?.payload?.totalElements > 0) {
<ds-pagination
[paginationOptions]="configSearch"
[collectionSize]="(searchResults$ | async)?.payload?.totalElements"
[hideGear]="true"
[hidePagerWhenSinglePage]="true">
<div class="table-responsive">
<table id="groupsSearch" class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.collectionOrCommunity' | translate}}</th>
<th class="align-middle">{{messagePrefix + '.table.edit' | translate}}</th>
</tr>
</thead>
<tbody>
@for (group of (searchResults$ | async)?.payload?.page; track group) {
<tr>
<td class="align-middle">{{group.id}}</td>
<td class="align-middle">
<a (click)="groupDataService.startEditingNewGroup(group)"
[routerLink]="[groupDataService.getGroupEditPageRouterLink(group)]">
{{ dsoNameService.getName(group) }}
</a>
</td>
<td class="align-middle">{{ dsoNameService.getName((group.object | async)?.payload) }}</td>
<td class="align-middle">
<div class="btn-group edit-field">
<button (click)="addSubgroupToGroup(group)"
<ds-pagination *ngIf="(searchResults$ | async)?.payload?.totalElements > 0"
[paginationOptions]="configSearch"
[collectionSize]="(searchResults$ | async)?.payload?.totalElements"
[hideGear]="true"
[hidePagerWhenSinglePage]="true">
<div class="table-responsive">
<table id="groupsSearch" class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
<th scope="col" class="align-middle">{{messagePrefix + '.table.collectionOrCommunity' | translate}}</th>
<th class="align-middle">{{messagePrefix + '.table.edit' | translate}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let group of (searchResults$ | async)?.payload?.page">
<td class="align-middle">{{group.id}}</td>
<td class="align-middle">
<a (click)="groupDataService.startEditingNewGroup(group)"
[routerLink]="[groupDataService.getGroupEditPageRouterLink(group)]">
{{ dsoNameService.getName(group) }}
</a>
</td>
<td class="align-middle">{{ dsoNameService.getName((group.object | async)?.payload) }}</td>
<td class="align-middle">
<div class="btn-group edit-field">
<button (click)="addSubgroupToGroup(group)"
class="btn btn-outline-primary btn-sm addButton"
title="{{messagePrefix + '.table.edit.buttons.add' | translate: { name: dsoNameService.getName(group) } }}">
<i class="fas fa-plus fa-fw"></i>
</button>
</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</ds-pagination>
}
@if ((searchResults$ | async)?.payload?.totalElements === 0 && searchDone) {
<div class="alert alert-info w-100 mb-2"
role="alert">
{{messagePrefix + '.no-items' | translate}}
<i class="fas fa-plus fa-fw"></i>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
}
</ds-pagination>
<div *ngIf="(searchResults$ | async)?.payload?.totalElements === 0 && searchDone" class="alert alert-info w-100 mb-2"
role="alert">
{{messagePrefix + '.no-items' | translate}}
</div>
</ng-container>

View File

@@ -31,7 +31,7 @@ import {
} from '@ngx-translate/core';
import {
Observable,
of,
of as observableOf,
} from 'rxjs';
import { EPersonMock2 } from 'src/app/shared/testing/eperson.mock';
@@ -108,7 +108,7 @@ describe('SubgroupsListComponent', () => {
subgroups: subgroups,
groupNonMembers: groupNonMembers,
getActiveGroup(): Observable<Group> {
return of(this.activeGroup);
return observableOf(this.activeGroup);
},
getSubgroups(): Group {
return this.subgroups;
@@ -138,7 +138,7 @@ describe('SubgroupsListComponent', () => {
this.groupNonMembers.splice(index, 1);
}
});
return of(new RestResponse(true, 200, 'Success'));
return observableOf(new RestResponse(true, 200, 'Success'));
},
clearGroupsRequests() {
// empty
@@ -155,7 +155,7 @@ describe('SubgroupsListComponent', () => {
});
// Add group to list of non-members
this.groupNonMembers = [...this.groupNonMembers, subgroupToDelete];
return of(new RestResponse(true, 200, 'Success'));
return observableOf(new RestResponse(true, 200, 'Success'));
},
};
routerStub = new RouterMock();

View File

@@ -1,4 +1,8 @@
import { AsyncPipe } from '@angular/common';
import {
AsyncPipe,
NgForOf,
NgIf,
} from '@angular/common';
import {
Component,
Input,
@@ -59,12 +63,14 @@ enum SubKey {
selector: 'ds-subgroups-list',
templateUrl: './subgroups-list.component.html',
imports: [
AsyncPipe,
ContextHelpDirective,
PaginationComponent,
ReactiveFormsModule,
RouterLink,
AsyncPipe,
NgForOf,
ContextHelpDirective,
TranslateModule,
ReactiveFormsModule,
PaginationComponent,
NgIf,
],
standalone: true,
})

View File

@@ -9,7 +9,7 @@ import {
} from '@angular/router';
import {
Observable,
of,
of as observableOf,
} from 'rxjs';
import { AuthService } from '../../core/auth/auth.service';
@@ -37,7 +37,7 @@ describe('GroupPageGuard', () => {
function init() {
halEndpointService = jasmine.createSpyObj(['getEndpoint']);
( halEndpointService as any ).getEndpoint.and.returnValue(of(groupsEndpointUrl));
( halEndpointService as any ).getEndpoint.and.returnValue(observableOf(groupsEndpointUrl));
authorizationService = jasmine.createSpyObj(['isAuthorized']);
// NOTE: value is set in beforeEach
@@ -46,7 +46,7 @@ describe('GroupPageGuard', () => {
( router as any ).parseUrl.and.returnValue = {};
authService = jasmine.createSpyObj(['isAuthenticated']);
( authService as any ).isAuthenticated.and.returnValue(of(true));
( authService as any ).isAuthenticated.and.returnValue(observableOf(true));
TestBed.configureTestingModule({
providers: [
@@ -69,7 +69,7 @@ describe('GroupPageGuard', () => {
describe('canActivate', () => {
describe('when the current user can manage the group', () => {
beforeEach(() => {
( authorizationService as any ).isAuthorized.and.returnValue(of(true));
( authorizationService as any ).isAuthorized.and.returnValue(observableOf(true));
});
it('should return true', (done) => {
@@ -89,7 +89,7 @@ describe('GroupPageGuard', () => {
describe('when the current user can not manage the group', () => {
beforeEach(() => {
(authorizationService as any).isAuthorized.and.returnValue(of(false));
(authorizationService as any).isAuthorized.and.returnValue(observableOf(false));
});
it('should not return true', (done) => {

View File

@@ -6,7 +6,7 @@ import {
} from '@angular/router';
import {
Observable,
of,
of as observableOf,
} from 'rxjs';
import { map } from 'rxjs/operators';
@@ -33,6 +33,6 @@ export const groupPageGuard = (
getObjectUrl = defaultGroupPageGetObjectUrl,
getEPersonUuid?: StringGuardParamFn,
): CanActivateFn => someFeatureAuthorizationGuard(
() => of([FeatureID.CanManageGroup]),
() => observableOf([FeatureID.CanManageGroup]),
getObjectUrl,
getEPersonUuid);

View File

@@ -4,21 +4,21 @@
<div class="d-flex justify-content-between border-bottom mb-3">
<h1 id="header" class="pb-2">{{messagePrefix + 'head' | translate}}</h1>
<div>
<button class="me-auto btn btn-success"
[routerLink]="'create'">
<button class="mr-auto btn btn-success"
[routerLink]="'create'">
<i class="fas fa-plus"></i>
<span class="d-none d-sm-inline ms-1">{{messagePrefix + 'button.add' | translate}}</span>
<span class="d-none d-sm-inline ml-1">{{messagePrefix + 'button.add' | translate}}</span>
</button>
</div>
</div>
<h2 id="search" class="border-bottom pb-2">{{messagePrefix + 'search.head' | translate}}</h2>
<form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)" class="d-flex justify-content-between">
<div class="flex-grow-1 me-3">
<div class="mb-3 input-group">
<div class="flex-grow-1 mr-3">
<div class="form-group input-group">
<input type="text" name="query" id="query" formControlName="query"
class="form-control" [attr.aria-label]="messagePrefix + 'search.placeholder' | translate"
[placeholder]="(messagePrefix + 'search.placeholder' | translate)" >
class="form-control" [attr.aria-label]="messagePrefix + 'search.placeholder' | translate"
[placeholder]="(messagePrefix + 'search.placeholder' | translate)" >
<span class="input-group-append">
<button type="submit" class="search-button btn btn-primary">
<i class="fas fa-search"></i> {{ messagePrefix + 'search.button' | translate }}
@@ -33,78 +33,66 @@
</div>
</form>
@if (loading$ | async) {
<ds-loading></ds-loading>
}
@if ((pageInfoState$ | async)?.totalElements > 0 && (loading$ | async) !== true) {
<ds-pagination
[paginationOptions]="config"
[collectionSize]="(pageInfoState$ | async)?.totalElements"
[hideGear]="true"
[hidePagerWhenSinglePage]="true">
<div class="table-responsive">
<table id="groups" class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th scope="col">{{messagePrefix + 'table.id' | translate}}</th>
<th scope="col">{{messagePrefix + 'table.name' | translate}}</th>
<th scope="col">{{messagePrefix + 'table.collectionOrCommunity' | translate}}</th>
<th scope="col">{{messagePrefix + 'table.members' | translate}}</th>
<th>{{messagePrefix + 'table.edit' | translate}}</th>
</tr>
</thead>
<tbody>
@for (groupDto of (groupsDto$ | async)?.page; track groupDto) {
<tr>
<td>{{groupDto.group.id}}</td>
<td>{{ dsoNameService.getName(groupDto.group) }}</td>
<td>{{ dsoNameService.getName((groupDto.group.object | async)?.payload) }}</td>
<td>{{groupDto.epersons?.totalElements + groupDto.subgroups?.totalElements}}</td>
<td>
<div class="btn-group edit-field">
@switch (groupDto.ableToEdit) {
@case (true) {
<button
[routerLink]="groupService.getGroupEditPageRouterLink(groupDto.group)"
class="btn btn-outline-primary btn-sm btn-edit"
title="{{messagePrefix + 'table.edit.buttons.edit' | translate: {name: dsoNameService.getName(groupDto.group) } }}"
>
<i class="fas fa-edit fa-fw"></i>
</button>
}
@case (false) {
<button
[dsBtnDisabled]="true"
class="btn btn-outline-primary btn-sm btn-edit"
placement="left"
[ngbTooltip]="'admin.access-control.epeople.table.edit.buttons.edit-disabled' | translate"
>
<i class="fas fa-edit fa-fw"></i>
</button>
}
}
@if (!groupDto.group?.permanent && groupDto.ableToDelete) {
<button
(click)="deleteGroup(groupDto)" class="btn btn-outline-danger btn-sm btn-delete"
title="{{messagePrefix + 'table.edit.buttons.remove' | translate: {name: dsoNameService.getName(groupDto.group) } }}">
<i class="fas fa-trash-alt fa-fw"></i>
</button>
}
</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</ds-pagination>
}
<ds-loading *ngIf="loading$ | async"></ds-loading>
<ds-pagination
*ngIf="(pageInfoState$ | async)?.totalElements > 0 && (loading$ | async) !== true"
[paginationOptions]="config"
[collectionSize]="(pageInfoState$ | async)?.totalElements"
[hideGear]="true"
[hidePagerWhenSinglePage]="true">
@if ((pageInfoState$ | async)?.totalElements === 0) {
<div class="alert alert-info w-100 mb-2" role="alert">
{{messagePrefix + 'no-items' | translate}}
<div class="table-responsive">
<table id="groups" class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th scope="col">{{messagePrefix + 'table.id' | translate}}</th>
<th scope="col">{{messagePrefix + 'table.name' | translate}}</th>
<th scope="col">{{messagePrefix + 'table.collectionOrCommunity' | translate}}</th>
<th scope="col">{{messagePrefix + 'table.members' | translate}}</th>
<th>{{messagePrefix + 'table.edit' | translate}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let groupDto of (groupsDto$ | async)?.page">
<td>{{groupDto.group.id}}</td>
<td>{{ dsoNameService.getName(groupDto.group) }}</td>
<td>{{ dsoNameService.getName((groupDto.group.object | async)?.payload) }}</td>
<td>{{groupDto.epersons?.totalElements + groupDto.subgroups?.totalElements}}</td>
<td>
<div class="btn-group edit-field">
<ng-container [ngSwitch]="groupDto.ableToEdit">
<button *ngSwitchCase="true"
[routerLink]="groupService.getGroupEditPageRouterLink(groupDto.group)"
class="btn btn-outline-primary btn-sm btn-edit"
title="{{messagePrefix + 'table.edit.buttons.edit' | translate: {name: dsoNameService.getName(groupDto.group) } }}"
>
<i class="fas fa-edit fa-fw"></i>
</button>
<button *ngSwitchCase="false"
[dsBtnDisabled]="true"
class="btn btn-outline-primary btn-sm btn-edit"
placement="left"
[ngbTooltip]="'admin.access-control.epeople.table.edit.buttons.edit-disabled' | translate"
>
<i class="fas fa-edit fa-fw"></i>
</button>
</ng-container>
<button *ngIf="!groupDto.group?.permanent && groupDto.ableToDelete"
(click)="deleteGroup(groupDto)" class="btn btn-outline-danger btn-sm btn-delete"
title="{{messagePrefix + 'table.edit.buttons.remove' | translate: {name: dsoNameService.getName(groupDto.group) } }}">
<i class="fas fa-trash-alt fa-fw"></i>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
}
</ds-pagination>
<div *ngIf="(pageInfoState$ | async)?.totalElements === 0" class="alert alert-info w-100 mb-2" role="alert">
{{messagePrefix + 'no-items' | translate}}
</div>
</div>
</div>

View File

@@ -25,6 +25,7 @@ import { provideMockStore } from '@ngrx/store/testing';
import { TranslateModule } from '@ngx-translate/core';
import {
Observable,
of as observableOf,
of,
} from 'rxjs';
@@ -94,11 +95,11 @@ describe('GroupsRegistryComponent', () => {
(authorizationService as any).isAuthorized.and.callFake((featureId?: FeatureID) => {
switch (featureId) {
case FeatureID.AdministratorOf:
return of(isAdmin);
return observableOf(isAdmin);
case FeatureID.CanManageGroup:
return of(canManageGroup);
return observableOf(canManageGroup);
case FeatureID.CanDelete:
return of(true);
return observableOf(true);
default:
throw new Error(`setIsAuthorized: this fake implementation does not support ${featureId}.`);
}

View File

@@ -1,4 +1,10 @@
import { AsyncPipe } from '@angular/common';
import {
AsyncPipe,
NgForOf,
NgIf,
NgSwitch,
NgSwitchCase,
} from '@angular/common';
import {
Component,
OnDestroy,
@@ -19,7 +25,7 @@ import {
combineLatest as observableCombineLatest,
EMPTY,
Observable,
of,
of as observableOf,
Subscription,
} from 'rxjs';
import {
@@ -68,14 +74,18 @@ import { followLink } from '../../shared/utils/follow-link-config.model';
selector: 'ds-groups-registry',
templateUrl: './groups-registry.component.html',
imports: [
AsyncPipe,
BtnDisabledDirective,
NgbTooltipModule,
PaginationComponent,
ReactiveFormsModule,
RouterLink,
ThemedLoadingComponent,
TranslateModule,
RouterLink,
ReactiveFormsModule,
AsyncPipe,
NgIf,
PaginationComponent,
NgSwitch,
NgSwitchCase,
NgbTooltipModule,
NgForOf,
BtnDisabledDirective,
],
standalone: true,
})
@@ -179,7 +189,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
getRemoteDataPayload(),
switchMap((groups: PaginatedList<Group>) => {
if (groups.page.length === 0) {
return of(buildPaginatedList(groups.pageInfo, []));
return observableOf(buildPaginatedList(groups.pageInfo, []));
}
return this.authorizationService.isAuthorized(FeatureID.AdministratorOf).pipe(
switchMap((isSiteAdmin: boolean) => {
@@ -224,7 +234,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
canManageGroup$(isSiteAdmin: boolean, group: Group): Observable<boolean> {
if (isSiteAdmin) {
return of(true);
return observableOf(true);
} else {
return this.authorizationService.isAuthorized(FeatureID.CanManageGroup, group.self);
}
@@ -283,7 +293,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
return this.dSpaceObjectDataService.findByHref(group._links.object.href).pipe(
getFirstSucceededRemoteData(),
map((rd: RemoteData<DSpaceObject>) => hasValue(rd) && hasValue(rd.payload)),
catchError(() => of(false)),
catchError(() => observableOf(false)),
);
}

Some files were not shown because too many files have changed in this diff Show More