-
Notifications
You must be signed in to change notification settings - Fork 8
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 next into main #2347
Merged
Merged
Merge next into main #2347
Conversation
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
Merge main into next
…ndencies that get passed through recursivelyLoadBlockData into loader functions (#1936) Can be extended using module augmentation in application to inject e.g., pageTreeNodeId. Add pageTreeNodeId in demo, although there is no loader that actually uses it.
Merge main into next
Set `clearable` for Form `date` field when it is not required. --------- Co-authored-by: Ricky James Smith <[email protected]>
Continues work started in #1807 and add App Router compatible implementation. ### New APIs - `previewParams()`: simlar to nextjs's `draftMode()`, returns `scope` and `previewData` (contains if invisible items should be shown) - `sitePreviewRoute(req)`: - `SitePreviewParams` and `SitePreviewData`: types returned by `previewParams()` --------- Co-authored-by: Franz Unger <[email protected]> Co-authored-by: Johannes Obermair <[email protected]>
Merge main into next
#1930) This allows to use any query, also probably future API-generated additional queries. For now the developer needs to make sure gqlType-value and response-type of query do match. I didn't see a simple solution to enforce this with typescript types. maybe we should add some warnings/errors in future.
…dded in parent page component (#1937) And adjust demo Products Future. This is a major braking change, but we never released a stable version containing the future generator. ## Alternative we could add a configuration if the toolbar should be generated. But I think we usually should not do that as we always want to use the SaveBoundary.
This is handy to debug or update just a single generated file without touching the others. This will be rarely needed.
Previously demo site had some "ideas" of i18n support (localized content) but as there was only a single language configured this was not tested at all. New: - add multiple languages in admin + site (en + de) - port i18n config from pages router to app router (which is completely different, this i18n next.config.js doesn't exist anymore, instead it's a simple dynamic route, see [docs](https://nextjs.org/docs/app/building-your-application/routing/internationalization)) - all paths are now below a /de or /de with default redirect from / to /en --------- Co-authored-by: Thomas Dax <[email protected]> Co-authored-by: Johannes Obermair <[email protected]>
This PR adds the hover functionality for the collapsed menu. --------- Co-authored-by: Ricky James Smith <[email protected]> Co-authored-by: Johannes Obermair <[email protected]>
I believe this is a leftover from #1596.
It was added in API (transformToPlain) but not in Admin. Fixes dirty prompt after save where due to a reload the scope was added.
…ling the list query (#1971) Sometimes the list query is not needed because special queries are created in application code. --------- Co-authored-by: Johannes Obermair <[email protected]>
… prompt dialog (#1961) Fixes an issue where a form that doesn't unmount doesn't lose its state even when the user chooses "Discard" in the prompt dialog.
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 // news-link.block.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, }, }; } } ``` --- TODO - [x] Convert other library blocks to new technique - [x] Changeset - [x] Fix type issues - [x] Remove transform dependencies - [x] Refactor complicated `createAsyncTraverse` function - [x] Naming - [x] Migration Guide - [x] Support request-scoped services --- <!-- Everything below this line will be removed from the commit message when the PR is merged --> ## PR Checklist - [x] Verify if the change requires a changeset. See [CONTRIBUTING.md](https://github.com/vivid-planet/comet/blob/HEAD/CONTRIBUTING.md) - [x] Link to the respective task if one exists: COM-403 --------- Co-authored-by: Thomas Dax <[email protected]>
This fixes Demo site preview. With App Router i18n changed: - language is now part of the url also for site preview (before it was used from scope that passed to site) - before: resolvePath was only used for the siteLink shown in the Admin UI - now: resolvePath is also applied for the preview url opened in site - because of that we need 2 parameters: - `path` (called `initialPath` in local variable): the path preview is initially opened with, only parameter passed from `openSitePreviewWindow`: resolvePath is not called on this - `sitePath`: current path, updated from iframe: resolvePath is called on this see also inline comments
Allows generating grid with nested fields in grid using dot-notation.
…nu-rework Merge `next` into `feature/menu-rework`
Currently, the client also requires the SITE_PREVIEW_SECRET. As far as I understand it, however, this should only be required on the server side.
Implement updated design to also support usage on content without white a background.
…props (#2327) Add back the `multiple` prop and be a single-file select by default. Only allow selecting multiple files when either the `multiple` prop is set or when the `maxFiles` prop is set and has a value of more than `1`. Also simplify stories slightly for more common use cases.
[Feature] File select components
…ManyFilter` (#2238) This PR adds search filter to OneToMany and ManyToMany relations, that can be used where a select is impossible to use because of too many related entities. Doing a poor-mans fulltext search doesn't have this problem (also has poor performance on the server side though) The old method (how search was implemented for list queries) didn't apply here well, so I decided do go a different approach: Instead of generating code (the service) that lists all fields to query, we find those fields at runtime now. We are using (1) MikroORM metadata and (2) our CrudField resolver, the search boolean. Just as before. And with this new approach it is possible to do that also for related entities that makes implementing the search possible. --------- Co-authored-by: Johannes Obermair <[email protected]>
Covers the breaking change introduced in #2238.
…ertical variant (#2342)
…o initializer (#2324) Previously, the following property of an entity ```ts @Property({ type: types.date, nullable: true }) @field({ nullable: true }) availableSince?: Date; ``` resulted in the following input being generated: ```ts @isnullable() @isdate() @field({ nullable: true }) availableSince?: Date; ``` This was problematic for two reasons: 1. The error message would be misleading when trying to create an entity without providing a value for the property. For example, a valid GraphQL mutation ```graphql mutation CreateProduct { createProduct(input: { title: "A", slug: "A", description: "FOO" }) { id availableSince } } ``` would result in the following error: ``` "isDate": "availableSince must be a Date instance" ``` 2. Relying on the initializer as the default value is not obvious and appears somewhat magical. To address this, we now use `null` as the default value for nullable properties if no initializer is provided. If an initializer is provided, it is used as the default value. --------- Co-authored-by: Johannes Obermair <[email protected]>
The name "public uploads" was not fitting since the uploads can also be used for "private" uploads in the Admin. The feature was therefore renamed to "file uploads". This requires the following changes: - Use `FilesUploadModule` instead of `PublicUploadModule` - Use `FileUpload` instead of `PublicUpload` - Use `FileUploadsService` instead of `PublicUploadsService` - Change the upload URL from `/public-upload/files/upload` to `/files-uploads/upload` --------- Co-authored-by: Thomas Dax <[email protected]>
The `/file-uploads/upload` endpoint now requires the `fileUploads` permission by default. It can be made public by using the `upload.public` option: ```diff FileUploadsModule.register({ /* ... */, + upload: { + public: true, + }, }), ```
Merge main into next
…he `filePreview` prop (#2341)
- Update migration guide to include changes made since beta.0 - Remove unnecessary changesets that only document changes between beta versions
…ormFileSelect` (#2344)
johnnyomair
approved these changes
Jul 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Still waiting for the PRs in https://github.com/vivid-planet/comet/milestone/18