Skip to content

Commit

Permalink
[Infra UI] Add feedback button to Infra Metrics Explorer (#163188)
Browse files Browse the repository at this point in the history
## Summary

This PR adds a feedback button to Metrics Explorer

## Testing
- Go to Infrastructure > Metrics Explorer
   - The feedback button (Tell us what you think!) should be visible
   
<img width="1702" alt="image"
src="https://github.com/elastic/kibana/assets/14139027/0d94371c-6269-4595-9b10-c85d1bcc66d9">

- When you click on the link the Kibana version should be prefilled (no
need to submit just go to step 4)
 
<img width="1193" alt="image"
src="https://github.com/elastic/kibana/assets/14139027/f03d641b-83f8-4a08-ad12-e279303e4a61">
  • Loading branch information
jennypavlova authored Aug 9, 2023
1 parent e3e0558 commit c0c8270
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { EuiErrorBoundary } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { useEffect, useState } from 'react';
import { useTrackPageview } from '@kbn/observability-shared-plugin/public';
import { FeatureFeedbackButton } from '../../../components/feature_feedback_button';
import { SourceLoadingPage } from '../../../components/source_loading_page';
import { useMetricsExplorerViews } from '../../../hooks/use_metrics_explorer_views';
import { MetricsSourceConfigurationProperties } from '../../../../common/metrics_sources';
Expand All @@ -27,6 +28,8 @@ interface MetricsExplorerPageProps {
derivedIndexPattern: DerivedIndexPattern;
}

const METRICS_EXPLORER_FEEDBACK_URL = 'https://ela.st/survey-infra-metricsexplorer?usp=pp_url';

export const MetricsExplorerPage = ({ source, derivedIndexPattern }: MetricsExplorerPageProps) => {
const [enabled, setEnabled] = useState(false);
const {
Expand Down Expand Up @@ -91,7 +94,13 @@ export const MetricsExplorerPage = ({ source, derivedIndexPattern }: MetricsExpl
hasData={metricIndicesExist}
pageHeader={{
pageTitle: metricsExplorerTitle,
rightSideItems: [<SavedViews viewState={viewState} />],
rightSideItems: [
<SavedViews viewState={viewState} />,
<FeatureFeedbackButton
formUrl={METRICS_EXPLORER_FEEDBACK_URL}
data-test-subj="infraMetricsExplorerFeedbackLink"
/>,
],
}}
>
<MetricsExplorerToolbar
Expand Down
4 changes: 4 additions & 0 deletions x-pack/test/functional/apps/infra/metrics_explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const chartType = await pageObjects.infraMetricsExplorer.getChartType(charts[0]);
expect(chartType).to.equal('bar chart');
});

it('renders the metrics explorer survey link', async () => {
await pageObjects.infraMetricsExplorer.ensureMetricsExplorerFeedbackLinkIsVisible();
});
});

describe('Saved Views', function () {
Expand Down
5 changes: 5 additions & 0 deletions x-pack/test/functional/page_objects/infra_metrics_explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,10 @@ export function InfraMetricsExplorerProvider({ getService }: FtrProviderContext)
const radioInput = await chartRadio.findByCssSelector(`label[for="${type}"]`);
return await radioInput.click();
},

async ensureMetricsExplorerFeedbackLinkIsVisible() {
await testSubjects.missingOrFail('loadingMessage', { timeout: 20000 });
await testSubjects.existOrFail('infraMetricsExplorerFeedbackLink');
},
};
}

0 comments on commit c0c8270

Please sign in to comment.