forked from mirrors/homebox
fix: other minor fixes (#388)
* remove overflow-hidden on when no collapsed * fix recently added on homescreen * fix delete account formatting * add manufacturer to search * move nav button to left
This commit is contained in:
parent
ced5aef6d1
commit
4dd925caf0
8 changed files with 38 additions and 20 deletions
|
@ -58,6 +58,7 @@ func (ctrl *V1Controller) HandleItemsGetAll() errchain.HandlerFunc {
|
|||
LabelIDs: queryUUIDList(params, "labels"),
|
||||
IncludeArchived: queryBool(params.Get("includeArchived")),
|
||||
Fields: filterFieldItems(params["fields"]),
|
||||
OrderBy: params.Get("orderBy"),
|
||||
}
|
||||
|
||||
if strings.HasPrefix(v.Search, "#") {
|
||||
|
|
|
@ -29,13 +29,14 @@ type (
|
|||
ItemQuery struct {
|
||||
Page int
|
||||
PageSize int
|
||||
Search string `json:"search"`
|
||||
AssetID AssetID `json:"assetId"`
|
||||
LocationIDs []uuid.UUID `json:"locationIds"`
|
||||
LabelIDs []uuid.UUID `json:"labelIds"`
|
||||
SortBy string `json:"sortBy"`
|
||||
IncludeArchived bool `json:"includeArchived"`
|
||||
Fields []FieldQuery
|
||||
Search string `json:"search"`
|
||||
AssetID AssetID `json:"assetId"`
|
||||
LocationIDs []uuid.UUID `json:"locationIds"`
|
||||
LabelIDs []uuid.UUID `json:"labelIds"`
|
||||
SortBy string `json:"sortBy"`
|
||||
IncludeArchived bool `json:"includeArchived"`
|
||||
Fields []FieldQuery `json:"fields"`
|
||||
OrderBy string `json:"orderBy"`
|
||||
}
|
||||
|
||||
ItemField struct {
|
||||
|
@ -326,6 +327,7 @@ func (e *ItemsRepository) QueryByGroup(ctx context.Context, gid uuid.UUID, q Ite
|
|||
item.NameContainsFold(q.Search),
|
||||
item.DescriptionContainsFold(q.Search),
|
||||
item.NotesContainsFold(q.Search),
|
||||
item.ManufacturerContainsFold(q.Search),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
@ -385,7 +387,17 @@ func (e *ItemsRepository) QueryByGroup(ctx context.Context, gid uuid.UUID, q Ite
|
|||
return PaginationResult[ItemSummary]{}, err
|
||||
}
|
||||
|
||||
qb = qb.Order(ent.Asc(item.FieldName)).
|
||||
// Order
|
||||
switch q.OrderBy {
|
||||
case "createdAt":
|
||||
qb = qb.Order(ent.Desc(item.FieldCreatedAt))
|
||||
case "updatedAt":
|
||||
qb = qb.Order(ent.Desc(item.FieldUpdatedAt))
|
||||
default: // "name"
|
||||
qb = qb.Order(ent.Asc(item.FieldName))
|
||||
}
|
||||
|
||||
qb = qb.
|
||||
WithLabel().
|
||||
WithLocation()
|
||||
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
</div>
|
||||
<div
|
||||
:class="{
|
||||
'max-h-[99999px]': !collapsed,
|
||||
'max-h-0': collapsed,
|
||||
'max-h-[9000px]': collapsable && !collapsed,
|
||||
'max-h-0 overflow-hidden': collapsed,
|
||||
}"
|
||||
class="transition-[max-height] duration-200 overflow-hidden"
|
||||
class="transition-[max-height] duration-200"
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
};
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const sortByProperty = ref<keyof ItemSummary>("name");
|
||||
const sortByProperty = ref<keyof ItemSummary | "">("");
|
||||
|
||||
const headers = computed<TableHeader[]>(() => {
|
||||
return [
|
||||
|
@ -136,6 +136,10 @@
|
|||
}
|
||||
|
||||
function itemSort(a: ItemSummary, b: ItemSummary) {
|
||||
if (!sortByProperty.value) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const aLower = extractSortable(a, sortByProperty.value);
|
||||
const bLower = extractSortable(b, sortByProperty.value);
|
||||
|
||||
|
|
|
@ -16,16 +16,16 @@
|
|||
<AppHeaderDecor class="-mt-10 hidden lg:block" />
|
||||
<!-- Button -->
|
||||
<div class="navbar z-[99] lg:hidden top-0 fixed bg-primary shadow-md drawer-button">
|
||||
<label for="my-drawer-2" class="btn btn-square btn-ghost text-base-100 drawer-button lg:hidden">
|
||||
<Icon name="mdi-menu" class="h-6 w-6" />
|
||||
</label>
|
||||
<NuxtLink to="/home">
|
||||
<h2 class="mt-1 ml-1 text-3xl font-bold tracking-tight text-base-100 flex">
|
||||
<h2 class="text-3xl font-bold tracking-tight text-base-100 flex">
|
||||
HomeB
|
||||
<AppLogo class="w-8 -mb-3" />
|
||||
x
|
||||
</h2>
|
||||
</NuxtLink>
|
||||
<label for="my-drawer-2" class="btn btn-square btn-ghost ml-auto text-base-100 drawer-button lg:hidden">
|
||||
<Icon name="mdi-menu" class="h-6 w-6" />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<slot></slot>
|
||||
|
|
|
@ -15,6 +15,7 @@ import { AttachmentTypes, PaginationResult } from "../types/non-generated";
|
|||
import { Requests } from "~~/lib/requests";
|
||||
|
||||
export type ItemsQuery = {
|
||||
orderBy?: string;
|
||||
includeArchived?: boolean;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
|
|
|
@ -5,6 +5,7 @@ export function itemsTable(api: UserClient) {
|
|||
const { data } = await api.items.getAll({
|
||||
page: 1,
|
||||
pageSize: 5,
|
||||
orderBy: "createdAt",
|
||||
});
|
||||
return data.items;
|
||||
});
|
||||
|
|
|
@ -473,11 +473,10 @@
|
|||
<span class="text-base-600"> Delete Account</span>
|
||||
<template #description> Delete your account and all it's associated data </template>
|
||||
</BaseSectionHeader>
|
||||
|
||||
<div class="py-4 border-t-2 border-gray-300">
|
||||
<BaseButton size="sm" class="btn-error" @click="deleteProfile"> Delete Account </BaseButton>
|
||||
</div>
|
||||
</template>
|
||||
<div class="p-4 px-6 border-t-2 border-gray-300">
|
||||
<BaseButton size="sm" class="btn-error" @click="deleteProfile"> Delete Account </BaseButton>
|
||||
</div>
|
||||
</BaseCard>
|
||||
</BaseContainer>
|
||||
<footer v-if="status" class="text-center w-full bottom-0 pb-4">
|
||||
|
|
Loading…
Reference in a new issue