Skip to content
5 changes: 2 additions & 3 deletions src/app/classroom-monitor/step-info/step-info.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<div class="flex justify-start items-center">
<node-icon [nodeId]="nodeId" size="18" class="hidden sm:block" />
<span class="hidden sm:block">&nbsp;&nbsp;</span>
<div class="flex justify-start items-center gap-2">
<node-icon [nodeId]="nodeId" size="24" class="hidden sm:flex" />
<span>{{ stepTitle }}</span>
@if (hasAlert) {
<status-icon [class]="alertIconClass" [name]="alertIconName" [tooltip]="alertIconLabel" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="flex flex-row justify-start items-center gap-1">
<node-icon [nodeId]="nodeId" size="18" />&nbsp;
<node-icon class="flex" [nodeId]="nodeId" size="24" />&nbsp;
@if (showPosition) {
<span class="step-number">{{ nodePosition }}: </span>
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="node-authoring-header flex flex-row flex-wrap justify-start items-start gap-4">
<teacher-node-icon [nodeId]="nodeId" [canEdit]="true" size="18" />
<teacher-node-icon [nodeId]="nodeId" [canEdit]="true" size="36" />
<edit-node-title [node]="node" />
<edit-node-advanced-button [nodeId]="nodeId" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
[ngClass]="{ 'nav-item--card--group': isGroup, 'expanded mat-elevation-z3': expanded }"
>
<mat-card-header
class="nav-item--card__content"
class="nav-item--card__content items-center"
tabindex="0"
(click)="itemClicked($event)"
(keyup.enter)="itemClicked($event)"
role="button"
>
<node-icon mat-card-avatar class="group-icon" customClass="mat-24" [nodeId]="nodeId" />
<node-icon mat-card-avatar class="group-icon flex" size="30" [nodeId]="nodeId" />
<mat-card-title class="title" style="color: {{ icon.color }}">
<span>{{ nodeTitle }}</span>
</mat-card-title>
Expand Down Expand Up @@ -68,7 +68,7 @@
[ngClass]="{ 'nav-item--list--group': isGroup, 'text-secondary': !nodeHasWork }"
>
<div class="flex justify-start items-center gap-3">
<node-icon [nodeId]="nodeId" customClass="mat-24" />
<node-icon [nodeId]="nodeId" size="24" class="flex" />
<span [ngClass]="{ warn: newAlert }">{{ nodeTitle }}</span>
<span class="flex-grow sm:hidden"></span>
@if (newAlert) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
.mat-mdc-card-header {
cursor: pointer;

.title {
padding-left: 8px;
padding-right: 8px;
}

&:focus, &:hover {
outline: none;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<h2 mat-dialog-title class="mat-dialog-title--icons !flex items-center gap-2">
@if (newNodeIcon.type === 'font') {
<div
style="background-color: {{ newNodeIcon.color }}"
class="avatar preview-icon"
<mat-icon
class="mat-30"
style="color: {{ newNodeIcon.color }}"
aria-label="Selected icon"
i18n-aria-label
[ngClass]="{ 'avatar--square': node.isGroup() }"
>{{ newNodeIcon.fontName }}</mat-icon
>
<mat-icon class="mat-24 material-icons">{{ newNodeIcon.fontName }}</mat-icon>
</div>
} @else if (newNodeIcon.type === 'img') {
<img
class="mat-24 avatar"
[ngClass]="{ 'avatar--square': node.isGroup() }"
class="mat-30 avatar"
[src]="newNodeIcon.imgSrc"
alt="newNodeIcon.imgAlt"
aria-label="Selected icon"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.preview-icon {
color: #ffffff;
}

.custom-icon {
vertical-align: middle;
}
Expand Down
11 changes: 5 additions & 6 deletions src/assets/wise5/common/stepTools/step-tools.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
>
<mat-icon>{{ icons.prev }}</mat-icon>
</button>
@if (nodeId) {
<node-icon [nodeId]="nodeId" size="18" />
}
&nbsp;
<mat-form-field appearance="fill">
<mat-select
id="stepSelectMenu"
Expand All @@ -26,15 +22,18 @@
>
<mat-select-trigger>
@if (nodeId) {
{{ getNodePositionAndTitle(nodeId) }}
<span class="flex gap-2 items-center">
<node-icon class="hidden sm:flex" [nodeId]="nodeId" size="18" />
<span>{{ getNodePositionAndTitle(nodeId) }}</span>
</span>
} @else {
<ng-container i18n> Select a Step </ng-container>
}
</mat-select-trigger>
@for (nodeId of nodeIds; track nodeId) {
<mat-option [value]="nodeId" class="node-select-option">
<div class="flex justify-start items-center gap-2">
<node-icon [nodeId]="nodeId" size="18" />
<node-icon class="hidden sm:flex" [nodeId]="nodeId" size="24" />
<span [ngClass]="{ strong: isGroupNode(nodeId) }">{{
getNodePositionAndTitle(nodeId)
}}</span>
Expand Down
7 changes: 7 additions & 0 deletions src/assets/wise5/common/stepTools/step-tools.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@
display: none;
}
}

.node-select-option.mat-mdc-option {
.mat-icon {
margin-right: 0;
margin-left: 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
@if (hasPrevNode && showPrevNodeNav) {
<button mat-raised-button color="primary" (click)="goToPrevNode()">
<mat-icon>{{ prevIcon }}</mat-icon>
<span i18n>Previous step</span>
<span i18n>Previous Step</span>
</button>
}
@if (hasNextNode) {
<button mat-raised-button color="primary" (click)="goToNextNode()">
<mat-icon>{{ nextIcon }}</mat-icon>
<span i18n>Next step</span>
<span i18n>Next Step</span>
</button>
}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ function expectHasPrevNextNodeValues(
tick(); // ensures component.hasNextNode to be set
fixture.detectChanges();
const buttons = Array.from(fixture.debugElement.nativeElement.querySelectorAll('button'));
const prevButton = buttons.find((el: any) => el.innerHTML.includes('Previous step'));
const nextButton = buttons.find((el: any) => el.innerHTML.includes('Next step'));
const prevButton = buttons.find((el: any) => el.innerHTML.includes('Previous Step'));
const nextButton = buttons.find((el: any) => el.innerHTML.includes('Next Step'));
if (expectedHasPrevNode) {
expect(prevButton).toBeDefined();
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@if (nodeStatus.isCompleted || nodeStatus.isWarn) {
<mat-icon
class="secondary-text"
class="s{{ sizeClass }} {{ customClass }}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove typo?

Suggested change
class="s{{ sizeClass }} {{ customClass }}"
class="{{ sizeClass }} {{ customClass }}"

[ngClass]="{ success: nodeStatus.isSuccess, warn: nodeStatus.isWarn }"
>
{{ nodeStatus.isWarn ? 'error' : 'check_circle' }}
{{ nodeStatus.isWarn ? 'error' : 'check' }}
</mat-icon>
}
@if (nodeStatus.isWarn) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ import { MatIconModule } from '@angular/material/icon';
})
export class NodeStatusIconComponent {
@Input() nodeId: string;
@Input() customClass: string;
protected nodeStatus: any;
@Input() size: number;
protected sizeClass: string;

constructor(private nodeStatusService: NodeStatusService) {}

ngOnChanges(): void {
this.nodeStatus = this.nodeStatusService.getNodeStatusByNodeId(this.nodeId);
if (this.size) {
this.sizeClass = `mat-${this.size}`;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<button
class="!px-2 step-select w-48 sm:w-96"
mat-button
[matMenuTriggerFor]="stepSelect"
(menuOpened)="onMenuOpened()"
>
<div class="flex gap-2 items-center">
<mat-icon>menu</mat-icon>
<node-icon [nodeId]="nodeId" size="18" />
<span class="normal-case truncate">{{ currentNodeTitle }}</span>
<node-status-icon [nodeId]="nodeId" size="18" />
</div>
</button>
<mat-menu #stepSelect="matMenu" [overlapTrigger]="true" class="step-select-menu">
<div class="mat-app-background" (keydown.tab)="$event.stopPropagation()">
<div class="sticky top-0 z-10" (click)="$event.stopPropagation()">
<div class="px-3 py-2 app-bg-bg" i18n>Unit Progress</div>
<div class="px-3 py-2 flex flex-row items-center gap-2 mat-caption mat-app-background">
<span i18n>Completion:</span>
<ng-container
*ngTemplateOutlet="
progressIndicator;
context: {
progress: nodeStatuses[rootNodeId]?.progress,
isVisitable: true
}
"
/>
<span>{{ nodeStatuses[rootNodeId]?.progress?.completionPct }}%</span>
</div>
<mat-divider />
</div>
<div class="px-2">
<mat-nav-list>
<mat-accordion multi>
<div class="flex flex-col gap-2">
@for (group of groups; track group.id) {
@if (nodeStatuses[group.id]?.isVisible) {
<mat-expansion-panel
hideToggle
[expanded]="expandedGroups[group.id]"
(opened)="expandedGroups[group.id] = true"
(closed)="expandedGroups[group.id] = false"
>
<mat-expansion-panel-header
mat-list-item
(click)="$event.stopPropagation()"
(keydown.enter)="$event.stopPropagation()"
(keydown.space)="$event.stopPropagation()"
>
<mat-panel-title>
<div class="flex flex-row flex-grow items-center gap-2">
<node-icon
class="flex!"
[nodeId]="group.id"
[icon]="nodeStatuses[group.id]?.icon"
size="24"
/>
<span class="mat-caption list-item-title">{{ group.title }}</span>
<span class="flex-1"></span>
<ng-container
*ngTemplateOutlet="
progressIndicator;
context: {
progress: nodeStatuses[group.id]?.progress,
isVisitable: nodeStatuses[group.id]?.isVisitable,
tooltip: getProgressTooltip(group.id)
}
"
/>
</div>
</mat-panel-title>
</mat-expansion-panel-header>
@for (child of group.children; track child.id) {
@if (nodeStatuses[child.id]?.isVisible) {
<button
mat-list-item
[activated]="child.id === nodeId"
(click)="chooseNode(child.id)"
>
<div class="flex flex-row items-center gap-2 w-full">
<node-icon
[nodeId]="child.id"
[icon]="nodeStatuses[child.id]?.icon"
size="24"
class="flex!"
/>
<span class="mat-caption list-item-title">{{ child.title }}</span>
<span class="flex-1"></span>
<node-status-icon
[nodeId]="child.id"
size="18"
class="shrink-0"
[customClass]="child.id === nodeId ? 'primary' : ''"
/>
@if (
!nodeStatuses[child.id]?.isVisitable ||
!nodeStatuses[group.id]?.isVisitable
) {
<mat-icon
class="shrink-0 mat-18"
aria-label="Item is locked"
i18n-aria-label
>
lock
</mat-icon>
}
</div>
</button>
}
}
</mat-expansion-panel>
}
}
</div>
</mat-accordion>
</mat-nav-list>
</div>
</div>
</mat-menu>

<ng-template
#progressIndicator
let-progress="progress"
let-isVisitable="isVisitable"
let-tooltip="tooltip"
>
<span class="relative shrink-0">
@if (isVisitable === false) {
<mat-icon class="icon-inside-progress" aria-label="Item is locked" i18n-aria-label>
lock
</mat-icon>
} @else if (progress?.completionPct === 100) {
<mat-icon class="icon-inside-progress">check</mat-icon>
}
<mat-progress-spinner
[value]="progress?.completionPct"
[diameter]="24"
[matTooltip]="tooltip"
[matTooltipDisabled]="!tooltip"
i18n-matTooltip
matTooltipPosition="above"
/>
</span>
</ng-template>
Loading