Browse Source

fix(metrics): adjust settings labels (#75050)

Ogi 7 months ago
parent
commit
dda38aa063

+ 1 - 1
static/app/components/modals/metricWidgetViewerModal/queries.tsx

@@ -293,7 +293,7 @@ function QueryContextMenu({
     const settingsItem = {
     const settingsItem = {
       leadingItems: [<IconSettings key="icon" />],
       leadingItems: [<IconSettings key="icon" />],
       key: 'settings',
       key: 'settings',
-      label: t('Metric Settings'),
+      label: t('Configure Metric'),
       disabled: !customMetric,
       disabled: !customMetric,
       onAction: () => {
       onAction: () => {
         navigateTo(
         navigateTo(

+ 6 - 6
static/app/views/metrics/layout.spec.tsx

@@ -52,9 +52,9 @@ describe('Metrics Layout', function () {
 
 
     render(<MetricsLayout />, {organization});
     render(<MetricsLayout />, {organization});
 
 
-    // Button: Create metric
+    // Button: Create Metric
     expect(
     expect(
-      await screen.findByRole('button', {name: 'Create metric'})
+      await screen.findByRole('button', {name: 'Create Metric'})
     ).toBeInTheDocument();
     ).toBeInTheDocument();
 
 
     // Alert: No alert shall be rendered
     // Alert: No alert shall be rendered
@@ -85,8 +85,8 @@ describe('Metrics Layout', function () {
     // Button: Set Up Tracing
     // Button: Set Up Tracing
     expect(screen.getByRole('button', {name: 'Set Up Tracing'})).toBeInTheDocument();
     expect(screen.getByRole('button', {name: 'Set Up Tracing'})).toBeInTheDocument();
 
 
-    // Not in the page: Create metric
-    expect(screen.queryByRole('button', {name: 'Create metric'})).not.toBeInTheDocument();
+    // Not in the page: Create Metric
+    expect(screen.queryByRole('button', {name: 'Create Metric'})).not.toBeInTheDocument();
   });
   });
 
 
   it('not using performance and have old custom metrics', async function () {
   it('not using performance and have old custom metrics', async function () {
@@ -104,8 +104,8 @@ describe('Metrics Layout', function () {
       await screen.findByText(/Metrics using with the old API will stop being ingested/i)
       await screen.findByText(/Metrics using with the old API will stop being ingested/i)
     ).toBeInTheDocument();
     ).toBeInTheDocument();
 
 
-    // Button: Create metric
-    expect(screen.getByRole('button', {name: 'Create metric'})).toBeInTheDocument();
+    // Button: Create Metric
+    expect(screen.getByRole('button', {name: 'Create Metric'})).toBeInTheDocument();
 
 
     // Main View: Does not display the empty state.
     // Main View: Does not display the empty state.
     expect(screen.queryByText(/track and solve what matters/i)).not.toBeInTheDocument();
     expect(screen.queryByText(/track and solve what matters/i)).not.toBeInTheDocument();

+ 2 - 2
static/app/views/metrics/pageHeaderActions.spec.tsx

@@ -27,7 +27,7 @@ describe('Metrics Page Header Actions', function () {
       expect(addCustomMetric).toHaveBeenCalled();
       expect(addCustomMetric).toHaveBeenCalled();
     });
     });
 
 
-    it('display "Create metric" button', async function () {
+    it('display "Create Metric" button', async function () {
       render(
       render(
         <PageHeaderActions showAddMetricButton addCustomMetric={() => jest.fn()} />,
         <PageHeaderActions showAddMetricButton addCustomMetric={() => jest.fn()} />,
         {
         {
@@ -41,7 +41,7 @@ describe('Metrics Page Header Actions', function () {
       );
       );
       renderGlobalModal();
       renderGlobalModal();
 
 
-      const button = screen.getByRole('button', {name: 'Create metric'});
+      const button = screen.getByRole('button', {name: 'Create Metric'});
 
 
       expect(button).toBeInTheDocument();
       expect(button).toBeInTheDocument();
 
 

+ 3 - 3
static/app/views/metrics/pageHeaderActions.tsx

@@ -99,8 +99,8 @@ export function PageHeaderActions({showAddMetricButton, addCustomMetric}: Props)
       },
       },
       {
       {
         leadingItems: [<IconSettings key="icon" />],
         leadingItems: [<IconSettings key="icon" />],
-        key: 'configure-metric',
-        label: t('Configure Metric'),
+        key: 'Metrics Settings',
+        label: t('Metrics Settings'),
         onAction: () => navigateTo(`/settings/projects/:projectId/metrics/`, router),
         onAction: () => navigateTo(`/settings/projects/:projectId/metrics/`, router),
       },
       },
     ],
     ],
@@ -155,7 +155,7 @@ export function PageHeaderActions({showAddMetricButton, addCustomMetric}: Props)
             onClick={() => openExtractionRuleCreateModal({})}
             onClick={() => openExtractionRuleCreateModal({})}
             size="sm"
             size="sm"
           >
           >
-            {t('Create metric')}
+            {t('Create Metric')}
           </Button>
           </Button>
         ) : (
         ) : (
           <Button priority="primary" onClick={() => addCustomMetric()} size="sm">
           <Button priority="primary" onClick={() => addCustomMetric()} size="sm">