Skip to content

Commit 045f7e1

Browse files
authored
Merge pull request #4489 from appirio-tech/hotfix/milestone-message-rewording
[HOTFIX][PROD] Milestone Approval Additional Fixes
2 parents 2da8b22 + e14a256 commit 045f7e1

File tree

4 files changed

+84
-17
lines changed

4 files changed

+84
-17
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# ignore dist directory to speed up linting after we build project
22
dist/*
3+
# ignore test automation folder as it uses TypeScript with its own Eslint config
4+
connect-automation/*

src/projects/detail/components/SimplePlan/components/MilestoneApprovalButton/MilestoneApprovalButton.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class MilestoneApprovalButton extends React.Component {
3535
onClick={() => {
3636
if(type === 'reject') {
3737
this.setState({open: true})
38-
} else {
38+
} else if(onClick) {
3939
onClick()
4040
}
4141
}}

src/projects/detail/components/SimplePlan/components/MilestonesApprovalNotification/MilestonesApprovalNotification.jsx

+40-16
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import PT from 'prop-types'
66
import {
77
PHASE_APPROVAL_APPROVE,
88
PHASE_APPROVAL_REJECT,
9-
PHASE_STATUS_IN_REVIEW,
109
PHASE_STATUS_REVIEWED,
1110
} from '../../../../../../config/constants'
1211
import IconCollapse from '../../../../../../assets/icons/icon-ui-collapse.svg'
@@ -50,16 +49,13 @@ class MilestonesApprovalNotification extends React.Component {
5049
const { milestones } = this.props
5150

5251
console.log('milestones', milestones)
53-
54-
const inReviews = milestones.find(
55-
(ms) => ms.status === PHASE_STATUS_IN_REVIEW
56-
)
52+
5753
const revieweds = milestones.filter(
5854
(ms) => ms.status === PHASE_STATUS_REVIEWED
5955
).map( ms => {ms.currentApproval = this.findLatest(ms.approvals); return ms})
6056

6157
const showAllApproved =
62-
!inReviews && revieweds.length > 0 &&
58+
revieweds.length > 0 &&
6359
!revieweds.find(
6460
(rd) =>
6561
!!(
@@ -114,17 +110,45 @@ class MilestonesApprovalNotification extends React.Component {
114110

115111
if (showAllApproved && this.state.show) {
116112
return (
117-
<div styleName="milestones-notifications">
118-
<div styleName="milestones-notifications-left">
119-
<MilestoneApprovalButton
120-
type="approve"
121-
global
122-
/>
123-
The following milestone(s) has been approved:
113+
<div styleName="approved-notifications">
114+
<div styleName="milestones-notifications">
115+
<div styleName="milestones-notifications-left">
116+
<button
117+
type="submit"
118+
className="tc-btn"
119+
styleName="tranparent-button"
120+
onClick={() => {
121+
this.setState({ open: !this.state.open })
122+
}}
123+
>
124+
<IconCollapse
125+
styleName={`icon-expand ${this.state.open ? 'open' : ''}`}
126+
/>
127+
</button>
128+
The following milestone(s) has been approved&nbsp;
129+
<MilestoneApprovalButton
130+
type="approve"
131+
/>
132+
</div>
133+
{renderDismissButton(() => {
134+
this.setState({ show: false })
135+
})}
124136
</div>
125-
{renderDismissButton(() => {
126-
this.setState({ show: false })
127-
})}
137+
{this.state.open && (
138+
<div styleName="body">
139+
{revieweds.map((item, key) => (
140+
<div
141+
className="flex middle"
142+
styleName="accordion-body-item"
143+
key={key}
144+
>
145+
<div styleName="body-item-one">
146+
<p styleName="bullet">{item.name}</p>
147+
</div>
148+
</div>
149+
))}
150+
</div>
151+
)}
128152
</div>
129153
)
130154
}

src/projects/detail/components/SimplePlan/components/MilestonesApprovalNotification/MilestonesApprovalNotification.scss

+41
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,47 @@
5151
}
5252
}
5353

54+
.approved-notifications {
55+
.milestones-notifications-left {
56+
display: flex;
57+
align-items: center;
58+
59+
button {
60+
padding: 0;
61+
}
62+
}
63+
64+
.body {
65+
padding: 20px calc(35px + 20px);
66+
border-top: none;
67+
background-color: white;
68+
69+
.accordion-body-item {
70+
font-size: 90%;
71+
72+
.body-item-one {
73+
flex: 20;
74+
}
75+
76+
.body-item-two {
77+
flex: 45;
78+
}
79+
80+
&:first-child {
81+
font-weight: normal;
82+
}
83+
84+
.body-item-one {
85+
.bullet {
86+
display: list-item;
87+
list-style-type: disc;
88+
list-style-position: inside;
89+
}
90+
}
91+
}
92+
}
93+
}
94+
5495
.reject-notifications {
5596

5697
.trigger {

0 commit comments

Comments
 (0)