Skip to content

Commit

Permalink
Merge pull request #1692 from bcgov/feature/ALCS-1903
Browse files Browse the repository at this point in the history
Change referral to use text area for two fields
  • Loading branch information
dhaselhan authored May 15, 2024
2 parents 3b6767d + bae4bd5 commit 6467c22
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h5>Referral #{{ planingReferrals.length - i }}</h5>
<div>
<div class="subheading2">Referral Description</div>
<div>
<app-inline-text
<app-inline-textarea
[value]="referral.referralDescription"
[required]="true"
(save)="updateReferralField(referral.uuid, 'referralDescription', $event)"
Expand All @@ -61,7 +61,7 @@ <h5>Referral #{{ planingReferrals.length - i }}</h5>
<div>
<div class="subheading2">Response Description</div>
<div>
<app-inline-text
<app-inline-textarea
[value]="referral.responseDescription"
[required]="true"
(save)="updateReferralField(referral.uuid, 'responseDescription', $event)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<div class="inline-number-wrapper">
<span class="left" *ngIf="!isEditing">
<div class="inline-textarea-wrapper">
<span *ngIf="!isEditing">
<a (click)="startEdit()" class="add" *ngIf="!value"> Add text </a>
<span *ngIf="value">
{{ value }}
<button *ngIf="value" class="edit-button" mat-icon-button (click)="startEdit()">
<mat-icon class="edit-icon">edit</mat-icon>
</button>
</span>
<button *ngIf="value" class="edit-button" mat-icon-button (click)="startEdit()">
<mat-icon class="edit-icon">edit</mat-icon>
</button>
</span>
<div
class="editing"
Expand All @@ -25,6 +25,7 @@
[(ngModel)]="pendingValue"
(keydown.enter)="confirmEdit()"
(keydown.escape)="cancelEdit()"
[required]="required"
></textarea>

<div class="button-container">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
@use '../../../../styles/colors';

.inline-number-wrapper {
.inline-textarea-wrapper {
padding-top: 4px;
white-space: pre-line;
}

.editing {
Expand All @@ -16,7 +17,7 @@
.edit-button {
height: 24px;
width: 24px;
display: flex;
display: inline-flex;
align-items: center;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AfterContentChecked, Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core';
import { Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core';

@Component({
selector: 'app-inline-textarea[value]',
Expand All @@ -8,6 +8,7 @@ import { AfterContentChecked, Component, ElementRef, EventEmitter, Input, Output
export class InlineTextareaComponent {
@Input() value?: string | undefined;
@Input() placeholder: string = 'Enter a value';
@Input() required = false;
@Output() save = new EventEmitter<string | null>();

@ViewChild('editInput') textInput!: ElementRef;
Expand Down

0 comments on commit 6467c22

Please sign in to comment.