Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
can bring the UI back up with lots of JS changes
- Loading branch information
1 parent
bec356e
commit 7db394e
Showing
18 changed files
with
9,906 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,4 @@ | ||
// Array.prototype.findIndex - MIT License (c) 2013 Paul Miller <http://paulmillr.com> | ||
// For all details and docs: <https://github.com/paulmillr/Array.prototype.findIndex> | ||
(function (globals) { | ||
if (Array.prototype.findIndex) return; | ||
import Routing from './components/routing' | ||
import Screen from './screen'; | ||
|
||
var findIndex = function(predicate) { | ||
var list = Object(this); | ||
var length = Math.max(0, list.length) >>> 0; // ES.ToUint32; | ||
if (length === 0) return -1; | ||
if (typeof predicate !== 'function' || Object.prototype.toString.call(predicate) !== '[object Function]') { | ||
throw new TypeError('Array#findIndex: predicate must be a function'); | ||
} | ||
var thisArg = arguments.length > 1 ? arguments[1] : undefined; | ||
for (var i = 0; i < length; i++) { | ||
if (predicate.call(thisArg, list[i], i, list)) return i; | ||
} | ||
return -1; | ||
}; | ||
|
||
if (Object.defineProperty) { | ||
try { | ||
Object.defineProperty(Array.prototype, 'findIndex', { | ||
value: findIndex, configurable: true, writable: true | ||
}); | ||
} catch(e) {} | ||
} | ||
|
||
if (!Array.prototype.findIndex) { | ||
Array.prototype.findIndex = findIndex; | ||
} | ||
}(this)); | ||
|
||
var Postal = require('postal'); | ||
var app = require('./components/app').default; | ||
var disconnect = require('./components/disconnected').default; | ||
|
||
// TODO -- HOKEY!!!!! | ||
var theStore = null; | ||
var startRouting = app(Storyteller.initialization, store => { | ||
theStore = store; | ||
|
||
Postal.subscribe({ | ||
channel: 'engine', | ||
topic: '*', | ||
callback: (data, env) => { | ||
data.type = env.topic; | ||
store.dispatch(data); | ||
} | ||
}); | ||
|
||
|
||
}); | ||
|
||
var Communicator = require('./communicator'); | ||
var wsAddress = Storyteller.wsAddress; | ||
|
||
var rebroadcast = m => { | ||
Postal.publish({ | ||
channel: 'engine', | ||
topic: m.type, | ||
data: m | ||
}); | ||
} | ||
|
||
var dispatch = msg => { | ||
theStore.dispatch(msg); | ||
|
||
|
||
|
||
switch (msg.type){ | ||
case 'spec-added': | ||
var href = '#/spec/editing/' + msg.data.id; | ||
window.location = href; | ||
|
||
case 'spec-saved': | ||
rebroadcast(msg); | ||
|
||
case 'runtime-error': | ||
rebroadcast(msg); | ||
} | ||
} | ||
|
||
var communicator = new Communicator(dispatch, wsAddress, disconnect); | ||
|
||
require('./lib/command-processor')(communicator, theStore); | ||
require('./lib/presentation/spec-editor-presenter')(theStore, communicator); | ||
|
||
startRouting(); | ||
Screen(Routing); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
var Routing = require('./routing'); | ||
import { AppContainer } from 'react-hot-loader' | ||
|
||
export default function HotReloaded(){ | ||
return ( | ||
<AppContainer> | ||
<Routing /> | ||
</AppContainer> | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
import {BrowserRouter as Router, Route, Link, RouteHandler} from 'react-router-dom'; | ||
import createHistory from 'history/createBrowserHistory'; | ||
|
||
import SpecExplorer from './explorer/spec-explorer'; | ||
import Language from './language/language'; | ||
import Documentation from './documentation'; | ||
import QueuePage from './queue/queue-page'; | ||
import Header from './header/header'; | ||
import GrammarErrors from './grammars/grammar-errors'; | ||
import SpecEditor from './editing/spec-editor'; | ||
import SpecPreview from './editing/spec-preview'; | ||
import SpecResults from './editing/spec-results'; | ||
import SpecStepthrough from './editing/spec-stepthrough'; | ||
import SuiteExplorer from './explorer/suite-explorer'; | ||
import ResultsPane from './results/results-pane'; | ||
import FixtureTable from './language/fixture-table'; | ||
|
||
var history = createHistory(); | ||
history.listen(location => { | ||
setLocation(location); | ||
}); | ||
|
||
function Routing(){ | ||
return ( | ||
<div> | ||
<Header /> | ||
|
||
<Router> | ||
<div className="container-fluid"> | ||
<Route name="language" path="/language" component={Language}/> | ||
<Route name="documentation" path="/docs" component={Documentation}/> | ||
<Route name="queue" path="/queue" component={QueuePage} /> | ||
<Route name="grammar-errors" path="/grammar-errors" component={GrammarErrors} /> | ||
<Route name="spec-preview" path="/spec/preview/:id" component={SpecPreview} /> | ||
<Route name="spec-editor" path="/spec/editing/:id" component={SpecEditor} /> | ||
<Route name="spec-results" path="/spec/results/:id" component={SpecResults} /> | ||
<Route name="spec-stepthrough" path="/spec/stepthrough/:id" component={SpecStepthrough} /> | ||
<Route name="fixture" path="/fixture/:key" component={FixtureTable} /> | ||
<Route name="suite-explorer" path="/suite/*" component={SuiteExplorer} /> | ||
<Route name="results" path="/results" component={ResultsPane} /> | ||
<Route name="home" exact path="/" component={SpecExplorer}/> | ||
</div> | ||
</Router> | ||
|
||
</div> | ||
); | ||
} | ||
|
||
module.exports = Routing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Screen from './screen' | ||
import HotReloading from './components/hotreloading' | ||
|
||
Screen(HotReloading); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.