Skip to content

[DO NOT MERGE] Toolbox refactor #478

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

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
No naked booleans
  • Loading branch information
code-asher committed Sep 12, 2024
commit 9f591ac2f2f5dee5c574e1eabae175e222edaff9
2 changes: 1 addition & 1 deletion src/main/kotlin/com/coder/gateway/CoderRemoteProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class CoderRemoteProvider(
* List of actions that appear next to the account.
*/
override fun getAdditionalPluginActions(): List<RunnableActionDescription> = listOf(
Action("Settings", false) {
Action("Settings", closesPage = false) {
ui.showUiPage(settingsPage)
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CoderSettingsPage(private val settings: CoderSettingsService) : CoderPage(
override fun getTitle(): String = "Coder Settings"

override fun getActionButtons(): MutableList<RunnableActionDescription> = mutableListOf(
Action("Save", true) {
Action("Save", closesPage = true) {
settings.binarySource = get(binarySourceField) as String
settings.binaryDirectory = get(binaryDirectoryField) as String
settings.dataDirectory = get(dataDirectoryField) as String
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/coder/gateway/views/ConnectPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class ConnectPage(
* Show a retry button on error.
*/
override fun getActionButtons(): MutableList<RunnableActionDescription> = listOfNotNull(
if (errorField != null) Action("Retry", false) { retry() } else null,
if (errorField != null) Action("Cancel", false) { onCancel() } else null,
if (errorField != null) Action("Retry", closesPage = false) { retry() } else null,
if (errorField != null) Action("Cancel", closesPage = false) { onCancel() } else null,
).toMutableList()

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/coder/gateway/views/SignInPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class SignInPage(
* Buttons displayed at the bottom of the page.
*/
override fun getActionButtons(): MutableList<RunnableActionDescription> = mutableListOf(
Action("Sign In", false) { submit() },
Action("Sign In", closesPage = false) { submit() },
)

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/coder/gateway/views/TokenPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class TokenPage(
* Buttons displayed at the bottom of the page.
*/
override fun getActionButtons(): MutableList<RunnableActionDescription> = mutableListOf(
Action("Connect", false) { submit(get(tokenField) as String) },
Action("Connect", closesPage = false) { submit(get(tokenField) as String) },
)

/**
Expand Down
Loading