Skip to content

Commit

Permalink
Merge pull request #5 from Authmaker/feature/ember-upgrade
Browse files Browse the repository at this point in the history
Ember upgrade & making it work with new Authmaker backend
  • Loading branch information
mansona authored Jun 25, 2018
2 parents 0c78707 + 2614853 commit 230b6f6
Show file tree
Hide file tree
Showing 51 changed files with 12,706 additions and 456 deletions.
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

14 changes: 0 additions & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,8 @@ insert_final_newline = true
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false
indent_style = space
indent_size = 2

[*.css]
indent_style = space
indent_size = 2

[*.html]
indent_style = space
indent_size = 2

[*.{diff,md}]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/blueprints/*/files/**/*.js
39 changes: 39 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {
},
overrides: [
// node files
{
files: [
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
}
}
]
};
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
Expand All @@ -13,5 +13,11 @@
/connect.lock
/coverage/*
/libpeerconnection.log
npm-debug.log
npm-debug.log*
yarn-error.log
testem.log

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
32 changes: 0 additions & 32 deletions .jshintrc

This file was deleted.

31 changes: 12 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
---
language: node_js
node_js:
- "4.2"

env:
- CXX=g++-4.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- 8

sudo: false
dist: trusty

addons:
chrome: stable

cache:
directories:
- node_modules
- $HOME/.npm

env:
global:
# See https://git.io/vdao3 for details.
- JOBS=1

before_install:
- npm config set spin false
- npm install -g bower
- bower --version
- npm install phantomjs-prebuilt
- phantomjs --version

install:
- bower install
- npm install

script:
- npm run lint:js
- npm test
41 changes: 8 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,27 @@
# authmaker-scopes-app

This README outlines the details of collaborating on this Ember application.
A short introduction of this app could easily go here.

## Prerequisites

You will need the following things properly installed on your computer.

* [Git](http://git-scm.com/)
* [Node.js](http://nodejs.org/) (with NPM)
* [Bower](http://bower.io/)
* [Ember CLI](http://www.ember-cli.com/)
* [PhantomJS](http://phantomjs.org/)

## Installation

* `git clone <repository-url>` this repository
* change into the new directory
* `npm install`
* `bower install`
This app powers the plan choice and subscription aspects of [Authmaker](https://authmaker.com). This app is consumed by the core Authmaker server as an NPM repository and is not intended to be run on its own.

## Running / Development

* `ember server`
* `npm start`
* Visit your app at [http://localhost:4200](http://localhost:4200).

### Code Generators

Make use of the many generators for code, try `ember help generate` for more details
* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).

### Running Tests

* `ember test`
* `ember test --server`

### Building

* `ember build` (development)
* `ember build --environment production` (production)

### Deploying
### Linting

Specify what it takes to deploy your app.
* `npm run lint:js`
* `npm run lint:js -- --fix`

## Further Reading / Useful Links

* [ember.js](http://emberjs.com/)
* [ember-cli](http://www.ember-cli.com/)
* [ember.js](https://emberjs.com/)
* [ember-cli](https://ember-cli.com/)
* Development Browser Extensions
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
4 changes: 2 additions & 2 deletions app/adapters/application.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import DS from 'ember-data';

export default DS.RESTAdapter.extend({
namespace: 'api'
export default DS.JSONAPIAdapter.extend({
namespace: 'v1'
});
12 changes: 4 additions & 8 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import Ember from 'ember';
import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
import Application from '@ember/application';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

let App;

Ember.MODEL_FACTORY_INJECTIONS = true;

App = Ember.Application.extend({
const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
Expand Down
20 changes: 10 additions & 10 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

{{content-for 'head'}}
{{content-for "head"}}

<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/authmaker-scopes-app.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/@authmaker/scopes-app.css">


{{content-for 'head-footer'}}
{{content-for "head-footer"}}
</head>
<body class="narrow fill-grey">
{{content-for 'body'}}
<body>
{{content-for "body"}}

<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/@authmaker/scopes-app.js"></script>

<script src="assets/vendor.js"></script>
<script src="assets/authmaker-scopes-app.js"></script>
{{content-for 'body-footer'}}
{{content-for "body-footer"}}
</body>
</html>
6 changes: 3 additions & 3 deletions app/pods/card/model.js → app/models/card.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { computed } from '@ember/object';
import DS from 'ember-data';
import Ember from 'ember';

var attr = DS.attr;

Expand All @@ -11,7 +11,7 @@ export default DS.Model.extend({
last4: attr('string'),
exp_month: attr('string'),
exp_year: attr('string'),
logo: Ember.computed('brand', function(){
return this.get('brand').toLowerCase();
logo: computed('brand', function(){
return this.brand.toLowerCase();
})
});
File renamed without changes.
2 changes: 1 addition & 1 deletion app/pods/plan/model.js → app/models/plan.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default DS.Model.extend({
stripePlan: DS.belongsTo('stripe-plan', {
async: true
}),
scopes: DS.hasMany('scopes', {
permissions: DS.hasMany('permission', {
async: true
}),
lowValue: attr('boolean'),
Expand Down
6 changes: 3 additions & 3 deletions app/pods/stripe-plan/model.js → app/models/stripe-plan.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { computed } from '@ember/object';
import DS from 'ember-data';
import Ember from 'ember';

var attr = DS.attr;

Expand All @@ -10,7 +10,7 @@ export default DS.Model.extend({
trial_period_days: attr('string'),
interval: attr('number'),
interval_count: attr('number'),
computedAmount: Ember.computed('amount', function(){
return this.get('amount') / 100;
computedAmount: computed('amount', function(){
return this.amount / 100;
})
});
4 changes: 2 additions & 2 deletions app/pods/application/controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';
import Controller from '@ember/controller';

export default Ember.Controller.extend({
export default Controller.extend({

queryParams: ['response_type', 'display', 'client_id', 'redirect_uri', 'state', 'previous_location'],

Expand Down
7 changes: 4 additions & 3 deletions app/pods/application/route.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import Ember from 'ember';
import $ from 'jquery';
import Route from '@ember/routing/route';

export default Ember.Route.extend({
export default Route.extend({
model: function(){
return Ember.$.getJSON('/settings/scopes');
return $.getJSON('/settings/scopes');
},

actions: {
Expand Down
4 changes: 2 additions & 2 deletions app/pods/authorize/route.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';
import Route from '@ember/routing/route';

export default Ember.Route.extend({
export default Route.extend({
redirect: function(model, transition) {
this.transitionTo('plans', {queryParams: transition.queryParams});
}
Expand Down
13 changes: 7 additions & 6 deletions app/pods/components/plan-item/component.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import Ember from 'ember';
import { computed } from '@ember/object';
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({

classNames: ['frame', 'flex-auto', 'flex', 'flex-column'],
classNames: ['frame', 'flex-auto', 'flex', 'flex-column'],

scopes: Ember.computed('plan.scopes[email protected]', function(){
return this.get('plan.scopes').filter((scope) => {
if(this.get('showPaidOnly')){
scopes: computed('plan.permissions[email protected]', function(){
return this.get('plan.permissions').filter((scope) => {
if(this.showPaidOnly){
return scope.get('paidFor');
}
return true; // default show all
Expand Down
5 changes: 0 additions & 5 deletions app/pods/plan/serializer.js

This file was deleted.

4 changes: 2 additions & 2 deletions app/pods/plans/controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Ember from 'ember';
import Controller from '@ember/controller';

export default Ember.Controller.extend({
export default Controller.extend({
queryParams: ['scope'],
});
Loading

0 comments on commit 230b6f6

Please sign in to comment.