[Library | Trunk]: Change contact us base on usege-counts

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59365 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-09-14 15:08:34 +00:00
parent 069dd4214b
commit 4d48dad56e
6 changed files with 55 additions and 12 deletions

View File

@ -48,7 +48,7 @@
[class.uk-form-danger]="contactForm.get('community').invalid && contactForm.get('community').touched">
</div>
<div *ngIf="contactForm.get('organization')" class="uk-width-1-2@s uk-margin-top">
<h5 class="uk-text-bold uk-margin-small-bottom">Organization<span class="uk-text-danger uk-text-bold">*</span></h5>
<h5 class="uk-text-bold uk-margin-small-bottom">Organization <span class="uk-text-danger uk-text-bold">*</span></h5>
<input class="uk-input uk-width-1-1" type="text" placeholder="Your organization" formControlName="organization"
[class.uk-form-danger]="contactForm.get('organization').invalid && contactForm.get('organization').touched">
</div>
@ -76,11 +76,22 @@
[class.uk-form-danger]="contactForm.get('message').invalid && contactForm.get('message').touched">
</textarea>
</div>
<div *ngIf="contactForm.get('message')" class="uk-width-1-2@s uk-margin-top">
<div *ngIf="contactForm.get('description')" class="uk-width-1-1 uk-margin-top">
<h5 class="uk-text-bold uk-margin-small-bottom">
Description <span class="uk-text-danger uk-text-bold">*</span>
</h5>
<textarea rows="4" class="uk-textarea" placeholder="Your description" formControlName="description"
[class.uk-form-danger]="contactForm.get('description').invalid && contactForm.get('description').touched">
</textarea>
</div>
<div *ngIf="contactForm.get('recaptcha')" class="uk-width-1-2@s uk-margin-top">
<re-captcha (resolved)="handleRecaptcha($event)" [(siteKey)]="properties.reCaptchaSiteKey">
</re-captcha>
</div>
<div class="uk-width-1-2@s uk-text-right uk-margin-medium-top">
<button class="uk-button portal-button" (click)="send()">Send</button>
<div class="uk-width-1-2@s uk-text-right uk-margin-medium-top" [class.uk-hidden]="!right">
<button class="uk-button" [class.portal-button]="!buttonClass" [ngClass]="buttonClass" (click)="send()">Send</button>
</div>
<div class="uk-margin-medium-top uk-width-1-1" [class.uk-hidden]="right">
<button class="uk-button" [class.portal-button]="!buttonClass" [ngClass]="buttonClass" (click)="send()">Send</button>
</div>
</div>

View File

@ -18,17 +18,23 @@ export class ContactUsComponent implements OnInit {
@Input() errorMessage;
@Input()
public organizationTypes: string[];
@Input()
public right: boolean = true;
@Input()
public buttonClass: string;
public autoCompleteTypes: Observable<string[]>;
constructor() {
}
ngOnInit() {
this.autoCompleteTypes = this.contactForm.get('organizationType').valueChanges
.pipe(
startWith(''),
map(value => this._filter(value))
);
if(this.contactForm.get('organizationType')) {
this.autoCompleteTypes = this.contactForm.get('organizationType').valueChanges
.pipe(
startWith(''),
map(value => this._filter(value))
);
}
}
private _filter(value: string): string[] {

View File

@ -58,7 +58,7 @@
<div>
<div class="uk-panel" id="module-0">
<ul class="uk-nav uk-nav-default">
<li *ngIf="portal != 'usage-statistics' && !stakeholder" class="uk-nav-header uk-parent">
<li *ngIf="portal != 'usage-counts' && !stakeholder" class="uk-nav-header uk-parent">
Dashboards
<ul class="uk-nav-sub">
<li *ngIf="portal!='explore'"><a
@ -131,7 +131,7 @@
<div *ngIf="specialAnnouncementContent" class="uk-hidden@m" [innerHTML]="specialAnnouncementContent">
</div>
<div *ngIf="!community && !stakeholder && portal != 'connect-admin' && portal != 'usage-statistics'"
<div *ngIf="!community && !stakeholder && portal != 'connect-admin' && portal != 'usage-counts'"
class="tm-toolbar custom-{{portal}}-toolbar uk-visible@m">
<div class="uk-container uk-flex uk-flex-middle uk-container-expand">
<div class="uk-margin-auto-left">

View File

@ -81,6 +81,21 @@ export class Composer {
return email;
}
public static composeEmailForUsageCounts(contactForm: any, admins: any): Email {
let email: Email = new Email();
email.subject = "OpenAIRE UsageCounts";
email.body = "<div style='font-size:" + this.noteBodySize + "'>"
+ "<span><b>Name</b>: " + contactForm.name + "</span><br>"
+ "<span><b>Email</b>: " + contactForm.email + "</span><br>"
+ "<span><b>Affiliation</b>: " + contactForm.affiliation + "</span><br>"
+ "<span><b>Organization</b>: " + contactForm.organization + "</span>"
+ "<p>" + contactForm.description + "</p>"
+ "</div>";
email.recipients = admins;
return email;
}
public static composeEmailForFeedback(info: {name: string, url: string, email: string, issues: any[]}, recipients: string[]): Email {
let email: Email = new Email();
email.subject = 'Feedback report for ' + info.name;

View File

@ -1,3 +1,12 @@
.top-bar {
position: fixed;
top: 0;
left: 0;
height: 100px;
width: 100%;
z-index: 1;
}
section {
position: fixed;
top:10%;
@ -14,7 +23,7 @@ section {
width: 120px;
border-right: 1px solid #4687E6;
background-color: white;
z-index: 1;
z-index: 2;
}
.menu .logo {

View File

@ -32,6 +32,7 @@ import {SlideComponent} from "./slide.component";
</svg>
</a>
</div>
<div [ngClass]="topBar" class="top-bar"></div>
<section (wheel)="onWheel($event)">
<ng-content></ng-content>
</section>`,
@ -44,6 +45,7 @@ export class FullPageSliderComponent implements AfterContentInit {
public initSlide = 1;
@Input()
public logoURL;
@Input() topBar: string = null;
public animate: boolean = false;
public state = 0;