Commit

Integrations: connect forms open under the tile that was chosen

syntaqxcommitted Parentf0e9964Browse files
1 file+31−110/1 viewed
+31−11
243243 agent's sandbox holds a token that dies with the run.
244244 </p>
245245 {!model && owner && <Choices kind="models" slug={slug} adding={adding} />}
246+ {adding && PROVIDERS[adding].kind === "models" && owner && (
247+ <AddForm
248+ provider={adding}
249+ slug={slug}
250+ repos={repoNames}
251+ busy={busy}
252+ error={actionData && "provider" in actionData ? error : null}
253+ />
254+ )}
246255 </Section>
247256
248257 {/* Alerts -------------------------------------------------------------- */}
255264 deliveries={deliveries}
256265 />
257266 {owner && <Choices kind="alerts" slug={slug} adding={adding} />}
267+ {adding && PROVIDERS[adding].kind === "alerts" && owner && (
268+ <AddForm
269+ provider={adding}
270+ slug={slug}
271+ repos={repoNames}
272+ busy={busy}
273+ error={actionData && "provider" in actionData ? error : null}
274+ />
275+ )}
258276 </Section>
259277
260278 {/* Trackers ------------------------------------------------------------ */}
267285 deliveries={deliveries}
268286 />
269287 {owner && <Choices kind="tracker" slug={slug} adding={adding} />}
288+ {adding && PROVIDERS[adding].kind === "tracker" && owner && (
289+ <AddForm
290+ provider={adding}
291+ slug={slug}
292+ repos={repoNames}
293+ busy={busy}
294+ error={actionData && "provider" in actionData ? error : null}
295+ />
296+ )}
270297 </Section>
271298
272− {adding && owner && (
273− <AddForm
274− provider={adding}
275− slug={slug}
276− repos={repoNames}
277− busy={busy}
278− error={actionData && "provider" in actionData ? error : null}
279− />
280− )}
281299 {!owner && <p className="mt-8 text-sm text-muted">An owner of {slug} can add and remove integrations.</p>}
282300 </div>
283301 );
597615 ),
598616 };
599617 return (
600− <section id="add" className="mt-10 rounded-xl border border-line bg-surface p-5">
618+ <section id="add" className="mt-4 scroll-mt-20 rounded-xl border border-line bg-surface p-5">
601619 <div className="flex items-center gap-3">
602620 <ProviderMark provider={provider} />
603621 <div className="grow">
604− <h3 className="font-medium">Connect {PROVIDERS[provider].label}</h3>
622+ <h3 className="font-medium">
623+ Connect {provider === "anthropic_endpoint" ? "your own endpoint" : PROVIDERS[provider].label}
624+ </h3>
605625 <p className="text-xs text-muted">{PROVIDER_BLURB[provider]}</p>
606626 </div>
607627 <Link to={`/${slug}/-/integrations`} className="rounded-md p-1.5 text-faint hover:bg-raised hover:text-fg" aria-label="Close">