This is an automated email from the ASF dual-hosted git repository. imbajin pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hugegraph-toolchain.git
commit d50c47e0d6c5969f7c301dcfc3b991b3046307aa Author: dark <[email protected]> AuthorDate: Sat Aug 29 23:19:49 2026 +0800 fix(hubble): restore Vermeer OLAP forms - render Vermeer independently of Computer capability - retain Computer environment gating - remove the misleading unavailable alert --- .../src/i18n/resources/en-US/modules/analysis.json | 2 -- .../src/i18n/resources/zh-CN/modules/analysis.json | 2 -- .../algorithm/algorithmsForm/OlapHome/index.js | 32 ++++++++++------------ .../algorithmsForm/OlapHome/index.test.js | 21 ++++++++++++-- 4 files changed, 34 insertions(+), 23 deletions(-) diff --git a/hugegraph-hubble/hubble-fe/src/i18n/resources/en-US/modules/analysis.json b/hugegraph-hubble/hubble-fe/src/i18n/resources/en-US/modules/analysis.json index 03640f187..2cf38250c 100644 --- a/hugegraph-hubble/hubble-fe/src/i18n/resources/en-US/modules/analysis.json +++ b/hugegraph-hubble/hubble-fe/src/i18n/resources/en-US/modules/analysis.json @@ -482,8 +482,6 @@ "computer_environment_description": "These whole-graph algorithms run asynchronously through HugeGraph Computer. Configure its compute environment, including Kubernetes when required by the deployment, before submitting a task", "computer_unavailable_title": "HugeGraph Computer unavailable", "computer_unavailable_description": "This graph cannot reach HugeGraph Computer. Configure Computer and its Kubernetes environment before running batch algorithms", - "vermeer_unavailable_title": "Vermeer computation is unavailable", - "vermeer_unavailable_description": "This Hubble version cannot securely submit Vermeer compute tasks. Configure HugeGraph Computer or upgrade the Vermeer integration before running batch algorithms", "task_submit_success": "{{name}} task submitted successfully", "common": { "instance_num": "Instance Count", diff --git a/hugegraph-hubble/hubble-fe/src/i18n/resources/zh-CN/modules/analysis.json b/hugegraph-hubble/hubble-fe/src/i18n/resources/zh-CN/modules/analysis.json index fa91e30fd..69ea6a35f 100644 --- a/hugegraph-hubble/hubble-fe/src/i18n/resources/zh-CN/modules/analysis.json +++ b/hugegraph-hubble/hubble-fe/src/i18n/resources/zh-CN/modules/analysis.json @@ -482,8 +482,6 @@ "computer_environment_description": "这些全图算法通过 HugeGraph Computer 异步执行。提交任务前需先配置计算环境;部署要求 Kubernetes 时还需完成对应集群配置", "computer_unavailable_title": "HugeGraph Computer 暂不可用", "computer_unavailable_description": "当前图无法连接 HugeGraph Computer。请完成 Computer 与 Kubernetes 环境配置后再运行批量算法", - "vermeer_unavailable_title": "当前无法运行 Vermeer 计算", - "vermeer_unavailable_description": "当前 Hubble 版本无法安全提交 Vermeer 计算任务。请改用已配置的 HugeGraph Computer,或升级 Vermeer 集成后再运行批量算法", "task_submit_success": "{{name}} 算法任务提交成功", "common": { "instance_num": "实例数", diff --git a/hugegraph-hubble/hubble-fe/src/modules/algorithm/algorithmsForm/OlapHome/index.js b/hugegraph-hubble/hubble-fe/src/modules/algorithm/algorithmsForm/OlapHome/index.js index 38d415633..601664789 100644 --- a/hugegraph-hubble/hubble-fe/src/modules/algorithm/algorithmsForm/OlapHome/index.js +++ b/hugegraph-hubble/hubble-fe/src/modules/algorithm/algorithmsForm/OlapHome/index.js @@ -163,16 +163,12 @@ const OlapFormHome = props => { const shouldDisableForm = isVermeer ? graphStatus !== GRAPH_LOAD_STATUS.LOADED : computerAvailable !== true; - const capabilityTitle = isVermeer - ? 'analysis.algorithm.vermeer_unavailable_title' - : computerAvailable === false - ? 'analysis.algorithm.computer_unavailable_title' - : 'analysis.algorithm.computer_environment_title'; - const capabilityDescription = isVermeer - ? 'analysis.algorithm.vermeer_unavailable_description' - : computerAvailable === false - ? 'analysis.algorithm.computer_unavailable_description' - : 'analysis.algorithm.computer_environment_description'; + const capabilityTitle = computerAvailable === false + ? 'analysis.algorithm.computer_unavailable_title' + : 'analysis.algorithm.computer_environment_title'; + const capabilityDescription = computerAvailable === false + ? 'analysis.algorithm.computer_unavailable_description' + : 'analysis.algorithm.computer_environment_description'; return ( <div> @@ -181,15 +177,17 @@ const OlapFormHome = props => { <Tooltip title={shouldDisableForm ? t(TEXT_PATH.ALGORITHM_COMMON + '.query_tooltip') : ''}> <div className={c.algorithmCatagery}>{OLAP}</div> </Tooltip> - <Alert - showIcon - type={shouldDisableForm ? 'warning' : 'info'} - message={t(capabilityTitle)} - description={t(capabilityDescription)} - /> + {!isVermeer && ( + <Alert + showIcon + type={shouldDisableForm ? 'warning' : 'info'} + message={t(capabilityTitle)} + description={t(capabilityDescription)} + /> + )} </> )} - {!isVermeer && computerAvailable === true && visibleGroups.map(group => ( + {(isVermeer || computerAvailable === true) && visibleGroups.map(group => ( <div key={group.key}> <div className={c.algorithmGoal}> {t(`analysis.algorithm.group.${group.key}`)} diff --git a/hugegraph-hubble/hubble-fe/src/modules/algorithm/algorithmsForm/OlapHome/index.test.js b/hugegraph-hubble/hubble-fe/src/modules/algorithm/algorithmsForm/OlapHome/index.test.js index e60c3a5fd..0b63d8a3e 100644 --- a/hugegraph-hubble/hubble-fe/src/modules/algorithm/algorithmsForm/OlapHome/index.test.js +++ b/hugegraph-hubble/hubble-fe/src/modules/algorithm/algorithmsForm/OlapHome/index.test.js @@ -61,9 +61,12 @@ jest.mock('react-i18next', () => ({ useTranslation: () => ({t: key => key}), })); -const renderHome = () => render( +const renderHome = (context = { + isVermeer: false, + graphStatus: 'LOADED', +}) => render( <GraphAnalysisContext.Provider - value={{isVermeer: false, graphStatus: 'LOADED'}} + value={context} > <OlapFormHome graphSpace="DEFAULT" @@ -77,6 +80,10 @@ const renderHome = () => render( </GraphAnalysisContext.Provider> ); +beforeEach(() => { + jest.clearAllMocks(); +}); + test('does not render runnable Computer algorithms when capability is unavailable', async () => { api.analysis.getOlapCapability.mockResolvedValue({ @@ -109,3 +116,13 @@ test('renders Computer algorithms only after capability succeeds', async () => { {suppressBusinessErrorToast: true} ); }); + +test('renders Vermeer algorithms without probing Computer', () => { + renderHome({isVermeer: true, graphStatus: 'LOADED'}); + + expect(screen.getAllByTestId('olap-item').length).toBeGreaterThan(0); + expect(api.analysis.getOlapCapability).not.toHaveBeenCalled(); + expect(screen.queryByText( + 'analysis.algorithm.vermeer_unavailable_title' + )).not.toBeInTheDocument(); +});
