Use a placeholder string for all dropdowns

This commit is contained in:
Eike Kettner
2021-04-11 20:37:16 +02:00
parent bbda4e84d7
commit 7b1cbe6435
31 changed files with 66 additions and 32 deletions

View File

@ -192,6 +192,7 @@ view2 texts settings model =
{ display = Data.ListType.label
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
div []

View File

@ -203,7 +203,7 @@ view2 flags texts settings model =
{ text = texts.languageLabel l
, additional = ""
}
, placeholder = ""
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = DS.mainStyle
}

View File

@ -93,6 +93,7 @@ type alias ViewOpts =
, colorLabel : Color -> String
, label : String
, description : Maybe String
, selectPlaceholder : String
}
@ -103,6 +104,7 @@ view2 data opts model =
{ display = identity
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = opts.selectPlaceholder
}
in
div [ class "flex flex-col" ]

View File

@ -119,6 +119,7 @@ update msg model =
type alias ViewSettings =
{ contactTypeLabel : ContactType -> String
, mobile : Bool
, selectPlaceholder : String
}
@ -129,6 +130,7 @@ view2 cfg _ model =
{ display = cfg.contactTypeLabel
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = cfg.selectPlaceholder
}
in
div [ class "flex flex-col" ]

View File

@ -209,6 +209,7 @@ view2 texts viewSettings model =
{ display = texts.fieldTypeLabel
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
(if viewSettings.showControls then

View File

@ -316,6 +316,7 @@ type alias ViewSettings =
, fieldIcon : CustomField -> Maybe String
, style : DS.DropdownStyle
, createCustomFieldTitle : String
, selectPlaceholder : String
}
@ -340,6 +341,7 @@ viewMenuBar2 viewSettings model =
{ display = \f -> Maybe.withDefault f.name f.label
, icon = \_ -> Nothing
, style = { ddstyle | root = ddstyle.root ++ " flex-grow" }
, selectPlaceholder = viewSettings.selectPlaceholder
}
in
div

View File

@ -155,7 +155,7 @@ view2 texts model =
, lineColor = "bg-gray-300 dark:bg-bluegray-600"
}
, B.primaryBasicButton
{ label = texts.select
{ label = texts.basics.selectPlaceholder
, icon = "fa fa-folder-open font-thin"
, handler = onClick PickFiles
, attrs = [ href "#" ]

View File

@ -180,7 +180,7 @@ view2 texts settings model =
{ text = texts.sslTypeLabel s
, additional = ""
}
, placeholder = ""
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = DS.mainStyle
}

View File

@ -107,6 +107,7 @@ view2 texts model =
{ display = texts.equipmentUseLabel
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
div [ class "flex flex-col" ]

View File

@ -152,6 +152,7 @@ update msg model =
type alias ViewSettings a =
{ display : a -> String
, icon : a -> Maybe String
, selectPlaceholder : String
, style : DS.DropdownStyle
}
@ -204,7 +205,7 @@ viewStyled2 cfg error sel model =
]
[ selIcon
, Maybe.map cfg.display sel
|> Maybe.withDefault "Select"
|> Maybe.withDefault cfg.selectPlaceholder
|> text
]
, div

View File

@ -372,6 +372,7 @@ viewMembers2 texts model =
{ display = .name
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
if model.folder.id == "" then

View File

@ -172,7 +172,7 @@ view2 texts settings model =
{ text = texts.sslTypeLabel s
, additional = ""
}
, placeholder = ""
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = DS.mainStyle
}

View File

@ -102,6 +102,7 @@ formTabs texts flags settings model =
, fieldIcon = \f -> Dict.get f.id model.customFieldSavingIcon
, style = dds
, createCustomFieldTitle = texts.createNewCustomField
, selectPlaceholder = texts.basics.selectPlaceholder
}
optional fields html =
@ -127,7 +128,7 @@ formTabs texts flags settings model =
folderCfg =
{ makeOption = Util.Folder.mkFolderOption flags model.allFolders
, placeholder = texts.selectPlaceholder
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = dds
}
@ -135,14 +136,14 @@ formTabs texts flags settings model =
idNameCfg =
{ makeOption = \e -> { text = e.name, additional = "" }
, labelColor = \_ -> \_ -> ""
, placeholder = texts.selectPlaceholder
, placeholder = texts.basics.selectPlaceholder
, style = dds
}
personCfg =
{ makeOption = \p -> Util.Person.mkPersonOption p model.allPersons
, labelColor = \_ -> \_ -> ""
, placeholder = texts.selectPlaceholder
, placeholder = texts.basics.selectPlaceholder
, style = dds
}
in

View File

@ -662,6 +662,7 @@ renderEditForm2 texts flags cfg settings model =
, fieldIcon = customFieldIcon
, style = dds
, createCustomFieldTitle = ""
, selectPlaceholder = texts.basics.selectPlaceholder
}
dds =
@ -672,7 +673,7 @@ renderEditForm2 texts flags cfg settings model =
folderCfg =
{ makeOption = Util.Folder.mkFolderOption flags model.allFolders
, placeholder = ""
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = dds
}
@ -680,7 +681,7 @@ renderEditForm2 texts flags cfg settings model =
idNameCfg =
{ makeOption = \e -> { text = e.name, additional = "" }
, labelColor = \_ -> \_ -> ""
, placeholder = texts.selectPlaceholder
, placeholder = texts.basics.selectPlaceholder
, style = dds
}

View File

@ -154,11 +154,13 @@ view2 texts mobile settings model =
{ display = texts.orgUseLabel
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
contactTypeCfg =
{ mobile = mobile
, contactTypeLabel = texts.contactTypeLabel
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
div [ class "flex flex-col" ]

View File

@ -186,11 +186,13 @@ view2 texts mobile settings model =
{ display = texts.personUseLabel
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
contactCfg =
{ mobile = mobile
, contactTypeLabel = texts.contactTypeLabel
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
div [ class "flex flex-col" ]

View File

@ -1034,7 +1034,7 @@ viewMetadata2 texts flags settings model =
let
folderCfg =
{ makeOption = Util.Folder.mkFolderOption flags model.allFolders
, placeholder = ""
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = DS.mainStyle
}
@ -1043,6 +1043,7 @@ viewMetadata2 texts flags settings model =
{ display = Messages.Data.Language.gb
, icon = \_ -> Nothing
, style = DS.mainStyleWith "flex-grow mr-2"
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
[ div [ class "mb-4" ]

View File

@ -1317,6 +1317,7 @@ searchTabs texts ddd flags settings model =
, fieldIcon = \_ -> Nothing
, style = DS.sidebarStyle
, createCustomFieldTitle = texts.createCustomFieldTitle
, selectPlaceholder = texts.basics.selectPlaceholder
}
model.customFieldModel
)

View File

@ -316,7 +316,7 @@ view2 flags texts settings model =
let
folderCfg =
{ makeOption = mkFolderOption flags model.allFolders
, placeholder = ""
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = DS.mainStyle
}
@ -330,7 +330,7 @@ view2 flags texts settings model =
{ text = texts.languageLabel a
, additional = ""
}
, placeholder = texts.selectPlaceholder
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = DS.mainStyle
}
@ -339,6 +339,7 @@ view2 flags texts settings model =
{ display = Data.Priority.toName
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
div [ class "flex flex-col" ]

View File

@ -469,6 +469,7 @@ tagColorViewOpts2 texts =
, colorLabel = texts.colorLabel
, label = texts.chooseTagColorLabel
, description = Just texts.tagColorDescription
, selectPlaceholder = texts.basics.selectPlaceholder
}
@ -497,6 +498,7 @@ settingFormTabs texts flags _ model =
{ display = \lang -> Messages.get lang |> .label
, icon = \lang -> Just (Messages.get lang |> .flagIcon)
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
[ { name = "general"

View File

@ -162,7 +162,7 @@ view2 texts settings model =
{ text = Data.UserState.toString s
, additional = ""
}
, placeholder = ""
, placeholder = texts.basics.selectPlaceholder
, style = DS.mainStyle
, labelColor = \_ -> \_ -> ""
}