Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ship Admin Next #868

Merged
merged 4 commits into from
Dec 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 6 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ jobs:
key: |
yarn
{{ checksum "yarn.lock" }}
{{ checksum "client/yarn.lock" }}
{{ checksum "clients/admin_next/yarn.lock" }}
{{ checksum "clients/admin/yarn.lock" }}
{{ checksum "clients/player_app/yarn.lock" }}

# Yarn install dependencies
Expand All @@ -48,14 +47,12 @@ jobs:
key: |
yarn
{{ checksum "yarn.lock" }}
{{ checksum "client/yarn.lock" }}
{{ checksum "clients/admin_next/yarn.lock" }}
{{ checksum "clients/admin/yarn.lock" }}
{{ checksum "clients/player_app/yarn.lock" }}
paths:
- ./node_modules
- ./client/node_modules
- ./clients/admin/node_modules
- ./clients/player_app/node_modules
- ./clients/admin_next/node_modules

# Generate checksum for assets
- type: shell
Expand All @@ -68,7 +65,6 @@ jobs:
assets
{{ checksum "assets-checksum.txt" }}
{{ checksum "Gemfile.lock" }}
{{ checksum "client/yarn.lock" }}

# Compile assets
- run: bundle exec rake assets:precompile
Expand All @@ -79,19 +75,17 @@ jobs:
assets
{{ checksum "assets-checksum.txt" }}
{{ checksum "Gemfile.lock" }}
{{ checksum "client/yarn.lock" }}
paths:
- public/assets
- public/webpack
- tmp/cache/assets

# Build admin_next
# Build admin
- run:
working_directory: clients/admin_next
working_directory: clients/admin
command: yarn build

- run:
working_directory: clients/admin_next
working_directory: clients/admin
command: yarn type-check

# Generate checksum for player_app
Expand Down
14 changes: 4 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ gem 'rails', '5.2.1.1'
gem 'bootsnap'
gem 'puma'
gem 'config'
gem 'jbuilder'
gem 'tzinfo-data'
gem 'active_operation'

Expand Down Expand Up @@ -50,22 +49,17 @@ gem 'rollbar'
# utils
gem 'wicked_pdf'

# asset gems
gem 'react_on_rails', '11.0.9'
gem 'webpacker'
# assets
gem 'sass-rails'
gem 'bootstrap-sass'
gem 'materialize-sass'
gem 'font-awesome-rails'
gem 'uglifier', '~> 3.2.0'
gem 'sassc-rails'
gem 'uglifier'

# javascript gems
gem 'coffee-rails'
# javascript
gem 'jquery-rails'
gem 'js_cookie_rails'
gem 'jstz-rails3-plus'
gem 'twine-rails'
gem 'turbolinks', '~> 5.0.0'

group :production do
gem 'rails_12factor'
Expand Down
54 changes: 8 additions & 46 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@ GEM
xpath (~> 3.1)
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.3)
config (1.7.0)
activesupport (>= 3.0)
Expand Down Expand Up @@ -176,9 +169,6 @@ GEM
hashie (3.5.7)
i18n (1.1.1)
concurrent-ruby (~> 1.0)
jbuilder (2.7.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
jquery-rails (4.3.3)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
Expand Down Expand Up @@ -260,8 +250,6 @@ GEM
rack (2.0.6)
rack-protection (2.0.3)
rack
rack-proxy (0.6.4)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rack-timeout (0.5.1)
Expand Down Expand Up @@ -299,12 +287,6 @@ GEM
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
react_on_rails (11.0.9)
addressable
connection_pool
execjs (~> 2.5)
rails (>= 3.2)
rainbow (~> 3.0)
redis (3.3.5)
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
Expand All @@ -318,16 +300,12 @@ GEM
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sassc (1.12.1)
ffi (~> 1.9.6)
sass (>= 3.3.0)
sassc-rails (1.3.0)
railties (>= 4.0.0)
sass
sassc (~> 1.9)
sprockets (> 2.11)
sprockets-rails
tilt
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
selenium-webdriver (3.13.1)
childprocess (~> 0.5)
rubyzip (~> 1.2)
Expand Down Expand Up @@ -359,12 +337,6 @@ GEM
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.8)
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.1.0)
twine-rails (1.2.1)
coffee-rails
railties
tzinfo (1.2.5)
thread_safe (~> 0.1)
tzinfo-data (1.2018.5)
Expand All @@ -379,10 +351,6 @@ GEM
activemodel (>= 5.0)
bindex (>= 0.4.0)
railties (>= 5.0)
webpacker (3.5.5)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
Expand All @@ -406,7 +374,6 @@ DEPENDENCIES
bundler-audit
byebug (~> 9.0.6)
capybara
coffee-rails
config
date_validator
devise
Expand All @@ -417,7 +384,6 @@ DEPENDENCIES
gibbon
graphiql-rails
graphql
jbuilder
jquery-rails
js_cookie_rails
json-schema (~> 2.6.0)
Expand All @@ -441,21 +407,17 @@ DEPENDENCIES
rails (= 5.2.1.1)
rails_12factor
rainbow
react_on_rails (= 11.0.9)
redis (~> 3.0)
rollbar
sassc-rails
sass-rails
selenium-webdriver
sidekiq
simplecov
sinatra
spring
turbolinks (~> 5.0.0)
twine-rails
tzinfo-data
uglifier (~> 3.2.0)
uglifier
web-console
webpacker
wicked_pdf
wkhtmltopdf-binary-edge (~> 0.12.3.0)
wkhtmltopdf-heroku
Expand Down
23 changes: 4 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Contents
* [**Production Check**](#production-check)
* **Clients**
* [**Admin**](#admin)
* [**Admin Next**](#admin-next)
* [**Player App**](#player-app)
* [**Operating**](#operating)

Expand Down Expand Up @@ -163,34 +162,20 @@ This will build all the clients and start both a web process and worker process

### Admin

[[Deprecated]](https://github.com/kevinhughes27/ultimate-tournament/issues/750)

There should be no new development on the old admin client unless it is to maintain a minor compatibility for the API as the new admin client is developed.

This client does not have a development server (anymore) so you'll need to run `yarn build` after making any changes.

Some of the config here might not make much sense since a) React on Rails is more complicated than it needs to be and b) I removed a bunch of the config since we're not developing on it anymore and I hate clutter.

Note - Any new react component needs to be added to clientRegistration.js and registered for use with React On Rails.

### Admin Next

New Admin client under development. See main issue [here](https://github.com/kevinhughes27/ultimate-tournament/issues/750).

To work on the new admin locally you need to run 2 processes: the webpack development server and the Rails server for the GraphQL API.
To work on the admin locally you need to run 2 processes: the webpack development server and the Rails server for the GraphQL API.

```
# webpack development server
cd clients/admin_next
cd clients/admin
yarn start

# rails server
bundle exec rails server
```

The webpack development server proxies all requests to `no-borders.lvh.me:/3000` which is the default development tournament. The proxy is configurable in the admin_next `package.json`.
The webpack development server proxies all requests to `no-borders.lvh.me:/3000` which is the default development tournament. The proxy is configurable in the admin `package.json`.

Admin Next uses Relay to make queries to the GraphQL API. Relay has a compile step which consumes the entire schema. To dump the schema run this rake task: `bundle exec rake dump_schema`. There is a test to ensure the commited schema file is up to date so this is only neccessary if you make a change to the schema. Relay will recompile if you change a query in the client but the process needs to be restarted if you dump a new version of the schema.
Admin uses Relay to make queries to the GraphQL API. Relay has a compile step which consumes the entire schema. To dump the schema run this rake task: `bundle exec rake dump_schema`. There is a test to ensure the committed schema file is up to date so this is only necessary if you make a change to the schema. Relay will recompile if you change a query in the client but the process needs to be restarted if you dump a new version of the schema.

`yarn start` runs the development server and the relay compiler in parallel. However if relay fails to compile it is easier to debug on its own using `yarn compile-relay`.

Expand Down
Binary file removed app/assets/images/loading-spinner.gif
Binary file not shown.
5 changes: 0 additions & 5 deletions app/assets/javascripts/admin.js

This file was deleted.

1 change: 0 additions & 1 deletion app/assets/javascripts/admin/admin.js

This file was deleted.

10 changes: 0 additions & 10 deletions app/assets/javascripts/admin/initializers/button.coffee

This file was deleted.

8 changes: 0 additions & 8 deletions app/assets/javascripts/admin/initializers/twine.coffee

This file was deleted.

4 changes: 0 additions & 4 deletions app/assets/javascripts/admin/initializers/vibrate.coffee

This file was deleted.

23 changes: 0 additions & 23 deletions app/assets/javascripts/admin/lib/action_with_check.coffee

This file was deleted.

56 changes: 0 additions & 56 deletions app/assets/javascripts/admin/lib/flash.coffee

This file was deleted.

10 changes: 0 additions & 10 deletions app/assets/javascripts/admin/lib/ordinalize.coffee

This file was deleted.

Loading