MCPcopy Index your code
hub / github.com/Flagsmith/flagsmith / addIntegration

Function addIntegration

frontend/web/components/IntegrationList.tsx:517–567  ·  view source on GitHub ↗
(
    integration: any,
    id: string,
    installationId: any = undefined,
    githubId: any = undefined,
  )

Source from the content-addressed store, hash-verified

515 }
516
517 const addIntegration = (
518 integration: any,
519 id: string,
520 installationId: any = undefined,
521 githubId: any = undefined,
522 ) => {
523 const params = Utils.fromParam()
524 API.trackEvent(Constants.events.VIEW_INTEGRATION(id))
525 // On the org page, a project-level-only integration cannot be saved
526 // against the organisation — the user must pick a project in the modal.
527 const requiresProjectSelection =
528 !!props.organisationId && !integration.organisation
529 openModal(
530 `${integration.title} Integration`,
531 <CreateEditIntegration
532 id={id}
533 modal
534 organisationId={
535 requiresProjectSelection ? undefined : props.organisationId
536 }
537 integration={integration}
538 data={
539 params.environment
540 ? {
541 flagsmithEnvironment: params.environment,
542 }
543 : null
544 }
545 githubMeta={{ githubId: githubId, installationId: installationId }}
546 projectId={props.projectId}
547 requiresProjectSelection={requiresProjectSelection}
548 onComplete={(result) => {
549 if (requiresProjectSelection && result?.projectId) {
550 setLastSavedByIntegration((prev) => ({
551 ...prev,
552 [id]: {
553 isCreate: !!result.isCreate,
554 projectId: result.projectId!,
555 },
556 }))
557 }
558 if (githubId) {
559 fetchGithubIntegration()
560 } else {
561 fetch()
562 }
563 }}
564 />,
565 'side-modal',
566 )
567 }
568
569 const editIntegration = (integration: any, id: string, data: any) => {
570 openModal(

Callers 1

fetchFunction · 0.85

Calls 2

fetchGithubIntegrationFunction · 0.85
fetchFunction · 0.85

Tested by

no test coverage detected