Skip to content

Commit

Permalink
Update Backfill Show to use full width tables (#411)
Browse files Browse the repository at this point in the history
Update Backfill Show to use full width tables

![Screenshot 2025-01-23 at 16 11
54](https://github.com/user-attachments/assets/dfe9c559-8965-4696-9168-8133252c6560)


Add custom parameters and handling of odd number of rows 

<img width="1140" alt="Screenshot 2025-01-27 at 11 52 43"
src="https://github.com/user-attachments/assets/e668dc12-12e0-4b70-a1c7-31ca0d2d4c0c"
/>
  • Loading branch information
adrw authored Jan 27, 2025
1 parent 6e89a7a commit 700ac33
Show file tree
Hide file tree
Showing 6 changed files with 263 additions and 222 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class BackfillCreateHandlerAction @Inject constructor(
formFields[BackfillCreateField.EXTRA_SLEEP_MS.fieldId]?.ifNotBlank { createRequestBuilder.extra_sleep_ms(it.toLongOrNull()) }
formFields[BackfillCreateField.BACKOFF_SCHEDULE.fieldId]?.ifNotBlank { createRequestBuilder.backoff_schedule(it) }
val customParameters = formFields.filter { it.key.startsWith(BackfillCreateField.CUSTOM_PARAMETER_PREFIX.fieldId) }
.mapValues { it.value?.encodeUtf8() }
.map { it.key.removePrefix(BackfillCreateField.CUSTOM_PARAMETER_PREFIX.fieldId) to it.value?.encodeUtf8() }.toMap()
if (customParameters.isNotEmpty()) {
createRequestBuilder.parameter_map(customParameters)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@ class BackfillShowButtonHandlerAction @Inject constructor(

companion object {
const val PATH = "/api/backfill/{id}/update"
fun path(id: String) = PATH.replace("{id}", id)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import app.cash.backfila.ui.actions.ServiceDataHelper
import app.cash.backfila.ui.components.AlertError
import app.cash.backfila.ui.components.DashboardPageLayout
import app.cash.backfila.ui.components.PageTitle
import javax.inject.Inject
import javax.inject.Singleton
import kotlinx.html.ButtonType
import kotlinx.html.InputType
import kotlinx.html.button
Expand All @@ -29,8 +31,6 @@ import misk.web.ResponseBody
import misk.web.ResponseContentType
import misk.web.actions.WebAction
import misk.web.mediatype.MediaTypes
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class BackfillCreateAction @Inject constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class BackfillCreateServiceIndexAction @Inject constructor(
val newPath = BackfillCreateAction.path(
service = service,
variantOrBackfillNameOrId = variantOrBlank.orEmpty(),
backfillNameOrId = ""
backfillNameOrId = "",
)
return Response(
body = "go to $newPath".toResponseBody(),
Expand Down Expand Up @@ -95,7 +95,7 @@ class BackfillCreateServiceIndexAction @Inject constructor(
href = BackfillCreateAction.path(
service = service,
variantOrBackfillNameOrId = variantOrBackfillNameOrId,
backfillNameOrId = if (variantOrBackfillNameOrId == it.name) "" else it.name
backfillNameOrId = if (variantOrBackfillNameOrId == it.name) "" else it.name,
)

this@ul.li("registration col-span-1 divide-y divide-gray-200 rounded-lg bg-white shadow") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import kotlinx.html.button
import kotlinx.html.div
import kotlinx.html.h3
import kotlinx.html.li
import kotlinx.html.p
import kotlinx.html.role
import kotlinx.html.span
import kotlinx.html.ul
Expand Down
Loading

0 comments on commit 700ac33

Please sign in to comment.