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 a36bf02 + 16ffa7b commit f275b7f
Show file tree
Hide file tree
Showing 80 changed files with 1,185 additions and 244 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.
8 changes: 0 additions & 8 deletions .changeset/plenty-pillows-jog.md

This file was deleted.

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.

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,
},
});
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 },
});
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 f275b7f

Please sign in to comment.