[plugins-functionality | DONE | ADDED ] add display title and shortitle and use them instead of title/ short title

This commit is contained in:
argirok 2024-05-14 14:49:59 +03:00
parent c7ce678915
commit 488ac615d4
1 changed files with 15 additions and 4 deletions

View File

@ -20,11 +20,19 @@ import {ClearCacheService} from "../../../../openaireLibrary/services/clear-cach
<div class="uk-grid uk-grid-large" uk-grid>
<div class="uk-width-1-2@m">
<div input id="name" [formInput]="communityFb.get('name')"
placeholder="Name of the community profile."></div>
placeholder="Index name of the community."></div>
</div>
<div class="uk-width-1-2@m">
<div input [formInput]="communityFb.get('shortName')"
placeholder="Short name of the community."></div>
placeholder="Index short name of the community."></div>
</div>
<div class="uk-width-1-2@m">
<div input id="name" [formInput]="communityFb.get('displayName')"
placeholder="Display name of the community."></div>
</div>
<div class="uk-width-1-2@m">
<div input [formInput]="communityFb.get('displayShortName')"
placeholder="Display short name of the community."></div>
</div>
<div class="uk-width-1-1">
<div class="uk-text-bold uk-margin-bottom uk-form-hint">Description of the community</div>
@ -153,6 +161,8 @@ export class EditCommunityComponent {
communityId: this.fb.control(this.community.communityId),
name: this.fb.control(this.community.title, Validators.required),
shortName: this.fb.control(this.community.shortTitle, Validators.required),
displayName: this.fb.control(this.community.title, Validators.required),
displayShortName: 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),
@ -182,6 +192,7 @@ export class EditCommunityComponent {
if (!this.isAdmin) {
setTimeout(() => {
this.communityFb.get('shortName').disable();
this.communityFb.get('name').disable();
}, 0);
}
}
@ -190,9 +201,9 @@ export class EditCommunityComponent {
}
public get isAdmin() {
return Session.isPortalAdministrator(this.user);
return Session.isPortalAdministrator(this.user) || Session.isCommunityCurator(this.user);
}
public get disabled(): boolean {
return (this.communityFb && this.communityFb.invalid) ||
(this.communityFb && this.communityFb.pristine && !this.isNew && !this.file) ||