Compare commits

..

13 Commits

Author SHA1 Message Date
Henry
a0dbc3309d chore: gen translations 2025-12-05 21:40:35 +00:00
Henry
d2a1bbede9 feat: display date updates in card activity 2025-12-05 21:04:30 +00:00
Henry
8969a3a97f feat: reduce selector font size 2025-12-05 20:55:41 +00:00
Henry
4d7c6770fb feat: improve text eligibility on light mode 2025-12-05 20:50:55 +00:00
Henry
6d2ca9e250 feat: light mode tweaks 2025-12-05 20:47:14 +00:00
Henry
f71fb63203 feat: add due date to new card form 2025-12-05 20:24:14 +00:00
Henry
7e3d64a4ff feat: add due date filters 2025-12-05 20:17:05 +00:00
Henry
3d5f4f63a2 feat: display date icon and label on cards 2025-12-04 14:09:04 +00:00
Henry
7bc83e70a9 feat: add date selector 2025-12-02 22:36:32 +00:00
Henry
172f94949e chore: update migration journal 2025-12-01 21:18:05 +00:00
Henry
cea9c89284 feat: update card router to support due dates 2025-12-01 21:17:22 +00:00
Henry
b664c566a1 feat: update repo funcs 2025-12-01 21:06:41 +00:00
Henry
48d3b43223 feat: add card due dates to schema 2025-12-01 20:44:39 +00:00
3 changed files with 1 additions and 58 deletions

View File

@@ -156,7 +156,6 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) {
getModalState,
clearModalState,
isOpen,
modalStates,
} = useModal();
const { showPopup } = usePopup();
const { workspace } = useWorkspace();
@@ -193,21 +192,6 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) {
},
});
const addOrRemoveLabel = api.card.addOrRemoveLabel.useMutation({
onError: () => {
showPopup({
header: t`Unable to add label`,
message: t`Please try again later, or contact customer support.`,
icon: "error",
});
},
onSettled: async () => {
if (cardId) {
await utils.card.byId.invalidate({ cardPublicId: cardId });
}
},
});
const { register, handleSubmit, setValue, watch } = useForm<FormValues>({
values: {
cardId: cardId ?? "",
@@ -224,24 +208,6 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) {
});
};
// this adds the new created label to selected labels
useEffect(() => {
const newLabelId = modalStates.NEW_LABEL_CREATED;
if (newLabelId && cardId) {
const isAlreadyAdded = card?.labels.some(
(label) => label.publicId === newLabelId,
);
if (!isAlreadyAdded) {
addOrRemoveLabel.mutate({
cardPublicId: cardId,
labelPublicId: newLabelId,
});
}
clearModalState("NEW_LABEL_CREATED");
}
}, [modalStates.NEW_LABEL_CREATED, card, cardId]);
// Open the new item form after creating a new checklist
useEffect(() => {
if (!card) return;

View File

@@ -9,7 +9,7 @@ import { generateUID } from "@kan/shared/utils";
import { createTRPCRouter, protectedProcedure } from "../trpc";
import { assertUserInWorkspace } from "../utils/auth";
import { deleteObject, generateUploadUrl } from "../utils/s3";
import { generateUploadUrl } from "../utils/s3";
export const attachmentRouter = createTRPCRouter({
generateUploadUrl: protectedProcedure
@@ -189,18 +189,6 @@ export const attachmentRouter = createTRPCRouter({
await assertUserInWorkspace(ctx.db, userId, workspaceId);
const bucket = process.env.NEXT_PUBLIC_ATTACHMENTS_BUCKET_NAME;
if (bucket) {
try {
await deleteObject(bucket, attachment.s3Key);
} catch (error) {
console.error(
`Failed to delete attachment from S3: ${attachment.s3Key}`,
error,
);
}
}
await cardAttachmentRepo.softDelete(ctx.db, {
attachmentId: attachment.id,
deletedAt: new Date(),

View File

@@ -1,5 +1,4 @@
import {
DeleteObjectCommand,
GetObjectCommand,
PutObjectCommand,
S3Client,
@@ -57,13 +56,3 @@ export async function generateDownloadUrl(
{ expiresIn },
);
}
export async function deleteObject(bucket: string, key: string) {
const client = createS3Client();
await client.send(
new DeleteObjectCommand({
Bucket: bucket,
Key: key,
}),
);
}