Skip to content

Commit

Permalink
Converted remaining views to React.Component and removed globals
Browse files Browse the repository at this point in the history
  • Loading branch information
dougmartin committed Oct 29, 2018
1 parent 128d678 commit 2d240a3
Show file tree
Hide file tree
Showing 112 changed files with 3,043 additions and 2,043 deletions.
67 changes: 0 additions & 67 deletions .eslintrc.js

This file was deleted.

23 changes: 19 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@types/node": "^10.12.0",
"@types/react": "^15.4.2",
"@types/react-dom": "^15.4.2",
"@types/jquery": "^3.2.1",
"autoprefixer": "^9.2.1",
"babel-core": "^6.26.3",
"babel-preset-es2015": "^6.24.1",
Expand Down
1 change: 0 additions & 1 deletion src/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
<div id='app'></div>
</div>
<script src="js/jsPlumb.js"></script>
<script src="js/globals.js"></script>
<script src="js/app.js"></script>
<script type="text/javascript" charset="utf-8">
if(self == top) {
Expand Down
2 changes: 2 additions & 0 deletions src/code/actions/codap-actions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const Reflux = require("reflux");

export const CodapActions = Reflux.createActions(
[
"codapLoaded",
Expand Down
2 changes: 2 additions & 0 deletions src/code/actions/graph-actions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const Reflux = require("reflux");

export const GraphActions = Reflux.createActions(
[
"graphChanged",
Expand Down
2 changes: 2 additions & 0 deletions src/code/actions/import-actions.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
const Reflux = require("reflux");

export const ImportActions = Reflux.createActions([ "import" ]);
2 changes: 2 additions & 0 deletions src/code/actions/lara-actions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const Reflux = require("reflux");

export const LaraActions = Reflux.createActions(
[
"laraLoaded"
Expand Down
38 changes: 20 additions & 18 deletions src/code/app.ts → src/code/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,36 @@

import "../stylus/app.styl";

import { AppView as AppViewClass } from "./views/app-view";
const AppView = React.createFactory(AppViewClass);
import * as React from "react";
import * as ReactDOM from "react-dom";

import { AppView } from "./views/app-view";
import { GraphStore } from "./stores/graph-store";
import { PaletteStore } from "./stores/palette-store";
import { HashParams } from "./utils/hash-parameters";

import * as $ from "jquery";
require("jquery-ui-dist/jquery-ui.js");
const Touchpunch = require("./vendor/touchpunch.js");
Touchpunch($);

// const jsPlumb = require("../vendor/jsPlumb");
declare var jsPlumb;

let appView;

// App API
(window as any).Sage = {
initApp() {
const opts = {
// Valid opts are:
// graphStore: store for the node-link graph
// publicUrl: Where to load json e.g.'json/serialized.json'
// googleDoc: try to load a googledoc from the url
// data: the json to load (compare with publicUrl above)
graphStore: GraphStore,
publicUrl: HashParams.getParam("publicUrl"),
data: HashParams.getParam("data"),
googleDoc: HashParams.getParam("googleDoc")
};

appView = AppView(opts);
const elem = "#app";

return jsPlumb.bind("ready", () => ReactDOM.render(appView, $(elem)[0]));
return jsPlumb.bind("ready", () => {
appView = <AppView
graphStore={GraphStore}
publicUrl={HashParams.getParam("publicUrl")}
data={HashParams.getParam("data")}
googleDoc={HashParams.getParam("googleDoc")}
/>;
ReactDOM.render(appView, document.getElementById("app"));
});
},

clearModel() {
Expand Down
2 changes: 2 additions & 0 deletions src/code/data/licenses.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import * as React from "react";

/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
Expand Down
1 change: 1 addition & 0 deletions src/code/data/migrations/01_base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// FORMAT BEFORE THIS TRANSFORM: in serialized-test-data-0.1.js
// FORMAT AFTER THIS TRANSFORM: in serialized-test-data-1.0.js

const _ = require("lodash");
import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
1 change: 1 addition & 0 deletions src/code/data/migrations/02_add_relations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");
import { MigrationMixin } from "./migration-mixin";
import { Relationship } from "../../models/relationship";

Expand Down
1 change: 1 addition & 0 deletions src/code/data/migrations/03_add_semi_quant_editing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");
import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
1 change: 1 addition & 0 deletions src/code/data/migrations/04_add_min_max.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");
import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
1 change: 1 addition & 0 deletions src/code/data/migrations/05_add_settings_and_cap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");
import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
2 changes: 2 additions & 0 deletions src/code/data/migrations/06_add_palette_references.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");
const uuid = require("uuid");

import { MigrationMixin } from "./migration-mixin";

const imageToUUIDMap = {};
Expand Down
2 changes: 2 additions & 0 deletions src/code/data/migrations/07_add_diagram_only_setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");

import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
2 changes: 2 additions & 0 deletions src/code/data/migrations/08_add_simulation_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");

import { MigrationMixin } from "./migration-mixin";
import { TimeUnits } from "../../utils/time-units";

Expand Down
2 changes: 2 additions & 0 deletions src/code/data/migrations/09_update_duration_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");

import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
2 changes: 2 additions & 0 deletions src/code/data/migrations/10_add_speed_and_cap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");

import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
2 changes: 2 additions & 0 deletions src/code/data/migrations/11_simulation_engine_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");

import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
2 changes: 2 additions & 0 deletions src/code/data/migrations/12_add_minigraphs_visibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");

import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
2 changes: 2 additions & 0 deletions src/code/data/migrations/13_add_frames_to_nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");

import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
2 changes: 2 additions & 0 deletions src/code/data/migrations/14_remove_new_integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");

import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");
import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
2 changes: 2 additions & 0 deletions src/code/data/migrations/16_add_link_reasoning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");

import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
2 changes: 2 additions & 0 deletions src/code/data/migrations/17_remove_simulation_speed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");

import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
2 changes: 2 additions & 0 deletions src/code/data/migrations/18_serialize_experiment_number.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const _ = require("lodash");

import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
2 changes: 2 additions & 0 deletions src/code/data/migrations/19_add_relation_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/

const _ = require("lodash");

import { MigrationMixin } from "./migration-mixin";

const migration = {
Expand Down
Loading

0 comments on commit 2d240a3

Please sign in to comment.