mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 04:25:46 +00:00
Make commit message optional
This commit is contained in:
@@ -435,14 +435,7 @@ export const registerPITRouter = async (server: FastifyZodProvider) => {
|
|||||||
projectId: z.string().trim(),
|
projectId: z.string().trim(),
|
||||||
environment: z.string().trim(),
|
environment: z.string().trim(),
|
||||||
secretPath: z.string().trim().default("/").transform(removeTrailingSlash),
|
secretPath: z.string().trim().default("/").transform(removeTrailingSlash),
|
||||||
message: z
|
message: z.string().trim().max(255).optional(),
|
||||||
.string()
|
|
||||||
.trim()
|
|
||||||
.min(1)
|
|
||||||
.max(255)
|
|
||||||
.refine((message) => message.trim() !== "", {
|
|
||||||
message: "Commit message cannot be empty"
|
|
||||||
}),
|
|
||||||
changes: z.object({
|
changes: z.object({
|
||||||
secrets: z.object({
|
secrets: z.object({
|
||||||
create: z
|
create: z
|
||||||
@@ -546,7 +539,7 @@ export const registerPITRouter = async (server: FastifyZodProvider) => {
|
|||||||
projectId: req.body.projectId,
|
projectId: req.body.projectId,
|
||||||
environment: req.body.environment,
|
environment: req.body.environment,
|
||||||
secretPath: req.body.secretPath,
|
secretPath: req.body.secretPath,
|
||||||
message: req.body.message,
|
message: req.body.message || "",
|
||||||
changes: {
|
changes: {
|
||||||
secrets: req.body.changes.secrets,
|
secrets: req.body.changes.secrets,
|
||||||
folders: req.body.changes.folders
|
folders: req.body.changes.folders
|
||||||
@@ -564,7 +557,7 @@ export const registerPITRouter = async (server: FastifyZodProvider) => {
|
|||||||
projectId: req.body.projectId,
|
projectId: req.body.projectId,
|
||||||
environment: req.body.environment,
|
environment: req.body.environment,
|
||||||
secretPath: req.body.secretPath,
|
secretPath: req.body.secretPath,
|
||||||
message: req.body.message
|
message: req.body.message || ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+1
-1
@@ -39,7 +39,7 @@ const CommitItem = ({
|
|||||||
<div className="flex gap-2 px-4 py-3 transition-colors duration-200 hover:bg-zinc-800">
|
<div className="flex gap-2 px-4 py-3 transition-colors duration-200 hover:bg-zinc-800">
|
||||||
<div className="flex min-w-0 flex-1 flex-col items-start">
|
<div className="flex min-w-0 flex-1 flex-col items-start">
|
||||||
<p className="block w-full truncate text-left text-sm text-mineshaft-100">
|
<p className="block w-full truncate text-left text-sm text-mineshaft-100">
|
||||||
{commit.message}
|
{commit.message || <span className="text-mineshaft-400 italic">No message</span>}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-left text-xs text-mineshaft-300">
|
<p className="text-left text-xs text-mineshaft-300">
|
||||||
{commit.actorMetadata?.email || commit.actorMetadata?.name || commit.actorType}{" "}
|
{commit.actorMetadata?.email || commit.actorMetadata?.name || commit.actorType}{" "}
|
||||||
|
|||||||
+2
-6
@@ -293,9 +293,6 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleCommit = async () => {
|
const handleCommit = async () => {
|
||||||
if (!commitMessage.trim()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
await onCommit(pendingChanges, commitMessage);
|
await onCommit(pendingChanges, commitMessage);
|
||||||
clearAllPendingChanges({
|
clearAllPendingChanges({
|
||||||
projectId,
|
projectId,
|
||||||
@@ -432,7 +429,7 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
|||||||
{/* Commit Message */}
|
{/* Commit Message */}
|
||||||
<div>
|
<div>
|
||||||
<label className="mb-2 block text-sm font-medium text-mineshaft-200">
|
<label className="mb-2 block text-sm font-medium text-mineshaft-200">
|
||||||
Commit Message <span className="text-red-400">*</span>
|
Commit Message
|
||||||
</label>
|
</label>
|
||||||
<Input
|
<Input
|
||||||
value={commitMessage}
|
value={commitMessage}
|
||||||
@@ -440,7 +437,6 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
|||||||
placeholder="Describe your changes..."
|
placeholder="Describe your changes..."
|
||||||
className="w-full"
|
className="w-full"
|
||||||
autoFocus
|
autoFocus
|
||||||
required
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -457,7 +453,7 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
|||||||
<Button
|
<Button
|
||||||
onClick={handleCommit}
|
onClick={handleCommit}
|
||||||
isLoading={isCommitting}
|
isLoading={isCommitting}
|
||||||
isDisabled={isCommitting || !commitMessage.trim()}
|
isDisabled={isCommitting}
|
||||||
leftIcon={<FontAwesomeIcon icon={faCodeCommit} />}
|
leftIcon={<FontAwesomeIcon icon={faCodeCommit} />}
|
||||||
colorSchema="primary"
|
colorSchema="primary"
|
||||||
variant="outline_bg"
|
variant="outline_bg"
|
||||||
|
|||||||
Reference in New Issue
Block a user