Skip to content

Commit bb98d91

Browse files
authored
Merge pull request #449 from serverlessworkflow/fix-dashboard-light-theme
Light theme improvements and close button for editor errors in the Dashboard
2 parents b71dfe7 + 251c2af commit bb98d91

File tree

11 files changed

+79
-23
lines changed

11 files changed

+79
-23
lines changed

src/dashboard/Synapse.Dashboard/Components/DocumentDetails/DocumentDetails.razor

+3-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@
5858
}
5959
@if (problemDetails != null)
6060
{
61-
<div class="problems p-3">
62-
<Callout Color="CalloutColor.Danger" Heading="@problemDetails.Title">
61+
<div class="problems px-3">
62+
<Callout Color="CalloutColor.Danger" Heading="@problemDetails.Title" Class="position-relative">
63+
<Icon Name="IconName.X" Class="position-absolute" @onclick="() => Store.SetProblemDetails(null)" />
6364
<p>@problemDetails.Detail</p>
6465

6566
@if (problemDetails.Errors != null && problemDetails.Errors.Any())

src/dashboard/Synapse.Dashboard/Components/DocumentDetails/State.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ public record DocumentDetailsState
6767
/// <summary>
6868
/// Gets/sets the list of <see cref="ProblemDetails"/> errors that occurred when trying to save the resource, if any
6969
/// </summary>
70-
public EquatableDictionary<string, string[]> ProblemErrors { get; set; } = new EquatableDictionary<string, string[]>();
70+
public IDictionary<string, string[]> ProblemErrors { get; set; } = new EquatableDictionary<string, string[]>();
7171
}

src/dashboard/Synapse.Dashboard/Components/DocumentDetails/Store.cs

+17
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
using Synapse.Api.Client.Services;
1515
using Synapse.Dashboard.Components.WorkflowInstanceLogsStateManagement;
16+
using Synapse.Dashboard.Pages.Functions.Create;
1617

1718
namespace Synapse.Dashboard.Components.DocumentDetailsStateManagement;
1819

@@ -380,6 +381,22 @@ public async Task OnCopyToClipboard()
380381
this.Logger.LogError("Unable to copy to clipboard: {exception}", ex.ToString());
381382
}
382383
}
384+
385+
/// <summary>
386+
/// Sets the state's <see cref="CreateFunctionViewState" /> <see cref="ProblemDetails"/>'s related data
387+
/// </summary>
388+
/// <param name="problem">The <see cref="ProblemDetails"/> to populate the data with</param>
389+
public void SetProblemDetails(ProblemDetails? problem)
390+
{
391+
this.Reduce(state => state with
392+
{
393+
ProblemType = problem?.Type,
394+
ProblemTitle = problem?.Title ?? string.Empty,
395+
ProblemStatus = problem?.Status ?? 0,
396+
ProblemDetail = problem?.Detail ?? string.Empty,
397+
ProblemErrors = problem?.Errors?.ToDictionary(kvp => kvp.Key, kvp => kvp.Value) ?? []
398+
});
399+
}
383400
#endregion
384401

385402
/// <inheritdoc/>

src/dashboard/Synapse.Dashboard/Components/ResourceEditor/ResourceEditor.razor

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
OnDidChangeModelContent="OnTextBasedValueChanged" />
3939
@if (problemDetails != null)
4040
{
41-
<div class="problems p-3">
42-
<Callout Color="CalloutColor.Danger" Heading="@problemDetails.Title">
41+
<div class="problems px-3">
42+
<Callout Color="CalloutColor.Danger" Heading="@problemDetails.Title" Class="position-relative">
43+
<Icon Name="IconName.X" Class="position-absolute" @onclick="() => Store.SetProblemDetails(null)" />
4344
<p>@problemDetails.Detail</p>
4445

4546
@if (problemDetails.Errors != null && problemDetails.Errors.Any())

src/dashboard/Synapse.Dashboard/Pages/Functions/Create/View.razor

+3-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ else
5353
CssClass="h-100" />
5454
@if (problemDetails != null)
5555
{
56-
<div class="problems p-3">
57-
<Callout Color="CalloutColor.Danger" Heading="@problemDetails.Title">
56+
<div class="problems px-3">
57+
<Callout Color="CalloutColor.Danger" Heading="@problemDetails.Title" Class="position-relative">
58+
<Icon Name="IconName.X" Class="position-absolute" @onclick="() => Store.SetProblemDetails(null)" />
5859
<p>@problemDetails.Detail</p>
5960

6061
@if (problemDetails.Errors != null && problemDetails.Errors.Any())

src/dashboard/Synapse.Dashboard/Pages/Workflows/Create/View.razor

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ else
4343
CssClass="h-100" />
4444
@if (problemDetails != null)
4545
{
46-
<div class="problems p-3">
47-
<Callout Color="CalloutColor.Danger" Heading="@problemDetails.Title">
46+
<div class="problems px-3">
47+
<Callout Color="CalloutColor.Danger" Heading="@problemDetails.Title" Class="position-relative">
48+
<Icon Name="IconName.X" Class="position-absolute" @onclick="() => Store.SetProblemDetails(null)" />
4849
<p>@problemDetails.Detail</p>
4950

5051
@if (problemDetails.Errors != null && problemDetails.Errors.Any())

src/dashboard/Synapse.Dashboard/wwwroot/css/app.css

+26-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dashboard/Synapse.Dashboard/wwwroot/css/app.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dashboard/Synapse.Dashboard/wwwroot/css/app.scss

+11
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,15 @@ input[type="search"]::-webkit-search-cancel-button {
179179
max-height: 300px;
180180
overflow: scroll;
181181
width: 100%;
182+
183+
.bb-callout {
184+
margin-top: 0;
185+
margin-bottom: 0;
186+
187+
.bi.bi-x.position-absolute {
188+
cursor: pointer;
189+
top: $spacer;
190+
right: $spacer;
191+
}
192+
}
182193
}

src/dashboard/Synapse.Dashboard/wwwroot/css/graph.scss

+9-4
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,20 @@ $viridisScale: // generated with 13 steps, using 12 to exclude the last yellow
4949
cursor: grabbing;
5050
}
5151
}
52-
52+
:root {
53+
--graph-symbol-color: #{$body-color-dark};
54+
}
5355
[data-bs-theme="dark"] {
56+
--graph-symbol-color: #{$body-color-dark};
5457
.graph-container, .graph-canvas {
58+
--stroke-color: #{$mute};
5559
--fill-color: #{$dark-bg-subtle-dark};
5660
}
5761
}
5862

5963
.graph-container, .graph-canvas {
60-
--stroke-color: #{$mute};
61-
--fill-color: #{$body-bg};
64+
--stroke-color: #{$dark};
65+
--fill-color: #{$gray-700};
6266
display: flex;
6367
flex-direction: column;
6468

@@ -124,6 +128,7 @@ $viridisScale: // generated with 13 steps, using 12 to exclude the last yellow
124128
white-space: nowrap;
125129
text-overflow: ellipsis;
126130
overflow: hidden;
131+
color: #{$body-color-dark};
127132

128133
h3 {
129134
margin-bottom: calc($spacer / 4);
@@ -208,7 +213,7 @@ $viridisScale: // generated with 13 steps, using 12 to exclude the last yellow
208213
}
209214

210215
.symbol {
211-
fill: var(--bs-body-color);
216+
fill: var(--graph-symbol-color);
212217
}
213218

214219
.start-node circle {

src/dashboard/Synapse.Dashboard/wwwroot/css/theme/theme.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ header.header.navbar {
8080
$value: map-get($theme-colors,"light");
8181
@include button-variant(
8282
transparent,
83-
$value,
83+
transparent,
84+
$color: $body-color,
8485
$hover-background: shade-color($value, $btn-hover-bg-shade-amount),
8586
$hover-border: shade-color($value, $btn-hover-border-shade-amount),
8687
$active-background: shade-color($value, $btn-active-bg-shade-amount),

0 commit comments

Comments
 (0)