Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into next #2098

Merged
merged 17 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/clean-insects-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@comet/cms-api": major
---

`FilesService#createFileDownloadUrl` now expects an options object as second parameter

```diff
- this.filesService.createFileDownloadUrl(file, previewDamUrls)
+ this.filesService.createFileDownloadUrl(file, { previewDamUrls, relativeDamUrls })
```
18 changes: 0 additions & 18 deletions .changeset/few-actors-impress.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/plenty-pillows-jog.md

This file was deleted.

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,
},
});
2 changes: 1 addition & 1 deletion demo/admin/src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createCometTheme } from "@comet/admin-theme";
import type {} from "@mui/lab/themeAugmentation";

export default createCometTheme();
export const theme = createCometTheme();
64 changes: 60 additions & 4 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 Expand Up @@ -2116,7 +2172,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
1 change: 0 additions & 1 deletion demo/site/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
7 changes: 6 additions & 1 deletion demo/site/src/blocks/LinkBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { ExternalLinkBlock, OneOfBlock, PropsWithData, SupportedBlocks, withPreview } from "@comet/cms-site";
import { DamFileDownloadLinkBlock, ExternalLinkBlock, OneOfBlock, PropsWithData, SupportedBlocks, withPreview } from "@comet/cms-site";
import { LinkBlockData } from "@src/blocks.generated";
import { NewsLinkBlock } from "@src/news/blocks/NewsLinkBlock";
import * as React from "react";
Expand All @@ -22,6 +22,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
Loading