Skip to content

Commit

Permalink
[Refactor/#517] vaadin 설정 web 모듈로 분리 (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
belljun3395 authored Jan 10, 2025
1 parent af29cdc commit 7b2ef4c
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 25 deletions.
3 changes: 0 additions & 3 deletions domain/crm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ dependencies {
implementation("io.awspring.cloud:spring-cloud-aws-starter-sqs:${DependencyVersion.AWS_SQS}")

implementation("software.amazon.awssdk:scheduler:2.29.45")

/** vaadin */
implementation("com.vaadin:vaadin-spring-boot-starter")
}

vaadin {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.few.crm.view.email

import com.few.crm.email.domain.EmailSendHistory
import com.few.crm.email.repository.EmailSendHistoryRepository
import com.few.crm.view.CommonVerticalLayout
import web.view.CommonVerticalLayout
import com.vaadin.flow.component.grid.Grid
import com.vaadin.flow.component.orderedlayout.HorizontalLayout
import com.vaadin.flow.component.textfield.TextArea
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.few.crm.support.schedule.TaskView
import com.few.crm.support.schedule.TimeOutEventTaskManager
import com.few.crm.user.domain.User
import com.few.crm.user.repository.UserRepository
import com.few.crm.view.CommonVerticalLayout
import web.view.CommonVerticalLayout
import com.vaadin.flow.component.button.Button
import com.vaadin.flow.component.checkbox.Checkbox
import com.vaadin.flow.component.datepicker.DatePicker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.few.crm.email.repository.EmailTemplateHistoryRepository
import com.few.crm.email.repository.EmailTemplateRepository
import com.few.crm.email.usecase.PostTemplateUseCase
import com.few.crm.email.usecase.dto.PostTemplateUseCaseIn
import com.few.crm.view.CommonVerticalLayout
import web.view.CommonVerticalLayout
import com.vaadin.flow.component.button.Button
import com.vaadin.flow.component.dialog.Dialog
import com.vaadin.flow.component.formlayout.FormLayout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.few.crm.user.domain.User
import com.few.crm.user.repository.UserRepository
import com.few.crm.user.usecase.EnrollUserUseCase
import com.few.crm.user.usecase.dto.EnrollUserUseCaseIn
import com.few.crm.view.CommonVerticalLayout
import web.view.CommonVerticalLayout
import com.vaadin.flow.component.button.Button
import com.vaadin.flow.component.dialog.Dialog
import com.vaadin.flow.component.formlayout.FormLayout
Expand Down
2 changes: 0 additions & 2 deletions domain/crm/src/main/resources/application-crm-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ spring:
properties:
hibernate:
format_sql: true
vaadin:
urlMapping: /view/*
2 changes: 0 additions & 2 deletions domain/crm/src/main/resources/application-crm-prd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ spring:
properties:
hibernate:
format_sql: true
vaadin:
urlMapping: /view/*
4 changes: 4 additions & 0 deletions library/web/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ dependencies {
api("org.springframework.restdocs:spring-restdocs-mockmvc")
api("org.springdoc:springdoc-openapi-ui:${DependencyVersion.SPRINGDOC}")
api("com.epages:restdocs-api-spec-mockmvc:${DependencyVersion.EPAGES_REST_DOCS_API_SPEC}")


/** vaadin */
api("com.vaadin:vaadin-spring-boot-starter")
}
14 changes: 14 additions & 0 deletions library/web/src/main/kotlin/web/config/VaadinConfig.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package web.config
import com.vaadin.flow.spring.annotation.EnableVaadin
import com.vaadin.hilla.crud.CrudConfiguration
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.context.annotation.Configuration

@Configuration
@EnableVaadin(value = ["com.few"])
@EnableAutoConfiguration(
exclude = [
CrudConfiguration::class,
]
)
class VaadinConfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.few.crm.view
package web.view

import com.vaadin.flow.component.UI
import com.vaadin.flow.component.button.Button
Expand All @@ -19,11 +19,11 @@ abstract class CommonVerticalLayout : VerticalLayout() {
val user = VaadinService.getCurrentRequest().wrappedSession.getAttribute("user")
if (user == null || user == "") {
UI.getCurrent().access {
UI.getCurrent().navigate("crm/login")
UI.getCurrent().navigate("login")
}
}

val logo = H1("FEW CRM")
val logo = H1("FEW")
logo.addClassName("logo")
val logout =
Button("Logout") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.few.crm.view
package web.view

import com.vaadin.flow.component.UI
import com.vaadin.flow.component.html.H1
Expand All @@ -13,10 +13,10 @@ import com.vaadin.flow.server.VaadinService
import com.vaadin.flow.server.auth.AnonymousAllowed
import org.springframework.web.client.RestTemplate

@Route("/crm/login")
@Route("/login")
@PageTitle("Login")
@AnonymousAllowed
class CrmLoginView :
class LoginView :
VerticalLayout(),
BeforeEnterObserver {
private val loginOverlay = LoginOverlay()
Expand Down
3 changes: 3 additions & 0 deletions library/web/src/main/resources/application-web-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ web:

webhook:
discord: "localhost:8080/webhook/discord/unused"

vaadin:
urlMapping: /view/*
3 changes: 3 additions & 0 deletions library/web/src/main/resources/application-web-prd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ web:

webhook:
discord: ${WEBHOOK_DISCORD}

vaadin:
urlMapping: /view/*

0 comments on commit 7b2ef4c

Please sign in to comment.