-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
128 additions
and
19 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,6 +1,6 @@ | ||
import DS from 'ember-data'; | ||
import EmberSimpleAuthTokenHeaders from 'ember-simple-auth-token/addon/mixins/token-authorizer'; | ||
import EmberSimpleAuthTokenHeaders from 'ember-simple-auth-token/mixins/token-authorizer'; | ||
|
||
export default DS.JSONAPIAdapter.extend(EmberSimpleAuthTokenHeaders, { | ||
namespace: 'api/v1' | ||
namespace: 'api/v1/protected' | ||
}); |
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,8 @@ | ||
import BaseModel from './-base'; | ||
import DS from 'ember-data'; | ||
|
||
export default BaseModel.extend({ | ||
key: DS.attr('string'), | ||
name: DS.attr('string'), | ||
notes: DS.attr('string') | ||
}); |
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,3 @@ | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({}); |
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,10 @@ | ||
import {hash} from 'rsvp'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
model() { | ||
return hash({ | ||
roles: this.get('store').query('role', {sort: 'name'}) | ||
}); | ||
} | ||
}); |
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 |
---|---|---|
@@ -1,10 +1,20 @@ | ||
<section class="my-3"> | ||
<div class="container"> | ||
<h1>Configuration</h1> | ||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur dignissimos, et fuga magnam provident | ||
quibusdam sequi velit veniam? Dolore eveniet excepturi expedita officia placeat. Accusamus deserunt esse iusto | ||
nulla quaerat? | ||
</p> | ||
|
||
<div class="d-flex my-3"> | ||
<h1 class="flex-fill">Configuration</h1> | ||
<div class="align-self-center"> | ||
{{#link-to "protected.index" class="btn btn-outline-secondary"}}Home{{/link-to}} | ||
</div> | ||
</div> | ||
|
||
<div class="list-group"> | ||
{{#link-to "protected.configuration.roles.index" class="list-group-item list-group-item-action"}} | ||
<h5 class="mb-0"> | ||
Roles | ||
</h5> | ||
{{/link-to}} | ||
</div> | ||
|
||
</div> | ||
</section> |
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 @@ | ||
{{outlet}} |
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,27 @@ | ||
<section class="my-3"> | ||
<div class="container"> | ||
|
||
<div class="d-flex my-3"> | ||
<h1 class="flex-fill">Roles</h1> | ||
<div class="align-self-center"> | ||
{{#link-to "protected.configuration.index" class="btn btn-outline-secondary"}} | ||
Configuration | ||
{{/link-to}} | ||
</div> | ||
</div> | ||
|
||
<div class="list-group"> | ||
{{#each model.roles as |role|}} | ||
<div class="list-group-item"> | ||
<h5 class="mb-0"> | ||
{{role.name}} | ||
{{#if role.notes}} | ||
<small class="text-muted">{{role.notes}}</small> | ||
{{/if}} | ||
</h5> | ||
</div> | ||
{{/each}} | ||
</div> | ||
|
||
</div> | ||
</section> |
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,14 +1,27 @@ | ||
<section class="my-3"> | ||
<div class="container"> | ||
<h1>Welcome To The <span class="text-success">Protected</span> Index Page</h1> | ||
<p> | ||
You can only get to the <code>/protected/*</code> paths if you have logged in. | ||
</p> | ||
<p> | ||
{{#link-to "protected.configuration.index"}}Configuration Page{{/link-to}} | ||
</p> | ||
<p> | ||
{{#link-to "index"}}Public Page{{/link-to}} | ||
</p> | ||
|
||
<div class="d-flex my-3"> | ||
<h1 class="flex-fill"><span class="text-success">Protected</span> Path</h1> | ||
<div class="align-self-center"> | ||
<div class="btn-group"> | ||
{{#link-to "protected.configuration.index" class="btn btn-outline-secondary"}}Configuration{{/link-to}} | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div> | ||
<p> | ||
Welcome to the protected index page that you can only get to once you have logged in. Check | ||
your address bar, everything under <code>/protected/*</code> requires authentication. | ||
</p> | ||
<p> | ||
{{#link-to "protected.configuration.index"}}Configuration Page{{/link-to}} | ||
</p> | ||
<p> | ||
{{#link-to "index"}}Public Page{{/link-to}} | ||
</p> | ||
</div> | ||
|
||
</div> | ||
</section> |
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 {module, test} from 'qunit'; | ||
import {setupTest} from 'ember-qunit'; | ||
|
||
module('Unit | Model | role', function (hooks) { | ||
setupTest(hooks); | ||
|
||
// Replace this with your real tests. | ||
test('it exists', function (assert) { | ||
let store = this.owner.lookup('service:store'); | ||
let model = store.createRecord('role', {}); | ||
assert.ok(model); | ||
}); | ||
}); |
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,11 @@ | ||
import {module, test} from 'qunit'; | ||
import {setupTest} from 'ember-qunit'; | ||
|
||
module('Unit | Route | protected/configuration/roles', function (hooks) { | ||
setupTest(hooks); | ||
|
||
test('it exists', function (assert) { | ||
let route = this.owner.lookup('route:protected/configuration/roles'); | ||
assert.ok(route); | ||
}); | ||
}); |
11 changes: 11 additions & 0 deletions
11
tests/unit/routes/protected/configuration/roles/index-test.js
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,11 @@ | ||
import {module, test} from 'qunit'; | ||
import {setupTest} from 'ember-qunit'; | ||
|
||
module('Unit | Route | protected/configuration/roles/index', function (hooks) { | ||
setupTest(hooks); | ||
|
||
test('it exists', function (assert) { | ||
let route = this.owner.lookup('route:protected/configuration/roles/index'); | ||
assert.ok(route); | ||
}); | ||
}); |