Skip to content

Commit b4b9af3

Browse files
committed
Updates for navigation, layout, and new “All Work” tab contents
1 parent da863c3 commit b4b9af3

File tree

18 files changed

+1055
-361
lines changed

18 files changed

+1055
-361
lines changed

src/actions/challenges.js

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,35 @@ export function loadChallengesByPage (
7272
filterSortOrder = null
7373
) {
7474
return (dispatch, getState) => {
75-
dispatch({
76-
type: LOAD_CHALLENGES_PENDING,
77-
challenges: [],
78-
projectId: projectId,
79-
status,
80-
filterChallengeName,
81-
filterChallengeType,
82-
filterDate,
83-
filterSortBy,
84-
filterSortOrder,
85-
perPage: PAGE_SIZE,
86-
page
87-
})
75+
if (_.isObject(projectId)) {
76+
dispatch({
77+
type: LOAD_CHALLENGES_PENDING,
78+
challenges: [],
79+
status,
80+
filterProjectOption: projectId,
81+
filterChallengeName,
82+
filterChallengeType,
83+
filterDate,
84+
filterSortBy,
85+
filterSortOrder,
86+
perPage: PAGE_SIZE,
87+
page
88+
})
89+
} else {
90+
dispatch({
91+
type: LOAD_CHALLENGES_PENDING,
92+
challenges: [],
93+
status,
94+
projectId,
95+
filterChallengeName,
96+
filterChallengeType,
97+
filterDate,
98+
filterSortBy,
99+
filterSortOrder,
100+
perPage: PAGE_SIZE,
101+
page
102+
})
103+
}
88104

89105
const filters = {
90106
sortBy: 'startDate',
@@ -116,8 +132,13 @@ export function loadChallengesByPage (
116132
}
117133
if (_.isInteger(projectId) && projectId > 0) {
118134
filters['projectId'] = projectId
135+
} else if (_.isObject(projectId) && projectId.value > 0) {
136+
filters['projectId'] = projectId.value
119137
}
120-
if (!_.isEmpty(status)) {
138+
139+
if (status === 'all') {
140+
delete filters['status']
141+
} else if (!_.isEmpty(status)) {
121142
filters['status'] = status === '' ? undefined : _.startCase(status.toLowerCase())
122143
} else if (!(_.isInteger(projectId) && projectId > 0)) {
123144
filters['status'] = 'Active'

src/assets/images/ico-arrow-down.svg

Lines changed: 3 additions & 0 deletions
Loading

src/assets/images/nav-active-item.svg

Lines changed: 4 additions & 0 deletions
Loading

src/components/App/index.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,17 @@
22
* Component that sets the general structure of the app
33
*/
44
import React from 'react'
5-
import TwoColsLayout from '../TwoColsLayout'
5+
import TwoRowsLayout from '../TwoRowsLayout'
66

77
const App = (content, topbar, sidebar) => () => {
88
return (
9-
<TwoColsLayout scrollIndependent>
10-
<TwoColsLayout.Sidebar>
11-
{sidebar}
12-
</TwoColsLayout.Sidebar>
13-
<TwoColsLayout.Content>
9+
<TwoRowsLayout scrollIndependent>
10+
<TwoRowsLayout.Content>
1411
{topbar || null}
12+
{sidebar}
1513
{content}
16-
</TwoColsLayout.Content>
17-
</TwoColsLayout>
14+
</TwoRowsLayout.Content>
15+
</TwoRowsLayout>
1816
)
1917
}
2018

src/components/ChallengesComponent/ChallengeCard/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class ChallengeCard extends React.Component {
200200

201201
render () {
202202
const { isLaunch, isConfirm, isSaving, isDeleteLaunch, isCheckChalengePermission, hasEditChallengePermission } = this.state
203-
const { challenge, reloadChallengeList, isBillingAccountExpired, disableHover, getStatusText, challengeTypes } = this.props
203+
const { setActiveProject, challenge, reloadChallengeList, isBillingAccountExpired, disableHover, getStatusText, challengeTypes } = this.props
204204
const deleteMessage = isCheckChalengePermission
205205
? 'Checking permissions...'
206206
: `Do you want to delete "${challenge.name}"?`
@@ -255,7 +255,7 @@ class ChallengeCard extends React.Component {
255255
<ChallengeTag type={challenge.type} challengeTypes={challengeTypes} />
256256
</div>
257257

258-
<Link className={styles.col2} to={`/projects/${challenge.projectId}/challenges/${challenge.id}/view`}>
258+
<Link className={styles.col2} to={`/projects/${challenge.projectId}/challenges/${challenge.id}/view`} onClick={() => setActiveProject(parseInt(challenge.projectId))}>
259259
<div className={styles.name}>
260260
<span className={styles.block}>{challenge.name}</span>
261261
</div>
@@ -294,13 +294,15 @@ class ChallengeCard extends React.Component {
294294

295295
ChallengeCard.defaultPrps = {
296296
reloadChallengeList: () => { },
297-
challengeTypes: []
297+
challengeTypes: [],
298+
setActiveProject: () => {}
298299
}
299300

300301
ChallengeCard.propTypes = {
301302
challenge: PropTypes.object,
302303
reloadChallengeList: PropTypes.func,
303304
partiallyUpdateChallengeDetails: PropTypes.func.isRequired,
305+
setActiveProject: PropTypes.func,
304306
deleteChallenge: PropTypes.func.isRequired,
305307
isBillingAccountExpired: PropTypes.bool,
306308
disableHover: PropTypes.bool,

src/components/ChallengesComponent/ChallengeList/ChallengeList.module.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
justify-content: space-between;
88
}
99

10+
.dashboardRow {
11+
align-items: flex-end;
12+
}
13+
1014
.row {
1115
display: flex;
1216
justify-content: flex-end;
@@ -349,4 +353,4 @@
349353
display: flex;
350354
flex-direction: column;
351355
justify-content: center;
352-
}
356+
}

0 commit comments

Comments
 (0)