Skip to content

Commit 1e2ebfb

Browse files
committed
Merge remote-tracking branch 'upstream/feature/pbs-25-24' into fix/ENG-9768
2 parents e710116 + 617856a commit 1e2ebfb

File tree

57 files changed

+368
-141
lines changed

Some content is hidden

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

57 files changed

+368
-141
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "osf",
3-
"version": "25.3.0",
3+
"version": "25.4.0",
44
"scripts": {
55
"ng": "ng",
66
"analyze-bundle": "ng build --configuration=analyze-bundle && source-map-explorer dist/**/*.js --no-border-checks",

src/app/core/services/auth.service.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,24 @@ export class AuthService {
3535

3636
navigateToSignIn(): void {
3737
this.loaderService.show();
38-
const loginUrl = `${this.casUrl}/login?${urlParam({ service: `${this.webUrl}/login` })}`;
38+
const loginUrl = `${this.casUrl}/login?${urlParam({ service: `${this.webUrl}/login`, next: window.location.href })}`;
3939
window.location.href = loginUrl;
4040
}
4141

4242
navigateToOrcidSignIn(): void {
4343
const loginUrl = `${this.casUrl}/login?${urlParam({
4444
redirectOrcid: 'true',
45-
service: `${this.webUrl}/login/?next=${encodeURIComponent(this.webUrl)}`,
45+
service: `${this.webUrl}/login`,
46+
next: window.location.href,
4647
})}`;
4748
window.location.href = loginUrl;
4849
}
4950

5051
navigateToInstitutionSignIn(): void {
5152
const loginUrl = `${this.casUrl}/login?${urlParam({
5253
campaign: 'institution',
53-
service: `${this.webUrl}/login/?next=${encodeURIComponent(this.webUrl)}`,
54+
service: `${this.webUrl}/login`,
55+
next: window.location.href,
5456
})}`;
5557
window.location.href = loginUrl;
5658
}

src/app/features/collections/components/collections-discover/collections-discover.component.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
class="collections-sub-header flex justify-content-between flex-column gap-4 mb-4 sm:mb-6 sm:gap-0 sm:flex-row"
55
>
66
<div class="flex gap-3">
7+
<h1 class="collections-heading flex align-items-center">{{ collectionProvider()?.name }}</h1>
8+
</div>
9+
10+
<div class="flex m-auto">
711
@let provider = collectionProvider();
812

913
@if (provider && provider.assets) {
@@ -14,8 +18,6 @@
1418
[src]="provider.assets.squareColorNoTransparent"
1519
/>
1620
}
17-
18-
<h1 class="collections-heading flex align-items-center">{{ collectionProvider()?.name }}</h1>
1921
</div>
2022

2123
<p-button [routerLink]="['../add']" [label]="'common.buttons.addToCollection' | translate" />

src/app/features/contributors/contributors.component.ts

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
AddContributorDialogComponent,
2929
AddUnregisteredContributorDialogComponent,
3030
ContributorsTableComponent,
31+
RemoveContributorDialogComponent,
3132
RequestAccessTableComponent,
3233
} from '@osf/shared/components/contributors';
3334
import { SearchInputComponent } from '@osf/shared/components/search-input/search-input.component';
@@ -395,26 +396,37 @@ export class ContributorsComponent implements OnInit, OnDestroy {
395396
removeContributor(contributor: ContributorModel) {
396397
const isDeletingSelf = contributor.userId === this.currentUser()?.id;
397398

398-
this.customConfirmationService.confirmDelete({
399-
headerKey: 'project.contributors.removeDialog.title',
400-
messageKey: 'project.contributors.removeDialog.message',
401-
messageParams: { name: contributor.fullName },
402-
acceptLabelKey: 'common.buttons.remove',
403-
onConfirm: () => {
404-
this.actions
405-
.deleteContributor(this.resourceId(), this.resourceType(), contributor.userId, isDeletingSelf)
406-
.pipe(takeUntilDestroyed(this.destroyRef))
407-
.subscribe(() => {
408-
this.toastService.showSuccess('project.contributors.removeDialog.successMessage', {
409-
name: contributor.fullName,
410-
});
399+
this.customDialogService
400+
.open(RemoveContributorDialogComponent, {
401+
header: 'project.contributors.removeDialog.title',
402+
width: '448px',
403+
data: {
404+
name: contributor.fullName,
405+
hasChildren: !!this.resourceChildren()?.length,
406+
},
407+
})
408+
.onClose.pipe(
409+
filter((res) => res !== undefined),
410+
switchMap((removeFromChildren: boolean) =>
411+
this.actions.deleteContributor(
412+
this.resourceId(),
413+
this.resourceType(),
414+
contributor.userId,
415+
isDeletingSelf,
416+
removeFromChildren
417+
)
418+
),
419+
takeUntilDestroyed(this.destroyRef)
420+
)
421+
.subscribe(() => {
422+
this.toastService.showSuccess('project.contributors.removeDialog.successMessage', {
423+
name: contributor.fullName,
424+
});
411425

412-
if (isDeletingSelf) {
413-
this.router.navigate(['/']);
414-
}
415-
});
416-
},
417-
});
426+
if (isDeletingSelf) {
427+
this.router.navigate(['/']);
428+
}
429+
});
418430
}
419431

420432
loadMoreContributors(): void {
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { ApiData } from '@osf/shared/models/common/json-api.model';
2+
import { replaceBadEncodedChars } from '@shared/helpers/format-bad-encoding.helper';
23

34
import { FileCustomMetadata, OsfFileCustomMetadata } from '../models';
45

56
export function MapFileCustomMetadata(data: ApiData<FileCustomMetadata, null, null, null>): OsfFileCustomMetadata {
67
return {
78
id: data.id,
8-
description: data.attributes.description,
9+
description: replaceBadEncodedChars(data.attributes.description),
910
language: data.attributes.language,
1011
resourceTypeGeneral: data.attributes.resource_type_general,
11-
title: data.attributes.title,
12+
title: replaceBadEncodedChars(data.attributes.title),
1213
};
1314
}

src/app/features/files/mappers/resource-metadata.mapper.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { IdentifiersMapper } from '@osf/shared/mappers/identifiers.mapper';
22
import { ResourceMetadata } from '@osf/shared/models/resource-metadata.model';
3+
import { replaceBadEncodedChars } from '@shared/helpers/format-bad-encoding.helper';
34

45
import { GetResourceCustomMetadataResponse } from '../models/get-resource-custom-metadata-response.model';
56
import { GetResourceShortInfoResponse } from '../models/get-resource-short-info-response.model';
@@ -9,8 +10,8 @@ export function MapResourceMetadata(
910
customMetadata: GetResourceCustomMetadataResponse
1011
): ResourceMetadata {
1112
return {
12-
title: shortInfo.data.attributes.title,
13-
description: shortInfo.data.attributes.description,
13+
title: replaceBadEncodedChars(shortInfo.data.attributes.title),
14+
description: replaceBadEncodedChars(shortInfo.data.attributes.description),
1415
dateCreated: new Date(shortInfo.data.attributes.date_created),
1516
dateModified: new Date(shortInfo.data.attributes.date_modified),
1617
funders:

src/app/features/files/pages/files/files.component.html

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,23 @@
99
}
1010

1111
<div class="flex flex-grow-0 w-full sm:w-30rem">
12-
<p-select
13-
inputId="in_label"
14-
[options]="rootFoldersOptions()"
15-
[(ngModel)]="currentRootFolder"
16-
(onChange)="handleRootFolderChange($event.value)"
17-
styleClass="w-full"
18-
variant="filled"
19-
>
20-
<ng-template #selectedItem let-selectedOption>
21-
<p class="provider-name">{{ selectedOption.label }}</p>
22-
</ng-template>
23-
<ng-template #item let-option>
24-
<p class="provider-name">{{ option.label }}</p>
25-
</ng-template>
26-
</p-select>
12+
@if (!isRegistration()) {
13+
<p-select
14+
inputId="in_label"
15+
[options]="rootFoldersOptions()"
16+
[(ngModel)]="currentRootFolder"
17+
(onChange)="handleRootFolderChange($event.value)"
18+
styleClass="w-full"
19+
variant="filled"
20+
>
21+
<ng-template #selectedItem let-selectedOption>
22+
<p class="provider-name">{{ selectedOption.label }}</p>
23+
</ng-template>
24+
<ng-template #item let-option>
25+
<p class="provider-name">{{ option.label }}</p>
26+
</ng-template>
27+
</p-select>
28+
}
2729
</div>
2830
@if (filesSelection.length) {
2931
@if (!isMoveDialogOpened()) {

src/app/features/files/store/files.state.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ export class FilesState {
6464
isAnonymous: response.meta?.anonymous ?? false,
6565
});
6666
}),
67-
catchError((error) => handleSectionError(ctx, 'files', error))
67+
catchError((error) => {
68+
ctx.patchState({ files: FILES_STATE_DEFAULTS.files });
69+
return handleSectionError(ctx, 'files', error);
70+
})
6871
);
6972
}
7073

src/app/features/meetings/mappers/meetings.mapper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ResponseJsonApi } from '@osf/shared/models/common/json-api.model';
2+
import { replaceBadEncodedChars } from '@shared/helpers/format-bad-encoding.helper';
23

34
import {
45
MeetingGetResponseJsonApi,
@@ -28,7 +29,7 @@ export class MeetingsMapper {
2829
return {
2930
data: response.data.map((item) => ({
3031
id: item.id,
31-
title: item.attributes.title,
32+
title: replaceBadEncodedChars(item.attributes.title),
3233
dateCreated: item.attributes.date_created,
3334
authorName: item.attributes.author_name,
3435
downloadCount: item.attributes.download_count || 0,

src/app/features/metadata/components/metadata-description/metadata-description.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ <h2>{{ 'project.overview.metadata.description' | translate }}</h2>
1313
</div>
1414

1515
<p data-test-display-node-description class="mt-4">
16-
{{ (description() | fixSpecialChar) || ('project.overview.metadata.noDescription' | translate) }}
16+
{{ description() || ('project.overview.metadata.noDescription' | translate) }}
1717
</p>
1818
</p-card>

0 commit comments

Comments
 (0)