mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 03:02:19 +08:00
fix: incorrect app context
This commit is contained in:
parent
fcaa643a37
commit
2db8bd92b0
@ -71,7 +71,7 @@ const MultiStepContextProvider: React.FC<MultiStepContextProviderProps> = ({
|
||||
return {
|
||||
model,
|
||||
globals: model.flowEngine?.context || {},
|
||||
app: model.flowEngine,
|
||||
app: model.flowEngine?.context?.app,
|
||||
step: null,
|
||||
flow: null,
|
||||
flowKey: '',
|
||||
@ -85,7 +85,7 @@ const MultiStepContextProvider: React.FC<MultiStepContextProviderProps> = ({
|
||||
return {
|
||||
model,
|
||||
globals: model.flowEngine?.context || {},
|
||||
app: model.flowEngine,
|
||||
app: model.flowEngine?.context?.app,
|
||||
step,
|
||||
flow,
|
||||
flowKey,
|
||||
@ -206,7 +206,7 @@ const openRequiredParamsStepFormDialog = async ({
|
||||
const paramsContext = {
|
||||
model,
|
||||
globals: model.flowEngine?.context || {},
|
||||
app: model.flowEngine,
|
||||
app: model.flowEngine?.context?.app,
|
||||
};
|
||||
|
||||
for (const { flowKey, stepKey, step } of requiredSteps) {
|
||||
@ -454,4 +454,4 @@ const openRequiredParamsStepFormDialog = async ({
|
||||
});
|
||||
};
|
||||
|
||||
export { openRequiredParamsStepFormDialog, useStepSettingContext };
|
||||
export { openRequiredParamsStepFormDialog };
|
||||
|
@ -91,7 +91,7 @@ const openStepSettingsDialog = async ({
|
||||
const paramsContext = {
|
||||
model,
|
||||
globals: model.flowEngine?.context || {},
|
||||
app: model.flowEngine,
|
||||
app: model.flowEngine?.context?.app,
|
||||
};
|
||||
|
||||
// 解析 defaultParams
|
||||
@ -138,7 +138,7 @@ const openStepSettingsDialog = async ({
|
||||
const contextValue: StepSettingContextType = {
|
||||
model,
|
||||
globals: model.flowEngine?.context || {},
|
||||
app: model.flowEngine,
|
||||
app: model.flowEngine?.context?.app,
|
||||
step,
|
||||
flow,
|
||||
flowKey,
|
||||
|
@ -91,7 +91,7 @@ const openStepSettingsDrawer = async ({
|
||||
const paramsContext = {
|
||||
model,
|
||||
globals: model.flowEngine?.context || {},
|
||||
app: model.flowEngine,
|
||||
app: model.flowEngine?.context?.app,
|
||||
};
|
||||
|
||||
// 解析 defaultParams
|
||||
@ -180,7 +180,7 @@ const openStepSettingsDrawer = async ({
|
||||
const contextValue: StepSettingContextType = {
|
||||
model,
|
||||
globals: model.flowEngine?.context || {},
|
||||
app: model.flowEngine,
|
||||
app: model.flowEngine?.context?.app,
|
||||
step,
|
||||
flow,
|
||||
flowKey,
|
||||
|
@ -142,7 +142,7 @@ const FlowSettingsContent: React.FC<FlowSettingsContentProps> = observer(({ mode
|
||||
const paramsContext = {
|
||||
model,
|
||||
globals: model.flowEngine?.context || {},
|
||||
app: model.flowEngine,
|
||||
app: model.flowEngine?.context?.app,
|
||||
};
|
||||
|
||||
// 从model中获取每个步骤的参数,如果为空则使用默认参数
|
||||
|
@ -377,9 +377,7 @@ export class FlowModel<Structure extends { parent?: any; subModels?: any } = Def
|
||||
async applyFlow(flowKey: string, extra?: FlowExtraContext): Promise<any> {
|
||||
const currentFlowEngine = this.flowEngine;
|
||||
if (!currentFlowEngine) {
|
||||
console.warn(
|
||||
'FlowEngine not available on this model for applyFlow. Check model.app and model.app.flowEngine setup.',
|
||||
);
|
||||
console.warn('FlowEngine not available on this model for applyFlow. Check and model.flowEngine setup.');
|
||||
return Promise.reject(new Error('FlowEngine not available for applyFlow. Please set flowEngine on the model.'));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user