Revision 60275
Added by Konstantinos Triantafyllou over 3 years ago
modules/uoa-services-library/trunk/ng-openaire-library/src/app/sharedComponents/subscriber-invite/subscriber-invite.component.ts | ||
---|---|---|
6 | 6 |
import {Body} from "../../utils/email/body"; |
7 | 7 |
import {CommunityService} from "../../connect/community/community.service"; |
8 | 8 |
import {Composer} from "../../utils/email/composer"; |
9 |
import {User} from "../../login/utils/helper.class"; |
|
9 |
import {Session, User} from "../../login/utils/helper.class";
|
|
10 | 10 |
import {EmailService} from "../../utils/email/email.service"; |
11 | 11 |
import {properties} from "../../../../environments/environment"; |
12 |
import {CommunityInfo} from "../../connect/community/communityInfo"; |
|
12 | 13 |
|
13 | 14 |
declare var UIkit; |
14 | 15 |
|
... | ... | |
31 | 32 |
Message *: |
32 | 33 |
</div> |
33 | 34 |
<div class="uk-width-expand"> |
34 |
<ckeditor class="form-control" formControlName="message" id="message" |
|
35 |
<ckeditor *ngIf="isManager" class="form-control" formControlName="message" id="message"
|
|
35 | 36 |
debounce="400" |
36 | 37 |
[config]="{ extraAllowedContent: '* [uk-*](*) ; span', disallowedContent: 'script; *[on*]', removeButtons: 'Save,NewPage,DocProps,Preview,Print', |
37 | 38 |
extraPlugins: 'divarea'}"></ckeditor> |
39 |
<div *ngIf="!isManager" [innerHTML]="body.paragraphs"></div> |
|
38 | 40 |
<div class="uk-margin-top"> |
39 | 41 |
{{body.signature}} |
40 | 42 |
<span *ngIf="body.fromName == ''" class="uk-text-muted"> |
... | ... | |
55 | 57 |
export class SubscriberInviteComponent implements OnInit, OnDestroy { |
56 | 58 |
@Input() |
57 | 59 |
public user: User; |
60 |
public community: CommunityInfo |
|
58 | 61 |
public inviteForm: FormGroup; |
59 | 62 |
public email: Email; |
60 | 63 |
public body: Body; |
... | ... | |
90 | 93 |
message: this.fb.control('', Validators.required) |
91 | 94 |
}); |
92 | 95 |
this.subscriptions.push(this.communityService.getCommunityAsObservable().subscribe(community => { |
96 |
this.community = community; |
|
93 | 97 |
this.inviteForm.get('name').enable(); |
94 | 98 |
this.inviteForm.get('name').setValue(this.user.fullname); |
95 | 99 |
this.inviteForm.get('name').disable(); |
... | ... | |
150 | 154 |
} |
151 | 155 |
} |
152 | 156 |
|
157 |
get isManager() { |
|
158 |
return Session.isPortalAdministrator(this.user) && Session.isCurator('community', this.user) && Session.isManager('community', this.community.communityId, this.user); |
|
159 |
} |
|
160 |
|
|
153 | 161 |
get valid() { |
154 | 162 |
return this.inviteForm && this.inviteForm.valid; |
155 | 163 |
} |
Also available in: Unified diff
[Library | Trunk]: Add isManager method for editing subscriber invitation message