You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by jo...@apache.org on 2021/11/10 07:39:00 UTC
[isis] 02/06: ISIS-2348 Replay Diff opens
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit af46825ebdc9c0ae6830581b6328b782f024b443
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Mon Oct 25 09:39:53 2021 +0200
ISIS-2348 Replay Diff opens
---
.../isis/client/kroviz/core/event/ReplayCommand.kt | 21 +++++++--
.../client/kroviz/ui/dialog/ReplayDiffDialog.kt | 55 ++++++++++++++++++++++
2 files changed, 71 insertions(+), 5 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/ReplayCommand.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/ReplayCommand.kt
index 5a5cb36..bad2953 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/ReplayCommand.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/ReplayCommand.kt
@@ -28,19 +28,29 @@ import org.apache.isis.client.kroviz.to.Link
import org.apache.isis.client.kroviz.to.Represention
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.ui.core.UiManager
+import org.apache.isis.client.kroviz.ui.dialog.ReplayDiffDialog
+import org.apache.isis.client.kroviz.ui.panel.EventLogTable
val AppScope = CoroutineScope(window.asCoroutineDispatcher())
class ReplayCommand {
+ private val eventStore = UiManager.getEventStore()
fun execute() {
- val es = UiManager.getEventStore()
- val expectedEvents = copyEvents(es.log)
- es.reset()
+ val expectedEvents = copyEvents(eventStore.log)
+ eventStore.reset()
main() // re-creates the UI, but keeps the UiManager(singleton/object) and the session
- val replayEvents = filterReplayEvents(expectedEvents)
- replay(replayEvents)
+ val uiEvents = filterReplayEvents(expectedEvents)
+ replay(uiEvents)
+ val actualEvents: MutableList<LogEntry> = eventStore.log
+
+ val expectedTable = EventLogTable(expectedEvents)
+ val actualTable = EventLogTable(actualEvents)
+ val rdd = ReplayDiffDialog()
+ rdd.expectedPanel.add(expectedTable)
+ rdd.actualPanel.add(actualTable)
+ rdd.dialog.open()
}
private fun replay(userActions: List<LogEntry>) {
@@ -93,6 +103,7 @@ class ReplayCommand {
output.type = input.type
output.obj = input.obj
output.state = input.state
+ output.response = input.response
return output
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ReplayDiffDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ReplayDiffDialog.kt
new file mode 100644
index 0000000..ce9e7bc
--- /dev/null
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ReplayDiffDialog.kt
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.client.kroviz.ui.dialog
+
+import io.kvision.core.CssSize
+import io.kvision.core.UNIT
+import io.kvision.panel.Direction
+import io.kvision.panel.SplitPanel
+import io.kvision.panel.VPanel
+import org.apache.isis.client.kroviz.ui.core.FormItem
+import org.apache.isis.client.kroviz.ui.core.RoDialog
+
+class ReplayDiffDialog : Command() {
+ var dialog: RoDialog
+
+ val expectedPanel = VPanel(spacing = 3) {
+ width = CssSize(20, UNIT.perc)
+ }
+ val actualPanel = VPanel(spacing = 3) {
+ width = CssSize(80, UNIT.perc)
+ }
+
+ init {
+ dialog = RoDialog(
+ caption = "Replay Diff",
+ items = mutableListOf<FormItem>(),
+ command = this,
+ defaultAction = "",
+ widthPerc = 60,
+ customButtons = mutableListOf<FormItem>()
+ )
+ val splitPanel = SplitPanel(direction = Direction.VERTICAL)
+ splitPanel.add(expectedPanel)
+ splitPanel.add(actualPanel)
+ dialog.formPanel!!.add(splitPanel)
+ }
+
+}