Skip to content

Commit

Permalink
Add placeholders for empty definitions #277
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Mar 10, 2023
1 parent ff2cd16 commit 1ad927f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
21 changes: 12 additions & 9 deletions src/Client/Modals/BuildingBlockDetailsModal.fs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,18 @@ let private rowIndicesToReadable (rowIndices:int []) =
$"{rowIndices.[0]}"

let private infoIcon (txt:string) =
span [
Style [Color NFDIColors.Yellow.Base; (*OverflowY OverflowOptions.Visible*)]
Class ("has-tooltip-right has-tooltip-multiline")
Props.Custom ("data-tooltip", txt)
] [
Fa.i [
Fa.Solid.InfoCircle
] []
]
if txt = "" then
str "No defintion found"
else
span [
Style [Color NFDIColors.Yellow.Base; (*OverflowY OverflowOptions.Visible*)]
Class ("has-tooltip-right has-tooltip-multiline")
Props.Custom ("data-tooltip", txt)
] [
Fa.i [
Fa.Solid.InfoCircle
] []
]

[<Literal>]
let private userSpecificTermMsg = "This Term was not found in the database."
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Pages/BuildingBlock/SearchComponent.fs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ module private AutocompleteComponents =
prop.children [
Bulma.content [
Html.b "Definition: "
Html.p term.Description
Html.p (if term.Description = "" then "No definition found" else term.Description)
]
]
]
Expand Down
2 changes: 1 addition & 1 deletion src/Client/SidebarComponents/AutocompleteSearch.fs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ let createAutocompleteSuggestions
td [ColSpan 4] [
Content.content [] [
b [] [ str "Definition: " ]
str sugg.TooltipText
str (if sugg.TooltipText = "" then "No definition found" else sugg.TooltipText)
]
]
]
Expand Down
4 changes: 2 additions & 2 deletions src/Client/Update.fs
Original file line number Diff line number Diff line change
Expand Up @@ -768,9 +768,9 @@ let update (msg : Msg) (model : Model) : Model * Cmd<Msg> =

let logg (msg:Msg) (model: Model) : Model =
if matchMsgToLog msg then

let l = 62
let txt = $"{msg.ToString()}"
let txt = if txt.Length > 62 then txt.Substring(0, 62) + ".." else txt
let txt = if txt.Length > l then txt.Substring(0, l) + ".." else txt
let nextState = {
model.DevState with
Log = (LogItem.ofStringNow "Info" txt)::model.DevState.Log
Expand Down

0 comments on commit 1ad927f

Please sign in to comment.