Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
69d42ae9
Unverified
Commit
69d42ae9
authored
Jan 08, 2024
by
Bowen Liang
Committed by
GitHub
Jan 08, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: cover missed source paths for eslint (#1956)
parent
5ff701ca
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
297 additions
and
295 deletions
+297
-295
workspace-context.tsx
web/context/workspace-context.tsx
+5
-4
use-metadata.ts
web/hooks/use-metadata.ts
+232
-231
i18next-serverside-config.ts
web/i18n/i18next-serverside-config.ts
+3
-3
share.ts
web/models/share.ts
+3
-3
next.config.js
web/next.config.js
+1
-0
index.ts
web/test/factories/index.ts
+52
-52
test_util.ts
web/test/test_util.ts
+1
-2
No files found.
web/context/workspace-context.tsx
View file @
69d42ae9
...
...
@@ -10,20 +10,21 @@ export type WorkspacesContextValue = {
}
const
WorkspacesContext
=
createContext
<
WorkspacesContextValue
>
({
workspaces
:
[]
workspaces
:
[]
,
})
interface
IWorkspaceProviderProps
{
type
IWorkspaceProviderProps
=
{
children
:
React
.
ReactNode
}
export
const
WorkspaceProvider
=
({
children
children
,
}:
IWorkspaceProviderProps
)
=>
{
const
{
data
}
=
useSWR
({
url
:
'/workspaces'
},
fetchWorkspaces
)
return
(
<
WorkspacesContext
.
Provider
value=
{
{
workspaces
:
data
?.
workspaces
||
[]
workspaces
:
data
?.
workspaces
||
[]
,
}
}
>
{
children
}
</
WorkspacesContext
.
Provider
>
...
...
web/hooks/use-metadata.ts
View file @
69d42ae9
This diff is collapsed.
Click to expand it.
web/i18n/i18next-serverside-config.ts
View file @
69d42ae9
import
{
createInstance
}
from
'i18next'
import
resourcesToBackend
from
'i18next-resources-to-backend'
import
{
initReactI18next
}
from
'react-i18next/initReactI18next'
import
{
Locale
}
from
'.'
import
type
{
Locale
}
from
'.'
// https://locize.com/blog/next-13-app-dir-i18n/
const
initI18next
=
async
(
lng
:
Locale
,
ns
:
string
)
=>
{
...
...
@@ -21,6 +21,6 @@ export async function useTranslation(lng: Locale, ns = '', options: Record<strin
const
i18nextInstance
=
await
initI18next
(
lng
,
ns
)
return
{
t
:
i18nextInstance
.
getFixedT
(
lng
,
ns
,
options
.
keyPrefix
),
i18n
:
i18nextInstance
i18n
:
i18nextInstance
,
}
}
web/models/share.ts
View file @
69d42ae9
import
{
Locale
}
from
'@/i18n'
import
type
{
Locale
}
from
'@/i18n'
export
type
ResponseHolder
=
{}
...
...
@@ -6,7 +6,7 @@ export type ConversationItem = {
id
:
string
name
:
string
inputs
:
Record
<
string
,
any
>
|
null
introduction
:
string
,
introduction
:
string
}
export
type
SiteInfo
=
{
...
...
web/next.config.js
View file @
69d42ae9
...
...
@@ -24,6 +24,7 @@ const nextConfig = {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds
:
true
,
dirs
:
[
'app'
,
'bin'
,
'config'
,
'context'
,
'hooks'
,
'i18n'
,
'models'
,
'service'
,
'test'
,
'types'
,
'utils'
],
},
typescript
:
{
// https://nextjs.org/docs/api-reference/next.config.js/ignoring-typescript-errors
...
...
web/test/factories/index.ts
View file @
69d42ae9
...
...
@@ -61,6 +61,6 @@ export const seedLog = () => {
},
get
adminRate
()
{
return
faker
.
datatype
.
number
(
5
)
}
},
})
}
web/test/test_util.ts
View file @
69d42ae9
...
...
@@ -2,8 +2,7 @@ import { Model, createServer } from 'miragejs'
import
type
{
User
}
from
'@/models/user'
import
type
{
History
}
from
'@/models/history'
import
type
{
Log
}
from
'@/models/log'
import
{
seedUser
,
seedHistory
,
seedLog
}
from
'@/test/factories'
import
{
seedHistory
,
seedLog
,
seedUser
}
from
'@/test/factories'
export
function
mockAPI
()
{
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment