@@ -14,6 +14,8 @@ import { SelectMenuComponent } from '../../shared/select-menu/select-menu.compon
1414import { StandardsSelectMenuComponent } from '../../shared/standards-select-menu/standards-select-menu.component' ;
1515import { Feature } from '../Feature' ;
1616import { 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,22 +50,24 @@ export class LibraryFiltersComponent {
4850 ] ;
4951
5052 constructor (
53+ private dialog : MatDialog ,
54+ protected filterValues : ProjectFilterValues ,
5155 private libraryService : LibraryService ,
5256 private utilService : UtilService
5357 ) {
54- libraryService . officialLibraryProjectsSource$ . subscribe ( ( projects : LibraryProject [ ] ) => {
58+ this . libraryService . officialLibraryProjectsSource$ . subscribe ( ( projects : LibraryProject [ ] ) => {
5559 this . libraryProjects = projects ;
5660 this . populateFilterOptions ( ) ;
5761 } ) ;
58- libraryService . communityLibraryProjectsSource$ . subscribe ( ( projects : LibraryProject [ ] ) => {
62+ this . libraryService . communityLibraryProjectsSource$ . subscribe ( ( projects : LibraryProject [ ] ) => {
5963 this . communityProjects = projects ;
6064 this . populateFilterOptions ( ) ;
6165 } ) ;
62- libraryService . sharedLibraryProjectsSource$ . subscribe ( ( projects : LibraryProject [ ] ) => {
66+ this . libraryService . sharedLibraryProjectsSource$ . subscribe ( ( projects : LibraryProject [ ] ) => {
6367 this . sharedProjects = projects ;
6468 this . populateFilterOptions ( ) ;
6569 } ) ;
66- libraryService . personalLibraryProjectsSource$ . subscribe ( ( projects : LibraryProject [ ] ) => {
70+ this . libraryService . personalLibraryProjectsSource$ . subscribe ( ( projects : LibraryProject [ ] ) => {
6771 this . personalProjects = projects ;
6872 this . populateFilterOptions ( ) ;
6973 } ) ;
@@ -143,41 +147,51 @@ export class LibraryFiltersComponent {
143147 }
144148
145149 protected searchUpdated ( value : string ) : void {
146- this . getFilterValues ( ) . searchValue = value . toLocaleLowerCase ( ) ;
150+ this . filterValues . searchValue = value . toLocaleLowerCase ( ) ;
147151 this . emitFilterValues ( ) ;
148152 }
149153
150154 protected filterUpdated ( value : any [ ] , context : string = '' ) : void {
151155 switch ( context ) {
152156 case 'discipline' :
153- this . getFilterValues ( ) . disciplineValue = value ;
157+ this . filterValues . disciplineValue = value ;
154158 break ;
155159 case 'gradeLevel' :
156- this . getFilterValues ( ) . gradeLevelValue = value ;
160+ this . filterValues . gradeLevelValue = value ;
157161 break ;
158162 case 'standard' :
159- this . getFilterValues ( ) . standardValue = value ;
163+ this . filterValues . standardValue = value ;
160164 break ;
161165 case 'feature' :
162- this . getFilterValues ( ) . featureValue = value ;
166+ this . filterValues . featureValue = value ;
163167 break ;
164168 case 'unitType' :
165- this . getFilterValues ( ) . unitTypeValue = value ;
169+ this . filterValues . unitTypeValue = value ;
166170 break ;
167171 }
168172 this . emitFilterValues ( ) ;
169173 }
170174
171- protected getFilterValues ( ) : ProjectFilterValues {
172- return this . libraryService . filterValues ;
173- }
174-
175175 private emitFilterValues ( ) : void {
176- this . libraryService . filterValuesUpdated ( ) ;
176+ this . filterValues . emitUpdated ( ) ;
177177 }
178178
179179 protected clearFilterValues ( ) : void {
180- this . getFilterValues ( ) . clear ( ) ;
180+ this . filterValues . clear ( ) ;
181181 this . emitFilterValues ( ) ;
182182 }
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+ }
183197}
0 commit comments