refactor: remove limitRollback from application settings and related UI components

- Eliminated the "limitRollback" property from the application schema and the ShowRollbackSettings component, streamlining rollback configuration.
- Updated the database schema to drop the "limitRollback" column from the "application" table, ensuring consistency across the application.
This commit is contained in:
Mauricio Siu
2025-06-08 16:53:23 -06:00
parent cf06e5369a
commit ef0cef99a1
5 changed files with 5814 additions and 26 deletions

View File

@@ -14,9 +14,7 @@ import {
FormField, FormField,
FormItem, FormItem,
FormLabel, FormLabel,
FormMessage,
} from "@/components/ui/form"; } from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { Switch } from "@/components/ui/switch"; import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api"; import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
@@ -55,7 +53,6 @@ export const ShowRollbackSettings = ({ applicationId, children }: Props) => {
resolver: zodResolver(formSchema), resolver: zodResolver(formSchema),
defaultValues: { defaultValues: {
rollbackActive: application?.rollbackActive ?? false, rollbackActive: application?.rollbackActive ?? false,
limitRollback: application?.limitRollback ?? 5,
}, },
}); });
@@ -63,7 +60,6 @@ export const ShowRollbackSettings = ({ applicationId, children }: Props) => {
await updateApplication({ await updateApplication({
applicationId, applicationId,
rollbackActive: data.rollbackActive, rollbackActive: data.rollbackActive,
limitRollback: data.limitRollback,
}) })
.then(() => { .then(() => {
toast.success("Rollback settings updated"); toast.success("Rollback settings updated");
@@ -111,27 +107,6 @@ export const ShowRollbackSettings = ({ applicationId, children }: Props) => {
)} )}
/> />
<FormField
control={form.control}
name="limitRollback"
render={({ field }) => (
<FormItem>
<FormLabel>Maximum Rollbacks</FormLabel>
<FormControl>
<Input
type="number"
{...field}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormControl>
<FormDescription>
Number of rollback points to maintain (1-50)
</FormDescription>
<FormMessage />
</FormItem>
)}
/>
<Button type="submit" className="w-full" isLoading={isLoading}> <Button type="submit" className="w-full" isLoading={isLoading}>
Save Settings Save Settings
</Button> </Button>

View File

@@ -0,0 +1 @@
ALTER TABLE "application" DROP COLUMN "limitRollback";

File diff suppressed because it is too large Load Diff

View File

@@ -666,6 +666,13 @@
"when": 1748918922255, "when": 1748918922255,
"tag": "0094_true_marvel_zombies", "tag": "0094_true_marvel_zombies",
"breakpoints": true "breakpoints": true
},
{
"idx": 95,
"version": "7",
"when": 1748931222940,
"tag": "0095_sweet_venom",
"breakpoints": true
} }
] ]
} }

View File

@@ -132,7 +132,6 @@ export const applications = pgTable("application", {
false, false,
), ),
rollbackActive: boolean("rollbackActive").default(false), rollbackActive: boolean("rollbackActive").default(false),
limitRollback: integer("limitRollback").default(5),
buildArgs: text("buildArgs"), buildArgs: text("buildArgs"),
memoryReservation: text("memoryReservation"), memoryReservation: text("memoryReservation"),
memoryLimit: text("memoryLimit"), memoryLimit: text("memoryLimit"),