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 feature/translation-module #1538

Merged
merged 52 commits into from
Jan 4, 2024

Conversation

VP-DS
Copy link
Contributor

@VP-DS VP-DS commented Jan 3, 2024

Merge main into untouched feature branch

nsams and others added 30 commits November 30, 2023 17:20
Changed to adhere to our best practices; no further changes needed, because crud generator handles visible on its own
…isibility

Demo: Remove default SQL value for news visibility
Reason: stick to best practices

- category is a required arg
- userGroup has GQL default value
example query that caused error:
```
query {
  products {
    nodes {
      id
      title
    }
  }
}
```
This would have prevented the bug fixed in #1479.
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
…-filter

API Generator: Add test for string filter
Don't let the Page expose a query, instead expose a loader function.
…bs` are used inside a `Stack` (#1439)

Remounting causes local state to be lost, including final-form values.

Problem was the missing `StackBreadcrumb` wrapper, as react remounts in
that case
(https://legacy.reactjs.org/docs/reconciliation.html#elements-of-different-types)

---------

Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
…xt-type

CRUD Generator: Correctly support `type: "text"` fields in input
Replace category-url mapping with a case conversion
Hide select when there's only one layout for a specific number of
columns.

---------

Co-authored-by: Ricky James Smith <jamesricky@me.com>
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
This PR moves the `YoutubeVideoBlock` from the demo/site directory to
the `@comet/cms-site` package.
This PR adds new icons from the Comet UX library. It also replaces
existing icons with new versions and deprecates the icons `Pool`,
`Pool2`, `Vignette1`, `Vignette2`, `Betrieb` and `LogischeFilter`.

---------

Co-authored-by: Thomas Dax <thomas.dax@vivid-planet.com>
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
Additional fields in the `item` prop of `AdditionalItemContextMenuItems`
and `AdditionalItemContent` will be typed correctly if the
`additionalItemFields` option is strongly typed.
## Changes:

- extend the text in the save conflicts dialog to explain
  - what happened
  - what the next steps are
  - what can be done to avoid conflicts
- make the button labels more precise
- once the save dialog is closed
  - stop polling
  - mark the save button red and with an error icon

(I will also show the other user (who made the conflicting change) in
the dialog. I'll do that in a follow-up PR)

## New dialog:

<img width="1075" alt="Bildschirmfoto 2023-11-06 um 09 32 27"
src="https://github.com/vivid-planet/comet/assets/13380047/49ee1ea5-e4f5-4ed5-ad91-9c695e5ea975">

## Screencast:



https://github.com/vivid-planet/comet/assets/13380047/51c18896-7e02-4373-a7e1-1fae10faebfc

---------

Co-authored-by: Ricky James Smith <jamesricky@me.com>
As it introduces incompatibilities and will be added when usable in the
next Comet version
…1508)

The prop seems to be a leftover and wasn't used.
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@5.2.0

### Minor Changes

- 0bed4e7: Add optional `hasConflict` prop to `SaveButton`,
`FinalFormSaveButton` and `FinalFormSaveSplitButton`

    If set to `true`, a new "conflict" display state is triggered.
You should pass the `hasConflict` prop returned by `useSaveConflict()`,
`useSaveConflictQuery()` and `useFormSaveConflict()`.

### Patch Changes

- 25daac0: Avoid remount of `RouterTab` with `forceRender={true}` when
`RouterTabs` are used inside a `Stack`
-   Updated dependencies [9fc7d47]
    -   @comet/admin-icons@5.2.0

## @comet/admin-icons@5.2.0

### Minor Changes

- 9fc7d47: Add new icons from the Comet UX library. Replace existing
icons with new versions. Mark icons Pool, Pool2, Vignette1, Vignette2,
Betrieb, LogischeFilter as deprecated.

## @comet/blocks-admin@5.2.0

### Minor Changes

-   824ea66: Improve layout selection UX in `createColumnsBlock`

Hide select when there's only one layout for a specific number of
columns

### Patch Changes

- 3702bb2: Infer additional item fields in `BlocksBlock` and
`ListBlock`

Additional fields in the `item` prop of `AdditionalItemContextMenuItems`
and `AdditionalItemContent` will be typed correctly if the
`additionalItemFields` option is strongly typed.

-   Updated dependencies [25daac0]

-   Updated dependencies [0bed4e7]

-   Updated dependencies [9fc7d47]
    -   @comet/admin@5.2.0
    -   @comet/admin-icons@5.2.0

## @comet/cms-admin@5.2.0

### Minor Changes

-   0bed4e7: Improve the `SaveConflictDialog`

    -   extend the text in the dialog to explain
        -   what happened
        -   what the next steps are
        -   what can be done to avoid conflicts
    -   make the button labels more precise
    -   once the save dialog is closed
        -   stop polling
        -   mark the save button red and with an error icon

- 0bed4e7: `useSaveConflict()`, `useSaveConflictQuery()` and
`useFormSaveConflict()` now return a `hasConflict` prop

    If `hasConflict` is true, a save conflict has been detected.
You should pass `hasConflict` on to `SaveButton`, `FinalFormSaveButton`
or `FinalFormSaveSplitButton`. The button will then display a "conflict"
state.

- 0bed4e7: Admin Generator: In the generated form, the `hasConflict`
prop is passed from the `useFormSaveConflict()` hook to the
`FinalFormSaveSplitButton`

- 6fda5a5: CRUD Generator: Change the file ending of the private
sibling GraphQL files from `.gql.tsx` to `.gql.ts`

    The GraphQL files do not contain JSX.
    Regenerate the files to apply this change to a project.

### Patch Changes

-   Updated dependencies [25daac0]
-   Updated dependencies [0bed4e7]
-   Updated dependencies [9fc7d47]
-   Updated dependencies [3702bb2]
-   Updated dependencies [824ea66]
    -   @comet/admin@5.2.0
    -   @comet/admin-icons@5.2.0
    -   @comet/blocks-admin@5.2.0
    -   @comet/admin-date-time@5.2.0
    -   @comet/admin-rte@5.2.0
    -   @comet/admin-theme@5.2.0

## @comet/cms-api@5.2.0

### Minor Changes

- bbc0a0a: Add access logging to log information about the request to
standard output. The log contains information about the requester and
the request itself. This can be useful for fulfilling legal requirements
regarding data integrity or for forensics.

    There are two ways to integrate logging into an application:

    **First option: Use the default implementation**

    ```ts
    imports: [
        ...
        AccessLogModule,
        ...
    ]
    ```

    **Second option: Configure logging**

Use the `shouldLogRequest` to prevent logging for specific requests. For
instance, one may filter requests for system users.

    ```ts
    imports: [
        ...
        AccessLogModule.forRoot({
            shouldLogRequest: ({user, req}) => {
                // do something
                return true; //or false
            },
        }),
        ...
    ]
    ```

More information can be found in the documentation under 'Authentication
> Access Logging'.

### Patch Changes

- 1a170b9: API Generator: Use correct type for `where` when
`getFindCondition` service method is not used
- 6b240a0: CRUD Generator: Correctly support `type: "text"` fields in
input
    -   @comet/blocks-api@5.2.0

## @comet/cms-site@5.2.0

### Minor Changes

- 6244d6c: Add the `YouTubeVideoBlock` to the `@comet/cms-site`
package.

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

### Patch Changes

-   Updated dependencies [25daac0]
-   Updated dependencies [0bed4e7]
-   Updated dependencies [9fc7d47]
    -   @comet/admin@5.2.0
    -   @comet/admin-icons@5.2.0

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

### Patch Changes

-   Updated dependencies [25daac0]
-   Updated dependencies [0bed4e7]
-   Updated dependencies [9fc7d47]
    -   @comet/admin@5.2.0
    -   @comet/admin-icons@5.2.0

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

### Patch Changes

-   Updated dependencies [25daac0]
-   Updated dependencies [0bed4e7]
    -   @comet/admin@5.2.0

## @comet/admin-rte@5.2.0

### Patch Changes

-   Updated dependencies [9fc7d47]
    -   @comet/admin-icons@5.2.0

## @comet/admin-theme@5.2.0

### Patch Changes

-   Updated dependencies [9fc7d47]
    -   @comet/admin-icons@5.2.0

## @comet/eslint-config@5.2.0

### Patch Changes

-   @comet/eslint-plugin@5.2.0

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



## @comet/blocks-api@5.2.0



## @comet/cli@5.2.0



## @comet/eslint-plugin@5.2.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
thomasdax98 and others added 22 commits December 13, 2023 10:15
Consider filtered mimetypes when calculating the position of a DAM item
in `DamItemsService`'s `getDamItemPosition()`

Previously, the mimetypes were ignored, sometimes resulting in an
incorrect position.
CRUD Generator: Add support for `ArrayType` fields in generated input
…1511)

Removes tight coupling between `PageTreeModule` and `BlocksModule`.
Allows projects that use blocks but have no page tree.
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
…ath with params that is not a sub route (#1443)

Co-authored-by: Thomas Dax <thomas.dax@vivid-planet.com>
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
Previously, **all files were downloaded and uploaded again when copying
within the same environment**.

This bug is caused because our deployed projects use the CDN URL for the
fileUrl and the API URL doesn't match the CDN URL
… sort (#1492)

Fixes test added in #1491
(although differently)

---------

Co-authored-by: Johannes Obermair <johannes.obermair@vivid-planet.com>
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
- Fix broken icons 
- Deprecate colored state icons because we don't support that. They were
added accidentally.
Allows specifying custom block categories in application code.
The `FieldSet` component is intended for better structuring of big forms. It allows the user to show and hide sections of related content on a page.

---------

Co-authored-by: Thomas Dax <thomas.dax@vivid-planet.com>
Nullable child blocks are not correctly supported in the Admin, for
instance, in `createCompositeBlock`. Save a block's default values
instead.
… in `Field` (#1500)

Previously, the `meta` argument was passed to these methods incorrectly. Now, the argument is passed as defined by the typing.
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@5.3.0

### Minor Changes

- 60cc1b2: Add `FieldSet` component with accordion behavior for better
structuring of big forms.

### Patch Changes

- a677a16: Fix `RouterPromptHandler` to not show a prompt when
navigating to a path with params that is not a sub route

- 5435b27: Fix `shouldScrollTo()`, `shouldShowError()` and
`shouldShowWarning()` in `Field`

Previously, the `meta` argument was passed to these methods incorrectly.
Now, the argument is passed as defined by the typing.

-   Updated dependencies [0ff9b9b]

-   Updated dependencies [0ff9b9b]
    -   @comet/admin-icons@5.3.0

## @comet/admin-icons@5.3.0

### Minor Changes

- 0ff9b9b: Deprecate icons `StateGreen`, `StateGreenRing`,
`StateOrange`, `StateOrangeRing`, `StateRed`, and `StateRedRing`,

### Patch Changes

-   0ff9b9b: Fix various icons

Since version 5.2.0 several icons were not displayed correctly. This
problem has been fixed.

## @comet/blocks-admin@5.3.0

### Minor Changes

-   a227388: Add support for custom block categories

    Allows specifying custom block categories in application code.

    **Example:**

    In `src/common/blocks/customBlockCategories.tsx`:

    ```tsx
import { BlockCategory, CustomBlockCategory } from
"@comet/blocks-admin";
    import React from "react";
    import { FormattedMessage } from "react-intl";

    const productsBlockCategory: CustomBlockCategory = {
        id: "Products",
label: <FormattedMessage id="blocks.category.products"
defaultMessage="Products" />,
        // Specify where category will be shown in drawer
        insertBefore: BlockCategory.Teaser,
    };

    export { productsBlockCategory };
    ```

    In `src/documents/pages/blocks/MyBlock.tsx`:

    ```tsx
import { productsBlockCategory } from
"@src/common/blocks/customBlockCategories";

    const MyBlock: BlockInterface = {
        category: productsBlockCategory,
        ...
    };
    ```

### Patch Changes

-   Updated dependencies [0ff9b9b]
-   Updated dependencies [0ff9b9b]
-   Updated dependencies [a677a16]
-   Updated dependencies [60cc1b2]
-   Updated dependencies [5435b27]
    -   @comet/admin-icons@5.3.0
    -   @comet/admin@5.3.0

## @comet/blocks-api@5.3.0

### Minor Changes

-   920f2b8: Deprecate `nullable: true` for child blocks

Nullable child blocks are not correctly supported in the Admin, for
instance, in `createCompositeBlock`.
    Save a block's default values instead.

## @comet/cms-api@5.3.0

### Minor Changes

- 570fdbc: CRUD Generator: Add support for `ArrayType` fields in
generated input
-   8d0e3ee: CRUD Generator: Add support for enum arrays in input

### Patch Changes

- dfb3c84: CRUD Generator: Correctly support `type: "text"` fields in
filter and sort

- c883d35: Consider filtered mimetypes when calculating the position of
a DAM item in `DamItemsService`'s `getDamItemPosition()`

Previously, the mimetypes were ignored, sometimes resulting in an
incorrect position.

-   Updated dependencies [920f2b8]
    -   @comet/blocks-api@5.3.0

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

### Patch Changes

-   Updated dependencies [0ff9b9b]
-   Updated dependencies [0ff9b9b]
-   Updated dependencies [a677a16]
-   Updated dependencies [60cc1b2]
-   Updated dependencies [5435b27]
    -   @comet/admin-icons@5.3.0
    -   @comet/admin@5.3.0

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

### Patch Changes

-   Updated dependencies [0ff9b9b]
-   Updated dependencies [0ff9b9b]
-   Updated dependencies [a677a16]
-   Updated dependencies [60cc1b2]
-   Updated dependencies [5435b27]
    -   @comet/admin-icons@5.3.0
    -   @comet/admin@5.3.0

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

### Patch Changes

-   Updated dependencies [a677a16]
-   Updated dependencies [60cc1b2]
-   Updated dependencies [5435b27]
    -   @comet/admin@5.3.0

## @comet/admin-rte@5.3.0

### Patch Changes

-   Updated dependencies [0ff9b9b]
-   Updated dependencies [0ff9b9b]
    -   @comet/admin-icons@5.3.0

## @comet/admin-theme@5.3.0

### Patch Changes

-   Updated dependencies [0ff9b9b]
-   Updated dependencies [0ff9b9b]
    -   @comet/admin-icons@5.3.0

## @comet/cms-admin@5.3.0

### Patch Changes

- 0fdf4ea: Always use the `/preview` file URLs in the admin application

This is achieved by setting the `x-preview-dam-urls` in the
`includeInvisibleContentContext`.

This fixes a page copy bug where all files were downloaded and uploaded
again, even when copying within the same environment.

-   Updated dependencies [0ff9b9b]

-   Updated dependencies [0ff9b9b]

-   Updated dependencies [a677a16]

-   Updated dependencies [60cc1b2]

-   Updated dependencies [5435b27]

-   Updated dependencies [a227388]
    -   @comet/admin-icons@5.3.0
    -   @comet/admin@5.3.0
    -   @comet/blocks-admin@5.3.0
    -   @comet/admin-date-time@5.3.0
    -   @comet/admin-rte@5.3.0
    -   @comet/admin-theme@5.3.0

## @comet/eslint-config@5.3.0

### Patch Changes

-   @comet/eslint-plugin@5.3.0

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



## @comet/cli@5.3.0



## @comet/eslint-plugin@5.3.0



## @comet/cms-site@5.3.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Showcase how public upload fixtures (e.g., for uploaded profile
pictures) could be implemented in an application.
The helper can be used to conditionally render a `RichTextBlock`.
Make all DAM license fields optional if `LicenseType` is `ROYALTY_FREE`
even if `requireLicense` is true in `DamConfig`.

Closes COM-250
---------

Co-authored-by: Ricky James Smith <jamesricky@me.com>
Co-authored-by: Thomas Dax <thomas.dax@vivid-planet.com>
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
## Problem:

Our fixtures are currently broken. You always get this error when
executing them:

<img width="573" alt="Bildschirmfoto 2023-12-14 um 17 02 52"
src="https://github.com/vivid-planet/comet/assets/13380047/ce7eed3c-5834-4618-8ced-ec93875c71ca">


The problem is that a required `userGroup` field is added to
`PageTreeNode` in Demo:


https://github.com/vivid-planet/comet/blob/99e0c57cc8ef542befd74d5b8ad9cf71058570e1/demo/api/src/page-tree/entities/page-tree-node.entity.ts#L26-L28


https://github.com/vivid-planet/comet/blob/1c098e4d0f23946c0fd543856c8f0aa897b83b82/demo/api/src/page-tree/dto/page-tree-node.input.ts#L7-L12

We don't provide a userGroup in the fixtures and it didn't strike
because the typing of `PageTreeService.createNode()` is wrong. The input
is typed with `PageTreeNodeBaseCreateInput`


https://github.com/vivid-planet/comet/blob/b73eb4c34c70c694fc8b267ce330af5959c50e7b/packages/api/cms-api/src/page-tree/page-tree.service.ts#L33

but the actual input type can be defined in the application and is
passed to the resolver via a factory:


https://github.com/vivid-planet/comet/blob/46bced34cbb9ec02de6dd462bd9111a6be7898b7/packages/api/cms-api/src/page-tree/createPageTreeResolver.ts#L35

### -> So actually the typing in the `PageTreeService` is wrong and we
need to fix that

I now circumvented this by using ts-ignore. 
But I think we need a solution to get the typing right. I'm however not
sure what the best way to do this is.
Special characters in names of uploaded files weren't properly decoded.
This led to a wrong result during slugification.
Move the soft-hyphen functionality from `@comet/cms-admin` to
`@comet/admin-rte`. This allows using the soft-hyphen functionality in
plain RTEs, and not only in `RichTextBlock`.

---------

Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
johnnyomair
johnnyomair previously approved these changes Jan 3, 2024
@johnnyomair johnnyomair changed the title Merge main Merge main into feature/translation-module Jan 3, 2024
@johnnyomair johnnyomair dismissed their stale review January 3, 2024 15:52

There should be an extra branch for this?

@johnnyomair johnnyomair merged commit eaf2abe into feature/translation-module Jan 4, 2024
41 of 43 checks passed
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.