mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 20:27:43 +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");
|
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> {
|
export async function down(knex: Knex): Promise<void> {
|
||||||
@@ -52,4 +58,10 @@ export async function down(knex: Knex): Promise<void> {
|
|||||||
t.dropColumns("isReplicated");
|
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(),
|
statusChangeBy: z.string().uuid().nullable().optional(),
|
||||||
committerId: z.string().uuid(),
|
committerId: z.string().uuid(),
|
||||||
createdAt: z.date(),
|
createdAt: z.date(),
|
||||||
updatedAt: z.date()
|
updatedAt: z.date(),
|
||||||
|
isReplicated: z.boolean().nullable().optional()
|
||||||
});
|
});
|
||||||
|
|
||||||
export type TSecretApprovalRequests = z.infer<typeof SecretApprovalRequestsSchema>;
|
export type TSecretApprovalRequests = z.infer<typeof SecretApprovalRequestsSchema>;
|
||||||
|
|||||||
@@ -32,22 +32,20 @@ export const registerSecretApprovalRequestRouter = async (server: FastifyZodProv
|
|||||||
}),
|
}),
|
||||||
response: {
|
response: {
|
||||||
200: z.object({
|
200: z.object({
|
||||||
approvals: SecretApprovalRequestsSchema.merge(
|
approvals: SecretApprovalRequestsSchema.extend({
|
||||||
z.object({
|
// secretPath: z.string(),
|
||||||
// secretPath: z.string(),
|
policy: z.object({
|
||||||
policy: z.object({
|
id: z.string(),
|
||||||
id: z.string(),
|
name: z.string(),
|
||||||
name: z.string(),
|
approvals: z.number(),
|
||||||
approvals: z.number(),
|
approvers: z.string().array(),
|
||||||
approvers: z.string().array(),
|
secretPath: z.string().optional().nullable()
|
||||||
secretPath: z.string().optional().nullable()
|
}),
|
||||||
}),
|
commits: z.object({ op: z.string(), secretId: z.string().nullable().optional() }).array(),
|
||||||
commits: z.object({ op: z.string(), secretId: z.string().nullable().optional() }).array(),
|
environment: z.string(),
|
||||||
environment: z.string(),
|
reviewers: z.object({ member: z.string(), status: z.string() }).array(),
|
||||||
reviewers: z.object({ member: z.string(), status: z.string() }).array(),
|
approvers: z.string().array()
|
||||||
approvers: z.string().array()
|
}).array()
|
||||||
})
|
|
||||||
).array()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -154,7 +154,8 @@ export const secretReplicationServiceFactory = ({
|
|||||||
policyId: policy.id,
|
policyId: policy.id,
|
||||||
status: "open",
|
status: "open",
|
||||||
hasMerged: false,
|
hasMerged: false,
|
||||||
committerId: membershipId
|
committerId: membershipId,
|
||||||
|
isReplicated: true
|
||||||
},
|
},
|
||||||
tx
|
tx
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export type TSecretApprovalSecChange = {
|
|||||||
|
|
||||||
export type TSecretApprovalRequest<J extends unknown = EncryptedSecret> = {
|
export type TSecretApprovalRequest<J extends unknown = EncryptedSecret> = {
|
||||||
id: string;
|
id: string;
|
||||||
isReplication?: boolean;
|
isReplicated?: boolean;
|
||||||
slug: string;
|
slug: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
committerId: string;
|
committerId: string;
|
||||||
|
|||||||
+2
-2
@@ -213,7 +213,7 @@ export const SecretApprovalRequest = () => {
|
|||||||
policy,
|
policy,
|
||||||
reviewers,
|
reviewers,
|
||||||
status,
|
status,
|
||||||
isReplication
|
isReplicated: isReplication
|
||||||
} = secretApproval;
|
} = secretApproval;
|
||||||
const isApprover = policy?.approvers?.indexOf(myMembershipId || "") !== -1;
|
const isApprover = policy?.approvers?.indexOf(myMembershipId || "") !== -1;
|
||||||
const isReviewed =
|
const isReviewed =
|
||||||
@@ -242,7 +242,7 @@ export const SecretApprovalRequest = () => {
|
|||||||
{membersGroupById?.[committerId]?.user?.firstName}{" "}
|
{membersGroupById?.[committerId]?.user?.firstName}{" "}
|
||||||
{membersGroupById?.[committerId]?.user?.lastName} (
|
{membersGroupById?.[committerId]?.user?.lastName} (
|
||||||
{membersGroupById?.[committerId]?.user?.email})
|
{membersGroupById?.[committerId]?.user?.email})
|
||||||
{isReplication && "via replication"}
|
{isReplication && " via replication"}
|
||||||
{isApprover && !isReviewed && status === "open" && " - Review required"}
|
{isApprover && !isReviewed && status === "open" && " - Review required"}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+3
-1
@@ -185,7 +185,9 @@ export const SecretApprovalRequestChanges = ({
|
|||||||
<div className="flex flex-grow flex-col">
|
<div className="flex flex-grow flex-col">
|
||||||
<div className="mb-1 text-lg">
|
<div className="mb-1 text-lg">
|
||||||
{generateCommitText(secretApprovalRequestDetails.commits)}
|
{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>
|
||||||
<div className="flex items-center text-sm text-bunker-300">
|
<div className="flex items-center text-sm text-bunker-300">
|
||||||
{committer?.user?.firstName}
|
{committer?.user?.firstName}
|
||||||
|
|||||||
@@ -144,8 +144,7 @@ export const CreateSecretImportForm = ({
|
|||||||
defaultValue={false}
|
defaultValue={false}
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<Checkbox isChecked={field.value} onCheckedChange={field.onChange} id="isReplication">
|
<Checkbox isChecked={field.value} onCheckedChange={field.onChange} id="isReplication">
|
||||||
The replication mode retrieves secrets when changes occur in the specified
|
Enable replication mode to synchronize changes across boards.
|
||||||
environment and secret path.
|
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
+1
-1
@@ -156,7 +156,7 @@ export const SecretImportItem = ({
|
|||||||
</ProjectPermissionCan>
|
</ProjectPermissionCan>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{isExpanded && !isDragging && (
|
{!isReplication && isExpanded && !isDragging && (
|
||||||
<td
|
<td
|
||||||
colSpan={3}
|
colSpan={3}
|
||||||
className={`bg-bunker-800 ${isExpanded && "border-b-2 border-mineshaft-500"}`}
|
className={`bg-bunker-800 ${isExpanded && "border-b-2 border-mineshaft-500"}`}
|
||||||
|
|||||||
Reference in New Issue
Block a user