Skip to content

Commit

Permalink
[ObsUx][APM] Update survey forms for new experience (elastic#188203)
Browse files Browse the repository at this point in the history
Closed elastic#188193

## Summary

This PR changes the survey URL for all service pages when the new
experience is enabled (from `https://ela.st/services-feedback` to
`https://ela.st/entity-services-feedback`)

|Services form | Entity Services form |
|--------------|----------------------|
|
![image](https://github.com/user-attachments/assets/c3744892-7e9e-4926-88f2-705512b40012)
|
![image](https://github.com/user-attachments/assets/e8656611-d5fc-4ac6-9156-3a4b55b33fa6)
|

Testing:
- When the new experience is enabled all service pages should have the
new link (without traces and dependencies)
<img width="1917" alt="Screenshot 2024-07-12 at 12 49 54"
src="https://github.com/user-attachments/assets/7ec42151-060d-4bcc-bb80-ad79820a2f8b">
<img width="1889" alt="Screenshot 2024-07-12 at 12 48 32"
src="https://github.com/user-attachments/assets/4db632c7-8226-4251-b319-75f7d60f8453">
<img width="1900" alt="Screenshot 2024-07-12 at 12 50 56"
src="https://github.com/user-attachments/assets/4155905f-d56f-429c-8a72-732306310997">

- When the classic view is selected the form links should not show
 

![image](https://github.com/user-attachments/assets/45dbf548-5c3e-403f-b89a-5fb5e0e83290)

- The form prefilling should work the same way as before:


https://github.com/user-attachments/assets/6c024dcf-46e1-489e-8e7c-888a69881ad6
  • Loading branch information
jennypavlova authored Jul 12, 2024
1 parent aca8218 commit 9440ea5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-templat
import React, { useContext } from 'react';
import { useLocation } from 'react-router-dom';
import { FeatureFeedbackButton } from '@kbn/observability-shared-plugin/public';
import { useEntityManagerEnablementContext } from '../../../context/entity_manager_context/use_entity_manager_enablement_context';
import { useDefaultAiAssistantStarterPromptsForAPM } from '../../../hooks/use_default_ai_assistant_starter_prompts_for_apm';
import { KibanaEnvironmentContext } from '../../../context/kibana_environment_context/kibana_environment_context';
import { getPathForFeedback } from '../../../utils/get_path_for_feedback';
Expand All @@ -28,6 +29,7 @@ import { EntityEnablement } from '../../shared/entity_enablement';
// Paths that must skip the no data screen
const bypassNoDataScreenPaths = ['/settings', '/diagnostics'];
const APM_FEEDBACK_LINK = 'https://ela.st/services-feedback';
const APM_NEW_EXPERIENCE_FEEDBACK_LINK = 'https://ela.st/entity-services-feedback';

/*
* This template contains:
Expand Down Expand Up @@ -69,6 +71,7 @@ export function ApmMainTemplate({
const { kibanaVersion, isCloudEnv, isServerlessEnv } = kibanaEnvironment;
const basePath = http?.basePath.get();
const { config } = useApmPluginContext();
const { isEntityManagerEnabled } = useEntityManagerEnablementContext();

const ObservabilityPageTemplate = observabilityShared.navigation.PageTemplate;

Expand Down Expand Up @@ -135,7 +138,11 @@ export function ApmMainTemplate({
<EuiFlexItem grow={false}>
<FeatureFeedbackButton
data-test-subj="infraApmFeedbackLink"
formUrl={APM_FEEDBACK_LINK}
formUrl={
isEntityManagerEnabled && sanitizedPath.includes('service')
? APM_NEW_EXPERIENCE_FEEDBACK_LINK
: APM_FEEDBACK_LINK
}
kibanaVersion={kibanaVersion}
isCloudEnv={isCloudEnv}
isServerlessEnv={isServerlessEnv}
Expand Down Expand Up @@ -172,6 +179,4 @@ export function ApmMainTemplate({
);

return <EnvironmentsContextProvider>{pageTemplate}</EnvironmentsContextProvider>;

return pageTemplate;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { TechnicalPreviewBadge } from '../technical_preview_badge';
import { ApmPluginStartDeps } from '../../../plugin';
import { useEntityManagerEnablementContext } from '../../../context/entity_manager_context/use_entity_manager_enablement_context';
import { FeedbackModal } from './feedback_modal';
import { UnauthorisedModal } from './unauthorized_modal';
import { Unauthorized } from './unauthorized_modal';

export function EntityEnablement() {
const [isFeedbackModalVisible, setsIsFeedbackModalVisible] = useState(false);
Expand Down Expand Up @@ -56,7 +56,7 @@ export function EntityEnablement() {
}
};

const handleEnableblement = async () => {
const handleEnablement = async () => {
setIsLoading(true);
try {
const response = await entityManager.entityClient.enableManagedEntityDiscovery();
Expand All @@ -75,7 +75,7 @@ export function EntityEnablement() {
}
};

const handdleOnCloseFeedback = () => {
const handleOnCloseFeedback = () => {
setsIsFeedbackModalVisible(false);
refetch();
};
Expand All @@ -93,7 +93,7 @@ export function EntityEnablement() {
<EuiLink
disabled={isEntityManagerEnabled}
data-test-subj="tryOutEEMLink"
onClick={handleEnableblement}
onClick={handleEnablement}
>
{isEntityManagerEnabled
? i18n.translate('xpack.apm.eemEnablement.enabled.', {
Expand Down Expand Up @@ -149,18 +149,18 @@ export function EntityEnablement() {
</EuiFlexItem>
{isEntityManagerEnabled && (
<EuiFlexItem grow={false}>
<EuiLink data-test-subj="restoreClassiView" onClick={handleRestoreView}>
{i18n.translate('xpack.apm.eemEnablement.restoveClassicView.', {
<EuiLink data-test-subj="restoreClassicView" onClick={handleRestoreView}>
{i18n.translate('xpack.apm.eemEnablement.restoreClassicView.', {
defaultMessage: 'Restore classic view',
})}
</EuiLink>
</EuiFlexItem>
)}
<FeedbackModal
isFeedbackModalVisible={isFeedbackModalVisible}
onClose={handdleOnCloseFeedback}
onClose={handleOnCloseFeedback}
/>
<UnauthorisedModal
<Unauthorized
isUnauthorizedModalVisible={isUnauthorizedModalVisible}
onClose={() => setsIsUnauthorizedModalVisible(false)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
} from '@elastic/eui';
import { useKibanaUrl } from '../../../hooks/use_kibana_url';

export function UnauthorisedModal({
export function Unauthorized({
isUnauthorizedModalVisible = false,
onClose,
}: {
Expand Down

0 comments on commit 9440ea5

Please sign in to comment.