mirror of
https://github.com/langgenius/dify.git
synced 2026-10-04 13:47:55 +08:00
refactor(web): replace constructor parameter properties (#42691)
This commit is contained in:
3 files changed
+15
-19
No files matched your search
@@ -1307,11 +1307,6 @@
|
||||
"count": 3
|
||||
}
|
||||
},
|
||||
"web/app/components/base/image-uploader/__tests__/image-preview.spec.tsx": {
|
||||
"erasable-syntax-only/parameter-properties": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"web/app/components/base/image-uploader/__tests__/utils.spec.ts": {
|
||||
"no-restricted-imports": {
|
||||
"count": 1
|
||||
@@ -1506,11 +1501,6 @@
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"web/app/components/base/prompt-editor/plugins/component-picker-block/menu.tsx": {
|
||||
"erasable-syntax-only/parameter-properties": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"web/app/components/base/prompt-editor/plugins/component-picker-block/prompt-option.tsx": {
|
||||
"jsx-a11y/click-events-have-key-events": {
|
||||
"count": 1
|
||||
|
||||
@@ -81,7 +81,11 @@ describe('ImagePreview', () => {
|
||||
})
|
||||
|
||||
globalThis.ClipboardItem = class {
|
||||
constructor(public readonly data: Record<string, Blob | Promise<Blob>>) {}
|
||||
public readonly data: Record<string, Blob | Promise<Blob>>
|
||||
|
||||
constructor(data: Record<string, Blob | Promise<Blob>>) {
|
||||
this.data = data
|
||||
}
|
||||
} as unknown as typeof ClipboardItem
|
||||
vi.spyOn(window, 'open').mockImplementation((...args: Parameters<Window['open']>) => {
|
||||
return mocks.windowOpen(...args)
|
||||
|
||||
@@ -11,18 +11,20 @@ type MenuOptionRenderProps = {
|
||||
queryString: string | null
|
||||
}
|
||||
|
||||
type PickerBlockMenuOptionData = {
|
||||
key: string
|
||||
group?: string
|
||||
onSelect?: () => void
|
||||
render: (menuRenderProps: MenuOptionRenderProps) => React.JSX.Element
|
||||
}
|
||||
|
||||
export class PickerBlockMenuOption extends MenuOption {
|
||||
private data: PickerBlockMenuOptionData
|
||||
public group?: string
|
||||
|
||||
constructor(
|
||||
private data: {
|
||||
key: string
|
||||
group?: string
|
||||
onSelect?: () => void
|
||||
render: (menuRenderProps: MenuOptionRenderProps) => React.JSX.Element
|
||||
},
|
||||
) {
|
||||
constructor(data: PickerBlockMenuOptionData) {
|
||||
super(data.key)
|
||||
this.data = data
|
||||
this.group = data.group
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user