-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1998 from vivid-planet/merge-next-into-feature-me…
…nu-rework Merge `next` into `feature/menu-rework`
- Loading branch information
Showing
1,560 changed files
with
35,037 additions
and
14,207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@comet/cms-api": patch | ||
--- | ||
|
||
API Generator: Disable input generation if `create` and `update` are set to `false` in the decorator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
"@comet/eslint-config": major | ||
--- | ||
|
||
Enforce PascalCase for enums | ||
|
||
Changing the casing of an existing enum can be problematic, e.g., if the enum values are persisted in the database. | ||
In such cases, the rule can be disabled like so | ||
|
||
```diff | ||
+ /* eslint-disable @typescript-eslint/naming-convention */ | ||
export enum ExampleEnum { | ||
attr1 = "attr1", | ||
} | ||
+ /* eslint-enable @typescript-eslint/naming-convention */ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@comet/admin": major | ||
--- | ||
|
||
Add `@comet/admin-theme` as a peer dependency | ||
|
||
`@comet/admin` now uses the custom `Typography` variants `list` and `listItem` defined in `@comet/admin-theme`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@comet/admin": minor | ||
--- | ||
|
||
Add `StackToolbar`, a variant of `Toolbar` component that hides itself in a nested stack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
"@comet/cms-api": major | ||
--- | ||
|
||
Remove CDN config from DAM | ||
|
||
It was a bad idea to introduce this in the first place, because `@comet/cms-api` should not be opinionated about how the CDN works. | ||
|
||
Modern applications require all traffic to be routed through a CDN. Cloudflare offers a tunnel, which made the origin-check obsolete, so we introduced a flag to disable the origin check. | ||
|
||
Also changes the behavior of the `FilesService::createFileUrl()`-method which now expects an options-object as second argument. | ||
|
||
## How to migrate (only required if CDN is used): | ||
|
||
Remove the following env vars from the API | ||
|
||
``` | ||
DAM_CDN_ENABLED= | ||
DAM_CDN_DOMAIN= | ||
DAM_CDN_ORIGIN_HEADER= | ||
DAM_DISABLE_CDN_ORIGIN_HEADER_CHECK=false | ||
``` | ||
|
||
If you want to enable the origin check: | ||
|
||
1. Set the following env vars for the API | ||
|
||
``` | ||
CDN_ORIGIN_CHECK_SECRET="Use value from DAM_CDN_ORIGIN_HEADER to avoid downtime" | ||
``` | ||
|
||
_environment-variables.ts_ | ||
|
||
``` | ||
@IsOptional() | ||
@IsString() | ||
CDN_ORIGIN_CHECK_SECRET: string; | ||
``` | ||
|
||
_config.ts_ | ||
|
||
``` | ||
cdn: { | ||
originCheckSecret: envVars.CDN_ORIGIN_CHECK_SECRET, | ||
}, | ||
``` | ||
|
||
2. Add CdnGuard | ||
|
||
``` | ||
// if CDN is enabled, make sure all traffic is either coming from the CDN or internal sources | ||
if (config.cdn.originCheckSecret) { | ||
app.useGlobalGuards(new CdnGuard({ headerName: "x-cdn-origin-check", headerValue: config.cdn.originCheckSecret })); | ||
} | ||
``` | ||
|
||
3. DNS changes might be required. `api.example.com` should point to CDN, CDN should point to internal API domain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@comet/admin": major | ||
--- | ||
|
||
Create a subroute by default in `SaveBoundary` | ||
|
||
The default path is `./save`, you can change it using the `subRoutePath` prop. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@comet/cms-admin": major | ||
"@comet/cms-api": major | ||
--- | ||
|
||
Change language field in User and CurrentUser to locale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
"@comet/eslint-config": major | ||
--- | ||
|
||
Add the rule `@typescript-eslint/prefer-enum-initializers` to require enum initializers | ||
|
||
```ts | ||
// ✅ | ||
enum ExampleEnum { | ||
One = "One", | ||
Two = "Two" | ||
} | ||
``` | ||
|
||
```ts | ||
// ❌ | ||
enum ExampleEnum { | ||
One, | ||
Two | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@comet/admin-color-picker": major | ||
--- | ||
|
||
Replace the `componentsProps` prop with `slotProps` in `ColorPicker` and remove the `ColorPickerComponentsProps` type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@comet/cms-admin": major | ||
--- | ||
|
||
Add `@comet/admin-theme` as a peer dependency | ||
|
||
`@comet/cms-admin` now uses the custom `Typography` variants `list` and `listItem` defined in `@comet/admin-theme`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@comet/admin-theme": major | ||
--- | ||
|
||
Rework theme of MUI's `Chip` to match the updated Comet CI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@comet/admin-theme": major | ||
--- | ||
|
||
Rework `typographyOptions` | ||
|
||
- Replace `typographyOptions` with `createTypographyOptions()` to enable using the theme's breakpoints for media queries | ||
- Add new styles for `button` variant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@comet/admin": major | ||
--- | ||
|
||
Change theming method of `Menu` | ||
|
||
- Rename `permanent` class-key to `permanentDrawer` and `temporary` class-key to `temporaryDrawer` | ||
- Replace the `permanentDrawerProps` and `temporaryDrawerProps` props with `slotProps` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@comet/cms-api": minor | ||
--- | ||
|
||
API Generator: Add `list` option to `@CrudGenerator()` to allow disabling the list query | ||
|
||
Related DTO classes will still be generated as they might be useful for application code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@comet/cms-admin": major | ||
"@comet/cms-api": major | ||
--- | ||
|
||
CRUD Generator: Remove `lastUpdatedAt` argument from update mutations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
"@comet/admin-theme": major | ||
--- | ||
|
||
Rework colors | ||
|
||
- Rename `bluePalette` to `primaryPalette` | ||
- Rename `neutrals` to `greyPalette` | ||
- Remove `greenPalette` | ||
- Remove `secondary` from `paletteOptions` | ||
- Change colors in all palettes | ||
- Change `text` colors | ||
- Add `highlight` colors `purple`, `green`, `orange`, `yellow` and `red` to palette | ||
|
||
Hint: To use the `highlight` colors without getting a type error, you must adjust the `vendors.d.ts` in your project: | ||
|
||
```diff | ||
+ /// <reference types="@comet/admin-theme" /> | ||
|
||
// ... | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@comet/cms-site": minor | ||
--- | ||
|
||
Deprecate `InternalLinkBlock` component, instead there should be a copy of this component in the application for flexibility (e.g., support for internationalized routing) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@comet/cms-api": major | ||
--- | ||
|
||
Make `@nestjs/platform-express` a peer dependency | ||
|
||
Make sure that `@nestjs/platform-express` is installed in the application. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@comet/cms-site": major | ||
--- | ||
|
||
Bump styled-components peer dependency to v6 | ||
|
||
Follow the official [migration guide](https://styled-components.com/docs/faqs#what-do-i-need-to-do-to-migrate-to-v6) to upgrade. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
"@comet/blocks-api": major | ||
"@comet/cms-api": major | ||
--- | ||
|
||
Support "real" dependency injection in `BlockData#transformToPlain` | ||
|
||
Previously we supported poor man's dependency injection using the `TransformDependencies` object in `transformToPlain`. | ||
This is now replaced by a technique that allows actual dependency injection. | ||
|
||
**Example** | ||
|
||
```ts | ||
class NewsLinkBlockData extends BlockData { | ||
@BlockField({ nullable: true }) | ||
id?: string; | ||
|
||
transformToPlain() { | ||
// Return service that does the transformation | ||
return NewsLinkBlockTransformerService; | ||
} | ||
} | ||
|
||
type TransformResponse = { | ||
news?: { | ||
id: string; | ||
slug: string; | ||
}; | ||
}; | ||
|
||
@Injectable() | ||
class NewsLinkBlockTransformerService implements BlockTransformerServiceInterface<NewsLinkBlockData, TransformResponse> { | ||
// Use dependency injection here | ||
constructor(@InjectRepository(News) private readonly repository: EntityRepository<News>) {} | ||
|
||
async transformToPlain(block: NewsLinkBlockData, context: BlockContext) { | ||
if (!block.id) { | ||
return {}; | ||
} | ||
|
||
const news = await this.repository.findOneOrFail(block.id); | ||
|
||
return { | ||
news: { | ||
id: news.id, | ||
slug: news.slug, | ||
}, | ||
}; | ||
} | ||
} | ||
``` | ||
|
||
Adding this new technique results in a few breaking changes: | ||
|
||
- Remove dynamic registration of `BlocksModule` | ||
- Pass `moduleRef` to `BlocksTransformerMiddlewareFactory` instead of `dependencies` | ||
- Remove `dependencies` from `BlockData#transformToPlain` | ||
|
||
See the [migration guide](https://docs.comet-dxp.com/docs/migration/migration-from-v6-to-v7) on how to migrate. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
"@comet/admin-date-time": major | ||
--- | ||
|
||
Change `DatePicker` and `DateRangePicker` values from `Date` to `string` | ||
|
||
This affects the `value` prop and the value returned by the `onChange` event. | ||
|
||
The value of `DatePicker` is a string in the format `YYYY-MM-DD`. | ||
The value of `DateRangePicker` is an object with `start` and `end` keys, each as a string in the format `YYYY-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. | ||
|
||
```diff | ||
- 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} />; | ||
``` | ||
|
||
```diff | ||
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 a `Date` 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 as `2024-04-09`, which differs from the selected date. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@comet/cms-site": major | ||
--- | ||
|
||
Upgrade to Next 14 and React 18 | ||
|
||
Add "use client" directive to components that currently require it (as they use styled-components or a context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@comet/admin": major | ||
--- | ||
|
||
Remove the `requiredSymbol` prop from `FieldContainer` and use MUIs native implementation | ||
|
||
This prop was used to display a custom required symbol next to the label of the field. We now use the native implementation of the required attribute of MUI to ensure better accessibility and compatibility with screen readers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@comet/admin-theme": minor | ||
--- | ||
|
||
Slightly increase the default size of dialogs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@comet/cms-api": major | ||
--- | ||
|
||
API Generator: Generate better API for Many-to-one-relations with `orphanRemoval` activated where the reverse side has its own API generated | ||
|
||
- Add `id` as argument to create mutation | ||
- Add `id` as argument to list query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
"@comet/cms-site": minor | ||
--- | ||
|
||
Store site preview scope in cookie and add `previewParams()` helper to access it | ||
|
||
- Requires the new `SITE_PREVIEW_SECRET` environment variable that must contain a random secret (not required for local development) | ||
- Requires a Route Handler located at `app/api/site-preview/route.ts`: | ||
|
||
```ts | ||
import { sitePreviewRoute } from "@comet/cms-site"; | ||
import { createGraphQLFetch } from "@src/util/graphQLClient"; | ||
import { type NextRequest } from "next/server"; | ||
|
||
export const dynamic = "force-dynamic"; | ||
|
||
export async function GET(request: NextRequest) { | ||
return sitePreviewRoute(request, createGraphQLFetch()); | ||
} |
Oops, something went wrong.