Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/staging' into preview/NU-1778-ac…
Browse files Browse the repository at this point in the history
…tivities
  • Loading branch information
mgoworko committed Oct 28, 2024
2 parents c5f3fa5 + 309f511 commit eee70e9
Show file tree
Hide file tree
Showing 10 changed files with 136 additions and 79 deletions.
2 changes: 1 addition & 1 deletion designer/client/src/actions/nk/assignSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type FeaturesSettings = {
remoteEnvironment: { targetEnvironmentId: string };
environmentAlert: EnvironmentTagSettings;
commentSettings: { substitutionPattern: string; substitutionLink: string };
deploymentCommentSettings?: { exampleComment: string };
deploymentCommentSettings?: { exampleComment: string } | null;
intervalTimeSettings: { processes: number; healthCheck: number }; // TODO: verify usage
tabs: DynamicTabData[];
testDataSettings?: TestDataSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useCallback } from "react";
import { Box, Button, lighten, styled } from "@mui/material";
import { useWindows, WindowKind } from "../../../windowManager";
import { useTranslation } from "react-i18next";
import { EventTrackingSelector, getEventTrackingProps } from "../../../containers/event-tracking";

const StyledFooterButton = styled(Button)(({ theme }) => ({
textTransform: "none",
Expand Down Expand Up @@ -39,10 +40,18 @@ export const ActivitiesPanelFooter = () => {

return (
<Box my={2} mx={1} display={"flex"} justifyContent={"space-between"} gap={1.5}>
<StyledFooterButton variant={"contained"} onClick={handleOpenAddComment}>
<StyledFooterButton
variant={"contained"}
onClick={handleOpenAddComment}
{...getEventTrackingProps({ selector: EventTrackingSelector.ScenarioActivitiesAddComment })}
>
{t("activities.footer.addComment", "Add comment")}
</StyledFooterButton>
<StyledFooterButton variant={"contained"} onClick={handleOpenAddAttachment}>
<StyledFooterButton
variant={"contained"}
onClick={handleOpenAddAttachment}
{...getEventTrackingProps({ selector: EventTrackingSelector.ScenarioActivitiesAddAttachment })}
>
{t("activities.footer.addAttachment", "Add attachment")}
</StyledFooterButton>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useWindows } from "../../../../windowManager";
import { getProcessName } from "../../../../reducers/selectors/graph";
import { getScenarioActivities } from "../../../../actions/nk/scenarioActivities";
import { ActivityItemCommentModify } from "./ActivityItemCommentModify";
import { EventTrackingSelector, getEventTrackingProps } from "../../../../containers/event-tracking";

const getCommentSettings = createSelector(getFeatureSettings, (f) => f.commentSettings || {});

Expand Down Expand Up @@ -61,7 +62,7 @@ const CommentActivity = ({
key={activityAction.id}
src={activityAction.icon}
title={activityAction.displayableName}
delete-testid={`delete-comment-icon`}
{...getEventTrackingProps({ selector: EventTrackingSelector.ScenarioActivitiesDeleteComment })}
/>
);
}
Expand All @@ -78,6 +79,7 @@ const CommentActivity = ({
commentContent={activityComment.content}
data-testid={`edit-comment-icon`}
key={activityAction.id}
{...getEventTrackingProps({ selector: EventTrackingSelector.ScenarioActivitiesEditComment })}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ export const ActivityItemCommentModify = ({ commentContent, scenarioActivityId,
existingComment: commentContent.value,
scenarioActivityId,
placeholder: permittedModifyCommentTypes.includes(activityType)
? featuresSettings.deploymentCommentSettings.exampleComment
? featuresSettings?.deploymentCommentSettings?.exampleComment
: undefined,
},
});
}, [activityType, commentContent.value, featuresSettings.deploymentCommentSettings.exampleComment, open, scenarioActivityId]);
}, [activityType, commentContent.value, featuresSettings?.deploymentCommentSettings?.exampleComment, open, scenarioActivityId]);

return (
<StyledActionIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { StyledActionIcon } from "./StyledActionIcon";
import { getScenarioActivities } from "../../../../actions/nk/scenarioActivities";
import { ActivityItemCommentModify } from "./ActivityItemCommentModify";
import { getLoggedUser } from "../../../../reducers/selectors/settings";
import { EventTrackingSelector, getEventTrackingProps } from "../../../../containers/event-tracking";

const StyledHeaderIcon = styled(UrlIcon)(({ theme }) => ({
width: "16px",
Expand Down Expand Up @@ -77,6 +78,7 @@ const HeaderActivity = ({
onClick={() => open(handleOpenCompareVersionDialog(scenarioVersionId.toString()))}
key={activityAction.id}
src={activityAction.icon}
{...getEventTrackingProps({ selector: EventTrackingSelector.ScenarioActivitiesCompare })}
/>
);
}
Expand All @@ -97,6 +99,7 @@ const HeaderActivity = ({
key={attachmentId}
src={activityAction.icon}
title={activityAction.displayableName}
{...getEventTrackingProps({ selector: EventTrackingSelector.ScenarioActivitiesDownloadAttachment })}
/>
);
}
Expand Down Expand Up @@ -128,6 +131,7 @@ const HeaderActivity = ({
denyText: t("panels.actions.process-unarchive.no", "No"),
})
}
{...getEventTrackingProps({ selector: EventTrackingSelector.ScenarioActivitiesDeleteAttachment })}
/>
);
}
Expand All @@ -143,6 +147,7 @@ const HeaderActivity = ({
scenarioActivityId={scenarioActivityId}
activityType={activityType}
activityAction={activityAction}
{...getEventTrackingProps({ selector: EventTrackingSelector.ScenarioActivitiesAddCommentToActivity })}
/>
);
}
Expand Down Expand Up @@ -210,6 +215,7 @@ const WithOpenVersion = ({
onClick={() => {
changeVersion(scenarioVersion);
}}
{...getEventTrackingProps({ selector: EventTrackingSelector.ScenarioActivitiesOpenVersion })}
>
{children}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ enum ClickEventsSelector {
ScenarioUnarchive = "SCENARIO_UNARCHIVE",
ScenarioCustomAction = "SCENARIO_CUSTOM_ACTION",
ScenarioCustomLink = "SCENARIO_CUSTOM_LINK",
ScenarioActivitiesAddAttachment = "SCENARIO_ACTIVITIES_ADD_ATTACHMENT",
ScenarioActivitiesAddComment = "SCENARIO_ACTIVITIES_ADD_COMMENT",
ScenarioActivitiesAddCommentToActivity = "SCENARIO_ACTIVITIES_ADD_COMMENT_TO_ACTIVITY",
ScenarioActivitiesCompare = "SCENARIO_ACTIVITIES_COMPARE",
ScenarioActivitiesDownloadAttachment = "SCENARIO_ACTIVITIES_DOWNLOAD_ATTACHMENT",
ScenarioActivitiesDeleteAttachment = "SCENARIO_ACTIVITIES_DELETE_ATTACHMENT",
ScenarioActivitiesDeleteComment = "SCENARIO_ACTIVITIES_DELETE_COMMENT",
ScenarioActivitiesEditComment = "SCENARIO_ACTIVITIES_EDIT_COMMENT",
ScenarioActivitiesOpenVersion = "SCENARIO_ACTIVITIES_OPEN_VERSION",
}

enum SearchEventsSelector {
Expand Down
Loading

0 comments on commit eee70e9

Please sign in to comment.