Skip to content

Commit

Permalink
Rename some constants
Browse files Browse the repository at this point in the history
  • Loading branch information
iblancof committed Oct 25, 2024
1 parent 7200832 commit 05e527c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import { useKibana } from '../../../../context/kibana_context/use_kibana';
import { ApmPluginStartDeps, ApmServices } from '../../../../plugin';
import { EntityInventoryAddDataParams } from '../../../../services/telemetry';
import {
associateServiceLogs,
collectServiceLogs,
addApmData,
associateServiceLogsProps,
collectServiceLogsProps,
addApmDataProps,
} from '../../../shared/add_data_buttons/buttons';

const addData = i18n.translate('xpack.apm.addDataContextMenu.link', {
Expand All @@ -45,7 +45,7 @@ export function AddDataContextMenu() {
OBSERVABILITY_ONBOARDING_LOCATOR
);

const addApmButtonData = addApmData(onboardingLocator);
const addApmButtonData = addApmDataProps(onboardingLocator);

const button = (
<EuiHeaderLink
Expand All @@ -72,17 +72,17 @@ export function AddDataContextMenu() {
title: addData,
items: [
{
name: associateServiceLogs.name,
href: associateServiceLogs.link,
name: associateServiceLogsProps.name,
href: associateServiceLogsProps.link,
'data-test-subj': 'apmAddDataAssociateServiceLogs',
target: '_blank',
onClick: () => {
reportButtonClick('associate_existing_service_logs');
},
},
{
name: collectServiceLogs.name,
href: basePath.prepend(collectServiceLogs.link),
name: collectServiceLogsProps.name,
href: basePath.prepend(collectServiceLogsProps.link),
'data-test-subj': 'apmAddDataCollectServiceLogs',
onClick: () => {
reportButtonClick('collect_new_service_logs');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
ApmOnboardingLocatorParams,
} from '../../../locator/onboarding_locator';

export const addApmData = (locator: LocatorPublic<ApmOnboardingLocatorParams> | undefined) => {
export const addApmDataProps = (locator: LocatorPublic<ApmOnboardingLocatorParams> | undefined) => {
return {
name: i18n.translate('xpack.apm.add.apm.agent.button.', {
defaultMessage: 'Add APM',
Expand All @@ -28,14 +28,14 @@ export const addApmData = (locator: LocatorPublic<ApmOnboardingLocatorParams> |
};
};

export const associateServiceLogs = {
export const associateServiceLogsProps = {
name: i18n.translate('xpack.apm.associate.service.logs.button', {
defaultMessage: 'Associate existing service logs',
}),
link: 'https://ela.st/new-experience-associate-service-logs',
};

export const collectServiceLogs = {
export const collectServiceLogsProps = {
name: i18n.translate('xpack.apm.collect.service.logs.button', {
defaultMessage: 'Collect new service logs',
}),
Expand All @@ -60,9 +60,9 @@ export function AddApmData({ fill = false, size = 's', ...props }: AddApmDataPro
OBSERVABILITY_ONBOARDING_LOCATOR
);

const addApmButtonData = addApmData(onboardingLocator);
const addApmDataButtonProps = addApmDataProps(onboardingLocator);

if (!addApmButtonData.link) {
if (!addApmDataButtonProps.link) {
return;
}

Expand All @@ -71,26 +71,26 @@ export function AddApmData({ fill = false, size = 's', ...props }: AddApmDataPro
data-test-subj={props['data-test-subj']}
size={size}
onClick={props.onClick}
href={addApmButtonData?.link}
href={addApmDataButtonProps?.link}
fill={fill}
>
{addApmButtonData.name}
{addApmDataButtonProps.name}
</EuiButton>
);
}

export function AssociateServiceLogs({ onClick }: { onClick?: () => void }) {
return (
<EuiButton
data-test-subj="associateServiceLogsButton"
data-test-subj="associateServiceLogsPropsButton"
size="s"
onClick={onClick}
href={associateServiceLogs.link}
href={associateServiceLogsProps.link}
target="_blank"
iconType="popout"
iconSide="right"
>
{associateServiceLogs.name}
{associateServiceLogsProps.name}
</EuiButton>
);
}
Expand All @@ -101,12 +101,12 @@ export function CollectServiceLogs({ onClick }: { onClick?: () => void }) {

return (
<EuiButton
data-test-subj="collectServiceLogsButton"
data-test-subj="collectServiceLogsPropsButton"
size="s"
onClick={onClick}
href={basePath.prepend(collectServiceLogs.link)}
href={basePath.prepend(collectServiceLogsProps.link)}
>
{collectServiceLogs.name}
{collectServiceLogsProps.name}
</EuiButton>
);
}

0 comments on commit 05e527c

Please sign in to comment.