Skip to content

Commit

Permalink
remove default javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
F43nd1r committed Oct 8, 2023
1 parent 10aa0f5 commit edb40f8
Show file tree
Hide file tree
Showing 57 changed files with 21 additions and 257 deletions.
Expand Up @@ -27,10 +27,6 @@ import org.springframework.context.annotation.Lazy
import org.springframework.stereotype.Service
import java.io.ByteArrayInputStream

/**
* @author lukas
* @since 29.07.18
*/
@Service
class AvatarService {
private val avatar: Avatar = IdenticonAvatar.newAvatarBuilder().size(32, 32).build()
Expand Down
Expand Up @@ -48,10 +48,6 @@ import java.time.OffsetDateTime
import java.time.temporal.ChronoUnit
import java.util.*

/**
* @author lukas
* @since 07.12.18
*/
@Service
@EnableScheduling
@EnableAsync
Expand Down
Expand Up @@ -19,10 +19,6 @@ import com.vaadin.flow.i18n.I18NProvider
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

/**
* @author lukas
* @since 10.11.18
*/
@Configuration
class I18NConfiguration {
@Bean
Expand Down
Expand Up @@ -22,12 +22,6 @@ import java.util.*

private val logger = KotlinLogging.logger {}

/**
* Implementation of [I18NProvider] that reads messages from [ResourceBundle]s with a specific base name.
*
* @author lukas
* @since 10.11.18
*/
class ResourceBundleI18NProvider(private val baseName: String) : I18NProvider {
private fun getResourceBundle(locale: Locale, withFallback: Boolean): ResourceBundle? {
return try {
Expand All @@ -43,13 +37,13 @@ class ResourceBundleI18NProvider(private val baseName: String) : I18NProvider {
override fun getProvidedLocales() = Locale.getAvailableLocales().filter { getResourceBundle(it, false) != null }

override fun getTranslation(key: String, locale: Locale, vararg params: Any): String? =
getResourceBundle(locale, true)?.tryOrNull { getString(key) }?.let { String.format(it, *params) }
getResourceBundle(locale, true)?.tryOrNull { getString(key) }?.let { String.format(it, *params) }

private class MessageControl(private val allowFallback: Boolean) : ResourceBundle.Control() {
override fun getFallbackLocale(baseName: String, locale: Locale): Locale? = if (allowFallback) super.getFallbackLocale(baseName, locale) else null

override fun getCandidateLocales(baseName: String, locale: Locale): List<Locale> =
if (allowFallback) super.getCandidateLocales(baseName, locale) else listOf(locale, Locale.ROOT)
if (allowFallback) super.getCandidateLocales(baseName, locale) else listOf(locale, Locale.ROOT)
}


Expand Down
Expand Up @@ -20,10 +20,6 @@ import com.vaadin.flow.i18n.I18NProvider
import com.vaadin.flow.server.VaadinService
import java.util.*

/**
* @author lukas
* @since 06.09.19
*/
open class TranslatableText(val id: String, vararg val params: Any) {

fun translate(): String {
Expand Down
Expand Up @@ -31,10 +31,6 @@ import org.springframework.security.access.prepost.PreAuthorize
import org.springframework.web.bind.annotation.*
import java.time.Instant

/**
* @author lukas
* @since 23.08.18
*/
@RestController
@RequestMapping(RestApiInterface.API_PATH)
@PreAuthorize("isApi()")
Expand Down
Expand Up @@ -25,29 +25,20 @@ import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestMethod
import org.springframework.web.bind.annotation.RestController
import org.springframework.web.multipart.MultipartHttpServletRequest
import java.io.IOException
import java.nio.charset.StandardCharsets
import java.security.Principal

/**
* @author Lukas
* @since 22.03.2017
*/
@RestController
@PreAuthorize("isReporter()")
class RestReportInterface(private val reportService: ReportService) {
@RequestMapping(value = [REPORT_PATH], consumes = [MediaType.APPLICATION_JSON_VALUE], method = [RequestMethod.POST])
fun report(
@RequestBody
content: String, principal: Principal
) {
fun report(@RequestBody content: String, principal: Principal) {
if (content.isNotBlank()) {
reportService.create(principal.name, content, emptyList())
}
}

@RequestMapping(value = [REPORT_PATH], consumes = [MediaType.MULTIPART_FORM_DATA_VALUE], method = [RequestMethod.POST])
@Throws(IOException::class)
fun report(request: MultipartHttpServletRequest, principal: Principal): ResponseEntity<*> {
val fileMap = request.multiFileMap
val reportFiles = fileMap[REPORT]
Expand Down
Expand Up @@ -44,11 +44,6 @@ import org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMa
import org.springframework.security.web.util.matcher.OrRequestMatcher
import org.springframework.web.servlet.handler.HandlerMappingIntrospector


/**
* @author Lukas
* @since 22.03.2017
*/
@Configuration
@EnableWebSecurity
class WebSecurityConfiguration(private val userRepository: UserRepository) : VaadinWebSecurity() {
Expand Down
Expand Up @@ -30,10 +30,6 @@ import java.net.URLEncoder
import java.util.*
import kotlin.reflect.KProperty

/**
* @author lukas
* @since 10.09.19
*/
@SpringComponent
@VaadinSessionScope
class LocalSettings(private val objectMapper: ObjectMapper) : Serializable {
Expand Down
Expand Up @@ -31,10 +31,6 @@ import org.springframework.core.annotation.AnnotationUtils
import kotlin.reflect.KClass
import kotlin.reflect.full.isSubclassOf

/**
* @author lukas
* @since 18.10.18
*/
class AppPath(private val applicationContext: GenericApplicationContext) : SubTabs(), AfterNavigationListener, BeforeEnterObserver {
private var registration: Registration? = null

Expand Down
4 changes: 0 additions & 4 deletions acrarium/src/main/kotlin/com/faendir/acra/ui/component/Box.kt
Expand Up @@ -22,10 +22,6 @@ import com.vaadin.flow.component.Tag
import com.vaadin.flow.component.dependency.JsModule
import com.vaadin.flow.component.littemplate.LitTemplate

/**
* @author lukas
* @since 27.11.19
*/
@Tag("acrarium-box")
@JsModule("./elements/box.ts")
class Box(title: Component, details: Component, action: Component) : LitTemplate(), HasSize, HasStyle, HasSlottedComponents<Box.Slot> {
Expand Down
Expand Up @@ -20,10 +20,6 @@ import com.vaadin.flow.component.*
import com.vaadin.flow.component.dependency.JsModule
import com.vaadin.flow.component.littemplate.LitTemplate

/**
* @author lukas
* @since 18.10.18
*/
@Tag("acrarium-card")
@JsModule("./elements/card.ts")
class Card() : LitTemplate(), HasSize, HasStyle, HasComponents, HasSlottedComponents<Card.Slot> {
Expand Down
Expand Up @@ -28,10 +28,6 @@ import com.vaadin.flow.server.VaadinRequest
import com.vaadin.flow.server.VaadinService
import org.springframework.beans.factory.annotation.Value

/**
* @author lukas
* @since 09.11.18
*/
class ConfigurationLabel private constructor(
@Value("\${server.context-path}")
private val baseUrl: String?
Expand Down
Expand Up @@ -18,10 +18,6 @@ package com.faendir.acra.ui.component
import com.vaadin.flow.component.html.Anchor
import com.vaadin.flow.server.AbstractStreamResource

/**
* @author lukas
* @since 15.11.18
*/
class DownloadButton(href: AbstractStreamResource, captionId: String, vararg params: Any) : Anchor(href, "") {
init {
element.setAttribute("download", true)
Expand Down
Expand Up @@ -23,10 +23,6 @@ import com.vaadin.flow.i18n.LocaleChangeEvent
import com.vaadin.flow.i18n.LocaleChangeObserver
import com.vaadin.flow.router.HasDynamicTitle

/**
* @author lukas
* @since 06.09.19
*/
interface HasAcrariumTitle : HasDynamicTitle, LocaleChangeObserver {
val title: TranslatableText
override fun getPageTitle(): String {
Expand Down
Expand Up @@ -27,10 +27,6 @@ import com.vaadin.flow.server.StreamResource
import com.vaadin.flow.server.StreamResourceRegistry
import com.vaadin.flow.server.VaadinSession

/**
* @author lukas
* @since 23.04.19
*/
@Tag("acrarium-image-with-label")
@JsModule("./elements/image-with-label.ts")
class InstallationView(private val avatarService: AvatarService) : LitTemplate() {
Expand Down
Expand Up @@ -18,10 +18,6 @@ package com.faendir.acra.ui.component
import com.vaadin.flow.component.customfield.CustomField
import com.vaadin.flow.component.textfield.NumberField

/**
* @author lukas
* @since 07.05.19
*/
class RangeField : CustomField<Double>() {
private val input: RangeInput = RangeInput()
private val _field: NumberField = NumberField()
Expand Down
Expand Up @@ -17,10 +17,6 @@ package com.faendir.acra.ui.component

import com.vaadin.flow.component.*

/**
* @author lukas
* @since 29.11.18
*/
@Tag(Tag.INPUT)
class RangeInput : AbstractSinglePropertyField<RangeInput, Double>("value", 0.0, false), Focusable<RangeInput>, HasSize, HasStyle {

Expand Down
Expand Up @@ -45,10 +45,6 @@ import com.vaadin.flow.data.renderer.ComponentRenderer
import com.vaadin.flow.spring.annotation.SpringComponent
import com.vaadin.flow.spring.annotation.UIScope

/**
* @author lukas
* @since 17.09.18
*/
class ReportList(
private val app: AppId,
private val dataProvider: AcrariumDataProvider<ReportRow, ReportRow.Filter, ReportRow.Sort>,
Expand Down
Expand Up @@ -34,10 +34,6 @@ import com.vaadin.flow.router.RouterLink
import com.vaadin.flow.shared.Registration
import kotlin.reflect.KClass

/**
* @author lukas
* @since 14.11.18
*/
open class Translatable<T : Component>(protected val t: T, private val property: T.(String) -> Unit, internal val captionId: String, private vararg val params: Any) :
Composite<T>(), LocaleChangeObserver, HasSize, HasStyle {

Expand Down
Expand Up @@ -22,10 +22,6 @@ import com.vaadin.flow.component.upload.receivers.MemoryBuffer
import org.springframework.util.StreamUtils
import java.nio.charset.Charset

/**
* @author lukas
* @since 06.03.19
*/
class UploadField : CustomField<String?>() {
private val buffer: MemoryBuffer = MemoryBuffer()

Expand Down
Expand Up @@ -37,10 +37,6 @@ import java.util.*
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract

/**
* @author lukas
* @since 28.02.19
*/
class UserEditor(userRepository: UserRepository, mailService: MailService?, existingUsername: String? = null, grantRoles: Set<Role> = emptySet(), onSuccess: () -> Unit) :
Composite<FlexLayout>() {
private val isExistingUser = existingUsername != null
Expand Down
Expand Up @@ -23,10 +23,6 @@ import com.vaadin.flow.component.Tag
import com.vaadin.flow.component.dependency.JsModule
import com.vaadin.flow.component.littemplate.LitTemplate

/**
* @author lukas
* @since 24.04.19
*/
@Tag("acrarium-dialog-content")
@JsModule("./elements/dialog-content.ts")
class DialogContent : LitTemplate(), HasSize, HasStyle, HasComponents, HasSlottedComponents<DialogContent.Slot> {
Expand Down
Expand Up @@ -15,10 +15,6 @@
*/
package com.faendir.acra.ui.component.dialog

/**
* @author Lukas
* @since 19.12.2017
*/
class FluentDialog : AcrariumDialog() {
private val fields: MutableMap<ValidatedField<*, *>, Pair<Boolean, (Boolean) -> Unit>> = mutableMapOf()

Expand Down
Expand Up @@ -19,11 +19,12 @@ import com.vaadin.flow.component.Component
import com.vaadin.flow.component.HasValidation
import com.vaadin.flow.component.HasValue

/**
* @author Lukas
* @since 22.06.2017
*/
class ValidatedField<V, T : Component> private constructor(val field: T, private val getValue: () -> V, registerListener: ((V) -> Unit) -> Unit, private val setMessage: (String?) -> Unit) {
class ValidatedField<V, T : Component> private constructor(
val field: T,
private val getValue: () -> V,
registerListener: ((V) -> Unit) -> Unit,
private val setMessage: (String?) -> Unit
) {
private val validators: MutableMap<(V) -> Boolean, String> = mutableMapOf()
private val listeners: MutableList<(Boolean) -> Unit> = mutableListOf()
private var valid: Boolean = false
Expand Down Expand Up @@ -60,7 +61,7 @@ class ValidatedField<V, T : Component> private constructor(val field: T, private

companion object {
fun <V, T, E : HasValue.ValueChangeEvent<V>> of(field: T): ValidatedField<V, T> where T : Component, T : HasValue<E, V>, T : HasValidation {
return ValidatedField(field, { field.value }, { listener -> field.addValueChangeListener { listener(it.value) } }, { field.errorMessage = it })
return ValidatedField(field, { field.value }, { listener -> field.addValueChangeListener { listener(it.value) } }, { field.errorMessage = it })
}

fun <V, T> of(field: T, getValue: () -> V, registerListener: ((V) -> Unit) -> Unit): ValidatedField<V, T> where T : Component, T : HasValue<*, V>, T : HasValidation {
Expand Down
Expand Up @@ -22,10 +22,6 @@ import com.faendir.acra.persistence.version.VersionRepository
import com.faendir.acra.ui.component.Translatable
import com.vaadin.flow.component.orderedlayout.FlexLayout

/**
* @author lukas
* @since 24.04.19
*/
class VersionEditorDialog(versionRepository: VersionRepository, appId: AppId, onUpdate: (() -> Unit) = {}, old: Version? = null) : AcrariumDialog() {

init {
Expand Down
Expand Up @@ -24,10 +24,6 @@ import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.*

/**
* @author Lukas
* @since 26.05.2017
*/
open class TimeSpanRenderer<T>(valueProvider: (T) -> LocalDateTime?) : ComponentRenderer<Span, T>({ t: T ->
valueProvider(t)?.let {
Span(PrettyTime(Locale.US).formatUnrounded(it)).apply {
Expand Down
Expand Up @@ -23,10 +23,6 @@ import com.faendir.acra.ui.ext.setWidth
import com.github.appreciated.apexcharts.ApexCharts
import com.vaadin.flow.component.Composite

/**
* @author lukas
* @since 01.06.18
*/
internal abstract class Chart<T>(captionId: String, vararg params: Any) : Composite<Card>() {

init {
Expand Down
Expand Up @@ -21,10 +21,6 @@ import com.github.appreciated.apexcharts.ApexChartsBuilder
import com.github.appreciated.apexcharts.config.builder.ChartBuilder
import com.github.appreciated.apexcharts.config.chart.Type

/**
* @author lukas
* @since 01.06.18
*/
internal class PieChart(captionId: String, vararg params: Any) : Chart<String>(captionId, *params) {

override fun createChart(map: Map<String, Int>): ApexCharts {
Expand All @@ -38,8 +34,8 @@ internal class PieChart(captionId: String, vararg params: Any) : Chart<String>(c
return ApexChartsBuilder.get()
.withChart(ChartBuilder.get().withType(Type.PIE).withBackground("transparent").build())
.withLabels(*list.map { it.first }.toTypedArray())
.withSeries(*list.map {it.second.toDouble() }.toTypedArray())
.build()
.withSeries(*list.map { it.second.toDouble() }.toTypedArray())
.build()
}

companion object {
Expand Down
Expand Up @@ -34,10 +34,6 @@ import org.jooq.SelectField
import java.time.Instant
import java.time.temporal.ChronoUnit

/**
* @author lukas
* @since 01.06.18
*/
internal class Property<F, C, T, E : HasValue.ValueChangeEvent<F>, V> private
constructor(
private val appId: AppId,
Expand Down

0 comments on commit edb40f8

Please sign in to comment.