Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set admin page grid height to 100% #693

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ import support.views.toDisplayName
class AdministratorsView(private val administratorService: AdministratorService) : VerticalLayout() {
init {
add(createTitle(), createButton(), createGrid())
setSizeFull()
}

private fun createTitle(): Component {
return HorizontalLayout(H1("관리자")).apply {
setSizeFull()
setWidthFull()
justifyContentMode = FlexComponent.JustifyContentMode.CENTER
}
}
Expand All @@ -43,7 +44,7 @@ class AdministratorsView(private val administratorService: AdministratorService)
}
}
).apply {
setSizeFull()
setWidthFull()
justifyContentMode = FlexComponent.JustifyContentMode.END
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/apply/ui/admin/cheater/CheatersView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ class CheatersView(
) : VerticalLayout() {
init {
add(createTitle(), createAddCheater(), createCheaterGrid())
setSizeFull()
}

private fun createTitle(): Component {
return HorizontalLayout(H1("부정행위자")).apply {
setSizeFull()
setWidthFull()
justifyContentMode = FlexComponent.JustifyContentMode.CENTER
}
}
Expand All @@ -45,7 +46,7 @@ class CheatersView(
}
).apply {
justifyContentMode = FlexComponent.JustifyContentMode.END
setSizeFull()
setWidthFull()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import support.views.createIntSelect

class EvaluationItemForm() : BindingIdentityFormLayout<EvaluationItemData>(EvaluationItemData::class) {
private val title: TextField = TextField("항목명")
private val maximumScore: Select<Int> = createIntSelect(max = 10).apply { label = "최대 점수" }
private val maximumScore: Select<Int> = createIntSelect(max = 100).apply { label = "최대 점수" }
private val position: Select<Int> = createIntSelect(max = 10).apply { label = "순서" }
private val description: TextArea = TextArea("설명")

Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/apply/ui/admin/evaluation/EvaluationsView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ import support.views.createPrimarySmallButton
class EvaluationsView(private val evaluationService: EvaluationService) : VerticalLayout() {
init {
add(createTitle(), createButton(), createGrid())
setSizeFull()
}

private fun createTitle(): Component {
return HorizontalLayout(H1("평가 관리")).apply {
setSizeFull()
setWidthFull()
justifyContentMode = FlexComponent.JustifyContentMode.CENTER
}
}
Expand All @@ -39,7 +40,7 @@ class EvaluationsView(private val evaluationService: EvaluationService) : Vertic
UI.getCurrent().navigate(EvaluationsFormView::class.java, NEW_VALUE)
}
).apply {
setSizeFull()
setWidthFull()
justifyContentMode = FlexComponent.JustifyContentMode.END
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/apply/ui/admin/mail/MailsView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ class MailsView(
) : VerticalLayout() {
init {
add(createTitle(), createButton(), createGrid())
setSizeFull()
}

private fun createTitle(): Component {
return HorizontalLayout(H1("메일 관리")).apply {
setSizeFull()
setWidthFull()
justifyContentMode = FlexComponent.JustifyContentMode.CENTER
}
}
Expand All @@ -41,7 +42,7 @@ class MailsView(
UI.getCurrent().navigate(MailsFormView::class.java, NEW_VALUE)
}
).apply {
setSizeFull()
setWidthFull()
justifyContentMode = FlexComponent.JustifyContentMode.END
}
}
Expand Down
10 changes: 7 additions & 3 deletions src/main/kotlin/apply/ui/admin/mission/MissionsView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.vaadin.flow.component.Component
import com.vaadin.flow.component.UI
import com.vaadin.flow.component.button.Button
import com.vaadin.flow.component.grid.Grid
import com.vaadin.flow.component.html.H1
import com.vaadin.flow.component.orderedlayout.FlexComponent
import com.vaadin.flow.component.orderedlayout.HorizontalLayout
import com.vaadin.flow.component.orderedlayout.VerticalLayout
Expand All @@ -20,7 +21,6 @@ import com.vaadin.flow.router.Route
import com.vaadin.flow.router.WildcardParameter
import support.views.EDIT_VALUE
import support.views.NEW_VALUE
import support.views.Title
import support.views.addSortableColumn
import support.views.addSortableDateTimeColumn
import support.views.createDeleteButtonWithDialog
Expand All @@ -37,10 +37,14 @@ class MissionsView(
override fun setParameter(event: BeforeEvent, @WildcardParameter parameter: Long) {
recruitmentId = parameter
add(createTitle(), createButton(), createGrid())
setSizeFull()
}

private fun createTitle(): Component {
return Title("${recruitmentService.getById(recruitmentId).title} 과제 관리")
return HorizontalLayout(H1("${recruitmentService.getById(recruitmentId).title} 과제 관리")).apply {
setWidthFull()
justifyContentMode = FlexComponent.JustifyContentMode.CENTER
}
}

private fun createButton(): Component {
Expand All @@ -49,7 +53,7 @@ class MissionsView(
UI.getCurrent().navigate(MissionsFormView::class.java, "$recruitmentId/$NEW_VALUE")
}
).apply {
setSizeFull()
setWidthFull()
justifyContentMode = FlexComponent.JustifyContentMode.END
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ import support.views.createPrimarySmallButton
class RecruitmentsView(private val recruitmentService: RecruitmentService) : VerticalLayout() {
init {
add(createTitle(), createButton(), createGrid())
setSizeFull()
}

private fun createTitle(): Component {
return HorizontalLayout(H1("모집 관리")).apply {
setSizeFull()
setWidthFull()
justifyContentMode = FlexComponent.JustifyContentMode.CENTER
}
}
Expand All @@ -42,7 +43,7 @@ class RecruitmentsView(private val recruitmentService: RecruitmentService) : Ver
UI.getCurrent().navigate(RecruitmentsFormView::class.java, NEW_VALUE)
}
).apply {
setSizeFull()
setWidthFull()
justifyContentMode = FlexComponent.JustifyContentMode.END
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/main/kotlin/apply/ui/admin/selections/SelectionView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class SelectionView(
override fun setParameter(event: BeforeEvent, @WildcardParameter parameter: Long) {
this.recruitmentId = parameter
add(createTitle(), createContent())
setSizeFull()
}

private fun createTitle(): Component {
Expand Down Expand Up @@ -106,7 +107,7 @@ class SelectionView(
setWidthFull()
justifyContentMode = FlexComponent.JustifyContentMode.BETWEEN
}
return VerticalLayout(menu, grids, evaluationFileButtons).apply { setWidthFull() }
return VerticalLayout(menu, grids, evaluationFileButtons).apply { setSizeFull() }
}

private fun createEvaluationFileButtons(): HorizontalLayout {
Expand Down Expand Up @@ -146,6 +147,7 @@ class SelectionView(
addSortableColumn("부정행위자") { if (it.isCheater) "O" else "X" }
addColumn(createButtonRenderer()).apply { isAutoWidth = true }
setItems(users)
setSizeFull()
}
}

Expand All @@ -170,6 +172,7 @@ class SelectionView(
addSortableColumn("평가자", EvaluationTargetResponse::administratorId)
addColumn(createEvaluationButtonRenderer()).apply { isAutoWidth = true }
setItems(evaluationTargets)
setSizeFull()
}
}

Expand Down Expand Up @@ -206,7 +209,7 @@ class SelectionView(
tabs = this
}

val grids = Div(*tabsToGrids.values.toTypedArray()).apply { setWidthFull() }
val grids = Div(*tabsToGrids.values.toTypedArray()).apply { setSizeFull() }

return tabs to grids
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/apply/ui/admin/term/TermsView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ import support.views.toDisplayName
class TermsView(private val termService: TermService) : VerticalLayout() {
init {
add(createTitle(), createButton(), createGrid())
setSizeFull()
}

private fun createTitle(): Component {
return HorizontalLayout(H1("기수 관리")).apply {
setSizeFull()
setWidthFull()
justifyContentMode = FlexComponent.JustifyContentMode.CENTER
}
}
Expand All @@ -44,7 +45,7 @@ class TermsView(private val termService: TermService) : VerticalLayout() {
}
}
).apply {
setSizeFull()
setWidthFull()
justifyContentMode = FlexComponent.JustifyContentMode.END
}
}
Expand Down