feature/FA-11_CICD #33
@@ -50,8 +50,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Export schema
|
- name: Export schema
|
||||||
run: |
|
run: |
|
||||||
dotnet run --project ${{ matrix.service.project }}/${{ matrix.service.project }}.csproj \
|
dotnet run -c Release --no-build --no-launch-profile \
|
||||||
--no-build -c Release --no-launch-profile \
|
--project ${{ matrix.service.project }}/${{ matrix.service.project }}.csproj \
|
||||||
-- schema export --output ${{ matrix.service.project }}/schema.graphql
|
-- schema export --output ${{ matrix.service.project }}/schema.graphql
|
||||||
|
|
||||||
- name: Pack subgraph
|
- name: Pack subgraph
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v6.0.0
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import tseslint from 'typescript-eslint'
|
|||||||
import { defineConfig, globalIgnores } from 'eslint/config'
|
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||||
|
|
||||||
export default defineConfig([
|
export default defineConfig([
|
||||||
globalIgnores(['dist']),
|
globalIgnores(['dist', 'src/__generated__']),
|
||||||
{
|
{
|
||||||
files: ['**/*.{ts,tsx}'],
|
files: ['**/*.{ts,tsx}'],
|
||||||
extends: [
|
extends: [
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const uri = import.meta.env.VITE_GRAPHQL_URI ?? 'https://localhost:5001/graphql'
|
|||||||
|
|
||||||
const httpLink = new HttpLink({ uri })
|
const httpLink = new HttpLink({ uri })
|
||||||
|
|
||||||
const authLink = new SetContextLink(async ({ headers }, _) => {
|
const authLink = new SetContextLink(async ({ headers }) => {
|
||||||
if (!userManager) return { headers }
|
if (!userManager) return { headers }
|
||||||
try {
|
try {
|
||||||
const user = await userManager.getUser()
|
const user = await userManager.getUser()
|
||||||
|
|||||||
@@ -14,12 +14,11 @@ const AuthContext = createContext<AuthContextValue | undefined>(undefined)
|
|||||||
|
|
||||||
export function AuthProvider({ children }: { children: ReactNode }) {
|
export function AuthProvider({ children }: { children: ReactNode }) {
|
||||||
const [user, setUser] = useState<User | null>(null)
|
const [user, setUser] = useState<User | null>(null)
|
||||||
const [isLoading, setIsLoading] = useState(true)
|
const [isLoading, setIsLoading] = useState(!!userManager)
|
||||||
const callbackHandledRef = useRef(false)
|
const callbackHandledRef = useRef(false)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!userManager) {
|
if (!userManager) {
|
||||||
setIsLoading(false)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,6 +120,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
|||||||
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>
|
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line react-refresh/only-export-components
|
||||||
export function useAuth() {
|
export function useAuth() {
|
||||||
const context = useContext(AuthContext)
|
const context = useContext(AuthContext)
|
||||||
if (!context) {
|
if (!context) {
|
||||||
|
|||||||
@@ -31,4 +31,5 @@ function Badge({ className, variant, ...props }: BadgeProps) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line react-refresh/only-export-components
|
||||||
export { Badge, badgeVariants }
|
export { Badge, badgeVariants }
|
||||||
|
|||||||
@@ -51,4 +51,5 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|||||||
)
|
)
|
||||||
Button.displayName = 'Button'
|
Button.displayName = 'Button'
|
||||||
|
|
||||||
|
// eslint-disable-next-line react-refresh/only-export-components
|
||||||
export { Button, buttonVariants }
|
export { Button, buttonVariants }
|
||||||
|
|||||||
@@ -2,8 +2,7 @@ import * as React from 'react'
|
|||||||
|
|
||||||
import { cn } from '../../lib/utils'
|
import { cn } from '../../lib/utils'
|
||||||
|
|
||||||
export interface InputProps
|
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>
|
||||||
extends React.InputHTMLAttributes<HTMLInputElement> {}
|
|
||||||
|
|
||||||
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||||
({ className, type, ...props }, ref) => {
|
({ className, type, ...props }, ref) => {
|
||||||
|
|||||||
@@ -13,14 +13,13 @@ export function NovelsPage() {
|
|||||||
notifyOnNetworkStatusChange: true,
|
notifyOnNetworkStatusChange: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
const edges = data?.novels?.edges ?? []
|
|
||||||
const pageInfo = data?.novels?.pageInfo
|
const pageInfo = data?.novels?.pageInfo
|
||||||
const hasNextPage = pageInfo?.hasNextPage ?? false
|
const hasNextPage = pageInfo?.hasNextPage ?? false
|
||||||
const endCursor = pageInfo?.endCursor ?? null
|
const endCursor = pageInfo?.endCursor ?? null
|
||||||
|
|
||||||
const novels = useMemo(
|
const novels = useMemo(
|
||||||
() => edges.map((edge) => edge?.node).filter(Boolean),
|
() => (data?.novels?.edges ?? []).map((edge) => edge?.node).filter(Boolean),
|
||||||
[edges]
|
[data?.novels?.edges]
|
||||||
)
|
)
|
||||||
|
|
||||||
async function handleLoadMore() {
|
async function handleLoadMore() {
|
||||||
|
|||||||
Reference in New Issue
Block a user