fix: replace old config schemas for extensions and blueprints

to overcome a lot of warnings given during for example testing where
these extensions are used.

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
This commit is contained in:
Hellgren Heikki
2026-04-15 10:54:23 +03:00
parent a321fc0c47
commit cad156e797
47 changed files with 332 additions and 285 deletions
+3 -3
View File
@@ -818,18 +818,18 @@ const appPlugin: OverridableFrontendPlugin<
config: {
transientTimeoutMs: number;
anchorOrigin: {
horizontal: 'center' | 'left' | 'right';
vertical: 'top' | 'bottom';
horizontal: 'center' | 'left' | 'right';
};
};
configInput: {
transientTimeoutMs?: number | undefined;
anchorOrigin?:
| {
horizontal?: 'center' | 'left' | 'right' | undefined;
vertical?: 'top' | 'bottom' | undefined;
horizontal?: 'center' | 'left' | 'right' | undefined;
}
| undefined;
transientTimeoutMs?: number | undefined;
};
output: ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>;
inputs: {};
+1 -1
View File
@@ -18,7 +18,7 @@
import { AppLanguageSelector } from '../../../../packages/core-app-api/src/apis/implementations/AppLanguageApi';
import { appLanguageApiRef } from '@backstage/frontend-plugin-api';
import { ApiBlueprint } from '@backstage/frontend-plugin-api';
import { z } from 'zod';
import { z } from 'zod/v4';
export const AppLanguageApi = ApiBlueprint.makeWithOverrides({
name: 'app-language',
+10 -12
View File
@@ -14,6 +14,7 @@
* limitations under the License.
*/
import { z } from 'zod/v4';
import {
createExtension,
coreExtensionData,
@@ -32,18 +33,15 @@ export const AppRoutes = createExtension({
coreExtensionData.reactElement,
]),
},
config: {
schema: {
redirects: z =>
z
.array(
z.object({
from: z.string(),
to: z.string(),
}),
)
.optional(),
},
configSchema: {
redirects: z
.array(
z.object({
from: z.string(),
to: z.string(),
}),
)
.optional(),
},
output: [coreExtensionData.reactElement],
factory({ inputs, config }) {
+12 -11
View File
@@ -16,6 +16,7 @@
import { OAuthRequestDialog } from '@backstage/core-components';
import { AppRootElementBlueprint } from '@backstage/frontend-plugin-api';
import { z } from 'zod/v4';
import { ToastDisplay } from '../components/Toast';
export const oauthRequestDialogAppRootElement = AppRootElementBlueprint.make({
@@ -28,17 +29,17 @@ export const oauthRequestDialogAppRootElement = AppRootElementBlueprint.make({
export const alertDisplayAppRootElement =
AppRootElementBlueprint.makeWithOverrides({
name: 'alert-display',
config: {
schema: {
transientTimeoutMs: z => z.number().default(5000),
anchorOrigin: z =>
z
.object({
vertical: z.enum(['top', 'bottom']).default('top'),
horizontal: z.enum(['left', 'center', 'right']).default('center'),
})
.default({}),
},
configSchema: {
transientTimeoutMs: z.number().default(5000),
anchorOrigin: z
.object({
vertical: z.enum(['top', 'bottom']).default('top'),
horizontal: z.enum(['left', 'center', 'right']).default('center'),
})
.default({
vertical: 'top',
horizontal: 'center',
}),
},
factory: (originalFactory, { config }) => {
return originalFactory({