-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APM] Use core.chrome to set window title (#73232)
I noticed there's a `core.chrome.docTitle.change` method. It can take a string or array of strings and provides its own separator character if given an array. Replace our setting of `window.document.title` directly in the APM and Observability plugins with using the chrome method. This changes the title to be, for example, "トランザクション - opbeans-node - サービス - APM - Elastic" instead of "トランザクション | opbeans-node | サービス | APM | Elastic", using " - " as a separator instead of " | ".
- Loading branch information
Showing
4 changed files
with
66 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
x-pack/plugins/observability/public/application/application.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { renderApp } from './'; | ||
import { Observable } from 'rxjs'; | ||
import { CoreStart, AppMountParameters } from 'src/core/public'; | ||
|
||
describe('renderApp', () => { | ||
it('renders', () => { | ||
const core = ({ | ||
application: { currentAppId$: new Observable(), navigateToUrl: () => {} }, | ||
chrome: { docTitle: { change: () => {} }, setBreadcrumbs: () => {} }, | ||
i18n: { Context: ({ children }: { children: React.ReactNode }) => children }, | ||
uiSettings: { get: () => false }, | ||
} as unknown) as CoreStart; | ||
const params = ({ | ||
element: window.document.createElement('div'), | ||
} as unknown) as AppMountParameters; | ||
|
||
expect(() => { | ||
const unmount = renderApp(core, params); | ||
unmount(); | ||
}).not.toThrowError(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters