diff --git a/app/components/icons/close.js b/app/components/icons/close.js
new file mode 100644
index 0000000..a956cb2
--- /dev/null
+++ b/app/components/icons/close.js
@@ -0,0 +1 @@
+export { Close as default } from 'ember-mdi';
diff --git a/app/components/icons/loading.js b/app/components/icons/loading.js
index 2ff4aa1..5642ac5 100644
--- a/app/components/icons/loading.js
+++ b/app/components/icons/loading.js
@@ -1 +1 @@
-export { Heart as default } from 'ember-mdi';
+export { Loading as default } from 'ember-mdi';
diff --git a/app/components/toast.hbs b/app/components/toast.hbs
new file mode 100644
index 0000000..5888e94
--- /dev/null
+++ b/app/components/toast.hbs
@@ -0,0 +1,25 @@
+{{#in-element this.toasts.destinationElement}}
+
+
+
+
+
+
+ {{@text}}
+
+
+
+
+{{/in-element}}
diff --git a/app/components/toast.js b/app/components/toast.js
new file mode 100644
index 0000000..08ffc1d
--- /dev/null
+++ b/app/components/toast.js
@@ -0,0 +1,6 @@
+import Component from '@glimmer/component';
+import { inject as service } from '@ember/service';
+
+export default class ToastComponent extends Component {
+ @service toasts;
+}
diff --git a/app/controllers/admin/indexes/item/edit.js b/app/controllers/admin/indexes/item/edit.js
index b19a38a..c4bde3e 100644
--- a/app/controllers/admin/indexes/item/edit.js
+++ b/app/controllers/admin/indexes/item/edit.js
@@ -4,6 +4,7 @@ import { inject as service } from '@ember/service';
export default class AdminIndexesItemEditController extends Controller {
@service router;
+ @service toasts;
@action
save(event) {
@@ -13,6 +14,8 @@ export default class AdminIndexesItemEditController extends Controller {
const data = Object.fromEntries(formData.entries());
this.model.save(data);
+
+ this.toasts.add('Hello World!');
}
@action
diff --git a/app/services/toasts.js b/app/services/toasts.js
new file mode 100644
index 0000000..ec73718
--- /dev/null
+++ b/app/services/toasts.js
@@ -0,0 +1,18 @@
+import Service from '@ember/service';
+import { tracked } from '@glimmer/tracking';
+
+export default class ToastsService extends Service {
+ @tracked plate = [];
+
+ constructor() {
+ super();
+
+ this.destinationElement = document.createElement('div');
+
+ document.body.appendChild(this.destinationElement);
+ }
+
+ add() {
+
+ }
+}
diff --git a/app/templates/admin/indexes/item/edit.hbs b/app/templates/admin/indexes/item/edit.hbs
index 5c088c9..2e044ef 100644
--- a/app/templates/admin/indexes/item/edit.hbs
+++ b/app/templates/admin/indexes/item/edit.hbs
@@ -1,4 +1,6 @@
-
+{{#if @model.isNew}}
+
+{{/if}}
+
+
diff --git a/tests/integration/components/toast-test.js b/tests/integration/components/toast-test.js
new file mode 100644
index 0000000..b13a5cd
--- /dev/null
+++ b/tests/integration/components/toast-test.js
@@ -0,0 +1,26 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from 'meiliadmin/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+
+module('Integration | Component | toast', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs``);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+
+ template block text
+
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});
diff --git a/tests/unit/services/toasts-test.js b/tests/unit/services/toasts-test.js
new file mode 100644
index 0000000..ef47b31
--- /dev/null
+++ b/tests/unit/services/toasts-test.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from 'meiliadmin/tests/helpers';
+
+module('Unit | Service | toasts', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let service = this.owner.lookup('service:toasts');
+ assert.ok(service);
+ });
+});