Skip to content

Commit

Permalink
fix: Project settings with no environments (#3572)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-ssg committed Mar 7, 2024
1 parent 5116668 commit becfff1
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions frontend/web/components/pages/ProjectSettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import AccountStore from 'common/stores/account-store'
import ImportPage from 'components/import-export/ImportPage'
import FeatureExport from 'components/import-export/FeatureExport'
import ProjectUsage from 'components/ProjectUsage'
import ProjectStore from 'common/stores/project-store'

const ProjectSettingsPage = class extends Component {
static displayName = 'ProjectSettingsPage'
Expand Down Expand Up @@ -493,22 +494,25 @@ const ProjectSettingsPage = class extends Component {
roles={this.state.roles}
/>
</TabItem>
<TabItem data-test='js-import-page' tabLabel='Import'>
<ImportPage
environmentId={this.props.match.params.environmentId}
projectId={this.props.match.params.projectId}
projectName={project.name}
/>
</TabItem>
{Utils.getFlagsmithHasFeature(
'flagsmith_import_export',
) && (
<TabItem tabLabel='Export'>
<FeatureExport
{!!ProjectStore.getEnvs()?.length && (
<TabItem data-test='js-import-page' tabLabel='Import'>
<ImportPage
environmentId={this.props.match.params.environmentId}
projectId={this.props.match.params.projectId}
projectName={project.name}
/>
</TabItem>
)}
{!!ProjectStore.getEnvs()?.length &&
Utils.getFlagsmithHasFeature(
'flagsmith_import_export',
) && (
<TabItem tabLabel='Export'>
<FeatureExport
projectId={this.props.match.params.projectId}
/>
</TabItem>
)}
</Tabs>
}
</div>
Expand Down

0 comments on commit becfff1

Please sign in to comment.