Enhance Activepieces automation flows with restore UI and publishing

- Add "Restore Defaults" dropdown to Automations page with confirmation
- Create flows in "Defaults" folder for organization
- Pre-populate trigger sample data when creating/restoring flows
- Auto-publish flows (lock and enable) after creation
- Fix email template context variables to match template tags
- Fix dark mode logo switching in Activepieces iframe
- Add iframe refresh on flow restore
- Auto-populate business context (name, email, phone, address) in emails

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-21 23:38:10 -05:00
parent ac3115a5a1
commit 7b380fa903
14 changed files with 786 additions and 149 deletions

View File

@@ -0,0 +1,36 @@
import api from './client';
export interface DefaultFlow {
flow_type: string;
display_name: string;
activepieces_flow_id: string | null;
is_modified: boolean;
is_enabled: boolean;
}
export interface RestoreFlowResponse {
success: boolean;
flow_type: string;
message: string;
}
export interface RestoreAllResponse {
success: boolean;
restored: string[];
failed: string[];
}
export const getDefaultFlows = async (): Promise<DefaultFlow[]> => {
const response = await api.get('/activepieces/default-flows/');
return response.data.flows;
};
export const restoreFlow = async (flowType: string): Promise<RestoreFlowResponse> => {
const response = await api.post(`/activepieces/default-flows/${flowType}/restore/`);
return response.data;
};
export const restoreAllFlows = async (): Promise<RestoreAllResponse> => {
const response = await api.post('/activepieces/default-flows/restore-all/');
return response.data;
};