From 717f3afa89b044b2bbede80d1fec095e209135d9 Mon Sep 17 00:00:00 2001 From: mbecker20 Date: Tue, 28 May 2024 14:33:52 -0700 Subject: [PATCH] fix build config when not builder --- bin/migrator/src/migrate.rs | 1 + .../src/components/resources/build/config.tsx | 53 ++++++++++--------- frontend/src/components/resources/common.tsx | 2 +- 3 files changed, 31 insertions(+), 25 deletions(-) diff --git a/bin/migrator/src/migrate.rs b/bin/migrator/src/migrate.rs index db188f723..3d06fbc2e 100644 --- a/bin/migrator/src/migrate.rs +++ b/bin/migrator/src/migrate.rs @@ -129,6 +129,7 @@ pub async fn migrate_builds( Ok(()) } +#[allow(unused)] pub async fn migrate_updates( legacy_db: &v0::DbClient, target_db: &crate::DbClient, diff --git a/frontend/src/components/resources/build/config.tsx b/frontend/src/components/resources/build/config.tsx index a9f428b59..b1b7817e3 100644 --- a/frontend/src/components/resources/build/config.tsx +++ b/frontend/src/components/resources/build/config.tsx @@ -116,17 +116,19 @@ export const BuildConfig = ({ repo: { placeholder: "Enter repo" }, branch: { placeholder: "Enter branch" }, commit: { placeholder: "Enter specific commit hash. Optional." }, - github_account: (account, set) => ( - set({ github_account })} - disabled={disabled} - placeholder="None" - /> - ), + github_account: + (update.builder_id ?? config.builder_id ? true : false) && + ((account, set) => ( + set({ github_account })} + disabled={disabled} + placeholder="None" + /> + )), }, }, { @@ -134,17 +136,18 @@ export const BuildConfig = ({ components: { build_path: true, dockerfile_path: true, - docker_account: (account, set) => ( - set({ docker_account })} - disabled={disabled} - placeholder="None" - /> - ), + docker_account: (account, set) => + (update.builder_id ?? config.builder_id ? true : false) && ( + set({ docker_account })} + disabled={disabled} + placeholder="None" + /> + ), docker_organization: docker_organizations === undefined || docker_organizations.length === 0 @@ -298,7 +301,9 @@ const DockerOrganizations = ({