Skip to content

Commit

Permalink
EPMRPP-88599 || Make decision. Extend analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
AmsterGet committed Dec 20, 2023
1 parent c075161 commit 1a699e0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const getClickOnApplyEventCreator = (place) => (
itemDataIssueType,
issueActionType,
suggestedItems,
extraParams,
) => {
const basicEventParameters = getBasicClickEventParametersMakeDecisionCreator(
place,
Expand All @@ -84,6 +85,7 @@ const getClickOnApplyEventCreator = (place) => (
switcher,
icon_name: iconName,
element_name: getMakeDecisionElementName(issueActionType),
...extraParams,
};
};

Expand Down
4 changes: 4 additions & 0 deletions app/src/controllers/plugins/uiExtensions/createImportProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ import {
BTS_FIELDS_FORM,
} from 'components/integrations/elements';
import { updateLaunchLocallyAction } from 'controllers/launch';
import { withTooltip } from 'components/main/tooltips/tooltip';
import { getDefectTypeLabel } from 'components/main/analytics/events/common/utils';
import { formatAttribute } from 'common/utils/attributeUtils';
import { createNamespacedQuery } from 'common/utils/routingUtils';
Expand Down Expand Up @@ -242,6 +243,9 @@ export const createImportProps = (pluginName) => ({
BtsPropertiesForIssueForm,
BubblesPreloader,
},
HOCs: {
withTooltip,
},
constants: {
PLUGIN_UI_EXTENSION_ADMIN_PAGE,
PROJECT_SETTINGS_TAB_PAGE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const MakeDecision = ({ data }) => {
!item.issue.issueType.startsWith(TO_INVESTIGATE_LOCATOR_PREFIX),
),
commentOption: isBulkOperation ? NOT_CHANGED_FOR_ALL : REPLACE_FOR_ALL,
extraAnalyticsParams: {},
});
const [activeTab, setActiveTab] = useState(SELECT_DEFECT_MANUALLY);
const windowSize = useWindowResize();
Expand Down Expand Up @@ -313,6 +314,7 @@ const MakeDecision = ({ data }) => {
selectManualChoice: {
issue: { issueType },
},
extraAnalyticsParams,
} = modalState;

const hasSuggestions = !!suggestedItems.length;
Expand All @@ -335,6 +337,7 @@ const MakeDecision = ({ data }) => {
itemData.issue.issueType,
issueBtn,
suggestedItems,
extraAnalyticsParams,
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const SelectDefectManually = ({
const source = modalState.selectManualChoice;

const handleManualChange = (value = {}) => {
console.log('Change in service UI');
const issue = {
...(modalState.decisionType === SELECT_DEFECT_MANUALLY ? source.issue : itemData.issue),
...value,
Expand Down Expand Up @@ -190,6 +191,15 @@ export const SelectDefectManually = ({

const getDefectTypeNarrowView = () => width < SCREEN_SM_MAX && width > SCREEN_XS_MAX;

const updateExtraAnalyticsParams = (extraAnalyticsParams) => {
setModalState({
extraAnalyticsParams: {
...modalState.extraAnalyticsParams,
...extraAnalyticsParams,
},
});
};

const createDefectTypesBlock = (params = {}) => (
<>
{!isBulkOperation && (
Expand Down Expand Up @@ -228,7 +238,11 @@ export const SelectDefectManually = ({
<div className={cx('select-defect-wrapper')}>
{!isBulkOperation && defectTypeExtensions.length
? defectTypeExtensions.map((extension) => (
<extension.component key={extension.name} item={itemData}>
<extension.component
key={extension.name}
item={itemData}
updateExtraAnalyticsParams={updateExtraAnalyticsParams}
>
{createDefectTypesBlock}
</extension.component>
))
Expand Down Expand Up @@ -258,6 +272,7 @@ export const SelectDefectManually = ({
onChangeComment={handleDefectCommentChange}
comment={source.issue.comment}
item={itemData}
updateExtraAnalyticsParams={updateExtraAnalyticsParams}
/>
))}
</div>
Expand Down

0 comments on commit 1a699e0

Please sign in to comment.