diff --git a/designer/client/cypress/e2e/counts.cy.ts b/designer/client/cypress/e2e/counts.cy.ts index e62959ba7bb..7d897299b4d 100644 --- a/designer/client/cypress/e2e/counts.cy.ts +++ b/designer/client/cypress/e2e/counts.cy.ts @@ -49,7 +49,7 @@ describe("Counts", () => { .click(); cy.get("[data-testid=window]").matchImage({ maxDiffThreshold }); cy.get("[data-testid=window]").contains("no refresh").should("be.visible"); - cy.get("[data-testid=window]").contains("Latest deploy").click(); + cy.get("[data-testid=window]").contains("Latest run").click(); cy.get("[data-testid=window]").contains("10 seconds").should("be.visible"); }); diff --git a/designer/client/src/components/modals/CalculateCounts/useDeployHistory.ts b/designer/client/src/components/modals/CalculateCounts/useDeployHistory.ts deleted file mode 100644 index 1a5fc6fc019..00000000000 --- a/designer/client/src/components/modals/CalculateCounts/useDeployHistory.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { useEffect, useState } from "react"; -import { useTranslation } from "react-i18next"; -import HttpService from "../../../http/HttpService"; -import { DATE_FORMAT } from "../../../config"; -import { Range } from "./CountsRangesButtons"; -import moment from "moment"; - -export function useDeployHistory(processName: string): Range[] { - const { t } = useTranslation(); - const [deploys, setDeploys] = useState([]); - - useEffect(() => { - HttpService.fetchProcessesDeployments(processName) - .then((dates) => - dates.map((current, i, all) => { - const from = moment(current); - const to = all[i - 1]; - return { - from: () => from, - to: () => (to ? moment(to) : moment().add(1, "day").startOf("day")), - name: i - ? t("calculateCounts.range.prevDeploy", "Previous deploy #{{i}} ({{date}})", { - i: all.length - i, - date: from.format(DATE_FORMAT), - }) - : t("calculateCounts.range.lastDeploy", "Latest deploy"), - }; - }), - ) - .then(setDeploys); - }, [t, processName]); - - return deploys; -} diff --git a/designer/client/src/http/HttpService.ts b/designer/client/src/http/HttpService.ts index 4f441101a4e..c7c662dbae7 100644 --- a/designer/client/src/http/HttpService.ts +++ b/designer/client/src/http/HttpService.ts @@ -339,19 +339,6 @@ class HttpService { .then((res) => res.reverse().map((item) => ({ ...item, type: item.type as ActivityTypesRelatedToExecutions }))); } - fetchProcessesDeployments(processName: string) { - return api - .get< - { - performedAt: string; - actionName: ActionName; - }[] - >(`/processes/${encodeURIComponent(processName)}/deployments`) - .then((res) => - res.data.filter(({ actionName }) => actionName === PredefinedActionName.Deploy).map(({ performedAt }) => performedAt), - ); - } - deploy( processName: string, comment?: string,