Skip to content

Commit

Permalink
fix: fix problems that occured during cherry-pick elastic#10734
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevor Tabah committed Jun 20, 2024
1 parent 7299109 commit bc1d341
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 46 deletions.
1 change: 1 addition & 0 deletions packages/kbn-ui-shared-deps-npm/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
},
Expand Down
19 changes: 19 additions & 0 deletions src/core/public/i18n/i18n_eui_mapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand Down
53 changes: 7 additions & 46 deletions src/core/server/core_app/core_app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down

0 comments on commit bc1d341

Please sign in to comment.