Skip to content

Commit

Permalink
Fix frontend issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
LanDinh committed Dec 24, 2024
1 parent 39d8706 commit 4471272
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ jobs:
run: kubectl -n khaleesi-ninja-${{ matrix.environment.name }} get pod
- name: "DEBUG"
if: always()
run: kubectl -n khaleesi-ninja-${{ matrix.environment.name }} logs --tail 100 -l site=core -l app=sawmill
run: kubectl -n khaleesi-ninja-${{ matrix.environment.name }} logs --tail 100 -l site=admin -l app=frontend

# Clean up cache.
clean-cache:
Expand Down
10 changes: 8 additions & 2 deletions frontend/khaleesi/app/khaleesi/auth/loginRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { MetaFunction, ActionFunctionArgs } from '@remix-run/node'
import type { MetaFunction, ActionFunctionArgs, TypedResponse } from '@remix-run/node'
import { data } from '@remix-run/node'
import { Form } from '@remix-run/react'
import type { UNSAFE_DataWithResponseInit } from '@remix-run/router'
import { useContext } from 'react'
import { AppContext } from '../home/document'
import { breadcrumb } from '../navigation/breadcrumb'
Expand All @@ -22,7 +23,12 @@ export const meta: MetaFunction = () => {
]
}

export async function action({ request }: ActionFunctionArgs) {
export async function action(
{ request }: ActionFunctionArgs,
): Promise<
TypedResponse<{ message: string }>
| UNSAFE_DataWithResponseInit<{ fieldErrors: { user: string | null }, formError: string | null }>
> {
const session = new Session()
await session.init(request)
const form = await request.formData()
Expand Down
4 changes: 2 additions & 2 deletions frontend/khaleesi/app/khaleesi/auth/logoutRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { MetaFunction, ActionFunctionArgs } from '@remix-run/node'
import { Form } from '@remix-run/react'
import type { MetaFunction, ActionFunctionArgs, TypedResponse } from '@remix-run/node'
import { useContext } from 'react'
import { AppContext } from '../home/document'
import { breadcrumb } from '../navigation/breadcrumb'
Expand All @@ -21,7 +21,7 @@ export const meta: MetaFunction = () => {
]
}

export async function action({ request }: ActionFunctionArgs) {
export async function action({ request }: ActionFunctionArgs): Promise<TypedResponse<never>> {
const session = new Session()
await session.init(request)
return session.destroy('/')
Expand Down
4 changes: 2 additions & 2 deletions frontend/khaleesi/app/khaleesi/grpc/util.server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { makeGenericClientConstructor, credentials } from '@grpc/grpc-js'
import type * as $protobuf from 'protobufjs'
import proto from '../proto/proto'
import { khaleesi } from '../proto/proto'


export class Client<Type extends $protobuf.rpc.Service> {
Expand All @@ -22,7 +22,7 @@ export class Client<Type extends $protobuf.rpc.Service> {
const channel = new Channel(serviceUrl, credentials.createInsecure())

// @ts-expect-error any
this.stub = proto.khaleesi[site][app][stubName].create(
this.stub = khaleesi[site][app][stubName].create(
(method: any, requestData: any, callback: any) => channel.makeUnaryRequest( // eslint-disable-line @typescript-eslint/no-explicit-any, max-len
`/${serviceName}/${method.name}`,
arg => arg,
Expand Down
9 changes: 8 additions & 1 deletion frontend/khaleesi/app/khaleesi/home/document.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ import {
topNavigationData,
bottomNavigationData,
} from '../navigation/commonNavigationData'
import type { NavigationElementProperties } from '../navigation/navigationElement'
import { Session } from '../auth/session.server'

export async function loader({ request }: LoaderFunctionArgs) {
export async function loader(
{ request }: LoaderFunctionArgs,
): Promise<{
top: NavigationElementProperties[],
middle: NavigationElementProperties[],
bottom: NavigationElementProperties[],
}> {
const session = new Session()
await session.init(request)
return {
Expand Down
2 changes: 1 addition & 1 deletion frontend/khaleesi/app/khaleesi/home/document.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createContext, type Context, type PropsWithChildren } from 'react'
import type { LinksFunction, LoaderFunctionArgs } from '@remix-run/node'
import type { LinksFunction } from '@remix-run/node'
import {
Meta,
Links as RemixLinks,
Expand Down

0 comments on commit 4471272

Please sign in to comment.