// This is the top level component that really decides upon the major page // components to use. We start by deciding to show the login screen or a // normal page, which constitutes a header along with some other content. var CreateProject = require('./CreateProject.jsx'); var Location = require('../stores/Location'); var Login = require('./Login.jsx'); var React = require('react'); var Session = require('../stores/Session'); var ProjectDetails = require('./ProjectDetails.jsx'); var ProjectList = require('./ProjectList.jsx'); var Header = require('./Header.jsx'); var ProjectManagement = React.createClass({ getInitialState: function() { return { hasSession: Session.hasSession(), location: Location.getLocation() }; }, componentDidMount: function() { Session.addLoggedInListener(this.updateSession); Session.addLoggedOutListener(this.updateSession); Location.addNewLocationListener(this.updateLocation); }, componentWillUnmount: function() { Session.removeLoggedInListener(this.updateSession); Session.removeLoggedOutListener(this.updateSession); Location.removeNewLocationListener(this.updateLocation); }, render: function () { if (this.state.hasSession) { var page = null; if (this.state.location.projectList) { page = <ProjectList />; } else if (this.state.location.project) { page = <ProjectDetails />; } else if (this.state.location.createProject) { page = <CreateProject />; } return ( <div> <Header /> { page } </div> ); } else { return ( <Login /> ) } }, updateSession: function() { this.setState({ hasSession: Session.hasSession() }); }, updateLocation: function() { this.setState({ location: Location.getLocation() }); } }); module.exports = ProjectManagement;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15688 | Doug Scheirer |
Populate -o //guest/perforce_software/helix-web-services/... //guest/doug_scheirer/helix-web-services/.... |
||
//guest/perforce_software/helix-web-services/main/source/helix_web_components/project_management/components/ProjectManagement.jsx | |||||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/helix_web_components/project_management/components/ProjectManagement.jsx | |||||
#1 | 13974 | tjuricek |
Moving 'ui/static' to 'helix_web_components' project, and altering some notes. Also, removed obsolete top-level Rake tasks. The "Helix Web Components" project will likely get moved elsewhere in the future. |
||
//guest/perforce_software/helix-web-services/main/ui/static/project_management/components/ProjectManagement.jsx | |||||
#3 | 13962 | tjuricek |
Add 'location' store and integrate "Jest" for unit testing. The location will trigger different views of the main ProjectManagement component. The Jest framework allows us to create headless tests of the React component logic. It's a little tricky, and right now has a dependency on node 0.10. |
||
#2 | 13769 | tjuricek | Add a trivial 'Header' component with a log out method. | ||
#1 | 13707 | tjuricek |
Infrastructure for including a "project management" React application. This attempts to create a fairly simple installer that creates a 'static' folder based on ui/static that gets hosted by the nginx front end. Right now, it's the only app, so the default page is this application. It was called "pws2" during a prototyping phase. Another prototype, "pws" and the related "project" module, is removed since that was a Sinatra-based approach that will be much more difficult to integrate into anything else. I'm running into a couple of issues with notifications setup, it's still not 100%, so I'm disabling this for now from the default 'god' configuration. (The service isn't 100% functional yet, anyway.) |
||
//guest/perforce_software/helix-web-services/main/ui/static/pms2/components/ProjectManagement.jsx | |||||
#1 | 13645 | tjuricek |
React.js + Flux prototype This just logs in and displays a list of projects (create one with the other app for now). |