openaire-library/landingPages/feedback/feedback.component.html

85 lines
4.8 KiB
HTML
Raw Normal View History

<div *ngIf="showForm && !sent" class="feedback-page">
<div class="portal-background-color uk-padding-small">
<div class="uk-container">
<span class="clickable" (click)="openBackModal()"><span uk-icon="chevron-left"></span> Back</span>
<h3 class="uk-margin-remove-top">Report issues in...</h3>
<landing-header *ngIf="resultLandingInfo" [properties]="properties" [title]="title"
[subTitle]="resultLandingInfo.subtitle" [underCuration]="resultLandingInfo.underCurationMessage"
[entityType]="entityType" [types]="resultLandingInfo.types"
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
</landing-header>
<landing-header *ngIf="organizationInfo" [properties]="properties" [title]="title"
[subTitle]="(organizationInfo.name && organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
[entityType]="entityType">
</landing-header>
<landing-header *ngIf="projectInfo && title" [properties]="properties" [title]="title"
[subTitle]="projectInfo.acronym ? projectInfo.title : ''"
[entityType]="entityType" [startDate]="projectInfo.startDate" [endDate]="projectInfo.endDate"
[status]="projectInfo.status">
</landing-header>
<landing-header *ngIf="dataProviderInfo" [properties]="properties" [title]="title"
[subTitle]="(dataProviderInfo.officialName
&& dataProviderInfo.title.name !== dataProviderInfo.officialName)?dataProviderInfo.officialName:null"
[entityType]="entityType"
[types]="dataProviderInfo.type ? [dataProviderInfo.type] : null">
</landing-header>
</div>
</div>
<div *ngIf="form" [formGroup]="form" class="uk-container uk-padding-small">
<div *ngIf="error" class="uk-width-1-1 uk-alert uk-alert-danger uk-text-center ng-star-inserted" role="alert">Email sent failed! Please try again.</div>
<div formArrayName="issues" class="uk-margin-top">
<div *ngFor="let control of issues.controls; let i = index" [formGroupName]="i" class="uk-margin-medium-bottom">
<div>
<span>Issue #{{i + 1}}</span>
<span class="uk-float-right clickable" (click)="removeIssue(i)">Remove</span>
</div>
<div class="form">
<mat-select [formControl]="control.get('field')"
[disableOptionCentering]="true" [placeholder]="'Select the field to report the issue'"
class="matSelection uk-margin-bottom" panelClass="matSelectionPanel">
<mat-option *ngFor="let field of fields" [value]="field">{{field}}</mat-option>
</mat-select>
<textarea [formControl]="control.get('report')" class="uk-textarea default-border"
rows="4" placeholder="Write your report here..."></textarea>
</div>
</div>
<div class="uk-margin-small-bottom">
<span class="clickable" (click)="addIssue()">
<button class="uk-icon-button portal-button uk-icon uk-margin-small-right" uk-icon="plus"></button>
<span>Report issue for another field</span>
</span>
</div>
</div>
<div class="uk-flex uk-flex-bottom uk-margin-medium-top" uk-grid>
<div class="uk-width-2-3@m uk-width-1-2@s">
<div class="uk-text-small">Please leave us your E-mail to notify you about the reporting status.</div>
<input class="uk-input default-border uk-width-1-1" placeholder="E-mail" formControlName="email" [class.uk-form-danger]="form.get('email').invalid">
</div>
<div *ngIf="form" class="uk-width-expand">
<re-captcha (resolved)="handleRecaptcha($event)" [(siteKey)]="properties.reCaptchaSiteKey">
</re-captcha>
</div>
<div class="uk-margin-top uk-width-1-1">
<div class="uk-width-1-4@m uk-width-1-3@s uk-float-right">
<button [class.uk-disabled]="form.invalid || sending" [class.portal-button]="form.valid"
(click)="sendReport()" class="uk-button uk-width-1-1">Send report
</button>
</div>
</div>
</div>
</div>
</div>
<div *ngIf="sent" class="uk-position-relative">
<div class="uk-position-top-center">
<div class="feedback-sent uk-margin-small-top">
<h3>Thank you for your feedback</h3>
<p>Your feedback is successfully received and it will soon be reviewed by our graph experts!</p>
<span uk-icon="icon: check; ratio: 4"></span>
</div>
<div class="uk-text-center uk-margin-medium-top">
<button (click)="changeShowForm(false)" class="uk-button portal-button uk-width-1-2">Go back to {{entityType}}'s page</button>
</div>
</div>
</div>
<modal-alert #backModal (alertOutput)="changeShowForm(false)"></modal-alert>