Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Project settings with no environments #3572

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading