Skip to content

Commit

Permalink
Merge main into next
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jun 5, 2024
2 parents b2f6423 + c06c6f1 commit ef5f593
Show file tree
Hide file tree
Showing 91 changed files with 1,401 additions and 277 deletions.
5 changes: 5 additions & 0 deletions .changeset/epic-treasure-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/admin-rte": patch
---

Hide translation button for `FinalFormSearchTextField`
18 changes: 0 additions & 18 deletions .changeset/few-actors-impress.md

This file was deleted.

32 changes: 32 additions & 0 deletions .changeset/fifty-lies-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
"@comet/admin": minor
---

Add `FinalFormAsyncSelect`, `AsyncSelectField`, and `FinalFormAsyncAutocomplete` components

Thin wrappers to ease using `useAsyncOptionsProps()` with `FinalFormSelect` and `FinalFormAutocomplete`.

**Example**

Previously:

```tsx
const asyncOptionsProps = useAsyncOptionsProps(async () => {
// Load options here
});

// ...

<Field component={FinalFormAsyncAutocomplete} {...asyncOptionsProps} />;
```

Now:

```tsx
<Field
component={FinalFormAsyncAutocomplete}
loadOptions={async () => {
// Load options here
}}
/>
```
9 changes: 9 additions & 0 deletions .changeset/green-years-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@comet/cms-admin": minor
"@comet/cms-site": minor
"@comet/cms-api": minor
---

Add a `DamFileDownloadLinkBlock` that can be used to download a file or open it in a new tab

Also, add new `/dam/files/download/:hash/:fileId/:filename` endpoint for downloading assets.
5 changes: 5 additions & 0 deletions .changeset/lemon-eyes-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/cms-api": patch
---

API CrudSingleGenerator: Run `transformToBlockData()` for block fields on create
8 changes: 0 additions & 8 deletions .changeset/plenty-pillows-jog.md

This file was deleted.

15 changes: 15 additions & 0 deletions .changeset/proud-buckets-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@comet/admin-theme": minor
---

Allow to pass args to createCometTheme to support localization via theme

See https://mui.com/material-ui/guides/localization/

```tsx
import { deDE } from "@mui/x-data-grid-pro";

const theme = createCometTheme({}, deDE);

<MuiThemeProvider theme={theme} />;
```
10 changes: 10 additions & 0 deletions .changeset/thin-balloons-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@comet/cms-api": patch
---

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.
7 changes: 7 additions & 0 deletions .changeset/wild-suns-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@comet/cms-api": minor
---

Add `DisablePermissionCheck` constant for use in `@RequiredPermission` decorator

You can disable authorization for a resolver or operation by adding the decorator `@RequiredPermission(DisablePermissionCheck)`
15 changes: 0 additions & 15 deletions .changeset/young-hotels-sparkle.md

This file was deleted.

2 changes: 1 addition & 1 deletion demo/admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { additionalPageTreeNodeFieldsFragment } from "@src/common/EditPageNode";
import { createConfig } from "@src/config";
import { ImportFromUnsplash } from "@src/dam/ImportFromUnsplash";
import { pageTreeCategories } from "@src/pageTree/pageTreeCategories";
import theme from "@src/theme";
import { theme } from "@src/theme";
import * as React from "react";
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
Expand Down
9 changes: 7 additions & 2 deletions demo/admin/src/common/blocks/LinkBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { createLinkBlock, ExternalLinkBlock, InternalLinkBlock } from "@comet/cms-admin";
import { createLinkBlock, DamFileDownloadLinkBlock, ExternalLinkBlock, InternalLinkBlock } from "@comet/cms-admin";
import { NewsLinkBlock } from "@src/news/blocks/NewsLinkBlock";

export const LinkBlock = createLinkBlock({
supportedBlocks: { internal: InternalLinkBlock, external: ExternalLinkBlock, news: NewsLinkBlock },
supportedBlocks: {
internal: InternalLinkBlock,
external: ExternalLinkBlock,
news: NewsLinkBlock,
damFileDownload: DamFileDownloadLinkBlock,
},
});
9 changes: 9 additions & 0 deletions demo/admin/src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { createCometTheme } from "@comet/admin-theme";
import type {} from "@mui/lab/themeAugmentation";

<<<<<<< HEAD
export default createCometTheme();
=======
export const theme = createCometTheme();

declare module "@mui/styles/defaultTheme" {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface DefaultTheme extends Theme {}
}
>>>>>>> main
62 changes: 59 additions & 3 deletions demo/api/block-meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,60 @@
}
]
},
{
"name": "DamFileDownloadLink",
"fields": [
{
"name": "file",
"kind": "NestedObject",
"object": {
"fields": [
{
"name": "id",
"kind": "String",
"nullable": false
},
{
"name": "name",
"kind": "String",
"nullable": false
},
{
"name": "fileUrl",
"kind": "String",
"nullable": false
}
]
},
"nullable": true
},
{
"name": "openFileType",
"kind": "Enum",
"enum": [
"NewTab",
"Download"
],
"nullable": false
}
],
"inputFields": [
{
"name": "fileId",
"kind": "String",
"nullable": true
},
{
"name": "openFileType",
"kind": "Enum",
"enum": [
"NewTab",
"Download"
],
"nullable": false
}
]
},
{
"name": "DamImage",
"fields": [
Expand Down Expand Up @@ -746,7 +800,8 @@
"blocks": {
"internal": "InternalLink",
"external": "ExternalLink",
"news": "NewsLink"
"news": "NewsLink",
"damFileDownload": "DamFileDownloadLink"
},
"nullable": false
}
Expand Down Expand Up @@ -775,7 +830,8 @@
"blocks": {
"internal": "InternalLink",
"external": "ExternalLink",
"news": "NewsLink"
"news": "NewsLink",
"damFileDownload": "DamFileDownloadLink"
},
"nullable": false
}
Expand Down Expand Up @@ -2085,7 +2141,7 @@
{
"name": "youtubeIdentifier",
"kind": "String",
"nullable": false
"nullable": true
},
{
"name": "aspectRatio",
Expand Down
6 changes: 4 additions & 2 deletions demo/api/src/common/blocks/linkBlock/link.block.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ExternalLinkBlock } from "@comet/blocks-api";
import { createLinkBlock, InternalLinkBlock } from "@comet/cms-api";
import { createLinkBlock, DamFileDownloadLinkBlock, InternalLinkBlock } from "@comet/cms-api";
import { NewsLinkBlock } from "@src/news/blocks/news-link.block";

export const LinkBlock = createLinkBlock({ supportedBlocks: { internal: InternalLinkBlock, external: ExternalLinkBlock, news: NewsLinkBlock } });
export const LinkBlock = createLinkBlock({
supportedBlocks: { internal: InternalLinkBlock, external: ExternalLinkBlock, news: NewsLinkBlock, damFileDownload: DamFileDownloadLinkBlock },
});
1 change: 1 addition & 0 deletions demo/api/src/footer/generated/footer.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class FooterResolver {
if (!footer) {
footer = this.repository.create({
...input,
content: input.content.transformToBlockData(),
scope,
});
}
Expand Down
17 changes: 17 additions & 0 deletions demo/site/src/blocks/LinkBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<<<<<<< HEAD
"use client";
import { ExternalLinkBlock, OneOfBlock, PropsWithData, SupportedBlocks, withPreview } from "@comet/cms-site";
=======
import {
DamFileDownloadLinkBlock,
ExternalLinkBlock,
InternalLinkBlock,
OneOfBlock,
PropsWithData,
SupportedBlocks,
withPreview,
} from "@comet/cms-site";
>>>>>>> main
import { LinkBlockData } from "@src/blocks.generated";
import { NewsLinkBlock } from "@src/news/blocks/NewsLinkBlock";
import * as React from "react";
Expand All @@ -22,6 +34,11 @@ const supportedBlocks: SupportedBlocks = {
{children}
</NewsLinkBlock>
),
damFileDownload: ({ children, title, ...props }) => (
<DamFileDownloadLinkBlock data={props} title={title}>
{children}
</DamFileDownloadLinkBlock>
),
};

interface LinkBlockProps extends PropsWithData<LinkBlockData> {
Expand Down
Loading

0 comments on commit ef5f593

Please sign in to comment.