diff --git a/ui-ngx/src/app/modules/home/components/widget/action/manage-widget-actions.component.html b/ui-ngx/src/app/modules/home/components/widget/action/manage-widget-actions.component.html index c3c51a5d76..0941a20d00 100644 --- a/ui-ngx/src/app/modules/home/components/widget/action/manage-widget-actions.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/action/manage-widget-actions.component.html @@ -59,29 +59,49 @@
- +
+ + + +
+ drag_handle +
+
+
{{ 'widget-config.action-source' | translate }} - + {{ action.actionSourceName }} - {{ 'widget-config.action-name' | translate }} - + {{ 'widget-config.action-name' | translate }} + {{ action.name }} - {{ 'widget-config.action-icon' | translate }} - + {{ 'widget-config.action-icon' | translate }} + {{ action.icon }} - {{ 'widget-config.action-type' | translate }} - + {{ 'widget-config.action-type' | translate }} + {{ action.typeName }} @@ -107,9 +127,10 @@ - - + +
) { + this.dragDisabled = true; + const droppedAction: WidgetActionDescriptorInfo = event.item.data; + this.dataSource.pageData$.pipe( + first() + ).subscribe((actions) => { + const action = actions.data; + let startActionSourceIndex = action.findIndex(element => element.actionSourceId === droppedAction.actionSourceId); + const targetActions = this.getOrCreateTargetActions(droppedAction.actionSourceId); + if (startActionSourceIndex === 0) { + startActionSourceIndex -= targetActions.findIndex(element => element.id === action[0].id); + } + moveItemInArray(targetActions, event.previousIndex - startActionSourceIndex, event.currentIndex - startActionSourceIndex); + this.onActionsUpdated(); + }); + } + addAction($event: Event) { this.openWidgetActionDialog($event); }