diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/configuration/properties/SpringwolfConfigProperties.java b/springwolf-core/src/main/java/io/github/springwolf/core/configuration/properties/SpringwolfConfigProperties.java index 4f5089d12..f9f753ece 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/configuration/properties/SpringwolfConfigProperties.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/configuration/properties/SpringwolfConfigProperties.java @@ -232,15 +232,25 @@ public static class Group { @Getter @Setter public static class UI { - /** - * Allows to show or hide the bindings in the UI when opening the UI. - */ - private boolean initiallyShowBindings = true; /** - * Allows to show or hide the headers in the UI when opening the UI. + * Initial configuration when opening the UI. */ - private boolean initiallyShowHeaders = true; + private Defaults defaults = new Defaults(); + + @Getter + @Setter + public static class Defaults { + /** + * Allows to show or hide the bindings in the UI when opening the UI. + */ + private boolean showBindings = true; + + /** + * Allows to show or hide the headers in the UI when opening the UI. + */ + private boolean showHeaders = true; + } } @Getter diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/controller/UiConfigController.java b/springwolf-core/src/main/java/io/github/springwolf/core/controller/UiConfigController.java index 553f1c26d..fddf91c1f 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/controller/UiConfigController.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/controller/UiConfigController.java @@ -38,9 +38,9 @@ private List createGroups() { } private UiConfig.InitialConfig createInitialConfig() { - return new UiConfig.InitialConfig( - configProperties.getUi().isInitiallyShowBindings(), - configProperties.getUi().isInitiallyShowHeaders()); + SpringwolfConfigProperties.UI.Defaults defaults = + configProperties.getUi().getDefaults(); + return new UiConfig.InitialConfig(defaults.isShowBindings(), defaults.isShowHeaders()); } private record UiConfig(InitialConfig initialConfig, List groups) { diff --git a/springwolf-core/src/test/java/io/github/springwolf/core/configuration/properties/SpringwolfConfigPropertiesIntegrationTest.java b/springwolf-core/src/test/java/io/github/springwolf/core/configuration/properties/SpringwolfConfigPropertiesIntegrationTest.java index c093b58ee..bd9a17b1b 100644 --- a/springwolf-core/src/test/java/io/github/springwolf/core/configuration/properties/SpringwolfConfigPropertiesIntegrationTest.java +++ b/springwolf-core/src/test/java/io/github/springwolf/core/configuration/properties/SpringwolfConfigPropertiesIntegrationTest.java @@ -212,7 +212,7 @@ void groupConfigIsMappedCorrectly() { @ExtendWith(SpringExtension.class) @EnableConfigurationProperties(SpringwolfConfigProperties.class) @TestPropertySource( - properties = {"springwolf.ui.initially-show-bindings=false", "springwolf.ui.initially-show-headers=true"}) + properties = {"springwolf.ui.defaults.show-bindings=false", "springwolf.ui.defaults.show-headers=true"}) class UiConfigTest { @Autowired @@ -224,8 +224,8 @@ void uiConfigIsMappedCorrectly() { final SpringwolfConfigProperties.UI actual = properties.getUi(); // then - assertThat(actual.isInitiallyShowBindings()).isFalse(); - assertThat(actual.isInitiallyShowHeaders()).isTrue(); + assertThat(actual.getDefaults().isShowBindings()).isFalse(); + assertThat(actual.getDefaults().isShowHeaders()).isTrue(); } } @@ -243,8 +243,8 @@ void uiConfigIsMappedCorrectly() { final SpringwolfConfigProperties.UI actual = properties.getUi(); // then - assertThat(actual.isInitiallyShowBindings()).isTrue(); - assertThat(actual.isInitiallyShowHeaders()).isTrue(); + assertThat(actual.getDefaults().isShowBindings()).isTrue(); + assertThat(actual.getDefaults().isShowHeaders()).isTrue(); } } } diff --git a/springwolf-examples/springwolf-amqp-example/src/main/resources/application.properties b/springwolf-examples/springwolf-amqp-example/src/main/resources/application.properties index feb700d7a..cf89d1209 100644 --- a/springwolf-examples/springwolf-amqp-example/src/main/resources/application.properties +++ b/springwolf-examples/springwolf-amqp-example/src/main/resources/application.properties @@ -33,8 +33,8 @@ springwolf.docket.servers.amqp-server.host=${spring.rabbitmq.host}:${spring.rabb springwolf.plugin.amqp.publishing.enabled=true # Springwolf ui configuration -springwolf.ui.initially-show-bindings=true -springwolf.ui.initially-show-headers=true +springwolf.ui.defaults.show-bindings=true +springwolf.ui.defaults.show-headers=true # For debugging purposes logging.level.io.github.springwolf=DEBUG diff --git a/springwolf-examples/springwolf-cloud-stream-example/src/main/resources/application.properties b/springwolf-examples/springwolf-cloud-stream-example/src/main/resources/application.properties index 1583f29fc..c68c7ebb6 100644 --- a/springwolf-examples/springwolf-cloud-stream-example/src/main/resources/application.properties +++ b/springwolf-examples/springwolf-cloud-stream-example/src/main/resources/application.properties @@ -49,8 +49,8 @@ springwolf.docket.servers.kafka-server.host=${spring.cloud.stream.binders.kafka. springwolf.use-fqn=false # Springwolf ui configuration -springwolf.ui.initially-show-bindings=true -springwolf.ui.initially-show-headers=true +springwolf.ui.defaults.show-bindings=true +springwolf.ui.defaults.show-headers=true # For debugging purposes logging.level.io.github.springwolf=DEBUG diff --git a/springwolf-examples/springwolf-jms-example/src/main/resources/application.properties b/springwolf-examples/springwolf-jms-example/src/main/resources/application.properties index 04d24b5e9..855bc1246 100644 --- a/springwolf-examples/springwolf-jms-example/src/main/resources/application.properties +++ b/springwolf-examples/springwolf-jms-example/src/main/resources/application.properties @@ -28,8 +28,8 @@ springwolf.docket.servers.jms-server.host=${spring.activemq.broker-url} springwolf.plugin.jms.publishing.enabled=true # Springwolf ui configuration -springwolf.ui.initially-show-bindings=true -springwolf.ui.initially-show-headers=true +springwolf.ui.defaults.show-bindings=true +springwolf.ui.defaults.show-headers=true # For debugging purposes logging.level.io.github.springwolf=DEBUG diff --git a/springwolf-examples/springwolf-kafka-example/src/main/resources/application.properties b/springwolf-examples/springwolf-kafka-example/src/main/resources/application.properties index fa0d1b149..c1147f32e 100644 --- a/springwolf-examples/springwolf-kafka-example/src/main/resources/application.properties +++ b/springwolf-examples/springwolf-kafka-example/src/main/resources/application.properties @@ -44,8 +44,8 @@ springwolf.docket.group-configs[0].group=Only Vehicles springwolf.docket.group-configs[0].message-name-to-match=.*Vehicle.* # Springwolf ui configuration -springwolf.ui.initially-show-bindings=true -springwolf.ui.initially-show-headers=true +springwolf.ui.defaults.show-bindings=true +springwolf.ui.defaults.show-headers=true # Springwolf kafka configuration springwolf.docket.servers.kafka-server.protocol=kafka diff --git a/springwolf-examples/springwolf-sns-example/src/main/resources/application.properties b/springwolf-examples/springwolf-sns-example/src/main/resources/application.properties index e6a8ecb87..8b512ee2b 100644 --- a/springwolf-examples/springwolf-sns-example/src/main/resources/application.properties +++ b/springwolf-examples/springwolf-sns-example/src/main/resources/application.properties @@ -31,8 +31,8 @@ springwolf.docket.servers.sns-server.host=http://localhost:4566 springwolf.plugin.sns.publishing.enabled=true # Springwolf ui configuration -springwolf.ui.initially-show-bindings=true -springwolf.ui.initially-show-headers=true +springwolf.ui.defaults.show-bindings=true +springwolf.ui.defaults.show-headers=true # For debugging purposes logging.level.io.github.springwolf=DEBUG diff --git a/springwolf-examples/springwolf-sqs-example/src/main/resources/application.properties b/springwolf-examples/springwolf-sqs-example/src/main/resources/application.properties index cf289414f..515f694dd 100644 --- a/springwolf-examples/springwolf-sqs-example/src/main/resources/application.properties +++ b/springwolf-examples/springwolf-sqs-example/src/main/resources/application.properties @@ -31,8 +31,8 @@ springwolf.docket.servers.sqs-server.host=http://localhost:4566 springwolf.plugin.sqs.publishing.enabled=true # Springwolf ui configuration -springwolf.ui.initially-show-bindings=true -springwolf.ui.initially-show-headers=true +springwolf.ui.defaults.show-bindings=true +springwolf.ui.defaults.show-headers=true # For debugging purposes logging.level.io.github.springwolf=DEBUG diff --git a/springwolf-examples/springwolf-stomp-example/src/main/resources/application.properties b/springwolf-examples/springwolf-stomp-example/src/main/resources/application.properties index 3c8dfe6b6..1aee2b1a7 100644 --- a/springwolf-examples/springwolf-stomp-example/src/main/resources/application.properties +++ b/springwolf-examples/springwolf-stomp-example/src/main/resources/application.properties @@ -22,8 +22,8 @@ springwolf.plugin.stomp.endpoint.app=/app springwolf.plugin.stomp.endpoint.user=/user # Springwolf ui configuration -springwolf.ui.initially-show-bindings=true -springwolf.ui.initially-show-headers=true +springwolf.ui.defaults.show-bindings=true +springwolf.ui.defaults.show-headers=true # For debugging purposes logging.level.io.github.springwolf=DEBUG