Skip to content

Commit 551acd6

Browse files
Address Razor formatting.
Signed-off-by: Jaliya Udagedara <jaliya.udagedara@hotmail.com>
1 parent 205228b commit 551acd6

File tree

1 file changed

+43
-50
lines changed

1 file changed

+43
-50
lines changed

src/dashboard/Synapse.Dashboard/Features/Workflows/WorkflowEditor/AuthenticationEditor.razor

Lines changed: 43 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@*
1+
@*
22
Copyright © 2022-Present The Synapse Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,16 +22,14 @@
2222
<tbody>
2323
<tr>
2424
<td>Name</td>
25-
<td>
26-
<input type="text" value="@authentication.Name" required placeholder="Name" title="The authentication name" class="form-control"
27-
@onchange="async e => await OnPropertyChangedAsync(nameof(authentication.Name), a => a.Name = (string)e.Value!)" />
28-
</td>
25+
<td><input type="text" value="@authentication.Name" required placeholder="Name" title="The authentication name" class="form-control"
26+
@onchange="async e => await OnPropertyChangedAsync(nameof(authentication.Name), a => a.Name = (string)e.Value!)"/></td>
2927
</tr>
3028
<tr>
3129
<td>Scheme</td>
3230
<td>
3331
<select class="form-select bg-secondary text-white"
34-
@onchange="async e => await OnAuthenticationSchemeChangedAsync(EnumHelper.Parse<AuthenticationScheme>((string)e.Value!))">
32+
@onchange="async e => await OnAuthenticationSchemeChangedAsync(EnumHelper.Parse<AuthenticationScheme>((string)e.Value!))">
3533
@foreach (var scheme in Enum.GetValues<AuthenticationScheme>())
3634
{
3735
var schemeStr = @EnumHelper.Stringify(scheme);
@@ -42,27 +40,28 @@
4240
</tr>
4341
<ExpandableDataRow IsExpanded="true">
4442
<Header>
45-
<td>Properties</td>
46-
<td>
47-
<div class="input-group">
48-
<div class="input-group-text">
49-
<input class="form-check-input mt-0 me-2" type="checkbox" value="@useSecretBasedProperties" checked="@useSecretBasedProperties"
50-
@onclick="OnUseSecretBasedPropertiesChanged">
51-
<label title="Indicates whether or not to load the authentication properties from a secret">Load properties from secret</label>
52-
</div>
43+
<td>Properties</td>
44+
<td>
45+
<div class="input-group">
46+
<div class="input-group-text">
47+
<input class="form-check-input mt-0 me-2" type="checkbox" value="@useSecretBasedProperties" checked="@useSecretBasedProperties"
48+
@onclick="OnUseSecretBasedPropertiesChanged">
49+
<label title="Indicates whether or not to load the authentication properties from a secret">Load properties from secret</label>
50+
</div>
5351
@if (useSecretBasedProperties)
5452
{
55-
<SecretSelector Secrets="Workflow.Secrets"
53+
<SecretSelector
54+
Secrets="Workflow.Secrets"
5655
Selected="@(((SecretBasedAuthenticationProperties)authentication.Properties).Secret)"
57-
OnChange="async secret => await OnPropertyChangedAsync(nameof(authentication.Properties), a => a.SecretRef = secret)" />
56+
OnChange="async secret => await OnPropertyChangedAsync(nameof(authentication.Properties), a => a.SecretRef = secret)"/>
5857
}
59-
</div>
60-
</td>
58+
</div>
59+
</td>
6160
</Header>
6261
<Body>
6362
@if (!useSecretBasedProperties)
6463
{
65-
<td colspan="3">
64+
<td colspan="3">
6665
@switch (authentication.Scheme)
6766
{
6867
case AuthenticationScheme.Basic:
@@ -71,42 +70,36 @@
7170
basic = new();
7271
authentication.Properties = basic;
7372
}
74-
<table class="table table-striped">
75-
<tbody>
76-
<tr>
77-
<td>Username</td>
78-
<td>
79-
<input type="text" value="@basic.Username" required placeholder="Username" title="The username to use to authenticate" class="form-control"
80-
@onchange="async e => await OnAuthenticationPropertiesChangedAsync<BasicAuthenticationProperties>(p => p.Username = (string)e.Value!)" />
81-
</td>
82-
</tr>
83-
<tr>
84-
<td>Password</td>
85-
<td>
86-
<input type="text" value="@basic.Password" required placeholder="Password" title="The password to use to authenticate" class="form-control"
87-
@onchange="async e => await OnAuthenticationPropertiesChangedAsync<BasicAuthenticationProperties>(p => p.Password = (string)e.Value!)" />
88-
</td>
89-
</tr>
90-
</tbody>
91-
</table>
73+
<table class="table table-striped">
74+
<tbody>
75+
<tr>
76+
<td>Username</td>
77+
<td><input type="text" value="@basic.Username" required placeholder="Username" title="The username to use to authenticate" class="form-control"
78+
@onchange="async e => await OnAuthenticationPropertiesChangedAsync<BasicAuthenticationProperties>(p => p.Username = (string)e.Value!)"/></td>
79+
</tr>
80+
<tr>
81+
<td>Password</td>
82+
<td><input type="text" value="@basic.Password" required placeholder="Password" title="The password to use to authenticate" class="form-control"
83+
@onchange="async e => await OnAuthenticationPropertiesChangedAsync<BasicAuthenticationProperties>(p => p.Password = (string)e.Value!)"/></td>
84+
</tr>
85+
</tbody>
86+
</table>
9287
break;
9388
case AuthenticationScheme.Bearer:
9489
if (authentication.Properties is not BearerAuthenticationProperties bearer)
9590
{
9691
bearer = new();
9792
authentication.Properties = bearer;
9893
}
99-
<table class="table table-striped">
100-
<tbody>
101-
<tr>
102-
<td>Token</td>
103-
<td>
104-
<textarea placeholder="Token" title="The token to use to authenticate" class="form-control"
105-
@onchange="async e => await OnPropertyChangedAsync(nameof(authentication.Properties), a => ((BearerAuthenticationProperties)a.Properties).Token = (string)e.Value!)">@bearer.Token</textarea>
106-
</td>
107-
</tr>
108-
</tbody>
109-
</table>
94+
<table class="table table-striped">
95+
<tbody>
96+
<tr>
97+
<td>Token</td>
98+
<td><textarea placeholder="Token" title="The token to use to authenticate" class="form-control"
99+
@onchange="async e => await OnPropertyChangedAsync(nameof(authentication.Properties), a => ((BearerAuthenticationProperties)a.Properties).Token = (string)e.Value!)">@bearer.Token</textarea></td>
100+
</tr>
101+
</tbody>
102+
</table>
110103
break;
111104
case AuthenticationScheme.OAuth2:
112105
if (authentication.Properties is not OAuth2AuthenticationProperties oauth2)
@@ -116,10 +109,10 @@
116109
}
117110
break;
118111
default:
119-
<span class="text-danger">The specified authentication scheme '@(EnumHelper.Stringify(authentication.Scheme))' is not supported</span>
112+
<span class="text-danger">The specified authentication scheme '@(EnumHelper.Stringify(authentication.Scheme))' is not supported</span>
120113
break;
121114
}
122-
</td>
115+
</td>
123116
}
124117
</Body>
125118
</ExpandableDataRow>

0 commit comments

Comments
 (0)