Skip to content

Commit

Permalink
fix: trivial cleanup (#298)
Browse files Browse the repository at this point in the history
* fix: trivial cleanup

* fix: linting
  • Loading branch information
arielweinberger authored Apr 28, 2024
1 parent bbd6e20 commit dc56c85
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 21 deletions.
15 changes: 1 addition & 14 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
{
"sqltools.connections": [
{
"server": "localhost",
"port": 8123,
"useHTTPS": false,
"database": "default",
"username": "default",
"password": "",
"tls": {},
"previewLimit": 50,
"driver": "ClickHouse",
"name": "Local"
}
]
"css.customData": [".vscode/tailwind.json"]
}
7 changes: 7 additions & 0 deletions apps/console/src/components/common/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ export const Drawer = ({ children, className, onClose, open }: Props) => {
!open && "hidden"
)}
onClick={onClose}
onKeyDown={(e) => {
if (e.key === "Enter") {
onClose();
}
}}
role="button"
aria-label="Close"
></div>
<motion.div
initial={{ width: 0, opacity: 0 }}
Expand Down
7 changes: 7 additions & 0 deletions apps/console/src/components/layout/OrgSubHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ export const OrgSubHeader = () => {
key={nav.href}
onClick={() => navigate(nav.href)}
className={getClassName(nav.href)}
onKeyDown={(e) => {
if (e.key === "Enter") {
navigate(nav.href);
}
}}
role="button"
aria-label={nav.name}
>
{nav.name}
</li>
Expand Down
1 change: 1 addition & 0 deletions apps/console/src/components/layout/SideNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const SideNavigation = () => {
<div
onMouseOver={() => setCollapsed(false)}
onMouseLeave={() => setCollapsed(true)}
onFocus={() => setCollapsed(false)}
className={cn(
"z-50 flex h-full grow flex-col gap-y-4 overflow-y-auto overflow-x-hidden border-r border-border bg-stone-900 px-3 pt-2"
)}
Expand Down
2 changes: 0 additions & 2 deletions apps/console/src/components/prompts/ConsumePromptModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ interface Props {
export const ConsumePromptModal = ({ open, onClose }: Props) => {
const [integration, setIntegration] = useState("typescript");

<TypeScriptOpenAIIntegrationTutorial />;

const renderInsructions = () => {
switch (integration) {
case "typescript":
Expand Down
7 changes: 7 additions & 0 deletions apps/console/src/pages/prompts/PromptNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ export const PromptNavigation = () => {
key={nav.name}
onClick={() => navigate(nav.href)}
className={getClassName(nav)}
onKeyDown={(e) => {
if (e.key === "Enter") {
navigate(nav.href);
}
}}
role="button"
aria-label={nav.name}
>
<nav.icon className="h-4 w-4" />
{nav.name}
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/app/identity/projects.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class ProjectsResolver {
}

@Query(() => [Project])
async projects(
projects(
@Args("data") data: GetProjectsInput,
@CurrentUser() user: RequestUser
) {
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/app/prompts/prompts.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export class PromptsResolver {
}

@ResolveField(() => [PromptVersion])
async versions(@Parent() prompt: PrismaPrompt) {
versions(@Parent() prompt: PrismaPrompt) {
this.logger.info("Resolving prompt versions");

try {
Expand All @@ -278,7 +278,7 @@ export class PromptsResolver {
}

@ResolveField(() => PromptVersion, { nullable: true })
async latestVersion(@Parent() prompt: PrismaPrompt) {
latestVersion(@Parent() prompt: PrismaPrompt) {
this.logger.info("Resolving prompt latest version");

try {
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/app/reporting/reporting.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class ReportingController {
description: "Report has been reported successfully",
})
@ApiResponse({ status: 500, description: "Internal server error" })
async reportRequest(
reportRequest(
@Body() dto: CreateReportDto,
@ApiKeyOrgId() organizationId: string,
@ProjectId() projectId: string
Expand Down
2 changes: 1 addition & 1 deletion libs/common/src/utils/slugify.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function slugify(str: string) {
str = str.replace(/^\s+|\s+$/g, ""); // trim leading/trailing white space
str = str.replace(/(^\s+|\s+$)/g, ""); // trim leading/trailing white space
str = str.toLowerCase(); // convert string to lowercase
str = str
.replace(/[^a-z0-9 -]/g, "") // remove any non-alphanumeric characters
Expand Down

0 comments on commit dc56c85

Please sign in to comment.