From 3c702d8ee35935772773be92d29e85bac00b0271 Mon Sep 17 00:00:00 2001 From: Jacob Rothstein Date: Fri, 7 Jul 2023 16:41:16 -0700 Subject: [PATCH] add is_first_party to admin aggregator form --- app/src/ApiClient.ts | 1 + app/src/aggregators/AggregatorForm.tsx | 20 ++++++- .../SharedAggregatorForm.tsx | 2 +- src/entity/aggregator/new_aggregator.rs | 4 +- tests/aggregators.rs | 60 +++++++++++++++++++ tests/harness/fixtures.rs | 1 + 6 files changed, 85 insertions(+), 3 deletions(-) diff --git a/app/src/ApiClient.ts b/app/src/ApiClient.ts index fc56c823..585109c1 100644 --- a/app/src/ApiClient.ts +++ b/app/src/ApiClient.ts @@ -110,6 +110,7 @@ export interface NewAggregator { api_url: string; dap_url: string; bearer_token: string; + is_first_party?: boolean; } export interface ApiToken { diff --git a/app/src/aggregators/AggregatorForm.tsx b/app/src/aggregators/AggregatorForm.tsx index ece3e9a1..1b621645 100644 --- a/app/src/aggregators/AggregatorForm.tsx +++ b/app/src/aggregators/AggregatorForm.tsx @@ -46,11 +46,13 @@ async function submit( export function AggregatorForm({ handleSubmit, + showIsFirstParty = false, }: { handleSubmit: ( aggregator: NewAggregator, helpers: FormikHelpers ) => void; + showIsFirstParty?: boolean; }) { const actionData = useActionData(); let errors: undefined | FormikErrors = undefined; @@ -72,6 +74,7 @@ export function AggregatorForm({ api_url: "", dap_url: "", bearer_token: "", + is_first_party: showIsFirstParty ? true : undefined, } as NewAggregator } onSubmit={handleSubmit} @@ -88,6 +91,7 @@ export function AggregatorForm({ + {showIsFirstParty ? : null}