1
0
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 ()

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:
Thomas Heartman 2024-07-25 17:59:47 +02:00 committed by GitHub
parent c22196cb77
commit 464568dace
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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',