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 next into main for v6 Release #1628

Merged
merged 131 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 128 commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
b067a85
Configure admin-routes and -menu in single data-structure
fraxachun Sep 12, 2023
2fb073a
Update naming and don't use hooks when they're not possible
fraxachun Sep 13, 2023
c7f0365
Restructure Route-Menu in demo
fraxachun Sep 13, 2023
f559fe6
Support recursive Route-Menu
fraxachun Sep 14, 2023
2cb6d74
Rename function according to type
fraxachun Sep 14, 2023
0f814c5
Add changeset
fraxachun Sep 15, 2023
ff5dfb5
Move stateless code out of component
fraxachun Oct 4, 2023
7a9d18f
Add Master-Component which wraps MasterLayout, Menu and Routes
fraxachun Oct 6, 2023
c44d1a0
Move only relevant Components to cms-admin
fraxachun Oct 11, 2023
c99836a
Fix rebase error
fraxachun Oct 11, 2023
6c1ba31
Fix react warning
fraxachun Oct 11, 2023
b239d47
Avoid anonymous default exports
fraxachun Oct 23, 2023
645a0a2
Don't uppercase letter after sub-prefix
fraxachun Oct 23, 2023
7fcb0ef
Update .changeset/dirty-trees-burn.md
fraxachun Oct 23, 2023
f2988c6
Merge pull request #1262 from vivid-planet/admin-menu-routes
fraxachun Oct 23, 2023
e82b4c5
Use DI for CurrentUserLoader (#1330)
fraxachun Oct 30, 2023
b3ceaef
Migrate ContentScope-Module to UserPermissionsModule
fraxachun Oct 13, 2023
57a3eb0
Remove unnecessary constant-provider
fraxachun Oct 25, 2023
28c66e7
Use classes when instantiating UserPermissions-module
fraxachun Oct 25, 2023
be73045
Remove typo
fraxachun Oct 30, 2023
a036405
Exporting UserPermissionsCurrentUserLoader is not necessary anymore
fraxachun Nov 2, 2023
e5a35ae
Clean up module naming
fraxachun Nov 2, 2023
bd54fb4
Merge pull request #1331 from vivid-planet/user-permissions-content-s…
fraxachun Nov 15, 2023
d00a6eb
Remove role- and rights-fields from CurrentUser
fraxachun Nov 2, 2023
1b6d23e
Merge pull request #1356 from vivid-planet/user-permissions-remove-role
fraxachun Nov 15, 2023
e81609e
Move calculating permissions to AccessControlService
fraxachun Nov 7, 2023
08224ca
Merge pull request #1380 from vivid-planet/user-permissions-access-co…
fraxachun Nov 15, 2023
dc2de24
Remove domains from CurrentUser
fraxachun Nov 9, 2023
dee1c4d
Make AccessControlService mandatory in UserPermissionsModule-configur…
fraxachun Nov 15, 2023
c443140
Merge pull request #1358 from vivid-planet/user-permissions-domains
fraxachun Nov 20, 2023
27d1a2d
Merge pull request #1412 from vivid-planet/merge-main-into-next
johnnyomair Nov 21, 2023
ae124a6
Use Next.JS Site-Preview mode
fraxachun Aug 23, 2023
8d52a23
Rename resolvers for SitePreview
fraxachun Oct 9, 2023
03332c8
Use Provider only in preview-mode
fraxachun Oct 9, 2023
a7bdfb6
Update readme
fraxachun Oct 9, 2023
e182290
Revert AuthModule
fraxachun Oct 9, 2023
3a56f11
Add changeset
fraxachun Oct 9, 2023
8ff0c41
Remove not needed type
fraxachun Oct 10, 2023
9616484
Update readme for preview
fraxachun Oct 10, 2023
e72de1d
Remove cms-site/Link as now next-link can be used
fraxachun Oct 10, 2023
73e0f38
Use own resolver for SitePreview
fraxachun Oct 10, 2023
bdde3e2
Require setting secret for SitePreview-Hash
fraxachun Oct 10, 2023
02d61e2
Make type definition more logical
fraxachun Oct 10, 2023
b0c92c2
Use provider instead factory
fraxachun Oct 10, 2023
ffc2f3e
Use date-fns for better readability
fraxachun Oct 10, 2023
acaabea
Handle activating preview internally in SitePreviewProvider
fraxachun Oct 10, 2023
00d638b
Fix typo in import
fraxachun Oct 10, 2023
18d7b46
Renew schema
fraxachun Oct 11, 2023
2469ab7
Merge next into feature-brach
fraxachun Nov 21, 2023
5b1b3a2
Merge pull request #1418 from vivid-planet/user-permissions-merge-next
fraxachun Nov 21, 2023
5c453c3
Add useCurrentUser-hook
fraxachun Nov 2, 2023
ae331d8
Avoid using a hook
fraxachun Nov 13, 2023
160b98d
Throw error when useQuery fails
fraxachun Nov 13, 2023
e71d75e
Use existing CurrentUserInterace wherever possible
fraxachun Nov 13, 2023
7c5f626
Add loading to CurrentUserProvider
fraxachun Nov 15, 2023
451208f
Allow creating custom CurrentUserProvider
fraxachun Nov 21, 2023
9909f5f
Merge branch 'main' into next
invalid-email-address Nov 21, 2023
1ce11b8
Make CurrentUserContext a bit cleaner
fraxachun Nov 21, 2023
b6de17b
Merge pull request #1420 from vivid-planet/merge-main-into-next
johnnyomair Nov 22, 2023
76f3e2b
Allow passing isAllowed instead of creating own CurrentUserProvider
fraxachun Nov 22, 2023
d46b5fa
Throw error when CurrentUserContext is missing but requiredPermission…
fraxachun Nov 22, 2023
2a9f24a
Allow caching of CurrentUser-Query
fraxachun Nov 22, 2023
77d6675
Add enum for Permissions in admin
fraxachun Nov 22, 2023
c59d167
Rename SubjectEntity to AffectedEntity
fraxachun Nov 22, 2023
4d950a8
Update changeset
fraxachun Nov 22, 2023
82325bc
Remove unnecessary variable
fraxachun Nov 22, 2023
7e4f888
Merge pull request #1423 from vivid-planet/user-permissions-affected-…
fraxachun Nov 22, 2023
1d0bf6c
Merge pull request #1237 from vivid-planet/site-preview
fraxachun Nov 22, 2023
e9fe697
Revert "Add enum for Permissions in admin"
fraxachun Nov 23, 2023
bc5726f
Merge pull request #1360 from vivid-planet/user-permissions-hook
fraxachun Nov 23, 2023
eb4d602
Fix errors in currentUser query
fraxachun Nov 23, 2023
b59fed9
Merge pull request #1429 from vivid-planet/user-permissions-fix2
fraxachun Nov 23, 2023
2612f7c
Add RequiredPermission-decorator and enforce it by guard
fraxachun Nov 23, 2023
9a02222
Check scope only on request basis
fraxachun Nov 23, 2023
9501ef9
Align naming
fraxachun Nov 23, 2023
1e8a187
Merge branch 'main' into next
invalid-email-address Nov 28, 2023
4cc6bb6
Merge pull request #1421 from vivid-planet/merge-main-into-next
thomasdax98 Nov 28, 2023
22ac922
Merge pull request #1430 from vivid-planet/user-permissions-guard
fraxachun Nov 28, 2023
de8ec84
Merge branch 'main' into next
invalid-email-address Nov 29, 2023
a5032c5
Merge pull request #1457 from vivid-planet/merge-main-into-next
jamesricky Nov 29, 2023
47eb81c
Enable no-other-module-relative-import rule by default (#1453)
nsams Nov 29, 2023
3f1f1fd
Get args from controller for checking content scopes
fraxachun Dec 4, 2023
24675e3
Let generator add RequiredPermission-decorator (#1431)
fraxachun Dec 6, 2023
72f98c7
ESLint: Enable `import/newline-after-import` (#1501)
dkarnutsch Dec 11, 2023
084a7fa
Merge pull request #1432 from vivid-planet/user-permissions-multer
fraxachun Dec 12, 2023
406708c
Allow specifying requiredPermission as string oder array of strings
fraxachun Dec 6, 2023
a51f7bd
Merge pull request #1486 from vivid-planet/required-permission
fraxachun Dec 12, 2023
4ea10a7
Merge main into next
invalid-email-address Dec 14, 2023
0d76854
FinalForm: Don't handle sync submit differently than async submit (#1…
nsams Dec 14, 2023
61cba69
Resolve conflicts
johnnyomair Dec 14, 2023
fce5a9b
Merge pull request #1459 from vivid-planet/merge-main-into-next
thomasdax98 Dec 14, 2023
95df436
User permissions annotations (#1434)
fraxachun Dec 14, 2023
8ef440d
Merge branch 'main' into next
invalid-email-address Dec 18, 2023
8968cc4
Use JWT as SitePreview authorization (#1455)
fraxachun Dec 18, 2023
992b0a8
Merge pull request #1512 from vivid-planet/merge-main-into-next
thomasdax98 Dec 18, 2023
e4b6025
Re-add UserPermissions-Module (#1516)
fraxachun Dec 19, 2023
a3b0d3c
Merge branch 'next' into merge-next
fraxachun Dec 19, 2023
112b159
Merge pull request #1520 from vivid-planet/merge-next
fraxachun Dec 19, 2023
2eeb647
Merge pull request #1343 from vivid-planet/feature/user-permissions
fraxachun Dec 19, 2023
d20f59c
Enhance CronJob module (#1493)
dkarnutsch Dec 19, 2023
6fadde6
Merge branch 'main' into next
invalid-email-address Dec 19, 2023
298b63b
FinalForm: remove default `onAfterSubmit` implementation (#1446)
nsams Dec 19, 2023
0787562
Merge pull request #1522 from vivid-planet/merge-main-into-next
johnnyomair Dec 21, 2023
0880ca9
Merge main into next
invalid-email-address Dec 21, 2023
0200926
Fix conflicts
thomasdax98 Dec 22, 2023
a37ebde
Merge pull request #1528 from vivid-planet/merge-main-into-next
thomasdax98 Dec 22, 2023
a525766
Remove deprecated icons (#1529)
jomunker Jan 2, 2024
627c877
Merge main into next
invalid-email-address Jan 9, 2024
ead0135
Resolve conflicts
johnnyomair Jan 9, 2024
daa4b48
Merge pull request #1536 from vivid-planet/merge-main-into-next
thomasdax98 Jan 9, 2024
5ef25c1
Merge branch 'main' into next
invalid-email-address Jan 10, 2024
75a17f5
Merge pull request #1554 from vivid-planet/merge-main-into-next
johnnyomair Jan 10, 2024
65a16a7
Merge main into next
invalid-email-address Jan 10, 2024
ec382ca
Resolve conflicts
johnnyomair Jan 10, 2024
d829e2c
Merge pull request #1557 from vivid-planet/merge-main-into-next
thomasdax98 Jan 10, 2024
62bf8c6
Merge `core.js` and `core-without-import.js` ESLint configs (#1566)
johnnyomair Jan 15, 2024
6277912
Change the signatures of `shouldScrollToField`, `shouldShowFieldError…
thomasdax98 Jan 16, 2024
7dfa2bc
Merge main into next
invalid-email-address Jan 17, 2024
f8e8044
Fix conflicts
thomasdax98 Jan 17, 2024
e377111
Merge pull request #1564 from vivid-planet/merge-main-into-next
thomasdax98 Jan 17, 2024
fb52598
Move `comet-config.json` to `src/` folder (#1593)
johnnyomair Jan 18, 2024
d86d5a9
Make sites config generic (#1594)
johnnyomair Jan 23, 2024
03e6a77
Add support for anchor link items in `MasterMenu` (#1590)
lllHuber Jan 23, 2024
5df6093
Merge branch 'main' into next
invalid-email-address Jan 24, 2024
573845f
Merge pull request #1591 from vivid-planet/merge-main-into-next
johnnyomair Jan 24, 2024
8e86516
Revert Next.js Preview Mode (#1617)
fraxachun Jan 25, 2024
298da50
Allow setting Content Scopes for each permission (#1524)
fraxachun Jan 26, 2024
84e3e1f
Remove dynamic formatted message ids (#1622)
fraxachun Jan 26, 2024
fc8e475
Merge branch 'main' into next
invalid-email-address Jan 30, 2024
6f0fa5c
Merge pull request #1620 from vivid-planet/merge-main-into-next
thomasdax98 Jan 30, 2024
00c7cfd
Migration Guide for v6 (#1629)
thomasdax98 Jan 30, 2024
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
5 changes: 5 additions & 0 deletions .changeset/dirty-trees-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/cms-admin": minor
---

Add `MasterMenu` and `MasterMenuRoutes` components which both take a single data structure to define menu and routes.
thomasdax98 marked this conversation as resolved.
Show resolved Hide resolved
17 changes: 17 additions & 0 deletions .changeset/hungry-hornets-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@comet/cms-admin": major
"@comet/cms-api": major
---

Enhance CronJob module
thomasdax98 marked this conversation as resolved.
Show resolved Hide resolved

- Show latest job run on `CronJobsPage`
- Add option to manually trigger cron jobs to `CronJobsPage`
- Add subpage to `CronJobsPage` that shows all job runs

Warning: Only include this module if all your users should be able to trigger cron jobs manually or you have sufficient access control in place.

Includes the following breaking changes:

- Rename `JobStatus` to `KubernetesJobStatus` to avoid naming conflicts
- Rename `BuildRuntime` to `JobRuntime`
22 changes: 22 additions & 0 deletions .changeset/odd-paws-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
"@comet/admin": major
---

FinalForm: remove default `onAfterSubmit` implementation
thomasdax98 marked this conversation as resolved.
Show resolved Hide resolved

In most cases the default implementation is not needed anymore. When upgrading, an empty
function override of `onAfterSubmit` can be removed as it is not necessary any longer.

To get back the old behavior use the following in application code:

```
const stackApi = React.useContext(StackApiContext);
const editDialog = React.useContext(EditDialogApiContext);
....
<FinalForm
onAfterSubmit={() => {
stackApi?.goBack();
editDialog?.closeDialog({ delay: true });
}}
>
```
5 changes: 5 additions & 0 deletions .changeset/poor-boxes-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/admin-icons": major
---

Remove deprecated icons `Betrieb`, `Logische Filter`, `Pool`, `Pool 2`, `State Green`, `State Green Ring`, `State Orange`, `State Orange Ring`, `State Red`, `State Red Ring`, `Vignette 1` and `Vignette 2`.
thomasdax98 marked this conversation as resolved.
Show resolved Hide resolved
43 changes: 43 additions & 0 deletions .changeset/rich-crews-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
"@comet/cms-admin": major
---

Make sites config generic
thomasdax98 marked this conversation as resolved.
Show resolved Hide resolved

The sites config was previously assumed to be `Record<string, SiteConfg>`.
However, as the sites config is solely used in application code, it could be of any shape.
Therefore, the `SitesConfigProvider` and `useSitesConfig` are made generic.
The following changes have to be made in the application:

1. Define the type of your sites config

Preferably this should be done in `config.ts`:

```diff
export function createConfig() {
// ...

return {
...cometConfig,
apiUrl: environmentVariables.API_URL,
adminUrl: environmentVariables.ADMIN_URL,
+ sitesConfig: JSON.parse(environmentVariables.SITES_CONFIG) as SitesConfig,
};
}

+ export type SitesConfig = Record<string, SiteConfig>;
```

2. Use the type when using `useSitesConfig`

```diff
- const sitesConfig = useSitesConfig();
+ const sitesConfig = useSitesConfig<SitesConfig>();
```

3. Optional: Remove type annotation from `ContentScopeProvider#resolveSiteConfigForScope` (as it's now inferred)

```diff
- resolveSiteConfigForScope: (configs: Record<string, SiteConfig>, scope: ContentScope) => configs[scope.domain],
+ resolveSiteConfigForScope: (configs, scope: ContentScope) => configs[scope.domain],
```
5 changes: 5 additions & 0 deletions .changeset/sharp-readers-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/eslint-config": major
---

Enable `import/newline-after-import`
thomasdax98 marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions .changeset/six-wolves-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/admin": major
---

FinalForm: Don't handle sync submit differently than async submit
johnnyomair marked this conversation as resolved.
Show resolved Hide resolved
17 changes: 17 additions & 0 deletions .changeset/sixty-cobras-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@comet/cms-api": major
---

Replace ContentScopeModule with UserPermissionsModule
thomasdax98 marked this conversation as resolved.
Show resolved Hide resolved

Breaking changes:

- ContentScope-Module has been removed
- canAccessScope has been moved to AccessControlService and refactored into isAllowed
- contentScopes- and permissions-fields have been added to CurrentUser-Object
- role- and rights-fields has been removed from CurrentUser-Object
- AllowForRole-decorator has been removed
- Rename decorator SubjectEntity to AffectedEntity
- Add RequiredPermission-decorator and make it mandatory when using UserPermissionsModule

Upgrade-Guide: tbd
30 changes: 30 additions & 0 deletions .changeset/stale-wombats-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
"@comet/admin": major
---

Change the signatures of `shouldScrollToField`, `shouldShowFieldError` and `shouldShowFieldWarning` in `FinalFormContext` to match the corresponding methods in `Field`

The API in `FinalFormContext` was changed from

```tsx
// ❌
export interface FinalFormContext {
shouldScrollToField: ({ fieldMeta }: { fieldMeta: FieldMetaState<any> }) => boolean;
shouldShowFieldError: ({ fieldMeta }: { fieldMeta: FieldMetaState<any> }) => boolean;
shouldShowFieldWarning: ({ fieldMeta }: { fieldMeta: FieldMetaState<any> }) => boolean;
}
```

to

```tsx
// ✅
export interface FinalFormContext {
shouldScrollToField: (fieldMeta: FieldMetaState<any>) => boolean;
shouldShowFieldError: (fieldMeta: FieldMetaState<any>) => boolean;
shouldShowFieldWarning: (fieldMeta: FieldMetaState<any>) => boolean;
}
```

Now the corresponding methods in `Field` and `FinalFormContext` have the same signature.
johnnyomair marked this conversation as resolved.
Show resolved Hide resolved

5 changes: 5 additions & 0 deletions .changeset/unlucky-files-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/eslint-config": major
---

Enable no-other-module-relative-import rule by default
thomasdax98 marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions copy-schema-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const fs = require("fs");
fs.promises.copyFile("demo/api/block-meta.json", "demo/site/block-meta.json"),
fs.promises.copyFile("demo/api/schema.gql", "demo/admin/schema.gql"),
fs.promises.copyFile("demo/api/schema.gql", "demo/site/schema.gql"),
fs.promises.copyFile("demo/api/comet-config.json", "demo/site/comet-config.json"),
fs.promises.copyFile("demo/api/comet-config.json", "demo/admin/comet-config.json"),
fs.promises.copyFile("demo/api/src/comet-config.json", "demo/site/src/comet-config.json"),
fs.promises.copyFile("demo/api/src/comet-config.json", "demo/admin/src/comet-config.json"),
]);
})();
2 changes: 1 addition & 1 deletion demo/admin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ lang-compiled
graphql.generated.ts
block-meta.json
src/blocks.generated.ts
comet-config.json
src/comet-config.json
src/**/*.generated.ts
Loading
Loading