Skip to content

Commit

Permalink
fix: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyalv committed Nov 7, 2023
1 parent f107915 commit cb215ef
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 77 deletions.
6 changes: 2 additions & 4 deletions src/components/ui/command.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react"
import { DialogProps } from "@radix-ui/react-dialog"
import type { DialogProps } from "@radix-ui/react-dialog"
import { Command as CommandPrimitive } from "cmdk"
import { Search } from "lucide-react"

Expand All @@ -21,9 +21,7 @@ const Command = React.forwardRef<
))
Command.displayName = CommandPrimitive.displayName

interface CommandDialogProps extends DialogProps {}

const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
const CommandDialog = ({ children, ...props }: DialogProps) => {
return (
<Dialog {...props}>
<DialogContent className="overflow-hidden p-0 shadow-lg">
Expand Down
5 changes: 1 addition & 4 deletions src/components/ui/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import * as React from "react"

import { cn } from "~/lib/utils"

export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}

const Input = React.forwardRef<HTMLInputElement, InputProps>(
const Input = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<HTMLInputElement>>(
({ className, type, ...props }, ref) => {
return (
<input
Expand Down
1 change: 0 additions & 1 deletion src/modules/workspace/ProjectsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { DashboardLayout } from "~/layouts/DashboardLayout";
import { useEffect } from "react";
import { api } from "~/utils/api";
import { LoadingHero } from "~/layouts/LoadingHero";
import { DocumentsDataTable } from "./components/DocumentsDataTable";
import { ProjectsDataTable } from "./components/ProjectsDataTable";

export const ProjectsPage = withAuth(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
/* eslint-disable @typescript-eslint/consistent-indexed-object-style */
/* eslint-disable prefer-const */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import React, { useEffect } from "react";
import axios from "axios";
import { useRouter } from "next/router";
import Head from "next/head";

import React from "react";
import { api } from "~/utils/api";
import { withAuth } from "~/components/withAuth";
import { DashboardLayout } from "~/layouts/DashboardLayout";
import { LoadingHero } from "~/layouts/LoadingHero";
import { IssuesList, type IssueData } from "./IssuesList";

Expand Down
11 changes: 1 addition & 10 deletions src/modules/workspace/issue-generator/IssueDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,17 @@ import {
} from "~/components/ui/dialog";
import { Input } from "~/components/ui/input";
import { Label } from "~/components/ui/label";
import { IssueData } from "./IssuesList";
import type { IssueData } from "./IssuesList";
import { IssuePriorityCombobox } from "./IssuePriorityCombobox";
import { Textarea } from "~/components/ui/textarea";

interface DialogProps {
trigger: string;
title: string
dialogDesc: string;
issue: IssueData;
}

export function IssueDialog({
trigger,
title,
dialogDesc: description,
issue
}: DialogProps) {
return (
Expand Down Expand Up @@ -67,11 +63,6 @@ export function IssueDialog({
defaultValue={issue.description}
/>
</div>
{/* <Input
id="description"
defaultValue={`${issue.description}`}
className="col-span-3 row-span-2"
/> */}
</div>
<div className="grid grid-cols-4 items-center gap-4">
<Label htmlFor="priority" className="text-xl text-right">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
flexRender,
} from "@tanstack/react-table";
import { ArrowUpDown } from "lucide-react";
import { useRouter } from "next/router";
import { useState } from "react";
import { Button } from "~/components/ui/button";
import {
Expand Down Expand Up @@ -88,8 +87,6 @@ export const IssueDocumentDataTable: React.FC<IssueDocumentTableProps> = ({
},
});

const router = useRouter();

return (
<div className="my-8 rounded-md border border-primary-dark">
<Table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { IssueDocumentDataTable } from "~/modules/workspace/issue-generator/Issu
import { DashboardLayout } from "~/layouts/DashboardLayout";
import { LoadingHero } from "~/layouts/LoadingHero";

import { IssueData } from "./IssuesList";
import { type IssueData } from "./IssuesList";

const IssueGeneratorDashboard = withAuth(() => {
const [generated, setGenerated] = useState<boolean>(false);
Expand Down
24 changes: 11 additions & 13 deletions src/modules/workspace/issue-generator/IssuesList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React, { useState } from "react";
import { useRouter } from "next/router";
import
React
// { useState }
from "react";
// import { useRouter } from "next/router";
import type { User, Project } from "@linear/sdk";
import { Avatar, AvatarFallback, AvatarImage } from "~/components/ui/avatar";

Expand Down Expand Up @@ -45,15 +48,12 @@ export type IssueData = {
export const IssuesList: React.FC<{ issues: IssueData[]}> = ({
issues
}) => {
const [showDialog, setShowDialog] = useState<boolean>(false);
const [dialogData, setDialogData] = useState<IssueData>();

const router = useRouter();
const [workspaceId] = router.asPath
.replace("/", "")
.replace("/documents", "")
.split("/");
console.log("Issues", issues);
// const router = useRouter();
// const [workspaceId] = router.asPath
// .replace("/", "")
// .replace("/documents", "")
// .split("/");
// console.log("Issues", issues);

return (
<div className="flex flex-col gap-y-2">
Expand Down Expand Up @@ -109,8 +109,6 @@ export const IssuesList: React.FC<{ issues: IssueData[]}> = ({

<IssueDialog
trigger="Edit"
title={issue.title}
dialogDesc={issue.description}
issue={issue}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ import {
PopoverTrigger,
} from "~/components/ui/popover"
import { api } from "~/utils/api"
import { Team } from "@linear/sdk"

export function TeamSelectionCombobox({
handleSelectTeam
}: { handleSelectTeam?: (id: string) => void }) {
const [open, setOpen] = React.useState(false)
const [value, setValue] = React.useState("")

const { data: teams, isLoading: teamIsLoading } =
const { data: teams } =
api.workspace.linear.getTeams.useQuery(undefined, {
refetchOnWindowFocus: false
});
Expand Down
39 changes: 6 additions & 33 deletions src/server/api/routers/workspace/issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { documents } from "~/server/db/schema";
import { and, eq } from "drizzle-orm";

import { createTRPCRouter, protectedProcedure } from "../../trpc";
import {
sessions, users, workspaces,
// import {
// sessions, users, workspaces,

generatedIssues, generatedIssueDetail
} from "~/server/db/schema";
// generatedIssues, generatedIssueDetail
// } from "~/server/db/schema";

import { TRPCError } from "@trpc/server";
// import { TRPCError } from "@trpc/server";

// Vector DB
import { astra } from "~/server/astra";
Expand All @@ -36,7 +36,7 @@ import type { ChainValues } from "langchain/dist/schema";

// Others
import * as Questions from "~/server/api/routers/workspace/generator/generatorQuestions";
import { api } from "~/utils/api";
// import { api } from "~/utils/api";
import { getIssuePriorityLevel } from "~/modules/workspace/issue-generator/IssuesList";


Expand Down Expand Up @@ -242,30 +242,3 @@ export const issueRouter = createTRPCRouter({
// });
}),
});

// let genIssueMetadataResult = await ctx.db
// .select()
// .from(generatedIssues)
// .where(
// and(
// eq(generatedIssues.providerIssueId, input.providerIssueId),
// eq(generatedIssues.workspaceId, ctx.session.workspace_id),
// eq(generatedIssues.userId, ctx.session.user.id),
// eq(generatedIssues.teamId, input.teamId)
// ),
// )
// .limit(1);

// if (genIssueMetadataResult.length < 1) {
// genIssueMetadataResult = await tx
// .insert(generatedIssues)
// .values({
// id: ulid().toString(),
// providerIssueId: input.providerIssueId,
// workspaceId: ctx.session.workspace_id,
// userId: ctx.session.user.id,
// teamId: input.teamId
// })
// .returning();

// const issueMeta = genIssueMetadataResult[0]!;

0 comments on commit cb215ef

Please sign in to comment.