chore: clean up type errors and warnings
This commit is contained in:
120
package-lock.json
generated
120
package-lock.json
generated
@@ -10124,6 +10124,126 @@
|
|||||||
"@react-email/components": "0.0.12",
|
"@react-email/components": "0.0.12",
|
||||||
"react-email": "^1.10.0"
|
"react-email": "^1.10.0"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@next/swc-darwin-x64": {
|
||||||
|
"version": "14.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.4.tgz",
|
||||||
|
"integrity": "sha512-b0Xo1ELj3u7IkZWAKcJPJEhBop117U78l70nfoQGo4xUSvv0PJSTaV4U9xQBLvZlnjsYkc8RwQN1HoH/oQmLlQ==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@next/swc-linux-arm64-gnu": {
|
||||||
|
"version": "14.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.4.tgz",
|
||||||
|
"integrity": "sha512-457G0hcLrdYA/u1O2XkRMsDKId5VKe3uKPvrKVOyuARa6nXrdhJOOYU9hkKKyQTMru1B8qEP78IAhf/1XnVqKA==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@next/swc-linux-arm64-musl": {
|
||||||
|
"version": "14.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.4.tgz",
|
||||||
|
"integrity": "sha512-l/kMG+z6MB+fKA9KdtyprkTQ1ihlJcBh66cf0HvqGP+rXBbOXX0dpJatjZbHeunvEHoBBS69GYQG5ry78JMy3g==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@next/swc-linux-x64-gnu": {
|
||||||
|
"version": "14.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.4.tgz",
|
||||||
|
"integrity": "sha512-BapIFZ3ZRnvQ1uWbmqEGJuPT9cgLwvKtxhK/L2t4QYO7l+/DxXuIGjvp1x8rvfa/x1FFSsipERZK70pewbtJtw==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@next/swc-linux-x64-musl": {
|
||||||
|
"version": "14.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.4.tgz",
|
||||||
|
"integrity": "sha512-mqVxTwk4XuBl49qn2A5UmzFImoL1iLm0KQQwtdRJRKl21ylQwwGCxJtIYo2rbfkZHoSKlh/YgztY0qH3wG1xIg==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@next/swc-win32-arm64-msvc": {
|
||||||
|
"version": "14.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.4.tgz",
|
||||||
|
"integrity": "sha512-xzxF4ErcumXjO2Pvg/wVGrtr9QQJLk3IyQX1ddAC/fi6/5jZCZ9xpuL9Tzc4KPWMFq8GGWFVDMshZOdHGdkvag==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@next/swc-win32-ia32-msvc": {
|
||||||
|
"version": "14.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.4.tgz",
|
||||||
|
"integrity": "sha512-WZiz8OdbkpRw6/IU/lredZWKKZopUMhcI2F+XiMAcPja0uZYdMTZQRoQ0WZcvinn9xZAidimE7tN9W5v9Yyfyw==",
|
||||||
|
"cpu": [
|
||||||
|
"ia32"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@next/swc-win32-x64-msvc": {
|
||||||
|
"version": "14.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.4.tgz",
|
||||||
|
"integrity": "sha512-4Rto21sPfw555sZ/XNLqfxDUNeLhNYGO2dlPqsnuCg8N8a2a9u1ltqBOPQ4vj1Gf7eJC0W2hHG2eYUHuiXgY2w==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 10"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import React, {
|
|||||||
import { api } from "~/utils/api";
|
import { api } from "~/utils/api";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
GetBoardByIdOutput,
|
type GetBoardByIdOutput,
|
||||||
ReorderCardInput,
|
type ReorderCardInput,
|
||||||
ReorderListInput,
|
type ReorderListInput,
|
||||||
} from "~/types/router.types";
|
} from "~/types/router.types";
|
||||||
|
|
||||||
interface BoardContextProps {
|
interface BoardContextProps {
|
||||||
@@ -40,29 +40,22 @@ export const BoardProvider: React.FC<{ children: ReactNode }> = ({
|
|||||||
const [boardData, setBoardData] =
|
const [boardData, setBoardData] =
|
||||||
useState<GetBoardByIdOutput>(initialBoardData);
|
useState<GetBoardByIdOutput>(initialBoardData);
|
||||||
|
|
||||||
const refetchBoard = () => {
|
const refetchBoard = async () => {
|
||||||
if (boardData?.publicId)
|
if (boardData?.publicId) {
|
||||||
utils.board.byId.refetch({ boardPublicId: boardData.publicId });
|
try {
|
||||||
|
await utils.board.byId.refetch({ boardPublicId: boardData.publicId });
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateCardMutation = api.card.reorder.useMutation({
|
const updateCardMutation = api.card.reorder.useMutation({
|
||||||
onSuccess: async () => {
|
onSuccess: () => refetchBoard(),
|
||||||
try {
|
|
||||||
await refetchBoard();
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const updateListMutation = api.list.reorder.useMutation({
|
const updateListMutation = api.list.reorder.useMutation({
|
||||||
onSuccess: async () => {
|
onSuccess: () => refetchBoard(),
|
||||||
try {
|
|
||||||
await refetchBoard();
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const updateList = ({
|
const updateList = ({
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ export const cardRouter = createTRPCRouter({
|
|||||||
input.cardPublicId,
|
input.cardPublicId,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!card || !card?.list?.id) return;
|
if (!card ?? !card?.list?.id) return;
|
||||||
|
|
||||||
const deletedAt = new Date().toISOString();
|
const deletedAt = new Date().toISOString();
|
||||||
|
|
||||||
|
|||||||
@@ -105,5 +105,7 @@ export const listRouter = createTRPCRouter({
|
|||||||
{ name: input.name },
|
{ name: input.name },
|
||||||
{ listPublicId: input.listPublicId },
|
{ listPublicId: input.listPublicId },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return result;
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { generateUID } from "~/utils/generateUID";
|
|
||||||
|
|
||||||
import { createTRPCRouter, protectedProcedure } from "~/server/api/trpc";
|
import { createTRPCRouter, protectedProcedure } from "~/server/api/trpc";
|
||||||
import * as workspaceRepo from "~/server/db/repository/workspace.repo";
|
import * as workspaceRepo from "~/server/db/repository/workspace.repo";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { RouterInputs, type RouterOutputs } from "~/utils/api";
|
import { type RouterInputs, type RouterOutputs } from "~/utils/api";
|
||||||
|
|
||||||
export type GetBoardByIdOutput = RouterOutputs["board"]["byId"];
|
export type GetBoardByIdOutput = RouterOutputs["board"]["byId"];
|
||||||
export type ReorderListInput = RouterInputs["list"]["reorder"];
|
export type ReorderListInput = RouterInputs["list"]["reorder"];
|
||||||
|
|||||||
@@ -13,15 +13,20 @@ export function DeleteListConfirmation({
|
|||||||
const { boardData } = useBoard();
|
const { boardData } = useBoard();
|
||||||
const { closeModal } = useModal();
|
const { closeModal } = useModal();
|
||||||
|
|
||||||
const refetchBoard = () => {
|
const refetchBoard = async () => {
|
||||||
if (boardData?.publicId)
|
if (boardData?.publicId) {
|
||||||
utils.board.byId.refetch({ boardPublicId: boardData.publicId });
|
try {
|
||||||
|
await utils.board.byId.refetch({ boardPublicId: boardData.publicId });
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteList = api.list.delete.useMutation({
|
const deleteList = api.list.delete.useMutation({
|
||||||
onSuccess: async () => {
|
onSuccess: () => {
|
||||||
closeModal();
|
closeModal();
|
||||||
await refetchBoard();
|
return refetchBoard();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import CheckboxDropdown from "~/components/CheckboxDropdown";
|
|||||||
import { useBoard } from "~/providers/board";
|
import { useBoard } from "~/providers/board";
|
||||||
import { useModal } from "~/providers/modal";
|
import { useModal } from "~/providers/modal";
|
||||||
|
|
||||||
import { NewCardInput } from "~/types/router.types";
|
import { type NewCardInput } from "~/types/router.types";
|
||||||
|
|
||||||
type NewCardFormInput = NewCardInput & {
|
type NewCardFormInput = NewCardInput & {
|
||||||
isCreateAnotherEnabled: boolean;
|
isCreateAnotherEnabled: boolean;
|
||||||
@@ -43,9 +43,14 @@ export function NewCardForm({ listPublicId }: NewCardFormProps) {
|
|||||||
const memberPublicIds = watch("memberPublicIds") || [];
|
const memberPublicIds = watch("memberPublicIds") || [];
|
||||||
const isCreateAnotherEnabled = watch("isCreateAnotherEnabled");
|
const isCreateAnotherEnabled = watch("isCreateAnotherEnabled");
|
||||||
|
|
||||||
const refetchBoard = () => {
|
const refetchBoard = async () => {
|
||||||
if (boardData?.publicId)
|
if (boardData?.publicId) {
|
||||||
utils.board.byId.refetch({ boardPublicId: boardData.publicId });
|
try {
|
||||||
|
await utils.board.byId.refetch({ boardPublicId: boardData.publicId });
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const createCard = api.card.create.useMutation({
|
const createCard = api.card.create.useMutation({
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { Switch } from "@headlessui/react";
|
|||||||
import { useBoard } from "~/providers/board";
|
import { useBoard } from "~/providers/board";
|
||||||
import { useModal } from "~/providers/modal";
|
import { useModal } from "~/providers/modal";
|
||||||
|
|
||||||
import { NewListInput } from "~/types/router.types";
|
import { type NewListInput } from "~/types/router.types";
|
||||||
|
|
||||||
import { Formik, Form, Field } from "formik";
|
import { Formik, Form, Field } from "formik";
|
||||||
|
|
||||||
@@ -21,16 +21,21 @@ export function NewListForm({ boardPublicId }: { boardPublicId: string }) {
|
|||||||
const { closeModal } = useModal();
|
const { closeModal } = useModal();
|
||||||
const [isCreateAnotherEnabled, setIsCreateAnotherEnabled] = useState(false);
|
const [isCreateAnotherEnabled, setIsCreateAnotherEnabled] = useState(false);
|
||||||
|
|
||||||
const refetchBoard = () => {
|
const refetchBoard = async () => {
|
||||||
if (boardData?.publicId)
|
if (boardData?.publicId) {
|
||||||
utils.board.byId.refetch({ boardPublicId: boardData.publicId });
|
try {
|
||||||
|
await utils.board.byId.refetch({ boardPublicId: boardData.publicId });
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const createList = api.list.create.useMutation({
|
const createList = api.list.create.useMutation({
|
||||||
onSuccess: async () => {
|
onSuccess: () => {
|
||||||
try {
|
try {
|
||||||
await refetchBoard();
|
|
||||||
if (!isCreateAnotherEnabled) closeModal();
|
if (!isCreateAnotherEnabled) closeModal();
|
||||||
|
return refetchBoard();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import { NewWorkspaceForm } from "~/components/NewWorkspaceForm";
|
|||||||
import { NewCardForm } from "./components/NewCardForm";
|
import { NewCardForm } from "./components/NewCardForm";
|
||||||
import { NewListForm } from "./components/NewListForm";
|
import { NewListForm } from "./components/NewListForm";
|
||||||
|
|
||||||
import { UpdateBoardInput } from "~/types/router.types";
|
import { type UpdateBoardInput } from "~/types/router.types";
|
||||||
|
|
||||||
type PublicListId = string;
|
type PublicListId = string;
|
||||||
|
|
||||||
@@ -228,7 +228,7 @@ export default function BoardPage() {
|
|||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
fill={
|
fill={
|
||||||
label.colourCode || undefined
|
label.colourCode ?? undefined
|
||||||
}
|
}
|
||||||
className="h-2 w-2"
|
className="h-2 w-2"
|
||||||
viewBox="0 0 6 6"
|
viewBox="0 0 6 6"
|
||||||
@@ -246,15 +246,14 @@ export default function BoardPage() {
|
|||||||
className="inline-flex h-6 w-6 items-center justify-center rounded-full bg-light-900 ring-2 ring-light-50 dark:bg-gray-500 dark:ring-dark-500"
|
className="inline-flex h-6 w-6 items-center justify-center rounded-full bg-light-900 ring-2 ring-light-50 dark:bg-gray-500 dark:ring-dark-500"
|
||||||
>
|
>
|
||||||
<span className="text-[10px] font-medium leading-none text-white">
|
<span className="text-[10px] font-medium leading-none text-white">
|
||||||
{member?.user?.name &&
|
{member?.user?.name
|
||||||
member.user.name
|
?.split(" ")
|
||||||
.split(" ")
|
.map((namePart) =>
|
||||||
.map((namePart) =>
|
namePart
|
||||||
namePart
|
.charAt(0)
|
||||||
.charAt(0)
|
.toUpperCase(),
|
||||||
.toUpperCase(),
|
)
|
||||||
)
|
.join("")}
|
||||||
.join("")}
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { useWorkspace } from "~/providers/workspace";
|
|||||||
|
|
||||||
import { Formik, Form, Field } from "formik";
|
import { Formik, Form, Field } from "formik";
|
||||||
|
|
||||||
import { NewBoardInput } from "~/types/router.types";
|
import { type NewBoardInput } from "~/types/router.types";
|
||||||
|
|
||||||
export function NewBoardForm() {
|
export function NewBoardForm() {
|
||||||
const utils = api.useUtils();
|
const utils = api.useUtils();
|
||||||
|
|||||||
Reference in New Issue
Block a user