Set autosize and min two rows in textarea controls (#1604)
Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
7bbab6423e
commit
475059a974
+1
-1
@@ -15,7 +15,7 @@
|
||||
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Note</mat-label>
|
||||
<textarea matInput formControlName="note"></textarea>
|
||||
<textarea matInput formControlName="note" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
|
||||
</mat-form-field>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Note</mat-label>
|
||||
<textarea matInput formControlName="note"></textarea>
|
||||
<textarea matInput formControlName="note" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
|
||||
</mat-form-field>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
@@ -50,7 +50,7 @@ export class TakeSurveyComponent {
|
||||
private authenticationService: AuthenticationService) {
|
||||
this.route.data.subscribe((data: { clientActionData: any }) => {
|
||||
this.allSurveyData = data.clientActionData;
|
||||
this.clientId = this.route.parent.parent.snapshot.paramMap.get('clientId');
|
||||
this.clientId = this.route.parent.snapshot.params['clientId'];
|
||||
});
|
||||
/** Retrieves User ID */
|
||||
const savedCredentials = this.authenticationService.getCredentials();
|
||||
@@ -102,22 +102,15 @@ export class TakeSurveyComponent {
|
||||
*/
|
||||
submit() {
|
||||
this.formData = {
|
||||
userId: 0,
|
||||
clientId: 0,
|
||||
surveyId: 0,
|
||||
userId: this.userId,
|
||||
clientId: this.clientId,
|
||||
surveyId: this.surveyData.id,
|
||||
surveyName: '',
|
||||
username: '',
|
||||
id: 0,
|
||||
scorecardValues: []
|
||||
};
|
||||
|
||||
this.formData.userId = this.userId;
|
||||
this.formData.clientId = this.clientId;
|
||||
this.formData.surveyId = this.surveyData.id;
|
||||
this.formData.surveyName = '';
|
||||
this.formData.username = '';
|
||||
this.formData.id = 0;
|
||||
|
||||
this.surveyData.questionDatas.forEach((elem: any) => {
|
||||
if (elem.answer) {
|
||||
const tmp = {
|
||||
@@ -129,8 +122,9 @@ export class TakeSurveyComponent {
|
||||
this.formData.scorecardValues.push(tmp);
|
||||
}
|
||||
});
|
||||
|
||||
this.clientsService.createNewSurvey(this.surveyData.id, this.formData).subscribe(() => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
this.router.navigate(['../../general'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Note</mat-label>
|
||||
<textarea matInput formControlName="note"></textarea>
|
||||
<textarea matInput formControlName="note" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Note</mat-label>
|
||||
<textarea matInput formControlName="note"></textarea>
|
||||
<textarea matInput formControlName="note" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
|
||||
</mat-form-field>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
@@ -20,23 +20,23 @@
|
||||
<table mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
<ng-container matColumnDef="surveyName">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header='surveyName'> Survey </th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header="surveyName"> Survey </th>
|
||||
<td mat-cell *matCellDef="let survey"> {{ survey.surveyName }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="createdBy">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header='createdBy'> Created By </th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header="createdBy"> Created By </th>
|
||||
<td mat-cell *matCellDef="let survey"> {{ survey.createdBy }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="date">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Date </th>
|
||||
<td mat-cell *matCellDef="let survey"> {{ survey.date | dateFormat }} </td>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> DateTime </th>
|
||||
<td mat-cell *matCellDef="let survey"> {{ survey.date | datetimeFormat }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="score">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Score </th>
|
||||
<td mat-cell *matCellDef="let survey"> {{ survey.score }} </td>
|
||||
<td mat-cell *matCellDef="let survey"> {{ survey.score | number }} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
|
||||
Reference in New Issue
Block a user