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

Merge main into next #2098

merged 17 commits into from
Jun 6, 2024

Conversation

vivid-planet-bot
Copy link
Collaborator

This is an automated pull request to merge changes from main into next. It has merge conflicts. To resolve conflicts, check out the branch merge-main-into-next locally, make any necessary changes to conflicting files, and commit and publish your changes.

Extends the docs about dependencies:

- add more background info on what the block index is for
- Restructure parts of the docs
- Add info on how to
  - add field resolvers
  - use the `DependencyList`

---


https://deploy-preview-1957--comet-dxp-docs.netlify.app/docs/dependencies/
## Problem:

The validation in the ExternalLinkBlock was broken. The `isValid` check
uses `isLinkTarget` for validation:


https://github.com/vivid-planet/comet/blob/9867242fa6bad4849de58ccce1c28b816cc109a3/packages/admin/cms-admin/src/blocks/ExternalLinkBlock.tsx#L42-L44

The `targetUrl` field uses `validateUrl`:


https://github.com/vivid-planet/comet/blob/9867242fa6bad4849de58ccce1c28b816cc109a3/packages/admin/cms-admin/src/blocks/ExternalLinkBlock.tsx#L66-L73

The problem was that `validateUrl` internally used `isUrl` from class
validator. `isUrl` is less strict than `isLinkTarget`. This resulted in
no validation error in the UI but an error when trying to save the
block:


https://github.com/vivid-planet/comet/assets/13380047/a6c91ce1-94a5-4aac-a755-ef497a506504

## Solution:

I added `validateLinkTarget` using the stricter `isLinkTarget` check.
In #2102 I missed that the url can be undefined because it has an any
type and the typing of validateUrl was also incorrect. Now the
`ExternalLinkBlock` breaks when the URL is emptied. This PR fixes that
by checking if url is defined.
- Use Guard to avoid code duplication
- Use prevention everywhere for consistent behavior
- Better error message

---------

Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
…sibility (#2108)

Change the Behaviour of the Automatic Redirect to default to false if
the corresponding Page is unpublished or archived.

Co-authored-by: Markus Fichtner <markus.fichtner@vivid-planet.com>
- Fix type of youtubeIdentifier (was required, actually is optional)
- Don't show validation error if youtubeIdentifier is empty
- Allow emptying youtubeIdentifier

---------

Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @comet/admin@6.11.0

### Minor Changes

- 8e3dec5: Change `writeClipboardText`/`readClipboardText` clipboard
fallback to in-memory

Using the local storage as a fallback caused issues when writing
clipboard contents larger than 5MB.
    Changing the fallback to in-memory resolves the issue.

### Patch Changes

-   @comet/admin-icons@6.11.0

## @comet/cms-admin@6.11.0

### Minor Changes

- e10753b: Allow disabling the "Open preview" button in the `PageTree`
for certain document types

The "Open preview" button is shown for all document types in the
`PageTree`.
    But some document types (e.g., links) don't have a preview.
    Clicking on the preview button leads to an error page.

Now, it's possible to disable the button by setting `hasNoSitePreview`
for the document:

    ```diff
export const Link: DocumentInterface<Pick<GQLLink, "content">,
GQLLinkInput> = {
        // ...
    +   hasNoSitePreview: true,
    };
    ```

- fdf9fa7: Automatic Redirects are now set to false if the page is
unpublished or archived

### Patch Changes

-   815ba51: Fix link target validation in `ExternalLinkBlock`

    Previously, two different validation checks were used.
This resulted in an error when saving an invalid link target but no
error message was shown.

-   Updated dependencies [8e3dec5]
    -   @comet/admin@6.11.0
    -   @comet/admin-date-time@6.11.0
    -   @comet/admin-icons@6.11.0
    -   @comet/admin-rte@6.11.0
    -   @comet/admin-theme@6.11.0
    -   @comet/blocks-admin@6.11.0

## @comet/cms-api@6.11.0

### Minor Changes

-   0db10a5: Add a console script to import redirects from a csv file

You can use the script like this: `npm run console import-redirects
file-to-import.csv`

    The CSV file must look like this:

    ```csv
    source;target;target_type;comment;scope_domain
    /test-source;/test-target;internal;Internal Example;main
/test-source-external;https://www.comet-dxp.com/;external;External
Example;secondary
    ```

### Patch Changes

-   Updated dependencies [93a84b6]
    -   @comet/blocks-api@6.11.0

## @comet/admin-color-picker@6.11.0

### Patch Changes

-   Updated dependencies [8e3dec5]
    -   @comet/admin@6.11.0
    -   @comet/admin-icons@6.11.0

## @comet/admin-date-time@6.11.0

### Patch Changes

-   Updated dependencies [8e3dec5]
    -   @comet/admin@6.11.0
    -   @comet/admin-icons@6.11.0

## @comet/admin-react-select@6.11.0

### Patch Changes

-   Updated dependencies [8e3dec5]
    -   @comet/admin@6.11.0

## @comet/admin-rte@6.11.0

### Patch Changes

-   Updated dependencies [8e3dec5]
    -   @comet/admin@6.11.0
    -   @comet/admin-icons@6.11.0

## @comet/admin-theme@6.11.0

### Patch Changes

-   @comet/admin-icons@6.11.0

## @comet/blocks-admin@6.11.0

### Patch Changes

-   Updated dependencies [8e3dec5]
    -   @comet/admin@6.11.0
    -   @comet/admin-icons@6.11.0

## @comet/blocks-api@6.11.0

### Patch Changes

-   93a84b6: Fix type of `youtubeIdentifier` in `YouTubeVideoBlock`

    Previously, it was incorrectly typed as required. Now it's optional.

## @comet/eslint-config@6.11.0

### Patch Changes

-   @comet/eslint-plugin@6.11.0

## @comet/admin-babel-preset@6.11.0



## @comet/admin-icons@6.11.0



## @comet/cli@6.11.0



## @comet/eslint-plugin@6.11.0



## @comet/cms-site@6.11.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
See #1877

---------

Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
Co-authored-by: Thomas Dax <thomas.dax@vivid-planet.com>
Can be used to download a DAM file or open it in a new tab.

---------

Co-authored-by: Florian Ragger <florian.ragger@vivid-planet.com>
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
…tocomplete` components (#2069)

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
    }}
/>
```
…tching jobs (#2144)

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.
Previously this had to be done manually for e.g. each Grid
github-actions bot and others added 2 commits June 5, 2024 15:36
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @comet/admin@6.12.0

### Minor Changes

- 16ffa7b: 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
        }}
    />
    ```

### Patch Changes

-   @comet/admin-icons@6.12.0

## @comet/admin-theme@6.12.0

### Minor Changes

- c06c6f1: 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} />;
    ```

### Patch Changes

-   @comet/admin-icons@6.12.0

## @comet/cms-admin@6.12.0

### Minor Changes

- 3ee8c7a: 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.

### Patch Changes

-   Updated dependencies [dc7eaec]
-   Updated dependencies [16ffa7b]
-   Updated dependencies [c06c6f1]
    -   @comet/admin-rte@6.12.0
    -   @comet/admin@6.12.0
    -   @comet/admin-theme@6.12.0
    -   @comet/admin-date-time@6.12.0
    -   @comet/admin-icons@6.12.0
    -   @comet/blocks-admin@6.12.0

## @comet/cms-api@6.12.0

### Minor Changes

- 3ee8c7a: 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.

- 0597b1e: Add `DisablePermissionCheck` constant for use in
`@RequiredPermission` decorator

You can disable authorization for a resolver or operation by adding the
decorator `@RequiredPermission(DisablePermissionCheck)`

### Patch Changes

- 6717682: API CrudSingleGenerator: Run `transformToBlockData()` for
block fields on create
- b158e6a: 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.

    -   @comet/blocks-api@6.12.0

## @comet/cms-site@6.12.0

### Minor Changes

- 3ee8c7a: 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.

## @comet/admin-color-picker@6.12.0

### Patch Changes

-   Updated dependencies [16ffa7b]
    -   @comet/admin@6.12.0
    -   @comet/admin-icons@6.12.0

## @comet/admin-date-time@6.12.0

### Patch Changes

-   Updated dependencies [16ffa7b]
    -   @comet/admin@6.12.0
    -   @comet/admin-icons@6.12.0

## @comet/admin-react-select@6.12.0

### Patch Changes

-   Updated dependencies [16ffa7b]
    -   @comet/admin@6.12.0

## @comet/admin-rte@6.12.0

### Patch Changes

-   dc7eaec: Hide translation button for `FinalFormSearchTextField`
-   Updated dependencies [16ffa7b]
    -   @comet/admin@6.12.0
    -   @comet/admin-icons@6.12.0

## @comet/blocks-admin@6.12.0

### Patch Changes

-   Updated dependencies [16ffa7b]
    -   @comet/admin@6.12.0
    -   @comet/admin-icons@6.12.0

## @comet/eslint-config@6.12.0

### Patch Changes

-   @comet/eslint-plugin@6.12.0

## @comet/admin-babel-preset@6.12.0



## @comet/admin-icons@6.12.0



## @comet/blocks-api@6.12.0



## @comet/cli@6.12.0



## @comet/eslint-plugin@6.12.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@thomasdax98 thomasdax98 changed the title [Conflicts] Merge main into next Merge main into next Jun 6, 2024
@thomasdax98 thomasdax98 merged commit c8685c4 into next Jun 6, 2024
12 checks passed
@thomasdax98 thomasdax98 deleted the merge-main-into-next branch June 6, 2024 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants