Dashboard updates

This commit is contained in:
eikek
2022-01-26 21:24:03 +01:00
parent 3ff7e255b4
commit e6477a04b6
11 changed files with 62 additions and 34 deletions

View File

@@ -15,6 +15,7 @@ module Page.Dashboard.Data exposing
, isDashboardDefault
, isDashboardVisible
, isHomeContent
, reinitCmd
, reloadDashboardData
, reloadUiSettings
)
@@ -111,6 +112,16 @@ init flags =
initCmd : Flags -> Cmd Msg
initCmd flags =
makeInitCmd flags SetDefaultDashboard
reinitCmd : Flags -> Cmd Msg
reinitCmd flags =
makeInitCmd flags ReloadDashboardData
makeInitCmd : Flags -> Msg -> Cmd Msg
makeInitCmd flags nextMsg =
let
ignoreBookmarkError r =
Result.withDefault Data.Bookmarks.empty r
@@ -118,7 +129,7 @@ initCmd flags =
in
Cmd.batch
[ Api.getBookmarks flags ignoreBookmarkError
, Api.getAllDashboards flags (GetAllDashboardsResp (Just SetDefaultDashboard))
, Api.getAllDashboards flags (GetAllDashboardsResp (Just nextMsg))
]

View File

@@ -14,7 +14,7 @@ import Messages.UiLanguage
value : Texts -> Dashboard
value texts =
{ name = texts.default
, columns = 2
, columns = 4
, gap = 2
, boxes =
[ messageBox texts
@@ -48,7 +48,7 @@ messageBox texts =
{ name = texts.welcomeName
, visible = True
, decoration = False
, colspan = 2
, colspan = 4
, content =
BoxMessage
{ title = texts.welcomeTitle
@@ -62,7 +62,7 @@ newDocuments texts =
{ name = texts.newDocsName
, visible = True
, decoration = True
, colspan = 1
, colspan = 2
, content =
BoxQuery
{ query = SearchQueryString "inbox:yes"
@@ -79,7 +79,7 @@ dueDocuments texts =
{ name = texts.dueInDays 10
, visible = True
, decoration = True
, colspan = 1
, colspan = 2
, content =
BoxQuery
{ query = SearchQueryString "due>today;-10d due<today;+10d"
@@ -113,8 +113,8 @@ fieldStats : Box
fieldStats =
{ name = ""
, visible = True
, decoration = True
, colspan = 2
, decoration = False
, colspan = 4
, content =
BoxStats
{ query = SearchQueryString ""
@@ -128,7 +128,7 @@ upload =
{ name = ""
, visible = True
, decoration = True
, colspan = 1
, colspan = 3
, content =
BoxUpload
{ sourceId = Nothing

View File

@@ -307,11 +307,10 @@ doSearchDefaultCmd param model =
createQuery : Model -> Maybe Q.ItemQuery
createQuery model =
Debug.log "query" <|
Q.and
[ Comp.SearchMenu.getItemQuery model.searchMenuModel
, Maybe.map Q.Fragment model.powerSearchInput.input
]
Q.and
[ Comp.SearchMenu.getItemQuery model.searchMenuModel
, Maybe.map Q.Fragment model.powerSearchInput.input
]
resultsBelowLimit : UiSettings -> Model -> Bool

View File

@@ -109,7 +109,7 @@ update bookmarkId mId key flags texts settings msg model =
}
result =
if Debug.log "state" nextState.stateChange && not model.searchInProgress then
if nextState.stateChange && not model.searchInProgress then
doSearch (SearchParam flags BasicSearch settings.itemSearchPageSize 0 False) newModel
else