mirror of
https://github.com/Unleash/unleash.git
synced 2025-03-23 00:16:25 +01:00
fix: Hide project selection option in CreateFeatureDialog when OSS (#7669)
This change wraps the project selection option in the CreateFeatureDialog in a conditional that hides it when Unleash is OSS. OSS doesn't have access to the project creation API, so there's no point in showing this.
This commit is contained in:
parent
c22196cb77
commit
464568dace
@ -67,7 +67,7 @@ export const CreateFeatureDialog = ({
|
|||||||
}: ICreateFeatureDialogProps) => {
|
}: ICreateFeatureDialogProps) => {
|
||||||
const { setToastData, setToastApiError } = useToast();
|
const { setToastData, setToastApiError } = useToast();
|
||||||
const { setShowFeedback } = useContext(UIContext);
|
const { setShowFeedback } = useContext(UIContext);
|
||||||
const { uiConfig } = useUiConfig();
|
const { uiConfig, isOss } = useUiConfig();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@ -215,33 +215,41 @@ export const CreateFeatureDialog = ({
|
|||||||
setName={setName}
|
setName={setName}
|
||||||
configButtons={
|
configButtons={
|
||||||
<>
|
<>
|
||||||
<SingleSelectConfigButton
|
<ConditionallyRender
|
||||||
tooltip={{
|
condition={!isOss()}
|
||||||
header: 'Select a project for the flag',
|
show={
|
||||||
}}
|
<SingleSelectConfigButton
|
||||||
description={configButtonData.project.text}
|
tooltip={{
|
||||||
options={projects.map((project) => ({
|
header: 'Select a project for the flag',
|
||||||
label: project.name,
|
}}
|
||||||
value: project.id,
|
description={
|
||||||
}))}
|
configButtonData.project.text
|
||||||
onChange={(value: any) => {
|
}
|
||||||
setProject(value);
|
options={projects.map((project) => ({
|
||||||
}}
|
label: project.name,
|
||||||
button={{
|
value: project.id,
|
||||||
label: project,
|
}))}
|
||||||
icon: configButtonData.project.icon,
|
onChange={(value: any) => {
|
||||||
labelWidth: '12ch',
|
setProject(value);
|
||||||
}}
|
}}
|
||||||
search={{
|
button={{
|
||||||
label: 'Filter projects',
|
label: project,
|
||||||
placeholder: 'Select project',
|
icon: configButtonData.project.icon,
|
||||||
}}
|
labelWidth: '12ch',
|
||||||
onOpen={() =>
|
}}
|
||||||
setDocumentation(configButtonData.project)
|
search={{
|
||||||
|
label: 'Filter projects',
|
||||||
|
placeholder: 'Select project',
|
||||||
|
}}
|
||||||
|
onOpen={() =>
|
||||||
|
setDocumentation(
|
||||||
|
configButtonData.project,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onClose={clearDocumentationOverride}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
onClose={clearDocumentationOverride}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SingleSelectConfigButton
|
<SingleSelectConfigButton
|
||||||
tooltip={{
|
tooltip={{
|
||||||
header: 'Select a flag type',
|
header: 'Select a flag type',
|
||||||
|
Loading…
Reference in New Issue
Block a user