Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit ad27f84

Browse files
author
dengjun
committed
fix:110,111,112
1 parent 51045d6 commit ad27f84

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

src/containers/MyGigs/JobListing/JobCard/ProgressBar/index.jsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@ import * as constants from "../../../../../constants";
66

77
import "./styles.scss";
88

9-
const ProgressBar = ({
10-
phases,
11-
currentPhase,
12-
currentPhaseStatus,
13-
note,
14-
remark,
15-
}) => {
9+
const ProgressBar = ({ phases, currentPhase, currentPhaseStatus, note }) => {
1610
const isPassed = (phase) =>
1711
utils.myGig.isPassedPhase(phases, currentPhase, phase) ||
1812
(phase === currentPhase && utils.myGig.isLastPhase(phase)) ||
@@ -42,7 +36,7 @@ const ProgressBar = ({
4236
))}
4337
</div>
4438
</div>
45-
<p styleName="progress-note">{remark}</p>
39+
<p styleName="progress-note">{note}</p>
4640
</div>
4741
);
4842
};

src/containers/MyGigs/JobListing/JobCard/index.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const JobCard = ({ job }) => {
124124
<IconNote />
125125
</i>
126126
</NoteTooltip>
127-
<span styleName="note">{job.note}</span>
127+
<span styleName="note">{job.remark}</span>
128128
<span styleName={`${expanded ? "show-less" : "show-more"}`}>
129129
<Button
130130
isText
@@ -153,7 +153,6 @@ const JobCard = ({ job }) => {
153153
currentPhase={job.phase}
154154
currentPhaseStatus={job.phaseStatus}
155155
note={job.phaseNote}
156-
remark={job.remark}
157156
/>
158157
</div>
159158
)}

src/services/myGigs.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
AVAILABLE_REMARK_BY_JOB_STATUS,
66
JOB_STATUS_MAPPER,
77
JOB_STATUS_MESSAGE_MAPPER,
8-
MY_GIG_PHASE,
98
SORT_STATUS_ORDER,
9+
PHASES_FOR_JOB_STATUS,
1010
} from "../constants";
1111
import data from "../assets/data/my-gigs.json";
1212

@@ -16,7 +16,6 @@ import data from "../assets/data/my-gigs.json";
1616
* @returns
1717
*/
1818
const mapMyGigsData = (serverResponse) => {
19-
const jobKeys = values(MY_GIG_PHASE);
2019
const phaseActionKeys = keys(ACTIONS_AVAILABLE_FOR_MY_GIG_PHASE);
2120

2221
return (
@@ -26,9 +25,12 @@ const mapMyGigsData = (serverResponse) => {
2625
const action = phaseActionKeys.find((key) =>
2726
ACTIONS_AVAILABLE_FOR_MY_GIG_PHASE[key].includes(gigPhase)
2827
);
29-
const statusIndex = jobKeys.findIndex((key) => key === gigPhase);
30-
31-
const previousStatus = jobKeys[Math.max(0, statusIndex - 1)];
28+
const phases = PHASES_FOR_JOB_STATUS[myGig.status];
29+
const statusIndex = phases.findIndex((key) => key === gigPhase);
30+
let previousStatus = null;
31+
if (statusIndex >= 1) {
32+
previousStatus = phases[statusIndex - 1];
33+
}
3234
const sortPrio = SORT_STATUS_ORDER.findIndex(
3335
(status) => status === gigPhase
3436
);

0 commit comments

Comments
 (0)