mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Merge pull request #4869 from Infisical/feat/makeCommitMessageOptional
Make commit message optional
This commit is contained in:
@@ -435,14 +435,7 @@ export const registerPITRouter = async (server: FastifyZodProvider) => {
|
||||
projectId: z.string().trim(),
|
||||
environment: z.string().trim(),
|
||||
secretPath: z.string().trim().default("/").transform(removeTrailingSlash),
|
||||
message: z
|
||||
.string()
|
||||
.trim()
|
||||
.min(1)
|
||||
.max(255)
|
||||
.refine((message) => message.trim() !== "", {
|
||||
message: "Commit message cannot be empty"
|
||||
}),
|
||||
message: z.string().trim().max(255).optional(),
|
||||
changes: z.object({
|
||||
secrets: z.object({
|
||||
create: z
|
||||
@@ -546,7 +539,7 @@ export const registerPITRouter = async (server: FastifyZodProvider) => {
|
||||
projectId: req.body.projectId,
|
||||
environment: req.body.environment,
|
||||
secretPath: req.body.secretPath,
|
||||
message: req.body.message,
|
||||
message: req.body.message || "",
|
||||
changes: {
|
||||
secrets: req.body.changes.secrets,
|
||||
folders: req.body.changes.folders
|
||||
@@ -564,7 +557,7 @@ export const registerPITRouter = async (server: FastifyZodProvider) => {
|
||||
projectId: req.body.projectId,
|
||||
environment: req.body.environment,
|
||||
secretPath: req.body.secretPath,
|
||||
message: req.body.message
|
||||
message: req.body.message || ""
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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 min-w-0 flex-1 flex-col items-start">
|
||||
<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 className="text-left text-xs text-mineshaft-300">
|
||||
{commit.actorMetadata?.email || commit.actorMetadata?.name || commit.actorType}{" "}
|
||||
|
||||
@@ -293,9 +293,6 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
||||
}
|
||||
|
||||
const handleCommit = async () => {
|
||||
if (!commitMessage.trim()) {
|
||||
return;
|
||||
}
|
||||
await onCommit(pendingChanges, commitMessage);
|
||||
clearAllPendingChanges({
|
||||
projectId,
|
||||
@@ -432,7 +429,7 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
||||
{/* Commit Message */}
|
||||
<div>
|
||||
<label className="mb-2 block text-sm font-medium text-mineshaft-200">
|
||||
Commit Message <span className="text-red-400">*</span>
|
||||
Commit Message
|
||||
</label>
|
||||
<Input
|
||||
value={commitMessage}
|
||||
@@ -440,7 +437,6 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
||||
placeholder="Describe your changes..."
|
||||
className="w-full"
|
||||
autoFocus
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -457,7 +453,7 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
||||
<Button
|
||||
onClick={handleCommit}
|
||||
isLoading={isCommitting}
|
||||
isDisabled={isCommitting || !commitMessage.trim()}
|
||||
isDisabled={isCommitting}
|
||||
leftIcon={<FontAwesomeIcon icon={faCodeCommit} />}
|
||||
colorSchema="primary"
|
||||
variant="outline_bg"
|
||||
|
||||
Reference in New Issue
Block a user