Skip to content

Commit 436b950

Browse files
author
Vikas Agarwal
committed
Github issue #320 [Search] - when filters are hide don't take them into consideration
-- Added visual indicator to show the number of filters currently applied on the project listing
1 parent dd3d230 commit 436b950

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

src/components/TopBar/TopBar.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ require('./TopBar.scss')
33
import React, {PropTypes, Component} from 'react'
44
import { Link } from 'react-router'
55
import cn from 'classnames'
6+
import _ from 'lodash'
67
import { UserDropdown, Icons } from 'appirio-tech-react-components'
78

89
const { 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
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}

src/components/TopBar/TopBar.scss

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ $tc-body-large : 20px;
7676

7777
.search-bar{
7878
margin: 0 auto;
79-
width: 585px;
79+
width: 605px;
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: 77px;
91+
width: 97px;
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{

src/projects/reducers/projectSearch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function(state = initialState, action) {
2828
})
2929
case GET_PROJECTS_SEARCH_CRITERIA:
3030
return Object.assign({}, state, {
31-
criteria: action.criteria,
31+
criteria: Object.assign({}, action.criteria ),
3232
pageNum: action.pageNum
3333
})
3434
case CLEAR_PROJECT_SEARCH:

0 commit comments

Comments
 (0)