Skip to content
Snippets Groups Projects
Commit b21616cc authored by Damian Romano Haj-Houssin's avatar Damian Romano Haj-Houssin
Browse files

Changed datatable view to display (and filter for) country names again instead of ISO.

parent 135b1bac
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ import Model exposing (Global, View(..))
import Msg exposing (Msg(..))
import Data.DataLoader exposing (Entry)
import Config.DataTableConfig as Local exposing (Model)
import Utils exposing (codeToName)
propagate : Local.Msg -> Msg
propagate msg =
......@@ -29,8 +29,8 @@ update msg global model =
dataRow : Entry -> Html Msg
dataRow entry =
tr [ Html.Attributes.class "table-row" ]
[ td [ Html.Attributes.class "table-cell text-start" ] [ text entry.state ]
, td [ Html.Attributes.class "table-cell text-start" ] [ text entry.consulateCountry ]
[ td [ Html.Attributes.class "table-cell text-start" ] [ codeToName entry.state |> text ]
, td [ Html.Attributes.class "table-cell text-start" ] [ codeToName entry.consulateCountry |> text ]
, td [ Html.Attributes.class "table-cell text-start" ] [ text entry.consulate ]
, td [ Html.Attributes.class "table-cell text-end" ] [ entry.year |> String.fromInt |> text ]
, td [ Html.Attributes.class "table-cell text-end" ] [ entry.totalVisasApplied |> Maybe.map String.fromFloat |> Maybe.withDefault "N.A." |> text ]
......@@ -72,8 +72,8 @@ view global model =
\item -> case iquery of
Nothing -> True
Just query ->
String.contains query (String.toLower item.state)
|| String.contains query (String.toLower item.consulate)
String.contains query (codeToName item.state |> String.toLower)
|| String.contains query (codeToName item.consulate |> String.toLower)
|| String.contains query (String.toLower item.consulateCountry)
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment