-
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.
[ObsUx] Add feedback form to apm (#173758)
Closes #172506 ## Summary This PR adds a button to all APM pages navigating to a feedback form. The feedback button component exists in infra so in this PR the component is changed to meet the new requirements and moved to `observability_shared`. Now the feedback button component supports also prefilling the sanitized path (`entry.1876422621`). The requirements picked for the sanitized path are described in the issue - it should be for example `/app/apm/{page_name}` if the user is on the page with the exact path matching `/app/apm/{page_name}` and `/app/apm/{page_name}*` for all subpages (for example `/app/apm/{page_name}/something/else`) - different test scenarios can be found in the unit test: [get_path_for_feedback.test.ts](https://github.com/elastic/kibana/compare/main...jennypavlova:kibana:172506-obsux-add-feedback-form-to-apm?expand=1#diff-6396807e61353509c44fa38488dfb741549e60f25126024b92596f6b7ac933b8) ## Testing - Go to APM - All APM pages should have a yellow button with the text: `Tell us what you think!` - Hover on the button to see the prefilled properties and check if every property is prefilled <img width="1920" alt="image" src="https://github.com/elastic/kibana/assets/14139027/b57adf04-4e7b-42bb-827f-db554dc4a842"> - Click on the form and check if the form is prefilled - The questions that should be prefilled in APM - Where is your Elastic cluster deployed? (same as infra) - By default, the pre-selected option will be on-prem - To test the case with the cloud option preselected add `xpack.cloud.id: 'elastic_kibana_dev'` to your `kibana.dev.yaml` - To test the serverless option run Kibana in serverless mode (observability config) - What version of Elastic are you using? (same as infra) - Where in the UI are you? - After checking the APM go to the infra pages and check the feedback button/form https://github.com/elastic/kibana/assets/14139027/52cc886f-95a9-4099-b047-93fc64036572
- Loading branch information
1 parent
d458b53
commit 35d037b
Showing
23 changed files
with
356 additions
and
84 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
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
16 changes: 16 additions & 0 deletions
16
x-pack/plugins/apm/public/context/kibana_environment_context/kibana_environment_context.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,16 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { createContext } from 'react'; | ||
|
||
export interface KibanaEnvContext { | ||
kibanaVersion?: string; | ||
isCloudEnv?: boolean; | ||
isServerlessEnv?: boolean; | ||
} | ||
|
||
export const KibanaEnvironmentContext = createContext<KibanaEnvContext>({}); |
41 changes: 41 additions & 0 deletions
41
.../plugins/apm/public/context/kibana_environment_context/use_kibana_environment_context.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,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React, { useMemo, createElement } from 'react'; | ||
import { | ||
KibanaEnvironmentContext, | ||
type KibanaEnvContext, | ||
} from './kibana_environment_context'; | ||
|
||
export const useKibanaEnvironmentContextProvider = ({ | ||
kibanaVersion, | ||
isCloudEnv, | ||
isServerlessEnv, | ||
}: KibanaEnvContext) => { | ||
const value = useMemo( | ||
() => ({ | ||
kibanaVersion, | ||
isCloudEnv, | ||
isServerlessEnv, | ||
}), | ||
[kibanaVersion, isCloudEnv, isServerlessEnv] | ||
); | ||
|
||
const Provider: React.FC<{ kibanaEnvironment?: KibanaEnvContext }> = ({ | ||
kibanaEnvironment = {}, | ||
children, | ||
}) => { | ||
const newProvider = createElement(KibanaEnvironmentContext.Provider, { | ||
value: { ...kibanaEnvironment, ...value }, | ||
children, | ||
}); | ||
|
||
return newProvider; | ||
}; | ||
|
||
return Provider; | ||
}; |
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
Oops, something went wrong.