mirror of
https://github.com/hay-kot/homebox.git
synced 2025-06-27 14:18:35 +00:00
frontend: cleanup
* dummy commit * cleanup workflows * setup and run eslint * add linter to CI * use eslint for formatting * reorder rules * drop editor config
This commit is contained in:
parent
78fa714297
commit
75c633dcb5
65 changed files with 2048 additions and 641 deletions
|
@ -2,16 +2,16 @@
|
|||
<BaseModal v-model="modal">
|
||||
<template #title> Create Item </template>
|
||||
<form @submit.prevent="create">
|
||||
<FormSelect label="Location" v-model="form.location" :items="locations ?? []" select-first />
|
||||
<FormSelect v-model="form.location" label="Location" :items="locations ?? []" select-first />
|
||||
<FormTextField
|
||||
:trigger-focus="focused"
|
||||
ref="locationNameRef"
|
||||
v-model="form.name"
|
||||
:trigger-focus="focused"
|
||||
:autofocus="true"
|
||||
label="Item Name"
|
||||
v-model="form.name"
|
||||
/>
|
||||
<FormTextField label="Item Description" v-model="form.description" />
|
||||
<FormMultiselect label="Labels" v-model="form.labels" :items="labels ?? []" />
|
||||
<FormTextField v-model="form.description" label="Item Description" />
|
||||
<FormMultiselect v-model="form.labels" label="Labels" :items="labels ?? []" />
|
||||
<div class="modal-action">
|
||||
<BaseButton ref="submitBtn" type="submit" :loading="loading">
|
||||
<template #icon>
|
||||
|
@ -26,7 +26,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { type Location } from '~~/lib/api/classes/locations';
|
||||
import { type Location } from "~~/lib/api/classes/locations";
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
|
@ -36,21 +36,21 @@
|
|||
|
||||
const submitBtn = ref(null);
|
||||
|
||||
const modal = useVModel(props, 'modelValue');
|
||||
const modal = useVModel(props, "modelValue");
|
||||
const loading = ref(false);
|
||||
const focused = ref(false);
|
||||
const form = reactive({
|
||||
location: {} as Location,
|
||||
name: '',
|
||||
description: '',
|
||||
color: '', // Future!
|
||||
name: "",
|
||||
description: "",
|
||||
color: "", // Future!
|
||||
labels: [],
|
||||
});
|
||||
|
||||
function reset() {
|
||||
form.name = '';
|
||||
form.description = '';
|
||||
form.color = '';
|
||||
form.name = "";
|
||||
form.description = "";
|
||||
form.color = "";
|
||||
focused.value = false;
|
||||
modal.value = false;
|
||||
loading.value = false;
|
||||
|
@ -87,13 +87,13 @@
|
|||
labelIds: form.labels.map(l => l.id) as string[],
|
||||
};
|
||||
|
||||
const { data, error } = await api.items.create(out);
|
||||
const { error } = await api.items.create(out);
|
||||
if (error) {
|
||||
toast.error("Couldn't create label");
|
||||
return;
|
||||
}
|
||||
|
||||
toast.success('Item created');
|
||||
toast.success("Item created");
|
||||
reset();
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue