Commit 316564385fd4f2c5c8a600b1919fac18233ca197
1 parent
ce82de088e
Exists in
master
Added logout button to non org and fixed some css
Showing
8 changed files
with
27 additions
and
83 deletions
Show diff stats
client/stylesheets/custom.css
imports/client/layouts/NonOrgApp.js
... | ... | @@ -10,6 +10,7 @@ import { Row, Col, FormGroup, |
10 | 10 | NavLink, DropdownItem, DropdownToggle, DropdownMenu, |
11 | 11 | NavDropdown, MenuItem } from 'react-bootstrap'; |
12 | 12 | import { LinkContainer } from 'react-router-bootstrap'; |
13 | +import {AppNavigation} from '/imports/client/views/nonOrg/app/module/navigation/AppNavigation.js'; | |
13 | 14 | import './NonOrgApp.css'; |
14 | 15 | /** |
15 | 16 | * user based redirection will take place here |
... | ... | @@ -24,21 +25,7 @@ import './NonOrgApp.css'; |
24 | 25 | render(){ |
25 | 26 | return ( |
26 | 27 | <div> |
27 | - <Navbar> | |
28 | - <Navbar.Header> | |
29 | - <Navbar.Brand className='brand-style'> | |
30 | - <Link to="/">YOUNGDESK</Link> | |
31 | - </Navbar.Brand> | |
32 | - <Navbar.Toggle /> | |
33 | - </Navbar.Header> | |
34 | - <Navbar.Collapse> | |
35 | - <Nav pullRight> | |
36 | - <LinkContainer to="login" > | |
37 | - <NavItem className='nav-item' eventKey={ 2 } href="/login">Log in</NavItem> | |
38 | - </LinkContainer> | |
39 | - </Nav> | |
40 | - </Navbar.Collapse> | |
41 | - </Navbar> | |
28 | + <AppNavigation/> | |
42 | 29 | <Grid> |
43 | 30 | { this.props.children } |
44 | 31 | </Grid> | ... | ... |
imports/client/views/nonOrg/app/module/navigation/AppNavigation.js
1 | 1 | import React, { Component } from 'react'; |
2 | 2 | import { Navbar } from 'react-bootstrap'; |
3 | 3 | import { Link } from 'react-router'; |
4 | -import {PublicNavigation} from './PublicNavigation.js'; | |
5 | -import {AuthenticatedNavigation} from './AuthenticatedNavigation.js'; | |
4 | +import AuthenticatedNavigation from './AuthenticatedNavigation.js'; | |
6 | 5 | // import '/imports/client/assets/css/icons/icomoon/styles.css'; |
7 | 6 | // import '/imports/client/assets/css/bootstrap.css'; |
8 | 7 | // import '/imports/client/assets/css/core.css'; |
... | ... | @@ -22,34 +21,20 @@ export class AppNavigation extends Component { |
22 | 21 | this.setState({[key]: value}); |
23 | 22 | }; |
24 | 23 | render() { |
25 | - const {user} = this.props.data; | |
26 | - console.log(user); | |
27 | - if(user){ | |
28 | - return( | |
29 | - <AuthenticatedNavigation | |
30 | - data = {this.props.data} | |
31 | - /> | |
32 | - ) | |
33 | - }else{ | |
34 | 24 | return( |
35 | 25 | <Navbar> |
36 | 26 | <Navbar.Header> |
37 | 27 | <Navbar.Brand> |
38 | - <Link to="/">Application Name</Link> | |
28 | + <Link to="/">YoungDesk</Link> | |
39 | 29 | </Navbar.Brand> |
40 | 30 | <Navbar.Toggle /> |
41 | 31 | </Navbar.Header> |
42 | 32 | <Navbar.Collapse> |
43 | - <PublicNavigation /> | |
33 | + <AuthenticatedNavigation | |
34 | + /> | |
44 | 35 | </Navbar.Collapse> |
45 | 36 | </Navbar> |
46 | - | |
47 | 37 | ) |
48 | - } | |
49 | - | |
50 | - return ( | |
51 | - <div></div> | |
52 | - ); | |
53 | 38 | }; |
54 | 39 | |
55 | 40 | }; | ... | ... |
imports/client/views/nonOrg/app/module/navigation/AuthenticatedNavigation.js
... | ... | @@ -4,20 +4,19 @@ import { LinkContainer } from 'react-router-bootstrap'; |
4 | 4 | import { Nav, NavItem, NavDropdown, MenuItem } from 'react-bootstrap'; |
5 | 5 | import { Meteor } from 'meteor/meteor'; |
6 | 6 | |
7 | -const handleLogout = () => Meteor.logout(() => browserHistory.push('/login')); | |
7 | +const handleLogout = () => Meteor.logout(); | |
8 | 8 | |
9 | 9 | const userName = () => { |
10 | 10 | const user = Meteor.user(); |
11 | - const name = user && user.profile ? user.profile.name : ''; | |
12 | - return user ? `${name.first} ${name.last}` : ''; | |
11 | + console.log("user------"); | |
12 | + console.log(user); | |
13 | + return user ? `${user.firstName} ${user.lastName}` : ''; | |
13 | 14 | }; |
14 | 15 | |
15 | 16 | const AuthenticatedNavigation = () => ( |
16 | 17 | <div> |
17 | - <Nav> | |
18 | - <LinkContainer to="/documents"> | |
19 | - <NavItem eventKey={ 2 } href="/documents">Documents</NavItem> | |
20 | - </LinkContainer> | |
18 | + <Nav pullRight> | |
19 | + <MenuItem eventKey={ 3.1 } onClick={ handleLogout }>Logout</MenuItem> | |
21 | 20 | </Nav> |
22 | 21 | </div> |
23 | 22 | ); | ... | ... |
imports/client/views/verify/EmailPane.js
... | ... | @@ -70,12 +70,12 @@ export class EmailPane extends React.Component { |
70 | 70 | const {user} = this.props; |
71 | 71 | |
72 | 72 | return ( |
73 | - <div className = "wizardPane-box"> | |
73 | + <div className = "wizardPane-box verifyEmailBox"> | |
74 | 74 | <div className = "wizardPane-section1"> |
75 | 75 | |
76 | 76 | <div className = "wizardPane-title"> |
77 | 77 | {/* <i className="icon-envelope icon"></i> */} |
78 | - <h3>Hi, your email needs verification</h3> | |
78 | + <h3>Hi {user.getFullName()}, your email needs verification</h3> | |
79 | 79 | |
80 | 80 | <span>Please check your email โย we sent a verification link to |
81 | 81 | <span className = "EmailVerify"> | ... | ... |
imports/client/views/verify/module/VerifyLayout.js
... | ... | @@ -19,47 +19,17 @@ export class VerifyLayout extends Component { |
19 | 19 | |
20 | 20 | return ( |
21 | 21 | <div className = "wizardLayout-box"> |
22 | - <div className = "wizardLayout-top"> | |
23 | - <div className="container"> | |
24 | - <div className = "wizardLayout-topSpace logo-space-0"> | |
25 | - <ReactSVG | |
26 | - path="/files/images/svg/logo--white.svg" | |
27 | - className="enterPane__logo" | |
28 | - /> | |
29 | - </div> | |
30 | - <div className = "wizardLayout-topGroup"> | |
31 | - <div className = "wizardLayout-topItem"> | |
32 | - <Avatar | |
33 | - user = {user} | |
34 | - size = {20} | |
35 | - small = {true} | |
36 | - /> | |
37 | - | |
38 | - {user.getFullName()} | |
39 | - </div> | |
40 | - <div | |
41 | - className = "wizardLayout-topItem" | |
42 | - onClick = {() => logout()} | |
43 | - > | |
44 | - <i className="icon icon-simple icon-power"></i> | |
45 | - </div> | |
46 | - </div> | |
47 | - </div> | |
48 | - </div> | |
49 | - | |
50 | 22 | <div className = "wizardLayout-wrap"> |
51 | 23 | <div className = "wizardLayout-content"> |
52 | 24 | |
53 | 25 | <EmailPane |
54 | 26 | user = {user} |
55 | 27 | /> |
56 | - | |
28 | + | |
57 | 29 | </div> |
58 | 30 | </div> |
59 | 31 | </div> |
60 | 32 | ); |
61 | 33 | }; |
62 | - | |
63 | -}; | |
64 | - | |
65 | 34 | |
35 | +}; | ... | ... |
imports/server/accounts/creation.js
... | ... | @@ -15,7 +15,7 @@ Accounts.onCreateUser((options, user) => { |
15 | 15 | |
16 | 16 | if(options.orgSlug){ |
17 | 17 | orgId = Orgs.insert({ |
18 | - slug: options.orgSlug, | |
18 | + slug: options.orgSlug.replace(" ", "-").toLowerCase(), | |
19 | 19 | name: options.orgName, |
20 | 20 | setup: 1, |
21 | 21 | users: [{ |
... | ... | @@ -24,16 +24,12 @@ Accounts.onCreateUser((options, user) => { |
24 | 24 | }], |
25 | 25 | }); |
26 | 26 | } |
27 | - console.log("options"); | |
28 | - console.log(options); | |
29 | - console.log("user"); | |
30 | - console.log(user); | |
31 | - _.assign(user, { | |
27 | + | |
28 | + _.assign(user, { | |
32 | 29 | role: Users.roles.ADMIN, |
33 | 30 | orgId: orgId, |
34 | 31 | firstName: options.profile.name.first, |
35 | 32 | lastName: options.profile.name.last, |
36 | 33 | }); |
37 | - console.log(user); | |
38 | 34 | return user; |
39 | 35 | }); | ... | ... |
imports/server/emails/verifyEmail.js
... | ... | @@ -14,7 +14,7 @@ Accounts.emailTemplates.verifyEmail = { |
14 | 14 | const theUrl = Meteor.absoluteUrl(`back/verifyEmail/${_.last(url.split('/'))}`); |
15 | 15 | org = Orgs.findOne({"_id":user.orgId}); |
16 | 16 | |
17 | - OrgUrl = theUrl.replace("http://","http://"+org.slug+"."); | |
17 | + OrgUrl = encodeURI(theUrl.replace("http://","http://"+org.slug+".")); | |
18 | 18 | return ( |
19 | 19 | ` |
20 | 20 | Hello, ${user.firstName}! | ... | ... |