-
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.
- Loading branch information
1 parent
344326d
commit 4ee667b
Showing
7 changed files
with
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,31 @@ | ||
import Controller from 'cuf/controllers/display/company'; | ||
import { computed } from '@ember/object'; | ||
import { inject } from '@ember/service'; | ||
|
||
import mutation from 'cuf/gql/mutations/complete'; | ||
|
||
export default Controller.extend({ | ||
options: { toolbarButtons: [] }, | ||
apollo: inject(), | ||
body: computed('model.submission.payload.body', function() { | ||
return `<div contenteditable=false>${this.get('model.submission.payload.body')}</div>`; | ||
}), | ||
init() { | ||
this._super(...arguments); | ||
this.set('options', { | ||
toolbarButtons: [] | ||
}); | ||
}, | ||
actions: { | ||
async done() { | ||
try { | ||
const id = this.get('model.submission.id'); | ||
await this.get('apollo').mutate({ mutation, variables: { id } }); | ||
this.get('notify').info('Marked as done!'); | ||
this.set('model.submission.reviewed', true); | ||
} catch (e) { | ||
console.error(e); // eslint-disable-line no-console | ||
this.get('notify').alert('Something went wrong -- please try again!', { closeAfter: null }); | ||
} | ||
}, | ||
}, | ||
}); |
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,7 @@ | ||
mutation Complete($id: String!) { | ||
complete(id: $id) { | ||
result { | ||
ok | ||
} | ||
} | ||
} |
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