-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from solocommand/updates
Support listing and counting submissions
- Loading branch information
Showing
11 changed files
with
188 additions
and
6 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
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,4 @@ | ||
import Controller from '@ember/controller'; | ||
|
||
export default Controller.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 @@ | ||
query ListSubmissions { | ||
submissions { | ||
id | ||
submitted | ||
companyName | ||
hash | ||
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Route from '@ember/routing/route'; | ||
import { RouteQueryManager } from 'ember-apollo-client'; | ||
|
||
import query from 'cuf/gql/queries/submissions'; | ||
|
||
export default Route.extend(RouteQueryManager, { | ||
model() { | ||
return this.get('apollo').watchQuery({ query, fetchPolicy: 'cache-and-network' }, 'submissions'); | ||
}, | ||
actions: { | ||
loading(transition) { | ||
const controller = this.controllerFor(this.get('routeName')); | ||
controller.set('isLoading', true); | ||
transition.promise.finally(() => setTimeout(() => controller.set('isLoading', false), 250)); | ||
}, | ||
refresh() { | ||
this.refresh(); | ||
return false; | ||
}, | ||
}, | ||
}); |
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,50 @@ | ||
<div class="row mb-5"> | ||
<div class="col"> | ||
<div class="card list-index"> | ||
<div class="card-header"></div> | ||
<div class="card-body"> | ||
</div> | ||
|
||
<div> | ||
<ul class="list-group list-group-flush"> | ||
<li class="list-group-item pt-0"><h5 class="mb-0 text-muted">Total Results: {{model.length}}</h5></li> | ||
{{#each model as |item|}} | ||
|
||
{{#link-to | ||
"display.company.review" | ||
item.hash | ||
item.id | ||
class="list-group-item list-group-item-action flex-column align-items-start" | ||
}} | ||
<div class="d-flex w-100 justify-content-between"> | ||
<div class="d-flex flex-column"> | ||
<h4 class="mb-1">{{ item.companyName }}</h4> | ||
<small>{{ item.name }} <{{ item.email }}></small> | ||
</div> | ||
<div class="d-none d-md-flex flex-column align-items-end text-right"> | ||
<div class="mt-auto small"> | ||
{{entypo-icon "clock"}} | ||
<span title={{moment-format item.submitted "MMM Do, YYYY @ h:mma"}}> | ||
{{moment-from-now item.submitted}} | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
{{/link-to}} | ||
|
||
{{/each}} | ||
</ul> | ||
|
||
<div class="card-footer border-0"> | ||
<button | ||
class="btn btn-block btn-primary" | ||
disabled={{isLoading}} | ||
{{ action (route-action "refresh") }}> | ||
{{entypo-icon "cycle"}} {{#if isLoading}}Loading...{{else}}Check for new submissions{{/if}} | ||
</button> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> |
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
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
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