Releases: vivid-planet/comet
7.0.0-beta.3
@comet/admin@7.0.0-beta.3
Major Changes
- ce5eaed: Move the
ScopeIndicator
from theToolbarBreadcrumbs
to theToolbar
@comet/cms-admin@7.0.0-beta.3
Major Changes
-
06768a7: Make icon required for top level menu and group items
This fixes the problem, that there was no icon or text to display in the collapsed state of the menu if no icon was passed.
Icons are required for all top level menu items and the items of groups. Groups themselves do not require an icon.
@comet/cms-api@7.0.0-beta.3
Major Changes
-
caefa1c: Rename
DateFilter
toDateTimeFilter
This leaves room for a future DateFilter that only filters by date, not time.
Upgrading
- Change import
- import { DateFilter } from "@comet/cms-api"; + import { DateTimeFilter } from "@comet/cms-api";
- Re-run API Generator.
-
fe22985: API Generator: Replace graphql-type-json with graphql-scalars for JSON columns
Upgrading
-
Install graphql-scalars:
npm install graphql-scalars
-
Uninstall graphql-type-json:
npm uninstall graphql-type-json
-
Update imports:
- import { GraphQLJSONObject } from "graphql-type-json"; + import { GraphQLJSONObject } from "graphql-scalars";
-
Minor Changes
- 5e87134: API Generator: Add support for filtering one-to-many relations by id
Patch Changes
- 9c8a9a1: API Generator: Add missing type for integer fields in input type
@comet/eslint-config@7.0.0-beta.3
Major Changes
-
7a473ab: Prevent
@mui/icons-material
icon importsIcons used in Comet DXP applications should match the Comet CI.
Use icons from@comet/admin-icons
instead.
6.14.1
6.14.0
@comet/admin@6.14.0
Minor Changes
-
2fc764e: Add
OnChangeField
helper to listen to field changesExample
<OnChangeField name="product"> {(value, previousValue) => { // Will be called when field 'product' changes }} </OnChangeField>
Patch Changes
- 012a768: Fix infinite update loop in
useAsyncOptionsProps
@comet/admin-icons@6.14.0
Minor Changes
- efccc42: Add
YouTube
andVimeo
icons
@comet/admin-theme@6.14.0
Patch Changes
- 2de81e4: Fix top position of end-adornment in MuiAutocomplete
@comet/cms-admin@6.14.0
Minor Changes
-
73dfb61: Add
PhoneLinkBlock
andEmailLinkBlock
-
9055ff7: Remove label from
DamVideoBlock
file fieldThis was done to streamline it with the
DamImageBlock
. -
dddb03d: Add capability to generate alt texts and titles for images in DAM
You can find instructions for adding this feature to your project in the docs.
-
acfcef9: The
documentTypes
prop ofPagesPage
now also accepts a function mapping categories to document typesPreviously, only the supported documentTypes of the current category could be passed to the
PagesPage
.
That made it impossible to verify if a document can be moved to another category.
If a document was moved to a category that didn't support its type, the PageTree crashed.If a mapping function is passed to
documentTypes
, documents can only be moved to categories that support their type.<PagesPage - documentTypes={pageTreeDocumentTypes} + documentTypes={(category): Record<DocumentType, DocumentInterface> => { + if (category === "TopMenu") { + return { + Page, + PredefinedPage, + }; + } + + return { + Page, + PredefinedPage, + Link, + }; + }} // ... />
-
61a43d2: Add a menu item to
PixelImageBlock
,SvgImageBlock
andDamVideoBlock
that opens the chosen file in the DAMNote: This feature only works if the
DependenciesConfig
is configured forDamFile
:// App.tsx <DependenciesConfigProvider entityDependencyMap={{ + DamFile: createDamFileDependency(), // ... }} >
@comet/blocks-api@6.14.0
Minor Changes
-
73dfb61: Add
PhoneLinkBlock
andEmailLinkBlock
-
87ef5fa: YouTubeVideoBlock: Add validation for identifier
Must be either a valid YouTube URL or video identifier.
@comet/cms-api@6.14.0
Minor Changes
-
73dfb61: Add
PhoneLinkBlock
andEmailLinkBlock
-
dddb03d: Add capability to generate alt texts and titles for images in DAM
You can find instructions for adding this feature to your project in the docs.
-
73dfb61: Add
IsPhoneNumber
andisPhoneNumber
validators to validate phone numbers
Patch Changes
- b7dbd7a: Export
DisablePermissionCheck
constant to enable usage in application code
@comet/cms-site@6.14.0
Minor Changes
- 73dfb61: Add
PhoneLinkBlock
andEmailLinkBlock
7.0.0-beta.2
@comet/cms-admin@7.0.0-beta.2
Major Changes
-
3574617: Remove
EditPageLayout
You can completely remove
EditPageLayout
from your application.
Instead, useMainContent
to wrap all your page content except theToolbar
.
If needed, wrapMainContent
andToolbar
in a fragment.Example:
- <EditPageLayout> + <> <Toolbar> // ... </Toolbar> - <div> + <MainContent> // ... - </div> + </MainContent> - </EditPageLayout> + </>
Minor Changes
-
acfcef9: The
documentTypes
prop ofPagesPage
now also accepts a function mapping categories to document typesPreviously, only the supported documentTypes of the current category could be passed to the
PagesPage
.
That made it impossible to verify if a document can be moved to another category.
If a document was moved to a category that didn't support its type, the PageTree crashed.If a mapping function is passed to
documentTypes
, documents can only be moved to categories that support their type.<PagesPage - documentTypes={pageTreeDocumentTypes} + documentTypes={(category): Record<DocumentType, DocumentInterface> => { + if (category === "TopMenu") { + return { + Page, + PredefinedPage, + }; + } + + return { + Page, + PredefinedPage, + Link, + }; + }} // ... />
-
61a43d2: Add a menu item to
PixelImageBlock
,SvgImageBlock
andDamVideoBlock
that opens the chosen file in the DAMNote: This feature only works if the
DependenciesConfig
is configured forDamFile
:// App.tsx <DependenciesConfigProvider entityDependencyMap={{ + DamFile: createDamFileDependency(), // ... }} >
Patch Changes
- e106a02: Make the
ContentScopeIndicator
show the scope label instead of the scope value
@comet/admin@7.0.0-beta.2
Minor Changes
-
2fc764e: Add
OnChangeField
helper to listen to field changesExample
<OnChangeField name="product"> {(value, previousValue) => { // Will be called when field 'product' changes }} </OnChangeField>
@comet/blocks-api@7.0.0-beta.2
Minor Changes
-
87ef5fa: YouTubeVideoBlock: Add validation for identifier
Must be either a valid YouTube URL or video identifier.
@comet/cms-api@7.0.0-beta.2
Minor Changes
- 2f0675b: API Generator: Add support for filtering many-to-many-relations by id
@comet/admin-theme@7.0.0-beta.2
Patch Changes
- 2de81e4: Fix top position of end-adornment in MuiAutocomplete
6.13.0
@comet/admin@6.13.0
Minor Changes
-
5e25348: Add a dialog option to the translation feature
If enabled a dialog will open when pressing the translation button showing the original text and an editable translation
Control if the dialog should be shown for the current scope via the
showApplyTranslationDialog
prop (default: true)<ContentTranslationServiceProvider enabled={true} + showApplyTranslationDialog={true} translate={...} >
-
796e832: Add
AutocompleteField
andAsyncAutocompleteField
componentsExamples
<AutocompleteField name="autocomplete" label="Autocomplete" options={[ { value: "chocolate", label: "Chocolate" }, { value: "strawberry", label: "Strawberry" }, { value: "vanilla", label: "Vanilla" }, ]} getOptionLabel={(option: Option) => option.label} isOptionEqualToValue={(option: Option, value: Option) => option.value === value.value} fullWidth />
<AsyncAutocompleteField name="asyncAutocomplete" label="Async Autocomplete" loadOptions={async () => { // Load options here }} getOptionLabel={(option: Option) => option.label} isOptionEqualToValue={(option: Option, value: Option) => option.value === value.value} fullWidth />
@comet/admin-rte@6.13.0
Minor Changes
-
5e25348: Add a dialog option to the translation feature
If enabled a dialog will open when pressing the translation button showing the original text and an editable translation
Control if the dialog should be shown for the current scope via the
showApplyTranslationDialog
prop (default: true)<ContentTranslationServiceProvider enabled={true} + showApplyTranslationDialog={true} translate={...} >
@comet/cms-admin@6.13.0
Minor Changes
-
c51b250: Add loading spinner to
IFrameViewer
This feature was added to inform users that the iframe is loading. It is particularly useful when loading takes a long time due to a slow network connection or a large amount of content or data. The feedback remains visible until the iframe is fully loaded and the
onLoad
event is triggered. -
dcf3f70: Add
overrideAcceptedMimeTypes
configuration to DAMIf set, only the mimetypes specified in
overrideAcceptedMimeTypes
will be accepted.You must configure
overrideAcceptedMimeTypes
in the API and the admin interface:API:
// app.module.ts DamModule.register({ damConfig: { // ... + overrideAcceptedMimeTypes: ["image/png"], // ... }, // ... }),
Admin:
// App.tsx <DamConfigProvider value={{ // ... + overrideAcceptedMimeTypes: ["image/png"], }} >
Patch Changes
- aee7ae4: Use the same logic for checking the user's content scope in Admin as it is used in the API.
@comet/cms-api@6.13.0
Minor Changes
-
2a5e00b: API Generator: Add
list
option to@CrudGenerator()
to allow disabling the list queryRelated DTO classes will still be generated as they might be useful for application code.
-
dcf3f70: Add
overrideAcceptedMimeTypes
configuration to DAMIf set, only the mimetypes specified in
overrideAcceptedMimeTypes
will be accepted.You must configure
overrideAcceptedMimeTypes
in the API and the admin interface:API:
// app.module.ts DamModule.register({ damConfig: { // ... + overrideAcceptedMimeTypes: ["image/png"], // ... }, // ... }),
Admin:
// App.tsx <DamConfigProvider value={{ // ... + overrideAcceptedMimeTypes: ["image/png"], }} >
-
07a7291: Adjust
searchToMikroOrmQuery
function to reduce the amount of irrelevant resultsThis is done by using a combination of AND- and OR-queries. For example, a search of
red shirt
won't give all products containingred
ORshirt
but rather returns all products that have the wordsred
ANDshirt
in some column. The words don't have to be in the same column.
Patch Changes
- 5bbb2ee: API Generator: Don't add
skipScopeCheck
when the entity has a@ScopedEntity()
decorator - ebdd108: API Generator: Fix imports in generated code for more than one level deep relations
- b925f94: API Generator: Support relation with primary key type
int
(in addition tointeger
)
@comet/cms-site@6.13.0
Minor Changes
- 493cad7: Add
DamVideoBlock
7.0.0-beta.1
@comet/cms-admin@7.0.0-beta.1
Major Changes
-
c3940df: Replace
additionalMimeTypes
andoverrideAcceptedMimeTypes
inDamConfigProvider
withacceptedMimeTypes
You can now add mime types like this:
<DamConfigProvider value={{ acceptedMimeTypes: [...damDefaultAcceptedMimetypes, "something-else"], }} > {/* ... */} </DamConfigProvider>
And remove them like this:
<DamConfigProvider value={{ acceptedMimeTypes: damDefaultAcceptedMimetypes.filter((mimeType) => mimeType !== "application/zip"), }} > {/* ... */} </DamConfigProvider>
Don't forget to also remove/add the mime types in the API's
DamModule
@comet/cms-api@7.0.0-beta.1
Major Changes
-
c3940df: Replace
additionalMimeTypes
andoverrideAcceptedMimeTypes
inDamModule#damConfig
withacceptedMimeTypes
You can now add mime types like this:
DamModule.register({ damConfig: { acceptedMimeTypes: [...damDefaultAcceptedMimetypes, "something-else"], }, });
And remove them like this:
DamModule.register({ damConfig: { acceptedMimeTypes: damDefaultAcceptedMimetypes.filter((mimeType) => mimeType !== "application/zip"), }, });
Don't forget to also remove/add the mime types in the admin's
DamConfigProvider
-
c3940df: Rename
defaultDamAcceptedMimetypes
todamDefaultAcceptedMimetypes
Minor Changes
- f38ecc1: API Generator: Add support for enum array filter and sort
Patch Changes
- 10424c7: Fix
SvgImageBlock
in site by always loadingfileUrl
7.0.0-beta.0
@comet/admin-color-picker@7.0.0-beta.0
Major Changes
-
b87c3c2: Replace the
componentsProps
prop withslotProps
inColorPicker
and remove theColorPickerComponentsProps
type -
cb544bc: Remove
clearable
prop and add arequired
prop toColorPicker
The clear button will automatically be shown for all optional fields.
-
92eae2b: Change the method of overriding the styling of Admin components
- Remove dependency on the legacy
@mui/styles
package in favor of@mui/material/styles
. - Add the ability to style components using MUI's
sx
prop. - Add the ability to style individual elements (slots) of a component using the
slotProps
andsx
props. - The
# @comet/admin-color-picker syntax in the theme's
styleOverrides` is no longer supported, see: https://mui.com/material-ui/migration/v5-style-changes/#migrate-theme-styleoverrides-to-emotion
const theme = createCometTheme({ components: { CometAdminMyComponent: { styleOverrides: { - root: { - "&$hasShadow": { - boxShadow: "2px 2px 5px 0 rgba(0, 0, 0, 0.25)", - }, - "& $header": { - backgroundColor: "lime", - }, - }, + hasShadow: { + boxShadow: "2px 2px 5px 0 rgba(0, 0, 0, 0.25)", + }, + header: { + backgroundColor: "lime", + }, }, }, }, });
- Overriding a component's styles using
withStyles
is no longer supported. Use thesx
andslotProps
props instead:
-import { withStyles } from "@mui/styles"; - -const StyledMyComponent = withStyles({ - root: { - backgroundColor: "lime", - }, - header: { - backgroundColor: "fuchsia", - }, -})(MyComponent); - -// ... - -<StyledMyComponent title="Hello World" />; +<MyComponent + title="Hello World" + sx={{ + backgroundColor: "lime", + }} + slotProps={{ + header: { + sx: { + backgroundColor: "fuchsia", + }, + }, + }} +/>
- The module augmentation for the
DefaultTheme
type from@mui/styles/defaultTheme
is no longer needed and needs to be removed from the admins theme file, usually located inadmin/src/theme.ts
:
-declare module "@mui/styles/defaultTheme" { - // eslint-disable-next-line @typescript-eslint/no-empty-interface - export interface DefaultTheme extends Theme {} -}
-
Class-keys originating from MUI components have been removed from Comet Admin components, causing certain class-names and
styleOverrides
to no longer be applied.
The componentsroot
class-key is not affected. Other class-keys will retain the class-names andstyleOverrides
from the underlying MUI component.
For example, inClearInputAdornment
(when used withposition="end"
) the class-nameCometAdminClearInputAdornment-positionEnd
and thestyleOverrides
forCometAdminClearInputAdornment.positionEnd
will no longer be applied.
The component will retain the class-namesMuiInputAdornment-positionEnd
,MuiInputAdornment-root
, andCometAdminClearInputAdornment-root
.
Also, thestyleOverrides
forMuiInputAdornment.positionEnd
,MuiInputAdornment.root
, andCometAdminClearInputAdornment.root
will continue to be applied.This affects the following components:
AppHeader
AppHeaderMenuButton
ClearInputAdornment
Tooltip
CancelButton
DeleteButton
OkayButton
SaveButton
StackBackButton
DatePicker
DateRangePicker
TimePicker
-
For more details, see MUI's migration guide: https://mui.com/material-ui/migration/v5-style-changes/#mui-styles
- Remove dependency on the legacy
Patch Changes
- b5753e6: Allow partial props in the theme's
defaultProps
instead of requiring all props when setting thedefaultProps
of a component
@comet/admin-date-time@7.0.0-beta.0
Major Changes
-
ad73068: Change
DatePicker
andDateRangePicker
values fromDate
tostring
This affects the
value
prop and the value returned by theonChange
event.The value of
DatePicker
is a string in the formatYYYY-MM-DD
.
The value ofDateRangePicker
is an object withstart
andend
keys, each as a string in the formatYYYY-MM-DD
.The code that handles values from these components may need to be adjusted.
This may include how the values are stored in or sent to the database.- const [date, setDate] = useState<Date | undefined>(new Date("2024-03-10")); + const [date, setDate] = useState<string | undefined>("2024-03-10"); return <DatePicker value={date} onChange={setDate} />;
const [dateRange, setDateRange] = useState<DateRange | undefined>({ - start: new Date("2024-03-10"), - end: new Date("2024-03-16"), + start: "2024-03-10", + end: "2024-03-16", }); return <DateRangePicker value={dateRange} onChange={setDateRange} />;
The reason for this change is that when selecting a date like
2024-04-10
in a timezone ahead of UTC, it would be stored in aDate
object as e.g.2024-04-09T22:00:00.000Z
. When only the date is saved to the database, without the time, it would be saved as2024-04-09
, which differs from the selected date. -
cb544bc: Remove the
clearable
prop and add arequired
prop toDateRangePicker
,DateTimePicker
,TimePicker
andTimeRangePicker
The clear button will automatically be shown for all optional fields.
-
b87c3c2: Rename multiple props and class-keys and remove the
componentsProps
types:-
DatePicker
:- Replace the
componentsProps
prop withslotProps
- Remove the
DatePickerComponentsProps
type
- Replace the
-
DateRangePicker
:- Replace the
componentsProps
prop withslotProps
- Remove the
DateRangePickerComponentsProps
type - Rename the
calendar
class-key todateRange
- Replace the
-
DateTimePicker
:- Replace the
componentsProps
prop withslotProps
- Remove the
DateTimePickerComponentsProps
type - Replace the
formControl
class-key with two separate class-keys:dateFormControl
andtimeFormControl
- Replace the
-
TimeRangePicker
:- Replace the
componentsProps
prop withslotProps
- Remove the
TimeRangePickerComponentsProps
andTimeRangePickerIndividualPickerProps
types - Replace the
formControl
class-key with two separate class-keys:startFormControl
andendFormControl
- Replace the
timePicker
class-key with two separate class-keys:startTimePicker
andendTimePicker
- Replace the
-
-
f8114cd: Remove
clearable
prop fromDatePicker
The clear button will automatically be shown for all optional fields.
-
92eae2b: Change the method of overriding the styling of Admin components
- Remove dependency on the legacy
@mui/styles
package in favor of@mui/material/styles
. - Add the ability to style components using MUI's
sx
prop. - Add the ability to style individual elements (slots) of a component using the
slotProps
andsx
props. - The
# @comet/admin-date-time syntax in the theme's
styleOverrides` is no longer supported, see: https://mui.com/material-ui/migration/v5-style-changes/#migrate-theme-styleoverrides-to-emotion
const theme = createCometTheme({ components: { CometAdminMyComponent: { styleOverrides: { - root: { - "&$hasShadow": { - boxShadow: "2px 2px 5px 0 rgba(0, 0, 0, 0.25)", - }, - "& $header": { - backgroundColor: "lime", - }, - }, + hasShadow: { + boxShadow: "2px 2px 5px 0 rgba(0, 0, 0, 0.25)", + }, + header: { + backgroundColor: "lime", + }, }, }, }, });
- Overriding a component's styles using
withStyles
is no longer supported. Use thesx
andslotProps
props instead:
-import { withStyles } from "@mui/styles"; - -const StyledMyComponent = withStyles({ - root: { - backgroundColor: "lime", - }, - header: { - backgroundColor: "fuchsia", - }, -})(MyComponent); - -// ... - -<StyledMyComponent title="Hello World" />; +<MyComponent + title="Hello World" + sx={{ + backgroundColor: "lime", + }} + slotProps={{ + header: { + sx: { + backgroundColor: "fuchsia", + }, + }, + }} +/>
- The module augmentation for the
DefaultTheme
type from@mui/styles/defaultTheme
is no longer needed and needs to be removed from the admins t...
- Remove dependency on the legacy
6.12.0
@comet/admin@6.12.0
Minor Changes
-
16ffa7b: Add
FinalFormAsyncSelect
,AsyncSelectField
, andFinalFormAsyncAutocomplete
componentsThin wrappers to ease using
useAsyncOptionsProps()
withFinalFormSelect
andFinalFormAutocomplete
.Example
Previously:
const asyncOptionsProps = useAsyncOptionsProps(async () => { // Load options here }); // ... <Field component={FinalFormAsyncAutocomplete} {...asyncOptionsProps} />;
Now:
<Field component={FinalFormAsyncAutocomplete} loadOptions={async () => { // Load options here }} />
@comet/admin-theme@6.12.0
Minor Changes
-
c06c6f1: Allow to pass args to createCometTheme to support localization via theme
See https://mui.com/material-ui/guides/localization/
import { deDE } from "@mui/x-data-grid-pro"; const theme = createCometTheme({}, deDE); <MuiThemeProvider theme={theme} />;
@comet/cms-admin@6.12.0
Minor Changes
-
3ee8c7a: Add a
DamFileDownloadLinkBlock
that can be used to download a file or open it in a new tabAlso, add new
/dam/files/download/:hash/:fileId/:filename
endpoint for downloading assets.
@comet/cms-api@6.12.0
Minor Changes
-
3ee8c7a: Add a
DamFileDownloadLinkBlock
that can be used to download a file or open it in a new tabAlso, add new
/dam/files/download/:hash/:fileId/:filename
endpoint for downloading assets. -
0597b1e: Add
DisablePermissionCheck
constant for use in@RequiredPermission
decoratorYou can disable authorization for a resolver or operation by adding the decorator
@RequiredPermission(DisablePermissionCheck)
Patch Changes
-
6717682: API CrudSingleGenerator: Run
transformToBlockData()
for block fields on create -
b158e6a: ChangesCheckerConsole: Start exactly matching job or all partially matching jobs
Previously, the first job with a partially matching content scope was started.
Doing so could lead to problems when multiple jobs with overlapping content scopes exist.
For instance, jobs with the scopes{ domain: "main", language: "de" }
and{ domain: "main", language: "en" }
both partially match a change in{ domain: "main", language: "de" }
.
To fix this, we either start a single job if the content scope matches exactly or start all jobs with partially matching content scopes.
@comet/cms-site@6.12.0
Minor Changes
-
3ee8c7a: Add a
DamFileDownloadLinkBlock
that can be used to download a file or open it in a new tabAlso, add new
/dam/files/download/:hash/:fileId/:filename
endpoint for downloading assets.
@comet/admin-rte@6.12.0
Patch Changes
- dc7eaec: Hide translation button for
FinalFormSearchTextField
6.11.0
@comet/admin@6.11.0
Minor Changes
-
8e3dec5: Change
writeClipboardText
/readClipboardText
clipboard fallback to in-memoryUsing the local storage as a fallback caused issues when writing clipboard contents larger than 5MB.
Changing the fallback to in-memory resolves the issue.
@comet/cms-admin@6.11.0
Minor Changes
-
e10753b: Allow disabling the "Open preview" button in the
PageTree
for certain document typesThe "Open preview" button is shown for all document types in the
PageTree
.
But some document types (e.g., links) don't have a preview.
Clicking on the preview button leads to an error page.Now, it's possible to disable the button by setting
hasNoSitePreview
for the document:export const Link: DocumentInterface<Pick<GQLLink, "content">, GQLLinkInput> = { // ... + hasNoSitePreview: true, };
-
fdf9fa7: Per default disable the automatic creation of redirects when changing a document's slug if the document is unpublished or archived
Patch Changes
-
815ba51: Fix link target validation in
ExternalLinkBlock
Previously, two different validation checks were used.
This resulted in an error when saving an invalid link target but no error message was shown.
@comet/cms-api@6.11.0
Minor Changes
-
0db10a5: Add a console script to import redirects from a csv file
You can use the script like this:
npm run console import-redirects file-to-import.csv
The CSV file must look like this:
source;target;target_type;comment;scope_domain /test-source;/test-target;internal;Internal Example;main /test-source-external;https://www.comet-dxp.com/;external;External Example;secondary
@comet/blocks-api@6.11.0
Patch Changes
-
93a84b6: Fix type of
youtubeIdentifier
inYouTubeVideoBlock
Previously, it was incorrectly typed as required. Now it's optional.