Skip to content

Commit fe212c5

Browse files
[DSC-1864] resolve conflicts on 7.6.2 alignment
1 parent 7c456e0 commit fe212c5

45 files changed

Lines changed: 538 additions & 176 deletions

File tree

Some content is hidden

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

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@
114114
"date-fns-tz": "^1.3.7",
115115
"deepmerge": "^4.3.1",
116116
"domino": "^2.1.6",
117-
"ejs": "^3.1.9",
118-
"express": "^4.18.2",
117+
"ejs": "^3.1.10",
118+
"express": "^4.19.2",
119119
"express-rate-limit": "^5.1.3",
120120
"fast-json-patch": "^3.1.1",
121121
"file-saver": "^2.0.5",
@@ -145,14 +145,16 @@
145145
"ng2-nouislider": "^2.0.0",
146146
"ngx-infinite-scroll": "^15.0.0",
147147
"ngx-pagination": "6.0.3",
148-
"ngx-ui-switch": "^14.0.3",
148+
"ngx-sortablejs": "^11.1.0",
149+
"ngx-ui-switch": "^14.1.0",
149150
"nouislider": "^15.7.1",
150151
"pem": "1.14.7",
151152
"prop-types": "^15.8.1",
152153
"react-copy-to-clipboard": "^5.1.0",
153154
"reflect-metadata": "^0.1.13",
154155
"rxjs": "^7.8.0",
155-
"sanitize-html": "^2.10.0",
156+
"sanitize-html": "^2.12.1",
157+
"sortablejs": "1.15.0",
156158
"uuid": "^8.3.2",
157159
"webfontloader": "1.6.28",
158160
"zone.js": "~0.11.5"
@@ -165,7 +167,7 @@
165167
"@angular-eslint/eslint-plugin-template": "15.2.1",
166168
"@angular-eslint/schematics": "15.2.1",
167169
"@angular-eslint/template-parser": "15.2.1",
168-
"@angular/cli": "^15.2.6",
170+
"@angular/cli": "^16.0.4",
169171
"@angular/compiler-cli": "^15.2.8",
170172
"@angular/language-service": "^15.2.8",
171173
"@cypress/schematic": "^1.5.0",
@@ -194,7 +196,7 @@
194196
"eslint": "^8.39.0",
195197
"eslint-plugin-deprecation": "^1.4.1",
196198
"eslint-plugin-import": "^2.27.5",
197-
"eslint-plugin-jsdoc": "^39.6.4",
199+
"eslint-plugin-jsdoc": "^45.0.0",
198200
"eslint-plugin-jsonc": "^2.6.0",
199201
"eslint-plugin-lodash": "^7.4.0",
200202
"eslint-plugin-unused-imports": "^2.0.0",
@@ -208,7 +210,7 @@
208210
"karma-jasmine-html-reporter": "^1.5.0",
209211
"karma-mocha-reporter": "2.2.5",
210212
"ngx-export-as": "~1.15.1",
211-
"ngx-mask": "13.1.7",
213+
"ngx-mask": "^13.1.7",
212214
"nodemon": "^2.0.22",
213215
"postcss": "^8.4",
214216
"postcss-apply": "0.12.0",

src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
<div class="sidebar-section">
22
<a class="nav-item nav-link d-flex flex-row flex-nowrap"
33
[ngClass]="{ disabled: isDisabled }"
4+
role="menuitem"
45
[attr.aria-disabled]="isDisabled"
5-
[attr.aria-labelledby]="'sidebarName-' + section.id"
6+
[attr.aria-labelledby]="adminMenuSectionTitleId(section.id)"
67
[title]="('menu.section.icon.' + section.id) | translate"
78
[routerLink]="itemModel.link"
89
[queryParams]="itemModel.queryParams"
910
(keyup.space)="navigate($event)"
1011
(keyup.enter)="navigate($event)"
1112
href="javascript:void(0);"
1213
>
13-
<div class="shortcut-icon">
14+
<div class="sidebar-fixed-element-wrapper" data-test="sidebar-section-icon" aria-hidden="true">
1415
<i class="fas fa-{{section.icon}} fa-fw"></i>
1516
</div>
16-
<div class="sidebar-collapsible">
17-
<div class="toggle">
18-
<span id="sidebarName-{{section.id}}" class="section-header-text">
19-
{{itemModel.text | translate}}
20-
</span>
17+
<div class="sidebar-collapsible-element-outer-wrapper">
18+
<div class="sidebar-collapsible-element-inner-wrapper sidebar-item">
19+
<span [id]="adminMenuSectionTitleId(section.id)">{{itemModel.text | translate}}</span>
2120
</div>
2221
</div>
2322
</a>

src/app/admin/admin-sidebar/admin-sidebar.component.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, HostListener, Injector, OnInit } from '@angular/core';
1+
import { Component, HostListener, Injector, Input, OnInit } from '@angular/core';
22
import { BehaviorSubject, combineLatest, Observable } from 'rxjs';
33
import { debounceTime, distinctUntilChanged, first, map, withLatestFrom } from 'rxjs/operators';
44
import { AuthService } from '../../core/auth/auth.service';
@@ -29,9 +29,14 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
2929
menuID = MenuID.ADMIN;
3030

3131
/**
32-
* Observable that emits the width of the collapsible menu sections
32+
* Observable that emits the width of the sidebar when expanded
3333
*/
34-
sidebarWidth: Observable<string>;
34+
@Input() expandedSidebarWidth$: Observable<string>;
35+
36+
/**
37+
* Observable that emits the width of the sidebar when collapsed
38+
*/
39+
@Input() collapsedSidebarWidth$: Observable<string>;
3540

3641
/**
3742
* Is true when the sidebar is open, is false when the sidebar is animating or closed
@@ -45,6 +50,12 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
4550
*/
4651
sidebarClosed = !this.sidebarOpen; // Closed in UI, animation finished
4752

53+
/**
54+
* Is true when the sidebar is opening or closing
55+
* @type {boolean}
56+
*/
57+
sidebarTransitioning = !this.sidebarOpen; // Animation in progress
58+
4859
/**
4960
* Emits true when either the menu OR the menu's preview is expanded, else emits false
5061
*/
@@ -70,7 +81,6 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
7081
*/
7182
ngOnInit(): void {
7283
super.ngOnInit();
73-
this.sidebarWidth = this.variableService.getVariable('--ds-sidebar-items-width');
7484
combineLatest([
7585
this.authService.isAuthenticated(),
7686
this.menuService.getMenuTopSections(this.menuID).pipe(
@@ -141,6 +151,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
141151
* @param event The animation event
142152
*/
143153
startSlide(event: any): void {
154+
this.sidebarTransitioning = true;
144155
if (event.toState === 'expanded') {
145156
this.sidebarClosed = false;
146157
} else if (event.toState === 'collapsed') {
@@ -153,6 +164,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
153164
* @param event The animation event
154165
*/
155166
finishSlide(event: any): void {
167+
this.sidebarTransitioning = false;
156168
if (event.fromState === 'expanded') {
157169
this.sidebarClosed = true;
158170
} else if (event.fromState === 'collapsed') {

src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="container">
22
<div class="d-flex justify-content-between">
3-
<h3>{{'bitstream.download.page' | translate:{ bitstream: dsoNameService.getName((bitstream$ | async)) } }}</h3>
3+
<h1 class="h2">{{'bitstream.download.page' | translate:{ bitstream: dsoNameService.getName((bitstream$ | async)) } }}</h1>
44
<div class="pt-3">
55
<button *ngIf="hasHistory" (click)="back()" class="btn btn-outline-secondary">
66
<i class="fas fa-arrow-left"></i> {{'bitstream.download.page.back' | translate}}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import { APP_CONFIG } from '../../../config/app-config.interface';
2424
import { environment } from '../../../environments/environment';
2525
import { SortDirection } from '../../core/cache/models/sort-options.model';
2626
import { SearchManager } from '../../core/browse/search-manager';
27+
import { cold } from 'jasmine-marbles';
28+
2729

2830
describe('BrowseByDatePageComponent', () => {
2931
let comp: BrowseByDatePageComponent;
@@ -118,9 +120,13 @@ describe('BrowseByDatePageComponent', () => {
118120
fixture.detectChanges();
119121
});
120122

121-
it('should initialize the list of items', () => {
123+
it('should initialize the list of items', (done: DoneFn) => {
124+
expect(comp.loading$).toBeObservable(cold('(a|)', {
125+
a: false,
126+
}));
122127
comp.items$.subscribe((result) => {
123128
expect(result.payload.page).toEqual([firstItem]);
129+
done();
124130
});
125131
});
126132

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ import { PaginationComponentOptions } from '../../shared/pagination/pagination-c
3131
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
3232
import { APP_CONFIG } from '../../../config/app-config.interface';
3333
import { SearchManager } from '../../core/browse/search-manager';
34+
import { cold } from 'jasmine-marbles';
35+
3436

3537
describe('BrowseByMetadataPageComponent', () => {
3638
let comp: BrowseByMetadataPageComponent;
@@ -155,9 +157,13 @@ describe('BrowseByMetadataPageComponent', () => {
155157
fixture.detectChanges();
156158
});
157159

158-
it('should fetch items', () => {
160+
it('should fetch items', (done: DoneFn) => {
161+
expect(comp.loading$).toBeObservable(cold('(a|)', {
162+
a: false,
163+
}));
159164
comp.items$.subscribe((result) => {
160165
expect(result.payload.page).toEqual(mockItems);
166+
done();
161167
});
162168
});
163169

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

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { combineLatest as observableCombineLatest, Observable, Subscription } from 'rxjs';
1+
import { combineLatest as observableCombineLatest, Observable, Subscription, of as observableOf } from 'rxjs';
22
import { Component, Inject, OnInit, OnDestroy } from '@angular/core';
33
import { RemoteData } from '../../core/data/remote-data';
44
import { PaginatedList } from '../../core/data/paginated-list.model';
@@ -109,9 +109,9 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy {
109109
value = '';
110110

111111
/**
112-
* The authority key (may be undefined) associated with {@link #value}.
113-
*/
114-
authority: string;
112+
* The authority key (may be undefined) associated with {@link #value}.
113+
*/
114+
authority: string;
115115

116116
/**
117117
* The current startsWith option (fetched and updated from query-params)
@@ -123,6 +123,11 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy {
123123
*/
124124
fetchThumbnails: boolean;
125125

126+
/**
127+
* Observable determining if the loading animation needs to be shown
128+
*/
129+
loading$ = observableOf(true);
130+
126131
public constructor(protected route: ActivatedRoute,
127132
protected browseService: BrowseService,
128133
protected searchManager: SearchManager,
@@ -202,9 +207,11 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy {
202207
*/
203208
updatePage(searchOptions: BrowseEntrySearchOptions) {
204209
this.browseEntries$ = this.browseService.getBrowseEntriesFor(searchOptions);
210+
this.loading$ = this.browseEntries$.pipe(
211+
map((browseEntriesRD: RemoteData<PaginatedList<BrowseEntry>>) => browseEntriesRD.isLoading),
212+
);
205213
this.items$ = undefined;
206214
}
207-
208215
/**
209216
* Updates the current page with searchOptions and display items linked to the given value
210217
* @param searchOptions Options to narrow down your search:
@@ -216,8 +223,10 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy {
216223
* @param authority The metadata authority of the browse-entry to display items for
217224
*/
218225
updatePageWithItems(searchOptions: BrowseEntrySearchOptions, value: string, authority: string) {
219-
const embedMetrics = followLink('metrics');
220-
this.items$ = this.searchManager.getBrowseItemsFor(value, authority, searchOptions, embedMetrics);
226+
this.items$ = this.browseService.getBrowseItemsFor(value, authority, searchOptions);
227+
this.loading$ = this.items$.pipe(
228+
map((itemsRD: RemoteData<PaginatedList<Item>>) => itemsRD.isLoading),
229+
);
221230
}
222231

223232
/**

src/app/collection-page/collection-page-routing.module.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { ThemedCollectionPageComponent } from './themed-collection-page.componen
2323
import { MenuItemType } from '../shared/menu/menu-item-type.model';
2424
import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver';
2525
import { CommunityBreadcrumbResolver } from '../core/breadcrumbs/community-breadcrumb.resolver';
26+
import { EditCollectionResolver } from "../core/shared/resolvers/edit-collection.resolver";
2627

2728
@NgModule({
2829
imports: [
@@ -60,6 +61,9 @@ import { CommunityBreadcrumbResolver } from '../core/breadcrumbs/community-bread
6061
runGuardsAndResolvers: 'always',
6162
children: [
6263
{
64+
resolve: {
65+
dso: EditCollectionResolver,
66+
},
6367
path: COLLECTION_EDIT_PATH,
6468
loadChildren: () => import('./edit-collection-page/edit-collection-page.module')
6569
.then((m) => m.EditCollectionPageModule),
@@ -92,7 +96,7 @@ import { CommunityBreadcrumbResolver } from '../core/breadcrumbs/community-bread
9296
public: [{
9397
id: 'statistics_collection_:id',
9498
active: true,
95-
visible: true,
99+
visible: false,
96100
index: 2,
97101
model: {
98102
type: MenuItemType.LINK,

src/app/core/core.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ import {
238238
import { ProductDatasetSchemaType } from './metadata/schema-json-ld/schema-types/product/product-dataset-schema-type';
239239
import { PersonSchemaType } from './metadata/schema-json-ld/schema-types/Person/person-schema-type';
240240
import { InternalLinkService } from './services/internal-link.service';
241+
import { SubmissionParentBreadcrumbsService } from './submission/submission-parent-breadcrumb.service';
242+
241243

242244
/**
243245
* When not in production, endpoint responses can be mocked for testing purposes
@@ -375,6 +377,7 @@ const PROVIDERS = [
375377
WorkflowStepStatisticsDataService,
376378
WorkflowOwnerStatisticsDataService,
377379
LoginStatisticsService,
380+
SubmissionParentBreadcrumbsService
378381
];
379382

380383
const SCHEMA_PROVIDERS = [

src/app/core/data/relationship-data.service.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,35 @@ export class RelationshipDataService extends IdentifiableDataService<Relationshi
225225
);
226226
}
227227

228+
/**
229+
* Get an item's relationships in the form of an array with size 100
230+
*
231+
* @param item The {@link Item} to get {@link Relationship}s for
232+
* @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s
233+
* should be automatically resolved
234+
*/
235+
getItemRelationshipsAsArrayAll(item: Item, ...linksToFollow: FollowLinkConfig<Relationship>[]): Observable<Relationship[]> {
236+
// Set the pagination info
237+
const findOptions: FindListOptions = {
238+
elementsPerPage: 100
239+
};
240+
return this.findListByHref(item._links.relationships.href, findOptions, false, false, ...linksToFollow).pipe(
241+
getFirstSucceededRemoteData(),
242+
getRemoteDataPayload(),
243+
map((rels: PaginatedList<Relationship>) => rels.page),
244+
hasValueOperator(),
245+
distinctUntilChanged(compareArraysUsingIds()),
246+
);
247+
}
248+
249+
public updateRightPlace(rel: Relationship): Observable<RemoteData<Relationship>> {
250+
251+
const update$ = this.update(rel);
252+
253+
return update$;
254+
}
255+
256+
228257
/**
229258
* Get an array of the labels of an item’s unique relationship types
230259
* The array doesn't contain any duplicate labels

0 commit comments

Comments
 (0)