Skip to content

Commit

Permalink
remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
adityachoudhari26 committed Oct 4, 2024
1 parent 039a07e commit 969de01
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const ConditionBadge: React.FC<{
}> = ({ children }) => (
<Badge
variant="outline"
// className="mx-1 w-fit bg-neutral-800/60 px-1 hover:bg-neutral-800/60"
className="text-sx h-7 gap-1.5 bg-neutral-900 px-2 font-normal"
>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,123 +85,3 @@ export const ReleaseConditionDialog: React.FC<ReleaseConditionDialogProps> = ({
</Dialog>
);
};

// type CreateTargetViewDialogProps = {
// workspaceId: string;
// filter?: TargetCondition;
// onSubmit?: (view: schema.TargetView) => void;
// children: React.ReactNode;
// };

// export const CreateTargetViewDialog: React.FC<CreateTargetViewDialogProps> = ({
// workspaceId,
// filter,
// onSubmit,
// children,
// }) => {
// const [open, setOpen] = useState(false);
// const form = useForm({
// schema: targetViewFormSchema,
// defaultValues: {
// name: "",
// description: "",
// filter: filter ?? defaultCondition,
// },
// });
// const router = useRouter();

// const createTargetView = api.target.view.create.useMutation();

// const onFormSubmit = (data: TargetViewFormSchema) => {
// createTargetView
// .mutateAsync({
// ...data,
// workspaceId,
// })
// .then((view) => onSubmit?.(view))
// .then(() => form.reset())
// .then(() => setOpen(false))
// .then(() => router.refresh());
// };

// return (
// <Dialog open={open} onOpenChange={setOpen}>
// <DialogTrigger asChild>{children}</DialogTrigger>
// <DialogContent
// className="min-w-[1000px]"
// onClick={(e) => e.stopPropagation()}
// >
// <DialogHeader>
// <DialogTitle>Create Target View</DialogTitle>
// <DialogDescription>
// Create a target view for this workspace.
// </DialogDescription>
// </DialogHeader>
// <TargetViewForm form={form} onSubmit={onFormSubmit} />
// </DialogContent>
// </Dialog>
// );
// };

// type EditTargetViewDialogProps = {
// view: schema.TargetView;
// onClose?: () => void;
// onSubmit?: (view: schema.TargetView) => void;
// children: React.ReactNode;
// };

// export const EditTargetViewDialog: React.FC<EditTargetViewDialogProps> = ({
// view,
// onClose,
// onSubmit,
// children,
// }) => {
// const [open, setOpen] = useState(false);
// const form = useForm({
// schema: releaseViewFormSchema,
// defaultValues: {
// name: view.name,
// description: view.description ?? "",
// filter: view.filter,
// },
// });
// const router = useRouter();

// const updateTargetView = api.target.view.update.useMutation();

// const onFormSubmit = (data: TargetViewFormSchema) => {
// updateTargetView
// .mutateAsync({
// id: view.id,
// data,
// })
// .then((view) => onSubmit?.(view))
// .then(() => setOpen(false))
// .then(onClose)
// .then(() => router.refresh());
// };

// return (
// <Dialog
// open={open}
// onOpenChange={(open) => {
// setOpen(open);
// if (!open) onClose?.();
// }}
// >
// <DialogTrigger asChild>{children}</DialogTrigger>
// <DialogContent
// className="min-w-[1000px]"
// onClick={(e) => e.stopPropagation()}
// >
// <DialogHeader>
// <DialogTitle>Create Target View</DialogTitle>
// <DialogDescription>
// Create a target view for this workspace.
// </DialogDescription>
// </DialogHeader>
// <TargetViewForm form={form} onSubmit={onFormSubmit} />
// </DialogContent>
// </Dialog>
// );
// };
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,5 @@ export const useReleaseFilter = () => {
[router],
);

// const setView = useCallback(
// (view: schema.ReleaseView) => {
// const query = new URLSearchParams(window.location.search);
// const filterJson = LZString.compressToEncodedURIComponent(
// JSON.stringify(view.filter),
// );
// query.set("filter", filterJson);
// query.set("view", view.id);
// router.replace(`?${query.toString()}`);
// },
// [router],
// );

// const removeView = () => {
// const query = new URLSearchParams(window.location.search);
// query.delete("view");
// query.delete("filter");
// router.replace(`?${query.toString()}`);
// };

return { filter, setFilter };
};

0 comments on commit 969de01

Please sign in to comment.