mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
feat: updated ui replication text and approval replication flag
This commit is contained in:
@@ -26,6 +26,12 @@ export async function up(knex: Knex): Promise<void> {
|
||||
t.boolean("isReplicated");
|
||||
});
|
||||
}
|
||||
|
||||
if (await knex.schema.hasTable(TableName.SecretApprovalRequest)) {
|
||||
await knex.schema.alterTable(TableName.SecretApprovalRequest, (t) => {
|
||||
t.boolean("isReplicated");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export async function down(knex: Knex): Promise<void> {
|
||||
@@ -52,4 +58,10 @@ export async function down(knex: Knex): Promise<void> {
|
||||
t.dropColumns("isReplicated");
|
||||
});
|
||||
}
|
||||
|
||||
if (await knex.schema.hasTable(TableName.SecretApprovalRequest)) {
|
||||
await knex.schema.alterTable(TableName.SecretApprovalRequest, (t) => {
|
||||
t.dropColumn("isReplicated");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,8 @@ export const SecretApprovalRequestsSchema = z.object({
|
||||
statusChangeBy: z.string().uuid().nullable().optional(),
|
||||
committerId: z.string().uuid(),
|
||||
createdAt: z.date(),
|
||||
updatedAt: z.date()
|
||||
updatedAt: z.date(),
|
||||
isReplicated: z.boolean().nullable().optional()
|
||||
});
|
||||
|
||||
export type TSecretApprovalRequests = z.infer<typeof SecretApprovalRequestsSchema>;
|
||||
|
||||
@@ -32,22 +32,20 @@ export const registerSecretApprovalRequestRouter = async (server: FastifyZodProv
|
||||
}),
|
||||
response: {
|
||||
200: z.object({
|
||||
approvals: SecretApprovalRequestsSchema.merge(
|
||||
z.object({
|
||||
// secretPath: z.string(),
|
||||
policy: z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
approvals: z.number(),
|
||||
approvers: z.string().array(),
|
||||
secretPath: z.string().optional().nullable()
|
||||
}),
|
||||
commits: z.object({ op: z.string(), secretId: z.string().nullable().optional() }).array(),
|
||||
environment: z.string(),
|
||||
reviewers: z.object({ member: z.string(), status: z.string() }).array(),
|
||||
approvers: z.string().array()
|
||||
})
|
||||
).array()
|
||||
approvals: SecretApprovalRequestsSchema.extend({
|
||||
// secretPath: z.string(),
|
||||
policy: z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
approvals: z.number(),
|
||||
approvers: z.string().array(),
|
||||
secretPath: z.string().optional().nullable()
|
||||
}),
|
||||
commits: z.object({ op: z.string(), secretId: z.string().nullable().optional() }).array(),
|
||||
environment: z.string(),
|
||||
reviewers: z.object({ member: z.string(), status: z.string() }).array(),
|
||||
approvers: z.string().array()
|
||||
}).array()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -154,7 +154,8 @@ export const secretReplicationServiceFactory = ({
|
||||
policyId: policy.id,
|
||||
status: "open",
|
||||
hasMerged: false,
|
||||
committerId: membershipId
|
||||
committerId: membershipId,
|
||||
isReplicated: true
|
||||
},
|
||||
tx
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -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"}`}
|
||||
|
||||
Reference in New Issue
Block a user