@@ -120,9 +123,8 @@
OnChange="@OnChange"
TriggerParameters="@GetTriggerParameters()"
FlowItems="FlowItems"
- WorkflowId="@workflowId"/>
+ WorkflowId="@workflowId"/>
}
-
@if (_showError)
{
@@ -153,11 +155,9 @@
private bool _isManualTriggersExpanded;
private bool _isIssueCredentialExpanded;
private bool _isVerifyCredentialExpanded;
+ private bool _isValidationExpanded;
private bool _isOutgoingRequestExpanded;
- private bool HasActions => FlowItems.Any(x => x is WorkflowAction);
- private bool HasOutcome => FlowItems.Any(x => x is WorkflowOutcome);
-
private void ToggleGroup(string group)
{
switch (group)
@@ -177,13 +177,67 @@
case "verifyCredential":
_isVerifyCredentialExpanded = !_isVerifyCredentialExpanded;
break;
+ case "validation":
+ _isValidationExpanded = !_isValidationExpanded;
+ break;
case "outgoingRequest":
_isOutgoingRequestExpanded = !_isOutgoingRequestExpanded;
break;
}
}
- private object CreateNewItem(object itemType, string template)
+ private IEnumerable? GetTriggerParameters()
+ {
+ var trigger = FlowItems.FirstOrDefault(x => x is Trigger) as Trigger;
+ if (trigger == null)
+ return null;
+
+ if (trigger.Input is TriggerInputHttpRequest incomingRequest)
+ {
+ return incomingRequest.Parameters.Keys;
+ }
+ else if (trigger.Input is TriggerInputForm formTrigger)
+ {
+ return formTrigger.Parameters.Keys;
+ }
+
+ return null;
+ }
+
+ private async Task HandleItemClick(object itemType, MenuButton.MenuButtonAction action, string? template = null)
+ {
+ var newItem = CreateNewItem(itemType, template);
+ if (newItem != null)
+ {
+ await OnItemCreated.InvokeAsync(newItem);
+ if (action == MenuButton.MenuButtonAction.Configure)
+ {
+ await SelectItem(newItem);
+ }
+ }
+ }
+
+ private async Task SelectItem(object? item)
+ {
+ SelectedItem = item;
+ StateHasChanged();
+ }
+
+ private void ShowError(string message)
+ {
+ _errorMessage = message;
+ _showError = true;
+ StateHasChanged();
+ }
+
+ private void CloseError()
+ {
+ _errorMessage = null;
+ _showError = false;
+ StateHasChanged();
+ }
+
+ private object CreateNewItem(object itemType, string? template = null)
{
try
{
@@ -196,7 +250,7 @@
}
catch (Exception ex)
{
- HandleError(ex.Message);
+ ShowError(ex.Message);
throw;
}
}
@@ -217,7 +271,7 @@
Source = ParameterSource.TriggerInput,
Path = "peerDid"
},
- SenderPeerDid =new ParameterReference()
+ SenderPeerDid = new ParameterReference
{
Source = ParameterSource.AppSettings,
Path = "DefaultSenderDid"
@@ -252,38 +306,28 @@
},
Claims = new Dictionary()
},
- EActionType.IssueW3CSdCredential => new IssueW3CSdCredential
+ EActionType.W3cValidation => new W3cValidationAction
{
Id = Guid.NewGuid(),
- SubjectDid = new ParameterReference
- {
- Source = ParameterSource.TriggerInput,
- Path = "subjectDid"
- },
- IssuerDid = new ParameterReference
+ CredentialReference = new ParameterReference
{
- Source = ParameterSource.AppSettings,
- Path = "DefaultIssuerDid"
+ Source = ParameterSource.TriggerInput
},
- Claims = new Dictionary()
+ ValidationRules = new List(),
+ FailureAction = "Stop",
+ ErrorMessageTemplate = string.Empty
},
- EActionType.IssueAnoncredCredential => new IssueAnoncredCredential
+ EActionType.CustomValidation => new CustomValidationAction
{
Id = Guid.NewGuid(),
- SubjectDid = new ParameterReference
+ DataReference = new ParameterReference
{
- Source = ParameterSource.TriggerInput,
- Path = "subjectDid"
- },
- IssuerDid = new ParameterReference
- {
- Source = ParameterSource.AppSettings,
- Path = "DefaultIssuerDid"
+ Source = ParameterSource.TriggerInput
},
- CredentialDefinitionId = "",
- Attributes = new Dictionary()
+ ValidationRules = new List(),
+ FailureAction = "Stop"
},
- EActionType.VerifyW3CCredential => new VerifyW3cCredential
+EActionType.VerifyW3CCredential => new VerifyW3cCredential
{
Id = Guid.NewGuid(),
CheckSignature = true,
@@ -316,57 +360,6 @@
};
}
- private async Task HandleItemClick(object itemType, MenuButton.MenuButtonAction action, string? template = null)
- {
- var newItem = CreateNewItem(itemType, template);
- if (newItem != null)
- {
- await OnItemCreated.InvokeAsync(newItem);
- if (action == MenuButton.MenuButtonAction.Configure)
- {
- await SelectItem(newItem);
- }
- }
- }
-
- private async Task SelectItem(object? item)
- {
- SelectedItem = item;
- StateHasChanged();
- }
-
- private IEnumerable? GetTriggerParameters()
- {
- var trigger = FlowItems.FirstOrDefault(x => x is Trigger) as Trigger;
- if (trigger == null)
- return null;
-
- if (trigger.Input is TriggerInputHttpRequest incomingRequest)
- {
- return incomingRequest.Parameters.Keys;
- }
- else if (trigger.Input is TriggerInputForm formTrigger)
- {
- return formTrigger.Parameters.Keys;
- }
-
- return null;
- }
-
- private async Task HandleError(string message)
- {
- _errorMessage = message;
- _showError = true;
- StateHasChanged();
- }
-
- private void CloseError()
- {
- _errorMessage = null;
- _showError = false;
- StateHasChanged();
- }
-
private Trigger CreateNewTrigger(ETriggerType triggerType, string? template = null)
{
TriggerInput trigger;
@@ -439,12 +432,10 @@
throw new ArgumentException($"Trigger type {triggerType} is not implemented.");
}
-
return new Trigger
{
Type = triggerType,
Input = trigger
};
}
-
}
\ No newline at end of file
diff --git a/Blocktrust.CredentialWorkflow.Web/wwwroot/app.css b/Blocktrust.CredentialWorkflow.Web/wwwroot/app.css
index 8d40d1e..aa4b458 100644
--- a/Blocktrust.CredentialWorkflow.Web/wwwroot/app.css
+++ b/Blocktrust.CredentialWorkflow.Web/wwwroot/app.css
@@ -1149,10 +1149,6 @@ video {
overflow-y: auto;
}
-.overflow-x-hidden {
- overflow-x: hidden;
-}
-
.truncate {
overflow: hidden;
text-overflow: ellipsis;
@@ -1859,12 +1855,6 @@ video {
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}
-.ring-2 {
- --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
- --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
- box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
-}
-
.ring-inset {
--tw-ring-inset: inset;
}
@@ -1874,11 +1864,6 @@ video {
--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
}
-.ring-slate-500 {
- --tw-ring-opacity: 1;
- --tw-ring-color: rgb(100 116 139 / var(--tw-ring-opacity));
-}
-
.transition {
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
@@ -2056,11 +2041,6 @@ a {
color: rgb(17 24 39 / var(--tw-text-opacity));
}
-.hover\:text-green-800:hover {
- --tw-text-opacity: 1;
- color: rgb(22 101 52 / var(--tw-text-opacity));
-}
-
.hover\:text-green-900:hover {
--tw-text-opacity: 1;
color: rgb(20 83 45 / var(--tw-text-opacity));
@@ -2081,11 +2061,6 @@ a {
color: rgb(51 65 85 / var(--tw-text-opacity));
}
-.hover\:text-slate-900:hover {
- --tw-text-opacity: 1;
- color: rgb(15 23 42 / var(--tw-text-opacity));
-}
-
.hover\:opacity-80:hover {
opacity: 0.8;
}