-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Move `setHelpExtension` to plugin start method instead of plugin root * Move `setHelpExtension` to a separate file * Remove 'ui/modules' import * Use new platform capabilities in useUpdateBadgeEffect * Move useUpdateBadgeEffect to a utility function called in start * Add plugins and plugins context to new platform start * Use new platform plugins for KueryBar autocomplete provider * Add types for plugin and rename to ApmPublicPlugin * Add empty setup method to plugin * Move all context providers from App to render method * Remove some unnecessary mocks References #32894.
- Loading branch information
Showing
9 changed files
with
153 additions
and
109 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
31 changes: 0 additions & 31 deletions
31
x-pack/legacy/plugins/apm/public/components/app/Main/useUpdateBadgeEffect.ts
This file was deleted.
Oops, something went wrong.
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
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
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
33 changes: 33 additions & 0 deletions
33
x-pack/legacy/plugins/apm/public/new-platform/setHelpExtension.ts
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,33 @@ | ||
/* | ||
* 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 url from 'url'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { CoreStart } from 'kibana/public'; | ||
|
||
export function setHelpExtension({ chrome, http }: CoreStart) { | ||
chrome.setHelpExtension({ | ||
appName: i18n.translate('xpack.apm.feedbackMenu.appName', { | ||
defaultMessage: 'APM' | ||
}), | ||
links: [ | ||
{ | ||
linkType: 'discuss', | ||
href: 'https://discuss.elastic.co/c/apm' | ||
}, | ||
{ | ||
linkType: 'custom', | ||
href: url.format({ | ||
pathname: http.basePath.prepend('/app/kibana'), | ||
hash: '/management/elasticsearch/upgrade_assistant' | ||
}), | ||
content: i18n.translate('xpack.apm.helpMenu.upgradeAssistantLink', { | ||
defaultMessage: 'Upgrade assistant' | ||
}) | ||
} | ||
] | ||
}); | ||
} |
27 changes: 27 additions & 0 deletions
27
x-pack/legacy/plugins/apm/public/new-platform/updateBadge.ts
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,27 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
import { CoreStart } from 'kibana/public'; | ||
|
||
export function setReadonlyBadge({ application, chrome }: CoreStart) { | ||
const canSave = application.capabilities.apm.save; | ||
const { setBadge } = chrome; | ||
|
||
setBadge( | ||
!canSave | ||
? { | ||
text: i18n.translate('xpack.apm.header.badge.readOnly.text', { | ||
defaultMessage: 'Read only' | ||
}), | ||
tooltip: i18n.translate('xpack.apm.header.badge.readOnly.tooltip', { | ||
defaultMessage: 'Unable to save' | ||
}), | ||
iconType: 'glasses' | ||
} | ||
: undefined | ||
); | ||
} |