feat: updated ui replication text and approval replication flag

This commit is contained in:
Akhil Mohan
2024-05-02 20:23:23 +05:30
committed by =
parent 51c1487ed1
commit a11f120a83
9 changed files with 38 additions and 25 deletions

View File

@@ -44,7 +44,7 @@ export type TSecretApprovalSecChange = {
export type TSecretApprovalRequest<J extends unknown = EncryptedSecret> = {
id: string;
isReplication?: boolean;
isReplicated?: boolean;
slug: string;
createdAt: string;
committerId: string;

View File

@@ -213,7 +213,7 @@ export const SecretApprovalRequest = () => {
policy,
reviewers,
status,
isReplication
isReplicated: isReplication
} = secretApproval;
const isApprover = policy?.approvers?.indexOf(myMembershipId || "") !== -1;
const isReviewed =
@@ -242,7 +242,7 @@ export const SecretApprovalRequest = () => {
{membersGroupById?.[committerId]?.user?.firstName}{" "}
{membersGroupById?.[committerId]?.user?.lastName} (
{membersGroupById?.[committerId]?.user?.email})
{isReplication && "via replication"}
{isReplication && " via replication"}
{isApprover && !isReviewed && status === "open" && " - Review required"}
</span>
</div>

View File

@@ -185,7 +185,9 @@ export const SecretApprovalRequestChanges = ({
<div className="flex flex-grow flex-col">
<div className="mb-1 text-lg">
{generateCommitText(secretApprovalRequestDetails.commits)}
{secretApprovalRequestDetails.isReplication && <span className="text-sm text-bunker-300"> (replication)</span>}
{secretApprovalRequestDetails.isReplicated && (
<span className="text-sm text-bunker-300"> (replication)</span>
)}
</div>
<div className="flex items-center text-sm text-bunker-300">
{committer?.user?.firstName}

View File

@@ -144,8 +144,7 @@ export const CreateSecretImportForm = ({
defaultValue={false}
render={({ field }) => (
<Checkbox isChecked={field.value} onCheckedChange={field.onChange} id="isReplication">
The replication mode retrieves secrets when changes occur in the specified
environment and secret path.
Enable replication mode to synchronize changes across boards.
</Checkbox>
)}
/>

View File

@@ -156,7 +156,7 @@ export const SecretImportItem = ({
</ProjectPermissionCan>
</div>
</div>
{isExpanded && !isDragging && (
{!isReplication && isExpanded && !isDragging && (
<td
colSpan={3}
className={`bg-bunker-800 ${isExpanded && "border-b-2 border-mineshaft-500"}`}