diff --git a/src/main.tsx b/src/main.tsx index d580507d2e1a2b24e2458002ae7a33ad6c2f49d0..0a3112a6bccfa257e407630a76877f6d3ba7aefa 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -47,7 +47,7 @@ export interface CCMSProps { loadPageFrameURL: (pageID: any) => Promise loadPageConfig: (pageID: any) => Promise loadDomain: (domain: string) => Promise - handlePageRedirect?: (path: string) => void + handlePageRedirect?: (path: string, replaceHistory: boolean) => void callback: (success: boolean) => void onMount?: () => void } diff --git a/src/steps/common.tsx b/src/steps/common.tsx index 88da0fd7de79b099718f3c48cb43adaee7c70647..ad2d42847ded1c5390260ce802c57c7e0db8f7c6 100644 --- a/src/steps/common.tsx +++ b/src/steps/common.tsx @@ -32,7 +32,7 @@ export interface StepProps { loadPageConfig: (pageID: any) => Promise baseRoute: string loadDomain: (domain: string) => Promise - handlePageRedirect?: (path: string) => void + handlePageRedirect?: (path: string, replaceHistory: boolean) => void } /** diff --git a/src/steps/table/index.tsx b/src/steps/table/index.tsx index 8a751a05c24cf4a1c227a38e3438809d878d9fe5..b22febd34de8cd194798c4ae3b9577505b27dc94 100644 --- a/src/steps/table/index.tsx +++ b/src/steps/table/index.tsx @@ -87,7 +87,7 @@ export interface TableCCMSOperationConfig { type: 'ccms' page: any target: 'current' | 'page' | 'open' | 'handle' - historyTpye?: 'replace' + replaceHistory?: boolean targetURL: string width: string data: { [key: string]: ParamConfig } @@ -378,9 +378,9 @@ export default class TableStep extends Step { const targetURL = operation.handle.targetURL || '' const targetKey = queryString.stringifyUrl({ url, query: { ...query, ...params } }, { arrayFormat: 'bracket' }) || '' if (this.props.handlePageRedirect) { - this.props.handlePageRedirect(`${targetURL}${targetKey}`) + this.props.handlePageRedirect(`${targetURL}${targetKey}`, operation.handle?.replaceHistory || false) } else { - if (operation.handle.historyTpye === 'replace') { + if (operation.handle.replaceHistory) { window.location.replace(`${targetURL}${targetKey}`) } else { window.location.href = `${targetURL}${targetKey}` diff --git a/src/util/operation.tsx b/src/util/operation.tsx index 3f9f3b907252ecd5b5a3e3dc3cf9e8599a8bc7cf..bea2da86f494147d9eddaaba7a11fabefb6e862a 100644 --- a/src/util/operation.tsx +++ b/src/util/operation.tsx @@ -58,7 +58,7 @@ interface OperationHelperProps { loadPageConfig: (pageID: any) => Promise, baseRoute: string, loadDomain: (domain: string) => Promise - handlePageRedirect?: (path: string) => void + handlePageRedirect?: (path: string, replaceHistory: boolean) => void children?: (handleOperation: () => void) => React.ReactNode callback?: (success: boolean) => void @@ -122,7 +122,7 @@ export default class OperationHelper extends React.Component