Skip to content

Commit

Permalink
Cleanup: elm-review
Browse files Browse the repository at this point in the history
  • Loading branch information
roovo committed Jan 30, 2023
1 parent fa21c5c commit bad0126
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
3 changes: 0 additions & 3 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
- update readme
- new way to set column width with snippet

- need to update collapsed columns if columns are added or removed

- set size in elm (resize_spike branch)
Expand Down
8 changes: 5 additions & 3 deletions src/Board.elm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Board exposing

import BoardConfig exposing (BoardConfig)
import Card exposing (Card)
import CollapsedColumns
import CollapsedColumns exposing (CollapsedColumns)
import Column exposing (Column)
import ColumnNames exposing (ColumnNames)
import DateBoardColumns exposing (DateBoardColumns)
Expand Down Expand Up @@ -75,17 +75,19 @@ columns timeWithZone boardIndex (Board columnNames config taskList) =
collapseColumns : BoardConfig -> List (Column Card) -> List (Column Card)
collapseColumns config cols =
let
collapsedColumns : CollapsedColumns
collapsedColumns =
BoardConfig.collapsedColumns config

foo index col =
performCollapse : Int -> Column Card -> Column Card
performCollapse index col =
if CollapsedColumns.columnIsCollapsed index collapsedColumns then
Column.collapseState True col

else
Column.collapseState False col
in
List.indexedMap foo cols
List.indexedMap performCollapse cols


filterTaskList : BoardConfig -> TaskList -> TaskList
Expand Down
1 change: 0 additions & 1 deletion src/CollapsedColumns.elm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module CollapsedColumns exposing
, init
)

import List.Extra as LE
import Set exposing (Set)
import TsJson.Decode as TsDecode
import TsJson.Encode as TsEncode
Expand Down
4 changes: 4 additions & 0 deletions src/Page/Board.elm
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ update msg session =

ToggleColumnCollapse columnIndex newState ->
let
newSession : Session
newSession =
Session.updateColumnCollapse columnIndex newState session
in
Expand Down Expand Up @@ -260,20 +261,23 @@ selectedBoardView timeWithZone boardIndex board =
columnView : Int -> TimeWithZone -> Column Card -> Html Msg
columnView columnIndex timeWithZone column =
let
columnCollapsedArrow : String
columnCollapsedArrow =
if Column.isCollapsed column then
"arrow-down"

else
"arrow-right"

columnCollapsedClass : String
columnCollapsedClass =
if Column.isCollapsed column then
" collapsed"

else
""

columnCountString : String
columnCountString =
if Column.isCollapsed column then
"(" ++ (String.fromInt <| List.length <| Column.items column) ++ ")"
Expand Down
2 changes: 1 addition & 1 deletion tests/CollapsedColumnsTests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module CollapsedColumnsTests exposing (suite)

import CollapsedColumns
import Expect
import Fuzz exposing (Fuzzer)
import Fuzz
import Helpers.DecodeHelpers as DecodeHelpers
import Test exposing (..)
import TsJson.Encode as TsEncode
Expand Down

0 comments on commit bad0126

Please sign in to comment.