add fields claim and membership in edit form

This commit is contained in:
argirok 2023-07-19 14:26:16 +03:00
parent d9b0365a1d
commit f63cd1ec60
1 changed files with 26 additions and 0 deletions

View File

@ -82,6 +82,16 @@ import {ClearCacheService} from "../../../../openaireLibrary/services/clear-cach
placeholder="Visibility status for your community's profile."
[options]="statuses" type="select"></div>
</div>
<div class="uk-width-1-2@m">
<div input [formInput]="communityFb.get('claim')"
placeholder="Who can create links for your community"
[options]="claimOptions" type="select"></div>
</div>
<div class="uk-width-1-2@m">
<div input [formInput]="communityFb.get('membership')"
placeholder="Who can join"
[options]="membershipOptions" type="select"></div>
</div>
</div>
</form>
`,
@ -91,9 +101,23 @@ export class EditCommunityComponent {
public communityFb: UntypedFormGroup;
public statuses: Option[] = [
{label: 'Visible', value: 'all'},
{label: 'Visible [Public*]', value: 'PUBLIC'},
{label: 'Visible to managers', value: 'manager'},
{label: 'Visible to managers [Restricted*]', value: 'RESTRICTED'},
/*
{label: 'Hidden [Private*]', value: 'PRIVATE'},
*/
{label: 'Hidden', value: 'hidden'}
]
public claimOptions: Option[] = [
{label: 'Anyone can claim', value: 'all'},
{label: 'Managers only', value: 'managersOnly'},
{label: 'membersOnly', value: 'membersOnly'}
]
public membershipOptions: Option[] = [
{label: 'Anyone can join', value: 'open'},
{label: 'By invitation', value: 'byInvitation'}
]
public community: CommunityInfo;
public isNew: boolean;
public properties: EnvProperties = properties
@ -133,6 +157,8 @@ export class EditCommunityComponent {
shortName: this.fb.control(this.community.shortTitle, Validators.required),
description: this.fb.control(this.community.description),
status: this.fb.control(this.community.status),
claim: this.fb.control(this.community.claim),
membership: this.fb.control(this.community.membership),
managers: this.fb.control(this.community.managers),
isUpload: this.fb.control(this.community.isUpload),
logoUrl: this.fb.control(this.community.logoUrl)