mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Logs UI] Replace dependencies in the infra bundle (#91503)
This commit is contained in:
parent
8b909cedc8
commit
4d34a13bab
4 changed files with 11 additions and 15 deletions
|
@ -34,7 +34,7 @@ pageLoadAssetSize:
|
|||
indexLifecycleManagement: 107090
|
||||
indexManagement: 140608
|
||||
indexPatternManagement: 28222
|
||||
infra: 204800
|
||||
infra: 184320
|
||||
fleet: 415829
|
||||
ingestPipelines: 58003
|
||||
inputControlVis: 172675
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import Mustache from 'mustache';
|
||||
import { createBytesFormatter } from './bytes';
|
||||
import { formatNumber } from './number';
|
||||
import { formatPercent } from './percent';
|
||||
|
@ -34,5 +33,5 @@ export const createFormatter = (format: InventoryFormatterType, template: string
|
|||
}
|
||||
const fmtFn = FORMATTERS[format];
|
||||
const value = fmtFn(Number(val));
|
||||
return Mustache.render(template, { value });
|
||||
return template.replace(/{{value}}/g, value);
|
||||
};
|
||||
|
|
|
@ -11,7 +11,6 @@ import { AppMountParameters } from 'kibana/public';
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Route, RouteProps, Router, Switch } from 'react-router-dom';
|
||||
import url from 'url';
|
||||
|
||||
// This exists purely to facilitate legacy app/infra URL redirects.
|
||||
// It will be removed in 8.0.0.
|
||||
|
@ -79,11 +78,10 @@ const LegacyApp: React.FunctionComponent<{ history: History<unknown> }> = ({ his
|
|||
nextPath = nextPathParts[0];
|
||||
nextSearch = nextPathParts[1] ? nextPathParts[1] : undefined;
|
||||
|
||||
let nextUrl = url.format({
|
||||
pathname: `${nextBasePath}/${nextPath}`,
|
||||
hash: undefined,
|
||||
search: nextSearch,
|
||||
});
|
||||
const builtPathname = `${nextBasePath}/${nextPath}`;
|
||||
const builtSearch = nextSearch ? `?${nextSearch}` : '';
|
||||
|
||||
let nextUrl = `${builtPathname}${builtSearch}`;
|
||||
|
||||
nextUrl = nextUrl.replace('//', '/');
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
import { useMemo } from 'react';
|
||||
import { stringify } from 'query-string';
|
||||
import url from 'url';
|
||||
import { url as urlUtils } from '../../../../../src/plugins/kibana_utils/public';
|
||||
import { usePrefixPathWithBasepath } from './use_prefix_path_with_basepath';
|
||||
import { useKibana } from '../../../../../src/plugins/kibana_react/public';
|
||||
|
@ -58,11 +57,11 @@ export const useLinkProps = (
|
|||
}, [pathname, encodedSearch]);
|
||||
|
||||
const href = useMemo(() => {
|
||||
const link = url.format({
|
||||
pathname,
|
||||
hash: mergedHash,
|
||||
search: !hash ? encodedSearch : undefined,
|
||||
});
|
||||
const builtPathname = pathname ?? '';
|
||||
const builtHash = mergedHash ? `#${mergedHash}` : '';
|
||||
const builtSearch = !hash ? (encodedSearch ? `?${encodedSearch}` : '') : '';
|
||||
|
||||
const link = `${builtPathname}${builtSearch}${builtHash}`;
|
||||
|
||||
return prefixer(app, link);
|
||||
}, [mergedHash, hash, encodedSearch, pathname, prefixer, app]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue