-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🎨🔢 Set limit to number of characters and possible options on question and list block options #321
Conversation
Add maxlength variable to option component. Add custom error message to display on invalid input
Limit the options a user can add to question blocks to 3. Add limit to input size set to 20.
Limit input size to 24 characters Limit possible options to 10
Set font color to red Set font size to x-small Set flex direction on container to flex column
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job. Just some minor changes
type="text" placeholder="Click here to edit" fxFlexFill> | ||
type="text" placeholder="Click here to edit" [maxlength]="charMaxlength" [(ngModel)]="optionValue" fxFlexFill> | ||
<span class="length-error" *ngIf="optionValue.length >= charMaxlength"> | ||
maximum characters reached |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -45,9 +45,9 @@ export class ListBlockComponent<T> implements OnInit, AfterViewInit { | |||
} | |||
|
|||
addNewOption() { | |||
this.listItems.push(this.addListOptions()); | |||
if (this.listItems.length < 10) this.listItems.push(this.addListOptions()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Save this number to a const
@@ -10,7 +10,7 @@ | |||
<div [formGroupName]="i" class="inputList" fxLayout="row" fxLayoutALign="start center" fxFlex="100"> | |||
<button (click)="deleteInput(i)" class="listgone"><i class="far fa-trash-alt"></i></button> | |||
<app-option-input-field [jsPlumb]="jsPlumb" [blockFormGroup]="questionMessageBlock" [formGroupNameInput]="i" | |||
class="input"></app-option-input-field> | |||
class="input" [charMaxlength]=20></app-option-input-field> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -49,7 +49,7 @@ export class QuestionsBlockComponent implements OnInit, AfterViewInit { | |||
} | |||
|
|||
addNewOption() { | |||
this.options.push(this.addQuestionOptions()); | |||
if (this.options.length < 3) this.options.push(this.addQuestionOptions()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made all the requested changes. @ReaganCn
Update the en and fr json files for translation purposes.
Move the input max length value to constant Move the array limit size to constant.
Description
This pull request is made in part to handle number of options and character limit on the question and list blocks.
For the list block:
For the question block
Fixes #302
Type of change
Please delete options that are not relevant.
Screenshot (optional)
How Has This Been Tested?
Checklist: