diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm b/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm index 3b36b354..de607a6b 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm @@ -28,6 +28,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) import Http +import Util.CustomField import Util.Maybe @@ -63,9 +64,8 @@ visibleFields model = currentOptions : List CustomField -> Dict String VisibleField -> List CustomField currentOptions all visible = - List.filter - (\e -> not <| Dict.member e.name visible) - all + List.sortBy Util.CustomField.nameOrLabel all + |> List.filter (\e -> not <| Dict.member e.name visible) type Msg diff --git a/modules/webapp/src/main/elm/Util/CustomField.elm b/modules/webapp/src/main/elm/Util/CustomField.elm index 800864cf..9e2aa802 100644 --- a/modules/webapp/src/main/elm/Util/CustomField.elm +++ b/modules/webapp/src/main/elm/Util/CustomField.elm @@ -7,7 +7,7 @@ import Html exposing (..) import Html.Attributes exposing (..) -nameOrLabel : ItemFieldValue -> String +nameOrLabel : { r | name : String, label : Maybe String } -> String nameOrLabel fv = Maybe.withDefault fv.name fv.label