Skip to content

Commit

Permalink
make tests run again
Browse files Browse the repository at this point in the history
  • Loading branch information
F43nd1r committed Mar 11, 2024
1 parent c089d21 commit a417a50
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions acrarium/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dependencies {
implementation(libs.comFasterxmlJacksonModule.jacksonModuleKotlin)
implementation(libs.kotlin.logging)
implementation(libs.springdoc)
implementation(libs.orgAspectj.aspectjweaver)
developmentOnly(libs.orgSpringframeworkBoot.springBootDevtools)
testImplementation(libs.orgSpringframeworkBoot.springBootStarterTest)
testImplementation(libs.orgSpringframeworkSecurity.springSecurityTest)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2022-2023 Lukas Morawietz (https://github.com/F43nd1r)
* (C) Copyright 2022-2024 Lukas Morawietz (https://github.com/F43nd1r)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,10 +21,12 @@ import com.faendir.acra.rest.RestApiInterface.Companion.API_PATH
import com.faendir.acra.rest.RestReportInterface.Companion.REPORT_PATH
import com.faendir.acra.ui.view.login.LoginView
import com.faendir.acra.ui.view.login.SetupView
import com.vaadin.flow.spring.SpringSecurityAutoConfiguration
import com.vaadin.flow.spring.security.VaadinWebSecurity
import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Import
import org.springframework.core.annotation.Order
import org.springframework.security.authentication.AuthenticationManager
import org.springframework.security.authentication.AuthenticationProvider
Expand All @@ -46,6 +48,7 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector

@Configuration
@EnableWebSecurity
@Import(SpringSecurityAutoConfiguration::class)
class WebSecurityConfiguration(private val userRepository: UserRepository) : VaadinWebSecurity() {


Expand Down
25 changes: 12 additions & 13 deletions acrarium/src/main/kotlin/com/faendir/acra/ui/view/main/MainView.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2017-2023 Lukas Morawietz (https://github.com/F43nd1r)
* (C) Copyright 2017-2024 Lukas Morawietz (https://github.com/F43nd1r)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -50,20 +50,19 @@ import org.springframework.security.core.context.SecurityContextHolder
@SpringComponent
class MainView(applicationContext: GenericApplicationContext) : Composite<AppLayout>(), RouterLayout {
private val targets: MutableMap<Class<out HasElement>, Tab> = mutableMapOf()
private val tabs: Tabs
private val tabs: Tabs = Tabs().apply {
orientation = Tabs.Orientation.VERTICAL
add(createTab<Overview>(Messages.HOME))
add(AppPath(applicationContext))
add(createTab<AccountView>(Messages.ACCOUNT))
if (SecurityUtils.hasRole(Role.ADMIN)) {
add(createTab<UserManager>(Messages.USER_MANAGER))
}
add(createTab<SettingsView>(Messages.SETTINGS))
add(createTab<AboutView>(Messages.ABOUT))
}

init {
tabs = Tabs().apply {
orientation = Tabs.Orientation.VERTICAL
add(createTab<Overview>(Messages.HOME))
add(AppPath(applicationContext))
add(createTab<AccountView>(Messages.ACCOUNT))
if (SecurityUtils.hasRole(Role.ADMIN)) {
add(createTab<UserManager>(Messages.USER_MANAGER))
}
add(createTab<SettingsView>(Messages.SETTINGS))
add(createTab<AboutView>(Messages.ABOUT))
}
content {
element.style["width"] = "100%"
element.style["height"] = "100%"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tasks.register("build") {

tasks.register<Delete>("clean") {
group = "build"
delete = setOf(buildDir)
delete = setOf(layout.buildDirectory)
}

subprojects {
Expand Down

0 comments on commit a417a50

Please sign in to comment.