Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@
const values = tmpForm.getFieldsValue()
const { name, widgetType } = values as WidgetForm

await createWidgetHookRef.current(name, widgetType, () => {
await createWidgetHookRef.current(name, widgetType, (id: string) => {
setIsModalOpen(false)

tmpForm.resetFields()
void openWidget(id, widgetType)

Check failure on line 104 in assets/js/src/core/modules/widget-editor/context/widget-editor-provider.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this use of the "void" operator.

See more on https://sonarcloud.io/project/issues?id=pimcore_studio-ui-bundle&issues=AZ12ZMTqmKswA82ERFzM&open=AZ12ZMTqmKswA82ERFzM&pullRequest=3328
})
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import React, { useCallback, useRef } from 'react'
import { useTranslation } from 'react-i18next'

interface UseWidgetEditorReturn {
createWidget: (name: string, widgetType: string, onFinish?: (newName: string) => void) => Promise<void>
createWidget: (name: string, widgetType: string, onFinish?: (id: string) => void) => Promise<void>
getWidgetById: (widgetId: string, widgetType: string) => Promise<WidgetConfig | undefined>
updateWidget: (widgetId: string, widgetType: string, config: any, onFinish?: (updated: any) => void) => Promise<void>
removeWithConfirmation: (widgetId: string, widgetType: string, onFinish?: () => void) => void
Expand Down Expand Up @@ -63,7 +63,7 @@ export const useWidgetEditor = (): UseWidgetEditorReturn => {
}
}, [widgetDeleteMutation])

const createWidget = useCallback(async (name: string, widgetType: string, onFinish?: (name: string) => void): Promise<void> => {
const createWidget = useCallback(async (name: string, widgetType: string, onFinish?: (id: string) => void): Promise<void> => {
const widgetCreateTask = widgetCreateMutation({
widgetType,
body: {
Expand All @@ -78,9 +78,11 @@ export const useWidgetEditor = (): UseWidgetEditorReturn => {

if (response.error !== undefined) {
trackError(new ApiError(response.error))
return
}

onFinish?.(name)
const { id } = response.data as { id: string }
onFinish?.(id)
void successRef.current(tRef.current('widget-editor.create.success'))
} catch {
trackError(new GeneralError('Failed to create new widget.'))
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions public/build/1b39ed8c-85c8-4f2e-a6b6-2c12a8e15067/entrypoints.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions public/build/1b39ed8c-85c8-4f2e-a6b6-2c12a8e15067/manifest.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

22 changes: 0 additions & 22 deletions public/build/1bbc463c-5b2c-499b-ac61-f4eeb3381bdf/entrypoints.json

This file was deleted.

33 changes: 0 additions & 33 deletions public/build/1bbc463c-5b2c-499b-ac61-f4eeb3381bdf/manifest.json

This file was deleted.

23 changes: 0 additions & 23 deletions public/build/303cdcf1-58ee-4ae4-8040-42836066132b/entrypoints.json

This file was deleted.

Loading
Loading