Skip to content

Commit 42908fc

Browse files
Merge branch 'dspace-cris-2023_02_x' into DSC-1529-thumbnail-social-network
2 parents 7aaba55 + 5ec1ff3 commit 42908fc

86 files changed

Lines changed: 1396 additions & 622 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.

cypress/e2e/search-navbar.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const page = {
1515
}
1616
};
1717

18-
xdescribe('Search from Navigation Bar', () => {
18+
describe('Search from Navigation Bar', () => {
1919
// NOTE: these tests currently assume this query will return results!
2020
const query = TEST_SEARCH_TERM;
2121

src/app/admin/admin-edit-user-agreement/admin-edit-user-agreement.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class AdminEditUserAgreementComponent implements OnInit, OnDestroy {
7272
this.subs.push(this.siteService.patch(this.site, operations).pipe(
7373
getFirstCompletedRemoteData(),
7474
).subscribe((restResponse) => {
75-
if (restResponse.isSuccess) {
75+
if (restResponse.hasSucceeded) {
7676
this.notificationsService.success(this.translateService.get('admin.edit-user-agreement.success'));
7777
if ( result === 'edit-with-reset' ) {
7878
this.deleteAllUserAgreementMetadataValues();

src/app/collection-page/collection-form/collection-form.component.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
import { Collection } from '../../core/shared/collection.model';
1414
import { ComColFormComponent } from '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component';
1515
import { NotificationsService } from '../../shared/notifications/notifications.service';
16-
import { CommunityDataService } from '../../core/data/community-data.service';
16+
import { CollectionDataService } from '../../core/data/collection-data.service';
1717
import { AuthService } from '../../core/auth/auth.service';
1818
import { RequestService } from '../../core/data/request.service';
1919
import { ObjectCacheService } from '../../core/cache/object-cache.service';
@@ -34,7 +34,7 @@ import { SubmissionDefinitionsConfigDataService } from '../../core/config/submis
3434
import { ConfigObject } from '../../core/config/models/config.model';
3535
import { NONE_ENTITY_TYPE } from '../../core/shared/item-relationships/item-type.resource-type';
3636
import { hasNoValue, isNotNull } from 'src/app/shared/empty.util';
37-
37+
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
3838

3939
/**
4040
* Form used for creating and editing collections
@@ -85,13 +85,14 @@ export class CollectionFormComponent extends ComColFormComponent<Collection> imp
8585
protected translate: TranslateService,
8686
protected notificationsService: NotificationsService,
8787
protected authService: AuthService,
88-
protected dsoService: CommunityDataService,
88+
protected dsoService: CollectionDataService,
8989
protected requestService: RequestService,
9090
protected objectCache: ObjectCacheService,
9191
protected entityTypeService: EntityTypeDataService,
9292
protected chd: ChangeDetectorRef,
93+
protected modalService: NgbModal,
9394
protected submissionDefinitionService: SubmissionDefinitionsConfigDataService) {
94-
super(formService, translate, notificationsService, authService, requestService, objectCache);
95+
super(formService, translate, notificationsService, authService, requestService, objectCache, modalService);
9596
}
9697

9798
ngOnInit(): void {

src/app/collection-page/create-collection-page/create-collection-page.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ <h2 id="sub-header" class="border-bottom pb-2">{{'collection.create.sub-head' |
55
</div>
66
</div>
77
<ds-collection-form (submitForm)="onSubmit($event)"
8+
[isCreation]="true"
89
(back)="navigateToHome()"
910
(finish)="navigateToNewPage()"></ds-collection-form>
1011
</div>

src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
</div>
1818
</div>
1919
<ds-collection-form [dso]="(dsoRD$ | async)?.payload"
20+
[isCreation]="false"
2021
(submitForm)="onSubmit($event)"
2122
(back)="navigateToHomePage()"
2223
(finish)="navigateToHomePage()"></ds-collection-form>

src/app/community-page/community-form/community-form.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { AuthService } from '../../core/auth/auth.service';
1414
import { RequestService } from '../../core/data/request.service';
1515
import { ObjectCacheService } from '../../core/cache/object-cache.service';
1616
import { environment } from '../../../environments/environment';
17+
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
1718

1819
/**
1920
* Form used for creating and editing communities
@@ -78,8 +79,9 @@ export class CommunityFormComponent extends ComColFormComponent<Community> imple
7879
protected authService: AuthService,
7980
protected dsoService: CommunityDataService,
8081
protected requestService: RequestService,
81-
protected objectCache: ObjectCacheService) {
82-
super(formService, translate, notificationsService, authService, requestService, objectCache);
82+
protected objectCache: ObjectCacheService,
83+
protected modalService: NgbModal) {
84+
super(formService, translate, notificationsService, authService, requestService, objectCache, modalService);
8385
}
8486

8587
ngOnChanges(changes: SimpleChanges) {

src/app/community-page/create-community-page/create-community-page.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
<div class="row">
33
<div class="col-12 pb-4">
44
<ng-container *ngVar="(parentRD$ | async)?.payload as parent">
5-
<h2 *ngIf="!parent" id="header" class="border-bottom pb-2">{{ 'community.create.head' | translate }}</h2>
5+
<h2 *ngIf="!parent" id="header" class="border-bottom p-2">{{ 'community.create.head' | translate }}</h2>
66
<h2 *ngIf="parent" id="sub-header" class="border-bottom pb-2">{{ 'community.create.sub-head' | translate:{ parent: dsoNameService.getName(parent) } }}</h2>
77
</ng-container>
88
</div>
99
</div>
1010
<ds-community-form (submitForm)="onSubmit($event)"
11+
[isCreation]="true"
1112
(back)="navigateToHome()"
1213
(finish)="navigateToNewPage()"></ds-community-form>
1314
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<ds-community-form [dso]="(dsoRD$ | async)?.payload"
2+
[isCreation]="false"
23
(submitForm)="onSubmit($event)"
34
(back)="navigateToHomePage()"
45
(finish)="navigateToHomePage()"></ds-community-form>
5-

src/app/core/browse/search-manager.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { map, switchMap } from 'rxjs/operators';
44
import { PaginatedList } from '../data/paginated-list.model';
55
import { RemoteData } from '../data/remote-data';
66
import { Item } from '../shared/item.model';
7-
import { getFirstSucceededRemoteData } from '../shared/operators';
7+
import { getFirstCompletedRemoteData } from '../shared/operators';
88
import { BrowseEntrySearchOptions } from './browse-entry-search-options.model';
99
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
1010
import { ItemDataService } from '../data/item-data.service';
@@ -107,8 +107,16 @@ export class SearchManager {
107107
.filter((item) => hasValue(item));
108108

109109
const uuidList = this.extractUUID(items, environment.followAuthorityMetadata);
110-
111-
return uuidList.length > 0 ? this.itemService.findAllById(uuidList).pipe(getFirstSucceededRemoteData()) : of(null);
110+
return uuidList.length > 0 ? this.itemService.findAllById(uuidList).pipe(
111+
getFirstCompletedRemoteData(),
112+
map(data => {
113+
if (data.hasSucceeded) {
114+
return of(data);
115+
} else {
116+
of(null);
117+
}
118+
})
119+
) : of(null);
112120
}
113121

114122
protected extractUUID(items: Item[], metadataToFollow: FollowAuthorityMetadata[]): string[] {

src/app/core/core.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ import { EditItemMode } from './submission/models/edititem-mode.model';
162162
import { AuditDataService } from './audit/audit-data.service';
163163
import { Audit } from './audit/model/audit.model';
164164
import { ItemExportFormat } from './itemexportformat/model/item-export-format.model';
165-
import { MetricsComponentsDataService } from './layout/metrics-components-data.service';
165+
import { MetricsComponentsService } from './layout/metrics-components.service';
166166
import { MetricsComponent } from './layout/models/metrics-component.model';
167167
import { Metric } from './shared/metric.model';
168168
import { MetricsDataService } from './data/metrics-data.service';
@@ -354,7 +354,7 @@ const PROVIDERS = [
354354
FilteredDiscoveryPageResponseParsingService,
355355
{ provide: NativeWindowService, useFactory: NativeWindowFactory },
356356
TabDataService,
357-
MetricsComponentsDataService,
357+
MetricsComponentsService,
358358
MetricsDataService,
359359
VocabularyService,
360360
VocabularyDataService,

0 commit comments

Comments
 (0)