Skip to content

Commit

Permalink
feat: show "Report an issue" button even if the compilation fails mak…
Browse files Browse the repository at this point in the history
…ing it possible to report errors in any state of the web tool

[web]
  • Loading branch information
MangelMaxime committed May 8, 2024
1 parent dcd5968 commit e28372f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
17 changes: 15 additions & 2 deletions src/Glutinum.Web/Components/RightPanelContent.fs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,27 @@ type RightPanelContent =
|> prop.children
]

static member Error(error: string) =
static member Error(error: string, ?actions: ReactElement) =
Html.div [
prop.className [
classes.container
classes.``container--is-error``
]

prop.text error
prop.children [
Html.div [
prop.className classes.container__content
prop.children [
Html.text error

if actions.IsSome then
Html.div [
prop.className classes.container__actions
prop.children [ actions.Value ]
]
]
]
]
]

static member Loading() =
Expand Down
6 changes: 6 additions & 0 deletions src/Glutinum.Web/Components/RightPanelContent.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ $max-compilation-output-height: 25vh;
color: $danger-dark;
padding: 1rem;
white-space: break-spaces;

// Compensate for the padding
#{$self}__actions {
bottom: 0;
right: 1rem;
}
}

// If we have warnings, we need now have 2 rows
Expand Down
3 changes: 2 additions & 1 deletion src/Glutinum.Web/Pages/Editors.FSharpCode.fs
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,5 @@ let view model dispatch =
actions dispatch
)

| Errored message -> RightPanelContent.Error message
| Errored message ->
RightPanelContent.Error(message, actions = actions dispatch)

0 comments on commit e28372f

Please sign in to comment.