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:
Hayden 2023-04-01 22:01:21 -08:00 committed by GitHub
parent ced5aef6d1
commit 4dd925caf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 38 additions and 20 deletions

View file

@ -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()