Releases: vivid-planet/comet
6.17.17
5.9.6
7.10.0
@comet/[email protected]
Minor Changes
-
8f924d5: Add new custom
Dialog
The component extends the MUI
Dialog
component to enable common use cases:- The
title
prop can be used to set the dialog title - A close button is shown when the
onClose
is used
Example
<Dialog title="Dialog Title" onClose={() => { // Handle dialog closing here }} />
- The
-
6eba5ab: Add a
forceVerticalContainerSize
prop toFieldContainer
Use it to define below which container size the
vertical
styling is applied when using thehorizontal
variant. -
589b0b9: Enhance
FieldContainer
withsecondaryHelperText
prop andhelperTextIcon
prophelperTextIcon
displays an icon alongside the text forhelperText
,error
orwarning
.secondaryHelperText
provides an additional helper text positioned beneath the input field, aligned to the bottom-right corner.
Example:
<FieldContainer label="Helper Text Icon" helperTextIcon={<Info />} helperText="Helper Text with icon" secondaryHelperText="0/100"> <InputBase onChange={handleChange} value={value} placeholder="Placeholder" /> </FieldContainer>
Patch Changes
- aa02ca1: Fix a bug in
useDataGridExcelExport
that would cause an Excel export to fail when a cell's value wasundefined
- 6eba5ab: Prevent unintended layout shift after the initial render of
FieldContainer
when using thehorizontal
variant - bf6b03f: Fix alignment of
Alert
icon with the title
@comet/[email protected]
Minor Changes
-
7e94c55: Rework
GridFilterPanel
to match the updated Comet CI -
22f3d40: Adapt
Chip
styling to align with Comet DXP design- Fix hover styling
- Add new styling for
<Chip variant="filled" color="info">
-
589b0b9: Enhance
FieldContainer
withsecondaryHelperText
prop andhelperTextIcon
prophelperTextIcon
displays an icon alongside the text forhelperText
,error
orwarning
.secondaryHelperText
provides an additional helper text positioned beneath the input field, aligned to the bottom-right corner.
Example:
<FieldContainer label="Helper Text Icon" helperTextIcon={<Info />} helperText="Helper Text with icon" secondaryHelperText="0/100"> <InputBase onChange={handleChange} value={value} placeholder="Placeholder" /> </FieldContainer>
Patch Changes
-
b51bf6d: Adapt
Radio
andCheckbox
styling to Comet DXP designFix colors of disabled states.
-
71876ea: Adapt size of arrow in
Select
andAutocomplete
fields according to Comet DXP design
@comet/[email protected]
Minor Changes
-
2b9fac2: Add support for passing title and alt text to
useDamFileUpload
This can be useful when importing files from an external DAM.
Patch Changes
- d210ef7: Remove vertical and horizontal scroll bars from block preview iframe
@comet/[email protected]
Patch Changes
- 7b2adae: API Generator: Don't generate an update input for the single generator
7.9.0
@comet/[email protected]
Minor Changes
-
6d6131b: Add the
dataGridDateColumn
anddataGridDateTimeColumn
helpers for using the "date" and "dateTime" types in Data Grid-import { GridColDef } from "@comet/admin"; +import { GridColDef, dataGridDateColumn, dataGridDateTimeColumn } from "@comet/admin"; // ... const columns: GridColDef[] = [ { - type: "date", - valueGetter: ({ value }) => value && new Date(value), - renderCell: ({ value }) => value && <FormattedDate value={value} dateStyle="medium" />, + ...dataGridDateColumn, field: "createdAt", headerName: "Created At", }, { - type: "dateTime", - valueGetter: ({ value }) => value && new Date(value), - renderCell: ({ value }) => value && <FormattedDate value={value} dateStyle="medium" timeStyle="short" />, + ...dataGridDateTimeColumn, field: "updatedAt", headerName: "Updated At", }, ];
-
7cea765: Add UI for Impersonation Feature
- Add indicator to display when impersonation mode is active in
UserHeaderItem
- Add button to allow users to switch on impersonation in the
UserGrid
- Integrate
CrudMoreActionsMenu
inUserPageToolbar
with an impersonation entry for easy access to this feature. - Add
ImpersonateUser
icon
- Add indicator to display when impersonation mode is active in
Patch Changes
-
48cac4d: Fix styling issues of inputs like
FinalFormInput
,FinalFormNumberInput
,FinalFormSelect
,TextAreaField
- Change background-color, border-color and color of the label for different states (
default
,disabled
andfocused
). - For required inputs, fix spacing between the label and asterisk.
- Fix font-weight and margin of
helperText
.
- Change background-color, border-color and color of the label for different states (
-
0919e3b: Remove right padding from form fields without an end adornment
@comet/[email protected]
Patch Changes
- 1d73f3f: Add missing spacing to the clear-color button of
ColorPicker
@comet/[email protected]
Minor Changes
-
7cea765: Add UI for Impersonation Feature
- Add indicator to display when impersonation mode is active in
UserHeaderItem
- Add button to allow users to switch on impersonation in the
UserGrid
- Integrate
CrudMoreActionsMenu
inUserPageToolbar
with an impersonation entry for easy access to this feature. - Add
ImpersonateUser
icon
- Add indicator to display when impersonation mode is active in
Patch Changes
- 55d40ef: Add icon for indeterminate checkbox
@comet/[email protected]
Minor Changes
- 9aa6947: Add hover styling for MUI's
Switch
Patch Changes
-
48cac4d: Fix styling issues of inputs like
FinalFormInput
,FinalFormNumberInput
,FinalFormSelect
,TextAreaField
- Change background-color, border-color and color of the label for different states (
default
,disabled
andfocused
). - For required inputs, fix spacing between the label and asterisk.
- Fix font-weight and margin of
helperText
.
- Change background-color, border-color and color of the label for different states (
-
55d40ef: Add icon for indeterminate checkbox
@comet/[email protected]
Minor Changes
-
92f9d07: Add
hiddenForState
option tocreateCompositeBlock
This function can be used to hide a block in the
AdminComponent
for a given state.Example
const TextWithMediaVariantBlock = createCompositeBlock({ name: "TextWithMediaVariant", blocks: { variant: { block: createCompositeBlockSelectField<string>({ defaultValue: "text-image", fieldProps: { label: "Variant", fullWidth: true }, options: [ { value: "text-image", label: "Text Image" }, { value: "text-only", label: "Text Only" }, ], }), }, text: { block: RichTextBlock, }, media: { block: MediaBlock, // The media block isn't needed for the "text-only" variant hiddenForState: (state) => state.variant === "text-only", }, }, });
-
047b9d1: Add
label
prop toColumnsLayoutPreview
Use it to customize the label of the column displayed in the
FinalFormLayoutSelect
.
For instance, to add an icon or add custom text:<ColumnsLayoutPreviewContent width={10} label={<Image />} />
-
59b4b6f: Add
visibleOrderedBlocksForState
option tocreateCompositeBlock
The option can be used to hide and order child blocks in the
AdminComponent
.
It should return an array of visible block keys for a given state.
The order of the keys define the order in which the blocks will be rendered.
If key is not present in the array, the block will not be rendered.Example
const LayoutBlock = createCompositeBlock({ /* ... */ blocks: { layout: { /* A layout select */ }, headline1: { block: HeadlineBlock }, image1: { block: DamImageBlock }, headline2: { block: HeadlineBlock }, image2: { block: DamImageBlock }, }, visibleOrderedBlocksForState: (state: LayoutBlockData) => { if (state.layout === "compact") { // headline2 and image2 will be hidden return ["headline1", "image1"]; } else { return ["headline1", "image1", "headline2", "image2"]; } }, });
@comet/[email protected]
Minor Changes
-
7cea765: Add UI for Impersonation Feature
- Add indicator to display when impersonation mode is active in
UserHeaderItem
- Add button to allow users to switch on impersonation in the
UserGrid
- Integrate
CrudMoreActionsMenu
inUserPageToolbar
with an impersonation entry for easy access to this feature. - Add
ImpersonateUser
icon
- Add indicator to display when impersonation mode is active in
Patch Changes
7.8.0
@comet/[email protected]
Minor Changes
-
139616b: Add
FullHeightContent
componentUsed to help components take advantage of all the available content height, e.g., when using a
DataGrid
insideTabs
already contained in aMainContent
component.Usage example for
FullHeightContent
:<MainContent> <RouterTabs> <RouterTab label="DataGrid Example" path=""> <FullHeightContent> <DataGrid /> </FullHeightContent> </RouterTab> <RouterTab label="Another tab" path="/another-tab"> Content of another tab </RouterTab> </RouterTabs> </MainContent>
Example where
MainContent
withfullHeight
should be used, instead ofFullHeightContent
:<MainContent fullHeight> <DataGrid /> </MainContent>
-
d8fca05: Add second
InitialFormValues
generic toFinalForm
This allows differentiating between a form's values and initial values.
-
d8298d5: Add the
StackMainContent
componentThis version of
MainContent
only adds content spacing and height when it's the last visibleStackSwitch
.
UsingStackMainContent
instead ofMainContent
prevents unintended or duplicate spacings in cases where multipleMainContent
components are used inside nestedStackSwitch
components.
Patch Changes
-
a168e55: Open collapsible menu item on refresh if its child or sub-child is selected
-
e16ad1a: Fix a bug that prevented dynamically rendered tabs in
Tabs
-
139616b: Fix the
fullHeight
behavior ofMainContent
When used inside certain elements, e.g. with
position: relative
, the height would be calculated incorrectly. -
eefb054: Render empty values correctly when using
renderStaticSelectCell
as aDataGrid
column'srenderCell
function -
795ec73: Fix the spacing between the text and chip in
CrudMoreActionsMenu
-
8617c3b: Fix URL prefix in
SubRouteIndexRoute
-
daacf1e: Fix a bug in
ToolbarBreadcrumbs
where it was possible to open the mobile breadcrumbs menu when there were no items to be shown in the menu -
9cc75c1: Prevent the width of the mobile breadcrumbs menu of
ToolbarBreadcrumbs
from being far too small
@comet/[email protected]
Minor Changes
@comet/[email protected]
Minor Changes
-
059636a: Pass the
graphQLApiUrl
foruseBlockPreviewFetch
through theIFrameBridge
It's not necessary to set it in the site anymore. To migrate, remove the argument from
useBlockPreviewFetch()
:const PreviewPage = () => { const iFrameBridge = useIFrameBridge(); - const { fetch, graphQLFetch } = useBlockPreviewFetch(graphQLApiUrl); + const { fetch, graphQLFetch } = useBlockPreviewFetch(); const [blockData, setBlockData] = useState<PageContentBlockData>(); useEffect(() => { async function load() { + if (!graphQLFetch) { + return; + } if (!iFrameBridge.block) { setBlockData(undefined); return; } const newData = await recursivelyLoadBlockData({ blockType: "PageContent", blockData: iFrameBridge.block, graphQLFetch, fetch, pageTreeNodeId: undefined, //we don't have a pageTreeNodeId in preview }); setBlockData(newData); } load(); }, [iFrameBridge.block, fetch, graphQLFetch]); return <div>{blockData && <PageContentBlock data={blockData} />}</div>; };
Patch Changes
- 4338a6c: Make the space select required in the form when using
createSpaceBlock()
@comet/[email protected]
Minor Changes
-
44a5455: Allow replacing a file with a new one on the file detail page in the DAM
-
b721ac0: Harmonize the size and alignment of the DAM filters
-
c6d3ac3: Add support for file replacement on upload in the DAM
When uploading a file to the DAM with the same filename as an existing file, it's now possible to replace the existing file.
This is useful when you want to update a file without changing its URL. -
4037b4d: Rework the DAM crop/focus settings UI
-
059636a: Pass the
graphQLApiUrl
foruseBlockPreviewFetch
through theIFrameBridge
It's not necessary to set it in the site anymore. To migrate, remove the argument from
useBlockPreviewFetch()
:const PreviewPage = () => { const iFrameBridge = useIFrameBridge(); - const { fetch, graphQLFetch } = useBlockPreviewFetch(graphQLApiUrl); + const { fetch, graphQLFetch } = useBlockPreviewFetch(); const [blockData, setBlockData] = useState<PageContentBlockData>(); useEffect(() => { async function load() { + if (!graphQLFetch) { + return; + } if (!iFrameBridge.block) { setBlockData(undefined); return; } const newData = await recursivelyLoadBlockData({ blockType: "PageContent", blockData: iFrameBridge.block, graphQLFetch, fetch, pageTreeNodeId: undefined, //we don't have a pageTreeNodeId in preview }); setBlockData(newData); } load(); }, [iFrameBridge.block, fetch, graphQLFetch]); return <div>{blockData && <PageContentBlock data={blockData} />}</div>; };
Patch Changes
-
bfa5dba: Fix schema generation if
FileUpload
object type isn't usedPreviously, the file uploads module always added the
downloadUrl
andimageUrl
fields to theFileUpload
object type, even if the type wasn't used in the application.
This lead to errors when generating the GraphQL schema.Now, the fields are only added if the
download
option of the module is used.Note: As a consequence, the
finalFormFileUploadFragment
doesn't include the fields anymore.
To enable downloading file uploads in forms, use the newly addedfinalFormFileUploadDownloadableFragment
:export const productFormFragment = gql` fragment ProductFormFragment on Product { priceList { - ...FinalFormFileUpload + ...FinalFormFileUploadDownloadable } } - ${finalFormFileUploadFragment} + ${finalFormFileUploadDownloadableFragment} `;
-
62ead06: Master Menu: render collapsible or grouped menu items only when at least one item of the submenu is allowed.
@comet/[email protected]
Patch Changes
- f20ec6c: Make class-validator a peer dependency
@comet/[email protected]
Minor Changes
-
44a5455: Allow replacing a file with a new one on the file detail page in the DAM
-
45fbc54: Rename
User
toUserPermissionsUser
in GraphQL schemaThis prevents naming collisions if a web wants to use a
User
type.Additionally prefix remaining user permissions-specific actions with
UserPermissions
. -
c6d3ac3: Add support for file replacement on upload in the DAM
When uploading a file to the DAM with the same filename as an existing file, it's now possible to replace the existing file.
This is useful when you want to update a file without changing its URL.
Patch Changes
-
bfa5dba: Fix schema generation if
FileUpload
object type isn't usedPreviously, the file uploads module always added the
downloadUrl
andimageUrl
fields to theFileUpload
object type, even if the type wasn't used in the application.
This lead to errors when generating the GraphQL schema.Now, the fields are only added if the
download
option of the module is used.Note: As a consequence, the
finalFormFileUploadFragment
doesn't include the fields anymore.
To enable downloading file uploads in forms, use the newly addedfinalFormFileUploadDownloadableFragment
:export const productFormFragment = gql` fragment ProductFormFragment on Product { priceList { - ...FinalFormFileUpload + ...FinalFormFileUploadDownloadable } } - ${finalFormFileUploadFragment} + ${finalFormFileUploadDownloadableFragment} `;
-
02a5bdc: API Generator: Fix generated types for position code
-
f20ec6c: Make class-validator a peer dependency
@comet/[email protected]
Minor Changes
-
2352959: Export
convertPreviewDataToHeaders
to makecreateGraphQLFetch
more configurable -
059636a: Pass the
graphQLApiUrl
foruseBlockPreviewFetch
through theIFrameBridge
It's not necessary to set it in the site anymore. To migrate, remove the argument from
useBlockPreviewFetch()
:const PreviewPage = () => { const iFrameBridge = useIFrameBridge(); - const { fetch, graphQLFetch } = useBlockPreviewFetch(graphQLApiUrl); + const { fetch, graphQLFetch } = useBlockPreviewFetch(); const [blockData, setBlockData] = useState<PageContentBlockData>(); useEffect(() => { async function load() { + if (!graphQLFetch) { + return; + } if (!iFrameBridge.block) { ...
6.17.16
@comet/[email protected]
Patch Changes
-
ee5b5ae: DAM: Fix/set cache-control headers
- Public endpoints should cache files for 1 day
- Private endpoints should cache files for 1 year - but only in local caches (not CDN)
5.9.5
@comet/[email protected]
Patch Changes
-
ec67253: DAM: Fix/set cache-control headers
- Public endpoints should cache files for 1 day
- Private endpoints should cache files for 1 year - but only in local caches (not CDN)
7.7.0
@comet/[email protected]
Patch Changes
-
8ffc90e: Set the select field in
OneOfBlock
torequired
based on theallowEmpty
prop -
a9d2e2e: Fix linking from block preview to block admin for composite + list/blocks/columns block combinations
Previously, the generated route was wrong if a composite contained multiple nested list, blocks or columns blocks.
@comet/[email protected]
Minor Changes
-
6cb498f: Add search results highlighting to
ContentScopeSelect
Also, add the helper function
findTextMatches
, which can be used to add search highlighting to a customrenderOption
implementation:<ContentScopeSelect renderOption={(option, query) => { const text = `${option.domain.label} – ${option.language.label}`; const matches = findTextMatches(text, query); return <ListItemText primary={<MarkedMatches text={text} matches={matches} />} />; }} />
Patch Changes
-
bb9215f: Don't move files to a folder called "." when uploading them to the DAM
This bug only occurred in projects with a
react-dropzone
version >= 14.3.2.
@comet/[email protected]
Patch Changes
-
af892c1: Prevent the API from crashing because of stream errors when delivering a file
-
253aebb: Allow overriding
requestHandler
inBlobStorageS3Storage
-
af892c1: Prevent socket exhaustion in
BlobStorageS3Storage
By default, the S3 client allows a maximum of 50 open sockets.
A socket is only released once a file is streamed completely.
Meaning, it can remain open forever if a file stream is interrupted (e.g., when the user leaves the site).
This could lead to socket exhaustion, preventing further file delivery.To resolve this, the following changes were made:
- Add a close handler to destroy the stream when the client disconnects
- Set a 60-second
requestTimeout
to close unused connections
@comet/[email protected]
Minor Changes
-
723a0b8: Disable showing related videos from other channels in
YouTubeVideoBlock
By setting the parameter
rel
to0
only related videos from the same channel as the embedded video are shown.
6.17.15
@comet/[email protected]
Patch Changes
-
5e2e45e: Prevent the API from crashing because of stream errors when delivering a file
-
5e2e45e: Prevent socket exhaustion in
BlobStorageS3Storage
By default, the S3 client allows a maximum of 50 open sockets.
A socket is only released once a file is streamed completely.
Meaning, it can remain open forever if a file stream is interrupted (e.g., when the user leaves the site).
This could lead to socket exhaustion, preventing further file delivery.To resolve this, the following changes were made:
- Add a close handler to destroy the stream when the client disconnects
- Set a 60-second
requestTimeout
to close unused connections
6.17.14
@comet/[email protected]
Patch Changes
-
1515d0a: Don't move files to a folder called "." when uploading them to the DAM
This bug only occurred in projects with a
react-dropzone
version >= 14.3.2.