Skip to content

Commit

Permalink
Merge branch 'deploy/dev' of https://github.com/langgenius/dify into …
Browse files Browse the repository at this point in the history
…deploy/dev

* 'deploy/dev' of https://github.com/langgenius/dify:
  revert yarn.lock
  fix
  fix: OAuth link update
  fix: move countdown to components
  fix: lint
  • Loading branch information
ZhouhaoJiang committed Sep 9, 2024
2 parents 451048a + db680b0 commit 943bdfd
Show file tree
Hide file tree
Showing 13 changed files with 764 additions and 1,115 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const ConfigContent: FC<Props> = ({
onChange({
...datasetConfigs,
retrieval_model: RETRIEVE_TYPE.multiWay,
})
}, isInWorkflow)
}
}, [type])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useCountDown } from 'ahooks'
import { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'

const COUNT_DOWN_TIME_MS = 59000
export const COUNT_DOWN_TIME_MS = 59000
const COUNT_DOWN_KEY = 'leftTime'

type CountdownProps = {
Expand Down
2 changes: 1 addition & 1 deletion web/app/reset-password/check-code/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { RiArrowLeftLine, RiMailSendFill } from '@remixicon/react'
import { useTranslation } from 'react-i18next'
import { useState } from 'react'
import { useRouter, useSearchParams } from 'next/navigation'
import Countdown from './countdown'
import Countdown from '@/app/components/signin/countdown'
import Button from '@/app/components/base/button'
import Input from '@/app/components/base/input'
import Toast from '@/app/components/base/toast'
Expand Down
41 changes: 0 additions & 41 deletions web/app/signin/check-code/countdown.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion web/app/signin/check-code/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { RiArrowLeftLine, RiMailSendFill } from '@remixicon/react'
import { useTranslation } from 'react-i18next'
import { useState } from 'react'
import { useRouter, useSearchParams } from 'next/navigation'
import Countdown from './countdown'
import Countdown from '@/app/components/signin/countdown'
import Button from '@/app/components/base/button'
import Input from '@/app/components/base/input'
import Toast from '@/app/components/base/toast'
Expand Down
3 changes: 2 additions & 1 deletion web/app/signin/components/mail-and-code-auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Button from '@/app/components/base/button'
import { emailRegex } from '@/config'
import Toast from '@/app/components/base/toast'
import { sendEMailLoginCode } from '@/service/common'
import { COUNT_DOWN_TIME_MS } from '@/app/components/signin/countdown'

type MailAndCodeAuthProps = {
isInvite: boolean
Expand Down Expand Up @@ -36,7 +37,7 @@ export default function MailAndCodeAuth({ isInvite }: MailAndCodeAuthProps) {
setIsLoading(true)
const ret = await sendEMailLoginCode(email)
if (ret.result === 'success') {
localStorage.setItem('leftTime', '59000')
localStorage.setItem('leftTime', `${COUNT_DOWN_TIME_MS}`)
const params = new URLSearchParams(searchParams)
params.set('email', encodeURIComponent(email))
params.set('token', encodeURIComponent(ret.data))
Expand Down
5 changes: 2 additions & 3 deletions web/app/signin/components/social-auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ type SocialAuthProps = {
export default function SocialAuth(props: SocialAuthProps) {
const { t } = useTranslation()
const searchParams = useSearchParams()
const invite_token = decodeURIComponent(searchParams.get('invite_token') || '')

const getOAuthLink = (href: string) => {
const url = getPurifyHref(`${apiPrefix}${href}`)
if (invite_token)
return `${url}?invite_token=${invite_token}`
if (searchParams.has('invite_token'))
return `${url}?${searchParams.toString()}`

return url
}
Expand Down
17 changes: 0 additions & 17 deletions web/app/signin/forms.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions web/app/signin/oneMoreStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ import { useTranslation } from 'react-i18next'
import Link from 'next/link'
import useSWR from 'swr'
import { useRouter, useSearchParams } from 'next/navigation'
// import { useContext } from 'use-context-selector'
import Button from '@/app/components/base/button'
import Tooltip from '@/app/components/base/tooltip'
import { SimpleSelect } from '@/app/components/base/select'
import { timezones } from '@/utils/timezone'
import { LanguagesSupported, languages } from '@/i18n/language'
import { oneMoreStep } from '@/service/common'
import Toast from '@/app/components/base/toast'
// import I18n from '@/context/i18n'

type IState = {
formState: 'processing' | 'error' | 'success' | 'initial'
Expand Down Expand Up @@ -47,7 +45,6 @@ const OneMoreStep = () => {
const { t } = useTranslation()
const router = useRouter()
const searchParams = useSearchParams()
// const { locale } = useContext(I18n)

const [state, dispatch] = useReducer(reducer, {
formState: 'initial',
Expand Down
102 changes: 0 additions & 102 deletions web/app/signin/userSSOForm.tsx

This file was deleted.

1 change: 0 additions & 1 deletion web/service/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ function unicodeToChar(text: string) {
}

function requiredWebSSOLogin() {
console.log(globalThis.location.pathname)
globalThis.location.href = `/webapp-signin?redirect_url=${globalThis.location.pathname}`
}

Expand Down
4 changes: 2 additions & 2 deletions web/service/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ export const updatePluginProviderAIKey: Fetcher<UpdateOpenAIKeyResponse, { url:
return post<UpdateOpenAIKeyResponse>(url, { body })
}

export const invitationCheck: Fetcher<CommonResponse & { is_valid: boolean; data: { workspace_name: string;email: string;workspace_id: string } }, { url: string; params: { workspace_id?: string; email?: string; token: string } }> = ({ url, params }) => {
return get<CommonResponse & { is_valid: boolean; data: { workspace_name: string;email: string;workspace_id: string } }>(url, { params })
export const invitationCheck: Fetcher<CommonResponse & { is_valid: boolean; data: { workspace_name: string; email: string; workspace_id: string } }, { url: string; params: { workspace_id?: string; email?: string; token: string } }> = ({ url, params }) => {
return get<CommonResponse & { is_valid: boolean; data: { workspace_name: string; email: string; workspace_id: string } }>(url, { params })
}

export const activateMember: Fetcher<CommonResponse & { data: string }, { url: string; body: any }> = ({ url, body }) => {
Expand Down
Loading

0 comments on commit 943bdfd

Please sign in to comment.