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/12 17:09:01 UTC
[isis] branch master updated (a9c1cb7 -> 2d3e045)
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git.
from a9c1cb7 ISIS-2882: fixes flipped logic in prev. commit
new 81c6102 ISIS-2348 Handle blob error, upgrade to kvision 5.5.1, minor cleanup
new 92f110f ISIS-2348 Stackup dialogs visually (with some offset)
new a708a12 ISIS-2348 Actual events in DiffDialog filled
new 310e780 ISIS-2348 RoDisplay moved into builder dir, spacing extracted to Constants
new 1a6b4a8 ISIS-2348 amend with specific handling for HTTP 401
new 7c3d99d ISIS-2348 amend LoginPrompt with dropdown for localhost & incode
new 2d3e045 Merge branch 'master' of https://github.com/apache/isis
The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
incubator/clients/kroviz/gradle.properties | 2 +-
.../kroviz/core/aggregator/ErrorDispatcher.kt | 5 +--
.../isis/client/kroviz/core/event/ReplayCommand.kt | 4 +--
.../client/kroviz/core/event/RoXmlHttpRequest.kt | 16 ++++++---
...{HttpErrorHandler.kt => Http401ErrorHandler.kt} | 6 ++--
.../isis/client/kroviz/handler/ResponseHandler.kt | 4 ++-
.../isis/client/kroviz/to/PlainTransferObjects.kt | 38 +++++++++++++++++++---
.../isis/client/kroviz/ui/builder/ColBuilder.kt | 19 ++++++-----
.../client/kroviz/ui/builder/FieldSetBuilder.kt | 1 -
.../isis/client/kroviz/ui/builder/LayoutBuilder.kt | 1 -
.../kroviz/ui/{core => builder}/RoDisplay.kt | 11 +++----
.../isis/client/kroviz/ui/builder/RowBuilder.kt | 4 +--
.../isis/client/kroviz/ui/builder/TabBuilder.kt | 1 -
.../client/kroviz/ui/builder/TabGroupBuilder.kt | 1 -
.../apache/isis/client/kroviz/ui/core/Constants.kt | 2 ++
.../apache/isis/client/kroviz/ui/core/RoDialog.kt | 10 +++---
.../apache/isis/client/kroviz/ui/core/RoView.kt | 26 ++++++++++-----
.../apache/isis/client/kroviz/ui/core/UiManager.kt | 16 +++++++--
.../isis/client/kroviz/ui/dialog/ErrorDialog.kt | 8 +++--
.../isis/client/kroviz/ui/dialog/LoginPrompt.kt | 12 +++++--
.../client/kroviz/ui/dialog/ReplayDiffDialog.kt | 6 ++--
.../client/kroviz/ui/kv/override/RoTabPanel.kt | 2 +-
.../isis/client/kroviz/ui/panel/DropdownSearch.kt | 2 +-
.../isis/client/kroviz/ui/panel/EventLogTable.kt | 2 +-
.../HTTP_ERROR_401.kt} | 14 ++++----
.../apache/isis/client/kroviz/to/HttpErrorTest.kt | 38 ++++++++++++++--------
26 files changed, 165 insertions(+), 86 deletions(-)
copy incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/{HttpErrorHandler.kt => Http401ErrorHandler.kt} (87%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{core => builder}/RoDisplay.kt (89%)
copy incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/{simpleapp1_16_0/HTTP_ERROR_404.kt => demo2_0_0/HTTP_ERROR_401.kt} (79%)
[isis] 06/07: ISIS-2348 amend LoginPrompt with dropdown for
localhost & incode
Posted by jo...@apache.org.
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 7c3d99da7535a1d9a9eeb3ea7cf37671b6bb69a7
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Fri Nov 12 18:07:57 2021 +0100
ISIS-2348 amend LoginPrompt with dropdown for localhost & incode
---
.../apache/isis/client/kroviz/ui/core/RoView.kt | 26 +++++++++++++++-------
.../isis/client/kroviz/ui/dialog/LoginPrompt.kt | 12 +++++++---
.../client/kroviz/ui/kv/override/RoTabPanel.kt | 2 +-
3 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt
index ac32af2..834c160 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt
@@ -22,8 +22,10 @@ import io.kvision.core.BsBorder
import io.kvision.core.Component
import io.kvision.core.addBsBorder
import io.kvision.panel.SimplePanel
+import org.apache.isis.client.kroviz.ui.kv.override.RoTab
import org.apache.isis.client.kroviz.ui.kv.override.RoTabPanel
import org.apache.isis.client.kroviz.utils.IconManager
+import org.w3c.dom.Element
/**
* Area between menu bar at the top and the status bar at the bottom.
@@ -35,8 +37,9 @@ class RoView() {
private var tabCount = 0
fun addTab(
- title: String,
- panel: Component) {
+ title: String,
+ panel: Component
+ ) {
panel.addBsBorder(BsBorder.BORDER)
val index = tabPanel.findTab(title)
if (index != null) {
@@ -47,13 +50,20 @@ class RoView() {
}
val icon = IconManager.find(title)
+ val tab = RoTab(
+ title,
+ panel,
+ icon,
+ image = null,
+ closable = true
+ )
+ tab.addAfterInsertHook {
+ tab.getElement()?.unsafeCast<Element>()?.querySelector("i")?.addEventListener("click", {
+ console.log("icon clicked")
+ })
+ }
- tabPanel.addTab(
- title,
- panel,
- icon,
- image = null,
- closable = true)
+ tabPanel.add(tab)
tabPanel.activeIndex = tabCount
tabCount += 1
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/LoginPrompt.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/LoginPrompt.kt
index 628057b..8a3b12f 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/LoginPrompt.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/LoginPrompt.kt
@@ -18,6 +18,8 @@
*/
package org.apache.isis.client.kroviz.ui.dialog
+import io.kvision.core.StringPair
+import io.kvision.form.select.SimpleSelect
import io.kvision.form.text.Password
import io.kvision.form.text.Text
import org.apache.isis.client.kroviz.to.Link
@@ -38,7 +40,10 @@ class LoginPrompt : Command() {
fun open() {
val formItems = mutableListOf<FormItem>()
- formItems.add(FormItem("Url", ValueType.TEXT, url))
+ val urlList = mutableListOf<StringPair>()
+ urlList.add(StringPair(Constants.demoUrl, Constants.demoUrl))
+ urlList.add(StringPair(Constants.demoUrlRemote, Constants.demoUrlRemote))
+ formItems.add(FormItem("Url", ValueType.SIMPLE_SELECT, urlList))
formItems.add(FormItem("User", ValueType.TEXT, username))
formItems.add(FormItem("Password", ValueType.PASSWORD, password))
form = RoDialog(caption = "Connect", items = formItems, command = this, heightPerc = 27)
@@ -62,10 +67,11 @@ class LoginPrompt : Command() {
//iterate over FormItems (0,1,2) but not Buttons(3,4)
for (i in kids) {
when (i) {
+ is SimpleSelect -> {
+ url = i.getValue()!!
+ }
is Text -> {
key = i.label!!
- if (key == "Url")
- url = i.getValue()!!
if (key == "User")
username = i.getValue()!!
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
index 3f4da88..be62852 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
@@ -71,7 +71,7 @@ enum class SideTabSize {
open class RoTabPanel(
protected val tabPosition: TabPosition = TabPosition.TOP,
protected val sideTabSize: SideTabSize = SideTabSize.SIZE_3,
- val scrollableTabs: Boolean = false,
+ val scrollableTabs: Boolean = true,
val draggableTabs: Boolean = false,
className: String? = null,
init: (RoTabPanel.() -> Unit)? = null
[isis] 04/07: ISIS-2348 RoDisplay moved into builder dir,
spacing extracted to Constants
Posted by jo...@apache.org.
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 310e780fdae771c166f66609f26fc620285537b7
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Fri Nov 12 17:20:08 2021 +0100
ISIS-2348 RoDisplay moved into builder dir, spacing extracted to Constants
---
.../isis/client/kroviz/ui/builder/ColBuilder.kt | 19 ++++++++++---------
.../isis/client/kroviz/ui/builder/FieldSetBuilder.kt | 1 -
.../isis/client/kroviz/ui/builder/LayoutBuilder.kt | 1 -
.../client/kroviz/ui/{core => builder}/RoDisplay.kt | 11 +++++------
.../isis/client/kroviz/ui/builder/RowBuilder.kt | 4 ++--
.../isis/client/kroviz/ui/builder/TabBuilder.kt | 1 -
.../isis/client/kroviz/ui/builder/TabGroupBuilder.kt | 1 -
.../apache/isis/client/kroviz/ui/core/Constants.kt | 2 ++
.../apache/isis/client/kroviz/ui/core/UiManager.kt | 1 +
9 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/ColBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/ColBuilder.kt
index 02f9ac5..eec96ab 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/ColBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/ColBuilder.kt
@@ -25,8 +25,8 @@ import io.kvision.panel.HPanel
import io.kvision.panel.SimplePanel
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.bs3.Col
+import org.apache.isis.client.kroviz.ui.core.Constants
import org.apache.isis.client.kroviz.ui.core.MenuFactory
-import org.apache.isis.client.kroviz.ui.core.RoDisplay
import org.apache.isis.client.kroviz.ui.core.RoTable
import org.apache.isis.client.kroviz.utils.StringUtils
import kotlin.math.round
@@ -79,12 +79,13 @@ class ColBuilder : UiBuilder() {
private fun buildPanel(): FlexPanel {
return FlexPanel(
- FlexDirection.COLUMN,
- FlexWrap.NOWRAP,
- JustifyContent.SPACEBETWEEN,
- AlignItems.CENTER,
- AlignContent.STRETCH,
- spacing = 10)
+ FlexDirection.COLUMN,
+ FlexWrap.NOWRAP,
+ JustifyContent.SPACEBETWEEN,
+ AlignItems.CENTER,
+ AlignContent.STRETCH,
+ spacing = Constants.spacing
+ )
}
fun createMenu(tObject: TObject, dsp: RoDisplay): HPanel {
@@ -92,8 +93,8 @@ class ColBuilder : UiBuilder() {
style(panel)
val dd = MenuFactory.buildForObject(tObject)
- dd.marginTop = CssSize(10, UNIT.px)
- dd.marginBottom = CssSize(10, UNIT.px)
+ dd.marginTop = CssSize(Constants.spacing, UNIT.px)
+ dd.marginBottom = CssSize(Constants.spacing, UNIT.px)
dd.width = CssSize(100, UNIT.perc)
MenuFactory.amendWithSaveUndo(dd, tObject)
MenuFactory.disableSaveUndo(dd)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/FieldSetBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/FieldSetBuilder.kt
index 208c0eb..744af77 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/FieldSetBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/FieldSetBuilder.kt
@@ -24,7 +24,6 @@ import org.apache.isis.client.kroviz.to.TypeMapper
import org.apache.isis.client.kroviz.to.bs3.FieldSet
import org.apache.isis.client.kroviz.ui.core.FormItem
import org.apache.isis.client.kroviz.ui.core.FormPanelFactory
-import org.apache.isis.client.kroviz.ui.core.RoDisplay
class FieldSetBuilder {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/LayoutBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/LayoutBuilder.kt
index 7d28092..1bc51fc 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/LayoutBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/LayoutBuilder.kt
@@ -21,7 +21,6 @@ package org.apache.isis.client.kroviz.ui.builder
import io.kvision.panel.VPanel
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.bs3.Grid
-import org.apache.isis.client.kroviz.ui.core.RoDisplay
class LayoutBuilder {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDisplay.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/RoDisplay.kt
similarity index 89%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDisplay.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/RoDisplay.kt
index ecd6b7f..a04eb1e 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDisplay.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/RoDisplay.kt
@@ -16,17 +16,15 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.core
+package org.apache.isis.client.kroviz.ui.builder
-import io.kvision.core.CssSize
-import io.kvision.core.FontStyle
-import io.kvision.core.FontWeight
-import io.kvision.core.UNIT
+import io.kvision.core.*
import io.kvision.dropdown.DropDown
import io.kvision.panel.VPanel
import org.apache.isis.client.kroviz.core.model.ObjectDM
import org.apache.isis.client.kroviz.to.TObject
-import org.apache.isis.client.kroviz.ui.builder.LayoutBuilder
+import org.apache.isis.client.kroviz.ui.core.Displayable
+import org.apache.isis.client.kroviz.ui.core.MenuFactory
class RoDisplay(val displayModel: ObjectDM) : Displayable, VPanel() {
@@ -38,6 +36,7 @@ class RoDisplay(val displayModel: ObjectDM) : Displayable, VPanel() {
val tObject: TObject = model.delegate
val grid = displayModel.grid!!
objectPanel = LayoutBuilder().create(grid, tObject, this)
+ objectPanel.overflow = Overflow.AUTO
objectPanel.width = CssSize(100, UNIT.perc)
add(objectPanel)
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/RowBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/RowBuilder.kt
index 2f8afea..c537eb6 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/RowBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/RowBuilder.kt
@@ -23,7 +23,7 @@ import io.kvision.panel.FlexPanel
import io.kvision.panel.SimplePanel
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.bs3.Row
-import org.apache.isis.client.kroviz.ui.core.RoDisplay
+import org.apache.isis.client.kroviz.ui.core.Constants
class RowBuilder : UiBuilder() {
@@ -45,7 +45,7 @@ class RowBuilder : UiBuilder() {
JustifyContent.FLEXSTART,
AlignItems.FLEXSTART,
AlignContent.STRETCH,
- spacing = 10)
+ spacing = Constants.spacing)
}
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabBuilder.kt
index b8a6fb2..30aab37 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabBuilder.kt
@@ -20,7 +20,6 @@ package org.apache.isis.client.kroviz.ui.builder
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.bs3.Tab
-import org.apache.isis.client.kroviz.ui.core.RoDisplay
import io.kvision.core.Component
import io.kvision.panel.SimplePanel
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabGroupBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabGroupBuilder.kt
index ac05b90..02aca31 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabGroupBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabGroupBuilder.kt
@@ -20,7 +20,6 @@ package org.apache.isis.client.kroviz.ui.builder
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.bs3.TabGroup
-import org.apache.isis.client.kroviz.ui.core.RoDisplay
import io.kvision.core.Component
import io.kvision.panel.TabPanel
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/Constants.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/Constants.kt
index 076960a..53505fd 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/Constants.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/Constants.kt
@@ -39,4 +39,6 @@ object Constants {
const val demoUser = "sven"
const val demoPass = "pass"
const val demoUrlRemote = "https://demo-wicket.jdo.isis.incode.work/"
+
+ const val spacing = 10
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
index cb85cb8..9f7a6ad 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
@@ -38,6 +38,7 @@ import org.apache.isis.client.kroviz.core.model.ObjectDM
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.ValueType
import org.apache.isis.client.kroviz.to.mb.Menubars
+import org.apache.isis.client.kroviz.ui.builder.RoDisplay
import org.apache.isis.client.kroviz.ui.kv.override.RoTab
import org.apache.isis.client.kroviz.utils.*
import org.w3c.dom.events.KeyboardEvent
[isis] 02/07: ISIS-2348 Stackup dialogs visually (with some offset)
Posted by jo...@apache.org.
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 92f110fe0f8769a6a5963e123a20fdbf5294c1e5
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Wed Nov 10 18:46:21 2021 +0100
ISIS-2348 Stackup dialogs visually (with some offset)
---
.../main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt | 5 +++--
.../main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt | 4 ++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt
index 6286239..1403df5 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt
@@ -128,8 +128,9 @@ class RoDialog(
}
fun open(at: Point = Point(100, 100)): Widget {
- left = CssSize(at.x, UNIT.px)
- top = CssSize(at.y, UNIT.px)
+ val offset = UiManager.getNumberOfPopups() * 4
+ left = CssSize(at.x + offset, UNIT.px)
+ top = CssSize(at.y + offset, UNIT.px)
UiManager.openDialog(this)
super.show()
okButton.focus()
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
index a75b415..c7fcda3 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
@@ -242,6 +242,10 @@ object UiManager {
}
}
+ fun getNumberOfPopups(): Int {
+ return popups.size
+ }
+
fun performUserAction(aggregator: BaseAggregator, obj: TObject) {
setBusyCursor()
getEventStore().addUserAction(aggregator, obj)
[isis] 05/07: ISIS-2348 amend with specific handling for HTTP 401
Posted by jo...@apache.org.
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 1a6b4a871de2a0c7d267d46b2f188ce4e128b33e
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Fri Nov 12 18:00:48 2021 +0100
ISIS-2348 amend with specific handling for HTTP 401
---
.../kroviz/core/aggregator/ErrorDispatcher.kt | 5 +--
.../Http401ErrorHandler.kt} | 26 +++++++--------
.../isis/client/kroviz/handler/ResponseHandler.kt | 4 ++-
.../isis/client/kroviz/to/PlainTransferObjects.kt | 38 +++++++++++++++++++---
.../isis/client/kroviz/ui/dialog/ErrorDialog.kt | 8 +++--
.../kroviz/snapshots/demo2_0_0/HTTP_ERROR_401.kt} | 27 ++++++---------
.../apache/isis/client/kroviz/to/HttpErrorTest.kt | 38 ++++++++++++++--------
7 files changed, 92 insertions(+), 54 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ErrorDispatcher.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ErrorDispatcher.kt
index 35add14..5b595c7 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ErrorDispatcher.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ErrorDispatcher.kt
@@ -21,15 +21,16 @@ package org.apache.isis.client.kroviz.core.aggregator
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.core.event.ResourceSpecification
import org.apache.isis.client.kroviz.to.HttpError
+import org.apache.isis.client.kroviz.to.HttpResponse
import org.apache.isis.client.kroviz.ui.core.UiManager
import org.apache.isis.client.kroviz.ui.dialog.ErrorDialog
class ErrorDispatcher : BaseAggregator() {
override fun update(logEntry: LogEntry, subType: String) {
- val error = logEntry.getTransferObject() as HttpError
+ val error = logEntry.getTransferObject() as HttpResponse
val url = logEntry.url
- val message = error.message
+ val message = error.getMessage()
val reSpec = ResourceSpecification(url)
UiManager.getEventStore().fault(reSpec, message)
ErrorDialog(logEntry).open()
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ErrorDispatcher.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/Http401ErrorHandler.kt
similarity index 53%
copy from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ErrorDispatcher.kt
copy to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/Http401ErrorHandler.kt
index 35add14..2d9333b 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ErrorDispatcher.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/Http401ErrorHandler.kt
@@ -16,23 +16,21 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.core.aggregator
+package org.apache.isis.client.kroviz.handler
-import org.apache.isis.client.kroviz.core.event.LogEntry
-import org.apache.isis.client.kroviz.core.event.ResourceSpecification
-import org.apache.isis.client.kroviz.to.HttpError
-import org.apache.isis.client.kroviz.ui.core.UiManager
-import org.apache.isis.client.kroviz.ui.dialog.ErrorDialog
+import kotlinx.serialization.json.Json
+import org.apache.isis.client.kroviz.core.aggregator.ErrorDispatcher
+import org.apache.isis.client.kroviz.to.Http401Error
+import org.apache.isis.client.kroviz.to.TransferObject
-class ErrorDispatcher : BaseAggregator() {
+class Http401ErrorHandler : BaseHandler() {
- override fun update(logEntry: LogEntry, subType: String) {
- val error = logEntry.getTransferObject() as HttpError
- val url = logEntry.url
- val message = error.message
- val reSpec = ResourceSpecification(url)
- UiManager.getEventStore().fault(reSpec, message)
- ErrorDialog(logEntry).open()
+ override fun doHandle() {
+ logEntry.addAggregator(ErrorDispatcher())
+ update()
}
+ override fun parse(response: String): TransferObject {
+ return Json.decodeFromString(Http401Error.serializer(), response)
+ }
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/ResponseHandler.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/ResponseHandler.kt
index 7391cf0..a02a1d4 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/ResponseHandler.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/ResponseHandler.kt
@@ -42,6 +42,7 @@ object ResponseHandler {
private var _7a = CollectionHandler()
private var _8 = MemberHandler()
private var _9 = HttpErrorHandler()
+ private var _9a = Http401ErrorHandler()
private var _10 = UserHandler()
private var _11 = VersionHandler()
private var _12 = DomainTypesHandler()
@@ -65,7 +66,8 @@ object ResponseHandler {
_7.successor = _7a
_7a.successor = _8
_8.successor = _9
- _9.successor = _10
+ _9.successor = _9a
+ _9a.successor = _10
_10.successor = _11
_11.successor = _12
_12.successor = _13
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/to/PlainTransferObjects.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/to/PlainTransferObjects.kt
index 2d05e0d..c9e6d14 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/to/PlainTransferObjects.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/to/PlainTransferObjects.kt
@@ -34,12 +34,25 @@ data class DomainTypes(override val links: List<Link> = emptyList(),
val extensions: Extensions? = null
) : TransferObject, HasLinks
+interface HttpResponse {
+ val detail: HttpErrorDetail?
+ fun getMessage(): String
+ fun getStatusCode(): Int
+}
+
@Serializable
data class HttpError(
- val httpStatusCode: Int,
- val message: String,
- val detail: HttpErrorDetail? = null
-) : TransferObject
+ private val httpStatusCode: Int,
+ private val message: String,
+ override val detail: HttpErrorDetail? = null
+) : TransferObject, HttpResponse {
+ override fun getMessage() : String {
+ return message
+ }
+ override fun getStatusCode() : Int {
+ return httpStatusCode
+ }
+}
@Serializable
data class HttpErrorDetail(
@@ -50,6 +63,23 @@ data class HttpErrorDetail(
) : TransferObject
@Serializable
+data class Http401Error(
+ private val timestamp: String,
+ private val status: Int,
+ private val error: String,
+ private val path: String,
+ override val detail: HttpErrorDetail? = null
+) : TransferObject, HttpResponse {
+ override fun getMessage(): String {
+ return error + " / " + path + " / " + timestamp
+ }
+ override fun getStatusCode() : Int {
+ return status
+ }
+
+}
+
+@Serializable
data class Links(
@SerialName("links") val content: List<Link> = emptyList()
) : TransferObject
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ErrorDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ErrorDialog.kt
index 066ccc9..1015516 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ErrorDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ErrorDialog.kt
@@ -19,7 +19,9 @@
package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.core.event.LogEntry
+import org.apache.isis.client.kroviz.to.Http401Error
import org.apache.isis.client.kroviz.to.HttpError
+import org.apache.isis.client.kroviz.to.HttpResponse
import org.apache.isis.client.kroviz.to.ValueType
import org.apache.isis.client.kroviz.ui.core.FormItem
import org.apache.isis.client.kroviz.ui.core.RoDialog
@@ -27,16 +29,16 @@ import org.apache.isis.client.kroviz.ui.core.RoDialog
class ErrorDialog(val logEntry: LogEntry) : Command() {
fun open() {
- val error = logEntry.getTransferObject() as HttpError
+ val error = logEntry.getTransferObject() as HttpResponse
val formItems = mutableListOf<FormItem>()
formItems.add(FormItem("URL", ValueType.TEXT, logEntry.url))
- formItems.add(FormItem("Message", ValueType.TEXT, error.message))
+ formItems.add(FormItem("Message", ValueType.TEXT, error.getMessage()))
val detail = error.detail
if (detail != null) {
formItems.add(FormItem("StackTrace", ValueType.TEXT_AREA, toString(detail.element), 10))
formItems.add(FormItem("Caused by", ValueType.TEXT, detail.causedBy))
}
- val label = "HttpError " + error.httpStatusCode.toString()
+ val label = "HttpError " + error.getStatusCode().toString()
RoDialog(
caption = label,
items = formItems,
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ErrorDispatcher.kt b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/demo2_0_0/HTTP_ERROR_401.kt
similarity index 53%
copy from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ErrorDispatcher.kt
copy to incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/demo2_0_0/HTTP_ERROR_401.kt
index 35add14..1f1d982 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ErrorDispatcher.kt
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/demo2_0_0/HTTP_ERROR_401.kt
@@ -16,23 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.core.aggregator
+package org.apache.isis.client.kroviz.snapshots.demo2_0_0
-import org.apache.isis.client.kroviz.core.event.LogEntry
-import org.apache.isis.client.kroviz.core.event.ResourceSpecification
-import org.apache.isis.client.kroviz.to.HttpError
-import org.apache.isis.client.kroviz.ui.core.UiManager
-import org.apache.isis.client.kroviz.ui.dialog.ErrorDialog
-
-class ErrorDispatcher : BaseAggregator() {
-
- override fun update(logEntry: LogEntry, subType: String) {
- val error = logEntry.getTransferObject() as HttpError
- val url = logEntry.url
- val message = error.message
- val reSpec = ResourceSpecification(url)
- UiManager.getEventStore().fault(reSpec, message)
- ErrorDialog(logEntry).open()
- }
+import org.apache.isis.client.kroviz.snapshots.Response
+object HTTP_ERROR_401 : Response() {
+ override val url = ""
+ override val str = """{
+ "timestamp": "2021-11-12T15:39:15.039+00:00",
+ "status": 401,
+ "error": "Unauthorized",
+ "path": "/restful/"
+}"""
}
diff --git a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/to/HttpErrorTest.kt b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/to/HttpErrorTest.kt
index f68d730..7aacdd4 100644
--- a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/to/HttpErrorTest.kt
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/to/HttpErrorTest.kt
@@ -18,9 +18,11 @@
*/
package org.apache.isis.client.kroviz.to
+import org.apache.isis.client.kroviz.handler.Http401ErrorHandler
import org.apache.isis.client.kroviz.handler.HttpErrorHandler
-import org.apache.isis.client.kroviz.snapshots.demo2_0_0.HTTP_ERROR_500
+import org.apache.isis.client.kroviz.snapshots.demo2_0_0.HTTP_ERROR_401
import org.apache.isis.client.kroviz.snapshots.demo2_0_0.HTTP_ERROR_405
+import org.apache.isis.client.kroviz.snapshots.demo2_0_0.HTTP_ERROR_500
import org.apache.isis.client.kroviz.snapshots.simpleapp1_16_0.HTTP_ERROR
import org.apache.isis.client.kroviz.snapshots.simpleapp1_16_0.HTTP_ERROR_500_UNIQUE_CONSTRAINT_VIOLATION
import kotlin.test.Test
@@ -34,15 +36,15 @@ class HttpErrorTest {
fun testDemo500() {
val jsonStr = HTTP_ERROR_500.str
val error = HttpErrorHandler().parse(jsonStr) as HttpError
- val code = error.httpStatusCode
+ val code = error.getStatusCode()
assertEquals(500, code)
- assertNotNull(error.message)
+ assertNotNull(error.getMessage())
val detail = error.detail
assertNotNull(detail)
assertNotNull(detail.className)
assertNotNull(detail.message)
- assertEquals(error.message, detail.message)
+ assertEquals(error.getMessage(), detail.message)
assertNotNull(detail.element)
assertTrue(detail.element.size > 0)
}
@@ -51,15 +53,15 @@ class HttpErrorTest {
fun test405() {
val jsonStr = HTTP_ERROR_405.str
val error = HttpErrorHandler().parse(jsonStr) as HttpError
- val code = error.httpStatusCode
+ val code = error.getStatusCode()
assertEquals(405, code)
- assertNotNull(error.message)
+ assertNotNull(error.getMessage())
val detail = error.detail
assertNotNull(detail)
assertNotNull(detail.className)
assertNotNull(detail.message)
- assertEquals(error.message, detail.message)
+ assertEquals(error.getMessage(), detail.message)
assertNotNull(detail.element)
assertTrue(detail.element.size > 0)
}
@@ -68,32 +70,42 @@ class HttpErrorTest {
fun test400() {
val jsonStr = HTTP_ERROR.str
val error = HttpErrorHandler().parse(jsonStr) as HttpError
- val code = error.httpStatusCode
+ val code = error.getStatusCode()
assertEquals(400, code)
- assertNotNull(error.message)
+ assertNotNull(error.getMessage())
val detail = error.detail
assertNotNull(detail)
assertNotNull(detail.className)
assertNotNull(detail.message)
- assertEquals(error.message, detail.message)
+ assertEquals(error.getMessage(), detail.message)
assertNotNull(detail.element)
assertTrue(detail.element.size > 0)
}
+ @Test
+ fun test401() {
+ val jsonStr = HTTP_ERROR_401.str
+ val error = Http401ErrorHandler().parse(jsonStr) as Http401Error
+
+ assertEquals(401, error.getStatusCode())
+ assertTrue(error.getMessage().startsWith("Unauthorized"))
+ assertTrue(error.getMessage().contains("/restful/"))
+ }
+
//@Test //TODO handle nested causedBy's
fun test500() {
val jsonStr = HTTP_ERROR_500_UNIQUE_CONSTRAINT_VIOLATION.str
val error = HttpErrorHandler().parse(jsonStr) as HttpError
- val code = error.httpStatusCode
+ val code = error.getStatusCode()
assertEquals(400, code)
- assertNotNull(error.message)
+ assertNotNull(error.getMessage())
val detail = error.detail
assertNotNull(detail)
assertNotNull(detail.className)
assertNotNull(detail.message)
- assertEquals(error.message, detail.message)
+ assertEquals(error.getMessage(), detail.message)
assertNotNull(detail.element)
assertTrue(detail.element.size > 0)
}
[isis] 03/07: ISIS-2348 Actual events in DiffDialog filled
Posted by jo...@apache.org.
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 a708a121ea2bdb5751dd2e8ed463f22172aaecc9
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Thu Nov 11 09:27:53 2021 +0100
ISIS-2348 Actual events in DiffDialog filled
---
.../org/apache/isis/client/kroviz/core/event/ReplayCommand.kt | 4 ++--
.../kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt | 11 +++++------
.../kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt | 11 ++++++++---
.../apache/isis/client/kroviz/ui/dialog/ReplayDiffDialog.kt | 6 ++++--
4 files changed, 19 insertions(+), 13 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 e16da18..04bf437 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
@@ -52,8 +52,8 @@ class ReplayCommand {
val uiEvents = filterReplayEvents(expectedEvents)
replay(uiEvents, urlUnderTest)
- val actualEvents: MutableList<LogEntry> = eventStore.log
- val rdd = ReplayDiffDialog(expectedEvents, actualEvents)
+ val title = "Replay Events: " + oldBaseUrl + " -> " + urlUnderTest
+ val rdd = ReplayDiffDialog(expectedEvents, title)
rdd.dialog.open()
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt
index 1403df5..5c86aaf 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt
@@ -18,7 +18,9 @@
*/
package org.apache.isis.client.kroviz.ui.core
-import io.kvision.core.*
+import io.kvision.core.CssSize
+import io.kvision.core.UNIT
+import io.kvision.core.Widget
import io.kvision.form.FormPanel
import io.kvision.html.Button
import io.kvision.html.ButtonStyle
@@ -127,11 +129,8 @@ class RoDialog(
close()
}
- fun open(at: Point = Point(100, 100)): Widget {
- val offset = UiManager.getNumberOfPopups() * 4
- left = CssSize(at.x + offset, UNIT.px)
- top = CssSize(at.y + offset, UNIT.px)
- UiManager.openDialog(this)
+ fun open(at: Point = Point(x = 100, y = 100)): Widget {
+ UiManager.openDialog(this, at)
super.show()
okButton.focus()
return this
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
index c7fcda3..cb85cb8 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
@@ -18,6 +18,8 @@
*/
package org.apache.isis.client.kroviz.ui.core
+import io.kvision.core.CssSize
+import io.kvision.core.UNIT
import io.kvision.core.Widget
import io.kvision.dropdown.ContextMenu
import io.kvision.panel.SimplePanel
@@ -180,7 +182,10 @@ object UiManager {
setNormalCursor()
}
- fun openDialog(panel: RoDialog) {
+ fun openDialog(panel: RoDialog, at: Point = Point(100, 100)) {
+ val offset = UiManager.getNumberOfPopups() * 4
+ panel.left = CssSize(at.x + offset, UNIT.px)
+ panel.top = CssSize(at.y + offset, UNIT.px)
getRoApp().add(panel)
push(panel)
}
@@ -202,7 +207,7 @@ object UiManager {
}
}
- fun getEventStore() : EventStore {
+ fun getEventStore(): EventStore {
return getSession().eventStore
}
@@ -217,7 +222,7 @@ object UiManager {
fun login(url: String, username: String, password: String) {
val s = Session()
s.login(url, username, password)
- sessions.add(0,s)
+ sessions.add(0, s)
}
fun getCredentials(): String {
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
index 9f04df5..55d3a85 100644
--- 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
@@ -34,7 +34,7 @@ import org.apache.isis.client.kroviz.ui.panel.EventLogTable
class ReplayDiffDialog(
private val expectedEvents: List<LogEntry>,
- actualEvents: List<LogEntry>
+ title: String
) : Command() {
var dialog: RoDialog
@@ -47,7 +47,7 @@ class ReplayDiffDialog(
init {
dialog = RoDialog(
- caption = "Replay Events: Expected vs. Actual",
+ caption = title,
items = mutableListOf(),
command = this,
defaultAction = "Compare",
@@ -57,6 +57,8 @@ class ReplayDiffDialog(
)
val expectedTable = EventLogTable(expectedEvents)
expectedTable.tabulator.addCssClass("tabulator-in-dialog")
+ val actualEvents: MutableList<LogEntry> = UiManager.getEventStore().log
+
val actualTable = EventLogTable(actualEvents)
actualTable.tabulator.addCssClass("tabulator-in-dialog")
expectedPanel.add(expectedTable)
[isis] 07/07: Merge branch 'master' of
https://github.com/apache/isis
Posted by jo...@apache.org.
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 2d3e0452ed007a2bd07158e678cbbf1b714ecd41
Merge: 7c3d99d a9c1cb7
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Fri Nov 12 18:08:46 2021 +0100
Merge branch 'master' of https://github.com/apache/isis
.../java/org/apache/isis/applib/Identifier.java | 9 +-
.../applib/adapters/ValueSemanticsAbstract.java | 2 -
.../isis/commons/internal/base/_Optionals.java | 10 +
.../metamodel/commons/CanonicalParameterUtil.java | 9 +-
.../core/metamodel/facets/all/help/HelpFacet.java | 2 +-
.../facets/all/help/HelpFacetAbstract.java | 8 +-
.../facets/fallback/FallbackFacetFactory.java | 3 -
.../metamodel/facets/fallback/HelpFacetNone.java | 41 -
...acetForPersistentBigDecimalWhenUnspecified.java | 70 +
.../interactions/managed/ActionInteraction.java | 5 +-
.../interactions/managed/ManagedMember.java | 21 +-
.../managed/ParameterNegotiationModel.java | 15 +-
.../managed/nonscalar/DataTableModel.java | 7 +-
.../specimpl/ObjectActionParameterAbstract.java | 6 +-
core/pom.xml | 10 +-
.../sitemap/SitemapServiceDefault.java | 1 +
...shingVm_publishingEnabledAnnotatedEntities.java | 2 +-
.../usingjaxb/StatefulVmUsingJaxb-description.adoc | 2 +-
.../objects/other/mixins/MixinVm-description.adoc | 2 +-
examples/demo/pre-flight.adoc | 2948 ++++++++++++++++++++
isis-parent/pom.xml | 2 +-
.../impl/IsisModuleExtJaxRsClientImpl.java | 6 +-
...DecimalFromJdoColumnAnnotationFacetFactory.java | 17 +-
... => MaxFractionalDigitsFacetFromJdoColumn.java} | 6 +-
...malFromJdoColumnAnnotationFacetFactoryTest.java | 2 +-
...DecimalFromJpaColumnAnnotationFacetFactory.java | 17 +-
...ctionalDigitsFacetFromJpaColumnAnnotation.java} | 6 +-
regressiontests/stable-cucumber/pom.xml | 6 +
.../isis/testdomain/cucumber/CucumberTest.java | 17 +-
.../cucumber/HeadlessCucumberTestAbstract.java | 39 -
.../apache/isis/testdomain/cucumber/StepDefs.java | 18 +-
.../src/test/resources/junit-platform.properties | 2 +
.../base/applib/services/BaseServicesModule.java | 8 +-
.../applib/services/calendar/CalendarService.java | 57 +-
...darService.java => CalendarServiceDefault.java} | 63 +-
.../CalendarServiceTest_beginningOfMonth.java | 2 +-
.../CalendarServiceTest_beginningOfQuarter.java | 2 +-
.../isis/subdomains/docx/applib/DocxService.java | 399 +--
.../applib/IsisModuleSubdomainsDocxApplib.java | 6 +
.../DocxServiceDefault.java} | 162 +-
.../isis/subdomains/docx/applib/util/Docx.java | 17 +-
.../isis/subdomains/docx/applib/util/Dump.java | 28 +-
.../isis/subdomains/docx/applib/util/Jdom2.java | 20 +-
.../isis/subdomains/docx/applib/util/Types.java | 2 +-
.../docx/applib/DocxService_merge_Test.java | 13 +-
.../applib/IsisModuleSubdomainsExcelApplib.java | 8 +-
.../subdomains/excel/applib/dom/ExcelService.java | 222 +-
.../subdomains/excel/applib/dom/WorksheetSpec.java | 2 +-
.../ExcelServiceDefault.java} | 162 +-
.../_CellMarshaller.java} | 8 +-
.../_ExcelConverter.java} | 26 +-
.../_ExcelServiceHelper.java} | 62 +-
.../applib/{dom => }/util/AnnotationList.java | 2 +-
.../applib/{dom => }/util/AnnotationTriplet.java | 2 +-
.../{dom => }/util/ExcelFileBlobConverter.java | 5 +-
.../excel/applib/{dom => }/util/Mode.java | 2 +-
.../excel/applib/{dom => }/util/PivotUtils.java | 2 +-
.../excel/applib/{dom => }/util/SheetPivoter.java | 6 +-
.../applib/{dom => }/util/AnnotationListTest.java | 5 +-
.../{dom => }/util/AnnotationTripletTest.java | 4 +-
.../applib/{dom => }/util/PivotUtilsTest.java | 4 +-
.../applib/{dom => }/util/SheetPivoterTest.java | 4 +-
.../IsisModuleSubdomainsExcelFixtures.java | 2 +-
.../ExcelPivotByCategoryAndSubcategoryMenu.java | 4 +-
.../DemoFixture_extending_ExcelFixture2.java | 2 +-
.../ExcelModuleDemoUploadService_IntegTest.java | 2 +-
.../subdomains/excel/testing/ExcelFixture.java | 7 +-
.../IsisModuleSubdomainsFreemarkerApplib.java | 6 +-
.../applib/IsisModuleSubdomainsOgnlApplib.java | 2 -
.../applib/IsisModuleSubdomainsPdfBoxApplib.java | 6 +-
.../IsisModuleSubdomainsXDocReportApplib.java | 8 +-
.../xdocreport/applib/XDocReportService.java | 42 +
.../xdocreport/applib/service/OutputType.java | 27 -
.../xdocreport/applib/service/XDocReportModel.java | 48 -
...tService.java => XDocReportServiceDefault.java} | 26 +-
.../applib/service/XDocReportServiceTest.java | 4 +-
.../example/models/ProjectDevelopersModel.java | 2 +-
.../zip/applib}/IsisModuleExtZip.java | 10 +-
.../isis/subdomains/zip/applib/ZipService.java | 41 +
.../zip/applib/service/ZipServiceDefault.java} | 42 +-
.../integration/ObjectFactoryForIntegration.java | 8 +-
.../isis/testing/specsupport/applib/specs/V.java | 121 +-
tooling/pom.xml | 2 +-
.../semantics/AsciiDocValueSemantics.java | 18 +-
valuetypes/asciidoc/ui/pom.xml | 2 +-
valuetypes/markdown/pom.xml | 2 +-
.../applib/mixins/Object_impersonateWithRoles.java | 2 +-
.../rendering/domainobjects/JsonValueEncoder.java | 43 +-
.../domainobjects/ObjectPropertyReprRenderer.java | 8 +-
.../entityactions/LinkAndLabelFactory.java | 23 +-
.../bookmarkedpages/BookmarkedPagesPanel.java | 43 +-
.../org/apache/isis/viewer/wicket/ui/util/Wkt.java | 15 +
92 files changed, 3793 insertions(+), 1391 deletions(-)
[isis] 01/07: ISIS-2348 Handle blob error, upgrade to kvision 5.5.1,
minor cleanup
Posted by jo...@apache.org.
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 81c610277c805173fefb9443f6950b391be63182
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Wed Nov 10 17:44:15 2021 +0100
ISIS-2348 Handle blob error, upgrade to kvision 5.5.1, minor cleanup
---
incubator/clients/kroviz/gradle.properties | 2 +-
.../isis/client/kroviz/core/event/RoXmlHttpRequest.kt | 16 +++++++++++-----
.../apache/isis/client/kroviz/ui/panel/DropdownSearch.kt | 2 +-
.../apache/isis/client/kroviz/ui/panel/EventLogTable.kt | 2 +-
4 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/incubator/clients/kroviz/gradle.properties b/incubator/clients/kroviz/gradle.properties
index c035209..4c532c0 100644
--- a/incubator/clients/kroviz/gradle.properties
+++ b/incubator/clients/kroviz/gradle.properties
@@ -21,7 +21,7 @@ javaVersion=1.8
systemProp.kotlinVersion=1.5.31
serializationVersion=1.3.0
#Dependencies
-systemProp.kvisionVersion=5.4.3
+systemProp.kvisionVersion=5.5.1
coroutinesVersion=1.5.2
kotlin.mpp.stability.nowarn=true
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 5f77a1e..2a0b544 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
@@ -29,6 +29,7 @@ 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.w3c.xhr.BLOB
+import org.w3c.xhr.TEXT
import org.w3c.xhr.XMLHttpRequest
import org.w3c.xhr.XMLHttpRequestResponseType
@@ -112,9 +113,10 @@ class RoXmlHttpRequest(val aggregator: BaseAggregator?) {
}
private fun buildResourceSpecificationAndSetupHandler(
- url: String,
- subType: String,
- body: String): ResourceSpecification {
+ url: String,
+ subType: String,
+ body: String
+ ): ResourceSpecification {
val rs = ResourceSpecification(url, subType)
xhr.onload = { _ -> handleResult(rs, body) }
xhr.onerror = { _ -> handleError(rs) }
@@ -136,8 +138,12 @@ class RoXmlHttpRequest(val aggregator: BaseAggregator?) {
}
private fun handleError(rs: ResourceSpecification) {
- val responseText = xhr.responseText
- UiManager.getEventStore().fault(rs, responseText)
+ val error = when (xhr.responseType) {
+ XMLHttpRequestResponseType.BLOB -> "blob error"
+ XMLHttpRequestResponseType.TEXT -> xhr.responseText
+ else -> "neither text nor blob"
+ }
+ UiManager.getEventStore().fault(rs, error)
}
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DropdownSearch.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DropdownSearch.kt
index a933d42..3cc1332 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DropdownSearch.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DropdownSearch.kt
@@ -40,7 +40,7 @@ class DropdownSearch() : SimplePanel() {
this.marginTop = 10.px
this.marginLeft = 40.px
this.width = 100.pc
- val formPanel = formPanel<Form> {
+ formPanel<Form> {
add(
Form::select, Select(
options = cachedValues,
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTable.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTable.kt
index d5ce222..2cb133e 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTable.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTable.kt
@@ -108,7 +108,7 @@ class EventLogTable(val model: List<LogEntry>) : VPanel() {
b.onClick {
kotlinx.browser.window.open(data.title) //IMPROVE should be URL
}
- val tto = TooltipOptions(title = data.title)
+ //val tto = TooltipOptions(title = data.title)
// tabulator tooltip is buggy: often the tooltip doesn't go away and the color is not settable
//b.enableTooltip(tto)
if (data.obj is TObject) b.setDragDropData(Constants.stdMimeType, data.url)