+ class="ap-absolute ap-select-none ap-typography-body-2 ap-h-[92px] ap-text-description ap-flex ap-flex-col ap-justify-center ap-transition ap-fade-in ap-duration-500 ap-opacity-0 ap-top-0"
+ [class.ap-opacity-100]="itemContent.isHovered || name.isHovered" #nameDiv
+ [style.right]="-(15 + nameDiv.clientWidth) + 'px'">
{{_flowItemData.name}}
diff --git a/packages/ui/feature-builder-canvas/src/lib/ui-feature-builder-canvas.module.ts b/packages/ui/feature-builder-canvas/src/lib/ui-feature-builder-canvas.module.ts
index 8480be3d58..044baa71bc 100644
--- a/packages/ui/feature-builder-canvas/src/lib/ui-feature-builder-canvas.module.ts
+++ b/packages/ui/feature-builder-canvas/src/lib/ui-feature-builder-canvas.module.ts
@@ -22,6 +22,7 @@ import { ViewOnlyModeComponent } from './view-only-mode/view-only-mode.component
import { DeleteFlowItemActionComponent } from './flow-item-tree/flow-item/actions/delete-flow-item-action/delete-flow-item-action.component';
import { ReplaceTriggerActionComponent } from './flow-item-tree/flow-item/actions/replace-trigger-action/replace-trigger-action.component';
import { ActionsContainerComponent } from './flow-item-tree/flow-item/actions/actions-container/actions-container.component';
+import { DuplicateStepActionComponent } from './flow-item-tree/flow-item/actions/duplicate-step-action/duplicate-step-action.component';
@NgModule({
imports: [CommonModule, UiCommonModule, DragAndDropModule, CodemirrorModule],
declarations: [
@@ -44,6 +45,7 @@ import { ActionsContainerComponent } from './flow-item-tree/flow-item/actions/ac
DeleteFlowItemActionComponent,
ReplaceTriggerActionComponent,
ActionsContainerComponent,
+ DuplicateStepActionComponent,
],
exports: [FlowItemTreeComponent, CanvasUtilsComponent, CanvasPannerDirective],
})
diff --git a/packages/ui/feature-builder-header/src/lib/feedback/feedback.component.html b/packages/ui/feature-builder-header/src/lib/feedback/feedback.component.html
index a41fc14099..7349ac5cab 100644
--- a/packages/ui/feature-builder-header/src/lib/feedback/feedback.component.html
+++ b/packages/ui/feature-builder-header/src/lib/feedback/feedback.component.html
@@ -1,4 +1,4 @@
-
;
+
+ constructor(private flagService: FlagService) {
+ this.showSupport$ = this.flagService.isFlagEnabled(ApFlagId.SHOW_COMMUNITY);
+ }
+
openSupport() {
window.open(supportUrl, '_blank', 'noopener');
}
diff --git a/packages/ui/feature-builder-right-sidebar/src/lib/step-type-sidebar/step-type-sidebar.component.ts b/packages/ui/feature-builder-right-sidebar/src/lib/step-type-sidebar/step-type-sidebar.component.ts
index 2ea1688136..17a7a3e35e 100755
--- a/packages/ui/feature-builder-right-sidebar/src/lib/step-type-sidebar/step-type-sidebar.component.ts
+++ b/packages/ui/feature-builder-right-sidebar/src/lib/step-type-sidebar/step-type-sidebar.component.ts
@@ -265,7 +265,7 @@ export class StepTypeSidebarComponent implements OnInit, AfterViewInit {
stepLocationRelativeToParent: StepLocationRelativeToParent
): AddActionRequest {
const baseProps = {
- name: this.findAvailableName(flowVersion, 'step'),
+ name: flowHelper.findAvailableStepName(flowVersion, 'step'),
displayName: getDefaultDisplayNameForPiece(
flowItemDetails.type as ActionType,
flowItemDetails.name
@@ -353,21 +353,6 @@ export class StepTypeSidebarComponent implements OnInit, AfterViewInit {
}
}
- findAvailableName(flowVersion: FlowVersion, stepPrefix: string): string {
- const steps = flowHelper
- .getAllSteps(flowVersion.trigger)
- .map((f) => f.name);
- let availableNumber = 1;
- let availableName = `${stepPrefix}_${availableNumber}`;
-
- while (steps.includes(availableName)) {
- availableNumber++;
- availableName = `${stepPrefix}_${availableNumber}`;
- }
-
- return availableName;
- }
-
applySearchToObservable(
obs$: Observable
): Observable {
diff --git a/packages/ui/feature-builder-store/src/lib/service/code.service.ts b/packages/ui/feature-builder-store/src/lib/service/code.service.ts
index 4e62aabcc2..858dbeae5b 100755
--- a/packages/ui/feature-builder-store/src/lib/service/code.service.ts
+++ b/packages/ui/feature-builder-store/src/lib/service/code.service.ts
@@ -24,7 +24,10 @@ type ArtifactsCache = Map;
export class CodeService {
artifactsCacheForFlowConfigs: ArtifactsCache = new Map();
artifactsCacheForSteps: ArtifactsCache = new Map();
- cachedFile: Map = new Map>();
+ cachedFile: Map> = new Map<
+ string,
+ Observable
+ >();
constructor(private http: HttpClient) {}
@@ -57,7 +60,7 @@ export class CodeService {
})
);
}
- return this.cachedFile.get(url);
+ return this.cachedFile.get(url)!;
}
public helloWorldBase64(): string {
diff --git a/packages/ui/feature-builder-store/src/lib/store/builder/canvas/canvas.reducer.ts b/packages/ui/feature-builder-store/src/lib/store/builder/canvas/canvas.reducer.ts
index 1916366587..ba00dc39a3 100755
--- a/packages/ui/feature-builder-store/src/lib/store/builder/canvas/canvas.reducer.ts
+++ b/packages/ui/feature-builder-store/src/lib/store/builder/canvas/canvas.reducer.ts
@@ -9,6 +9,7 @@ import {
} from '../../../model';
import {
FlowOperationType,
+ FlowVersion,
FlowVersionState,
TriggerType,
flowHelper,
@@ -163,6 +164,22 @@ const __CanvasReducer = createReducer(
);
return clonedState;
}),
+ on(FlowsActions.duplicateStep, (state, { operation }): CanvasState => {
+ const clonedState: CanvasState = JSON.parse(JSON.stringify(state));
+ const clonedFlowVersionWithArtifacts: FlowVersion = JSON.parse(
+ JSON.stringify(operation.flowVersionWithArtifacts)
+ );
+ clonedState.displayedFlowVersion = flowHelper.apply(
+ clonedFlowVersionWithArtifacts,
+ {
+ type: FlowOperationType.DUPLICATE_ACTION,
+ request: {
+ stepName: operation.originalStepName,
+ },
+ }
+ );
+ return clonedState;
+ }),
on(FlowsActions.updateTrigger, (state, { operation }): CanvasState => {
const clonedState: CanvasState = JSON.parse(JSON.stringify(state));
clonedState.displayedFlowVersion = flowHelper.apply(
diff --git a/packages/ui/feature-builder-store/src/lib/store/flow/flow.effects.ts b/packages/ui/feature-builder-store/src/lib/store/flow/flow.effects.ts
index 39dccf9e31..7233510377 100755
--- a/packages/ui/feature-builder-store/src/lib/store/flow/flow.effects.ts
+++ b/packages/ui/feature-builder-store/src/lib/store/flow/flow.effects.ts
@@ -261,11 +261,22 @@ export class FlowsEffects {
},
};
break;
- case FlowsActionType.MOVE_ACTION:
+ case FlowsActionType.MOVE_ACTION: {
flowOperation = {
type: FlowOperationType.MOVE_ACTION,
request: action.operation,
};
+ break;
+ }
+ case FlowsActionType.DUPLICATE_ACTION: {
+ flowOperation = {
+ request: {
+ stepName: action.operation.originalStepName,
+ },
+ type: FlowOperationType.DUPLICATE_ACTION,
+ };
+ break;
+ }
}
if (flow) {
return of(
diff --git a/packages/ui/feature-builder-store/src/lib/store/flow/flows.action.ts b/packages/ui/feature-builder-store/src/lib/store/flow/flows.action.ts
index bcef704e85..ee4213e35e 100755
--- a/packages/ui/feature-builder-store/src/lib/store/flow/flows.action.ts
+++ b/packages/ui/feature-builder-store/src/lib/store/flow/flows.action.ts
@@ -10,6 +10,7 @@ import {
FlowOperationRequest,
Folder,
MoveActionRequest,
+ FlowVersion,
} from '@activepieces/shared';
export enum FlowsActionType {
@@ -28,6 +29,7 @@ export enum FlowsActionType {
MOVE_ACTION = '[FLOWS] MOVE_ACTION',
IMPORT_FLOW = '[FLOWS] IMPORT_FLOW',
TOGGLE_WAITING_TO_SAVE = '[FLOWS] TOGGLE_WAITING_TO_SAVE',
+ DUPLICATE_ACTION = `[FLOWS] DUPLICATE_ACTION`,
}
const updateTrigger = createAction(
@@ -86,6 +88,15 @@ const importFlow = createAction(
flow: Flow;
}>()
);
+const duplicateStep = createAction(
+ FlowsActionType.DUPLICATE_ACTION,
+ props<{
+ operation: {
+ flowVersionWithArtifacts: FlowVersion;
+ originalStepName: string;
+ };
+ }>()
+);
const applyUpdateOperation = createAction(
FlowsActionType.APPLY_UPDATE_OPERATION,
props<{ flow: Flow; operation: FlowOperationRequest; saveRequestId: UUID }>()
@@ -110,6 +121,7 @@ export const FlowsActions = {
moveAction,
importFlow,
toggleWaitingToSave,
+ duplicateStep,
};
export const SingleFlowModifyingState = [
@@ -119,4 +131,5 @@ export const SingleFlowModifyingState = [
updateTrigger,
deleteAction,
moveAction,
+ duplicateStep,
];
diff --git a/packages/ui/feature-builder-store/src/lib/store/flow/flows.reducer.ts b/packages/ui/feature-builder-store/src/lib/store/flow/flows.reducer.ts
index a7ee13c56b..dcc6c3d13f 100755
--- a/packages/ui/feature-builder-store/src/lib/store/flow/flows.reducer.ts
+++ b/packages/ui/feature-builder-store/src/lib/store/flow/flows.reducer.ts
@@ -70,6 +70,22 @@ const _flowsReducer = createReducer(
});
return clonedState;
}),
+ on(FlowsActions.duplicateStep, (state, { operation }): FlowState => {
+ const clonedState: FlowState = JSON.parse(JSON.stringify(state));
+ const clonedFlowVersionWithArtifacts = JSON.parse(
+ JSON.stringify(operation.flowVersionWithArtifacts)
+ );
+ clonedState.flow.version = flowHelper.apply(
+ clonedFlowVersionWithArtifacts,
+ {
+ type: FlowOperationType.DUPLICATE_ACTION,
+ request: {
+ stepName: operation.originalStepName,
+ },
+ }
+ );
+ return clonedState;
+ }),
on(FlowsActions.updateAction, (state, { operation }): FlowState => {
const clonedState: FlowState = JSON.parse(JSON.stringify(state));
clonedState.flow.version = flowHelper.apply(clonedState.flow.version, {
diff --git a/packages/ui/feature-chatbot/src/lib/chat/chat.component.html b/packages/ui/feature-chatbot/src/lib/chat/chat.component.html
index 661bcb947d..da4504c2d5 100644
--- a/packages/ui/feature-chatbot/src/lib/chat/chat.component.html
+++ b/packages/ui/feature-chatbot/src/lib/chat/chat.component.html
@@ -44,10 +44,10 @@
-
+
-
diff --git a/packages/ui/feature-chatbot/src/lib/chat/chat.component.ts b/packages/ui/feature-chatbot/src/lib/chat/chat.component.ts
index df58c55da5..c3ca2ac1b7 100644
--- a/packages/ui/feature-chatbot/src/lib/chat/chat.component.ts
+++ b/packages/ui/feature-chatbot/src/lib/chat/chat.component.ts
@@ -16,14 +16,11 @@ import {
} from 'rxjs';
import { FormControl } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
-import { Chatbot } from '@activepieces/shared';
+import { APChatMessage, Chatbot } from '@activepieces/shared';
import { AuthenticationService, FlagService } from '@activepieces/ui/common';
import { HttpErrorResponse, HttpStatusCode } from '@angular/common/http';
import { MatSnackBar } from '@angular/material/snack-bar';
-type Message = {
- text: string;
- sender: 'user' | 'bot';
-};
+
@Component({
selector: 'app-chat',
@@ -35,11 +32,11 @@ export class ChatComponent {
@ViewChild('chatThread') chatThreadHTML:
| ElementRef
| undefined;
- messages: Message[] = [];
+ messages: APChatMessage[] = [];
messageControl: FormControl;
sendMessage$: Observable | undefined;
sendingMessage$: BehaviorSubject = new BehaviorSubject(false);
- chatbotId: string | undefined;
+ chatbotId: string;
chatbotDisplayName = '';
dots$: Observable;
data$: Observable;
@@ -75,28 +72,30 @@ export class ChatComponent {
}
send() {
- if (this.sendingMessage$.value || !this.messageControl.value?.trim()) {
+ const input = this.messageControl.value?.trim();
+ if (this.sendingMessage$.value || !input) {
return;
}
- const input = this.messageControl.value!;
+
this.messages.push({
text: input,
- sender: 'user',
+ role: 'user',
});
this.messageControl.reset();
this.scrollThreadDown();
this.sendingMessage$.next(true);
this.sendMessage$ = this.chatbotService
.ask({
- chatbotId: this.chatbotId!,
+ chatbotId: this.chatbotId,
input,
+ history:this.messages
})
.pipe(
tap((res) => {
this.sendingMessage$.next(false);
this.messages.push({
text: res.output,
- sender: 'bot',
+ role: 'bot',
});
}),
tap(() => {
@@ -109,17 +108,17 @@ export class ChatComponent {
) {
this.messages.push({
text: 'Oops! make sure your OpenAI api key is valid, it seems it is not.',
- sender: 'bot',
+ role: 'bot',
});
} else if (err.status === HttpStatusCode.PaymentRequired) {
this.messages.push({
text: 'Oops! Your OpenAI quota is exceeded, please check your OpenAI plan and billing details.',
- sender: 'bot',
+ role: 'bot',
});
} else {
this.messages.push({
text: 'Oops! an unexpected error occured, please contact support.',
- sender: 'bot',
+ role: 'bot',
});
}
this.sendingMessage$.next(false);
diff --git a/packages/ui/feature-chatbot/src/lib/chatbot.service.ts b/packages/ui/feature-chatbot/src/lib/chatbot.service.ts
index 3317133d13..de611d87eb 100644
--- a/packages/ui/feature-chatbot/src/lib/chatbot.service.ts
+++ b/packages/ui/feature-chatbot/src/lib/chatbot.service.ts
@@ -15,7 +15,7 @@ import {
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { map } from 'rxjs';
-
+import {AskChatBotRequest} from '@activepieces/shared'
@Injectable({
providedIn: 'root',
})
@@ -43,11 +43,12 @@ export class ChatBotService {
);
}
- ask(req: { chatbotId: string; input: string }) {
+ ask(req: AskChatBotRequest) {
return this.http.post(
environment.apiUrl + '/chatbots/' + req.chatbotId + '/ask',
{
input: req.input,
+ history:req.history
}
).pipe(map(res=>{
const withHtmlNewLines= res.output;
diff --git a/packages/ui/feature-connections/src/lib/add-edit-connection-button/add-edit-connection-button.component.ts b/packages/ui/feature-connections/src/lib/add-edit-connection-button/add-edit-connection-button.component.ts
index fcb1af3547..14ff466051 100644
--- a/packages/ui/feature-connections/src/lib/add-edit-connection-button/add-edit-connection-button.component.ts
+++ b/packages/ui/feature-connections/src/lib/add-edit-connection-button/add-edit-connection-button.component.ts
@@ -447,7 +447,6 @@ export class AddEditConnectionButtonComponent {
) {
this.updateOrAddConnectionDialogClosed$ = currentConnection$.pipe(
switchMap((connection) => {
- console.log(connection);
if (connection.type === AppConnectionType.OAUTH2) {
return this.dialogService
.open(OAuth2ConnectionDialogComponent, {
diff --git a/tsconfig.base.json b/tsconfig.base.json
index 4577704884..c264bf4d30 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -133,6 +133,9 @@
"packages/pieces/mattermost/src/index.ts"
],
"@activepieces/piece-mautic": ["packages/pieces/mautic/src/index.ts"],
+ "@activepieces/piece-microsoft-onedrive": [
+ "packages/pieces/microsoft-onedrive/src/index.ts"
+ ],
"@activepieces/piece-mindee": ["packages/pieces/mindee/src/index.ts"],
"@activepieces/piece-monday": ["packages/pieces/monday/src/index.ts"],
"@activepieces/piece-mysql": ["packages/pieces/mysql/src/index.ts"],