var $ = require('jquery'); var AppConstants = require('../constants/AppConstants'); var AppDispatcher = require('../dispatchers/AppDispatcher'); var EventEmitter = require('events').EventEmitter; var Session = require('./Session'); var assign = require('object-assign'); var LOADED = 'loaded'; // Right now, the list of projects are just kept in memory var projects = []; var Projects = assign({}, EventEmitter.prototype, { getProjects: function() { return projects; }, load: function() { var session = Session.getSession(); console.log("session", session, session.user, session.token); var ajax = $.ajax({ url: '/hws/sync/v1/projects', beforeSend: function(xhr) { var auth = btoa(session.user + ":" + session.token); console.log('auth', auth); xhr.setRequestHeader("Authorization", "Basic " + auth); } }); var self = this; ajax.done(function(data) { projects = data; self.emitLoaded(); }); }, emitLoaded: function() { this.emit(LOADED, this.getProjects()); }, addLoadedListener: function(callback) { this.on(LOADED, callback); }, removeLoadedListener: function(callback) { this.removeListener(LOADED, callback); } }); module.exports = Projects;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 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. |
||
#2 | 13960 | tjuricek |
Setup a development config for nginx /hws points to the new monolithic helix_web_serivces instance / points to a static directory This static directory may end up getting moved around into other projects, I'm not sure where that location should be. |
||
#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/stores/Projects.js | |||||
#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). |