Skip to content

Commit

Permalink
Merge pull request #2237 from MahtabBukhari/header_and_Indexes_shoud_…
Browse files Browse the repository at this point in the history
…be_invisible

[BluePrint] - Create Type Modal when there is no parent selected then Attributes, Types and Required header and Indexes shoud be invisible
  • Loading branch information
Rassl authored Oct 17, 2024
2 parents eda19f3 + d77c0f5 commit 07525c5
Showing 1 changed file with 29 additions and 19 deletions.
48 changes: 29 additions & 19 deletions src/components/ModalsContainer/BlueprintModal/Body/Editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@ export const Editor = ({

const IconComponent = Icons[selectedIcon as keyof typeof Icons]

const parentType = selectedSchema ? selectedSchema.type : parent

return (
<Flex>
<HeaderRow>
Expand Down Expand Up @@ -591,29 +593,37 @@ export const Editor = ({
</>
)}
</Flex>
<CreateCustomNodeAttribute
onDelete={handleDeleteAttribute}
parent={selectedSchema ? selectedSchema.type : parent}
/>

{parentType && (
<CreateCustomNodeAttribute
onDelete={handleDeleteAttribute}
parent={selectedSchema ? selectedSchema.type : parent}
/>
)}
<MediaOptions
initialOptions={mediaOptions}
setMediaOptions={setMediaOptions}
setSubmitDisabled={setSubmitDisabled}
/>
<Flex>
<LineBar />
<Flex mb={12} mt={12}>
<Text>Indexes</Text>
{parentType && (
<Flex>
<LineBar />
<Flex mb={12} mt={12}>
<Text>Indexes</Text>
</Flex>
<Grid item mb={2} width="70%">
<AutoComplete
onSelect={(val) => setValue('selectedIndex', val?.value || '')}
options={attributes
.filter((attr) => attr.key)
.map((attr) => ({ label: attr.key, value: attr.key }))}
selectedValue={resolvedSelectedIndexValue}
/>
</Grid>
<LineBar />
</Flex>
<Grid item mb={2} width="70%">
<AutoComplete
onSelect={(val) => setValue('selectedIndex', val?.value || '')}
options={attributes.filter((attr) => attr.key).map((attr) => ({ label: attr.key, value: attr.key }))}
selectedValue={resolvedSelectedIndexValue}
/>
</Grid>
<LineBar />
</Flex>
)}

<Flex direction="row" justify="space-between" mt={20}>
{selectedSchema && (
<Flex direction="column">
Expand Down Expand Up @@ -660,7 +670,7 @@ export const Editor = ({
}

const CustomButton = styled(Button)`
width: 100% !important;
width: 400px !important;
margin: 0 auto !important;
`

Expand Down Expand Up @@ -765,4 +775,4 @@ const InputIconWrapper = styled(Flex)`

const InputWrapper = styled(Flex)`
width: 320px;
`
`

0 comments on commit 07525c5

Please sign in to comment.