From 11dcff450ce4f63495eb108999c58eb91319709b Mon Sep 17 00:00:00 2001
From: Hayden <64056131+hay-kot@users.noreply.github.com>
Date: Fri, 2 Sep 2022 09:46:20 -0800
Subject: [PATCH] stuff
---
frontend/components/App/Header.vue | 17 +--
frontend/components/Base/Button.vue | 7 ++
frontend/components/Base/Modal.vue | 6 +-
frontend/components/Form/Multiselect.vue | 80 ++++++++++++++
frontend/components/Form/Select.vue | 54 +++++++++
frontend/components/Form/TextArea.vue | 45 ++++++++
frontend/components/Form/TextField.vue | 10 +-
frontend/components/Item/CreateModal.vue | 87 +++++++++++++++
frontend/composables/use-preferences.ts | 4 +-
frontend/lib/api/classes/labels.ts | 5 +-
frontend/package.json | 5 +-
frontend/pages/item/new.vue | 95 ++++++++++++++++
frontend/pages/label/[id].vue | 134 +++++++++++++++++++++++
frontend/pages/location/[id].vue | 2 +-
frontend/pnpm-lock.yaml | 7 ++
15 files changed, 536 insertions(+), 22 deletions(-)
create mode 100644 frontend/components/Form/Multiselect.vue
create mode 100644 frontend/components/Form/Select.vue
create mode 100644 frontend/components/Form/TextArea.vue
create mode 100644 frontend/components/Item/CreateModal.vue
create mode 100644 frontend/pages/item/new.vue
create mode 100644 frontend/pages/label/[id].vue
diff --git a/frontend/components/App/Header.vue b/frontend/components/App/Header.vue
index 49c67bd..03e0b31 100644
--- a/frontend/components/App/Header.vue
+++ b/frontend/components/App/Header.vue
@@ -26,24 +26,24 @@
];
const modals = reactive({
+ item: false,
location: false,
label: false,
- item: false,
});
const dropdown = [
- {
- name: 'Location',
- action: () => {
- modals.location = true;
- },
- },
{
name: 'Item / Asset',
action: () => {
modals.item = true;
},
},
+ {
+ name: 'Location',
+ action: () => {
+ modals.location = true;
+ },
+ },
{
name: 'Label',
action: () => {
@@ -60,6 +60,7 @@
up the tree
-->
+
@@ -93,7 +94,7 @@
diff --git a/frontend/components/Base/Button.vue b/frontend/components/Base/Button.vue
index 126ba30..1a48cc6 100644
--- a/frontend/components/Base/Button.vue
+++ b/frontend/components/Base/Button.vue
@@ -2,10 +2,14 @@
@@ -21,4 +25,7 @@
default: false,
},
});
+
+ const submitBtn = ref(null);
+ const isHover = useElementHover(submitBtn);
diff --git a/frontend/components/Base/Modal.vue b/frontend/components/Base/Modal.vue
index fa2b715..950918f 100644
--- a/frontend/components/Base/Modal.vue
+++ b/frontend/components/Base/Modal.vue
@@ -1,8 +1,8 @@
-
+
-
-
+
+
diff --git a/frontend/components/Form/Multiselect.vue b/frontend/components/Form/Multiselect.vue
new file mode 100644
index 0000000..57c8985
--- /dev/null
+++ b/frontend/components/Form/Multiselect.vue
@@ -0,0 +1,80 @@
+
+
+
+
+
diff --git a/frontend/components/Form/Select.vue b/frontend/components/Form/Select.vue
new file mode 100644
index 0000000..e3d716e
--- /dev/null
+++ b/frontend/components/Form/Select.vue
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
diff --git a/frontend/components/Form/TextArea.vue b/frontend/components/Form/TextArea.vue
new file mode 100644
index 0000000..672df9c
--- /dev/null
+++ b/frontend/components/Form/TextArea.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
diff --git a/frontend/components/Form/TextField.vue b/frontend/components/Form/TextField.vue
index 0351e1c..57d5989 100644
--- a/frontend/components/Form/TextField.vue
+++ b/frontend/components/Form/TextField.vue
@@ -9,13 +9,13 @@
diff --git a/frontend/composables/use-preferences.ts b/frontend/composables/use-preferences.ts
index a933505..3e38682 100644
--- a/frontend/composables/use-preferences.ts
+++ b/frontend/composables/use-preferences.ts
@@ -5,10 +5,10 @@ export type LocationViewPreferences = {
};
/**
- * useLocationViewPreferences loads the view preferences from local storage and hydrates
+ * useViewPreferences loads the view preferences from local storage and hydrates
* them. These are reactive and will update the local storage when changed.
*/
-export function useLocationViewPreferences(): Ref {
+export function useViewPreferences(): Ref {
const results = useLocalStorage(
'homebox/preferences/location',
{
diff --git a/frontend/lib/api/classes/labels.ts b/frontend/lib/api/classes/labels.ts
index 65a1aa3..82aa005 100644
--- a/frontend/lib/api/classes/labels.ts
+++ b/frontend/lib/api/classes/labels.ts
@@ -7,7 +7,10 @@ export type LabelCreate = Details & {
export type LabelUpdate = LabelCreate;
-export type Label = LabelCreate & OutType;
+export type Label = LabelCreate &
+ OutType & {
+ groupId: string;
+ };
export class LabelsApi extends BaseAPI {
async getAll() {
diff --git a/frontend/package.json b/frontend/package.json
index eef23f8..00823e1 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -5,7 +5,8 @@
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
- "postinstall": "nuxt prepare"
+ "postinstall": "nuxt prepare",
+ "test": "vitest"
},
"devDependencies": {
"nuxt": "3.0.0-rc.8",
@@ -26,4 +27,4 @@
"tailwindcss": "^3.1.8",
"vue": "^3.2.38"
}
-}
+}
\ No newline at end of file
diff --git a/frontend/pages/item/new.vue b/frontend/pages/item/new.vue
new file mode 100644
index 0000000..8a93181
--- /dev/null
+++ b/frontend/pages/item/new.vue
@@ -0,0 +1,95 @@
+
+
+
+
+ Add an Item To Your Inventory
+
+
+
diff --git a/frontend/pages/label/[id].vue b/frontend/pages/label/[id].vue
new file mode 100644
index 0000000..a14588c
--- /dev/null
+++ b/frontend/pages/label/[id].vue
@@ -0,0 +1,134 @@
+
+
+
+
+
+ Update Label
+
+
+
+
+
+
+
diff --git a/frontend/pages/location/[id].vue b/frontend/pages/location/[id].vue
index 5b505d3..6d2e27d 100644
--- a/frontend/pages/location/[id].vue
+++ b/frontend/pages/location/[id].vue
@@ -10,7 +10,7 @@
const api = useUserApi();
const toast = useNotifier();
- const preferences = useLocationViewPreferences();
+ const preferences = useViewPreferences();
const locationId = computed(() => route.params.id as string);
diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml
index 0cf39e5..b74eb87 100644
--- a/frontend/pnpm-lock.yaml
+++ b/frontend/pnpm-lock.yaml
@@ -16,6 +16,7 @@ specifiers:
tailwindcss: ^3.1.8
vitest: ^0.22.1
vue: ^3.2.38
+ vue-multiselect: 3.0.0-alpha.2
dependencies:
'@iconify/vue': 3.2.1_vue@3.2.38
@@ -31,6 +32,7 @@ dependencies:
postcss: 8.4.16
tailwindcss: 3.1.8_postcss@8.4.16
vue: 3.2.38
+ vue-multiselect: 3.0.0-alpha.2
devDependencies:
nuxt: 3.0.0-rc.8
@@ -5680,6 +5682,11 @@ packages:
vue: 3.2.38
dev: false
+ /vue-multiselect/3.0.0-alpha.2:
+ resolution: {integrity: sha512-Xp9fGJECns45v+v8jXbCIsAkCybYkEg0lNwr7Z6HDUSMyx2TEIK2giipPE+qXiShEc1Ipn+ZtttH2iq9hwXP4Q==}
+ engines: {node: '>= 4.0.0', npm: '>= 3.0.0'}
+ dev: false
+
/vue-router/4.1.5_vue@3.2.38:
resolution: {integrity: sha512-IsvoF5D2GQ/EGTs/Th4NQms9gd2NSqV+yylxIyp/OYp8xOwxmU8Kj/74E9DTSYAyH5LX7idVUngN3JSj1X4xcQ==}
peerDependencies: