feat: improve handling of config to allow overrides
This commit is contained in:
@@ -12,3 +12,11 @@ The code is in `remix` folder.
|
||||
## Custom RTE field
|
||||
|
||||
The code is in `rte` folder.
|
||||
|
||||
### Configuration
|
||||
|
||||
The RTE plugin has the following configuration available. The values should be set on App Config level and overriden when needed on Plugin Config level.
|
||||
|
||||
- `baseUrl`: The base url for Contentstack, most likely `https://eu-app.contentstack.com/`
|
||||
- `formatId`: The id for the format in ImageVault to use when selecting an asset in ImageVault
|
||||
- `imageVaultUrl`: The URL to the ImageVault instance to use when selecting an asset.
|
||||
|
||||
12
rte/main.tsx
12
rte/main.tsx
@@ -181,7 +181,17 @@ async function init() {
|
||||
const savedSelection = rte?.selection?.get() ?? undefined;
|
||||
|
||||
// @ts-expect-error: Added at runtime
|
||||
const config = await rte.getConfig();
|
||||
const appConfig = await rte.getConfig();
|
||||
|
||||
// This is the configuration for this instance of the plugin.
|
||||
// You edit this in the content types settings RTE plugin section.
|
||||
// @ts-expect-error: Added at runtime
|
||||
const pluginConfig = await rte.getFieldConfig();
|
||||
|
||||
const config = {
|
||||
...appConfig,
|
||||
...pluginConfig,
|
||||
};
|
||||
|
||||
openImageVault({
|
||||
config,
|
||||
|
||||
Reference in New Issue
Block a user