Skip to content

Commit f803d10

Browse files
authored
feat(Unit Library): Add info about unit types (#2179)
1 parent 5a78eae commit f803d10

File tree

5 files changed

+103
-32
lines changed

5 files changed

+103
-32
lines changed

src/app/modules/library/library-filters/library-filters.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ <h3 class="mat-subtitle-2" i18n>Filters</h3>
3535
>
3636
@if (unitTypeOptions.length > 0) {
3737
<div
38-
class="library-filter"
38+
class="library-filter flex items-center gap-1"
3939
[ngClass]="{ 'md:w-full': isSplitScreen, 'md:w-1/4': !isSplitScreen }"
4040
>
4141
<app-select-menu
4242
id="unitTypeSelectMenu"
43+
class="w-full"
4344
[options]="unitTypeOptions"
4445
i18n-placeholderText
4546
placeholderText="Type"
@@ -49,6 +50,9 @@ <h3 class="mat-subtitle-2" i18n>Filters</h3>
4950
[viewValueProp]="'name'"
5051
[multiple]="true"
5152
/>
53+
<a tabindex="0" (click)="showTypeInfo()" (keyup.enter)="showTypeInfo()">
54+
<mat-icon aria-label="Type filter explanation" i18n-aria-label>info</mat-icon>
55+
</a>
5256
</div>
5357
}
5458
@if (disciplineOptions.length > 0) {

src/app/modules/library/library-filters/library-filters.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ h3 {
2929
.library-filter {
3030
margin: 0;
3131
}
32+
33+
a {
34+
cursor: pointer;
35+
}

src/app/modules/library/library-filters/library-filters.component.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import { SelectMenuComponent } from '../../shared/select-menu/select-menu.compon
1414
import { StandardsSelectMenuComponent } from '../../shared/standards-select-menu/standards-select-menu.component';
1515
import { Feature } from '../Feature';
1616
import { Grade, GradeLevel } from '../GradeLevel';
17+
import { MatDialog } from '@angular/material/dialog';
18+
import { DialogWithCloseComponent } from '../../../../assets/wise5/directives/dialog-with-close/dialog-with-close.component';
1719

1820
@Component({
1921
imports: [
@@ -48,6 +50,7 @@ export class LibraryFiltersComponent {
4850
];
4951

5052
constructor(
53+
private dialog: MatDialog,
5154
protected filterValues: ProjectFilterValues,
5255
private libraryService: LibraryService,
5356
private utilService: UtilService
@@ -177,4 +180,18 @@ export class LibraryFiltersComponent {
177180
this.filterValues.clear();
178181
this.emitFilterValues();
179182
}
183+
184+
protected showTypeInfo(): void {
185+
const message = $localize`"Type" indicates the platform on which a unit runs. "WISE Platform" units are created
186+
using the WISE authoring tool. Students use WISE accounts to complete lessons and teachers can review and grade
187+
work on the WISE platform. "Other" units are created using different platforms. Resources for these units
188+
are linked in the unit details.`;
189+
this.dialog.open(DialogWithCloseComponent, {
190+
data: {
191+
content: message,
192+
title: $localize`Unit Type`
193+
},
194+
panelClass: 'dialog-sm'
195+
});
196+
}
180197
}

src/app/modules/library/library-project-details/library-project-details.component.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@
6868
>
6969
</p>
7070
}
71+
@if (project.metadata.unitType !== 'Platform') {
72+
<p class="notice max-w-none" i18n>
73+
Note: This unit was created outside of the WISE platform. Teaching resources are linked
74+
below.
75+
</p>
76+
}
7177
@if (project.metadata.resources?.length > 0) {
7278
<p>
7379
<strong i18n>Resources:</strong>
@@ -210,7 +216,12 @@
210216
}
211217
@if (canPreview) {
212218
<button mat-flat-button color="primary" (click)="previewProject()">
213-
<mat-icon>preview</mat-icon>&nbsp;<ng-container i18n>Preview</ng-container>
219+
<mat-icon>preview</mat-icon>
220+
@if (project.metadata.unitType === 'Platform') {
221+
<ng-container i18n>Preview</ng-container>
222+
} @else {
223+
<ng-container i18n>Unit Resources</ng-container>
224+
}
214225
</button>
215226
}
216227
</div>

0 commit comments

Comments
 (0)