Skip to content

Commit 4413fb5

Browse files
Merge branch 'main' into AccessibilityInStatisticsTable
2 parents 796e0fc + 0ade76a commit 4413fb5

File tree

62 files changed

+3403
-1475
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3403
-1475
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
"colors": "^1.4.0",
127127
"compression": "^1.7.5",
128128
"cookie-parser": "1.4.7",
129-
"core-js": "^3.38.1",
129+
"core-js": "^3.39.0",
130130
"date-fns": "^2.29.3",
131131
"date-fns-tz": "^1.3.7",
132132
"deepmerge": "^4.3.1",

src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
343343
this.groups$ = this.groupsDataService.findListByHref(eperson._links.groups.href, {
344344
currentPage: 1,
345345
elementsPerPage: this.config.pageSize,
346-
});
346+
}, undefined, undefined, followLink('object'));
347347
}
348348
this.formGroup.patchValue({
349349
firstName: eperson != null ? eperson.firstMetadataValue('eperson.firstname') : '',

src/app/browse-by/browse-by-date/browse-by-date.component.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ import {
1818
combineLatest as observableCombineLatest,
1919
Observable,
2020
} from 'rxjs';
21-
import { map } from 'rxjs/operators';
21+
import {
22+
map,
23+
take,
24+
} from 'rxjs/operators';
2225
import { ThemedBrowseByComponent } from 'src/app/shared/browse-by/themed-browse-by.component';
2326

2427
import {
@@ -53,7 +56,6 @@ import { VarDirective } from '../../shared/utils/var.directive';
5356
import {
5457
BrowseByMetadataComponent,
5558
browseParamsToOptions,
56-
getBrowseSearchOptions,
5759
} from '../browse-by-metadata/browse-by-metadata.component';
5860

5961
@Component({
@@ -104,15 +106,18 @@ export class BrowseByDateComponent extends BrowseByMetadataComponent implements
104106
ngOnInit(): void {
105107
const sortConfig = new SortOptions('default', SortDirection.ASC);
106108
this.startsWithType = StartsWithType.date;
107-
// include the thumbnail configuration in browse search options
108-
this.updatePage(getBrowseSearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig, this.fetchThumbnails));
109109
this.currentPagination$ = this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig);
110110
this.currentSort$ = this.paginationService.getCurrentSort(this.paginationConfig.id, sortConfig);
111111
this.subs.push(
112-
observableCombineLatest([this.route.params, this.route.queryParams, this.scope$, this.route.data,
113-
this.currentPagination$, this.currentSort$]).pipe(
114-
map(([routeParams, queryParams, scope, data, currentPage, currentSort]) => {
115-
return [Object.assign({}, routeParams, queryParams, data), scope, currentPage, currentSort];
112+
observableCombineLatest(
113+
[ this.route.params.pipe(take(1)),
114+
this.route.queryParams,
115+
this.scope$,
116+
this.currentPagination$,
117+
this.currentSort$,
118+
]).pipe(
119+
map(([routeParams, queryParams, scope, currentPage, currentSort]) => {
120+
return [Object.assign({}, routeParams, queryParams), scope, currentPage, currentSort];
116121
}),
117122
).subscribe(([params, scope, currentPage, currentSort]: [Params, string, PaginationComponentOptions, SortOptions]) => {
118123
const metadataKeys = params.browseDefinition ? params.browseDefinition.metadataKeys : this.defaultMetadataKeys;

src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ import {
2323
of as observableOf,
2424
Subscription,
2525
} from 'rxjs';
26-
import { map } from 'rxjs/operators';
26+
import {
27+
map,
28+
take,
29+
} from 'rxjs/operators';
2730
import { ThemedBrowseByComponent } from 'src/app/shared/browse-by/themed-browse-by.component';
2831

2932
import {
@@ -216,7 +219,13 @@ export class BrowseByMetadataComponent implements OnInit, OnChanges, OnDestroy {
216219
this.currentPagination$ = this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig);
217220
this.currentSort$ = this.paginationService.getCurrentSort(this.paginationConfig.id, sortConfig);
218221
this.subs.push(
219-
observableCombineLatest([this.route.params, this.route.queryParams, this.scope$, this.currentPagination$, this.currentSort$]).pipe(
222+
observableCombineLatest(
223+
[ this.route.params.pipe(take(1)),
224+
this.route.queryParams,
225+
this.scope$,
226+
this.currentPagination$,
227+
this.currentSort$,
228+
]).pipe(
220229
map(([routeParams, queryParams, scope, currentPage, currentSort]) => {
221230
return [Object.assign({}, routeParams, queryParams), scope, currentPage, currentSort];
222231
}),

src/app/browse-by/browse-by-page/browse-by-page.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { BrowseBySwitcherComponent } from '../browse-by-switcher/browse-by-switc
2323
})
2424
export class BrowseByPageComponent implements OnInit {
2525

26-
browseByType$: Observable<BrowseByDataType>;
26+
browseByType$: Observable<{type: BrowseByDataType }>;
2727

2828
constructor(
2929
protected route: ActivatedRoute,
@@ -35,7 +35,7 @@ export class BrowseByPageComponent implements OnInit {
3535
*/
3636
ngOnInit(): void {
3737
this.browseByType$ = this.route.data.pipe(
38-
map((data: { browseDefinition: BrowseDefinition }) => data.browseDefinition.getRenderType()),
38+
map((data: { browseDefinition: BrowseDefinition }) => ({ type: data.browseDefinition.getRenderType() })),
3939
);
4040
}
4141

src/app/browse-by/browse-by-switcher/browse-by-switcher.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('BrowseBySwitcherComponent', () => {
8585
types.forEach((type: NonHierarchicalBrowseDefinition) => {
8686
describe(`when switching to a browse-by page for "${type.id}"`, () => {
8787
beforeEach(async () => {
88-
comp.browseByType = type.dataType;
88+
comp.browseByType = type as any;
8989
comp.ngOnChanges({
9090
browseByType: new SimpleChange(undefined, type.dataType, true),
9191
});

src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class BrowseBySwitcherComponent extends AbstractComponentLoaderComponent<
2424

2525
@Input() context: Context;
2626

27-
@Input() browseByType: BrowseByDataType;
27+
@Input() browseByType: { type: BrowseByDataType };
2828

2929
@Input() displayTitle: boolean;
3030

@@ -43,7 +43,7 @@ export class BrowseBySwitcherComponent extends AbstractComponentLoaderComponent<
4343
];
4444

4545
public getComponent(): GenericConstructor<Component> {
46-
return getComponentByBrowseByType(this.browseByType, this.context, this.themeService.getThemeName());
46+
return getComponentByBrowseByType(this.browseByType.type, this.context, this.themeService.getThemeName());
4747
}
4848

4949
}

src/app/browse-by/browse-by-title/browse-by-title.component.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import {
99
import { Params } from '@angular/router';
1010
import { TranslateModule } from '@ngx-translate/core';
1111
import { combineLatest as observableCombineLatest } from 'rxjs';
12-
import { map } from 'rxjs/operators';
12+
import {
13+
map,
14+
take,
15+
} from 'rxjs/operators';
1316

1417
import {
1518
SortDirection,
@@ -28,7 +31,6 @@ import { VarDirective } from '../../shared/utils/var.directive';
2831
import {
2932
BrowseByMetadataComponent,
3033
browseParamsToOptions,
31-
getBrowseSearchOptions,
3234
} from '../browse-by-metadata/browse-by-metadata.component';
3335

3436
@Component({
@@ -58,12 +60,16 @@ export class BrowseByTitleComponent extends BrowseByMetadataComponent implements
5860

5961
ngOnInit(): void {
6062
const sortConfig = new SortOptions('dc.title', SortDirection.ASC);
61-
// include the thumbnail configuration in browse search options
62-
this.updatePage(getBrowseSearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig, this.fetchThumbnails));
6363
this.currentPagination$ = this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig);
6464
this.currentSort$ = this.paginationService.getCurrentSort(this.paginationConfig.id, sortConfig);
6565
this.subs.push(
66-
observableCombineLatest([this.route.params, this.route.queryParams, this.scope$, this.currentPagination$, this.currentSort$]).pipe(
66+
observableCombineLatest(
67+
[ this.route.params.pipe(take(1)),
68+
this.route.queryParams,
69+
this.scope$,
70+
this.currentPagination$,
71+
this.currentSort$,
72+
]).pipe(
6773
map(([routeParams, queryParams, scope, currentPage, currentSort]) => {
6874
return [Object.assign({}, routeParams, queryParams), scope, currentPage, currentSort];
6975
}),

src/app/core/config/models/config-submission-section.model.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,16 @@ import {
44
inheritSerialization,
55
} from 'cerialize';
66

7+
import {
8+
SectionScope,
9+
SectionVisibility,
10+
} from '../../../submission/objects/section-visibility.model';
711
import { SectionsType } from '../../../submission/sections/sections-type';
812
import { typedObject } from '../../cache/builders/build-decorators';
913
import { HALLink } from '../../shared/hal-link.model';
1014
import { ConfigObject } from './config.model';
1115
import { SUBMISSION_SECTION_TYPE } from './config-type';
1216

13-
/**
14-
* An interface that define section visibility and its properties.
15-
*/
16-
export interface SubmissionSectionVisibility {
17-
main: any;
18-
other: any;
19-
}
20-
2117
@typedObject
2218
@inheritSerialization(ConfigObject)
2319
export class SubmissionSectionModel extends ConfigObject {
@@ -35,17 +31,23 @@ export class SubmissionSectionModel extends ConfigObject {
3531
@autoserialize
3632
mandatory: boolean;
3733

34+
/**
35+
* The submission scope for this section
36+
*/
37+
@autoserialize
38+
scope: SectionScope;
39+
3840
/**
3941
* A string representing the kind of section object
4042
*/
4143
@autoserialize
4244
sectionType: SectionsType;
4345

4446
/**
45-
* The [SubmissionSectionVisibility] object for this section
47+
* The [SectionVisibility] object for this section
4648
*/
4749
@autoserialize
48-
visibility: SubmissionSectionVisibility;
50+
visibility: SectionVisibility;
4951

5052
/**
5153
* The {@link HALLink}s for this SubmissionSectionModel

0 commit comments

Comments
 (0)