Skip to content

Commit 0d181a9

Browse files
committed
Merged main-cris into task/main-cris/DSC-2318
2 parents f987927 + 29f6cf2 commit 0d181a9

20 files changed

Lines changed: 189 additions & 64 deletions

File tree

src/app/collection-page/collection-page-routes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ export const ROUTES: Route[] = [
109109
public: [{
110110
id: 'statistics_collection_:id',
111111
active: true,
112-
visible: false,
112+
visible: true,
113+
parentID: 'statistics',
113114
index: 2,
114115
model: {
115116
type: MenuItemType.LINK,

src/app/community-page/community-page-routes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ export const ROUTES: Route[] = [
101101
public: [{
102102
id: 'statistics_community_:id',
103103
active: true,
104-
visible: false,
104+
visible: true,
105+
parentID: 'statistics',
105106
index: 2,
106107
model: {
107108
type: MenuItemType.LINK,

src/app/core/shared/listable.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ import { ItemSearchResultListElementSubmissionComponent } from '../../shared/obj
111111
import { PoolSearchResultListElementComponent } from '../../shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component';
112112
import { WorkflowItemSearchResultListElementComponent } from '../../shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component';
113113
import { WorkspaceItemSearchResultListElementComponent } from '../../shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component';
114+
import { RelationshipsListComponent } from '../../shared/object-list/relationships-list/relationships-list.component';
114115
import { CollectionSearchResultListElementComponent } from '../../shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component';
115116
import { CommunitySearchResultListElementComponent } from '../../shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component';
116117
import { ItemSearchResultListElementComponent } from '../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
@@ -205,6 +206,7 @@ const ENTRY_COMPONENTS = [
205206
ClaimedTaskSearchResultDetailElementComponent,
206207
PoolSearchResultDetailElementComponent,
207208
ItemSearchResultListElementSubmissionComponent,
209+
RelationshipsListComponent,
208210
PublicationComponent,
209211
UntypedItemComponent,
210212
];

src/app/home-page/home-page-routes.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { Route } from '@angular/router';
22

3-
import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model';
4-
import { MenuItemType } from '../shared/menu/menu-item-type.model';
53
import { homePageResolver } from './home-page.resolver';
64
import { ThemedHomePageComponent } from './themed-home-page.component';
75

@@ -13,19 +11,6 @@ export const ROUTES: Route[] = [
1311
data: {
1412
title: 'home.title',
1513
showSocialButtons: true,
16-
menu: {
17-
public: [{
18-
id: 'statistics_site',
19-
active: true,
20-
visible: false,
21-
index: 2,
22-
model: {
23-
type: MenuItemType.LINK,
24-
text: 'menu.section.statistics',
25-
link: 'statistics',
26-
} as LinkMenuItemModel,
27-
}],
28-
},
2914
},
3015
resolve: {
3116
site: homePageResolver,

src/app/item-page/item-page-routes.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ import { versionResolver } from './version-page/version.resolver';
2424
import { VersionPageComponent } from './version-page/version-page/version-page.component';
2525

2626
export const ROUTES: Route[] = [
27+
{
28+
path: 'version',
29+
children: [
30+
{
31+
path: ':id',
32+
component: VersionPageComponent,
33+
resolve: {
34+
dso: versionResolver,
35+
},
36+
},
37+
],
38+
},
2739
{
2840
path: ':id',
2941
resolve: {
@@ -78,7 +90,8 @@ export const ROUTES: Route[] = [
7890
public: [{
7991
id: 'statistics_item_:id',
8092
active: true,
81-
visible: false,
93+
visible: true,
94+
parentID: 'statistics',
8295
index: 2,
8396
model: {
8497
type: MenuItemType.LINK,
@@ -90,16 +103,5 @@ export const ROUTES: Route[] = [
90103
showSocialButtons: true,
91104
},
92105
},
93-
{
94-
path: 'version',
95-
children: [
96-
{
97-
path: ':id',
98-
component: VersionPageComponent,
99-
resolve: {
100-
dso: versionResolver,
101-
},
102-
},
103-
],
104-
},
106+
105107
];

src/app/my-dspace-page/my-dspace-page.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
[selectionConfig]="{ repeatable: true, listId: listId }"
1515
(deselectObject)="onDeselectObject($event)"
1616
(selectObject)="onSelectObject($event)">
17-
<ds-my-dspace-bulk-action *ngIf="(currentConfiguration$ | async) === workflowType"
17+
<!-- Using *ngIf breaks the projection, so we are using hidden instead -->
18+
<ds-my-dspace-bulk-action [hidden]="(currentConfiguration$ | async) !== workflowType"
1819
bulkActions
1920
[listId]="listId"></ds-my-dspace-bulk-action>
2021
<ds-my-dspace-new-bulk-import additionalSearchFormOptions></ds-my-dspace-new-bulk-import>

src/app/my-dspace-page/my-dspace-page.component.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import { RequestEntry } from '../core/data/request-entry.model';
3333
import { SuggestionsNotificationComponent } from '../notifications/suggestions-notification/suggestions-notification.component';
3434
import { getMockRequestService } from '../shared/mocks/request.service.mock';
3535
import { SelectableListService } from '../shared/object-list/selectable-list/selectable-list.service';
36+
import { MyDSpaceBulkActionComponent } from './my-dspace-new-submission/my-dspace-bulk-action/my-dspace-bulk-action.component';
3637
import { MyDSpaceNewBulkImportComponent } from './my-dspace-new-submission/my-dspace-new-bulk-import/my-dspace-new-bulk-import.component';
3738
import { MyDspaceQaEventsNotificationsComponent } from './my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component';
3839

@@ -124,6 +125,7 @@ describe('MyDSpacePageComponent', () => {
124125
SuggestionsNotificationComponent,
125126
MyDspaceQaEventsNotificationsComponent,
126127
MyDSpaceNewBulkImportComponent,
128+
MyDSpaceBulkActionComponent,
127129
],
128130
},
129131
})

src/app/search-page/themed-configuration-search-page.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ export class ThemedConfigurationSearchPageComponent extends ThemedComponent<Conf
228228
'query',
229229
'scope',
230230
'hideScopeInUrl',
231+
'customEvent',
232+
'customData',
231233
];
232234

233235
protected getComponentName(): string {

src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ import {
3434
Subscription,
3535
} from 'rxjs';
3636
import {
37+
distinctUntilChanged,
3738
filter,
3839
map,
3940
mergeMap,
4041
scan,
42+
startWith,
4143
take,
4244
} from 'rxjs/operators';
4345

@@ -118,8 +120,10 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent
118120
}
119121

120122
ngOnInit() {
121-
this.initChipsFromModelValue();
122-
this.valueChangeSubscription = this.model.valueChanges.subscribe(() => {
123+
this.valueChangeSubscription = this.model.valueChanges.pipe(
124+
startWith([]),
125+
distinctUntilChanged((a,b) => JSON.stringify(a) === JSON.stringify(b)),
126+
).subscribe(() => {
123127
this.initChipsFromModelValue();
124128
});
125129
}
@@ -174,23 +178,28 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent
174178
}
175179
modalRef.result.then(() => {
176180
// close
177-
this.selectedChipItemIndex = null;
178-
this.selectedChipItem = null;
179-
this.valueChangeSubscription = this.model.valueChanges.subscribe(() => {
180-
this.initChipsFromModelValue();
181-
});
181+
this.handleModalResult();
182182
}, () => {
183183
// dismiss
184-
this.selectedChipItemIndex = null;
185-
this.selectedChipItem = null;
186-
this.valueChangeSubscription = this.model.valueChanges.subscribe(() => {
187-
this.initChipsFromModelValue();
188-
});
184+
this.handleModalResult();
189185
});
190186

191187
return modalRef;
192188
}
193189

190+
private handleModalResult(): void {
191+
this.selectedChipItemIndex = null;
192+
this.selectedChipItem = null;
193+
if (this.valueChangeSubscription) {
194+
this.valueChangeSubscription.unsubscribe();
195+
}
196+
this.valueChangeSubscription = this.model.valueChanges.pipe(
197+
distinctUntilChanged((a,b) => JSON.stringify(a) === JSON.stringify(b)),
198+
).subscribe(() => {
199+
this.initChipsFromModelValue();
200+
});
201+
}
202+
194203
private initChipsFromModelValue() {
195204
let initChipsValue$: Observable<any[]>;
196205
if (this.model.isEmpty()) {
@@ -236,7 +245,7 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent
236245
return acc;
237246
}, []),
238247
filter((modelValues: any[]) => this.model.getGroupValue().length === modelValues.length),
239-
).subscribe((modelValue) => {
248+
).pipe(distinctUntilChanged((a,b) => JSON.stringify(a) === JSON.stringify(b))).subscribe((modelValue) => {
240249
this.model.value = modelValue;
241250
this.initChips(modelValue);
242251
this.cdr.markForCheck();

src/app/shared/form/chips/chips.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ const TOOLTIP_TEXT_LIMIT = 21;
6666
CdkDropList,
6767
CdkDropListGroup,
6868
NgTemplateOutlet,
69+
CdkDropListGroup,
6970
],
7071
standalone: true,
7172
})

0 commit comments

Comments
 (0)