File tree Expand file tree Collapse file tree 3 files changed +27
-10
lines changed
projects/list/components/Projects Expand file tree Collapse file tree 3 files changed +27
-10
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ require('./TopBar.scss')
33import React , { PropTypes , Component } from 'react'
44import { Link } from 'react-router'
55import cn from 'classnames'
6+ import _ from 'lodash'
67import { UserDropdown , Icons } from 'appirio-tech-react-components'
78
89const { ConnectLogoBeta } = Icons
@@ -94,6 +95,7 @@ class TopBar extends Component {
9495 if ( isProjectDetails ) {
9596 return < ProjectToolBar isPowerUser = { isPowerUser } logo = { logo } avatar = { avatar } project = { project } />
9697 }
98+ const noOfFilters = _ . keys ( criteria ) . length - 1 // -1 for default sort criteria
9799
98100 return (
99101 // <Sticky>
@@ -116,7 +118,7 @@ class TopBar extends Component {
116118 href = "javascript:"
117119 className = { cn ( 'tc-btn tc-btn-sm' , { active : isFilterVisible } ) }
118120 onClick = { this . props . onToggleFilter }
119- > Filters</ a >
121+ > Filters { noOfFilters > 0 && < span className = "filter-indicator" > { noOfFilters } </ span > } </ a >
120122 </ div > }
121123 </ div >
122124 { avatar }
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ $tc-body-large : 20px;
7676
7777 .search-bar {
7878 margin : 0 auto ;
79- width : 585 px ;
79+ width : 605 px ;
8080 padding-top : 15px ;
8181 display : flex ;
8282 justify-content :space-between ;
@@ -88,9 +88,11 @@ $tc-body-large : 20px;
8888 height : 30px ;
8989 }
9090 .search-filter {
91- width : 77 px ;
91+ width : 97 px ;
9292 .tc-btn {
93- display : block ;
93+ display : flex ;
94+ align-items : center ;
95+ justfiy-content : center ;
9496 padding : 5px 0 5px 34px ;
9597 text-align : left ;
9698 color : $tc-gray-40 ;
@@ -118,6 +120,18 @@ $tc-body-large : 20px;
118120 }
119121 }
120122 }
123+
124+ .filter-indicator {
125+ width : 15px ;
126+ height : 15px ;
127+ margin-left : $base-unit ;
128+ background-color : $tc-dark-blue-90 ;
129+ border-radius : 26px ;
130+ color : $tc-white ;
131+ display : flex ;
132+ justify-content : center ;
133+ align-items : center ;
134+ }
121135 }
122136 }
123137 .welcome-info {
Original file line number Diff line number Diff line change @@ -22,13 +22,14 @@ class Projects extends Component {
2222 // check for criteria specified in URL.
2323 const queryParams = _ . get ( this . props , 'location.query' , null )
2424 if ( ! _ . isEmpty ( queryParams ) ) {
25- if ( queryParams . sort ) criteria . sort = queryParams . sort
26- if ( queryParams . name ) criteria . name = decodeURIComponent ( queryParams . name )
27- if ( queryParams . status ) criteria . status = queryParams . status
28- if ( queryParams . type ) criteria . type = queryParams . type
29- if ( queryParams . memberOnly ) criteria . memberOnly = queryParams . memberOnly
25+ const initialCriteria = { }
26+ if ( queryParams . sort ) initialCriteria . sort = queryParams . sort
27+ if ( queryParams . name ) initialCriteria . name = decodeURIComponent ( queryParams . name )
28+ if ( queryParams . status ) initialCriteria . status = queryParams . status
29+ if ( queryParams . type ) initialCriteria . type = queryParams . type
30+ if ( queryParams . memberOnly ) initialCriteria . memberOnly = queryParams . memberOnly
3031 if ( queryParams . page ) pageNum = parseInt ( queryParams . page )
31- loadProjects ( criteria , pageNum )
32+ loadProjects ( initialCriteria , pageNum )
3233 } else {
3334 this . routeWithParams ( criteria , pageNum )
3435 }
You can’t perform that action at this time.
0 commit comments