-
Notifications
You must be signed in to change notification settings - Fork 37
[8500] Support for Controls Writing Sibling Tags #4747
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
Open
jvega190
wants to merge
11
commits into
craftercms:develop
Choose a base branch
from
jvega190:enhancement/8500
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c4275ba
[8500] Support for Controls Writing Sibling Tags
jvega190 a954c6b
[8500] Add key to AdditionalFielChip under a map
jvega190 811e105
[8500] Fix typo, add i18n to message
jvega190 97d67ee
[8500] Fix repeat group atom creation not considering additionalFields
jvega190 1badbe8
[8500] Fix embedded components additionalFields atoms creation
jvega190 4bb8378
[8500] Show processed additionalFieldId in AdditionalFieldChip
jvega190 a19f28f
Merge branch 'develop' of https://github.com/craftercms/studio-ui int…
jvega190 ea027b5
[8500] Add additionalField to dateTime descriptor, add props for time…
jvega190 f9eee61
Merge branch 'develop' of https://github.com/craftercms/studio-ui int…
jvega190 6dcd921
Refactor FormsEngine to improve handling of additional fields in repe…
jvega190 423d1c6
Guard against missing descriptors when resolving additional fields.
jvega190 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
ui/app/src/components/ContentTypeManagement/components/AdditionalFieldChip.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| /* | ||
| * Copyright (C) 2007-2026 Crafter Software Corporation. All Rights Reserved. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License version 3 as published by | ||
| * the Free Software Foundation. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| import SubdirectoryArrowRightRoundedIcon from '@mui/icons-material/SubdirectoryArrowRightRounded'; | ||
| import Box from '@mui/material/Box'; | ||
| import Typography from '@mui/material/Typography'; | ||
| import React from 'react'; | ||
| import useIsDarkModeTheme from '../../../hooks/useIsDarkModeTheme'; | ||
| import { FormattedMessage } from 'react-intl'; | ||
| import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined'; | ||
| import Tooltip from '@mui/material/Tooltip'; | ||
| import { processAdditionalFieldMacro } from '../../FormsEngine/lib/formUtils'; | ||
|
|
||
| export function AdditionalFieldChip(props: { parentFieldId: string; fieldId: string }) { | ||
| const { fieldId, parentFieldId } = props; | ||
| const isDark = useIsDarkModeTheme(); | ||
|
|
||
| const additionalFieldId = processAdditionalFieldMacro(parentFieldId, fieldId); | ||
|
|
||
| return ( | ||
| <Box display="flex" alignItems="center" sx={{ mb: 1 }}> | ||
| <SubdirectoryArrowRightRoundedIcon sx={{ ml: 3 }} /> | ||
| <Box | ||
| sx={[ | ||
| { | ||
| width: '100%', | ||
| bgcolor: isDark ? 'grey.800' : 'grey.200', | ||
| borderRadius: 10, | ||
| overflow: 'hidden', | ||
| border: '1px solid transparent', | ||
| px: 1.5, | ||
| py: 0.5, | ||
| display: 'flex', | ||
| justifyContent: 'space-between' | ||
| } | ||
| ]} | ||
| > | ||
| <Typography component="span" variant="body2"> | ||
| {additionalFieldId} | ||
| </Typography> | ||
| <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}> | ||
| <Typography variant="body2" component="span"> | ||
| <FormattedMessage defaultMessage="Additional Field" /> | ||
| </Typography> | ||
| <Tooltip | ||
| title={ | ||
| <FormattedMessage defaultMessage="An additional field is a field that this control has permission to edit, beyond its main value. " /> | ||
| } | ||
| placement="top" | ||
| > | ||
| <InfoOutlinedIcon fontSize="small" /> | ||
| </Tooltip> | ||
| </Box> | ||
| </Box> | ||
| </Box> | ||
| ); | ||
| } | ||
|
|
||
| export default AdditionalFieldChip; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.