-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update AG Grid Integration and Documentation for Fusion Framework (#2802
) * feat: enhance AG Grid module with detailed documentation, refactor dependencies, and add theme customization functionality * feat: add new AG Grid integration package for Fusion Framework React with installation and configuration instructions * feat: update AG Grid integration to use @equinor/fusion-framework-react-ag-grid, modify imports, and add app manifest configuration * chore: update lock file
- Loading branch information
Showing
24 changed files
with
2,516 additions
and
1,116 deletions.
There are no files selected for viewing
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,19 @@ | ||
--- | ||
'@equinor/fusion-framework-module-ag-grid': patch | ||
--- | ||
|
||
--- | ||
|
||
## "@equinor/fusion-framework-module-ag-grid": patch | ||
|
||
**@equinor/fusion-framework-module-ag-grid:** | ||
|
||
- Updated `README.md` with detailed documentation for the AG Grid React for Fusion Framework, including installation, configuration, theming, customizing a grid instance, and upgrading from version 32 to 33. | ||
- Refactor: `package.json` to include peer dependencies for `ag-grid-community` and `ag-grid-enterprise`. | ||
- Fixed: `AgGridConfigurator` class to setting the license key on initialization. | ||
- Refactor: import statements to use `ag-grid-enterprise` and `ag-grid-community`. | ||
- Feature: Added `createThemeFromExistingTheme` function to decontruct an existing theme and create a new theme _(AG-Grid type checks with `instanceof` which will break since the parent scope has another instance than the consumer)._ | ||
|
||
We have chose to only `patch` this release, to conform with the AG Grid versioning scheme, event tho there are some breaking changes. This is because the breaking changes are not related to the API of the module itself, but rather to the dependencies of the module. | ||
|
||
- `@equinor/fusion-framework-module-ag-grid/enterprise` and `@equinor/fusion-framework-module-ag-grid/community` have been removed. Instead, the module now relies on the `ag-grid-enterprise` and `ag-grid-community` packages as peer dependencies. This means that you will have to install these packages yourself. |
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,32 @@ | ||
--- | ||
"@equinor/fusion-framework-react-ag-grid": major | ||
--- | ||
|
||
Created a new package for AG Grid integration with Fusion Framework React. | ||
This package is a wrapper for `ag-grid-react`, `ag-grid-community` and `ag-grid-enterprise` packages. | ||
|
||
## Features | ||
|
||
- Consolidated AG Grid dependencies into a single package. | ||
- Method for enabling Fusion Framework AG Grid module | ||
- Utilities for extending Fusion themes | ||
|
||
## Getting started | ||
|
||
To install the package, run: | ||
|
||
```sh | ||
pnpm i @equinor/fusion-framework-react-ag-grid | ||
``` | ||
|
||
To enable the AG Grid module, add the following to your `config.ts`: | ||
|
||
```ts | ||
import { enableAgGrid } from '@equinor/fusion-framework-react-ag-grid'; | ||
|
||
const configure = (config: Config) => { | ||
enableAgGrid(config); | ||
}; | ||
``` | ||
|
||
See more in [packages/react/ag-grid/README.md](https://github.com/equinor/fusion-framework/blob/main/packages/react/ag-grid/README.md) |
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,14 @@ | ||
--- | ||
'@equinor/fusion-framework-cookbook-app-react-ag-grid': patch | ||
--- | ||
|
||
--- | ||
|
||
## "@equinor/fusion-framework-cookbook-app-react-ag-grid": patch | ||
|
||
Updated the package to use `@equinor/fusion-framework-react-ag-grid` instead of `@equinor/fusion-framework-module-ag-grid`. | ||
|
||
- Replaced `@equinor/fusion-framework-module-ag-grid` with `@equinor/fusion-framework-react-ag-grid` in `package.json`. | ||
- Updated imports in `App.tsx` and `config.ts` to use `@equinor/fusion-framework-react-ag-grid`. | ||
- Modified `tsconfig.json` to use `react-jsx` instead of `react-jsxdev`. | ||
- Added `app.manifest.config.ts` to define the app manifest. |
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,3 @@ | ||
import { defineAppManifest } from '@equinor/fusion-framework-cli'; | ||
|
||
export default defineAppManifest(async () => ({ appKey: 'cookbook-ag-grid' })); |
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
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
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
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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
export * from './AgGridConfigurator'; | ||
export * from './AgGridProvider'; | ||
export * from './module'; | ||
export { default } from './module'; | ||
export { AgGridConfigurator } from './AgGridConfigurator'; | ||
export { AgGridProvider, type IAgGridProvider } from './AgGridProvider'; | ||
export { | ||
enableAgGrid, | ||
type AgGridModule, | ||
type AgGridBuilderCallback, | ||
module as default, | ||
} from './module'; |
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 |
---|---|---|
@@ -1,9 +1,44 @@ | ||
import { type Theme, themeAlpine, createTheme } from './community'; | ||
import { type Theme, themeAlpine, createTheme, createPart } from 'ag-grid-community'; | ||
|
||
export const fusionTheme: Theme = themeAlpine.withParams({ | ||
fontFamily: 'Equinor, sans-serif', | ||
accentColor: '#00A2FF', | ||
backgroundColor: '#21222C', | ||
borderColor: '#429356', | ||
borderRadius: 0, | ||
browserColorScheme: 'dark', | ||
cellHorizontalPaddingScale: 0.8, | ||
cellTextColor: '#50F178', | ||
columnBorder: true, | ||
fontSize: 12, | ||
foregroundColor: '#68FF8E', | ||
headerBackgroundColor: '#21222C', | ||
headerFontSize: 14, | ||
headerFontWeight: 700, | ||
headerTextColor: '#68FF8E', | ||
headerVerticalPaddingScale: 1.5, | ||
oddRowBackgroundColor: '#21222C', | ||
rangeSelectionBackgroundColor: '#FFFF0020', | ||
rangeSelectionBorderColor: 'yellow', | ||
rangeSelectionBorderStyle: 'dashed', | ||
rowBorder: true, | ||
rowVerticalPaddingScale: 1.5, | ||
sidePanelBorder: true, | ||
spacing: 4, | ||
wrapperBorder: true, | ||
wrapperBorderRadius: 0, | ||
}); | ||
|
||
export const createThemeFromTheme = (theme: Theme): Theme => { | ||
const newTheme = createTheme(); | ||
if ('parts' in theme && Array.isArray(theme.parts)) { | ||
for (const part of theme.parts) { | ||
newTheme.withPart(createPart(part)); | ||
} | ||
} | ||
return newTheme; | ||
}; | ||
|
||
export { createTheme, type Theme }; | ||
|
||
export default { fusionTheme }; |
Oops, something went wrong.