Skip to content

Commit

Permalink
Merge pull request #600 from nfdi4plants/Bug_Swate_DataColumnsNotHidd…
Browse files Browse the repository at this point in the history
…able

Bug, Swate: Enable Hiding of Data Property Colums
  • Loading branch information
Freymaurer authored Jan 10, 2025
2 parents 2663218 + d1ad801 commit 13ddc14
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Client/MainComponents/Cells.fs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ type Cell =
| TSR | TAN -> $"{columnType} ({cellValue})"
| _ -> cellValue
let extendableButtonOpt =
if columnType = Main && not header.IsSingleColumn then
if (columnType = Main && not header.IsSingleColumn) || (columnType = Main && header.IsDataColumn) then
extendHeaderButton(state_extend, columnIndex, setState_extend) |> Some
else
None
Expand Down
10 changes: 6 additions & 4 deletions src/Client/MainComponents/SpreadsheetView/ArcTable.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let private CreateBodyCells (columnIndex, rowIndex, state:Set<int>, model:Model,
Cell.Empty()
Cell.BodyTSR(index, cell, model, dispatch)
Cell.BodyTAN(index, cell, model, dispatch)
elif header.IsDataColumn then
elif header.IsDataColumn && isExtended then
if cell.isData then
Cell.BodyDataSelector(index, cell, model, dispatch)
Cell.BodyDataFormat(index, cell, model, dispatch)
Expand All @@ -48,9 +48,11 @@ let private CreateHeaderCells(columnIndex, state, setState, model, dispatch) =
Cell.HeaderTSR(columnIndex, header, state, setState, model, dispatch)
Cell.HeaderTAN(columnIndex, header, state, setState, model, dispatch)
elif header.IsDataColumn then
Cell.HeaderDataSelector(columnIndex, header, state, setState, model, dispatch)
Cell.HeaderDataFormat(columnIndex, header, state, setState, model, dispatch)
Cell.HeaderDataSelectorFormat(columnIndex, header, state, setState, model, dispatch)
let isExtended = state.Contains columnIndex
if isExtended then
Cell.HeaderDataSelector(columnIndex, header, state, setState, model, dispatch)
Cell.HeaderDataFormat(columnIndex, header, state, setState, model, dispatch)
Cell.HeaderDataSelectorFormat(columnIndex, header, state, setState, model, dispatch)
else
()
]
Expand Down
3 changes: 1 addition & 2 deletions src/Client/MainComponents/SpreadsheetView/DataMap.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let private CreateBodyCells(columnIndex, rowIndex, state: Set<int>, model, dispa
Cell.Empty()
Cell.BodyTSR(index, cell, model, dispatch)
Cell.BodyTAN(index, cell, model, dispatch)
elif header.IsDataColumn then
elif header.IsDataColumn && isExtended then
if cell.isData then
Cell.BodyDataSelector(index, cell, model, dispatch)
Cell.BodyDataFormat(index, cell, model, dispatch)
Expand All @@ -35,7 +35,6 @@ let private CreateBodyCells(columnIndex, rowIndex, state: Set<int>, model, dispa
Cell.Empty()
Cell.Empty()
Cell.Empty()

]

let private CreateHeaderCells(columnIndex, state, setState, model, dispatch) =
Expand Down

0 comments on commit 13ddc14

Please sign in to comment.