forked from mirrors/homebox
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
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
export type sizes = 'sm' | 'md' | 'lg';
|
||||
import { Label } from "~~/lib/api/classes/labels";
|
||||
|
||||
import { Label } from '~~/lib/api/classes/labels';
|
||||
export type sizes = "sm" | "md" | "lg";
|
||||
defineProps({
|
||||
label: {
|
||||
type: Object as () => Label,
|
||||
|
@ -9,7 +9,7 @@
|
|||
},
|
||||
size: {
|
||||
type: String as () => sizes,
|
||||
default: 'md',
|
||||
default: "md",
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -22,12 +22,12 @@
|
|||
|
||||
<template>
|
||||
<NuxtLink
|
||||
ref="badge"
|
||||
class="badge"
|
||||
:class="{
|
||||
'p-3': size !== 'sm',
|
||||
'p-2 badge-sm': size === 'sm',
|
||||
}"
|
||||
ref="badge"
|
||||
:to="`/label/${label.id}`"
|
||||
>
|
||||
<label class="swap swap-rotate" :class="isActive ? 'swap-active' : ''">
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
<template #title> Create Label </template>
|
||||
<form @submit.prevent="create">
|
||||
<FormTextField
|
||||
:trigger-focus="focused"
|
||||
ref="locationNameRef"
|
||||
v-model="form.name"
|
||||
:trigger-focus="focused"
|
||||
:autofocus="true"
|
||||
label="Label Name"
|
||||
v-model="form.name"
|
||||
/>
|
||||
<FormTextField label="Label Description" v-model="form.description" />
|
||||
<FormTextField v-model="form.description" label="Label Description" />
|
||||
<div class="modal-action">
|
||||
<BaseButton type="submit" :loading="loading"> Create </BaseButton>
|
||||
</div>
|
||||
|
@ -25,19 +25,19 @@
|
|||
},
|
||||
});
|
||||
|
||||
const modal = useVModel(props, 'modelValue');
|
||||
const modal = useVModel(props, "modelValue");
|
||||
const loading = ref(false);
|
||||
const focused = ref(false);
|
||||
const form = reactive({
|
||||
name: '',
|
||||
description: '',
|
||||
color: '', // Future!
|
||||
name: "",
|
||||
description: "",
|
||||
color: "", // Future!
|
||||
});
|
||||
|
||||
function reset() {
|
||||
form.name = '';
|
||||
form.description = '';
|
||||
form.color = '';
|
||||
form.name = "";
|
||||
form.description = "";
|
||||
form.color = "";
|
||||
focused.value = false;
|
||||
modal.value = false;
|
||||
loading.value = false;
|
||||
|
@ -54,13 +54,13 @@
|
|||
const toast = useNotifier();
|
||||
|
||||
async function create() {
|
||||
const { data, error } = await api.labels.create(form);
|
||||
const { error } = await api.labels.create(form);
|
||||
if (error) {
|
||||
toast.error("Couldn't create label");
|
||||
return;
|
||||
}
|
||||
|
||||
toast.success('Label created');
|
||||
toast.success("Label created");
|
||||
reset();
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue