Skip to content

Commit

Permalink
Delete the old UI and leave the new one in its place 🙌 (#645)
Browse files Browse the repository at this point in the history
* New UI: Move the UI contents into a new branch until fully functional (#547)

* setup code responses for react

* Add Editor Redux feature

* code review changes

* link editor code with django

right now the game id is fixed to 1

* test get code button

* Add GamePage snapshot test

* add post code epic

* Sends post request successfully

* add a way to get csrf token via ajax

* update npm packages

* add post request for code

* simplify passing of epics

* move api calls into an api folder

* simplify post api call

* simplify syntax

* Fix tests and add some more

* New UI: Code editor frontend (#548)

* setup code responses for react

* Add Editor Redux feature

* code review changes

* link editor code with django

right now the game id is fixed to 1

* Merge branch 'master' into django_editor_link

* test get code button

* Add GamePage snapshot test

* add post code epic

* Sends post request successfully

* add a way to get csrf token via ajax

* update npm packages

* add post request for code

* simplify passing of epics

* move api calls into an api folder

* simplify post api call

* simplify syntax

* Fix tests and add some more

* Add front-end component for AceEditor

* Modified theme of code editor

* Merge branch 'UI_new_design' into code_editor_frontend

* Fixed failing test and updated snapshot for code editor

* Merge branch 'code_editor_frontend' of https://github.com/ocadotechnology/aimmo into code_editor_frontend

* Editor state management (#555)

* Get intial state of code on editor load

* Added more types to handle changing code

* Wrote a test case for changeCodeEpic

* fix deps

* Inject testscheduler into changeCodeEpic

* State in post request should be evaluated at the time of the action

* fix eslint in GamePage tests

* code review changes

* Add Material Design to AI:MMO with a Basic Colour Palette (#618)

* Add material-ui core

* Add mui theme to MUIThemeProvider and styled components ThemeProvider

* Use theme colors for existing ui

I didn't do the Unity one because it's going to not have a background

* delete unused file

* add a withTheme testHelper

* Use withTheme testHelper

* Update snapshots

* Use absolute imports for testhelpers

* Merge branch 'master' into UI_new_design

* Fix build

* Add typography (#620)

* Add typography

* withTheme is a default export

* Fix tests so that they are testing the correct code

* Merge branch 'master'

Conflicts:
	game_frontend/package-lock.json
	game_frontend/package.json
	game_frontend/yarn.lock
	players/views.py

* JS: Update dependencies and lock files

* Add more snapshot tests for containers

* Merge with UI_new_design

* Document createShallowWithTheme (#641)

* Add documentation for `createShallowWithTheme` test helper

* Remove feature path

* Fix redux-dev-tools deployment bug

* [New UI] Unity Build in React (#616)

* Add react-unity-webgl package as a dependency

* Introduce new unity module to the component

* Update the README

* Move GameView to be a container

* Add some extra functionality local to the file for now

* Add utilities and a API with JSON settings. Resolves #612

* More functionality to connect two systems

* More Redux changes for success & connection

* Refactor method name of the view to not include 'view'

* Add initial state & send information across to Unity WebGL

* Add socketIO dependency to generated HTML

* Call Unity functions as redux actions now

* Remove irrelevant comments now

* Serialise boolean SSL flag for Unity

* More changes to how communication is conducted

* Handle errors

* Add lunch json for VS code to git ignore

* Emit success event in the epic

* Remove middlewares

* New feature introduced for Game

* Remove old game reducer and move to its own. Resolves #619

Same as below

* Separate epics for each event refactoring

* Remove older epic

* Update .gitignore launch json path
Ignore all .vscode files


Update .gitignore

* Remove a TODO comment

* Fix existing tests to suit new code

* Merge branch 'UI_new_design' into add_unity_to_react

* Regenerate yarn.lock

* Revert the refactoring, can be done in a different PR

* Add epic tests for the happy path

* Remove unwanted comment and add EOF lines

* Change reducer name, forgot to change beforehand

* Add reducer test for all current cases

* More function tests

* Some testing changes as requested in PR by @mrniket

* Change imports to one liner using aliases

* Remove redundant alias for default import

* Refactoring of setGameURL successful, rest not done

* Refactoring of setGameURL fixed

* Finish refactoring

* Merge remote-tracking branch 'origin/UI_new_design' into add_unity_to_react

* GameView minor esLint changes

* Merge remote-tracking branch 'origin/UI_new_design' into add_unity_to_react

* Fix indentation and other eslint issues in unity

* Certain eslint fixes

* More eslint

* Fix minor SSL bug

* Add extra developer settings to the parcel bundler

* Initial connectionParams naming changes


More naming changes


More naming changes again


connectionParams naming change done

* Name change in the view to parameters

* utilities called game_helpers now

* Add another shallow theme test to the layout

* Test passing, still unhappy with marble completion

* Use action creators instead of explicit objects

* Add css to Game Page testing

* Change the djangoBundler check environment before setting vars

* Update tests without theme to use shallow instead

* Export unity as a object containing all the calls instead

* Bring id of current avatar view to be called game_id again

* Add naming change to game_helpers as requested

* Fix tests to be correct now

* Make aimmo compatible with Django 1.9 (#642)

* Make aimmo compatible with Django 1.9

* Using patch version of Django 1.9 (#643)

* Using patch version of Django 1.9

* Merge remote-tracking branch 'origin/master' into add_unity_to_react

* Simply the API for api.js, put error in payload of fail actions

* Add test for emit unity failure

* Merge branch 'master' into UI_new_design

* Fix linter error

* Use the new game_ide ui for AI:MMO and delete the old one 🙌

* Merge branch 'master' into UI_new_design

* Change travis.yml to build new UI before running all_tests


Silly mistake
  • Loading branch information
mrniket authored and OlafSzmidt committed Jul 4, 2018
1 parent 5910ea5 commit 5dd77ca
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 357 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ stages:
jobs:
include:
- stage: test
env:
- NODE_ENV=production
before_script:
# Download kubectl, which is a requirement for using minikube.
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.9.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
Expand All @@ -31,6 +33,10 @@ jobs:
install:
- pip install .
- pip install coveralls
- pushd game_frontend
- yarn
- node djangoBundler.js
- popd
script:
- python all_tests.py --coverage
after_success:
Expand Down
2 changes: 1 addition & 1 deletion game_frontend/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"cwd": "babelrc",
"root": ["./src"],
"alias": {
"features": "./src/redux/features",
"features": "./src/redux/features"
}
}]
]
Expand Down
8 changes: 7 additions & 1 deletion game_frontend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const initialState = {
},
game: {
connectionParameters: {
id: 1,
id: getGameIDFromURL() || 1,
game_url_base: '',
game_url_path: '',
game_url_port: 0,
Expand All @@ -36,6 +36,12 @@ const initialState = {
}
}

function getGameIDFromURL () {
const url = window.location.href
const gameIDFinder = /\/play\/([0-9]+)/
return gameIDFinder.exec(url)[1]
}

const reduxStore = configureStore(initialState)
const muiTheme = createMuiTheme(theme)

Expand Down
2 changes: 1 addition & 1 deletion players/game_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def render_game(request, game):

context.update(connection_settings)

return render(request, 'players/viewer.html', context)
return render(request, 'players/game_ide.html', context)


def get_environment_connection_settings(game_id):
Expand Down
3 changes: 0 additions & 3 deletions players/static/css/program.css

This file was deleted.

88 changes: 0 additions & 88 deletions players/static/js/program.js

This file was deleted.

8 changes: 2 additions & 6 deletions players/templates/players/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,8 @@

<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="dropdown {% block nav-program-class %}{% endblock %}"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Program<span class="sr-only"> (current)</span><span class="caret"</span></a>
{% game_dropdown_list 'aimmo/program' %}
</li>
</li>
<li class="dropdown {% block nav-watch-class %}{% endblock %}"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Watch<span class="caret"></span></a>
{% game_dropdown_list 'aimmo/watch' %}
<li class="dropdown {% block nav-watch-class %}{% endblock %}"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Play<span class="caret"></span></a>
{% game_dropdown_list 'aimmo/play' %}
</li>
<li class="{% block nav-statistics-class %}{% endblock %}"><a href="{% url 'aimmo/statistics' %}">Statistics</a></li>
<li><a href="{% url 'aimmo/logout' %}">Logout</a></li>
Expand Down
4 changes: 0 additions & 4 deletions players/templates/players/dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@
{% endfor %}
<li role="seperator" class="divider"></li>
<li><a href="{% url 'aimmo/new_game' %}">Create a new game</a></li>
<li class="navbar-brand">Levels</li>
{% for i in level_numbers %}
<li><a href="{% url base_url|add:"_level" num=i %}">Level {{ i }}</a></li>
{% endfor %}
</ul>
33 changes: 0 additions & 33 deletions players/templates/players/program.html

This file was deleted.

26 changes: 0 additions & 26 deletions players/templates/players/viewer.html

This file was deleted.

81 changes: 0 additions & 81 deletions players/templates/players/watch.html

This file was deleted.

Loading

0 comments on commit 5dd77ca

Please sign in to comment.