Skip to content

Commit c3faec7

Browse files
committed
working breadcrumbs, create, clone
1 parent 6e4769c commit c3faec7

19 files changed

+531
-643
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package app.cash.backfila.ui
2+
3+
object DashboardUrls {
4+
fun app(appName: String) = "/app/$appName"
5+
fun createDeploy(appName: String) = "/app/$appName/deploy"
6+
fun deploy(appName: String, deployName: String) = "/app/$appName/deploy/$deployName"
7+
fun setMinimalCommitTimestamp(appName: String) = "/app/$appName/set-minimal-commit-timestamp"
8+
}

service/src/main/kotlin/app/cash/backfila/ui/PathBuilder.kt

Lines changed: 0 additions & 69 deletions
This file was deleted.

service/src/main/kotlin/app/cash/backfila/ui/UiModule.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package app.cash.backfila.ui
22

33
import app.cash.backfila.ui.actions.BackfillCreateHandlerAction
44
import app.cash.backfila.ui.actions.BackfillShowButtonHandlerAction
5-
import app.cash.backfila.ui.actions.ServiceAutocompleteAction
65
import app.cash.backfila.ui.pages.BackfillCreateAction
76
import app.cash.backfila.ui.pages.BackfillCreateIndexAction
7+
import app.cash.backfila.ui.pages.BackfillCreateServiceIndexAction
88
import app.cash.backfila.ui.pages.BackfillIndexAction
99
import app.cash.backfila.ui.pages.BackfillShowAction
1010
import app.cash.backfila.ui.pages.IndexAction
@@ -20,13 +20,13 @@ class UiModule : KAbstractModule() {
2020
install(WebActionModule.create<ServiceIndexAction>())
2121
install(WebActionModule.create<ServiceShowAction>())
2222
install(WebActionModule.create<BackfillCreateIndexAction>())
23+
install(WebActionModule.create<BackfillCreateServiceIndexAction>())
2324
install(WebActionModule.create<BackfillCreateAction>())
2425
install(WebActionModule.create<BackfillIndexAction>())
2526
install(WebActionModule.create<BackfillShowAction>())
2627

2728
// Other
2829
install(WebActionModule.create<BackfillCreateHandlerAction>())
2930
install(WebActionModule.create<BackfillShowButtonHandlerAction>())
30-
install(WebActionModule.create<ServiceAutocompleteAction>())
3131
}
3232
}

service/src/main/kotlin/app/cash/backfila/ui/actions/ServiceAutocompleteAction.kt

Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package app.cash.backfila.ui.actions
2+
3+
import app.cash.backfila.dashboard.GetServicesAction
4+
import javax.inject.Inject
5+
import javax.inject.Singleton
6+
7+
@Singleton
8+
class ServiceDataHelper @Inject constructor(
9+
private val getServicesAction: GetServicesAction,
10+
) {
11+
fun getFlattenedServices(): Map<String, GetServicesAction.UiService> {
12+
val services = getServicesAction.services().services
13+
return services.flatMap { service ->
14+
service.variants.map { variant -> "${service.name}/$variant" to service }
15+
}.toMap()
16+
}
17+
}

service/src/main/kotlin/app/cash/backfila/ui/components/BackfillsTable.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package app.cash.backfila.ui.components
22

33
import app.cash.backfila.dashboard.UiBackfillRun
4-
import app.cash.backfila.ui.PathBuilder
54
import app.cash.backfila.ui.pages.BackfillShowAction
65
import kotlinx.html.TagConsumer
76
import kotlinx.html.a
@@ -48,7 +47,7 @@ fun TagConsumer<*>.BackfillsTable(running: Boolean, backfills: List<UiBackfillRu
4847
"whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-0",
4948
) {
5049
a(classes = "text-green-500 hover:underline") {
51-
href = PathBuilder(path = BackfillShowAction.PATH.replace("{id}", it.id)).build()
50+
href = BackfillShowAction.PATH.replace("{id}", it.id)
5251
+it.name
5352
}
5453
}

service/src/main/kotlin/app/cash/backfila/ui/components/DashboardPageLayout.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class DashboardPageLayout @Inject constructor(
7575

7676
fun headBlock(block: TagConsumer<*>.() -> Unit) = apply { this.headBlock = block }
7777

78-
fun breadcrumbLinks(links: List<Link>) = apply { this.breadcrumbLinks = links }
78+
fun breadcrumbLinks(vararg links: Link?) = apply { this.breadcrumbLinks = links.toList().filterNotNull() }
7979

8080
@JvmOverloads
8181
fun build(block: TagConsumer<*>.() -> Unit = { }): String {

service/src/main/kotlin/app/cash/backfila/ui/components/PageTitle.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import kotlinx.html.div
55
import kotlinx.html.header
66
import kotlinx.html.span
77

8-
fun TagConsumer<*>.PageTitle(title: String, subtitle: String? = null, floatRightBlock: TagConsumer<*>.() -> Unit = {}) {
8+
fun TagConsumer<*>.PageTitle(title: String, subtitle: String? = null, smallerSubtitle: String? = null, floatRightBlock: TagConsumer<*>.() -> Unit = {}) {
99
header {
1010
div("mx-auto max-w-7xl px-200 sm:px-6 lg:px-8s py-10") {
1111
val maybeSubtitleSuffix = subtitle?.let { ": " } ?: ""
@@ -14,6 +14,11 @@ fun TagConsumer<*>.PageTitle(title: String, subtitle: String? = null, floatRight
1414
div("float-right") {
1515
floatRightBlock()
1616
}
17+
div {
18+
smallerSubtitle?.let {
19+
span("text-sm font-medium text-gray-500") { +it }
20+
}
21+
}
1722
}
1823
}
1924
}

service/src/main/kotlin/app/cash/backfila/ui/components/ServiceAutocomplete.kt

Lines changed: 0 additions & 68 deletions
This file was deleted.

service/src/main/kotlin/app/cash/backfila/ui/components/ServiceAutocompleteWrapper.kt

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)