Skip to content
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

[#8931] Instructor: Feedback Session: Mark mandatory fields for creating and editing session #12617

Merged
merged 5 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,16 @@ <h5>Or</h5>
<br/>
<div class="row text-center">
<div class="col-md-2 text-md-end font-bold">
<span *ngIf="formMode === SessionEditFormMode.ADD" class="ngb-tooltip-class" ngbTooltip="Enter the name of the feedback session e.g. Feedback Session 1.">Session Name</span>
<span *ngIf="formMode === SessionEditFormMode.ADD" class="ngb-tooltip-class" ngbTooltip="Enter the name of the feedback session e.g. Feedback Session 1.">Session Name*</span>
<span *ngIf="formMode !== SessionEditFormMode.ADD">Session Name</span>
</div>
<div class="col-md-10 text-md-start">
<div *ngIf="formMode === SessionEditFormMode.ADD">
<input id="add-session-name" type="text" class="form-control" [ngModel]="model.feedbackSessionName" (ngModelChange)="triggerModelChange('feedbackSessionName', $event)" placeholder="e.g. Feedback for Project Presentation 1" maxlength="64" />
<input id="add-session-name" type="text" class="form-control" [ngModel]="model.feedbackSessionName" (ngModelChange)="triggerModelChange('feedbackSessionName', $event)" placeholder="e.g. Feedback for Project Presentation 1" maxlength="64" required #sessionName="ngModel" />
<div [hidden]="sessionName.valid || (sessionName.pristine && sessionName.untouched)" class="invalid-field">
<i class="fa fa-exclamation-circle" aria-hidden="true"></i>
The field Session Name should not be empty.
</div>
<div>
{{FEEDBACK_SESSION_NAME_MAX_LENGTH - model.feedbackSessionName.length}} characters left
</div>
Expand Down Expand Up @@ -339,7 +343,7 @@ <h5>Or</h5>
<div class="col-12 text-center">
<span class="loader"></span>
<div *ngIf="formMode === SessionEditFormMode.ADD">
<button id="btn-create-session" type="button" class="btn btn-primary" [disabled]="courseCandidates.length === 0 || model.isSaving" (click)="submitFormHandler()">
<button id="btn-create-session" type="button" class="btn btn-primary" [disabled]="courseCandidates.length === 0 || model.isSaving || !model.feedbackSessionName" (click)="submitFormHandler()">
<tm-ajax-loading *ngIf="model.isSaving"></tm-ajax-loading>Create Feedback Session
</button>
<p class="text-danger margin-top-20px" *ngIf="courseCandidates.length === 0"><b>You need to have an active(unarchived) course to create a session!</b></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@
margin-bottom: .5rem;
}
}

.invalid-field {
padding-top: 5px;
color: #B50000;
}
Original file line number Diff line number Diff line change
Expand Up @@ -588,20 +588,31 @@ exports[`InstructorSessionsPageComponent should snap when new session form is ex
class="ngb-tooltip-class"
ngbtooltip="Enter the name of the feedback session e.g. Feedback Session 1."
>
Session Name
Session Name*
</span>
</div>
<div
class="col-md-10 text-md-start"
>
<div>
<input
class="form-control ng-untouched ng-pristine ng-valid"
class="form-control ng-untouched ng-pristine ng-invalid"
id="add-session-name"
maxlength="64"
placeholder="e.g. Feedback for Project Presentation 1"
required=""
type="text"
/>
<div
class="invalid-field"
hidden=""
>
<i
aria-hidden="true"
class="fa fa-exclamation-circle"
/>
The field Session Name should not be empty.
</div>
<div>
64 characters left
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ <h5 class="modal-title">Creating a new session by copying a previous session</h5
</select>
</div>
<div class="form-group">
<label><b>Name for new session</b></label>
<label><b>Name for new session*</b></label>
<input id="copy-session-name" type="text" class="form-control" [(ngModel)]="newFeedbackSessionName" maxlength="38"
placeholder="e.g. Feedback for Project Presentation 1">
placeholder="e.g. Feedback for Project Presentation 1" required #newSessionName="ngModel">
<div [hidden]="newSessionName.valid || (newSessionName.pristine && newSessionName.untouched)" class="invalid-field">
<i class="fa fa-exclamation-circle" aria-hidden="true"></i>
The field "Name for new session" should not be empty.
</div>
<span>{{ FEEDBACK_SESSION_NAME_MAX_LENGTH - newFeedbackSessionName.length }} characters left</span>
</div>
<div class="form-group">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.invalid-field {
padding-top: 5px;
color: #B50000;
}
Loading