From bc1d341fe8ef3961645fc69ac9ed80c59d3f2af0 Mon Sep 17 00:00:00 2001 From: Trevor Tabah Date: Thu, 20 Jun 2024 10:05:07 -0400 Subject: [PATCH] fix: fix problems that occured during cherry-pick #10734 --- .../kbn-ui-shared-deps-npm/webpack.config.js | 1 + src/core/public/i18n/i18n_eui_mapping.tsx | 19 +++++++ src/core/server/core_app/core_app.ts | 53 +++---------------- 3 files changed, 27 insertions(+), 46 deletions(-) diff --git a/packages/kbn-ui-shared-deps-npm/webpack.config.js b/packages/kbn-ui-shared-deps-npm/webpack.config.js index 2a9333dcbdff0..2224c25c7f45f 100644 --- a/packages/kbn-ui-shared-deps-npm/webpack.config.js +++ b/packages/kbn-ui-shared-deps-npm/webpack.config.js @@ -99,6 +99,7 @@ module.exports = (_, argv) => { ], 'kbn-ui-shared-deps-npm.v7.dark': ['@elastic/eui/dist/eui_theme_dark.css'], 'kbn-ui-shared-deps-npm.v7.light': ['@elastic/eui/dist/eui_theme_light.css'], + 'kbn-ui-shared-deps-npm.v7.makila.light': ['@elastic/eui/dist/eui_theme_makila_light.css'], 'kbn-ui-shared-deps-npm.v8.dark': ['@elastic/eui/dist/eui_theme_amsterdam_dark.css'], 'kbn-ui-shared-deps-npm.v8.light': ['@elastic/eui/dist/eui_theme_amsterdam_light.css'], }, diff --git a/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index 265fca2289ea6..fa7aad081e413 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -1183,6 +1183,25 @@ export const getEuiContextMapping = (): EuiTokensObject => { defaultMessage: 'You can quickly navigate this list using arrow keys.', } ), + 'euiNotificationEventReadIcon.read': i18n.translate('core.euiNotificationEventReadIcon.read', { + defaultMessage: 'Read', + }), + 'euiNotificationEventReadIcon.readAria': ({ eventName }: EuiValues) => + i18n.translate('core.euiNotificationEventReadIcon.readAria', { + defaultMessage: '{eventName} is read', + values: { eventName }, + }), + 'euiNotificationEventReadIcon.unread': i18n.translate( + 'core.euiNotificationEventReadIcon.unread', + { + defaultMessage: 'Unread', + } + ), + 'euiNotificationEventReadIcon.unreadAria': ({ eventName }: EuiValues) => + i18n.translate('core.euiNotificationEventReadIcon.unreadAria', { + defaultMessage: '{eventName} is unread', + values: { eventName }, + }), 'euiMakila.datePicker.euiDatePopoverContent.now.infos': i18n.translate( 'core.euiMakila.datePicker.euiDatePopoverContent.now.infos', { diff --git a/src/core/server/core_app/core_app.ts b/src/core/server/core_app/core_app.ts index 85abfd3eb134a..176b93b36d8fd 100644 --- a/src/core/server/core_app/core_app.ts +++ b/src/core/server/core_app/core_app.ts @@ -100,52 +100,13 @@ export class CoreApp { }); }); - // remove trailing slash catch-all - router.get( - { - path: '/{path*}', - validate: { - params: schema.object({ - path: schema.maybe(schema.string()), - }), - query: schema.maybe(schema.recordOf(schema.string(), schema.any())), - }, - }, - async (context, req, res) => { - const { query, params } = req; - const { path } = params; - if (!path || !path.endsWith('/') || path.startsWith('/')) { - return res.notFound(); - } - - const basePath = httpSetup.basePath.get(req); - let rewrittenPath = path.slice(0, -1); - if (`/${path}`.startsWith(basePath)) { - rewrittenPath = rewrittenPath.substring(basePath.length); - } - - const querystring = query ? stringify(query) : undefined; - const url = `${basePath}/${encodeURIComponent(rewrittenPath)}${ - querystring ? `?${querystring}` : '' - }`; - - return res.redirected({ - headers: { - location: url, - }, - }); - } - ); - - router.get({ path: '/core', validate: false }, async (context, req, res) => - res.ok({ body: { version: '0.0.1' } }) - ); - - // registerBundleRoutes({ - // router, - // uiPlugins, - // onResourceNotFound: async (req, res) => res.notFound(), - // }); + this.registerCommonDefaultRoutes({ + basePath: coreSetup.http.basePath, + httpResources: resources, + router, + uiPlugins, + onResourceNotFound: async (req, res) => res.notFound(), + }); resources.register( {