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

[#12664] Instructor's Student Records Page: Accessibility issue for comment buttons #12683

Closed
wants to merge 1 commit into from
Closed
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 @@ -3,7 +3,7 @@
Your comment about the above response
</div>
<div class="col-6" *ngIf="!isFeedbackParticipantComment && response">
Giver: {{ response.giver }} ({{ response.giverTeam }})<br/>
Giver: {{ response.giver }} ({{ response.giverTeam }})<br />
Recipient: {{ response.recipient }} ({{ response.recipientTeam }})
</div>
<div class="col-6">
Expand All @@ -13,44 +13,58 @@
<i class="fas fa-eye"></i> {{ isVisibilityTableExpanded ? "Hide" : "Show" }} Visibility Options</button>
</span>
<span *ngIf="!isVisibilityOptionEnabled" style="margin-left: 10px;">
<button *ngIf="!shouldHideClosingButton" type="button" class="btn-close" aria-label="Close" (click)="triggerCloseCommentBoxEvent()"></button>
<button *ngIf="!shouldHideClosingButton" type="button" class="btn-close" aria-label="Close"
(click)="triggerCloseCommentBoxEvent()"></button>
</span>
</div>
</div>
</div>
<p *ngIf="isVisibilityOptionEnabled">You may change comment's visibility using the visibility options on the right hand side.</p>
<p *ngIf="isVisibilityOptionEnabled">You may change comment's visibility using the visibility options on the right hand
side.</p>

<div *ngIf="isVisibilityTableExpanded" @collapseAnim>
<table class="table margin-bottom-0 background-color-white table-striped table-responsive-md">
<thead>
<tr>
<th scope="col" class="text-start">User/Group</th>
<th scope="col" class="text-center" *ngFor="let commentVisibilityControl of CommentVisibilityControl | enumToArray">{{ commentVisibilityControl | commentVisibilityControlName }}</th>
</tr>
<tr>
<th scope="col" class="text-start">User/Group</th>
<th scope="col" class="text-center"
*ngFor="let commentVisibilityControl of CommentVisibilityControl | enumToArray">{{ commentVisibilityControl |
commentVisibilityControlName }}</th>
</tr>
</thead>
<tbody>
<ng-container *ngFor="let commentVisibilityType of CommentVisibilityType | enumToArray">
<tr *ngIf="visibilityStateMachine.isVisibilityTypeApplicable(commentVisibilityType)">
<td><span container="body" class="ngb-tooltip-class" [ngbTooltip]="commentVisibilityType | commentVisibilityTypeDescription">{{ commentVisibilityType | commentVisibilityTypeName }}</span></td>
<td *ngFor="let commentVisibilityControl of CommentVisibilityControl | enumToArray" class="text-center">
<input type="checkbox" [checked]="visibilityStateMachine.isVisible(commentVisibilityType, commentVisibilityControl)"
(click)="modifyVisibilityControl($event.target.checked, commentVisibilityType, commentVisibilityControl)">
</td>
</tr>
</ng-container>
<ng-container *ngFor="let commentVisibilityType of CommentVisibilityType | enumToArray">
<tr *ngIf="visibilityStateMachine.isVisibilityTypeApplicable(commentVisibilityType)">
<td><span container="body" class="ngb-tooltip-class"
[ngbTooltip]="commentVisibilityType | commentVisibilityTypeDescription">{{ commentVisibilityType |
commentVisibilityTypeName }}</span></td>
<td *ngFor="let commentVisibilityControl of CommentVisibilityControl | enumToArray" class="text-center">
<input type="checkbox"
[checked]="visibilityStateMachine.isVisible(commentVisibilityType, commentVisibilityControl)"
(click)="modifyVisibilityControl($event.target.checked, commentVisibilityType, commentVisibilityControl)">
</td>
</tr>
</ng-container>
</tbody>
</table>
</div>

<div style="margin: 10px 0;">
<tm-rich-text-editor [richText]="model.commentText" (richTextChange)="triggerModelChange('commentText', $event)"
placeholderText="Enter your comment here" [isDisabled]="isDisabled"></tm-rich-text-editor>
placeholderText="Enter your comment here" [isDisabled]="isDisabled"></tm-rich-text-editor>
</div>

<button type="button" class="btn btn-success btn-sm float-end btn-margin-left"
(click)="triggerSaveCommentEvent()" *ngIf="!shouldHideSavingButton" [disabled]="isDisabled"><i class="fas fa-save"></i>
{{ mode === CommentRowMode.EDIT ? 'Save' : 'Add' }}</button>

<button type="button" class="btn btn-light btn-sm float-end"
(click)="triggerCloseCommentBoxEvent()" *ngIf="!shouldHideClosingButton" [disabled]="isDisabled"><i class="fas fa-times"></i>
Cancel</button>
<div class="float-end">
<span *ngIf="!shouldHideClosingButton">
<button type="button" class="btn btn-light btn-sm" (click)="triggerCloseCommentBoxEvent()" tabindex="0"
aria-label="Cancel" [disabled]="isDisabled">
<i class="fas fa-times"></i> Cancel
</button>
</span>
<span *ngIf="!shouldHideSavingButton">
<button type="button" class="btn btn-success btn-sm btn-margin-left" (click)="triggerSaveCommentEvent()"
[attr.aria-label]="mode === CommentRowMode.EDIT ? 'Save' : 'Add'" tabindex="1" [disabled]="isDisabled">
<i class="fas fa-save"></i> {{ mode === CommentRowMode.EDIT ? 'Save' : 'Add' }}
</button>
</span>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: let's keep the newline at the end of file.

Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
<tm-comment-edit-form *ngIf="model.isEditing || mode === CommentRowMode.ADD"
[mode]="mode"
[model]="model.commentEditFormModel"
(modelChange)="triggerModelChange('commentEditFormModel', $event)"
[isVisibilityOptionEnabled]="isVisibilityOptionEnabled"
[isDisabled]="isDisabled"
[shouldHideSavingButton]="shouldHideSavingButton"
[questionShowResponsesTo]="questionShowResponsesTo"
[response]="response"
[isFeedbackParticipantComment]="isFeedbackParticipantComment"
[shouldHideClosingButton]="shouldHideClosingButton"
(closeCommentBoxEvent)="triggerCloseEditing()"
(saveCommentEvent)="triggerSaveCommentEvent()"></tm-comment-edit-form>
<tm-comment-edit-form *ngIf="model.isEditing || mode === CommentRowMode.ADD" [mode]="mode"
[model]="model.commentEditFormModel" (modelChange)="triggerModelChange('commentEditFormModel', $event)"
[isVisibilityOptionEnabled]="isVisibilityOptionEnabled" [isDisabled]="isDisabled"
[shouldHideSavingButton]="shouldHideSavingButton" [questionShowResponsesTo]="questionShowResponsesTo"
[response]="response" [isFeedbackParticipantComment]="isFeedbackParticipantComment"
[shouldHideClosingButton]="shouldHideClosingButton" (closeCommentBoxEvent)="triggerCloseEditing()"
(saveCommentEvent)="triggerSaveCommentEvent()"></tm-comment-edit-form>

<div class="card" *ngIf="!model.isEditing && mode === CommentRowMode.EDIT && model.originalComment">
<div class="card-body">
Expand All @@ -20,26 +14,33 @@
Comment by response giver.
</span>
<ng-container class="text-secondary" *ngIf="!isFeedbackParticipantComment">
<span class="comment-giver-name">{{ model.commentGiverName ? model.commentGiverName : model.originalComment.commentGiver }} commented at </span>
<span class="ngb-tooltip-class" style="margin-right: .25rem;" [ngbTooltip]="model.originalComment.createdAt | formatDateDetail: model.timezone!">
<span class="comment-giver-name">{{ model.commentGiverName ? model.commentGiverName :
model.originalComment.commentGiver }} commented at </span>
<span class="ngb-tooltip-class" style="margin-right: .25rem;"
[ngbTooltip]="model.originalComment.createdAt | formatDateDetail: model.timezone!">
{{ model.originalComment.createdAt | formatDateBrief: model.timezone! }}</span>
<ng-container *ngIf="model.originalComment.lastEditedAt && model.originalComment.lastEditedAt !== model.originalComment.createdAt">
<ng-container
*ngIf="model.originalComment.lastEditedAt && model.originalComment.lastEditedAt !== model.originalComment.createdAt">
<i class="fas fa-circle dot-xs align-middle" style="margin-right: .25rem;"></i>
<span id="last-editor-name" style="margin-right: .25rem;" class="ngb-tooltip-class"
[ngbTooltip]="model.originalComment.lastEditedAt | formatDateDetail: model.timezone!">edited by {{ model.lastEditorName ? model.lastEditorName : model.originalComment.lastEditorEmail }}</span>
[ngbTooltip]="model.originalComment.lastEditedAt | formatDateDetail: model.timezone!">edited by {{
model.lastEditorName ? model.lastEditorName : model.originalComment.lastEditorEmail }}</span>
</ng-container>
</ng-container>

<i class="fa fa-eye" aria-hidden="true" ngbTooltip="This response comment is visible to {{ visibilityStateMachine.getVisibilityTypesUnderVisibilityControl(CommentVisibilityControl.SHOW_COMMENT) | commentVisibilityTypesJointName }}"></i>
<i class="fa fa-eye" aria-hidden="true"
ngbTooltip="This response comment is visible to {{ visibilityStateMachine.getVisibilityTypesUnderVisibilityControl(CommentVisibilityControl.SHOW_COMMENT) | commentVisibilityTypesJointName }}"></i>

<div class="float-end">
<button type="button" class="btn-edit-comment btn btn-outline-primary btn-sm" *ngIf="!shouldHideEditButton" ngbTooltip='Edit this comment'
(click)="triggerModelChange('isEditing', true)" [disabled]="isDisabled"><i class="fas fa-pencil-alt"></i></button>
<button type="button" class="btn-delete-comment btn btn-outline-primary btn-sm btn-margin-left" *ngIf="!shouldHideDeleteButton" ngbTooltip='Delete this comment'
(click)="triggerDeleteCommentEvent()" [disabled]="isDisabled"><i class="fas fa-trash"></i></button>
<button type="button" class="btn-edit-comment btn btn-outline-primary btn-sm" aria-label="Edit Comment"
*ngIf="!shouldHideEditButton" ngbTooltip='Edit this comment' (click)="triggerModelChange('isEditing', true)"
[disabled]="isDisabled"><i class="fas fa-pencil-alt"></i></button>
<button type="button" class="btn-delete-comment btn btn-outline-primary btn-sm btn-margin-left"
aria-label="Delete Comment" *ngIf="!shouldHideDeleteButton" ngbTooltip='Delete this comment'
(click)="triggerDeleteCommentEvent()" [disabled]="isDisabled"><i class="fas fa-trash"></i></button>
</div>
</div>
<div class="comment-text col-12" [innerHTML]="model.originalComment.commentText | safeHtml"></div>
</div>
</div>
</div>
</div>
Loading