From c0bff6091af064c70f98e3c41c532ffbe0fdea70 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Wed, 28 Feb 2024 07:59:44 +0000 Subject: [PATCH 1/6] Update scala-library, scala-reflect to 2.13.13 --- .github/workflows/ci.yml | 2 +- project/Dependencies.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54dba553d..63418c0c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - scala: [ 2.13.12 ] + scala: [ 2.13.13 ] command: [ udash-jvm/test, udash-js/test, guide-selenium/test ] steps: - uses: actions/checkout@v3 diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 8c9bf5546..d58996efb 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -5,7 +5,7 @@ import sbt.* import sbt.Keys.scalaVersion object Dependencies { - val versionOfScala = "2.13.12" //update .github/workflows/ci.yml as well + val versionOfScala = "2.13.13" //update .github/workflows/ci.yml as well val jqueryWrapperVersion = "3.3.0" From b7313820059810d88b77018391fd3177e6d42343 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Wed, 28 Feb 2024 07:59:06 +0000 Subject: [PATCH 2/6] Update webdrivermanager to 5.7.0 --- project/Dependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index d58996efb..174454ab8 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -43,7 +43,7 @@ object Dependencies { val momentJsVersion = "2.29.4" val seleniumVersion = "4.18.1" - val webDriverManagerVersion = "5.6.4" + val webDriverManagerVersion = "5.7.0" val scalaJsBenchmarkVersion = "0.10.0" val compilerPlugins = Def.setting(Seq( From a3a525a8f3b25cd9660c6a7d671a1aaaafd2cefc Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Wed, 28 Feb 2024 07:58:56 +0000 Subject: [PATCH 3/6] Update sbt-less to 2.0.1 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 686209c1f..d3f2a80af 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -7,7 +7,7 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.15.0") addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2") addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4") addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.2") -addSbtPlugin("com.github.sbt" % "sbt-less" % "1.5.0") +addSbtPlugin("com.github.sbt" % "sbt-less" % "2.0.1") addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.16") // Deployment configuration From 5f57beaee2ae27d10f7477d76ed4720b92ed985a Mon Sep 17 00:00:00 2001 From: Sebastian Haracz Date: Tue, 5 Mar 2024 12:05:34 +0100 Subject: [PATCH 4/6] Scala 2.13.13 --- .github/workflows/ci.yml | 2 +- .../udash/bootstrap/carousel/UdashCarouselTest.scala | 4 ++-- .../test/scala/io/udash/bindings/TagsBindingTest.scala | 10 +++++----- .../scala/io/udash/properties/SeqPropertyTest.scala | 10 +++++----- .../web/homepage/components/demo/DemoComponent.scala | 6 +++--- project/Dependencies.scala | 4 ++-- .../src/main/scala/io/udash/rest/openapi/OpenApi.scala | 4 ++-- .../scala/io/udash/rest/openapi/OpenApiMetadata.scala | 2 +- rpc/src/test/scala/io/udash/rpc/RpcMessagesTest.scala | 6 +++--- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54dba553d..63418c0c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - scala: [ 2.13.12 ] + scala: [ 2.13.13 ] command: [ udash-jvm/test, udash-js/test, guide-selenium/test ] steps: - uses: actions/checkout@v3 diff --git a/bootstrap4/.js/src/test/scala/io/udash/bootstrap/carousel/UdashCarouselTest.scala b/bootstrap4/.js/src/test/scala/io/udash/bootstrap/carousel/UdashCarouselTest.scala index 856865e9d..3226d908b 100644 --- a/bootstrap4/.js/src/test/scala/io/udash/bootstrap/carousel/UdashCarouselTest.scala +++ b/bootstrap4/.js/src/test/scala/io/udash/bootstrap/carousel/UdashCarouselTest.scala @@ -139,8 +139,8 @@ class UdashCarouselTest extends AsyncUdashCoreFrontendTest { changedEvent = ev.asInstanceOf[CarouselEvent[UdashCarouselSlide, ReadableProperty[UdashCarouselSlide]]] } carousel.goTo(5) - retrying(changeEvent shouldBe CarouselEvent(carousel, 5, CarouselEvent.Direction.Left, false)) - retrying(changedEvent shouldBe CarouselEvent(carousel, 5, CarouselEvent.Direction.Left, true)) + retrying(changeEvent shouldBe CarouselEvent(carousel, 5, CarouselEvent.Direction.Left, changed = false)) + retrying(changedEvent shouldBe CarouselEvent(carousel, 5, CarouselEvent.Direction.Left, changed = true)) retrying(carousel.activeSlide.get shouldBe 5) } diff --git a/core/.js/src/test/scala/io/udash/bindings/TagsBindingTest.scala b/core/.js/src/test/scala/io/udash/bindings/TagsBindingTest.scala index 2e46b1852..61b9b2cd1 100644 --- a/core/.js/src/test/scala/io/udash/bindings/TagsBindingTest.scala +++ b/core/.js/src/test/scala/io/udash/bindings/TagsBindingTest.scala @@ -1686,11 +1686,11 @@ class TagsBindingTest extends UdashFrontendTest with Bindings { bindings: Bindin done.listenStructure(p => patches += p) todos.set(Seq( - Todo("A", false), - Todo("B", false), - Todo("C", false), - Todo("D", false), - Todo("E", false) + Todo("A", completed = false), + Todo("B", completed = false), + Todo("C", completed = false), + Todo("D", completed = false), + Todo("E", completed = false), )) patches.size should be(0) diff --git a/core/src/test/scala/io/udash/properties/SeqPropertyTest.scala b/core/src/test/scala/io/udash/properties/SeqPropertyTest.scala index 06de4083a..de7596c96 100644 --- a/core/src/test/scala/io/udash/properties/SeqPropertyTest.scala +++ b/core/src/test/scala/io/udash/properties/SeqPropertyTest.scala @@ -706,11 +706,11 @@ class SeqPropertyTest extends UdashCoreTest { filtered.listen(_ => ()) val s = Seq( - D("A", false), - D("B", false), - D("C", false), - D("D", false), - D("E", false) + D("A", b = false), + D("B", b = false), + D("C", b = false), + D("D", b = false), + D("E", b = false), ) ts.set(s) diff --git a/guide/homepage/.js/src/main/scala/io/udash/web/homepage/components/demo/DemoComponent.scala b/guide/homepage/.js/src/main/scala/io/udash/web/homepage/components/demo/DemoComponent.scala index 6dd6801fb..262dff183 100644 --- a/guide/homepage/.js/src/main/scala/io/udash/web/homepage/components/demo/DemoComponent.scala +++ b/guide/homepage/.js/src/main/scala/io/udash/web/homepage/components/demo/DemoComponent.scala @@ -36,9 +36,9 @@ final class DemoComponent(implicit application: Application[RoutingState]) exten ) }.toSeq ), - produce(application.currentStateProperty) { state => - state.opt.collect { case state: IndexState => code(state.codeDemo).setup(Prism.highlightAllUnder) }.getOrElse[Element](div().render) + produce(application.currentStateProperty) { currentState => + currentState.opt.collect { case state: IndexState => code(state.codeDemo).setup(Prism.highlightAllUnder) }.getOrElse[Element](div().render) } ) ).render -} \ No newline at end of file +} diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 765b868cb..80a60db5c 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -5,7 +5,7 @@ import sbt.* import sbt.Keys.scalaVersion object Dependencies { - val versionOfScala = "2.13.12" //update .github/workflows/ci.yml as well + val versionOfScala = "2.13.13" //update .github/workflows/ci.yml as well val jqueryWrapperVersion = "3.3.0" @@ -14,7 +14,7 @@ object Dependencies { val scalaCssVersion = "1.0.0" val servletVersion = "4.0.1" - val avsCommonsVersion = "2.13.3" + val avsCommonsVersion = "2.14.0" val atmosphereJSVersion = "3.1.3" val atmosphereVersion = "2.7.10" diff --git a/rest/src/main/scala/io/udash/rest/openapi/OpenApi.scala b/rest/src/main/scala/io/udash/rest/openapi/OpenApi.scala index a02cea02d..e839e5e42 100644 --- a/rest/src/main/scala/io/udash/rest/openapi/OpenApi.scala +++ b/rest/src/main/scala/io/udash/rest/openapi/OpenApi.scala @@ -247,7 +247,7 @@ final case class Schema( @td uniqueItems: Boolean = false, @td properties: Map[String, RefOr[Schema]] = Map.empty, - @td additionalProperties: AdditionalProperties = AdditionalProperties.Flag(true), + @td additionalProperties: AdditionalProperties = AdditionalProperties.Flag(value = true), @td maxProperties: OptArg[Int] = OptArg.Empty, @td minProperties: OptArg[Int] = OptArg.Empty, @td required: List[String] = Nil, @@ -295,7 +295,7 @@ object Schema extends HasGenObjectCodec[Schema] { def enumMapOf(keys: List[String], value: RefOr[Schema]): Schema = Schema(`type` = DataType.Object, properties = keys.iterator.map(k => (k, value)).toMap, - additionalProperties = AdditionalProperties.Flag(false) + additionalProperties = AdditionalProperties.Flag(value = false) ) def nullable(schema: RefOr[Schema]): Schema = schema match { diff --git a/rest/src/main/scala/io/udash/rest/openapi/OpenApiMetadata.scala b/rest/src/main/scala/io/udash/rest/openapi/OpenApiMetadata.scala index a656dedbc..fc97821bc 100644 --- a/rest/src/main/scala/io/udash/rest/openapi/OpenApiMetadata.scala +++ b/rest/src/main/scala/io/udash/rest/openapi/OpenApiMetadata.scala @@ -275,7 +275,7 @@ final case class OpenApiParamInfo[T]( @bincompat private[rest] def this( name: String, whenAbsentInfo: Opt[WhenAbsentInfo[T]], flags: ParamFlags, restSchema: RestSchema[T] - ) = this(name, whenAbsentInfo, false, flags, restSchema) + ) = this(name, whenAbsentInfo, optional = false, flags, restSchema) } final case class OpenApiParameter[T]( diff --git a/rpc/src/test/scala/io/udash/rpc/RpcMessagesTest.scala b/rpc/src/test/scala/io/udash/rpc/RpcMessagesTest.scala index 1d527c00c..a583210a9 100644 --- a/rpc/src/test/scala/io/udash/rpc/RpcMessagesTest.scala +++ b/rpc/src/test/scala/io/udash/rpc/RpcMessagesTest.scala @@ -120,7 +120,7 @@ trait RpcMessagesTestScenarios extends UdashSharedTest with Utils { } "serialize and deserialize simple case classes" in { - val test: TestCC = TestCC(5, 123L, 432, true, "bla", 'a' :: 'b' :: Nil) + val test: TestCC = TestCC(5, 123L, 432, b = true, "bla", 'a' :: 'b' :: Nil) val serialized = write[TestCC](test) val deserialized = read[TestCC](serialized) @@ -128,8 +128,8 @@ trait RpcMessagesTestScenarios extends UdashSharedTest with Utils { } "serialize and deserialize nested case classes" in { - val test: TestCC = TestCC(5, 123L, 432, true, "bla", 'a' :: 'b' :: Nil) - val test2: TestCC = TestCC(-35, 1L, 432, true, "blsddf sdg \"{,}[,]\"a", 'a' :: 'b' :: Nil) + val test: TestCC = TestCC(5, 123L, 432, b = true, "bla", 'a' :: 'b' :: Nil) + val test2: TestCC = TestCC(-35, 1L, 432, b = true, "blsddf sdg \"{,}[,]\"a", 'a' :: 'b' :: Nil) val nested: NestedTestCC = NestedTestCC(-123, test, test2) val serialized = write(nested) val deserialized = read[NestedTestCC](serialized) From f0dc5831deafa95a92f2ed3a5fd33824e61a20ea Mon Sep 17 00:00:00 2001 From: Dawid Dworak Date: Tue, 5 Mar 2024 13:33:12 +0100 Subject: [PATCH 5/6] Scala 2.13.13 --- .../io/udash/bootstrap/UdashBootstrap.scala | 2 +- .../carousel/UdashCarouselTest.scala | 8 ++++---- .../io/udash/bindings/TagsBindingTest.scala | 10 +++++----- .../io/udash/properties/SeqPropertyTest.scala | 10 +++++----- .../views/frontend/FrontendRoutingView.scala | 18 ++++++++--------- .../components/demo/DemoComponent.scala | 5 +++-- project/Dependencies.scala | 5 +---- .../scala/io/udash/rest/openapi/OpenApi.scala | 4 ++-- .../udash/rest/openapi/OpenApiMetadata.scala | 2 +- .../scala/io/udash/rpc/RpcMessagesTest.scala | 20 +++---------------- .../scala/io/udash/logging/UdashLogger.scala | 4 ++-- 11 files changed, 36 insertions(+), 52 deletions(-) diff --git a/bootstrap4/.js/src/main/scala/io/udash/bootstrap/UdashBootstrap.scala b/bootstrap4/.js/src/main/scala/io/udash/bootstrap/UdashBootstrap.scala index 3f8ee6e21..fe5c958ec 100644 --- a/bootstrap4/.js/src/main/scala/io/udash/bootstrap/UdashBootstrap.scala +++ b/bootstrap4/.js/src/main/scala/io/udash/bootstrap/UdashBootstrap.scala @@ -9,7 +9,7 @@ object UdashBootstrap { final val True: ReadableProperty[Boolean] = true.toProperty final val ColorSecondary: ReadableProperty[BootstrapStyles.Color] = BootstrapStyles.Color.Secondary.toProperty private final val NoneProperty = scala.None.toProperty - def None[A]: ReadableProperty[Option[A]] = NoneProperty.asInstanceOf[ReadableProperty[Option[A]]] + def None[A]: ReadableProperty[Option[A]] = NoneProperty /** Loads FontAwesome styles. */ def loadFontAwesome(): Element = diff --git a/bootstrap4/.js/src/test/scala/io/udash/bootstrap/carousel/UdashCarouselTest.scala b/bootstrap4/.js/src/test/scala/io/udash/bootstrap/carousel/UdashCarouselTest.scala index 856865e9d..8de67118c 100644 --- a/bootstrap4/.js/src/test/scala/io/udash/bootstrap/carousel/UdashCarouselTest.scala +++ b/bootstrap4/.js/src/test/scala/io/udash/bootstrap/carousel/UdashCarouselTest.scala @@ -134,13 +134,13 @@ class UdashCarouselTest extends AsyncUdashCoreFrontendTest { var changedEvent: CarouselEvent[UdashCarouselSlide, ReadableProperty[UdashCarouselSlide]] = null carousel.listen { case ev@CarouselEvent(_, _, _, false) => - changeEvent = ev.asInstanceOf[CarouselEvent[UdashCarouselSlide, ReadableProperty[UdashCarouselSlide]]] + changeEvent = ev case ev@CarouselEvent(_, _, _, true) => - changedEvent = ev.asInstanceOf[CarouselEvent[UdashCarouselSlide, ReadableProperty[UdashCarouselSlide]]] + changedEvent = ev } carousel.goTo(5) - retrying(changeEvent shouldBe CarouselEvent(carousel, 5, CarouselEvent.Direction.Left, false)) - retrying(changedEvent shouldBe CarouselEvent(carousel, 5, CarouselEvent.Direction.Left, true)) + retrying(changeEvent shouldBe CarouselEvent(carousel, 5, CarouselEvent.Direction.Left, changed = false)) + retrying(changedEvent shouldBe CarouselEvent(carousel, 5, CarouselEvent.Direction.Left, changed = true)) retrying(carousel.activeSlide.get shouldBe 5) } diff --git a/core/.js/src/test/scala/io/udash/bindings/TagsBindingTest.scala b/core/.js/src/test/scala/io/udash/bindings/TagsBindingTest.scala index 2e46b1852..61b9b2cd1 100644 --- a/core/.js/src/test/scala/io/udash/bindings/TagsBindingTest.scala +++ b/core/.js/src/test/scala/io/udash/bindings/TagsBindingTest.scala @@ -1686,11 +1686,11 @@ class TagsBindingTest extends UdashFrontendTest with Bindings { bindings: Bindin done.listenStructure(p => patches += p) todos.set(Seq( - Todo("A", false), - Todo("B", false), - Todo("C", false), - Todo("D", false), - Todo("E", false) + Todo("A", completed = false), + Todo("B", completed = false), + Todo("C", completed = false), + Todo("D", completed = false), + Todo("E", completed = false), )) patches.size should be(0) diff --git a/core/src/test/scala/io/udash/properties/SeqPropertyTest.scala b/core/src/test/scala/io/udash/properties/SeqPropertyTest.scala index 06de4083a..de7596c96 100644 --- a/core/src/test/scala/io/udash/properties/SeqPropertyTest.scala +++ b/core/src/test/scala/io/udash/properties/SeqPropertyTest.scala @@ -706,11 +706,11 @@ class SeqPropertyTest extends UdashCoreTest { filtered.listen(_ => ()) val s = Seq( - D("A", false), - D("B", false), - D("C", false), - D("D", false), - D("E", false) + D("A", b = false), + D("B", b = false), + D("C", b = false), + D("D", b = false), + D("E", b = false), ) ts.set(s) diff --git a/guide/guide/.js/src/main/scala/io/udash/web/guide/views/frontend/FrontendRoutingView.scala b/guide/guide/.js/src/main/scala/io/udash/web/guide/views/frontend/FrontendRoutingView.scala index d73fa2423..3dc098383 100644 --- a/guide/guide/.js/src/main/scala/io/udash/web/guide/views/frontend/FrontendRoutingView.scala +++ b/guide/guide/.js/src/main/scala/io/udash/web/guide/views/frontend/FrontendRoutingView.scala @@ -4,17 +4,16 @@ import io.udash._ import io.udash.auth.{UnauthenticatedException, UnauthorizedException} import io.udash.bootstrap.utils.BootstrapStyles import io.udash.css.CssView -import io.udash.web.commons.components.{CodeBlock, ForceBootstrap} +import io.udash.utils.URLEncoder +import io.udash.web.commons.components.ForceBootstrap import io.udash.web.commons.styles.GlobalStyles +import io.udash.web.guide._ import io.udash.web.guide.demos.AutoDemo import io.udash.web.guide.styles.partials.GuideStyles import io.udash.web.guide.views.References -import io.udash.web.guide.{Context, _} import org.scalajs.dom import scalatags.JsDom -import scala.scalajs.js - case object FrontendRoutingViewFactory extends ViewFactory[FrontendRoutingState] { override def create(): (View, Presenter[FrontendRoutingState]) = { val url = Property.blank[String] @@ -23,13 +22,16 @@ case object FrontendRoutingViewFactory extends ViewFactory[FrontendRoutingState] } class FrontendRoutingPresenter(url: Property[String]) extends Presenter[FrontendRoutingState] { + import Context.applicationInstance + override def handleState(state: FrontendRoutingState) = { url.set(applicationInstance.currentUrl.value) } } class FrontendRoutingView(url: Property[String]) extends View with CssView { + import Context._ import JsDom.all._ import com.avsystem.commons.SharedExtensions.universalOps @@ -219,14 +221,12 @@ class FrontendRoutingView(url: Property[String]) extends View with CssView { size = BootstrapStyles.SpacingSize.Normal ))(input( BootstrapStyles.Form.control, id := "url-demo-link-input", value := "", - placeholder := "Type something in this field and look at the URL...", onkeyup :+= ((event: dom.Event) => { + placeholder := "Type something in this field and look at the URL...", onkeyup :+= { (event: dom.Event) => applicationInstance.goTo(FrontendRoutingState( - Some(js.Dynamic.global - .encodeURIComponent(event.target.asInstanceOf[dom.html.Input].value) - .asInstanceOf[String]) + Some(URLEncoder.encode(event.target.asInstanceOf[dom.html.Input].value, spaceAsPlus = false)) )) true - }) + } )), p("This view was created with: ", span(id := "url-demo-link-init")(applicationInstance.currentUrl.value)) ) diff --git a/guide/homepage/.js/src/main/scala/io/udash/web/homepage/components/demo/DemoComponent.scala b/guide/homepage/.js/src/main/scala/io/udash/web/homepage/components/demo/DemoComponent.scala index 6dd6801fb..44189819c 100644 --- a/guide/homepage/.js/src/main/scala/io/udash/web/homepage/components/demo/DemoComponent.scala +++ b/guide/homepage/.js/src/main/scala/io/udash/web/homepage/components/demo/DemoComponent.scala @@ -36,8 +36,9 @@ final class DemoComponent(implicit application: Application[RoutingState]) exten ) }.toSeq ), - produce(application.currentStateProperty) { state => - state.opt.collect { case state: IndexState => code(state.codeDemo).setup(Prism.highlightAllUnder) }.getOrElse[Element](div().render) + produce(application.currentStateProperty) { + case state: IndexState => code(state.codeDemo).setup(Prism.highlightAllUnder) + case _ => div().render } ) ).render diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 174454ab8..609ea1fb5 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -1,7 +1,4 @@ -import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport.* -import org.scalajs.jsdependencies.sbtplugin.JSDependenciesPlugin.autoImport.* import org.scalajs.jsdependencies.sbtplugin.JSModuleID -import sbt.* import sbt.Keys.scalaVersion object Dependencies { @@ -14,7 +11,7 @@ object Dependencies { val scalaCssVersion = "1.0.0" val servletVersion = "4.0.1" - val avsCommonsVersion = "2.13.3" + val avsCommonsVersion = "2.14.0" val atmosphereJSVersion = "3.1.3" val atmosphereVersion = "2.7.10" diff --git a/rest/src/main/scala/io/udash/rest/openapi/OpenApi.scala b/rest/src/main/scala/io/udash/rest/openapi/OpenApi.scala index a02cea02d..e839e5e42 100644 --- a/rest/src/main/scala/io/udash/rest/openapi/OpenApi.scala +++ b/rest/src/main/scala/io/udash/rest/openapi/OpenApi.scala @@ -247,7 +247,7 @@ final case class Schema( @td uniqueItems: Boolean = false, @td properties: Map[String, RefOr[Schema]] = Map.empty, - @td additionalProperties: AdditionalProperties = AdditionalProperties.Flag(true), + @td additionalProperties: AdditionalProperties = AdditionalProperties.Flag(value = true), @td maxProperties: OptArg[Int] = OptArg.Empty, @td minProperties: OptArg[Int] = OptArg.Empty, @td required: List[String] = Nil, @@ -295,7 +295,7 @@ object Schema extends HasGenObjectCodec[Schema] { def enumMapOf(keys: List[String], value: RefOr[Schema]): Schema = Schema(`type` = DataType.Object, properties = keys.iterator.map(k => (k, value)).toMap, - additionalProperties = AdditionalProperties.Flag(false) + additionalProperties = AdditionalProperties.Flag(value = false) ) def nullable(schema: RefOr[Schema]): Schema = schema match { diff --git a/rest/src/main/scala/io/udash/rest/openapi/OpenApiMetadata.scala b/rest/src/main/scala/io/udash/rest/openapi/OpenApiMetadata.scala index a656dedbc..fc97821bc 100644 --- a/rest/src/main/scala/io/udash/rest/openapi/OpenApiMetadata.scala +++ b/rest/src/main/scala/io/udash/rest/openapi/OpenApiMetadata.scala @@ -275,7 +275,7 @@ final case class OpenApiParamInfo[T]( @bincompat private[rest] def this( name: String, whenAbsentInfo: Opt[WhenAbsentInfo[T]], flags: ParamFlags, restSchema: RestSchema[T] - ) = this(name, whenAbsentInfo, false, flags, restSchema) + ) = this(name, whenAbsentInfo, optional = false, flags, restSchema) } final case class OpenApiParameter[T]( diff --git a/rpc/src/test/scala/io/udash/rpc/RpcMessagesTest.scala b/rpc/src/test/scala/io/udash/rpc/RpcMessagesTest.scala index 1d527c00c..616c006b5 100644 --- a/rpc/src/test/scala/io/udash/rpc/RpcMessagesTest.scala +++ b/rpc/src/test/scala/io/udash/rpc/RpcMessagesTest.scala @@ -74,20 +74,6 @@ trait RpcMessagesTestScenarios extends UdashSharedTest with Utils { deserialized3 should be(sealedException) } - // "serialize and deserialize exception stacktrace" in { - // val serialized = write[RpcResponse](exception) - // val deserialized = read[RpcResponse](serialized) - // deserialized.asInstanceOf[RpcResponseException].exception.getStackTrace should be(exception.exception.getStackTrace) - // - // val serialized2 = write[RpcResponse](runtimeException) - // val deserialized2 = read[RpcResponse](serialized2) - // deserialized2.asInstanceOf[RpcResponseException].exception.getStackTrace should be(runtimeException.exception.getStackTrace) - // - // val serialized3 = write[RpcResponse](sealedException) - // val deserialized3 = read[RpcResponse](serialized3) - // deserialized3.asInstanceOf[RpcResponseException].exception.getStackTrace should be(sealedException.exception.getStackTrace) - // } - "serialize and deserialize rpc failure msg" in { val serialized = write[RpcFailure](rpcFail) val deserialized = read[RpcFailure](serialized) @@ -120,7 +106,7 @@ trait RpcMessagesTestScenarios extends UdashSharedTest with Utils { } "serialize and deserialize simple case classes" in { - val test: TestCC = TestCC(5, 123L, 432, true, "bla", 'a' :: 'b' :: Nil) + val test: TestCC = TestCC(5, 123L, 432, b = true, "bla", 'a' :: 'b' :: Nil) val serialized = write[TestCC](test) val deserialized = read[TestCC](serialized) @@ -128,8 +114,8 @@ trait RpcMessagesTestScenarios extends UdashSharedTest with Utils { } "serialize and deserialize nested case classes" in { - val test: TestCC = TestCC(5, 123L, 432, true, "bla", 'a' :: 'b' :: Nil) - val test2: TestCC = TestCC(-35, 1L, 432, true, "blsddf sdg \"{,}[,]\"a", 'a' :: 'b' :: Nil) + val test: TestCC = TestCC(5, 123L, 432, b = true, "bla", 'a' :: 'b' :: Nil) + val test2: TestCC = TestCC(-35, 1L, 432, b = true, "blsddf sdg \"{,}[,]\"a", 'a' :: 'b' :: Nil) val nested: NestedTestCC = NestedTestCC(-123, test, test2) val serialized = write(nested) val deserialized = read[NestedTestCC](serialized) diff --git a/utils/.js/src/main/scala/io/udash/logging/UdashLogger.scala b/utils/.js/src/main/scala/io/udash/logging/UdashLogger.scala index 6d9565b12..a4c098fce 100644 --- a/utils/.js/src/main/scala/io/udash/logging/UdashLogger.scala +++ b/utils/.js/src/main/scala/io/udash/logging/UdashLogger.scala @@ -1,12 +1,12 @@ package io.udash.logging +import org.scalajs.dom import org.scalajs.dom.Console import scala.scalajs.js -import scala.scalajs.js.Dynamic.global class UdashLogger(clazz: Class[_]) extends CrossLogger { - private val console: Console = global.console.asInstanceOf[Console] + private val console: Console = dom.console private def printWithParams(method: (js.Any, Seq[js.Any]) => Unit)(message: String, params: Any*): Unit = method(message, params.map(_.asInstanceOf[js.Any])) From 6eed6f00f4d24942d856b873e1ae4cf49706d3c4 Mon Sep 17 00:00:00 2001 From: Dawid Dworak Date: Tue, 5 Mar 2024 13:38:41 +0100 Subject: [PATCH 6/6] Fix imports --- project/Dependencies.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 609ea1fb5..80a60db5c 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -1,4 +1,7 @@ +import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport.* +import org.scalajs.jsdependencies.sbtplugin.JSDependenciesPlugin.autoImport.* import org.scalajs.jsdependencies.sbtplugin.JSModuleID +import sbt.* import sbt.Keys.scalaVersion object Dependencies {