This repository has been archived by the owner on Oct 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Dennis Trümper <privat@truemper-nord.de>
- Loading branch information
1 parent
877bc43
commit d50e835
Showing
19 changed files
with
314 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/backend/src/domain/definitions/communication/getItemDetailsRequestResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import z from 'zod'; | ||
|
||
export const getItemDetailsResponseSchema = z.object({ | ||
name: z.string(), | ||
description: z.string().optional(), | ||
id: z.string(), | ||
priority: z.number() | ||
}); | ||
|
||
export type GetItemDetailsResponse = z.infer<typeof getItemDetailsResponseSchema>; | ||
export const getItemDetailsArrayResponseSchema = getItemDetailsResponseSchema.array(); | ||
export type GetItemDetailsArrayResponse = z.infer<typeof getItemDetailsArrayResponseSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module Components.Dropdown exposing (ExactOneSelection(..), viewDropdown) | ||
|
||
import Html exposing (Html) | ||
import Html.Attributes as Attr exposing (class) | ||
import Html.Events as Events | ||
|
||
|
||
type ExactOneSelection a | ||
= ExactOneSelection (List a) a (List a) | ||
|
||
|
||
viewDropdown : { id : String, name : String, variants : ExactOneSelection { value : a, text : String }, valueToString : a -> String, selectedMsg : String -> msg } -> Html msg | ||
viewDropdown options = | ||
Html.div [ class "relative" ] | ||
[ Html.label | ||
[ Attr.for options.id | ||
, class "absolute -top-2 left-2 inline-block px-1 text-xs font-medium text-pink-900" | ||
] | ||
[ Html.text options.name ] | ||
, Html.select | ||
[ Attr.id options.id | ||
, Attr.name options.name | ||
, Events.onInput options.selectedMsg | ||
, class "bg-pink-50 block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-pink-200 placeholder:text-gray-500 text-pink-900 focus:ring-2 focus:ring-inset focus:ring-pink-300 sm:text-sm sm:leading-6" | ||
] | ||
(case options.variants of | ||
ExactOneSelection before selected after -> | ||
List.map | ||
(\variant -> | ||
Html.option [ Attr.value (options.valueToString variant.value) ] | ||
[ Html.text variant.text ] | ||
) | ||
before | ||
++ [ Html.option | ||
[ Attr.selected True | ||
, Attr.value (options.valueToString selected.value) | ||
] | ||
[ Html.text selected.text ] | ||
] | ||
++ List.map | ||
(\variant -> | ||
Html.option [ Attr.value (options.valueToString variant.value) ] | ||
[ Html.text variant.text ] | ||
) | ||
after | ||
) | ||
] |
Oops, something went wrong.