Enable invite button for byInvitation commmunities with a link to admin portal.

This commit is contained in:
Konstantinos Triantafyllou 2023-10-11 12:55:11 +03:00
parent 7841e84ca1
commit cc5d3cbdb3
4 changed files with 14 additions and 5 deletions

View File

@ -89,7 +89,7 @@ import {LayoutService} from "./openaireLibrary/dashboard/sharedComponents/sideba
</div>
<div id="joinAndInviteBtn" *ngIf="isClient && communityId && community">
<subscribe *ngIf="community.isOpen()" [communityId]="community.communityId"></subscribe>
<invite *ngIf="isManager && community.isOpen()" [longView]="false"></invite>
<invite *ngIf="isManager" [longView]="false" [communityId]="communityId" [isOpen]="community.isOpen()"></invite>
</div>
<!--feedback *ngIf= "isClient && properties" portalName="Connect" [feedbackQuestionaire]=properties.feedbackQuestionaire></feedback-->
<cookie-law *ngIf="isClient" position="bottom">

View File

@ -30,8 +30,12 @@
</div>
</div>
<div *ngIf="!longView" class="uk-margin-top">
<a id="invite" routerLink="/invite" class="uk-button uk-flex uk-flex-middle uk-flex-center">
<a *ngIf="isOpen" id="invite" routerLink="/invite" class="uk-button uk-flex uk-flex-middle uk-flex-center">
<icon name="person_add" [flex]="true"></icon>
<span class="uk-margin-small-left">Invite users</span>
</a>
<a *ngIf="!isOpen" id="invite" [href]="this.adminInviteURL" target="_blank" class="uk-button uk-flex uk-flex-middle uk-flex-center">
<icon name="person_add" [flex]="true"></icon>
<span class="uk-margin-small-left">Invite members</span>
</a>
</div>

View File

@ -21,6 +21,7 @@ declare var UIkit;
export class InviteComponent implements OnInit {
@Input() longView: boolean = true;
@Input() communityId = null;
@Input() isOpen: boolean = true;
public properties: EnvProperties = properties;
public pageTitle: string = "Invite";
public user: User;
@ -44,9 +45,9 @@ export class InviteComponent implements OnInit {
user => {
this.user = user;
}));
this.getPageContents();
this.url = this.properties.domain + this._router.url;
if(this.longView) {
this.url = this.properties.domain + this._router.url;
this.getPageContents();
this.seoService.createLinkForCanonicalURL(this.url);
this.updateUrl(this.url);
this.updateTitle(this.pageTitle);
@ -88,6 +89,10 @@ export class InviteComponent implements OnInit {
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
get adminInviteURL() {
return this.properties.adminPortalURL + '/' + this.communityId + '/users/member';
}
close(element) {
UIkit.dropdown(element).hide();

View File

@ -20,7 +20,7 @@
#joinAndInviteBtn #join,
#joinAndInviteBtn #member,
#joinAndInviteBtn #invite {
width: 140px;
width: 160px;
line-height: 60px;
height: 60px;
padding: 0 20px;