From 8c75e56e2c19a88f89e83fa9a3e0c7f7c1719f83 Mon Sep 17 00:00:00 2001
From: Eugen Ciur <eugen@papermerge.com>
Date: Fri, 1 Oct 2021 21:11:05 +0200
Subject: [PATCH] tags view

---
 app/components/tag/edit.hbs      |  31 ---
 app/components/tag/new.hbs       |  28 ++-
 app/components/tag/new.js        |  29 ++-
 app/components/tag/table_row.hbs |  45 ++++
 app/components/tag/table_row.js  |  23 ++
 app/helpers/default_string.js    |  13 ++
 app/templates/tags/edit.hbs      |   1 -
 app/templates/tags/index.hbs     |  21 +-
 package-lock.json                | 380 +------------------------------
 package.json                     |   1 +
 10 files changed, 143 insertions(+), 429 deletions(-)
 delete mode 100644 app/components/tag/edit.hbs
 create mode 100644 app/components/tag/table_row.hbs
 create mode 100644 app/components/tag/table_row.js
 create mode 100644 app/helpers/default_string.js
 delete mode 100644 app/templates/tags/edit.hbs

diff --git a/app/components/tag/edit.hbs b/app/components/tag/edit.hbs
deleted file mode 100644
index 9c945e6..0000000
--- a/app/components/tag/edit.hbs
+++ /dev/null
@@ -1,31 +0,0 @@
-<h1>Edit {{@model.name}} Tag</h1>
-
-<form>
-    <div class="mb-3">
-        <label for="tag" class="form-label">Name</label>
-        <Input id="tag-name" @type="text" @value="{{@model.name}}" />
-    </div>
-    <div class="mb-3">
-        <Input id="tag-pinned" @type="checkbox" @checked={{true}} />
-        <label for="tag" class="form-label">Pinned?</label>
-        <p>
-            <small class="form-text text-muted">
-                Pinned tag will be displayed under Documents menu.
-                It serves as shortcut to quickly filter folders/documents
-                associated with this tag
-            </small>
-        </p>
-    </div>
-    <div class="mb-3">
-        <label for="tag" class="form-label">Foreground Color</label>
-        <Input id="tag-fg-color" @type="color" />
-    </div>
-    <div class="mb-3">
-        <label for="tag" class="form-label">Background Color</label>
-        <Input id="tag-bg-color" @type="color" />
-    </div>
-    <div class="mb-3">
-        <label for="tag" class="form-label">Description</label>
-        <Input id="tag-description" @type="text" />
-    </div>
-</form>
\ No newline at end of file
diff --git a/app/components/tag/new.hbs b/app/components/tag/new.hbs
index afbb3cf..1728342 100644
--- a/app/components/tag/new.hbs
+++ b/app/components/tag/new.hbs
@@ -5,9 +5,9 @@
 {{#if this.form_visible}}
     <form>
         <div class="row my-2">
-            <div class="col-md-1">
+            <div class="col-md-2">
                 <Tag::Item
-                    @name={{this.new_name}}
+                    @name={{default_string this.new_name "preview"}}
                     @fg_color={{this.new_fg_color}}
                     @bg_color={{this.new_bg_color}} />
             </div>
@@ -43,24 +43,34 @@
         </div>
         <div class="row mb-2">
             <div class="col">
-                <Input @type="checkbox" @checked={{this.pinned}} class="form-check-input" id="is_pinned" />
+                <Input @type="checkbox" @checked={{this.new_pinned}} class="form-check-input" id="is_pinned" />
                 <label class="form-check-label" for="is_pinned">Is Pinned?</label>
             </div>
         </div>
         <div class="row mb-2">
             <div class="col">
-                <button
-                    type="button"
-                    {{on "click" this.onCreate}}
-                    class="btn btn-success">
-                    Create Tag
-                </button>
                 <button
                     type="button"
                     {{on "click" this.onCancel}}
                     class="btn btn-secondary">
                     Cancel
                 </button>
+                {{#if this.new_name }}
+                    <button
+                        type="button"
+                        {{on "click" this.onCreate}}
+                        class="btn btn-success">
+                        Create Tag
+                    </button>
+                {{else}}
+                    <button
+                        type="button"
+                        {{on "click" this.onCreate}}
+                        disabled
+                        class="btn btn-success">
+                        Create Tag
+                    </button>
+                {{/if}}
             </div>
         </div>
     </form>
diff --git a/app/components/tag/new.js b/app/components/tag/new.js
index a5426de..40dcca0 100644
--- a/app/components/tag/new.js
+++ b/app/components/tag/new.js
@@ -4,6 +4,31 @@ import { tracked } from '@glimmer/tracking';
 import { inject as service } from '@ember/service';
 
 
+const COLORS = [
+  "#ff0000",
+  "#0000ff",
+  "#006684",
+  "#661200",
+  "#ce5c00",
+  "#5c3566",
+  "#4e9a06"
+]
+
+function _random_color() {
+  /*
+    Returns a random color string from `COLORS` array.
+
+    Color strings are RGB strings like for
+    example "#ff0000", "#ff7892", "#ffffff"
+  */
+  let index = Math.floor(
+    Math.random() * COLORS.length
+  );
+
+  return COLORS[index];
+}
+
+
 export default class NewTagComponent extends Component {
   /*
   Component to create new tag.
@@ -19,6 +44,8 @@ export default class NewTagComponent extends Component {
   @tracked new_name = "";
   @tracked new_description = "";
   @tracked new_pinned = false;
+  @tracked new_fg_color = "#ffffff";
+  @tracked new_bg_color = _random_color();
 
   @action
   onToggleNew() {
@@ -50,7 +77,7 @@ export default class NewTagComponent extends Component {
     this.new_name = "";
     this.new_description = "";
     this.new_fg_color = "#ffffff";
-    this.new_bg_color = "#ff0000";
+    this.new_bg_color = _random_color();
     this.new_pinned = false;
     this.form_visible = false;
   }
diff --git a/app/components/tag/table_row.hbs b/app/components/tag/table_row.hbs
new file mode 100644
index 0000000..8f35f6a
--- /dev/null
+++ b/app/components/tag/table_row.hbs
@@ -0,0 +1,45 @@
+{{! `eq` helper is provided by ember-truth-helpers addon !}}
+{{#if  (eq this.edit_mode_id @tag.id)}}
+  {{! inline edit }}
+  <td>
+      <Tag::Item
+        @name={{@tag.name}}
+        @fg_color={{@tag.fg_color}}
+        @bg_color={{@tag.bg_color}} />
+
+      <label for="name" class="form-label">Name</label>
+      <Input
+        id="name"
+        @type="text"
+        @value={{@tag.name}}
+        class="form-control"
+      />
+  </td>
+  <td>
+  </td>
+  <td>{{tag.description}}</td>
+  <td>
+    <button class="btn btn-secondary" {{on "click" (fn this.onCancel)}}>
+    Cancel
+    </button>
+  </td>
+{{else}}
+  <td>
+    <Tag::Item
+        @name={{@tag.name}}
+        @fg_color={{@tag.fg_color}}
+        @bg_color={{@tag.bg_color}} />
+  </td>
+  <td>
+    <Common::Boolean @value={{@tag.pinned}} />
+  </td>
+  <td>{{@tag.description}}</td>
+  <td>
+    <button class="btn btn-link" {{on "click" (fn this.onEdit @tag)}}>
+    Edit
+    </button>
+    <button class="btn btn-link" {{on "click" (fn this.onRemove @tag)}}>
+    Remove
+    </button>
+  </td>
+{{/if}}
\ No newline at end of file
diff --git a/app/components/tag/table_row.js b/app/components/tag/table_row.js
new file mode 100644
index 0000000..886a4c3
--- /dev/null
+++ b/app/components/tag/table_row.js
@@ -0,0 +1,23 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+
+
+export default class TableRowComponent extends Component {
+  @tracked edit_mode_id = 0;
+
+  @action
+  async onRemove(tag) {
+    await tag.destroyRecord();
+  }
+
+  @action
+  onEdit(tag) {
+    this.edit_mode_id = tag.id;
+  }
+
+  @action
+  onCancel() {
+    this.edit_mode_id = undefined;
+  }
+}
\ No newline at end of file
diff --git a/app/helpers/default_string.js b/app/helpers/default_string.js
new file mode 100644
index 0000000..a0c3ed6
--- /dev/null
+++ b/app/helpers/default_string.js
@@ -0,0 +1,13 @@
+import { helper } from '@ember/component/helper';
+
+function default_string(args) {
+  let [string, default_value] = args;
+
+  if (string){
+    return string;
+  }
+
+  return default_value;
+}
+
+export default helper(default_string);
\ No newline at end of file
diff --git a/app/templates/tags/edit.hbs b/app/templates/tags/edit.hbs
deleted file mode 100644
index f8c16c7..0000000
--- a/app/templates/tags/edit.hbs
+++ /dev/null
@@ -1 +0,0 @@
-<Tag::Edit @model={{@model}}/>
\ No newline at end of file
diff --git a/app/templates/tags/index.hbs b/app/templates/tags/index.hbs
index 043c1e6..4791d1c 100644
--- a/app/templates/tags/index.hbs
+++ b/app/templates/tags/index.hbs
@@ -1,32 +1,21 @@
-<h1>Tags Index</h1>
-
-<Tag::New />
+<p class="my-2">
+  <Tag::New />
+</p>
 
 <div class="tags">
-
   <table class="table table-striped align-middle">
     <thead>
       <tr class="text-uppercase">
         <th class="border-top-0">Tag Name</th>
         <th class="border-top-0">Pinned?</th>
         <th class="border-top-0">Description</th>
+        <th class="border-top-0">Action</th>
       </tr>
     </thead>
     <tbody>
       {{#each @model as |tag|}}
         <tr>
-          <td>
-            <LinkTo @route="tags.edit" @model={{tag.id}} class="tag-link">
-              <Tag::Item
-                  @name={{tag.name}}
-                  @fg_color={{tag.fg_color}}
-                  @bg_color={{tag.bg_color}} />
-            </LinkTo>
-          </td>
-          <td>
-            <Common::Boolean @value={{tag.pinned}} />
-          </td>
-          <td>{{tag.description}}</td>
+          <Tag::TableRow @tag={{tag}} />
         </tr>
       {{/each}}
     </tbody>
diff --git a/package-lock.json b/package-lock.json
index eb3df22..039fd3e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2638,85 +2638,6 @@
         "semver": "^7.3.2"
       }
     },
-    "@embroider/shared-internals": {
-      "version": "0.40.0",
-      "resolved": "https://registry.npmjs.org/@embroider/shared-internals/-/shared-internals-0.40.0.tgz",
-      "integrity": "sha512-Ovr/i0Qgn6W6jdGXMvYJKlRoRpyBY9uhYozDSFKlBjeEmRJ0Plp7OST41+O5Td6Pqp+Rv2jVSnGzhA/MpC++NQ==",
-      "dev": true,
-      "requires": {
-        "ember-rfc176-data": "^0.3.17",
-        "fs-extra": "^7.0.1",
-        "lodash": "^4.17.10",
-        "pkg-up": "^3.1.0",
-        "resolve-package-path": "^1.2.2",
-        "semver": "^7.3.2",
-        "typescript-memoize": "^1.0.0-alpha.3"
-      },
-      "dependencies": {
-        "find-up": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
-          "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
-          "dev": true,
-          "requires": {
-            "locate-path": "^3.0.0"
-          }
-        },
-        "locate-path": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
-          "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
-          "dev": true,
-          "requires": {
-            "p-locate": "^3.0.0",
-            "path-exists": "^3.0.0"
-          }
-        },
-        "p-limit": {
-          "version": "2.3.0",
-          "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
-          "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
-          "dev": true,
-          "requires": {
-            "p-try": "^2.0.0"
-          }
-        },
-        "p-locate": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
-          "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
-          "dev": true,
-          "requires": {
-            "p-limit": "^2.0.0"
-          }
-        },
-        "p-try": {
-          "version": "2.2.0",
-          "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
-          "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
-          "dev": true
-        },
-        "pkg-up": {
-          "version": "3.1.0",
-          "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz",
-          "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==",
-          "dev": true,
-          "requires": {
-            "find-up": "^3.0.0"
-          }
-        },
-        "resolve-package-path": {
-          "version": "1.2.7",
-          "resolved": "https://registry.npmjs.org/resolve-package-path/-/resolve-package-path-1.2.7.tgz",
-          "integrity": "sha512-fVEKHGeK85bGbVFuwO9o1aU0n3vqQGrezPc51JGu9UTXpFQfWq5qCeKxyaRUSvephs+06c5j5rPq/dzHGEo8+Q==",
-          "dev": true,
-          "requires": {
-            "path-root": "^0.1.1",
-            "resolve": "^1.10.0"
-          }
-        }
-      }
-    },
     "@eslint/eslintrc": {
       "version": "0.4.3",
       "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz",
@@ -3051,12 +2972,6 @@
       "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==",
       "dev": true
     },
-    "@miragejs/pretender-node-polyfill": {
-      "version": "0.1.2",
-      "resolved": "https://registry.npmjs.org/@miragejs/pretender-node-polyfill/-/pretender-node-polyfill-0.1.2.tgz",
-      "integrity": "sha512-M/BexG/p05C5lFfMunxo/QcgIJnMT2vDVCd00wNqK2ImZONIlEETZwWJu1QtLxtmYlSHlCFl3JNzp0tLe7OJ5g==",
-      "dev": true
-    },
     "@nodelib/fs.scandir": {
       "version": "2.1.5",
       "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@@ -9458,71 +9373,6 @@
       "integrity": "sha1-IMtop5D+D94kiN39jvu332/nZvI=",
       "dev": true
     },
-    "ember-cli-mirage": {
-      "version": "2.2.0",
-      "resolved": "https://registry.npmjs.org/ember-cli-mirage/-/ember-cli-mirage-2.2.0.tgz",
-      "integrity": "sha512-w+DrFEGuuLyHzJwOVkG0yOLvgwYezaMBNvvZJQzQkv1W3CsdhllkY1ZauYgL0dhrmYJwRFtp8DnaPQwBTDCSfA==",
-      "dev": true,
-      "requires": {
-        "@embroider/macros": "^0.40.0",
-        "broccoli-file-creator": "^2.1.1",
-        "broccoli-funnel": "^3.0.3",
-        "broccoli-merge-trees": "^4.2.0",
-        "ember-auto-import": "^1.2.19",
-        "ember-cli-babel": "^7.5.0",
-        "ember-get-config": "^0.2.4 || ^0.3.0",
-        "ember-inflector": "^2.0.0 || ^3.0.0 || ^4.0.0",
-        "lodash-es": "^4.17.11",
-        "miragejs": "^0.1.31"
-      },
-      "dependencies": {
-        "@embroider/macros": {
-          "version": "0.40.0",
-          "resolved": "https://registry.npmjs.org/@embroider/macros/-/macros-0.40.0.tgz",
-          "integrity": "sha512-ygChvFoebSi/N8b+A+XFncd454gLYBYHancrtY0AE/h6Y1HouoqQvji/IfaLisGoeuwUWuI9rCBv97COweu/rA==",
-          "dev": true,
-          "requires": {
-            "@embroider/shared-internals": "0.40.0",
-            "assert-never": "^1.1.0",
-            "ember-cli-babel": "^7.23.0",
-            "lodash": "^4.17.10",
-            "resolve": "^1.8.1",
-            "semver": "^7.3.2"
-          }
-        },
-        "broccoli-merge-trees": {
-          "version": "4.2.0",
-          "resolved": "https://registry.npmjs.org/broccoli-merge-trees/-/broccoli-merge-trees-4.2.0.tgz",
-          "integrity": "sha512-nTrQe5AQtCrW4enLRvbD/vTLHqyW2tz+vsLXQe4IEaUhepuMGVKJJr+I8n34Vu6fPjmPLwTjzNC8izMIDMtHPw==",
-          "dev": true,
-          "requires": {
-            "broccoli-plugin": "^4.0.2",
-            "merge-trees": "^2.0.0"
-          }
-        },
-        "broccoli-plugin": {
-          "version": "4.0.7",
-          "resolved": "https://registry.npmjs.org/broccoli-plugin/-/broccoli-plugin-4.0.7.tgz",
-          "integrity": "sha512-a4zUsWtA1uns1K7p9rExYVYG99rdKeGRymW0qOCNkvDPHQxVi3yVyJHhQbM3EZwdt2E0mnhr5e0c/bPpJ7p3Wg==",
-          "dev": true,
-          "requires": {
-            "broccoli-node-api": "^1.7.0",
-            "broccoli-output-wrapper": "^3.2.5",
-            "fs-merger": "^3.2.1",
-            "promise-map-series": "^0.3.0",
-            "quick-temp": "^0.1.8",
-            "rimraf": "^3.0.2",
-            "symlink-or-copy": "^1.3.1"
-          }
-        },
-        "promise-map-series": {
-          "version": "0.3.0",
-          "resolved": "https://registry.npmjs.org/promise-map-series/-/promise-map-series-0.3.0.tgz",
-          "integrity": "sha512-3npG2NGhTc8BWBolLLf8l/92OxMGaRLbqvIh9wjCHhDXNvk4zsxaTaCpiCunW09qWPrN2zeNSNwRLVBrQQtutA==",
-          "dev": true
-        }
-      }
-    },
     "ember-cli-normalize-entity-name": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/ember-cli-normalize-entity-name/-/ember-cli-normalize-entity-name-1.0.0.tgz",
@@ -10372,37 +10222,6 @@
         }
       }
     },
-    "ember-get-config": {
-      "version": "0.3.0",
-      "resolved": "https://registry.npmjs.org/ember-get-config/-/ember-get-config-0.3.0.tgz",
-      "integrity": "sha512-0e2pKzwW5lBZ4oJnvu9qHOht4sP1MWz/m3hyz8kpSoMdrlZVf62LDKZ6qfKgy8drcv5YhCMYE6QV7MhnqlrzEQ==",
-      "dev": true,
-      "requires": {
-        "broccoli-file-creator": "^1.1.1",
-        "ember-cli-babel": "^7.0.0"
-      },
-      "dependencies": {
-        "broccoli-file-creator": {
-          "version": "1.2.0",
-          "resolved": "https://registry.npmjs.org/broccoli-file-creator/-/broccoli-file-creator-1.2.0.tgz",
-          "integrity": "sha512-l9zthHg6bAtnOfRr/ieZ1srRQEsufMZID7xGYRW3aBDv3u/3Eux+Iawl10tAGYE5pL9YB4n5X4vxkp6iNOoZ9g==",
-          "dev": true,
-          "requires": {
-            "broccoli-plugin": "^1.1.0",
-            "mkdirp": "^0.5.1"
-          }
-        },
-        "mkdirp": {
-          "version": "0.5.5",
-          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
-          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
-          "dev": true,
-          "requires": {
-            "minimist": "^1.2.5"
-          }
-        }
-      }
-    },
     "ember-inflector": {
       "version": "4.0.2",
       "resolved": "https://registry.npmjs.org/ember-inflector/-/ember-inflector-4.0.2.tgz",
@@ -11355,6 +11174,15 @@
         }
       }
     },
+    "ember-truth-helpers": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/ember-truth-helpers/-/ember-truth-helpers-3.0.0.tgz",
+      "integrity": "sha512-hPKG9QqruAELh0li5xaiLZtr88ioWYxWCXisAWHWE0qCP4a2hgtuMzKUPpiTCkltvKjuqpzTZCU4VhQ+IlRmew==",
+      "dev": true,
+      "requires": {
+        "ember-cli-babel": "^7.22.1"
+      }
+    },
     "ember-welcome-page": {
       "version": "4.1.0",
       "resolved": "https://registry.npmjs.org/ember-welcome-page/-/ember-welcome-page-4.1.0.tgz",
@@ -12212,18 +12040,6 @@
       "integrity": "sha512-AEo4zm+TenK7zQorGK1f9mJ8L14hnTDi2ZQPR+Mub1NX8zimka1mXpV5LpH8x9HoUmFSHZCfLHqWvp0Y4FxxzQ==",
       "dev": true
     },
-    "fake-xml-http-request": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/fake-xml-http-request/-/fake-xml-http-request-2.1.2.tgz",
-      "integrity": "sha512-HaFMBi7r+oEC9iJNpc3bvcW7Z7iLmM26hPDmlb0mFwyANSsOQAtJxbdWsXITKOzZUyMYK0zYCv3h5yDj9TsiXg==",
-      "dev": true
-    },
-    "faker": {
-      "version": "5.5.3",
-      "resolved": "https://registry.npmjs.org/faker/-/faker-5.5.3.tgz",
-      "integrity": "sha512-wLTv2a28wjUyWkbnX7u/ABZBkUkIF2fCd73V6P2oFqEGEktDfzWx4UxrSqtPRw0xPRAcjeAOIiJWqZm3pP4u3g==",
-      "dev": true
-    },
     "fast-deep-equal": {
       "version": "3.1.3",
       "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
@@ -13668,12 +13484,6 @@
       "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==",
       "dev": true
     },
-    "inflected": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/inflected/-/inflected-2.1.0.tgz",
-      "integrity": "sha512-hAEKNxvHf2Iq3H60oMBHkB4wl5jn3TPF3+fXek/sRwAB5gP9xWs4r7aweSF95f99HFoz69pnZTcu8f0SIHV18w==",
-      "dev": true
-    },
     "inflection": {
       "version": "1.13.1",
       "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.1.tgz",
@@ -14405,12 +14215,6 @@
       "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
       "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
     },
-    "lodash-es": {
-      "version": "4.17.21",
-      "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz",
-      "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==",
-      "dev": true
-    },
     "lodash._baseassign": {
       "version": "3.2.0",
       "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz",
@@ -14489,12 +14293,6 @@
       "integrity": "sha1-uo31+4QesKPoBEIysOJjqNxqKKI=",
       "dev": true
     },
-    "lodash.camelcase": {
-      "version": "4.3.0",
-      "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
-      "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=",
-      "dev": true
-    },
     "lodash.castarray": {
       "version": "4.4.0",
       "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz",
@@ -14507,12 +14305,6 @@
       "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=",
       "dev": true
     },
-    "lodash.compact": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/lodash.compact/-/lodash.compact-3.0.1.tgz",
-      "integrity": "sha1-VAzjg3dFl1gHRx4WtKK6IeclbKU=",
-      "dev": true
-    },
     "lodash.debounce": {
       "version": "4.0.8",
       "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
@@ -14546,30 +14338,6 @@
       "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=",
       "dev": true
     },
-    "lodash.forin": {
-      "version": "4.4.0",
-      "resolved": "https://registry.npmjs.org/lodash.forin/-/lodash.forin-4.4.0.tgz",
-      "integrity": "sha1-XT8grlZAEfvog4H32YlJyclRlzE=",
-      "dev": true
-    },
-    "lodash.get": {
-      "version": "4.4.2",
-      "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
-      "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=",
-      "dev": true
-    },
-    "lodash.has": {
-      "version": "4.5.2",
-      "resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz",
-      "integrity": "sha1-0Z9NwQlQWMzL4rDN9O4P5Ko3yGI=",
-      "dev": true
-    },
-    "lodash.invokemap": {
-      "version": "4.6.0",
-      "resolved": "https://registry.npmjs.org/lodash.invokemap/-/lodash.invokemap-4.6.0.tgz",
-      "integrity": "sha1-F0jNpdiw74NpxOs+xUwh/rofLWI=",
-      "dev": true
-    },
     "lodash.isarguments": {
       "version": "3.1.0",
       "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz",
@@ -14582,36 +14350,6 @@
       "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=",
       "dev": true
     },
-    "lodash.isempty": {
-      "version": "4.4.0",
-      "resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz",
-      "integrity": "sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=",
-      "dev": true
-    },
-    "lodash.isequal": {
-      "version": "4.5.0",
-      "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
-      "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=",
-      "dev": true
-    },
-    "lodash.isfunction": {
-      "version": "3.0.9",
-      "resolved": "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz",
-      "integrity": "sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==",
-      "dev": true
-    },
-    "lodash.isinteger": {
-      "version": "4.0.4",
-      "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",
-      "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=",
-      "dev": true
-    },
-    "lodash.isplainobject": {
-      "version": "4.0.6",
-      "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
-      "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=",
-      "dev": true
-    },
     "lodash.kebabcase": {
       "version": "4.1.1",
       "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz",
@@ -14629,24 +14367,6 @@
         "lodash.isarray": "^3.0.0"
       }
     },
-    "lodash.lowerfirst": {
-      "version": "4.3.1",
-      "resolved": "https://registry.npmjs.org/lodash.lowerfirst/-/lodash.lowerfirst-4.3.1.tgz",
-      "integrity": "sha1-3jx7EuAsZSSgBZwvbLfFxSZVoT0=",
-      "dev": true
-    },
-    "lodash.map": {
-      "version": "4.6.0",
-      "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz",
-      "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=",
-      "dev": true
-    },
-    "lodash.mapvalues": {
-      "version": "4.6.0",
-      "resolved": "https://registry.npmjs.org/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz",
-      "integrity": "sha1-G6+lAF3p3W9PJmaMMMo3IwzJaJw=",
-      "dev": true
-    },
     "lodash.memoize": {
       "version": "4.1.2",
       "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
@@ -14665,24 +14385,12 @@
       "integrity": "sha1-brGa5aHuHdnfC5aeZs4Lf6MLXmA=",
       "dev": true
     },
-    "lodash.pick": {
-      "version": "4.4.0",
-      "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz",
-      "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=",
-      "dev": true
-    },
     "lodash.restparam": {
       "version": "3.6.1",
       "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz",
       "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=",
       "dev": true
     },
-    "lodash.snakecase": {
-      "version": "4.1.1",
-      "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz",
-      "integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=",
-      "dev": true
-    },
     "lodash.template": {
       "version": "4.5.0",
       "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz",
@@ -14720,12 +14428,6 @@
       "integrity": "sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI=",
       "dev": true
     },
-    "lodash.values": {
-      "version": "4.3.0",
-      "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-4.3.0.tgz",
-      "integrity": "sha1-o6bCsOvsxcLLocF+bmIP6BtT00c=",
-      "dev": true
-    },
     "log-symbols": {
       "version": "2.2.0",
       "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz",
@@ -15194,54 +14896,6 @@
         }
       }
     },
-    "miragejs": {
-      "version": "0.1.42",
-      "resolved": "https://registry.npmjs.org/miragejs/-/miragejs-0.1.42.tgz",
-      "integrity": "sha512-35Gl2Pubkj/9Xk/D5/JcKJyspPWCNcpMkrlEpP0ArjQ4wKINQaFIgg5R/LW5v/yvsLpMjf9tzZuHtO3NDZeZow==",
-      "dev": true,
-      "requires": {
-        "@miragejs/pretender-node-polyfill": "^0.1.0",
-        "inflected": "^2.0.4",
-        "lodash.assign": "^4.2.0",
-        "lodash.camelcase": "^4.3.0",
-        "lodash.clonedeep": "^4.5.0",
-        "lodash.compact": "^3.0.1",
-        "lodash.find": "^4.6.0",
-        "lodash.flatten": "^4.4.0",
-        "lodash.forin": "^4.4.0",
-        "lodash.get": "^4.4.2",
-        "lodash.has": "^4.5.2",
-        "lodash.invokemap": "^4.6.0",
-        "lodash.isempty": "^4.4.0",
-        "lodash.isequal": "^4.5.0",
-        "lodash.isfunction": "^3.0.9",
-        "lodash.isinteger": "^4.0.4",
-        "lodash.isplainobject": "^4.0.6",
-        "lodash.lowerfirst": "^4.3.1",
-        "lodash.map": "^4.6.0",
-        "lodash.mapvalues": "^4.6.0",
-        "lodash.pick": "^4.4.0",
-        "lodash.snakecase": "^4.1.1",
-        "lodash.uniq": "^4.5.0",
-        "lodash.uniqby": "^4.7.0",
-        "lodash.values": "^4.3.0",
-        "pretender": "^3.4.7"
-      },
-      "dependencies": {
-        "lodash.assign": {
-          "version": "4.2.0",
-          "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz",
-          "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=",
-          "dev": true
-        },
-        "lodash.flatten": {
-          "version": "4.4.0",
-          "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz",
-          "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=",
-          "dev": true
-        }
-      }
-    },
     "mississippi": {
       "version": "3.0.0",
       "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz",
@@ -16462,16 +16116,6 @@
       "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
       "dev": true
     },
-    "pretender": {
-      "version": "3.4.7",
-      "resolved": "https://registry.npmjs.org/pretender/-/pretender-3.4.7.tgz",
-      "integrity": "sha512-jkPAvt1BfRi0RKamweJdEcnjkeu7Es8yix3bJ+KgBC5VpG/Ln4JE3hYN6vJym4qprm8Xo5adhWpm3HCoft1dOw==",
-      "dev": true,
-      "requires": {
-        "fake-xml-http-request": "^2.1.2",
-        "route-recognizer": "^0.3.3"
-      }
-    },
     "prettier": {
       "version": "2.4.1",
       "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz",
@@ -17181,12 +16825,6 @@
         "estree-walker": "^0.6.1"
       }
     },
-    "route-recognizer": {
-      "version": "0.3.4",
-      "resolved": "https://registry.npmjs.org/route-recognizer/-/route-recognizer-0.3.4.tgz",
-      "integrity": "sha512-2+MhsfPhvauN1O8KaXpXAOfR/fwe8dnUXVM+xw7yt40lJRfPVQxV6yryZm0cgRvAj5fMF/mdRZbL2ptwbs5i2g==",
-      "dev": true
-    },
     "rsvp": {
       "version": "4.8.5",
       "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz",
diff --git a/package.json b/package.json
index 2efb9a6..57a2ce3 100644
--- a/package.json
+++ b/package.json
@@ -51,6 +51,7 @@
     "ember-resolver": "^8.0.2",
     "ember-source": "~3.28.0",
     "ember-template-lint": "^3.6.0",
+    "ember-truth-helpers": "^3.0.0",
     "ember-welcome-page": "^4.0.0",
     "eslint": "^7.32.0",
     "eslint-config-prettier": "^8.3.0",
-- 
GitLab