From 688e74f69446e14bbbe266ed2609c40ecb79ba5d Mon Sep 17 00:00:00 2001 From: hongwei Date: Thu, 19 Jan 2023 23:42:16 +0100 Subject: [PATCH 1/2] feature/added the debugging pages --- .../main/scala/bootstrap/liftweb/Boot.scala | 5 + obp-api/src/main/webapp/debug.html | 44 +++++ .../src/main/webapp/debug/debug-basic.html | 20 +++ .../main/webapp/debug/debug-localization.html | 164 +++++++++++++++++ .../{plain.html => debug/debug-plain.html} | 5 +- .../src/main/webapp/debug/debug-webui.html | 165 ++++++++++++++++++ 6 files changed, 400 insertions(+), 3 deletions(-) create mode 100644 obp-api/src/main/webapp/debug.html create mode 100644 obp-api/src/main/webapp/debug/debug-basic.html create mode 100644 obp-api/src/main/webapp/debug/debug-localization.html rename obp-api/src/main/webapp/{plain.html => debug/debug-plain.html} (65%) create mode 100644 obp-api/src/main/webapp/debug/debug-webui.html diff --git a/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala b/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala index 1b3704f57..d960d4fe9 100644 --- a/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala +++ b/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala @@ -529,6 +529,11 @@ class Boot extends MdcLoggable { Menu.i("Plain") / "plain", Menu.i("Static") / "static", Menu.i("SDKs") / "sdks", + Menu.i("Debug") / "debug", + Menu.i("debug-basic") / "debug" / "debug-basic", + Menu.i("debug-localization") / "debug" / "debug-localization", + Menu.i("debug-plain") / "debug" / "debug-plain", + Menu.i("debug-webui") / "debug" / "debug-webui", Menu.i("Consumer Admin") / "admin" / "consumers" >> Admin.loginFirst >> LocGroup("admin") submenus(Consumer.menus : _*), Menu("Consumer Registration", Helper.i18n("consumer.registration.nav.name")) / "consumer-registration" >> AuthUser.loginFirst, diff --git a/obp-api/src/main/webapp/debug.html b/obp-api/src/main/webapp/debug.html new file mode 100644 index 000000000..02de2e0ae --- /dev/null +++ b/obp-api/src/main/webapp/debug.html @@ -0,0 +1,44 @@ + +The page for debugging + +

Here are the debugging pages.

+ +

debug-plain -- no Liftweb involved.

+

debug-basic -- call LiftWeb code 'surround'.

+

debug-localization -- call Localization 'lift:loc' method.

+

debug-webui -- call webui method 'apiDocumentationLink' method.

+ + +
+
+

Here are the debugging endpoints.

+

Get Root -- Return data from Liftweb server.

+

Get Banks -- Return data from backend, default is postgres database.

+

Get Resource Docs -- Return data from Liftweb, but around 2.3M data.

diff --git a/obp-api/src/main/webapp/debug/debug-basic.html b/obp-api/src/main/webapp/debug/debug-basic.html new file mode 100644 index 000000000..b5d16355b --- /dev/null +++ b/obp-api/src/main/webapp/debug/debug-basic.html @@ -0,0 +1,20 @@ + + + + + + +Basic Liftweb Suround with default + +
+ +

I call LiftWeb code surround

+ with a link +

Link to static

static image +

Link to SDKs

SDKs + +
+ + + + \ No newline at end of file diff --git a/obp-api/src/main/webapp/debug/debug-localization.html b/obp-api/src/main/webapp/debug/debug-localization.html new file mode 100644 index 000000000..1ea4fc2ff --- /dev/null +++ b/obp-api/src/main/webapp/debug/debug-localization.html @@ -0,0 +1,164 @@ + + + + +Debug The Localization + +
+

I will call Localization 'lift:loc' 40 times.

+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ + Loc +
+ +
+ + + + \ No newline at end of file diff --git a/obp-api/src/main/webapp/plain.html b/obp-api/src/main/webapp/debug/debug-plain.html similarity index 65% rename from obp-api/src/main/webapp/plain.html rename to obp-api/src/main/webapp/debug/debug-plain.html index be81c6d67..c4573332c 100644 --- a/obp-api/src/main/webapp/plain.html +++ b/obp-api/src/main/webapp/debug/debug-plain.html @@ -1,8 +1,7 @@ -Example HTML - -

I am some Example HTML

+Plain HTML +

I am an Example HTML, no Liftweb involved.

with a link

Link to static

static image

Link to SDKs

SDKs diff --git a/obp-api/src/main/webapp/debug/debug-webui.html b/obp-api/src/main/webapp/debug/debug-webui.html new file mode 100644 index 000000000..c7e4fa612 --- /dev/null +++ b/obp-api/src/main/webapp/debug/debug-webui.html @@ -0,0 +1,165 @@ + + + + +Debug Webui Props Exists with Loc + + +
+

I will call webui method 'apiDocumentationLink' 40 times.

+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + API +
+ + +
+ + + \ No newline at end of file From 15f54b7c242fdc41122b1983fdcfde3539a5ef08 Mon Sep 17 00:00:00 2001 From: hongwei Date: Mon, 23 Jan 2023 12:01:04 +0100 Subject: [PATCH 2/2] bugfix/Register button BUG --- obp-api/src/main/scala/code/snippet/WebUI.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/obp-api/src/main/scala/code/snippet/WebUI.scala b/obp-api/src/main/scala/code/snippet/WebUI.scala index adbb04fd7..d8b9085bd 100644 --- a/obp-api/src/main/scala/code/snippet/WebUI.scala +++ b/obp-api/src/main/scala/code/snippet/WebUI.scala @@ -460,6 +460,12 @@ class WebUI extends MdcLoggable{ def forBanks: CssSel = { "@for-banks [style]" #> s"display: $displayForBanks" } + def userIsLoggedIn: CssSel = { + if(AuthUser.loggedIn_?) + "#register-link [href]" #> scala.xml.Unparsed(s"/already-logged-in") + else + "#register-link [href]" #> scala.xml.Unparsed(s"/user_mgt/sign_up") + } def alreadyLoggedIn: CssSel = { lazy val logoutLink = s" ${Constant.HostName}${AuthUser.logoutPath.foldLeft("")(_ + "/" + _)}"