Skip to content

Commit da863c3

Browse files
committed
Enhance project screen
#1427
1 parent 4aad155 commit da863c3

File tree

13 files changed

+618
-424
lines changed

13 files changed

+618
-424
lines changed

src/actions/challenges.js

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,58 @@ import { removeChallengeFromPhaseProduct, saveChallengeAsPhaseProduct } from '..
5959
/**
6060
* Loads active challenges of project by page
6161
*/
62-
export function loadChallengesByPage (page, projectId, status, filterChallengeName = null, selfService = false, userHandle = null) {
62+
export function loadChallengesByPage (
63+
page,
64+
projectId,
65+
status,
66+
filterChallengeName = null,
67+
selfService = false,
68+
userHandle = null,
69+
filterChallengeType = {},
70+
filterDate = {},
71+
filterSortBy = null,
72+
filterSortOrder = null
73+
) {
6374
return (dispatch, getState) => {
6475
dispatch({
6576
type: LOAD_CHALLENGES_PENDING,
6677
challenges: [],
6778
projectId: projectId,
6879
status,
6980
filterChallengeName,
81+
filterChallengeType,
82+
filterDate,
83+
filterSortBy,
84+
filterSortOrder,
7085
perPage: PAGE_SIZE,
7186
page
7287
})
7388

7489
const filters = {
75-
sortBy: 'updated',
90+
sortBy: 'startDate',
7691
sortOrder: 'desc'
7792
}
93+
if (_.isObject(filterChallengeType) && filterChallengeType.value) {
94+
filters['type'] = filterChallengeType.value
95+
}
96+
if (_.isObject(filterDate) && filterDate.startDateStart) {
97+
filters['startDateStart'] = filterDate.startDateStart
98+
}
99+
if (_.isObject(filterDate) && filterDate.startDateEnd) {
100+
filters['startDateEnd'] = filterDate.startDateEnd
101+
}
102+
if (_.isObject(filterDate) && filterDate.endDateStart) {
103+
filters['endDateStart'] = filterDate.endDateStart
104+
}
105+
if (_.isObject(filterDate) && filterDate.endDateEnd) {
106+
filters['endDateEnd'] = filterDate.endDateEnd
107+
}
108+
if (filterSortBy) {
109+
filters['sortBy'] = filterSortBy
110+
}
111+
if (filterSortOrder) {
112+
filters['sortOrder'] = filterSortOrder
113+
}
78114
if (!_.isEmpty(filterChallengeName)) {
79115
filters['name'] = filterChallengeName
80116
}
@@ -113,14 +149,24 @@ export function loadChallengesByPage (page, projectId, status, filterChallengeNa
113149
/**
114150
* Loads active challenges of project
115151
*/
116-
export function loadChallenges (projectId, status, filterChallengeName = null) {
152+
export function loadChallenges (
153+
projectId,
154+
status,
155+
filterChallengeName = null,
156+
filterChallengeType = null,
157+
filterSortBy,
158+
filterSortOrder
159+
) {
117160
return (dispatch, getState) => {
118161
dispatch({
119162
type: LOAD_CHALLENGES_PENDING,
120163
challenges: [],
121164
projectId: projectId ? `${projectId}` : '',
122165
status,
123-
filterChallengeName
166+
filterChallengeName,
167+
filterChallengeType,
168+
filterSortBy,
169+
filterSortOrder
124170
})
125171

126172
const filters = {}

src/assets/images/sort-icon.svg

Lines changed: 4 additions & 0 deletions
Loading

src/components/ChallengesComponent/ChallengeCard/ChallengeCard.module.scss

Lines changed: 39 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,59 @@
11
@import "../../../styles/includes";
22

33
.item {
4-
width: 100%;
54
display: flex;
6-
justify-content: space-between;
7-
font-size: 16px;
5+
font-size: 14px;
6+
gap: 30px;
87
height: 100%;
8+
padding: 0 20px;
9+
910
.editingContainer {
1011
display: none;
1112
}
1213
.iconsContainer {
1314
display: flex;
1415
}
15-
&:hover {@import "../../../styles/includes";
16-
17-
.item {
18-
width: 100%;
19-
display: flex;
20-
justify-content: space-between;
21-
font-size: 16px;
22-
height: 100%;
23-
&:hover {
24-
cursor: pointer;
25-
background-color: $lighter-gray;
26-
}
27-
28-
.block {
29-
color: $text-color;
30-
word-break: break-all;
31-
}
32-
33-
.light-text {
34-
color: $light-text;
35-
}
36-
37-
.linkGroup {
38-
display: flex;
39-
justify-content: space-between;
40-
width: 100%;
41-
padding-left: 20px;
42-
padding-right: 20px;
43-
44-
.link,
45-
.link:hover,
46-
.link:visited {
47-
color: $status-blue;
48-
margin: 0;
49-
text-decoration-line: underline;
50-
}
51-
52-
span.link,
53-
span.link:hover,
54-
span.link:visited {
55-
color: $inactive;
56-
cursor: default;
57-
}
58-
59-
&.onlyOne {
60-
justify-content: center;
61-
}
62-
}
63-
64-
65-
}
66-
67-
.icon {
68-
vertical-align: bottom;
69-
}
70-
71-
.faIcon {
72-
color: $gray;
73-
margin-right: 10px;
74-
margin-left: 20px;
75-
}
76-
77-
.faIconContainer {
78-
flex:1;
79-
width: 100%;
80-
display: flex;
81-
justify-items: flex-end;
82-
align-items: center;
83-
84-
span {
85-
flex-grow: 1;
86-
flex-shrink: 0;
87-
color: $text-color;
88-
}
89-
}
90-
91-
.col1 {
92-
flex: 6;
93-
flex-wrap: nowrap;
94-
display: flex;
95-
text-decoration: none;
96-
97-
.name {
98-
flex:1;
99-
display: flex;
100-
flex-direction: column;
101-
}
10216

103-
align-items: center;
104-
padding-left: 20px;
105-
}
17+
.col1 {
18+
display: flex;
19+
flex: 1;
20+
flex-direction: column;
21+
justify-content: center;
22+
}
10623

107-
.col2 {
108-
flex: 2;
109-
display: flex;
110-
flex-direction: column;
111-
justify-content: center;
112-
align-items: center;
113-
text-decoration: none;
114-
}
24+
.col2 {
25+
display: flex;
26+
flex: 2;
27+
flex-direction: column;
28+
justify-content: center;
29+
}
11530

116-
.col3 {
117-
flex: 2;
118-
display: flex;
119-
flex-direction: column;
120-
justify-content: center;
121-
}
31+
.col3 {
32+
display: flex;
33+
flex: 1;
34+
flex-direction: column;
35+
justify-content: center;
36+
}
12237

123-
.col4 {
124-
flex: 2;
125-
display: flex;
126-
flex-wrap: wrap;
127-
width: 100%;
128-
align-items: center;
129-
padding-right: 20px;
130-
justify-content: center;
131-
}
38+
.col4 {
39+
display: flex;
40+
width: 30px;
41+
flex-direction: column;
42+
justify-content: center;
43+
}
13244

133-
cursor: pointer;
134-
background-color: $lighter-gray;
45+
.col5 {
46+
display: flex;
47+
width: 80px;
48+
flex-direction: column;
49+
justify-content: center;
50+
}
13551

136-
.editingContainer {
137-
display: flex;
138-
}
139-
.iconsContainer {
140-
display: none;
141-
}
52+
.col6 {
53+
display: flex;
54+
width: 40px;
55+
flex-direction: column;
56+
justify-content: center;
14257
}
14358

14459
.block {
@@ -305,54 +220,6 @@
305220
}
306221
}
307222

308-
.col1 {
309-
flex: 6;
310-
flex-wrap: nowrap;
311-
display: flex;
312-
313-
.name {
314-
flex:1;
315-
display: flex;
316-
flex-direction: column;
317-
}
318-
319-
align-items: center;
320-
padding-left: 20px;
321-
}
322-
323-
.col2 {
324-
flex: 2;
325-
display: flex;
326-
flex-direction: column;
327-
justify-content: center;
328-
align-items: center;
329-
330-
.statusText {
331-
color: $text-color;
332-
font-size: 14px;
333-
overflow-wrap: break-word;
334-
word-wrap: break-word;
335-
//hyphens: auto;
336-
max-width: 100px;
337-
}
338-
}
339-
340-
.col3 {
341-
flex: 2;
342-
display: flex;
343-
flex-direction: column;
344-
justify-content: center;
345-
}
346-
347-
.col4 {
348-
flex: 2;
349-
display: flex;
350-
flex-wrap: wrap;
351-
width: 100%;
352-
align-items: center;
353-
padding-right: 20px;
354-
}
355-
356223
.modalContainer {
357224
padding: 0;
358225
position: fixed;

0 commit comments

Comments
 (0)