Skip to content

Commit

Permalink
fix: Failure to import LD project other than default (#2979)
Browse files Browse the repository at this point in the history
  • Loading branch information
khvn26 authored Nov 15, 2023
1 parent 628e29d commit e0d6e8a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/docs/integrations/importers/launchdarkly.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You can import your Flags and Segments from LaunchDarkly into Flagsmith.

:::caution

Flagsmith and Launch Darkly do have differences in their product design and underlying data model. Our importer makes
Flagsmith and LaunchDarkly do have differences in their product design and underlying data model. Our importer makes
sane decisions around how to migrate data but we strongly recommend you check the results of the import by hand once the
import has finished.

Expand Down
18 changes: 10 additions & 8 deletions frontend/web/components/pages/ImportPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ const ImportPage: FC<ImportPageType> = ({ projectId, projectName }) => {
})
}

const createImportLDProjects = (LDKey: string, projectId: string) => {
const createImportLDProjects = (LDKey: string, key: string, projectId: string) => {
createLaunchDarklyProjectImport({
body: { project_key: 'default', token: LDKey },
body: { project_key: key, token: LDKey },
project_id: projectId,
})
}
Expand Down Expand Up @@ -122,21 +122,23 @@ const ImportPage: FC<ImportPageType> = ({ projectId, projectName }) => {
id='projects-list'
className='no-pad panel-projects'
listClassName='row mt-n2 gy-4'
title='Launch Darkly Projects'
title='LaunchDarkly Projects'
items={projects}
renderRow={({ name }, i) => {
renderRow={({ name, key }, i) => {
return (
<>
<Button
className='btn-project'
onClick={() =>
openConfirm(
'Import LaunchDarkly project',
<div>
{`Are you sure you want import ${name} to ${projectName}`}
</div>,
<span>
Flagsmith will import{' '}
{<strong>{name}</strong>} to {<strong>{projectName}</strong>}.
Are you sure?
</span>,
() => {
createImportLDProjects(LDKey, projectId)
createImportLDProjects(LDKey, key, projectId)
},
() => {
return
Expand Down

3 comments on commit e0d6e8a

@vercel
Copy link

@vercel vercel bot commented on e0d6e8a Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on e0d6e8a Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on e0d6e8a Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./docs

docs-flagsmith.vercel.app
docs-git-main-flagsmith.vercel.app
docs.flagsmith.com
docs.bullet-train.io

Please sign in to comment.