PIT: general improvements and fixes

This commit is contained in:
carlosmonastyrski
2025-05-25 11:00:06 -03:00
parent b7b90aea33
commit 14362dbe6a
18 changed files with 390 additions and 139 deletions
@@ -1,16 +1,18 @@
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
import { useNavigate, useParams, useSearch } from "@tanstack/react-router";
import { ProjectPermissionCan } from "@app/components/permissions";
import { PageHeader } from "@app/components/v2";
import { ROUTE_PATHS } from "@app/const/routes";
import { useWorkspace } from "@app/context";
import {
ProjectPermissionCommitsActions,
ProjectPermissionSub
} from "@app/context/ProjectPermissionContext/types";
import { ProjectType } from "@app/hooks/api/workspace/types";
import { CommitHistoryTab } from "./components/CommitHistoryTab";
export const CommitsPage = () => {
const { t } = useTranslation();
const envSlug = useParams({
from: ROUTE_PATHS.SecretManager.CommitsPage.id,
select: (el) => el.environment
@@ -45,20 +47,23 @@ export const CommitsPage = () => {
return (
<div className="mx-auto flex h-full w-full max-w-7xl justify-center bg-bunker-800 py-4 text-white">
<Helmet>
<title>{t("common.head-title", { title: "Commit History" })}</title>
</Helmet>
<div className="w-full max-w-[75vw]">
<PageHeader
title="Commits"
description="Track, inspect, and restore your secrets and folders with confidence. View the complete history of changes made to your environment, examine specific modifications at each commit point, and preview the exact impact before rolling back to previous states."
/>
<CommitHistoryTab
onSelectCommit={handleSelectCommit}
projectId={currentWorkspace.id}
environment={envSlug}
secretPath={secretPath}
/>
<ProjectPermissionCan
renderGuardBanner
I={ProjectPermissionCommitsActions.Read}
a={ProjectPermissionSub.Commits}
>
<CommitHistoryTab
onSelectCommit={handleSelectCommit}
projectId={currentWorkspace.id}
environment={envSlug}
secretPath={secretPath}
/>
</ProjectPermissionCan>
</div>
</div>
);