-
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 #1627 from vivid-planet/merge-next-into-feature-re…
…factor-admin-component-theming Merge `next` into `feature/refactor-admin-component-theming`
- Loading branch information
Showing
229 changed files
with
3,067 additions
and
2,498 deletions.
There are no files selected for viewing
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/admin": minor | ||
--- | ||
|
||
Add `helperText` prop to `Field` and `FieldContainer` to provide additional information |
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,43 @@ | ||
--- | ||
"@comet/cms-admin": major | ||
--- | ||
|
||
Make sites config generic | ||
|
||
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], | ||
``` |
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 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,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. | ||
|
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -4,3 +4,7 @@ addReviewers: true | |
|
||
reviewers: | ||
- johnnyomair | ||
|
||
skipKeywords: | ||
- Merge main into next | ||
- Version Packages |
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
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
Oops, something went wrong.