@@ -2,14 +2,7 @@ import React, {PropTypes} from 'react'
22import _ from 'lodash'
33import { Dropdown , DropdownItem , SwitchButton } from 'appirio-tech-react-components'
44import { PROJECT_STATUS } from '../../config/constants'
5-
6- const projectTypes = [
7- { val : null , label : 'All Types' } ,
8- { val : 'generic' , label : 'Work Project' } ,
9- { val : 'visual_design' , label : 'Visual Design' } ,
10- { val : 'visual_prototype' , label : 'Visual Prototype' } ,
11- { val : 'app_dev' , label : 'App Development' }
12- ]
5+ import { projectTypes } from '../../config/projectWizard'
136
147const projectStatuses = [
158 { val : 'in(draft,in_review,reviewed,active)' , label : 'Open' } ,
@@ -19,12 +12,15 @@ const projectStatuses = [
1912
2013const Filters = ( { criteria, handleMyProjectsFilter, applyFilters } ) => {
2114
22- const type = _ . find ( projectTypes , t => t . val === ( criteria . type || null ) )
15+ const type = _ . find ( projectTypes , t => t . id === ( criteria . type || null ) )
2316 const status = _ . find ( projectStatuses , t => t . val === ( criteria . status || null ) )
2417
2518 const _types = _ . map ( projectTypes , p => {
26- return { val : { type : p . val } , label : p . label }
19+ return { val : { type : p . id } , label : p . name }
2720 } )
21+ // adds null valued object for All Types selection
22+ _types . splice ( 0 , 0 , { val : { type : null } , label : 'All Types' } )
23+
2824 const _statuses = _ . map ( projectStatuses , p => {
2925 return { val : { status : p . val } , label : p . label }
3026 } )
@@ -36,7 +32,7 @@ const Filters = ({ criteria, handleMyProjectsFilter, applyFilters }) => {
3632 < label className = "first" > Project Type</ label >
3733 < div className = "search-select-widget" >
3834 < Dropdown theme = "new-theme" noPointer pointerShadow >
39- < a className = "dropdown-menu-header" > { type . label || 'All Types' } </ a >
35+ < a className = "dropdown-menu-header" > { _ . get ( type , 'name' ) || 'All Types' } </ a >
4036 < ul className = "dropdown-menu-list" >
4137 {
4238 _types . map ( ( item , i ) =>
0 commit comments