Skip to content

Commit 1c93c6f

Browse files
author
vikasrohit
authored
Merge pull request #1262 from appirio-tech/feature/sync-url-change-for-logged-in-user
Github issue#1234, Functions of the "Connect Logo", "Back", "Esc" buttons in logged in and logged out states
2 parents 1d75c13 + efb75c7 commit 1c93c6f

File tree

7 files changed

+11
-25
lines changed

7 files changed

+11
-25
lines changed

src/projects/create/components/FillProjectDetails.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import _ from 'lodash'
22
import React, { PropTypes as PT, Component } from 'react'
3-
import { Link } from 'react-router'
43
import Sticky from 'react-stickynode'
54

65
import config from '../../../config/projectWizard'
7-
import SVGIconImage from '../../../components/SVGIconImage'
86
import './FillProjectDetails.scss'
97
import ProjectBasicDetailsForm from '../components/ProjectBasicDetailsForm'
108
import ProjectOutline from '../components/ProjectOutline'
@@ -34,9 +32,7 @@ class FillProjectDetails extends Component {
3432
}
3533

3634
render() {
37-
const { project, dirtyProject, processing, submitBtnText, userRoles } = this.props
38-
const isLoggedIn = userRoles && userRoles.length
39-
const logoTargetUrl = isLoggedIn ? '/projects' : '/'
35+
const { project, dirtyProject, processing, submitBtnText } = this.props
4036
const product = _.get(project, 'details.products[0]')
4137
const projectTypeId = _.get(project, 'type')
4238
const subConfig = config[_.findKey(config, {id : projectTypeId})]
@@ -49,8 +45,6 @@ class FillProjectDetails extends Component {
4945
return (
5046
<div className="FillProjectDetailsWrapper">
5147
<div className="header headerFillProjectDetails">
52-
{ !isLoggedIn && <Link className="logo" to={logoTargetUrl} target="_self"><SVGIconImage filePath="connect-logo-mono" className="connectLogo"/></Link>}
53-
{ !isLoggedIn && <button className="tc-btn tc-btn-default tc-btn-sm" onClick={ this.props.onChangeProjectType }><SVGIconImage filePath="arrows-undo" />Change project type</button> }
5448
</div>
5549
<div className="FillProjectDetails">
5650
<div className="header">

src/projects/create/components/IncompleteProjectConfirmation.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import React, { PropTypes as PT } from 'react'
2-
import { Link } from 'react-router'
32
import SVGIconImage from '../../../components/SVGIconImage'
43
import './IncompleteProjectConfirmation.scss'
54

6-
function IncompleteProjectConfirmation({ loadIncompleteProject, removeIncompleteProject, userRoles }) {
7-
const isLoggedIn = userRoles && userRoles.length
8-
const logoTargetUrl = isLoggedIn ? '/projects' : '/'
5+
function IncompleteProjectConfirmation({ loadIncompleteProject, removeIncompleteProject }) {
6+
// const isLoggedIn = userRoles && userRoles.length
97
return (
108
<div className="IncompleteProjectConfirmation">
119
<div className="header">
12-
{ !isLoggedIn && <Link className="logo" to={logoTargetUrl} target="_self"><SVGIconImage filePath="connect-logo-mono" className="connectLogo"/></Link>}
10+
<SVGIconImage filePath="connect-logo-mono" className="connectLogo"/>
1311
</div>
1412
<h3>Welcome back!</h3>
1513
<h5>You started a project with us recently.</h5>

src/projects/create/components/ProjectWizard.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ class ProjectWizard extends Component {
385385
onCancel={this.handleWizardCancel}
386386
onStepChange={ this.handleStepChange }
387387
step={this.state.wizardStep}
388-
shouldRenderBackButton={ (step) => userRoles && userRoles.length && step > 1 }
388+
shouldRenderBackButton={ (step) => step > 1 }
389389
>
390390
<IncompleteProjectConfirmation
391391
loadIncompleteProject={ this.loadIncompleteProject }

src/projects/create/components/SelectProduct.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import React, { PropTypes as PT } from 'react'
2-
import { Link } from 'react-router'
32
import config from '../../../config/projectWizard'
43
import ProductCard from './ProductCard'
54
import SVGIconImage from '../../../components/SVGIconImage'
65
import { findCategory } from '../../../config/projectWizard'
76
import './SelectProduct.scss'
87

98
function SelectProduct(props) {
10-
const { userRoles, projectType, onChangeProjectType } = props
11-
const isLoggedIn = userRoles && userRoles.length
12-
const logoTargetUrl = isLoggedIn ? '/projects' : '/'
9+
const { projectType } = props
1310
const cards = []
1411
for (const key in config) {
1512
const type = config[key]
@@ -36,8 +33,6 @@ function SelectProduct(props) {
3633
return (
3734
<div>
3835
<div className="header headerSelectProduct">
39-
{ !isLoggedIn && <Link className="logo" to={logoTargetUrl} target="_self"><SVGIconImage filePath="connect-logo-mono" className="connectLogo"/></Link>}
40-
{ !isLoggedIn && <button className="tc-btn tc-btn-default tc-btn-sm" onClick={ onChangeProjectType }><SVGIconImage filePath="arrows-undo" />Change project type</button> }
4136
</div>
4237
<div className="SelectProduct">
4338
<h1> { projectCategory.name } projects </h1>

src/projects/create/components/SelectProjectType.jsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
import React, { PropTypes as PT } from 'react'
2-
import { Link } from 'react-router'
32
import config from '../../../config/projectWizard'
43
import ProjectTypeCard from './ProjectTypeCard'
54
import SVGIconImage from '../../../components/SVGIconImage'
65
import { findProductsOfCategory } from '../../../config/projectWizard'
76
import './SelectProjectType.scss'
87

98
function SelectProjectType(props) {
10-
const { userRoles } = props
11-
const isLoggedIn = userRoles && userRoles.length
12-
const logoTargetUrl = isLoggedIn ? '/projects' : '/'
139
const cards = []
1410
for (const key in config) {
1511
const item = config[key]
@@ -32,7 +28,7 @@ function SelectProjectType(props) {
3228
return (
3329
<div>
3430
<div className="header headerSelectProjectType">
35-
{ !isLoggedIn && <Link className="logo" to={logoTargetUrl} target="_self"><SVGIconImage filePath="connect-logo-mono" className="connectLogo"/></Link>}
31+
<SVGIconImage filePath="connect-logo-mono" className="connectLogo"/>
3632
</div>
3733
<div className="SelectProjectType">
3834
<h1>Create a new project</h1>

src/projects/create/components/_layout.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ $minimumPageWidth: 984px;
2929
display: flex;
3030
justify-content: space-between;
3131
margin: 20px 0 0;
32+
height: 43px;
3233

3334
button {
3435
align-self: flex-start;

src/projects/create/containers/CreateContainer.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ class CreateConainer extends React.Component {
148148
if (isLoggedIn) {
149149
this.props.router.push('/projects')
150150
} else {
151-
this.props.router.push('/')
151+
// this.props.router.push('/')
152+
// FIXME ideally we should push on router
153+
window.location = window.location.origin
152154
}
153155
}
154156

0 commit comments

Comments
 (0)