Releases: vivid-planet/comet
4.7.2
6.1.0
@comet/admin@6.1.0
Minor Changes
-
b35bb8d: Add basis for content translation
Wrap a component with a
ContentTranslationServiceProvider
to add support for content translation to all underlyingFinalFormInput
inputs.<ContentTranslationServiceProvider enabled={true} translate={async function (text: string): Promise<string> { return yourTranslationFnc(text); }} > ... </ContentTranslationServiceProvider>
You can disable translation for a specific
FinalFormInput
by using thedisableContentTranslation
prop.<Field required fullWidth name="myField" component={FinalFormInput} label={<FormattedMessage id="myField" defaultMessage="My Field" />} + disableContentTranslation />
-
8eb1375: Add
SaveBoundary
andSaveBoundarySaveButton
that helps implementing multiple forms with a centralized save buttonRender a
Savable
Component anywhere below aSaveBoundary
. ForFinalForm
this doesn't have to be done manually. -
a4fac91: Rework
Alert
component- Use theme wherever possible
- Move styles where they're more fitting
- Fix some paddings
Patch Changes
- dcfa03c: Fix a crash when using the
Alert
component inside a MUISnackbar
@comet/admin-rte@6.1.0
Minor Changes
- f1fc9e2: Add support for content translation
@comet/admin-theme@6.1.0
Minor Changes
-
a4fac91: Rework
Alert
component- Use theme wherever possible
- Move styles where they're more fitting
- Fix some paddings
@comet/cms-api@6.1.0
Minor Changes
-
7ea43eb: Make the
UserService
option of theUserPermissionsModule
optional.The service is still necessary though for the administration panel.
-
86cd5c6: Allow a callback for the
availableContentScopes
option of theUserPermissionsModule
Please be aware that when using this possibility to make sure to cache the
response properly as this is called for every request to the API. -
737ab3b: Allow returning multiple content scopes in
@ScopedEntity()
decorator -
f416510: Remove
CurrentUserLoader
andCurrentUserInterface
Overriding the current user in the application isn't supported anymore when using the new
UserPermissionsModule
, which provides the current user DTO itself.
Patch Changes
- ef84331: Fix type of
@RequiredPermission()
to accept a non-array string for a single permission - 8e158f8: Add missing
@RequiredPermission()
decorator toFileLicensesResolver
- 5018441: API Generator: Add missing
scope
argument and filter to<entity>BySlug
query - 1f6c58e: API Generator: support
GraphQLJSONObject
input for fields that are not anInputType
class - b437f75: API Generator: Disable input generation if
create
andupdate
are set tofalse
in the decorator
@comet/admin-icons@6.1.0
Patch Changes
- 08e0da0: Fix icons inside tooltips by forwarding the ref
@comet/cms-admin@6.1.0
Patch Changes
5.6.1
6.0.0
@comet/admin@6.0.0
Major Changes
-
298b63b:
FinalForm
: Remove defaultonAfterSubmit
implementationIn most cases the default implementation is not wanted anymore. When upgrading, an empty
function override ofonAfterSubmit
can be removed as it is no longer necessary.To get back the old behavior use the following in application code:
const stackApi = React.useContext(StackApiContext); const editDialog = React.useContext(EditDialogApiContext); // ... <FinalForm onAfterSubmit={() => { stackApi?.goBack(); editDialog?.closeDialog({ delay: true }); }} >
-
0d76854:
FinalForm
: Don't handle sync submit differently than async submit -
6277912:
FinalFormContext
: Change the signatures ofshouldScrollToField
,shouldShowFieldError
andshouldShowFieldWarning
inFinalFormContext
to match the corresponding methods inField
The API in
FinalFormContext
was changed from// ❌ export interface FinalFormContext { shouldScrollToField: ({ fieldMeta }: { fieldMeta: FieldMetaState<any> }) => boolean; shouldShowFieldError: ({ fieldMeta }: { fieldMeta: FieldMetaState<any> }) => boolean; shouldShowFieldWarning: ({ fieldMeta }: { fieldMeta: FieldMetaState<any> }) => boolean; }
to
// ✅ export interface FinalFormContext { shouldScrollToField: (fieldMeta: FieldMetaState<any>) => boolean; shouldShowFieldError: (fieldMeta: FieldMetaState<any>) => boolean; shouldShowFieldWarning: (fieldMeta: FieldMetaState<any>) => boolean; }
Now the corresponding methods in
Field
andFinalFormContext
have the same signature.
Minor Changes
- 921f637: Add
helperText
prop toField
andFieldContainer
to provide additional information
@comet/admin-icons@6.0.0
Major Changes
- a525766: Remove deprecated icons
Betrieb
,LogischeFilter
,Pool
,Pool2
,StateGreen
,StateGreenRing
,StateOrange
,StateOrangeRing
,StateRed
,StateRedRing
,Vignette1
andVignette2
.
Patch Changes
- 76e50aa: Fix broken
Logout
icon
@comet/cms-admin@6.0.0
Major Changes
-
d20f59c: Enhance CronJob module
- Show latest job run on
CronJobsPage
- Add option to manually trigger cron jobs to
CronJobsPage
- Add subpage to
CronJobsPage
that shows all job runs
Warning: Only include this module if all your users should be able to trigger cron jobs manually or you have sufficient access control in place.
Includes the following breaking changes:
- Rename
JobStatus
toKubernetesJobStatus
to avoid naming conflicts - Rename
BuildRuntime
toJobRuntime
- Show latest job run on
-
d86d5a9: Make sites config generic
The sites config was previously assumed to be
Record<string, SiteConfig>
.
However, as the sites config is solely used in application code, it could be of any shape.
Therefore, theSitesConfigProvider
anduseSitesConfig
are made generic.
The following changes have to be made in the application:-
Define the type of your sites config
Preferably this should be done in
config.ts
:export function createConfig() { // ... return { ...cometConfig, apiUrl: environmentVariables.API_URL, adminUrl: environmentVariables.ADMIN_URL, + sitesConfig: JSON.parse(environmentVariables.SITES_CONFIG) as SitesConfig, }; } + export type SitesConfig = Record<string, SiteConfig>;
-
Use the type when using
useSitesConfig
- const sitesConfig = useSitesConfig(); + const sitesConfig = useSitesConfig<SitesConfig>();
-
Optional: Remove type annotation from
ContentScopeProvider#resolveSiteConfigForScope
(as it's now inferred)- resolveSiteConfigForScope: (configs: Record<string, SiteConfig>, scope: ContentScope) => configs[scope.domain], + resolveSiteConfigForScope: (configs, scope: ContentScope) => configs[scope.domain],
-
Minor Changes
- 0f814c5: Add
MasterMenu
andMasterMenuRoutes
components which both take a single data structure to define menu and routes.
@comet/cms-api@6.0.0
Major Changes
-
d20f59c: Enhance CronJob module
- Show latest job run on
CronJobsPage
- Add option to manually trigger cron jobs to
CronJobsPage
- Add subpage to
CronJobsPage
that shows all job runs
Warning: Only include this module if all your users should be able to trigger cron jobs manually or you have sufficient access control in place.
Includes the following breaking changes:
- Rename
JobStatus
toKubernetesJobStatus
to avoid naming conflicts - Rename
BuildRuntime
toJobRuntime
- Show latest job run on
-
b3ceaef: Replace
ContentScopeModule
withUserPermissionsModule
Breaking changes:
ContentScopeModule
has been removedcanAccessScope
has been moved toAccessControlService
and refactored intoisAllowed
contentScopes
andpermissions
fields have been added toCurrentUser
objectrole
andrights
fields has been removed fromCurrentUser
objectAllowForRole
decorator has been removed- Rename
SubjectEntity
decorator toAffectedEntity
- Add
RequiredPermission
decorator and make it mandatory when usingUserPermissionsModule
@comet/eslint-config@6.0.0
Major Changes
- 72f98c7: Enable
import/newline-after-import
rule by default - 47eb81c: Enable
no-other-module-relative-import
rule by default
@comet/admin-rte@6.0.0
Patch Changes
- 803f504: Retain headings 4 - 6, blockquote and strikethrough formatting when copying from one RTE to another
5.6.0
@comet/admin-theme@5.6.0
Minor Changes
- fb6c806: Change
DataGrid
'snoRowsLabel
from "No rows" to "No results found."
@comet/blocks-admin@5.6.0
Patch Changes
- 76f85ab: Fix linking from block preview to block admin for non-trivial composite/list block combinations
@comet/cms-admin@5.6.0
Minor Changes
- fe26a6e: Show an error message when trying to edit a non-existing document and when trying to edit an archived document
- 3ee4ce0: Return newly uploaded items from
useDamFileUpload#uploadFiles
@comet/blocks-api@5.6.0
Minor Changes
- fd10b80: Add support for a custom block name and migrations to
createRichTextBlock
5.5.0
@comet/cms-admin@5.5.0
Patch Changes
-
1b37b1f: Show
additionalToolbarItems
inChooseFileDialog
The
additionalToolbarItems
were only shown inside theDamPage
, but not in theChooseFileDialog
.
To fix this, use theadditionalToolbarItems
option inDamConfigProvider
.
TheadditionalToolbarItems
prop ofDamPage
has been deprecated in favor of this option.Previously:
<DamPage // ... additionalToolbarItems={<ImportFromExternalDam />} />
Now:
<DamConfigProvider value={{ // ... additionalToolbarItems: <ImportFromExternalDam />, }} > {/*...*/} </DamConfigProvider>
-
85aa962: Set unhandled dependencies to
undefined
when copying documents to another scopeThis prevents leaks between scopes. In practice, this mostly concerns links to documents that don't exist in the target scope.
Example:
- Page A links to Page B
- Page A is copied from Scope A to Scope B
- Link to Page B is removed from Page A by replacing the
id
withundefined
(since Page B doesn't exist in Scope B)
Note: The link is only retained if both pages are copied in the same operation.
-
c4639be: Clip crop values when cropping an image in the DAM or
PixelImageBlock
Previously, negative values could occur, causing the image proxy to fail on delivery.
@comet/cms-api@5.5.0
Minor Changes
-
bb2c76d: Deprecate
FileUploadInterface
interfaceUse
FileUploadInput
instead. -
bb2c76d: Deprecate
download
helperThe helper is primarily used to create a
FileUploadInput
(previouslyFileUploadInterface
) input forFilesService#upload
while creating fixtures.
However, the name of the helper is too generic to be part of the package's public API.
Instead, use the newly addedFileUploadService#createFileUploadInputFromUrl
.Example:
@Injectable() class ImageFixtureService { constructor(private readonly filesService: FilesService, private readonly fileUploadService: FileUploadService) {} async generateImage(url: string): Promise<FileInterface> { const upload = await this.fileUploadService.createFileUploadInputFromUrl(url); return this.filesService.upload(upload, {}); } }
@comet/eslint-config@5.5.0
Patch Changes
- 80a6d8d: Move import restriction for MUI's
Alert
to correct ESLint config
4.7.1
@comet/admin@4.7.1
Patch Changes
-
56b33ff: Fix
submit
implementation forDirtyHandler
inFinalForm
The submit mutation wasn't correctly awaited if a
FinalForm
using an asynchronous validation was saved via thesaveAction
provided in theRouterPrompt
.In practice, this affected
FinalForm
s within anEditDialog
. TheEditDialog
closed before the submission was completed. All changes were omitted. The result of the submission (fail or success) was never shown.
@comet/cms-admin@4.7.1
Patch Changes
-
3275154: Prevent false positive save conflicts while editing documents (e.g.
Page
):- Stop checking for conflicts while saving is in progress
- Ensure that all "CheckForChanges" polls are cleared
-
56b33ff: Improved the
EditPageNode
dialog ("Page Properties" dialog):- Execute the asynchronous slug validation less often (increased the debounce wait time from 200ms to 500ms)
- Cache the slug validation results. Evict the cache on the initial render of the dialog
5.4.0
@comet/admin@5.4.0
Minor Changes
-
60a1839: Add
Alert
componentExample:
import { Alert, OkayButton, SaveButton } from "@comet/admin"; <Alert severity="warning" title="Title" action={ <Button variant="text" startIcon={<ArrowRight />}> Action Text </Button> } > Notification Text </Alert>;
Patch Changes
-
ba80016: Allow passing a mix of elements and arrays to
Tabs
andRouterTabs
as childrenFor example:
<RouterTabs> <RouterTab label="One" path=""> One </RouterTab> {content.map((value) => ( <RouterTab key={value} label={value} path={`/${value}`}> {value} </RouterTab> ))} {showFourthTab && ( <RouterTab label="Four" path="/four"> Four </RouterTab> )} </RouterTabs>
@comet/admin-rte@5.4.0
Minor Changes
-
981bf48: Allow setting a tooltip to the button of custom-inline-styles using the
tooltipText
prop -
51d6c2b: Move soft-hyphen functionality to
@comet/admin-rte
This allows using the soft-hyphen functionality in plain RTEs, and not only in
RichTextBlock
const [useRteApi] = makeRteApi(); export default function MyRte() { const { editorState, setEditorState } = useRteApi(); return ( <Rte value={editorState} onChange={setEditorState} options={{ supports: [ // Soft Hyphen "soft-hyphen", // Other options you may wish to support "bold", "italic", ], }} /> ); }
@comet/cms-admin@5.4.0
Minor Changes
-
e146d8b: Support the import of files from external DAMs
To connect an external DAM, implement a component with the necessary logic (asset picker, upload functionality, ...). Pass this component to the
DamPage
via theadditionalToolbarItems
prop.<DamPage // ... additionalToolbarItems={<ImportFromExternalDam />} />
You can find an example in the demo project.
-
51d6c2b: Move soft-hyphen functionality to
@comet/admin-rte
This allows using the soft-hyphen functionality in plain RTEs, and not only in
RichTextBlock
const [useRteApi] = makeRteApi(); export default function MyRte() { const { editorState, setEditorState } = useRteApi(); return ( <Rte value={editorState} onChange={setEditorState} options={{ supports: [ // Soft Hyphen "soft-hyphen", // Other options you may wish to support "bold", "italic", ], }} /> ); }
-
dcaf750: Make all DAM license fields optional if
LicenseType
isROYALTY_FREE
even ifrequireLicense
is true inDamConfig
Patch Changes
- 087cb01: Enable copying documents from one
PageTree
category to another (e.g. from "Main navigation" to "Top menu" in Demo)
@comet/cms-api@5.4.0
Minor Changes
-
e146d8b: Support the import of files from external DAMs
To connect an external DAM, implement a component with the necessary logic (asset picker, upload functionality, ...). Pass this component to the
DamPage
via theadditionalToolbarItems
prop.<DamPage // ... additionalToolbarItems={<ImportFromExternalDam />} />
You can find an example in the demo project.
-
27bf643: Add
PublicUploadsService
to public APIThe service can be used to programmatically create public uploads, such as when creating fixtures.
-
df5c959: Remove license types
MICRO
andSUBSCRIPTION
The
LicenseType
enum no longer contains the valuesMICRO
andSUBSCRIPTION
. The database migration will automatically update all licenses of typeMICRO
orSUBSCRIPTION
toRIGHTS_MANAGED
.
Patch Changes
-
60f5208: Fix encoding of special characters in names of uploaded files
For example:
Previously:
€.jpg
->a.jpg
ä.jpg
->ai.jpg
Now:
€.jpg
->euro.jpg
ä.jpg
->ae.jpg
@comet/cms-site@5.4.0
Minor Changes
-
f906386: Add
hasRichTextBlockContent
helperThe helper can be used to conditionally render a
RichTextBlock
.Example:
import { hasRichTextBlockContent } from "@comet/cms-site"; function TeaserBlock({ data: { image, text } }: PropsWithData<TeaserBlockData>) { return ( <> <DamImageBlock data={image} /> {hasRichTextBlockContent(text) && <RichTextBlock data={text} />} </> ); }
5.3.0
@comet/admin@5.3.0
Minor Changes
- 60cc1b2: Add
FieldSet
component with accordion behavior for better structuring of big forms.
Patch Changes
-
a677a16: Fix
RouterPromptHandler
to not show a prompt when navigating to a path with params that is not a sub route -
5435b27: Fix
shouldScrollTo()
,shouldShowError()
andshouldShowWarning()
inField
Previously, the
meta
argument was passed to these methods incorrectly. Now, the argument is passed as defined by the typing.
@comet/admin-icons@5.3.0
Minor Changes
- 0ff9b9b: Deprecate icons
StateGreen
,StateGreenRing
,StateOrange
,StateOrangeRing
,StateRed
, andStateRedRing
,
Patch Changes
-
0ff9b9b: Fix various icons
Since version 5.2.0 several icons were not displayed correctly. This problem has been fixed.
@comet/blocks-admin@5.3.0
Minor Changes
-
a227388: Add support for custom block categories
Allows specifying custom block categories in application code.
Example:
In
src/common/blocks/customBlockCategories.tsx
:import { BlockCategory, CustomBlockCategory } from "@comet/blocks-admin"; import React from "react"; import { FormattedMessage } from "react-intl"; const productsBlockCategory: CustomBlockCategory = { id: "Products", label: <FormattedMessage id="blocks.category.products" defaultMessage="Products" />, // Specify where category will be shown in drawer insertBefore: BlockCategory.Teaser, }; export { productsBlockCategory };
In
src/documents/pages/blocks/MyBlock.tsx
:import { productsBlockCategory } from "@src/common/blocks/customBlockCategories"; const MyBlock: BlockInterface = { category: productsBlockCategory, ... };
@comet/cms-admin@5.3.0
Patch Changes
-
0fdf4ea: Always use the
/preview
file URLs in the admin applicationThis is achieved by setting the
x-preview-dam-urls
in theincludeInvisibleContentContext
.This fixes a page copy bug where all files were downloaded and uploaded again, even when copying within the same environment.
5.2.0
@comet/admin@5.2.0
Minor Changes
-
0bed4e7: Add optional
hasConflict
prop toSaveButton
,FinalFormSaveButton
andFinalFormSaveSplitButton
If set to
true
, a new "conflict" display state is triggered.
You should pass thehasConflict
prop returned byuseSaveConflict()
,useSaveConflictQuery()
anduseFormSaveConflict()
.
Patch Changes
- 25daac0: Avoid remount of
RouterTab
withforceRender={true}
whenRouterTabs
are used inside aStack
@comet/admin-icons@5.2.0
Minor Changes
- 9fc7d47: Add new icons from the Comet UX library. Replace existing icons with new versions. Mark icons Pool, Pool2, Vignette1, Vignette2, Betrieb, LogischeFilter as deprecated.
@comet/blocks-admin@5.2.0
Minor Changes
-
824ea66: Improve layout selection UX in
createColumnsBlock
Hide select when there's only one layout for a specific number of columns
Patch Changes
-
3702bb2: Infer additional item fields in
BlocksBlock
andListBlock
Additional fields in the
item
prop ofAdditionalItemContextMenuItems
andAdditionalItemContent
will be typed correctly if theadditionalItemFields
option is strongly typed.
@comet/cms-admin@5.2.0
Minor Changes
-
0bed4e7: Improve the
SaveConflictDialog
- extend the text in the dialog to explain
- what happened
- what the next steps are
- what can be done to avoid conflicts
- make the button labels more precise
- once the save dialog is closed
- stop polling
- mark the save button red and with an error icon
- extend the text in the dialog to explain
-
0bed4e7:
useSaveConflict()
,useSaveConflictQuery()
anduseFormSaveConflict()
now return ahasConflict
propIf
hasConflict
is true, a save conflict has been detected.
You should passhasConflict
on toSaveButton
,FinalFormSaveButton
orFinalFormSaveSplitButton
. The button will then display a "conflict" state. -
0bed4e7: Admin Generator: In the generated form, the
hasConflict
prop is passed from theuseFormSaveConflict()
hook to theFinalFormSaveSplitButton
-
6fda5a5: CRUD Generator: Change the file ending of the private sibling GraphQL files from
.gql.tsx
to.gql.ts
The GraphQL files do not contain JSX.
Regenerate the files to apply this change to a project.
@comet/cms-api@5.2.0
Minor Changes
-
bbc0a0a: Add access logging to log information about the request to standard output. The log contains information about the requester and the request itself. This can be useful for fulfilling legal requirements regarding data integrity or for forensics.
There are two ways to integrate logging into an application:
First option: Use the default implementation
imports: [ ... AccessLogModule, ... ]
Second option: Configure logging
Use the
shouldLogRequest
to prevent logging for specific requests. For instance, one may filter requests for system users.imports: [ ... AccessLogModule.forRoot({ shouldLogRequest: ({user, req}) => { // do something return true; //or false }, }), ... ]
More information can be found in the documentation under 'Authentication > Access Logging'.
Patch Changes
- 1a170b9: API Generator: Use correct type for
where
whengetFindCondition
service method is not used - 6b240a0: CRUD Generator: Correctly support
type: "text"
fields in input
@comet/cms-site@5.2.0
Minor Changes
- 6244d6c: Add the
YouTubeVideoBlock
to the@comet/cms-site
package.