-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/support-binding-context-var' into deploy/dev
- Loading branch information
Showing
34 changed files
with
551 additions
and
47 deletions.
There are no files selected for viewing
11 changes: 0 additions & 11 deletions
11
web/app/components/app/configuration/base/icons/var-icon.tsx
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
web/app/components/app/configuration/base/warning-mask/cannot-query-dataset.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use client' | ||
import type { FC } from 'react' | ||
import React from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import WarningMask from '.' | ||
import Button from '@/app/components/base/button' | ||
|
||
export type IFormattingChangedProps = { | ||
onConfirm: () => void | ||
} | ||
|
||
const FormattingChanged: FC<IFormattingChangedProps> = ({ | ||
onConfirm, | ||
}) => { | ||
const { t } = useTranslation() | ||
|
||
return ( | ||
<WarningMask | ||
title={t('appDebug.feature.dataSet.queryVariable.unableToQueryDataSet')} | ||
description={t('appDebug.feature.dataSet.queryVariable.unableToQueryDataSetTip')} | ||
footer={ | ||
<div className='flex space-x-2'> | ||
<Button type='primary' className='flex items-center justify-start !h-8 !w-[96px]' onClick={onConfirm}> | ||
<span className='text-[13px] font-medium'>{t('appDebug.feature.dataSet.queryVariable.ok')}</span> | ||
</Button> | ||
</div> | ||
} | ||
/> | ||
) | ||
} | ||
export default React.memo(FormattingChanged) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
web/app/components/app/configuration/dataset-config/context-var/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use client' | ||
import type { FC } from 'react' | ||
import React from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import cn from 'classnames' | ||
import type { Props } from './var-picker' | ||
import VarPicker from './var-picker' | ||
import { BracketsX } from '@/app/components/base/icons/src/vender/line/development' | ||
import Tooltip from '@/app/components/base/tooltip' | ||
import { HelpCircle } from '@/app/components/base/icons/src/vender/line/general' | ||
|
||
const ContextVar: FC<Props> = (props) => { | ||
const { t } = useTranslation() | ||
const { value, options } = props | ||
const currItem = options.find(item => item.value === value) | ||
const notSetVar = !currItem | ||
return ( | ||
<div className={cn(notSetVar ? 'rounded-bl-xl rounded-br-xl bg-[#FEF0C7] border-[#FEF0C7]' : 'border-gray-200', 'flex justify-between items-center h-12 px-3 border-t ')}> | ||
<div className='flex items-center space-x-1 shrink-0'> | ||
<div className='p-1'> | ||
<BracketsX className='w-4 h-4 text-primary-500'/> | ||
</div> | ||
<div className='mr-1 text-sm font-medium text-gray-800'>{t('appDebug.feature.dataSet.queryVariable.title')}</div> | ||
<Tooltip | ||
htmlContent={<div className='w-[180px]'> | ||
{t('appDebug.feature.dataSet.queryVariable.tip')} | ||
</div>} | ||
selector='config-var-tooltip' | ||
> | ||
<HelpCircle className='w-3.5 h-3.5 text-gray-400'/> | ||
</Tooltip> | ||
</div> | ||
|
||
<VarPicker {...props} /> | ||
</div> | ||
) | ||
} | ||
|
||
export default React.memo(ContextVar) |
3 changes: 3 additions & 0 deletions
3
web/app/components/app/configuration/dataset-config/context-var/style.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.trigger:hover .dropdownIcon { | ||
color: #98A2B3; | ||
} |
Oops, something went wrong.