diff --git a/app/app/controllers/display/company/review.js b/app/app/controllers/display/company/review.js
index 3759de5..48d95ae 100644
--- a/app/app/controllers/display/company/review.js
+++ b/app/app/controllers/display/company/review.js
@@ -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 `
${this.get('model.submission.payload.body')}
`;
}),
+ 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 });
+ }
+ },
+ },
});
diff --git a/app/app/gql/mutations/complete.graphql b/app/app/gql/mutations/complete.graphql
new file mode 100644
index 0000000..f02d47a
--- /dev/null
+++ b/app/app/gql/mutations/complete.graphql
@@ -0,0 +1,7 @@
+mutation Complete($id: String!) {
+ complete(id: $id) {
+ result {
+ ok
+ }
+ }
+}
diff --git a/app/app/styles/app.scss b/app/app/styles/app.scss
index aedac15..4a21d6b 100644
--- a/app/app/styles/app.scss
+++ b/app/app/styles/app.scss
@@ -43,3 +43,9 @@ body.transitioning {
padding: 1em;
min-height: 8em;
}
+
+.field-modified {
+ background-color: rgba(24, 188, 156, 0.1) !important;
+ border: 1px solid rgb(24, 188, 156);
+ border-right: none;
+}
diff --git a/app/app/templates/display/company/review.hbs b/app/app/templates/display/company/review.hbs
index ceff3a8..2aa03ea 100644
--- a/app/app/templates/display/company/review.hbs
+++ b/app/app/templates/display/company/review.hbs
@@ -6,7 +6,15 @@
When you are finished making changes, click the "Done" button.
-
+ {{#if model.submission.reviewed}}
+
+ {{else}}
+
+ {{/if}}
diff --git a/app/app/templates/display/company/review/fields.hbs b/app/app/templates/display/company/review/fields.hbs
index 4fa4862..4d2750a 100644
--- a/app/app/templates/display/company/review/fields.hbs
+++ b/app/app/templates/display/company/review/fields.hbs
@@ -6,11 +6,11 @@