Skip to content

Commit ad9fa11

Browse files
authored
Merge pull request #200 from CenterForOpenScience/fix/fixes
fix(settings): fixed some bugs
2 parents 1b05df5 + 66bee04 commit ad9fa11

File tree

9 files changed

+50
-12
lines changed

9 files changed

+50
-12
lines changed

src/app/features/settings/developer-apps/components/developer-app-add-edit-form/developer-app-add-edit-form.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class DeveloperAppAddEditFormComponent implements OnInit {
4343
protected readonly appForm: DeveloperAppForm = new FormGroup({
4444
[DeveloperAppFormFormControls.AppName]: new FormControl('', {
4545
nonNullable: true,
46-
validators: [CustomValidators.requiredTrimmed(), Validators.maxLength(InputLimits.name.maxLength)],
46+
validators: [CustomValidators.requiredTrimmed(), Validators.maxLength(InputLimits.fullName.maxLength)],
4747
}),
4848
[DeveloperAppFormFormControls.ProjectHomePageUrl]: new FormControl('', {
4949
nonNullable: true,

src/app/features/settings/profile-settings/components/employment/employment.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ export class EmploymentComponent {
122122
private createEmploymentFormGroup(employment?: Partial<EmploymentForm>): FormGroup {
123123
return this.fb.group(
124124
{
125-
institution: [employment?.institution ?? '', CustomValidators.requiredTrimmed()],
126-
title: [employment?.title ?? ''],
125+
title: [employment?.title ?? '', CustomValidators.requiredTrimmed()],
126+
institution: [employment?.institution ?? ''],
127127
department: [employment?.department ?? ''],
128128
startDate: [employment?.startDate ?? null],
129129
endDate: [employment?.endDate ?? null],

src/app/features/settings/profile-settings/components/social/social.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ export class SocialComponent {
7979
const mappedLinks = links.map((link) => {
8080
const key = link.socialOutput.key as SocialLinksKeys;
8181

82-
const value = SOCIAL_KEYS.includes(key) ? [link.webAddress] : link.webAddress;
82+
const value = SOCIAL_KEYS.includes(key)
83+
? Array.isArray(link.webAddress)
84+
? link.webAddress
85+
: [link.webAddress]
86+
: link.webAddress;
8387

8488
return {
8589
[key]: value,

src/app/features/settings/profile-settings/constants/data.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,68 +7,94 @@ export const socials: SocialLinksModel[] = [
77
address: 'http://researchers.com/rid/',
88
placeholder: 'x-xxxx-xxxx',
99
key: 'researcherId',
10+
multiple: false,
1011
},
1112
{
1213
id: 1,
1314
label: 'ORCID',
1415
address: 'http://orcid.org/',
1516
placeholder: 'xxxx-xxxx-xxxx',
1617
key: 'orcid',
18+
multiple: false,
1719
},
1820
{
1921
id: 2,
2022
label: 'LinkedIn',
2123
address: 'https://linkedin.com/',
2224
placeholder: 'in/userID, profie/view?profileID, or pub/pubID',
2325
key: 'linkedIn',
26+
multiple: true,
2427
},
2528
{
2629
id: 3,
2730
label: 'X',
2831
address: '@',
2932
placeholder: 'twitterhandle',
3033
key: 'twitter',
34+
multiple: true,
3135
},
3236
{
3337
id: 4,
3438
label: 'GitHub',
3539
address: 'https://github.com/',
3640
placeholder: 'username',
3741
key: 'github',
42+
multiple: true,
3843
},
3944
{
4045
id: 5,
4146
label: 'ImpactStory',
4247
address: 'https://impactstory.org/u/',
4348
placeholder: 'profileID',
4449
key: 'impactStory',
50+
multiple: false,
4551
},
4652
{
4753
id: 6,
4854
label: 'Google Scholar',
4955
address: 'http://scholar.google.com/citations?user=',
5056
placeholder: 'profileID',
5157
key: 'scholar',
58+
multiple: false,
5259
},
5360
{
5461
id: 7,
5562
label: 'ResearchGate',
5663
address: 'https://researchgate.net/profile/',
5764
placeholder: 'profileID',
5865
key: 'researchGate',
66+
multiple: false,
5967
},
6068
{
6169
id: 8,
6270
label: 'Baidu Scholar',
6371
address: 'http://xueshu.baidu.com/scholarID/',
6472
placeholder: 'profileID',
6573
key: 'baiduScholar',
74+
multiple: false,
6675
},
6776
{
6877
id: 9,
6978
label: 'SSRN',
7079
address: 'http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=',
7180
placeholder: 'profileID',
7281
key: 'ssrn',
82+
multiple: false,
83+
},
84+
{
85+
id: 10,
86+
label: 'Your website',
87+
address: 'website',
88+
placeholder: 'https://yourwebsite.com',
89+
key: 'profileWebsites',
90+
multiple: true,
91+
},
92+
{
93+
id: 11,
94+
label: 'Academia Profile Id',
95+
address: '.academia.edu/',
96+
placeholder: 'profileId',
97+
key: 'academiaProfileID',
98+
multiple: false,
7399
},
74100
];

src/app/features/settings/profile-settings/models/social.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export interface SocialLinksModel {
1010
address: string;
1111
placeholder: string;
1212
key: SocialLinksKeys;
13+
multiple: boolean;
1314
}
1415

1516
export interface SocialLinksForm {

src/assets/styles/overrides/date-picker.scss

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/assets/styles/overrides/datepicker.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "assets/styles/mixins" as mix;
2+
13
.p-datepicker {
24
width: 100%;
35
--p-datepicker-input-icon-color: var(--grey-1);
@@ -36,3 +38,9 @@
3638
--p-datepicker-date-hover-color: var(--white);
3739
}
3840
}
41+
42+
.half-width-datepicker {
43+
.p-datepicker-panel {
44+
min-width: mix.rem(350px) !important;
45+
}
46+
}

src/assets/styles/overrides/dialog.scss

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

3+
.p-dialog-close-button {
4+
--p-button-padding-y: 0.75rem;
5+
--p-button-padding-x: 0.75rem;
6+
border: 0;
7+
}
8+
39
.upload-dialog {
410
.p-dialog {
511
width: mix.rem(356px);

src/assets/styles/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
@use "./overrides/stepper";
2424
@use "./overrides/radio";
2525
@use "./overrides/confirmation-dialog";
26+
@use "./overrides/dialog";
2627
@use "./overrides/input-group-addon";
2728
@use "./overrides/iconfield";
2829
@use "./overrides/datepicker";
@@ -44,5 +45,4 @@
4445
@use "./components/md-editor";
4546
@use "./components/preprints";
4647
@use "./overrides/cedar-metadata";
47-
@use "./overrides/date-picker";
4848
@use "./components/collections";

0 commit comments

Comments
 (0)