Skip to content

Commit

Permalink
Merge pull request activepieces#2971 from activepieces/enhance-duplic…
Browse files Browse the repository at this point in the history
…ate-step

chore: enhance duplicate step
  • Loading branch information
AbdulTheActivePiecer authored Oct 17, 2023
2 parents 415bcbd + 5ce27c1 commit eff6cd0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
8 changes: 7 additions & 1 deletion packages/ui/core/src/assets/scss/ng-material-override.scss
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,14 @@ mat-icon[data-mat-icon-name="custom_expand_less"] {
}

.mat-mdc-raised-button.mat-warn {
--mdc-protected-button-label-text-color: var(--warn-palette-contrast-500) ;
--mdc-protected-button-label-text-color: var(--warn-palette-contrast-300) ;
}
.mat-mdc-checkbox.mat-primary {
--mdc-checkbox-selected-checkmark-color: var(--primary-palette-contrast-500);
}
.mat-mdc-checkbox.mat-warn {
--mdc-checkbox-selected-checkmark-color: var(--primary-palette-contrast-500);
}

.material-suffix-icon {
padding-right: max(16px, calc(var(--mdc-shape-small, 4px) + 4px));;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
ap-bg-white ap-border-solid ap-border-[1px]
ap-border-line ap-w-[40px] ap-h-[40px] ap-overflow-hidden" apTrackHover
#deleteStepContainer="hoverTrackerDirective"
[class.ap-opacity-100]="(stepHovered || deleteStepContainer.isHovered)"
[class.ap-opacity-0]="(!stepHovered && !deleteStepContainer.isHovered)"
[class.ap-opacity-100]="(stepHovered || deleteStepContainer.isHovered || duplicateStepContainer.isHovered )"
[class.ap-opacity-0]="(!stepHovered && !deleteStepContainer.isHovered && !duplicateStepContainer.isHovered)"
[class.ap-hidden]="isDragging$ | async">
<app-delete-flow-item-action [flowItem]="flowItem"></app-delete-flow-item-action>

Expand All @@ -34,8 +34,8 @@
ap-bg-white ap-border-solid ap-border-[1px]
ap-border-line ap-w-[40px] ap-h-[40px] ap-overflow-hidden" apTrackHover
#duplicateStepContainer="hoverTrackerDirective"
[class.ap-opacity-100]="(stepHovered || duplicateStepContainer.isHovered)"
[class.ap-opacity-0]="(!stepHovered && !duplicateStepContainer.isHovered)"
[class.ap-opacity-100]="(stepHovered || duplicateStepContainer.isHovered || deleteStepContainer.isHovered)"
[class.ap-opacity-0]="(!stepHovered && !duplicateStepContainer.isHovered && !deleteStepContainer.isHovered )"
[class.ap-hidden]="isDragging$ | async">
<app-duplicate-step-action [flowItem]="flowItem"></app-duplicate-step-action>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ const __CanvasReducer = createReducer(
const clonedFlowVersionWithArtifacts: FlowVersion = JSON.parse(
JSON.stringify(operation.flowVersionWithArtifacts)
);
const newStepName = flowHelper.findAvailableStepName(
state.displayedFlowVersion,
'step'
);

clonedState.displayedFlowVersion = flowHelper.apply(
clonedFlowVersionWithArtifacts,
{
Expand All @@ -178,7 +183,17 @@ const __CanvasReducer = createReducer(
},
}
);
return clonedState;
return {
...clonedState,
focusedStep: flowHelper.getStep(
clonedState.displayedFlowVersion,
newStepName
),
rightSidebar: {
type: RightSideBarType.EDIT_STEP,
props: 'NO_PROPS',
},
};
}),
on(FlowsActions.updateTrigger, (state, { operation }): CanvasState => {
const clonedState: CanvasState = JSON.parse(JSON.stringify(state));
Expand Down

0 comments on commit eff6cd0

Please sign in to comment.