Skip to content

Commit f9fbb8c

Browse files
authored
Fix/712 714 bugs (CenterForOpenScience#429)
* fix(contributors): fixed contributors 2 bugs * fix(styles): fixed styles for contributors
1 parent 2f71a6c commit f9fbb8c

6 files changed

Lines changed: 9 additions & 19 deletions

File tree

src/app/features/my-projects/mappers/my-resources.mapper.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ export class MyResourcesMapper {
1111
isPublic: response.attributes.public,
1212
contributors:
1313
response.embeds?.bibliographic_contributors?.data?.map((contributor) => ({
14-
familyName: contributor.embeds.users.data.attributes.family_name,
15-
fullName: contributor.embeds.users.data.attributes.full_name,
16-
givenName: contributor.embeds.users.data.attributes.given_name,
17-
middleName: contributor.embeds.users.data.attributes.middle_name,
14+
familyName: contributor.embeds.users.data?.attributes.family_name,
15+
fullName: contributor.embeds.users.data?.attributes.full_name,
16+
givenName: contributor.embeds.users.data?.attributes.given_name,
17+
middleName: contributor.embeds.users.data?.attributes.middle_name,
1818
})) ?? [],
1919
};
2020
}

src/app/shared/components/contributors/add-contributor-dialog/add-contributor-dialog.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
} @else {
1212
@for (item of users(); track $index) {
1313
<div class="border-divider flex pb-3">
14-
<p-checkbox variant="filled" [value]="item" [inputId]="item.id" [(ngModel)]="selectedUsers"></p-checkbox>
15-
<label class="label ml-2" [for]="item.id">{{ item.fullName }}</label>
14+
<p-checkbox variant="filled" [value]="item" [(ngModel)]="selectedUsers"></p-checkbox>
15+
<a class="ml-2 font-bold" [href]="item.id" target="_blank">{{ item.fullName }}</a>
1616
</div>
1717
}
1818

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
@use "styles/mixins" as mix;
22

3-
.label {
4-
color: var(--dark-blue-1);
5-
margin: 0;
6-
cursor: pointer;
7-
}
8-
93
.border-divider {
104
border-bottom: 1px solid var(--grey-2);
115
}

src/app/shared/components/cookie-consent/cookie-consent.component.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
<div class="flex flex-column gap-2">
44
<span>{{ message.detail }}</span>
55
<div class="flex justify-content-end">
6-
<p-button
7-
type="button"
8-
label="{{ 'toast.cookie-consent.accept' | translate }}"
9-
(click)="acceptCookies()"
10-
></p-button>
6+
<p-button [label]="'toast.cookie-consent.accept' | translate" (onClick)="acceptCookies()"></p-button>
117
</div>
128
</div>
139
</ng-template>

src/app/shared/mappers/contributors/contributors.mapper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export class ContributorsMapper {
3636
({
3737
id: user.id,
3838
fullName: user.attributes.full_name,
39-
isBibliographic: false,
40-
permission: ContributorPermission.Read,
39+
isBibliographic: true,
40+
permission: ContributorPermission.Write,
4141
}) as ContributorAddModel
4242
),
4343
totalCount: response.meta.total,

0 commit comments

Comments
 (0)