Skip to content

Commit

Permalink
STNG-132 Final touches on sandbox state in the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
gj0dcsa committed Aug 11, 2024
1 parent 1910bec commit ffad2d1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ private EblIssuanceStandard() {
public SortedMap<String, SortedSet<String>> getScenarioSuitesByStandardVersion() {
return new TreeMap<>(
Map.ofEntries(
Map.entry("2.0.0", new TreeSet<>(Set.of("Conformance"))),
Map.entry("3.0.0", new TreeSet<>(Set.of("Conformance")))));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ private EblSurrenderStandard() {
public SortedMap<String, SortedSet<String>> getScenarioSuitesByStandardVersion() {
return new TreeMap<>(
Map.ofEntries(
Map.entry("2.0.0", new TreeSet<>(Set.of("Conformance"))),
Map.entry("3.0.0", new TreeSet<>(Set.of("Conformance")))));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ public static ObjectNode handleActionInput(
return OBJECT_MAPPER.createObjectNode();
}

public static JsonNode startOrStopScenario(
public static void startOrStopScenario(
ConformancePersistenceProvider persistenceProvider,
Consumer<JsonNode> deferredSandboxTaskConsumer,
String sandboxId,
Expand All @@ -486,10 +486,9 @@ public static JsonNode startOrStopScenario(
ConformanceSandbox._asyncSendOutboundWebRequest(
deferredSandboxTaskConsumer, conformanceWebRequest),
sandboxId,
"starting in sandbox %s scenario %s".formatted(sandboxId, scenarioId),
"starting or stopping in sandbox %s scenario %s".formatted(sandboxId, scenarioId),
orchestrator -> orchestrator.startOrStopScenario(scenarioId))
.run();
return OBJECT_MAPPER.createObjectNode();
}

public static JsonNode completeCurrentAction(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,13 @@ private JsonNode _handleActionInput(String userId, JsonNode requestNode) {
private JsonNode _startOrStopScenario(String userId, JsonNode requestNode) {
String sandboxId = requestNode.get("sandboxId").asText();
accessChecker.checkUserSandboxAccess(userId, sandboxId);
return ConformanceSandbox.startOrStopScenario(
ConformanceSandbox.startOrStopScenario(
persistenceProvider,
deferredSandboxTaskConsumer,
sandboxId,
requestNode.get("scenarioId").asText());
ConformanceSandbox.resetParty(persistenceProvider, deferredSandboxTaskConsumer, sandboxId);
return OBJECT_MAPPER.createObjectNode();
}

private JsonNode _completeCurrentAction(String userId, JsonNode requestNode) {
Expand Down
2 changes: 1 addition & 1 deletion webui/src/app/pages/scenario/scenario.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<div class="pageTitle">Current action: <b>{{getCurrentActionTitle()}}</b></div>

<div *ngIf="scenarioStatus.promptText">
<div class="paragraph">{{scenarioStatus.promptText}}</div>
<div class="paragraph">▶️ {{scenarioStatus.promptText}}</div>

<div *ngIf="scenarioStatus.jsonForPromptText" class="paragraph">
<pre>{{getJsonForPromptText()}}</pre>
Expand Down

0 comments on commit ffad2d1

Please sign in to comment.