Skip to content

Commit c549480

Browse files
committed
Merge branch 'dev' of github.com:appirio-tech/connect-app into dev
2 parents 6fbdc3c + b50598c commit c549480

File tree

13 files changed

+188
-467
lines changed

13 files changed

+188
-467
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React from 'react'
2+
import PropTypes from 'prop-types'
3+
import { HOC as hoc } from 'formsy-react'
4+
5+
import Select from './Select'
6+
7+
/**
8+
* This component is a formsy wrapper for the Select component
9+
* @param {Object} props Component props
10+
*/
11+
const FormsySelect = props => {
12+
// when setValueOnly is set to true, formsy should submit the 'option.value' instead of the whole 'option' object
13+
const { onChange, setValueOnly, options } = props
14+
const selectedOption = props.getValue()
15+
16+
const onSelectionChange = selectedOption => {
17+
props.setValue(setValueOnly ? selectedOption.value : selectedOption)
18+
onChange && onChange(selectedOption)
19+
}
20+
const value = setValueOnly
21+
? _.find(options, o => o.value === selectedOption)
22+
: selectedOption
23+
24+
return <Select {...props} value={value} onChange={onSelectionChange} />
25+
}
26+
27+
FormsySelect.PropTypes = {
28+
onChange: PropTypes.func,
29+
setValueOnly: PropTypes.bool,
30+
options: PropTypes.array.isRequired
31+
}
32+
33+
export default hoc(FormsySelect)

src/projects/create/components/HeaderWithProgress.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ function HeaderWithProgress({project, template, currentWizardStep, hidePrice}) {
2020
<div styleName="content">
2121
<div styleName="title-estimate">
2222
<h3>{currentStep.title}</h3>
23-
{ !hidePrice ?
24-
<div>From ${numberWithCommas(priceEstimate)}</div> : ''
25-
}
23+
{ false && !hidePrice && (<div>From ${numberWithCommas(priceEstimate)}</div>) }
2624
</div>
2725
<div styleName="progress-bar">
2826
<div styleName="progress" style={{width: (progress*100)+'%'}} />

src/projects/create/components/ProjectEstimation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function ProjectEstimation({
6767
return renderBlock({ ...item, duration: duration ? duration : null })
6868
})}
6969
</ul>
70-
{showPrice && (
70+
{ false && showPrice && (
7171
<h3>Our estimate is from <span>$</span>{numberWithCommas(priceEstimate)}</h3>
7272
)}
7373
</div>

src/projects/detail/components/ProjectEstimationSection/ProjectEstimationSection.jsx

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/projects/detail/components/ProjectEstimationSection/ProjectEstimationSection.scss

Lines changed: 0 additions & 57 deletions
This file was deleted.

src/projects/detail/components/ProjectEstimationSection/index.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/projects/detail/components/ProjectSpecSidebar.jsx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ import PropTypes from 'prop-types'
44
import { withRouter } from 'react-router-dom'
55
import { connect } from 'react-redux'
66
import cn from 'classnames'
7-
import Sticky from '../../../components/Sticky'
8-
import MediaQuery from 'react-responsive'
97
import SidebarNav from './SidebarNav'
10-
import { PROJECT_ROLE_OWNER, PROJECT_ROLE_CUSTOMER, SCREEN_BREAKPOINT_MD } from '../../../config/constants'
8+
import { PROJECT_ROLE_OWNER, PROJECT_ROLE_CUSTOMER } from '../../../config/constants'
119
import { updateProject } from '../../actions/project'
12-
import { isProjectEstimationPresent } from '../../../helpers/projectHelper'
1310
import ReviewProjectButton from './ReviewProjectButton'
14-
import ProjectEstimationSection from './ProjectEstimationSection'
1511
import './ProjectSpecSidebar.scss'
1612

1713
const calcProgress = (project, subSection) => {
@@ -119,17 +115,13 @@ class ProjectSpecSidebar extends Component {
119115
const showReviewBtn = project.status === 'draft' &&
120116
_.indexOf([PROJECT_ROLE_OWNER, PROJECT_ROLE_CUSTOMER], currentMemberRole) > -1
121117

122-
const hasEstimation = isProjectEstimationPresent(project)
123-
124118
return (
125119
<div className={cn('projectSpecSidebar', { 'has-review-btn': showReviewBtn })}>
126120
<h4 className="titles gray-font">Sections</h4>
127121
<div className="list-group">
128122
<SidebarNav items={navItems} />
129123
</div>
130124

131-
{hasEstimation && <ProjectEstimationSection project={project} />}
132-
133125
{ showReviewBtn &&
134126
<div>
135127
<div className="text-box">
@@ -147,17 +139,6 @@ class ProjectSpecSidebar extends Component {
147139
/>
148140
</div>
149141
}
150-
{!showReviewBtn && hasEstimation &&
151-
<MediaQuery maxWidth={SCREEN_BREAKPOINT_MD - 1}>
152-
<div className="sticky-estimation-only">
153-
<Sticky top={0}>
154-
<div className="btn-boxs">
155-
<ProjectEstimationSection project={project} />
156-
</div>
157-
</Sticky>
158-
</div>
159-
</MediaQuery>
160-
}
161142
</div>
162143
)
163144
}

src/projects/detail/components/ReviewProjectButton/ReviewProjectButton.jsx

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,21 @@ import React from 'react'
88
import PT from 'prop-types'
99
import cn from 'classnames'
1010

11-
import Sticky from 'react-stickynode'
12-
import MediaQuery from 'react-responsive'
13-
import ProjectEstimationSection from '../ProjectEstimationSection'
14-
import { SCREEN_BREAKPOINT_MD } from '../../../../config/constants'
15-
import { isProjectEstimationPresent } from '../../../../helpers/projectHelper'
16-
1711
import './ReviewProjectButton.scss'
1812

19-
const ReviewProjectButton = ({ project, disabled, onClick, wrapperClass }) => {
13+
const ReviewProjectButton = ({ disabled, onClick, wrapperClass }) => {
2014
const submitButton = (
2115
<button className="tc-btn tc-btn-primary tc-btn-md"
2216
onClick={onClick}
2317
disabled={disabled}
2418
>Submit for Review</button>
2519
)
2620

27-
const hasEstimation = isProjectEstimationPresent(project)
28-
2921
return (
3022
<div styleName={cn('container', wrapperClass)}>
31-
<MediaQuery minWidth={SCREEN_BREAKPOINT_MD}>
32-
{(matches) => {
33-
if (matches) {
34-
return (
35-
<div className="btn-boxs">
36-
{submitButton}
37-
</div>
38-
)
39-
} else {
40-
return (
41-
<Sticky top={0}>
42-
<div className={cn('btn-boxs', { 'has-estimation': hasEstimation })}>
43-
{hasEstimation && <ProjectEstimationSection project={project} />}
44-
{submitButton}
45-
</div>
46-
</Sticky>
47-
)
48-
}
49-
}}
50-
</MediaQuery>
23+
<div className="btn-boxs">
24+
{submitButton}
25+
</div>
5126
</div>
5227
)
5328
}
@@ -58,7 +33,7 @@ ReviewProjectButton.defaultProps = {
5833

5934
ReviewProjectButton.propTypes = {
6035
disabled: PT.bool,
61-
project: PT.object.isRequired,
36+
project: PT.object,
6237
onClick: PT.func.isRequired,
6338
wrapperClass: PT.string
6439
}

src/routes/settings/components/SettingsPanel.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
flex-grow: 1;
1010
margin: auto;
1111
margin-top: 20px;
12+
margin-bottom: 260px; // gives space to show country selection list
1213

1314
@media screen and (max-width: $screen-md - 1px) {
1415
padding: 0;
1516
margin: 0;
1617
max-width: none;
18+
margin-bottom: 260px; // gives space to show country selection list in mobile view
1719
}
1820
}
1921

0 commit comments

Comments
 (0)