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/30 13:43:57 UTC

[isis] 02/03: ISIS-2348 EventComparison with response diff

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 8deeff00b91782b007871863ef9094f5bc3a1717
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Tue Nov 30 14:43:15 2021 +0100

    ISIS-2348 EventComparison with response diff
---
 .../client/kroviz/core/event/RoXmlHttpRequest.kt   | 13 ++++++++++-
 .../apache/isis/client/kroviz/utils/Diff2HtmlUI.kt | 27 ----------------------
 2 files changed, 12 insertions(+), 28 deletions(-)

diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt
index 2a0b544..72296e8 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt
@@ -28,6 +28,7 @@ import org.apache.isis.client.kroviz.ui.core.Constants
 import org.apache.isis.client.kroviz.ui.core.UiManager
 import org.apache.isis.client.kroviz.utils.StringUtils
 import org.apache.isis.client.kroviz.utils.UrlUtils
+import org.apache.isis.client.kroviz.utils.XmlHelper
 import org.w3c.xhr.BLOB
 import org.w3c.xhr.TEXT
 import org.w3c.xhr.XMLHttpRequest
@@ -125,7 +126,17 @@ class RoXmlHttpRequest(val aggregator: BaseAggregator?) {
     }
 
     private fun handleResult(rs: ResourceSpecification, body: String) {
-        val response: Any? = xhr.response
+        var response: Any? = xhr.response
+       if (rs.url.contains("layout")) {
+            if (rs.subType == Constants.subTypeXml) {
+               response = XmlHelper.format(response as String)
+                console.log("[RXHR.handleResult]")
+                console.log(response)
+            }
+  /*          if (rs.subType == Constants.subTypeJson) {
+                response = StringUtils.format(response as String)
+            }*/
+        }
         val le: LogEntry? = UiManager.getEventStore().end(rs, body, response)
         if (le != null) {
             when {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/Diff2HtmlUI.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/Diff2HtmlUI.kt
deleted file mode 100644
index 575468a..0000000
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/Diff2HtmlUI.kt
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- *  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.utils
-
-import kotlin.js.Json
-
-@JsModule("diff2html")
-@JsNonModule
-external object Diff2HtmlUI {
-    fun html(diff: Diff, options: Json): String
-}