Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into w2p-118627_realign-st…
Browse files Browse the repository at this point in the history
…andard-dspace-themes-after-bootstrap-5-upgrade-9.0
  • Loading branch information
ybnd committed Dec 4, 2024
2 parents 327c02e + 37bd26e commit d315929
Show file tree
Hide file tree
Showing 15 changed files with 294 additions and 176 deletions.
14 changes: 7 additions & 7 deletions config/config.example.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NOTE: will log all redux actions and transfers in console
debug: false

# Angular Universal server settings
# Angular User Inteface settings
# NOTE: these settings define where Node.js will start your UI application. Therefore, these
# "ui" settings usually specify a localhost port/URL which is later proxied to a public URL (using Apache or similar)
ui:
Expand All @@ -17,12 +17,12 @@ ui:
# Trust X-FORWARDED-* headers from proxies (default = true)
useProxies: true

universal:
# Whether to inline "critical" styles into the server-side rendered HTML.
# Determining which styles are critical is a relatively expensive operation;
# this option can be disabled to boost server performance at the expense of
# loading smoothness.
inlineCriticalCss: true
# Angular Server Side Rendering (SSR) settings
ssr:
# Whether to tell Angular to inline "critical" styles into the server-side rendered HTML.
# Determining which styles are critical is a relatively expensive operation; this option is
# disabled (false) by default to boost server performance at the expense of loading smoothness.
inlineCriticalCss: false

# The REST API server settings
# NOTE: these settings define which (publicly available) REST API to use. They are usually
Expand Down
125 changes: 37 additions & 88 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"compression-webpack-plugin": "^9.2.0",
"copy-webpack-plugin": "^6.4.1",
"cross-env": "^7.0.3",
"cypress": "^13.15.1",
"cypress": "^13.16.0",
"cypress-axe": "^1.5.0",
"deep-freeze": "0.0.1",
"eslint": "^8.39.0",
Expand Down
2 changes: 2 additions & 0 deletions src/app/core/provide-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { AccessStatusObject } from '../shared/object-collection/shared/badges/ac
import { IdentifierData } from '../shared/object-list/identifier-data/identifier-data.model';
import { Subscription } from '../shared/subscriptions/models/subscription.model';
import { SubmissionCoarNotifyConfig } from '../submission/sections/section-coar-notify/submission-coar-notify.config';
import { SystemWideAlert } from '../system-wide-alert/system-wide-alert.model';
import { AuthStatus } from './auth/models/auth-status.model';
import { ShortLivedToken } from './auth/models/short-lived-token.model';
import { BulkAccessConditionOptions } from './config/models/bulk-access-condition-options.model';
Expand Down Expand Up @@ -186,4 +187,5 @@ export const models =
Itemfilter,
SubmissionCoarNotifyConfig,
NotifyRequestsStatus,
SystemWideAlert,
];
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from '@ngx-translate/core';
import {
BehaviorSubject,
catchError,
Observable,
} from 'rxjs';
import { map } from 'rxjs/operators';
Expand All @@ -34,6 +35,7 @@ import { Item } from '../../../core/shared/item.model';
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
import { AlertComponent } from '../../../shared/alert/alert.component';
import { NotificationsService } from '../../../shared/notifications/notifications.service';
import { createFailedRemoteDataObjectFromError$ } from '../../../shared/remote-data.utils';

@Component({
selector: 'ds-orcid-auth',
Expand Down Expand Up @@ -203,13 +205,14 @@ export class OrcidAuthComponent implements OnInit, OnChanges {
this.unlinkProcessing.next(true);
this.orcidAuthService.unlinkOrcidByItem(this.item).pipe(
getFirstCompletedRemoteData(),
catchError(createFailedRemoteDataObjectFromError$<ResearcherProfile>),
).subscribe((remoteData: RemoteData<ResearcherProfile>) => {
this.unlinkProcessing.next(false);
if (remoteData.isSuccess) {
if (remoteData.hasFailed) {
this.notificationsService.error(this.translateService.get('person.page.orcid.unlink.error'));
} else {
this.notificationsService.success(this.translateService.get('person.page.orcid.unlink.success'));
this.unlink.emit();
} else {
this.notificationsService.error(this.translateService.get('person.page.orcid.unlink.error'));
}
});
}
Expand Down
17 changes: 15 additions & 2 deletions src/app/item-page/orcid-page/orcid-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
combineLatest,
} from 'rxjs';
import {
filter,
map,
take,
} from 'rxjs/operators';
Expand Down Expand Up @@ -187,8 +188,20 @@ export class OrcidPageComponent implements OnInit {
*/
private clearRouteParams(): void {
// update route removing the code from query params
const redirectUrl = this.router.url.split('?')[0];
this.router.navigate([redirectUrl]);
this.route.queryParamMap
.pipe(
filter((paramMap: ParamMap) => isNotEmpty(paramMap.keys)),
map(_ => Object.assign({})),
take(1),
).subscribe(queryParams =>
this.router.navigate(
[],
{
relativeTo: this.route,
queryParams,
},
),
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ describe('OrcidSyncSettingsComponent test suite', () => {
scheduler = getTestScheduler();
fixture = TestBed.createComponent(OrcidSyncSettingsComponent);
comp = fixture.componentInstance;
researcherProfileService.findByRelatedItem.and.returnValue(createSuccessfulRemoteDataObject$(mockResearcherProfile));
comp.item = mockItemLinkedToOrcid;
fixture.detectChanges();
}));
Expand Down Expand Up @@ -216,7 +217,6 @@ describe('OrcidSyncSettingsComponent test suite', () => {
});

it('should call updateByOrcidOperations properly', () => {
researcherProfileService.findByRelatedItem.and.returnValue(createSuccessfulRemoteDataObject$(mockResearcherProfile));
researcherProfileService.patch.and.returnValue(createSuccessfulRemoteDataObject$(mockResearcherProfile));
const expectedOps: Operation[] = [
{
Expand Down Expand Up @@ -245,7 +245,6 @@ describe('OrcidSyncSettingsComponent test suite', () => {
});

it('should show notification on success', () => {
researcherProfileService.findByRelatedItem.and.returnValue(createSuccessfulRemoteDataObject$(mockResearcherProfile));
researcherProfileService.patch.and.returnValue(createSuccessfulRemoteDataObject$(mockResearcherProfile));

scheduler.schedule(() => comp.onSubmit(formGroup));
Expand All @@ -257,6 +256,8 @@ describe('OrcidSyncSettingsComponent test suite', () => {

it('should show notification on error', () => {
researcherProfileService.findByRelatedItem.and.returnValue(createFailedRemoteDataObject$());
comp.item = mockItemLinkedToOrcid;
fixture.detectChanges();

scheduler.schedule(() => comp.onSubmit(formGroup));
scheduler.flush();
Expand All @@ -266,7 +267,6 @@ describe('OrcidSyncSettingsComponent test suite', () => {
});

it('should show notification on error', () => {
researcherProfileService.findByRelatedItem.and.returnValue(createSuccessfulRemoteDataObject$(mockResearcherProfile));
researcherProfileService.patch.and.returnValue(createFailedRemoteDataObject$());

scheduler.schedule(() => comp.onSubmit(formGroup));
Expand Down
Loading

0 comments on commit d315929

Please sign in to comment.