Skip to content

Commit

Permalink
bug fixed: Added an action from the floating menu
Browse files Browse the repository at this point in the history
  • Loading branch information
dariodepa75 committed Dec 1, 2023
1 parent a5007c1 commit 7d821b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1058,10 +1058,11 @@ export class CdsCanvasComponent implements OnInit {
}
else if (this.hasClickedAddAction) {
this.logger.log("[CDS-CANVAS] ho premuto + quindi creo una nuova action e la aggiungo all'intent", this.intentSelected);
// const newAction = this.intentService.createNewAction(event.type);
// this.intentSelected.actions.push(newAction);
const newAction = this.intentService.createNewAction(event.type);
this.intentSelected.actions.push(newAction);
this.intentService.updateIntentNew(this.intentSelected);
// this.updateIntent(this.intentSelected, 0, true);
// this.controllerService.closeAddActionMenu();
this.controllerService.closeAddActionMenu();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ export class CdsIntentComponent implements OnInit, OnDestroy, OnChanges {
} else if (action.value && action.value.type) {
// moving new action in intent from panel elements
this.logger.log("[CDS-INTENT] onDropAction aggiungo una nuova action all'intent da panel elements - action ", this.newActionCreated);
this.intentService.moveNewActionIntoIntent(event, action, this.intent.intent_id);
this.intentService.moveNewActionIntoIntent(event.currentIndex, action, this.intent.intent_id);
//this.onSelectAction(newAction, event.currentIndex, newAction._tdActionId)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/chatbot-design-studio/services/intent.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,13 @@ export class IntentService {


// moving new action in intent from panel elements
public moveNewActionIntoIntent(event, action, currentIntentId): any {
public moveNewActionIntoIntent(currentActionIndex, action, currentIntentId): any {
// console.log('[INTENT-SERVICE] moveNewActionIntoIntent');
let newAction = this.createNewAction(action.value.type);
let currentIntent = this.listOfIntents.find(function(obj) {
return obj.intent_id === currentIntentId;
});
currentIntent.actions.splice(event.currentIndex, 0, newAction);
currentIntent.actions.splice(currentActionIndex, 0, newAction);
this.behaviorIntent.next(currentIntent);
// this.connectorService.updateConnector(currentIntent.intent_id);
// this.onUpdateIntentWithTimeout2(currentIntent, 0, true);
Expand Down

0 comments on commit 7d821b2

Please sign in to comment.