Skip to content

Commit beb2b0e

Browse files
author
vahesamsonyan
committed
Merge branch 'develop' into feature/EPMRPP-114875-Test-Executions-Promotion
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
2 parents 05fc610 + 36763fc commit beb2b0e

7 files changed

Lines changed: 100 additions & 17 deletions

File tree

app/src/components/integrations/elements/integrationSettings/connectionSection/connectionSection.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import TrashBin from 'common/img/newIcons/bin-inline.svg';
2929
import Tick from 'common/img/newIcons/tick-inline.svg';
3030
import ErrorIcon from 'common/img/newIcons/error-inline.svg';
3131
import styles from './connectionSection.scss';
32+
import { IntegrationAnalyticsContext } from 'components/integrations/integrationAnalyticsContext';
3233

3334
const cx = classNames.bind(styles);
3435

@@ -108,6 +109,8 @@ export class ConnectionSection extends Component {
108109
pluginName: null,
109110
};
110111

112+
static contextType = IntegrationAnalyticsContext;
113+
111114
removeIntegrationHandler = () => {
112115
const {
113116
intl: { formatMessage },
@@ -118,6 +121,9 @@ export class ConnectionSection extends Component {
118121
id: 'deleteIntegrationModal',
119122
data: {
120123
onConfirm: this.props.onRemoveIntegration,
124+
onConfirmTrackEvent: this.context?.deleteConfirmEvent
125+
? () => this.context.deleteConfirmEvent(this.props.pluginName)
126+
: undefined,
121127
modalTitle: formatMessage(messages.deleteIntegrationTitle, { name: data.name }),
122128
description: formatMessage(messages.deleteIntegrationDescription, { name: data.name }),
123129
},

app/src/components/integrations/elements/integrationSettings/integrationForm/integrationForm.jsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { COMMON_LOCALE_KEYS } from 'common/constants/localization';
2424
import { Button } from '@reportportal/ui-kit';
2525
import { isIntegrationSupportsMultipleInstances } from 'components/integrations/utils';
2626
import { PLUGINS_PAGE_EVENTS } from 'components/main/analytics/events';
27+
import { IntegrationAnalyticsContext } from 'components/integrations/integrationAnalyticsContext';
2728
import { removeNoneValues } from 'components/fields/dynamicFieldsSection/utils';
2829
import { trimStringValues } from 'common/utils';
2930
import styles from './integrationForm.scss';
@@ -74,6 +75,8 @@ export class IntegrationForm extends Component {
7475
isGlobal: false,
7576
};
7677

78+
static contextType = IntegrationAnalyticsContext;
79+
7780
state = {
7881
disabled: !this.props.isEmptyConfiguration,
7982
metaData: {},
@@ -99,9 +102,13 @@ export class IntegrationForm extends Component {
99102
this.state.metaData,
100103
);
101104

102-
this.props.tracking.trackEvent(
103-
PLUGINS_PAGE_EVENTS.pluginConfigureClickSubmit(this.props.pluginName),
104-
);
105+
if (this.context?.submitEvent) {
106+
this.context.submitEvent(this.props.pluginName);
107+
} else {
108+
this.props.tracking.trackEvent(
109+
PLUGINS_PAGE_EVENTS.pluginConfigureClickSubmit(this.props.pluginName),
110+
);
111+
}
105112
};
106113

107114
updateMetaData = (metaData) => {
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2026 EPAM Systems
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { createContext } from 'react';
18+
19+
interface IntegrationAnalyticsContextValue {
20+
submitEvent: (pluginName: string) => void;
21+
deleteConfirmEvent: (pluginName: string) => void;
22+
}
23+
24+
export const IntegrationAnalyticsContext = createContext<IntegrationAnalyticsContextValue | null>(
25+
null,
26+
);

app/src/components/integrations/integrationProviders/emailIntegration/emailSettings/emailSettings.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { useEffect, useState, useMemo, useCallback, ReactNode } from 'react';
17+
import { useEffect, useState, useMemo, useCallback, useContext, ReactNode } from 'react';
1818
import { useSelector, useDispatch } from 'react-redux';
1919
import { redirect } from 'redux-first-router';
2020
import { useIntl, defineMessages } from 'react-intl';
@@ -47,6 +47,7 @@ import { NamedIntegrations } from 'pages/inside/common/integrations/types';
4747
import { messages as integrationsMessages } from 'pages/inside/common/integrations/messages';
4848
import { DeleteIntegrationModal } from 'components/integrations/modals/deleteIntegrationModal';
4949
import AddIntegrationModal from 'components/integrations/modals/addIntegrationModal/addIntegrationModal';
50+
import { IntegrationAnalyticsContext } from 'components/integrations/integrationAnalyticsContext';
5051

5152
import { IntegrationData } from '../types';
5253
import { EmailDetailsCard } from '../emailDetailsCard';
@@ -94,6 +95,7 @@ export function EmailSettings({
9495
}: EmailSettingsProps) {
9596
const dispatch = useDispatch();
9697
const { formatMessage } = useIntl();
98+
const analyticsContext = useContext(IntegrationAnalyticsContext);
9799
const [connected, setConnected] = useState(true);
98100
const [loading, setLoading] = useState(true);
99101

@@ -202,6 +204,9 @@ export function EmailSettings({
202204

203205
const modalData = {
204206
onConfirm: removeIntegration,
207+
onConfirmTrackEvent: analyticsContext?.deleteConfirmEvent
208+
? () => analyticsContext.deleteConfirmEvent(data.integrationType?.name)
209+
: undefined,
205210
modalTitle: formatMessage(messages.deleteIntegrationTitle),
206211
description: getDescription(),
207212
};

app/src/components/integrations/modals/deleteIntegrationModal/deleteIntegrationModal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const cx = createClassnames(styles);
3232

3333
interface DeleteIntegrationModalData {
3434
onConfirm: () => void;
35+
onConfirmTrackEvent?: () => void;
3536
modalTitle: ReactNode | string;
3637
description: ReactNode | string;
3738
okButtonLabel?: ReactNode | string;
@@ -44,6 +45,7 @@ const DeleteIntegrationModal = ({ data }: UseModalData<DeleteIntegrationModalDat
4445

4546
const onDelete = () => {
4647
data.onConfirm();
48+
data.onConfirmTrackEvent?.();
4749
dispatch(hideModalAction());
4850
};
4951

app/src/components/main/analytics/events/ga4Events/projectSettingsPageEvents.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,32 @@ export const PROJECT_SETTINGS_INTEGRATION = {
260260
type: normalizeEventString(type),
261261
}),
262262

263-
CLICK_RESET_TO_GLOBAL_INTEGRATION: {
263+
CLICK_SUBMIT_CONFIGURATION: (type) => ({
264+
...BASIC_EVENT_PARAMETERS_INTEGRATIONS,
265+
element_name: 'submit',
266+
place: 'configuration_view',
267+
type: normalizeEventParameter(type),
268+
}),
269+
270+
CLICK_RESET_TO_GLOBAL_INTEGRATION: (type) => ({
264271
...BASIC_EVENT_PARAMETERS_INTEGRATIONS,
265272
element_name: 'button_reset',
266-
},
273+
type: normalizeEventParameter(type),
274+
}),
275+
276+
CLICK_RESET_CONFIRM: (type) => ({
277+
...BASIC_EVENT_PARAMETERS_INTEGRATIONS,
278+
element_name: 'button_reset',
279+
modal: 'reset_to_global_integration',
280+
type: normalizeEventParameter(type),
281+
}),
282+
283+
CLICK_DELETE_CONFIRM: (type) => ({
284+
...BASIC_EVENT_PARAMETERS_INTEGRATIONS,
285+
element_name: 'button_delete',
286+
modal: 'delete_integration',
287+
type: normalizeEventParameter(type),
288+
}),
267289
};
268290

269291
export const PROJECT_SETTINGS_PATTERN_ANALYSIS_EVENTS = {

app/src/pages/inside/projectSettingsPageContainer/content/integrations/integrationsList/integrationInfo/integrationInfo.jsx

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import { ExtensionLoader } from 'components/extensionLoader';
4545
import { INTEGRATIONS_SETTINGS_COMPONENTS_MAP } from 'components/integrations/settingsComponentsMap';
4646
import { EmptyStatePage } from 'pages/inside/common/emptyStatePage';
4747
import { PROJECT_SETTINGS_INTEGRATION } from 'analyticsEvents/projectSettingsPageEvents';
48+
import { IntegrationAnalyticsContext } from 'components/integrations/integrationAnalyticsContext';
4849
import { INTEGRATIONS } from 'common/constants/settingsTabs';
4950
import { EMAIL } from 'common/constants/pluginNames';
5051
import { combineNameAndEmailToFrom, fetch } from 'common/utils';
@@ -64,6 +65,16 @@ export const IntegrationInfo = (props) => {
6465
const [updatedParameters, setUpdatedParameters] = useState({});
6566
const { formatMessage } = useIntl();
6667
const { trackEvent } = useTracking();
68+
69+
const integrationAnalyticsContextValue = useMemo(
70+
() => ({
71+
submitEvent: (pluginName) =>
72+
trackEvent(PROJECT_SETTINGS_INTEGRATION.CLICK_SUBMIT_CONFIGURATION(pluginName)),
73+
deleteConfirmEvent: (pluginName) =>
74+
trackEvent(PROJECT_SETTINGS_INTEGRATION.CLICK_DELETE_CONFIRM(pluginName)),
75+
}),
76+
[trackEvent],
77+
);
6778
const settingsExtensions = useSelector(uiExtensionIntegrationSettingsSelector);
6879
const { canUpdateSettings } = useUserPermissions();
6980
const globalIntegrations = useSelector(namedGlobalIntegrationsSelector);
@@ -299,6 +310,8 @@ export const IntegrationInfo = (props) => {
299310
id: 'deleteIntegrationModal',
300311
data: {
301312
onConfirm: resetProjectIntegrations,
313+
onConfirmTrackEvent: () =>
314+
trackEvent(PROJECT_SETTINGS_INTEGRATION.CLICK_RESET_CONFIRM(pluginName)),
302315
modalTitle: showOrganizationalIntegrations
303316
? formatMessage(messages.resetIntegrationsToOrganizational)
304317
: formatMessage(messages.resetIntegrations),
@@ -309,7 +322,7 @@ export const IntegrationInfo = (props) => {
309322
},
310323
}),
311324
);
312-
trackEvent(PROJECT_SETTINGS_INTEGRATION.CLICK_RESET_TO_GLOBAL_INTEGRATION);
325+
trackEvent(PROJECT_SETTINGS_INTEGRATION.CLICK_RESET_TO_GLOBAL_INTEGRATION(pluginName));
313326
};
314327

315328
const handleDocumentationClick = () => {
@@ -420,16 +433,18 @@ export const IntegrationInfo = (props) => {
420433
documentationLinkEvent={integrationDetailDocumentationLinkEvent}
421434
/>
422435
<div className={cx('integration-settings-block')}>
423-
<IntegrationSettingsComponent
424-
data={updatedData}
425-
onUpdate={onUpdate}
426-
goToPreviousPage={goToPluginIntegrationList}
427-
extension={integrationSettingsExtension}
428-
withPreloader
429-
silentOnError={false}
430-
isGlobal={integrationInfo.isGlobal}
431-
isOrganizational={integrationInfo.isOrganizational}
432-
/>
436+
<IntegrationAnalyticsContext.Provider value={integrationAnalyticsContextValue}>
437+
<IntegrationSettingsComponent
438+
data={updatedData}
439+
onUpdate={onUpdate}
440+
goToPreviousPage={goToPluginIntegrationList}
441+
extension={integrationSettingsExtension}
442+
withPreloader
443+
silentOnError={false}
444+
isGlobal={integrationInfo.isGlobal}
445+
isOrganizational={integrationInfo.isOrganizational}
446+
/>
447+
</IntegrationAnalyticsContext.Provider>
433448
</div>
434449
</>
435450
)}

0 commit comments

Comments
 (0)