From c2cb845a32ed009891133c4e8e2aea861577b0ba Mon Sep 17 00:00:00 2001 From: wuzilong <704541015@qq.com> Date: Mon, 23 Nov 2026 09:44:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(dify):=20=E6=8A=8A=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=8F=B0=E7=9A=84=E4=B8=AD=E6=96=87=E4=B8=8E?= =?UTF-8?q?=E5=8E=BB=E5=A4=96=E9=93=BE=E6=94=B9=E5=8A=A8=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这些界面改动和专家服务草稿停在工作区,没有随上一笔主分支提交进入仓库。 Co-authored-by: Cursor --- .scratch/expert-service/assets/logo.jpg | Bin 0 -> 33916 bytes .scratch/expert-service/assets/user-icon.png | Bin 0 -> 5434 bytes .../expert-service/dianshi-prototype.html | 1418 +++++++++++++++++ .../api/services/rag_pipeline/rag_pipeline.py | 3 - .../recommended_app_catalog_gateway.py | 2 - .../rag_pipeline/test_rag_pipeline.py | 9 +- .../test_recommended_app_catalog_gateway.py | 9 +- .../dify/docker/docker-compose.override.yaml | 5 + .../[appId]/overview/chart-view.tsx | 13 +- .../built-in-access-points/index.tsx | 14 +- .../built-in-access-points/trigger-card.tsx | 11 +- .../shared/service-api-card-view.tsx | 13 +- .../config-var/config-modal/form-fields.tsx | 15 +- .../settings-modal/retrieval-section.tsx | 8 - .../tools/external-data-tool-modal.tsx | 16 +- .../web/app/components/app/deploy/index.tsx | 14 - .../components/app/in-site-message/index.tsx | 3 +- .../app/log-annotation/page-title.tsx | 7 +- .../app/overview/customize/index.tsx | 3 + .../app/overview/settings/index.tsx | 14 +- .../moderation/moderation-setting-modal.tsx | 15 +- .../base/form/components/base/base-field.tsx | 3 +- .../components/base/markdown-blocks/link.tsx | 3 + .../billing/apps-full-in-dialog/index.tsx | 13 +- .../__tests__/index.spec.tsx | 11 +- .../multimodal-retrieval-guidance/index.tsx | 14 - .../__tests__/built-in-pipeline-list.spec.tsx | 59 +- .../list/built-in-pipeline-list.tsx | 32 - .../create-from-pipeline/list/index.tsx | 2 - .../create/embedding-process/index.tsx | 21 +- .../step-three/__tests__/index.spec.tsx | 9 +- .../datasets/create/step-three/index.tsx | 13 +- .../components/indexing-mode-section.tsx | 13 +- .../datasets/create/website/base/header.tsx | 25 +- .../create/website/base/url-input.tsx | 4 +- .../watercrawl/__tests__/index.spec.tsx | 48 +- .../documents/components/documents-header.tsx | 13 +- .../data-source/base/header.tsx | 21 +- .../__tests__/index.spec.tsx | 7 +- .../processing/embedding-process/index.tsx | 21 +- .../create-from-pipeline/processing/index.tsx | 12 +- .../external-api/external-api-modal/Form.tsx | 14 - .../external-api/external-api-panel/index.tsx | 16 +- .../create/InfoPanel.tsx | 18 - .../external-knowledge-base/create/index.tsx | 10 - .../api-access/__tests__/index.spec.tsx | 4 +- .../datasets/extra-info/api-access/card.tsx | 31 +- .../service-api/__tests__/index.spec.tsx | 4 +- .../datasets/extra-info/service-api/card.tsx | 25 +- .../hit-testing/modify-retrieval-modal.tsx | 12 +- .../datasets/no-linked-apps-panel.tsx | 16 +- .../form/components/indexing-section.tsx | 20 +- .../commands/__tests__/commands.spec.tsx | 7 +- .../goto-anything/actions/commands/catalog.ts | 2 - .../actions/commands/discord.tsx | 27 +- .../goto-anything/actions/commands/docs.tsx | 10 +- .../permission-set-modal/index.tsx | 14 - .../api-based-extension-page/empty.tsx | 14 +- .../api-based-extension-page/modal.tsx | 20 +- .../__tests__/index.spec.tsx | 127 +- .../data-source-page-new/index.tsx | 13 +- .../install-from-marketplace.tsx | 36 - .../header/account-setting/index.tsx | 3 +- .../__tests__/index.spec.tsx | 2 +- .../model-provider-page/index.tsx | 5 - .../install-from-marketplace.tsx | 36 - .../model-provider-page/model-modal/index.tsx | 5 +- .../model-provider-page-body.tsx | 51 +- .../model-selector/__tests__/popup.spec.tsx | 7 +- .../model-selector/marketplace-section.tsx | 41 - .../model-selector/popup.tsx | 2 +- .../permissions-page/role-modal/index.tsx | 14 - .../header/utils/__tests__/util.spec.ts | 13 +- .../web/app/components/header/utils/util.ts | 3 +- .../integrations/__tests__/page.spec.tsx | 41 +- .../__tests__/tool-provider-list.spec.tsx | 14 +- .../web/app/components/integrations/index.tsx | 38 +- .../integrations/tool-provider-card.tsx | 19 +- .../integrations/tool-provider-list.tsx | 12 - .../main-nav/__tests__/index.spec.tsx | 66 +- .../__tests__/support-menu.spec.tsx | 19 +- .../main-nav/components/help-menu.tsx | 64 +- .../main-nav/components/support-menu.tsx | 43 +- .../web/app/components/main-nav/routes.ts | 4 +- .../plugins/base/deprecation-notice.tsx | 11 +- .../components/plugins/card/base/org-info.tsx | 8 +- .../web/app/components/plugins/card/index.tsx | 8 +- .../__tests__/dify-profile.spec.tsx | 22 +- .../creator-profile/creator-sidebar.tsx | 13 +- .../marketplace/creator-profile/header.tsx | 8 +- .../plugins/marketplace/description/index.tsx | 6 - .../__tests__/local-detail.spec.tsx | 55 + .../marketplace/detail-dialog/index.tsx | 14 + .../detail-dialog/local-detail.tsx | 188 +++ .../embedded-marketplace-search.spec.tsx | 14 +- .../home/__tests__/home-header.spec.tsx | 34 +- .../home/__tests__/home-trending.spec.tsx | 75 +- .../marketplace/home/home-creator-center.tsx | 2 + .../plugins/marketplace/home/home-header.tsx | 14 - .../marketplace/home/home-trending-slides.tsx | 67 +- .../home/marketplace-search-autocomplete.tsx | 5 +- .../list/__tests__/card-wrapper.spec.tsx | 19 +- .../__tests__/list-with-collection.spec.tsx | 11 +- .../plugins/marketplace/list/card-wrapper.tsx | 19 +- .../marketplace/list/list-with-collection.tsx | 33 +- .../__tests__/template-card.spec.tsx | 30 +- .../__tests__/template-detail-route.spec.tsx | 11 +- .../marketplace/templates/template-card.tsx | 9 +- .../templates/template-collection-list.tsx | 36 +- .../marketplace/use-detail-navigation.ts | 50 +- .../plugin-detail-panel/endpoint-list.tsx | 13 +- .../plugin-detail-panel/endpoint-modal.tsx | 3 +- .../plugin-detail-panel/operation-menu.tsx | 15 +- .../components/reasoning-config-form.tsx | 3 +- .../components/plugins/plugin-item/index.tsx | 19 +- .../category-marketplace-panel.spec.tsx | 31 +- .../__tests__/plugins-panel.spec.tsx | 26 +- .../category-marketplace-panel.tsx | 21 - .../plugins/plugin-page/debug-info.tsx | 27 +- .../plugins/plugin-page/nav-operations.tsx | 5 +- .../plugin-page/plugins-panel-results.tsx | 38 +- .../plugins/plugin-page/plugins-panel.tsx | 15 +- .../app/components/plugins/provider-card.tsx | 43 +- .../auto-update-setting/tool-item.tsx | 8 +- .../rag-pipeline-header/publisher/index.tsx | 10 - .../rag-pipeline-header/publisher/popup.tsx | 7 +- .../utils/__tests__/nodes.spec.ts | 3 + .../components/rag-pipeline/utils/nodes.ts | 68 +- .../step-by-step-tour/coachmark.tsx | 4 +- .../step-by-step-tour/floating-widget.tsx | 5 +- .../marketplace/__tests__/index.spec.tsx | 8 +- .../components/tools/marketplace/index.tsx | 24 - .../tools/provider/__tests__/empty.spec.tsx | 5 +- .../tools/provider/create-entry-card.tsx | 29 +- .../app/components/tools/provider/detail.tsx | 7 +- .../app/components/tools/provider/empty.tsx | 12 +- .../setting/build-in/config-credentials.tsx | 3 +- .../__tests__/all-start-blocks.spec.tsx | 50 +- .../__tests__/tool-browser.spec.tsx | 6 +- .../__tests__/tool-picker.spec.tsx | 7 +- .../block-selector/all-start-blocks.tsx | 49 - .../block-selector/featured-tools.tsx | 20 +- .../block-selector/featured-triggers.tsx | 20 +- .../__tests__/action.spec.tsx | 9 +- .../__tests__/item-list.spec.tsx | 29 +- .../marketplace-plugin/action.tsx | 14 +- .../marketplace-plugin/list.tsx | 43 +- .../rag-tool-recommendations/index.tsx | 26 +- .../workflow/block-selector/tool-browser.tsx | 16 - .../tool/tool-list-tree-view/item.tsx | 8 +- .../tool/tool-list-tree-view/list.tsx | 3 +- .../workflow/block-selector/tool/tool.tsx | 3 +- .../block-selector/trigger-plugin/item.tsx | 5 +- .../context-menu-content.tsx | 22 +- .../workflow/node-actions-menu/index.tsx | 22 +- .../workflow/node-actions-menu/shared.tsx | 2 +- .../agent-strategy-selector.spec.tsx | 7 +- .../_base/components/agent-strategy-list.tsx | 16 +- .../nodes/_base/components/agent-strategy.tsx | 14 +- .../error-handle/fail-branch-card.tsx | 14 +- .../nodes/_base/components/help-link.tsx | 3 +- .../components/switch-plugin-version.tsx | 18 - .../agent-v2/components/agent-task-field.tsx | 15 +- .../nodes/document-extractor/panel.tsx | 6 - .../migration/migration-banner.tsx | 3 +- .../delivery-method/method-selector.tsx | 43 +- .../chunk-structure/instruction/index.tsx | 13 +- .../components/retrieval-setting/index.tsx | 13 +- .../nodes/tool/components/tool-form/item.tsx | 6 + .../web/app/components/workflow/run/node.tsx | 12 +- .../app/components/workflow/run/status.tsx | 17 +- .../workflow/variable-inspect/empty.tsx | 13 +- .../app/education/apply/application-form.tsx | 32 +- .../web/app/education/expire-notice/modal.tsx | 21 +- .../web/app/education/verify/verify-flow.tsx | 11 +- .../dify/web/app/notifications/index.tsx | 46 +- demo-dify/dify/web/context/i18n.spec.ts | 333 +--- demo-dify/dify/web/context/i18n.ts | 30 +- .../components/service-api-access-card.tsx | 20 +- .../agent-v2/agent-detail/access/page.tsx | 13 +- .../orchestrate/common/docs-link.tsx | 3 + .../orchestrate/prompt-editor/slash.tsx | 21 +- .../orchestrate/tools/cli-tool/dialog.tsx | 13 +- .../components/preview/chat-conversation.tsx | 17 +- .../configure/components/preview/header.tsx | 19 +- .../agent-v2/agent-detail/logs/page.tsx | 13 +- .../web/features/agent-v2/roster/page.tsx | 19 +- .../web/features/app-access-error/page.tsx | 2 +- .../im-platform/email-config-dialog.tsx | 14 +- .../web/features/home/banner/banner-item.tsx | 3 +- .../__tests__/home-content.spec.tsx | 7 +- .../home/home-content/home-content.tsx | 85 +- .../home/home-content/templates-header.tsx | 16 - .../loaded-form-content.browser.spec.tsx | 4 +- .../human-input/form/branding-footer.tsx | 2 +- .../new-rag/list/knowledge-view-switcher.tsx | 12 +- .../new-rag/space/api-access-dialog.tsx | 15 +- .../upgrade/knowledge-upgrade-card.tsx | 5 +- .../upgrade/knowledge-upgrade-dialog.tsx | 12 +- .../web/i18n/locales/en-US/app-overview.json | 2 +- .../dify/web/i18n/locales/en-US/billing.json | 6 +- .../web/i18n/locales/zh-Hans/agent-v-2.json | 18 +- .../web/i18n/locales/zh-Hans/app-debug.json | 2 +- .../i18n/locales/zh-Hans/app-overview.json | 2 +- .../web/i18n/locales/zh-Hans/billing.json | 6 +- .../web/i18n/locales/zh-Hans/dataset.json | 2 +- .../web/i18n/locales/zh-Hans/education.json | 2 +- .../__tests__/chinese-system-message.spec.ts | 19 + .../web/service/chinese-system-message.ts | 292 ++++ demo-dify/dify/web/utils/official-link.ts | 18 + demo-dify/dify/web/utils/visible-author.ts | 8 + 211 files changed, 3030 insertions(+), 2794 deletions(-) create mode 100644 .scratch/expert-service/assets/logo.jpg create mode 100644 .scratch/expert-service/assets/user-icon.png create mode 100644 .scratch/expert-service/dianshi-prototype.html create mode 100644 demo-dify/dify/web/app/components/plugins/marketplace/detail-dialog/__tests__/local-detail.spec.tsx create mode 100644 demo-dify/dify/web/app/components/plugins/marketplace/detail-dialog/local-detail.tsx create mode 100644 demo-dify/dify/web/service/__tests__/chinese-system-message.spec.ts create mode 100644 demo-dify/dify/web/service/chinese-system-message.ts create mode 100644 demo-dify/dify/web/utils/official-link.ts create mode 100644 demo-dify/dify/web/utils/visible-author.ts diff --git a/.scratch/expert-service/assets/logo.jpg b/.scratch/expert-service/assets/logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ee8e165d3b667ece194dcfdff52c648d0cde4a43 GIT binary patch literal 33916 zcmce-1zc6_(m1;5?(Pl=>F$sQK@kuT32BfL1f;u>?(POD0|cbIL%JL34)59<^*!f3 z@A*qHR79z|$;2#t<2pS6t1`FzE8;ArD6$Aqo z_s<0n3x@y$1r00`0dVm3X9)y?1yWkpg_==Fqj|^RMWpK|8=Xs@z#65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Bu2ho5f zLaZ@(FvZd1U3#{0dO_I_OJ}Pi#Wu;C?I^8e_Z7lpsY9kSOpsev-<{b2t4NRe_(cN9 zln8v~4$RSs$c#LRAWsN+GviwD9_#oF68j}6_d1mW3p#~iJD@y-qE?IJJV}k76Jcih zm^<5zPizI}WkMe0D8@(o6b*x#-Z4}`Vy@#O(FTf4fR716_ zz=Y{ELeaUWKk5#;aqQYN>PGEV|DA$fw`q~Iz>uQtNsZap9%YN^ zu>;5U1(MRXCGWx)e6M_jNSB*7?7>Vz(L1KR^7shv*QyL&SZaSsMo|EoCtQIXwBii4(t5lbi7q(flo!T2~!-@+-L85U>azmw0iKPuD8YJ z*4AO#8koU_cuh_|{v#u|G`zDpMcedCFGz#-#w*K*mF_A zFW{dXVY^s65`090 zO;Yw2QDg}B9~*gckBbFZ;$CU(;2s=0d~E9{UWn(uW|(JJ|AUHL#7Zu8d20DHEavB`VxS(8@K1x(smqvVuPH2Zqg;bYt)p2K z=}=~S{7W^f9=&YIjc&NtZXPoIWo1sppxZRdBW1K zB!?^oEYYsJCWWQW1t{;H7GtK?&~JW>cr9oBI3OzqBkX%}`eHFNYot1!^ON^|Eg+C8 aW?H|>r7~pfQ$^Qog(QjV> literal 0 HcmV?d00001 diff --git a/.scratch/expert-service/assets/user-icon.png b/.scratch/expert-service/assets/user-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..451171b301fdce8a54fa9991caf89bd5927ce910 GIT binary patch literal 5434 zcmZvgWmr@H8^*_&up!C@2$BxiP(o5V2SWyW z^Xhy601D7TqwWPzZREv2+mwezHaG+13qdOYJ!G2Nn=lrU^l2<@8t|IiL`PD(Y~l^c zdW6-%jo?K(WGLkSP?5s|sV%4OfLC zyx>rCR3R_Q^x=zFs)bCH&^(afkRnYuykESzuPP4?1+5|s?3TpAAXH+P(!)(qxH9Am zq}lG_1w}bYvI{VPg~Kr#9_qgTSKt><=u@>#P=z`s+?}Qc{#SrWbzU5Loev6PD}fz` zcY-LTK*<60pk9h$@8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}N|K4fEvuX;L>eI5D=V6nl z+*_{Ldrb(qvw6#)<^y~uPKO%@TL*vr$y(%(;iEU5;}R@!bp}N_m^#1D95YLWXHu=w zB$9&q)snrz_CRAHLYvEANei%d$jBF{ufP0N4Od6UNnbWESN26-q9TyLmA= z);h)ma%>p_=e@W=jrMED`hKGe<9gV7aB(_*;VWk$G(x4R+xNAzcpDNJCm_!Esz1PG z?J37sVO&@~VDTw~lF#TTU|2<<$0Y+3&DAU6eG4d^lxR17&$FVFsopy|aNv#!fZ>@E zDXAK2E}4l(84xiJUs4-g1$6Q!W0f4$0zG89-O9>#3F6|V{thN#MRF-*mluto#7Gp;Yr0U9%EMh&+UO}RgZMupiSPbOg1@kAXT6pD zkIY>X9(qFYE4@7{ZuN+gEPvTNYl?+}->ljk8YTI}9IT*@G-+?>K#Y`pJo-L$I2$ER zvJhaNzqv+yq9{s3SY*o+3ORe%qwsK@g2ynAs4ja?QJ|f3y#LSy z8}N`H^Qeo?dx~P`ob+sH5=OC0#9e#Us7b+i+8__QS literal 0 HcmV?d00001 diff --git a/.scratch/expert-service/dianshi-prototype.html b/.scratch/expert-service/dianshi-prototype.html new file mode 100644 index 00000000..d001b4c6 --- /dev/null +++ b/.scratch/expert-service/dianshi-prototype.html @@ -0,0 +1,1418 @@ + + + + + + 智能估价 · UI 原型(可丢弃) + + + + + + + +

+
原型 · 智能估价(非正式代码,内存态,可丢弃)
+
+ 身份预览: + + +
+
+ +
+ + +
+
+
+ + +
+
+ +
+ +
+
+
+ + + + +
+
+

支持 pdf / docx / txt / md / xlsx / csv / jpg / png / webp。回答含可折叠思考过程。演示文稿不构成正式评估意见。

+
+ 内网知识库 · 默认开启 + +
+
+ +
+
+
+ + + + + + + + + + +
+ + + + diff --git a/demo-dify/dify/api/services/rag_pipeline/rag_pipeline.py b/demo-dify/dify/api/services/rag_pipeline/rag_pipeline.py index 4c085c5f..7e4753a3 100644 --- a/demo-dify/dify/api/services/rag_pipeline/rag_pipeline.py +++ b/demo-dify/dify/api/services/rag_pipeline/rag_pipeline.py @@ -139,9 +139,6 @@ class RagPipelineService: mode = dify_config.HOSTED_FETCH_PIPELINE_TEMPLATES_MODE retrieval_instance = PipelineTemplateRetrievalFactory.get_pipeline_template_factory(mode)() result = retrieval_instance.get_pipeline_templates(language, current_tenant_id, session=session) - if not result.get("pipeline_templates") and language != "en-US": - template_retrieval = PipelineTemplateRetrievalFactory.get_built_in_pipeline_template_retrieval() - result = template_retrieval.fetch_pipeline_templates_from_builtin("en-US") return result else: mode = "customized" diff --git a/demo-dify/dify/api/services/recommended_app_catalog_gateway.py b/demo-dify/dify/api/services/recommended_app_catalog_gateway.py index 750e1ac1..7108e7d8 100644 --- a/demo-dify/dify/api/services/recommended_app_catalog_gateway.py +++ b/demo-dify/dify/api/services/recommended_app_catalog_gateway.py @@ -221,8 +221,6 @@ class RecommendedAppCatalogRouter(RecommendedAppCatalogQuery): logger.warning("fetch recommended apps from dify official failed: %s, switch to built-in.", error) page = self._builtin.list_recommended(language) - if not page.recommended_apps: - return self._builtin.list_recommended(_BUILTIN_FALLBACK_LANGUAGE) return page @override diff --git a/demo-dify/dify/api/tests/unit_tests/services/rag_pipeline/test_rag_pipeline.py b/demo-dify/dify/api/tests/unit_tests/services/rag_pipeline/test_rag_pipeline.py index c397af27..3165d832 100644 --- a/demo-dify/dify/api/tests/unit_tests/services/rag_pipeline/test_rag_pipeline.py +++ b/demo-dify/dify/api/tests/unit_tests/services/rag_pipeline/test_rag_pipeline.py @@ -311,7 +311,7 @@ class TestRagPipelineServiceCases: assert "FOR UPDATE" in sql @staticmethod - def test_get_pipeline_templates_fallbacks_to_builtin_for_non_english_empty_result( + def test_get_pipeline_templates_keeps_empty_result_for_non_english( mocker: MockerFixture, sqlite_session: Session, config_overrides: Callable[..., None] ) -> None: config_overrides(HOSTED_FETCH_PIPELINE_TEMPLATES_MODE="remote") @@ -324,16 +324,13 @@ class TestRagPipelineServiceCases: factory_mock.get_pipeline_template_factory.return_value.return_value = remote_retrieval builtin_retrieval = mocker.Mock() - builtin_retrieval.fetch_pipeline_templates_from_builtin.return_value = { - "pipeline_templates": [{"id": "builtin-1"}] - } factory_mock.get_built_in_pipeline_template_retrieval.return_value = builtin_retrieval result = RagPipelineService.get_pipeline_templates(type="built-in", language="ja-JP", session=session) - assert result == {"pipeline_templates": [{"id": "builtin-1"}]} + assert result == {"pipeline_templates": []} remote_retrieval.get_pipeline_templates.assert_called_once_with("ja-JP", None, session=session) - builtin_retrieval.fetch_pipeline_templates_from_builtin.assert_called_once_with("en-US") + builtin_retrieval.fetch_pipeline_templates_from_builtin.assert_not_called() @staticmethod def test_get_pipeline_templates_customized_mode_uses_customized_factory( diff --git a/demo-dify/dify/api/tests/unit_tests/services/test_recommended_app_catalog_gateway.py b/demo-dify/dify/api/tests/unit_tests/services/test_recommended_app_catalog_gateway.py index e6ff933c..23cee07c 100644 --- a/demo-dify/dify/api/tests/unit_tests/services/test_recommended_app_catalog_gateway.py +++ b/demo-dify/dify/api/tests/unit_tests/services/test_recommended_app_catalog_gateway.py @@ -304,11 +304,10 @@ class TestRemoteRecommendedAppCatalogGateway: assert [app.app_id for app in learn_dify.recommended_apps] == ["app-2", "app-1"] assert learn_dify.categories == () - def test_list_fetch_error_falls_back_through_builtin_en_us(self, monkeypatch: pytest.MonkeyPatch) -> None: + def test_list_fetch_error_keeps_empty_builtin_page(self, monkeypatch: pytest.MonkeyPatch) -> None: fallback = RecordingCatalog() empty_page = RecommendedAppCatalogPage(recommended_apps=(), categories=()) - fallback_page = _expected_page(categories=("builtin",)) - fallback.recommended_pages = [empty_page, fallback_page] + fallback.recommended_pages = [empty_page] remote = RemoteRecommendedAppCatalogGateway() router = RecommendedAppCatalogRouter( remote=remote, @@ -318,8 +317,8 @@ class TestRemoteRecommendedAppCatalogGateway: monkeypatch.setattr(remote, "_fetch_page", _fetch_timeout) - assert router.list_recommended("fr-FR") == fallback_page - assert fallback.calls == [("recommended", "fr-FR"), ("recommended", "en-US")] + assert router.list_recommended("fr-FR") == empty_page + assert fallback.calls == [("recommended", "fr-FR")] def test_json_decode_error_falls_back_to_builtin(self, monkeypatch: pytest.MonkeyPatch) -> None: fallback = RecordingCatalog() diff --git a/demo-dify/dify/docker/docker-compose.override.yaml b/demo-dify/dify/docker/docker-compose.override.yaml index 5a2abb74..5b8b94cb 100644 --- a/demo-dify/dify/docker/docker-compose.override.yaml +++ b/demo-dify/dify/docker/docker-compose.override.yaml @@ -15,6 +15,11 @@ services: environment: GSREA_SSO_SECRET: ${GSREA_SSO_SECRET:-} GSREA_SSO_CONSOLE_WEB_URL: ${GSREA_SSO_CONSOLE_WEB_URL:-http://127.0.0.1:13080} + # Local catalog only. An empty recommended_apps table stays empty. + HOSTED_FETCH_APP_TEMPLATES_MODE: db + HOSTED_FETCH_PIPELINE_TEMPLATES_MODE: database volumes: - ../api/controllers/console/auth/gsrea_sso.py:/app/api/controllers/console/auth/gsrea_sso.py:ro - ../api/controllers/console/__init__.py:/app/api/controllers/console/__init__.py:ro + - ../api/services/recommended_app_catalog_gateway.py:/app/api/services/recommended_app_catalog_gateway.py:ro + - ../api/services/rag_pipeline/rag_pipeline.py:/app/api/services/rag_pipeline/rag_pipeline.py:ro diff --git a/demo-dify/dify/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx b/demo-dify/dify/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx index c8cda4c9..c91b79bf 100644 --- a/demo-dify/dify/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx +++ b/demo-dify/dify/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx @@ -11,7 +11,6 @@ import { useState } from 'react' import { useTranslation } from 'react-i18next' import { TIME_PERIOD_MAPPING as LONG_TIME_PERIOD_MAPPING } from '@/app/components/app/log/filter' import { AppCharts } from '@/app/components/app/overview/app-chart' -import { useDocLink } from '@/context/i18n' import { systemFeaturesQueryOptions } from '@/features/system-features/client' import LongTimeRangePicker from './long-time-range-picker' import TimeRangePicker from './time-range-picker' @@ -61,8 +60,7 @@ function ChartViewContent({ const { t } = useTranslation(['appLog', 'common']) const isCloudEdition = deploymentEdition === 'CLOUD' const isNonCloudEdition = deploymentEdition === 'COMMUNITY' || deploymentEdition === 'ENTERPRISE' - const docLink = useDocLink() - const [period, setPeriod] = useState(() => + const [period, setPeriod] = useState(() => isCloudEdition ? { name: t(($) => $['filter.period.today'], { ns: 'appLog' }), @@ -93,15 +91,6 @@ function ChartViewContent({

{t(($) => $['monitoring.description'], { ns: 'appLog' })}

- - {t(($) => $['operation.learnMore'], { ns: 'common' })} -
diff --git a/demo-dify/dify/web/app/components/app/access-point/built-in-access-points/index.tsx b/demo-dify/dify/web/app/components/app/access-point/built-in-access-points/index.tsx index e80c744f..d8d865a2 100644 --- a/demo-dify/dify/web/app/components/app/access-point/built-in-access-points/index.tsx +++ b/demo-dify/dify/web/app/components/app/access-point/built-in-access-points/index.tsx @@ -7,7 +7,6 @@ import { skipToken, useQuery, useSuspenseQuery } from '@tanstack/react-query' import { useAtomValue } from 'jotai' import { useTranslation } from 'react-i18next' import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder' -import { useDocLink } from '@/context/i18n' import { currentWorkspaceAtom, currentWorkspaceLoadingAtom } from '@/context/workspace-state' import { systemFeaturesQueryOptions } from '@/features/system-features/client' import Link from '@/next/link' @@ -39,8 +38,7 @@ export function BuiltInAccessPoints({ highlightedAccessPoint, }: BuiltInAccessPointsProps) { const { t } = useTranslation(['common', 'deployments']) - const docLink = useDocLink() - const { data: appInfo } = useSuspenseQuery( + const { data: appInfo } = useSuspenseQuery( consoleQuery.apps.byAppId.get.queryOptions({ input: { params: { app_id: appId } } }), ) const { data: systemFeatures } = useSuspenseQuery(systemFeaturesQueryOptions()) @@ -185,15 +183,7 @@ export function BuiltInAccessPoints({ {t(($) => $['studio.accessPoint.triggerExclusiveNotice'], { ns: 'deployments', - })}{' '} - - {t(($) => $['operation.learnMore'], { ns: 'common' })} - + })}
)} diff --git a/demo-dify/dify/web/app/components/app/access-point/built-in-access-points/trigger-card.tsx b/demo-dify/dify/web/app/components/app/access-point/built-in-access-points/trigger-card.tsx index d6ddfadb..bca63e4f 100644 --- a/demo-dify/dify/web/app/components/app/access-point/built-in-access-points/trigger-card.tsx +++ b/demo-dify/dify/web/app/components/app/access-point/built-in-access-points/trigger-card.tsx @@ -15,7 +15,6 @@ import BlockIcon from '@/app/components/workflow/block-icon' import { useTriggerStatusStore } from '@/app/components/workflow/store/trigger-status' import { BlockEnum } from '@/app/components/workflow/types' import { toast } from '@/app/notifications' -import { useDocLink } from '@/context/i18n' import Link from '@/next/link' import { consoleQuery } from '@/service/console' import { useAllTriggerPlugins } from '@/service/use-triggers' @@ -155,8 +154,7 @@ export function TriggerAccessPointCard({ highlighted, }: TriggerAccessPointCardProps) { const { t } = useTranslation(['appOverview', 'deployments', 'navigation']) - const docLink = useDocLink() - const { data: response, isLoading } = useQuery( + const { data: response, isLoading } = useQuery( consoleQuery.apps.byAppId.triggers.get.queryOptions({ input: { params: { app_id: appInfo.id } }, enabled: !!appInfo.id, @@ -210,16 +208,13 @@ export function TriggerAccessPointCard({ {t(($) => $['overview.triggerInfo.triggerStatusDescription'], { ns: 'appOverview', })}{' '} - {t(($) => $['overview.triggerInfo.learnAboutTriggers'], { ns: 'appOverview', })} - + )} diff --git a/demo-dify/dify/web/app/components/app/access-point/shared/service-api-card-view.tsx b/demo-dify/dify/web/app/components/app/access-point/shared/service-api-card-view.tsx index 557ccab5..7000b15b 100644 --- a/demo-dify/dify/web/app/components/app/access-point/shared/service-api-card-view.tsx +++ b/demo-dify/dify/web/app/components/app/access-point/shared/service-api-card-view.tsx @@ -3,12 +3,13 @@ import type { AppDetailWithSite } from '@dify/contracts/api/console/apps/types.gen' import type { ReactNode } from 'react' import type { AccessPointStatus } from '@/app/components/base/access-point/status' -import { Button, buttonVariants } from '@langgenius/dify-ui/button' +import { buttonVariants } from '@langgenius/dify-ui/button' import { cn } from '@langgenius/dify-ui/cn' import { useTranslation } from 'react-i18next' import { AccessPointCard } from '@/app/components/base/access-point/card' import { AccessPointUrl } from '@/app/components/base/access-point/url' import { useDocLink } from '@/context/i18n' +import { isOfficialDifyUrl } from '@/utils/official-link' import Link from '@/next/link' import { useAccessPointStatusLabel } from './use-access-point-status-label' import { getAppApiReferencePath } from './utils' @@ -59,7 +60,7 @@ export function ServiceApiCardView({ actions={ <> {apiKeyAction} - {available && apiReferenceUrl ? ( + {available && apiReferenceUrl && !isOfficialDifyUrl(apiReferenceUrl) ? ( $['overview.apiInfo.doc'], { ns: 'appOverview' })} - ) : ( - - )} + ) : null} } > diff --git a/demo-dify/dify/web/app/components/app/configuration/config-var/config-modal/form-fields.tsx b/demo-dify/dify/web/app/components/app/configuration/config-var/config-modal/form-fields.tsx index a23cc8d2..dd8672b4 100644 --- a/demo-dify/dify/web/app/components/app/configuration/config-var/config-modal/form-fields.tsx +++ b/demo-dify/dify/web/app/components/app/configuration/config-var/config-modal/form-fields.tsx @@ -31,7 +31,6 @@ import CodeEditor from '@/app/components/workflow/nodes/_base/components/editor/ import FileUploadSetting from '@/app/components/workflow/nodes/_base/components/file-upload-setting' import { CodeLanguage } from '@/app/components/workflow/nodes/code/types' import { InputVarType, SupportUploadFileTypes } from '@/app/components/workflow/types' -import { useDocLink } from '@/context/i18n' import { TransferMethod } from '@/types/app' import ConfigSelect from '../config-select' import ConfigString from '../config-string' @@ -42,6 +41,10 @@ import { CHECKBOX_DEFAULT_FALSE_VALUE, CHECKBOX_DEFAULT_TRUE_VALUE, TEXT_MAX_LEN const EMPTY_SELECT_VALUE = '__empty__' as const +function HiddenOfficialPhrase() { + return null +} + type ConfigModalFormFieldsProps = { checkboxDefaultSelectValue: string isStringInput: boolean @@ -92,7 +95,6 @@ const ConfigModalFormFields: FC = ({ ? Number(tempPayload.default) : Number.NaN const isFileInput = fileInputTypes.includes(type) - const docLink = useDocLink() const fieldId = React.useId() const errorId = `${fieldId}-error` const getError = (field: ConfigModalValidationError['field']) => @@ -416,14 +418,7 @@ const ConfigModalFormFields: FC = ({ i18nKey={($) => $['variableConfig.hiddenDescription']} ns="appDebug" components={{ - docLink: ( - - ), + docLink: , }} /> diff --git a/demo-dify/dify/web/app/components/app/configuration/dataset-config/settings-modal/retrieval-section.tsx b/demo-dify/dify/web/app/components/app/configuration/dataset-config/settings-modal/retrieval-section.tsx index 76147796..13f1c23d 100644 --- a/demo-dify/dify/web/app/components/app/configuration/dataset-config/settings-modal/retrieval-section.tsx +++ b/demo-dify/dify/web/app/components/app/configuration/dataset-config/settings-modal/retrieval-section.tsx @@ -131,14 +131,6 @@ const InternalRetrievalSection: FC = ({ {t(($) => $['form.retrievalSetting.title'], { ns: 'datasetSettings' })}
- - {t(($) => $['form.retrievalSetting.learnMore'], { ns: 'datasetSettings' })} - {t(($) => $['form.retrievalSetting.description'], { ns: 'datasetSettings' })}
diff --git a/demo-dify/dify/web/app/components/app/configuration/tools/external-data-tool-modal.tsx b/demo-dify/dify/web/app/components/app/configuration/tools/external-data-tool-modal.tsx index 1551f0c4..607c6a99 100644 --- a/demo-dify/dify/web/app/components/app/configuration/tools/external-data-tool-modal.tsx +++ b/demo-dify/dify/web/app/components/app/configuration/tools/external-data-tool-modal.tsx @@ -32,7 +32,6 @@ import { IconPickerTrigger, } from '@/app/components/base/icon-picker' import { ApiBasedExtensionSelector } from '@/app/components/header/account-setting/api-based-extension-page/selector' -import { useDocLink } from '@/context/i18n' import { codeBasedExtensionsQueryOptions } from '@/features/code-based-extension/query' import { buildProviders, @@ -54,8 +53,7 @@ const ExternalDataToolModal: FC = ({ onValidateBeforeSave, }) => { const { t } = useTranslation(['appDebug', 'common', 'app']) - const docLink = useDocLink() - const locale = useLocale() + const locale = useLocale() const [localeData, setLocaleData] = useState(data.type ? data : { ...data, type: 'api' }) const { data: codeBasedExtensionList } = useQuery( codeBasedExtensionsQueryOptions('external_data_tool'), @@ -218,18 +216,6 @@ const ExternalDataToolModal: FC = ({
{t(($) => $['apiBasedExtension.selector.title'], { ns: 'common' })} - - - {t(($) => $['apiBasedExtension.link'], { ns: 'common' })} -

{t(($) => $['studio.description'])} - - {tCommon(($) => $['operation.learnMore'])} -

diff --git a/demo-dify/dify/web/app/components/app/in-site-message/index.tsx b/demo-dify/dify/web/app/components/app/in-site-message/index.tsx index e747530d..4ef11210 100644 --- a/demo-dify/dify/web/app/components/app/in-site-message/index.tsx +++ b/demo-dify/dify/web/app/components/app/in-site-message/index.tsx @@ -5,6 +5,7 @@ import { cn } from '@langgenius/dify-ui/cn' import { useEffect, useMemo, useState } from 'react' import { trackEvent } from '@/app/components/base/amplitude' import { MarkdownWithDirective } from '@/app/components/base/markdown-with-directive' +import { isOfficialDifyUrl } from '@/utils/official-link' type InSiteMessageAction = 'link' | 'close' type InSiteMessageButtonType = 'primary' | 'default' | 'outline' @@ -123,7 +124,7 @@ function InSiteMessage({ ) const linkData = item.action === 'link' ? normalizeLinkData(item.data) : null - if (linkData) { + if (linkData && !isOfficialDifyUrl(linkData.href)) { const target = linkData.target ?? '_blank' return ( { - const showLearnMore = !!learnMoreHref && learnMoreLabel !== undefined && learnMoreLabel !== null + const showLearnMore = + !!learnMoreHref && + !isOfficialDifyUrl(learnMoreHref) && + learnMoreLabel !== undefined && + learnMoreLabel !== null return ( diff --git a/demo-dify/dify/web/app/components/app/overview/settings/index.tsx b/demo-dify/dify/web/app/components/app/overview/settings/index.tsx index 8b5474a0..f81276b7 100644 --- a/demo-dify/dify/web/app/components/app/overview/settings/index.tsx +++ b/demo-dify/dify/web/app/components/app/overview/settings/index.tsx @@ -58,9 +58,12 @@ import { } from '@/app/components/billing/pricing/query-params' import { deploymentEditionAtom } from '@/features/system-features/state' import { languages } from '@/i18n/language' -import Link from '@/next/link' import { consoleQuery } from '@/service/console' +function HiddenOfficialLink() { + return null +} + type SettingsDialogProps = { isChat: boolean canDeploy?: boolean @@ -566,14 +569,7 @@ function SettingsForm({ i18nKey={($) => $[`${prefixSettings}.more.privacyPolicyTip`]} ns="appOverview" components={{ - privacyPolicyLink: ( - - ), + privacyPolicyLink: , }} /> diff --git a/demo-dify/dify/web/app/components/base/features/new-feature-panel/moderation/moderation-setting-modal.tsx b/demo-dify/dify/web/app/components/base/features/new-feature-panel/moderation/moderation-setting-modal.tsx index 780ca3fc..fbf34cdd 100644 --- a/demo-dify/dify/web/app/components/base/features/new-feature-panel/moderation/moderation-setting-modal.tsx +++ b/demo-dify/dify/web/app/components/base/features/new-feature-panel/moderation/moderation-setting-modal.tsx @@ -28,7 +28,6 @@ import { settingsQueryParser, } from '@/app/components/header/account-setting/query-params' import { toast } from '@/app/notifications' -import { useDocLink } from '@/context/i18n' import { codeBasedExtensionsQueryOptions } from '@/features/code-based-extension/query' import { LanguagesSupported } from '@/i18n/language' import FormGeneration from './form-generation' @@ -69,8 +68,7 @@ type ModerationSettingModalProps = { const ModerationSettingModal: FC = ({ data, onCancel, onSave }) => { const { t } = useTranslation(['appDebug', 'common', 'navigation']) - const docLink = useDocLink() - const locale = useLocale() + const locale = useLocale() const { data: modelProviders, isPending: isLoading } = useQuery( modelProviderDetailsQueryOptions(), ) @@ -429,19 +427,10 @@ const ModerationSettingModal: FC = ({ data, onCance )} {localeData.type === 'api' && (
-
+
{t(($) => $['apiBasedExtension.selector.title'], { ns: 'common' })}
- - - {t(($) => $['apiBasedExtension.link'], { ns: 'common' })} -
)} - {url && ( + {url && !isOfficialDifyUrl(url) && ( { ) } + if (href && isOfficialDifyUrl(href)) return null + if (!href || !isValidUrl(href)) return {children} return ( diff --git a/demo-dify/dify/web/app/components/billing/apps-full-in-dialog/index.tsx b/demo-dify/dify/web/app/components/billing/apps-full-in-dialog/index.tsx index e9d7e81c..f7fb5eab 100644 --- a/demo-dify/dify/web/app/components/billing/apps-full-in-dialog/index.tsx +++ b/demo-dify/dify/web/app/components/billing/apps-full-in-dialog/index.tsx @@ -34,6 +34,11 @@ const AppsFull: FC<{ loc: string; className?: string }> = ({ loc, className }) = const percent = total > 0 ? (usage / total) * 100 : 0 const tone: MeterTone = percent >= 80 ? 'error' : percent >= 50 ? 'warning' : 'neutral' const buildAppsLabel = t(($) => $['usagePage.buildApps'], { ns: 'billing' }) + const supportHref = mailToSupport( + accountProfile.email, + billing.plan, + accountProfile.currentVersion ?? '', + ) return (
= ({ loc, className }) = {(billing.plan === 'sandbox' || billing.plan === 'professional') && ( )} - {billing.plan !== 'sandbox' && billing.plan !== 'professional' && ( + {billing.plan !== 'sandbox' && billing.plan !== 'professional' && supportHref && ( {t(($) => $['apps.contactUs'], { ns: 'billing' })} diff --git a/demo-dify/dify/web/app/components/datasets/common/multimodal-retrieval-guidance/__tests__/index.spec.tsx b/demo-dify/dify/web/app/components/datasets/common/multimodal-retrieval-guidance/__tests__/index.spec.tsx index c4352514..fa668a9d 100644 --- a/demo-dify/dify/web/app/components/datasets/common/multimodal-retrieval-guidance/__tests__/index.spec.tsx +++ b/demo-dify/dify/web/app/components/datasets/common/multimodal-retrieval-guidance/__tests__/index.spec.tsx @@ -56,13 +56,10 @@ describe('MultimodalRetrievalGuidance', () => { screen.getByText('datasetSettings.form.multimodalRetrievalGuidance.pipelineDescription'), ).toBeInTheDocument() expect( - screen.getByRole('link', { + screen.queryByRole('link', { name: 'datasetSettings.form.multimodalRetrievalGuidance.helpLink', }), - ).toHaveAttribute( - 'href', - 'https://dify.ai/blog/multimodal-retrieval-is-now-available-in-the-knowledge-base', - ) + ).not.toBeInTheDocument() expect( screen.getByText('datasetSettings.form.multimodalRetrievalGuidance.helpDescription'), ).toBeInTheDocument() @@ -103,9 +100,7 @@ describe('MultimodalRetrievalGuidance', () => { expect(localStorage.getItem(MULTIMODAL_RETRIEVAL_GUIDANCE_DISMISSED_STORAGE_KEY)).toBe('true') expect( - screen.getByRole('link', { - name: 'datasetSettings.form.multimodalRetrievalGuidance.helpLink', - }), + screen.getByText('datasetSettings.form.multimodalRetrievalGuidance.helpDescription'), ).toBeInTheDocument() expect( screen.queryByText('datasetSettings.form.multimodalRetrievalGuidance.createTitle'), diff --git a/demo-dify/dify/web/app/components/datasets/common/multimodal-retrieval-guidance/index.tsx b/demo-dify/dify/web/app/components/datasets/common/multimodal-retrieval-guidance/index.tsx index dd6aec42..3c9c4ee8 100644 --- a/demo-dify/dify/web/app/components/datasets/common/multimodal-retrieval-guidance/index.tsx +++ b/demo-dify/dify/web/app/components/datasets/common/multimodal-retrieval-guidance/index.tsx @@ -19,9 +19,6 @@ type MultimodalRetrievalGuidanceProps = { className?: string } -const MULTIMODAL_RETRIEVAL_DOC_URL = - 'https://dify.ai/blog/multimodal-retrieval-is-now-available-in-the-knowledge-base' - const isVisionEmbeddingModel = ( embeddingModel?: DefaultModel, embeddingModelList?: ProviderWithModelsResponse[], @@ -74,17 +71,6 @@ export const MultimodalRetrievalGuidanceLearnMore = ({ className }: { className? return (
- - {t(($) => $['form.multimodalRetrievalGuidance.helpLink'], { - ns: 'datasetSettings', - })} - -   {t(($) => $['form.multimodalRetrievalGuidance.helpDescription'], { ns: 'datasetSettings', })} diff --git a/demo-dify/dify/web/app/components/datasets/create-from-pipeline/list/__tests__/built-in-pipeline-list.spec.tsx b/demo-dify/dify/web/app/components/datasets/create-from-pipeline/list/__tests__/built-in-pipeline-list.spec.tsx index ab5acddb..34dc3d14 100644 --- a/demo-dify/dify/web/app/components/datasets/create-from-pipeline/list/__tests__/built-in-pipeline-list.spec.tsx +++ b/demo-dify/dify/web/app/components/datasets/create-from-pipeline/list/__tests__/built-in-pipeline-list.spec.tsx @@ -1,20 +1,9 @@ -import type { PipelineTemplateListResponse } from '@dify/contracts/api/console/rag/types.gen' -import { act, screen, waitFor } from '@testing-library/react' -import { ChunkingMode } from '@/models/datasets' +import { screen } from '@testing-library/react' import { renderWithConsoleQuery as render } from '@/test/console/query-data' -import { createDeferred } from '@/test/deferred' import BuiltInPipelineList from '../built-in-pipeline-list' const { getTemplates } = vi.hoisted(() => ({ getTemplates: vi.fn() })) -let locale = 'en-US' -vi.mock('#i18n', async (importOriginal) => ({ - ...(await importOriginal()), - useLocale: () => locale, -})) vi.mock('@/next/navigation', () => ({ useRouter: () => ({ push: vi.fn() }) })) -vi.mock('@/app/components/workflow/plugin-dependency/hooks', () => ({ - usePluginDependencies: () => ({ handleCheckPluginDependencies: vi.fn() }), -})) vi.mock('@/service/console', async (importOriginal) => { const actual = await importOriginal() const { withConsoleResponses } = await import('@/test/console/service-responses') @@ -26,50 +15,12 @@ vi.mock('@/service/console', async (importOriginal) => { } }) -beforeEach(() => { - locale = 'en-US' - getTemplates.mockResolvedValue({ pipeline_templates: [] }) -}) - -it('shows built-in templates after loading without custom-template management actions', async () => { - const pending = createDeferred() - getTemplates.mockReturnValue(pending.promise) +it('offers a blank pipeline and does not list built-in templates', () => { render(, { systemFeatures: { enable_marketplace: true } }) - expect(screen.queryByText('Legal documents')).not.toBeInTheDocument() - await act(async () => - pending.resolve({ - pipeline_templates: [ - { - id: 'template-1', - name: 'Legal documents', - description: 'Process legal documents', - chunk_structure: ChunkingMode.text, - position: 1, - icon: { icon_type: 'emoji', icon: '📚', icon_background: '#FFF4ED' }, - }, - ], - }), - ) - expect(await screen.findByText('Legal documents')).toBeInTheDocument() + expect( - screen.getByRole('button', { name: 'datasetPipeline.operations.choose' }), + screen.getByText('datasetPipeline.creation.createFromScratch.title'), ).toBeInTheDocument() - expect(screen.queryByRole('button', { name: 'common.operation.more' })).not.toBeInTheDocument() -}) - -it.each([ - ['zh-Hans', 'zh-Hans'], - ['ja-JP', 'ja-JP'], - ['fr-FR', 'en-US'], -])('requests %s templates using %s', async (requested, language) => { - locale = requested - render(, { systemFeatures: { enable_marketplace: true } }) - await waitFor(() => - expect(getTemplates).toHaveBeenCalledWith({ query: { type: 'built-in', language } }), - ) -}) - -it('does not request marketplace templates when the marketplace is disabled', () => { - render(, { systemFeatures: { enable_marketplace: false } }) + expect(screen.queryByText('Legal documents')).not.toBeInTheDocument() expect(getTemplates).not.toHaveBeenCalled() }) diff --git a/demo-dify/dify/web/app/components/datasets/create-from-pipeline/list/built-in-pipeline-list.tsx b/demo-dify/dify/web/app/components/datasets/create-from-pipeline/list/built-in-pipeline-list.tsx index 82ddc997..47e2eb18 100644 --- a/demo-dify/dify/web/app/components/datasets/create-from-pipeline/list/built-in-pipeline-list.tsx +++ b/demo-dify/dify/web/app/components/datasets/create-from-pipeline/list/built-in-pipeline-list.tsx @@ -1,41 +1,9 @@ -import { useQuery } from '@tanstack/react-query' -import { useMemo } from 'react' -import { useLocale } from '#i18n' -import { selectPipelineTemplateList } from '@/app/components/rag-pipeline/utils/query-select' -import { useMarketplace } from '@/features/marketplace/client' -import { LanguagesSupported } from '@/i18n/language' -import { consoleQuery } from '@/service/console' import CreateCard from './create-card' -import TemplateCard from './template-card' const BuiltInPipelineList = () => { - const locale = useLocale() - const language = useMemo(() => { - if (['zh-Hans', 'ja-JP'].includes(locale)) return locale - return LanguagesSupported[0] - }, [locale]) - const enableMarketplace = useMarketplace() !== null - const { data: pipelineList, isLoading } = useQuery( - consoleQuery.rag.pipeline.templates.get.queryOptions({ - input: { query: { type: 'built-in', language } }, - enabled: enableMarketplace, - select: selectPipelineTemplateList, - }), - ) - const list = pipelineList?.pipeline_templates || [] - return (
- {!isLoading && - list.map((pipeline, index) => ( - - ))}
) } diff --git a/demo-dify/dify/web/app/components/datasets/create-from-pipeline/list/index.tsx b/demo-dify/dify/web/app/components/datasets/create-from-pipeline/list/index.tsx index 270f91c3..0cbd1264 100644 --- a/demo-dify/dify/web/app/components/datasets/create-from-pipeline/list/index.tsx +++ b/demo-dify/dify/web/app/components/datasets/create-from-pipeline/list/index.tsx @@ -1,11 +1,9 @@ import BuiltInPipelineList from './built-in-pipeline-list' -import CustomizedList from './customized-list' const List = () => { return (
-
) } diff --git a/demo-dify/dify/web/app/components/datasets/create/embedding-process/index.tsx b/demo-dify/dify/web/app/components/datasets/create/embedding-process/index.tsx index 73845a5b..95398a45 100644 --- a/demo-dify/dify/web/app/components/datasets/create/embedding-process/index.tsx +++ b/demo-dify/dify/web/app/components/datasets/create/embedding-process/index.tsx @@ -12,6 +12,7 @@ import { useTranslation } from 'react-i18next' import VectorSpaceAdmissionAlert from '@/app/components/datasets/common/vector-space-admission-alert' import { deploymentEditionAtom } from '@/features/system-features/state' import { useDatasetApiAccessUrl } from '@/hooks/use-api-access-url' +import { isOfficialDifyUrl } from '@/utils/official-link' import Link from '@/next/link' import { consoleQuery } from '@/service/console' import IndexingProgressItem from './indexing-progress-item' @@ -62,15 +63,17 @@ const ActionButtons: FC<{ return (
- - - Access the API - + {apiReferenceUrl && !isOfficialDifyUrl(apiReferenceUrl) ? ( + + + Access the API + + ) : null} { expect(screen.queryByText('datasetCreation.stepThree.creationTitle')).not.toBeInTheDocument() }) - it('links to the document-processing documentation', () => { + it('does not link the document-processing note to the official documentation site', () => { render() expect( - screen.getByRole('link', { name: 'datasetPipeline.addDocuments.stepThree.learnMore' }), - ).toHaveAttribute( - 'href', - 'https://docs.dify.ai/use-dify/knowledge/integrate-knowledge-within-application', - ) + screen.queryByRole('link', { name: 'datasetPipeline.addDocuments.stepThree.learnMore' }), + ).not.toBeInTheDocument() }) }) diff --git a/demo-dify/dify/web/app/components/datasets/create/step-three/index.tsx b/demo-dify/dify/web/app/components/datasets/create/step-three/index.tsx index 8b8e2056..f5e7ccf6 100644 --- a/demo-dify/dify/web/app/components/datasets/create/step-three/index.tsx +++ b/demo-dify/dify/web/app/components/datasets/create/step-three/index.tsx @@ -6,7 +6,6 @@ import { RiBookOpenLine } from '@remixicon/react' import * as React from 'react' import { useTranslation } from 'react-i18next' import AppIcon from '@/app/components/base/app-icon' -import { useDocLink } from '@/context/i18n' import EmbeddingProcess from '../embedding-process' type StepThreeProps = { @@ -25,9 +24,7 @@ const StepThree = ({ retrievalMethod, }: StepThreeProps) => { const { t } = useTranslation(['datasetCreation', 'datasetPipeline']) - const docLink = useDocLink() - - // The creation response carries no icon; new knowledge bases start with the default one. + // The creation response carries no icon; new knowledge bases start with the default one. const iconInfo = { icon: '📙', icon_type: 'emoji', @@ -91,14 +88,6 @@ const StepThree = ({
{t(($) => $['stepThree.sideTipContent'], { ns: 'datasetCreation' })}
- - {t(($) => $['addDocuments.stepThree.learnMore'], { ns: 'datasetPipeline' })} -
diff --git a/demo-dify/dify/web/app/components/datasets/create/step-two/components/indexing-mode-section.tsx b/demo-dify/dify/web/app/components/datasets/create/step-two/components/indexing-mode-section.tsx index 3a5b3868..e016ca26 100644 --- a/demo-dify/dify/web/app/components/datasets/create/step-two/components/indexing-mode-section.tsx +++ b/demo-dify/dify/web/app/components/datasets/create/step-two/components/indexing-mode-section.tsx @@ -26,7 +26,6 @@ import { } from '@/app/components/datasets/common/multimodal-retrieval-guidance' import RetrievalMethodConfig from '@/app/components/datasets/common/retrieval-method-config' import { ModelSelector } from '@/app/components/header/account-setting/model-provider-page/model-selector' -import { useDocLink } from '@/context/i18n' import { ChunkingMode } from '@/models/datasets' import Link from '@/next/link' import { indexMethodIcon } from '../../icons' @@ -74,9 +73,7 @@ export const IndexingModeSection: FC = ({ onQAConfirmDialogConfirm, }) => { const { t } = useTranslation(['datasetCreation', 'datasetSettings']) - const docLink = useDocLink() - - const getIndexingTechnique = () => indexType + const getIndexingTechnique = () => indexType const economicalDisabledReason = (() => { if (docForm === ChunkingMode.qa) return t(($) => $['stepTwo.notAvailableForQA'], { ns: 'datasetCreation' }) @@ -234,14 +231,6 @@ export const IndexingModeSection: FC = ({ {t(($) => $['form.retrievalSetting.title'], { ns: 'datasetSettings' })}
- - {t(($) => $['form.retrievalSetting.learnMore'], { ns: 'datasetSettings' })} - {t(($) => $['form.retrievalSetting.longDescription'], { ns: 'datasetSettings' })}
diff --git a/demo-dify/dify/web/app/components/datasets/create/website/base/header.tsx b/demo-dify/dify/web/app/components/datasets/create/website/base/header.tsx index 8e534274..a72ee6f4 100644 --- a/demo-dify/dify/web/app/components/datasets/create/website/base/header.tsx +++ b/demo-dify/dify/web/app/components/datasets/create/website/base/header.tsx @@ -3,6 +3,7 @@ import { cn } from '@langgenius/dify-ui/cn' import { Separator } from '@langgenius/dify-ui/separator' import { RiBookOpenLine, RiEqualizer2Line } from '@remixicon/react' import * as React from 'react' +import { isOfficialDifyUrl } from '@/utils/official-link' type HeaderProps = { isInPipeline?: boolean @@ -43,17 +44,19 @@ const Header = ({ {!isInPipeline && {buttonText}}
- - - - {docTitle} - - + {docLink && !isOfficialDifyUrl(docLink) && ( + + + + {docTitle} + + + )}
) } diff --git a/demo-dify/dify/web/app/components/datasets/create/website/base/url-input.tsx b/demo-dify/dify/web/app/components/datasets/create/website/base/url-input.tsx index c1300503..77bd644e 100644 --- a/demo-dify/dify/web/app/components/datasets/create/website/base/url-input.tsx +++ b/demo-dify/dify/web/app/components/datasets/create/website/base/url-input.tsx @@ -4,7 +4,6 @@ import { Button } from '@langgenius/dify-ui/button' import * as React from 'react' import { useCallback, useState } from 'react' import { useTranslation } from 'react-i18next' -import { useDocLink } from '@/context/i18n' import Input from './text-input' const I18N_PREFIX = 'stepOne.website' @@ -16,7 +15,6 @@ type Props = Readonly<{ const UrlInput: FC = ({ isRunning, onRun }) => { const { t } = useTranslation(['datasetCreation']) - const docLink = useDocLink() const [url, setUrl] = useState('') const handleUrlChange = useCallback((url: string | number) => { setUrl(url as string) @@ -28,7 +26,7 @@ const UrlInput: FC = ({ isRunning, onRun }) => { return (
- + diff --git a/demo-dify/dify/web/app/components/datasets/create/website/watercrawl/__tests__/index.spec.tsx b/demo-dify/dify/web/app/components/datasets/create/website/watercrawl/__tests__/index.spec.tsx index d304bdfc..4ee79254 100644 --- a/demo-dify/dify/web/app/components/datasets/create/website/watercrawl/__tests__/index.spec.tsx +++ b/demo-dify/dify/web/app/components/datasets/create/website/watercrawl/__tests__/index.spec.tsx @@ -30,7 +30,7 @@ vi.mock('@/utils', () => ({ // Mock i18n context vi.mock('@/context/i18n', () => ({ useDocLink: () => (path?: string) => - path ? `https://docs.dify.ai/en${path}` : 'https://docs.dify.ai/en/', + path ? `https://docs.dify.ai/en${path}` : 'https://example.com', })) // Note: limit and max_depth are typed as `number | string` in CrawlOptions @@ -138,7 +138,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps() render() - const urlInput = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const urlInput = screen.getByPlaceholderText('https://example.com') await user.type(urlInput, 'https://example.com') const runButton = screen.getByRole('button', { name: /run/i }) @@ -173,7 +173,7 @@ describe('WaterCrawl', () => { // Options should be visible initially expect(screen.getByText('datasetCreation.stepOne.website.crawlSubPage'))!.toBeInTheDocument() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://example.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -273,7 +273,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps({ crawlOptions }) render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://api-test.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -302,7 +302,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps({ crawlOptions }) render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://test.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -327,7 +327,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps() render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://fail-test.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -353,7 +353,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps() render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://error-test.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -386,7 +386,7 @@ describe('WaterCrawl', () => { const user = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }) render() await user.type( - screen.getByPlaceholderText('https://docs.dify.ai/en/'), + screen.getByPlaceholderText('https://example.com'), 'https://example.com', ) await user.click(screen.getByRole('button', { name: /run/i })) @@ -411,7 +411,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps() render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://no-status-test.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -443,7 +443,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps() render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'invalid-url') await user.click(screen.getByRole('button', { name: /run/i })) @@ -457,7 +457,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps() render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'example.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -482,7 +482,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps() render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'http://example.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -498,7 +498,7 @@ describe('WaterCrawl', () => { }) render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://example.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -517,7 +517,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps() render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://exception-test.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -544,7 +544,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps() render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://empty-error-test.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -572,7 +572,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps({ onCheckedCrawlResultChange }) render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://empty-data-test.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -605,7 +605,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps({ onCheckedCrawlResultChange }) render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://null-data-test.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -631,7 +631,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps({ onCheckedCrawlResultChange }) render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://undefined-data-test.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -658,7 +658,7 @@ describe('WaterCrawl', () => { }) render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://zero-current-test.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -686,7 +686,7 @@ describe('WaterCrawl', () => { }) render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://zero-total-test.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -721,7 +721,7 @@ describe('WaterCrawl', () => { }) render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://both-zero-test.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -750,7 +750,7 @@ describe('WaterCrawl', () => { const props = createDefaultProps() render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://time.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -801,7 +801,7 @@ describe('WaterCrawl', () => { }) render() - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://full-workflow.com') await user.click(screen.getByRole('button', { name: /run/i })) @@ -863,7 +863,7 @@ describe('WaterCrawl', () => { render() // Step 1: Enter URL - const input = screen.getByPlaceholderText('https://docs.dify.ai/en/') + const input = screen.getByPlaceholderText('https://example.com') await user.type(input, 'https://preview.com') // Step 2: Run crawl diff --git a/demo-dify/dify/web/app/components/datasets/documents/components/documents-header.tsx b/demo-dify/dify/web/app/components/datasets/documents/components/documents-header.tsx index 8a2d9866..fa1d953e 100644 --- a/demo-dify/dify/web/app/components/datasets/documents/components/documents-header.tsx +++ b/demo-dify/dify/web/app/components/datasets/documents/components/documents-header.tsx @@ -15,7 +15,6 @@ import AutoDisabledDocument from '@/app/components/datasets/common/document-stat import IndexFailed from '@/app/components/datasets/common/document-status-with-action/index-failed' import StatusWithAction from '@/app/components/datasets/common/document-status-with-action/status-with-action' import DatasetMetadataDrawer from '@/app/components/datasets/metadata/metadata-dataset/dataset-metadata-drawer' -import { useDocLink } from '@/context/i18n' import { DataSourceType } from '@/models/datasets' import { useIndexStatus } from '../status-item/hooks' @@ -87,8 +86,7 @@ const DocumentsHeader: FC = ({ const { t } = useTranslation(['dataset', 'datasetDocuments']) const statusFilterId = useId() const statusFilterLabelId = useId() - const docLink = useDocLink() - const DOC_INDEX_STATUS_MAP = useIndexStatus() + const DOC_INDEX_STATUS_MAP = useIndexStatus() const isDataSourceNotion = dataSourceType === DataSourceType.NOTION const isDataSourceWeb = dataSourceType === DataSourceType.WEB @@ -139,15 +137,6 @@ const DocumentsHeader: FC = ({
{t(($) => $['list.desc'], { ns: 'datasetDocuments' })} - - {t(($) => $['list.learnMore'], { ns: 'datasetDocuments' })} - -
diff --git a/demo-dify/dify/web/app/components/datasets/documents/create-from-pipeline/data-source/base/header.tsx b/demo-dify/dify/web/app/components/datasets/documents/create-from-pipeline/data-source/base/header.tsx index 21fc6c51..97396c8f 100644 --- a/demo-dify/dify/web/app/components/datasets/documents/create-from-pipeline/data-source/base/header.tsx +++ b/demo-dify/dify/web/app/components/datasets/documents/create-from-pipeline/data-source/base/header.tsx @@ -4,6 +4,7 @@ import { Separator } from '@langgenius/dify-ui/separator' import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip' import * as React from 'react' import { useTranslation } from 'react-i18next' +import { isOfficialDifyUrl } from '@/utils/official-link' import CredentialSelector from './credential-selector' type HeaderProps = { @@ -39,15 +40,17 @@ const Header = ({ docTitle, docLink, onClickConfiguration, pluginName, ...rest } {configurationTip} - - - {docTitle} - + {docLink && !isOfficialDifyUrl(docLink) && ( + + + {docTitle} + + )} ) } diff --git a/demo-dify/dify/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/__tests__/index.spec.tsx b/demo-dify/dify/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/__tests__/index.spec.tsx index e833a66d..71c9463b 100644 --- a/demo-dify/dify/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/__tests__/index.spec.tsx +++ b/demo-dify/dify/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/__tests__/index.spec.tsx @@ -143,15 +143,12 @@ describe('EmbeddingProcess', () => { }) describe('Rendering', () => { - it('should render API reference link with correct URL', () => { + it('does not link the API reference to the official documentation site', () => { const props = createDefaultProps() render() - const apiLink = screen.getByRole('link', { name: /access the api/i }) - expect(apiLink).toHaveAttribute('href', 'https://docs.dify.ai/api-reference/datasets') - expect(apiLink).toHaveAttribute('target', '_blank') - expect(apiLink).toHaveAttribute('rel', 'noopener noreferrer') + expect(screen.queryByRole('link', { name: /access the api/i })).not.toBeInTheDocument() }) }) diff --git a/demo-dify/dify/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/index.tsx b/demo-dify/dify/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/index.tsx index 01133394..41a517b9 100644 --- a/demo-dify/dify/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/index.tsx +++ b/demo-dify/dify/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/index.tsx @@ -27,6 +27,7 @@ import DocumentFileIcon from '@/app/components/datasets/common/document-file-ico import VectorSpaceAdmissionAlert from '@/app/components/datasets/common/vector-space-admission-alert' import { deploymentEditionAtom } from '@/features/system-features/state' import { useDatasetApiAccessUrl } from '@/hooks/use-api-access-url' +import { isOfficialDifyUrl } from '@/utils/official-link' import { DatasourceType } from '@/models/pipeline' import Link from '@/next/link' import { consoleQuery } from '@/service/console' @@ -277,15 +278,17 @@ const EmbeddingProcess = ({ />
- - - Access the API - + {apiReferenceUrl && !isOfficialDifyUrl(apiReferenceUrl) ? ( + + + Access the API + + ) : null} { const { t } = useTranslation(['datasetCreation', 'datasetPipeline']) - const docLink = useDocLink() - const datasetId = useDatasetDetailContextWithSelector((s) => s.dataset?.id) + const datasetId = useDatasetDetailContextWithSelector((s) => s.dataset?.id) const indexingType = useDatasetDetailContextWithSelector( (s) => s.dataset?.indexing_technique ?? undefined, ) @@ -48,14 +46,6 @@ const Processing = ({ batchId, documents }: ProcessingProps) => {
{t(($) => $['stepThree.sideTipContent'], { ns: 'datasetCreation' })}
- - {t(($) => $['addDocuments.stepThree.learnMore'], { ns: 'datasetPipeline' })} -
diff --git a/demo-dify/dify/web/app/components/datasets/external-api/external-api-modal/Form.tsx b/demo-dify/dify/web/app/components/datasets/external-api/external-api-modal/Form.tsx index a56fbe76..09b1d9c6 100644 --- a/demo-dify/dify/web/app/components/datasets/external-api/external-api-modal/Form.tsx +++ b/demo-dify/dify/web/app/components/datasets/external-api/external-api-modal/Form.tsx @@ -4,10 +4,8 @@ import { cn } from '@langgenius/dify-ui/cn' import { Field, FieldError } from '@langgenius/dify-ui/field' import { Form } from '@langgenius/dify-ui/form' import { Input } from '@langgenius/dify-ui/input' -import { RiBookOpenLine } from '@remixicon/react' import * as React from 'react' import { useTranslation } from 'react-i18next' -import { useDocLink } from '@/context/i18n' type ExternalAPIFormProps = { id: string @@ -36,7 +34,6 @@ const ExternalAPIForm: FC = React.memo( errors, }) => { const { t, i18n } = useTranslation(['common', 'dataset']) - const docLink = useDocLink() const handleFormChange = (key: string, val: string) => { if (key === 'name') { @@ -69,17 +66,6 @@ const ExternalAPIForm: FC = React.memo( {label[i18n.language] || label.en_US} {required && *} - {variable === 'endpoint' && ( - - - {t(($) => $.externalAPIPanelDocumentation, { ns: 'dataset' })} - - )} = ({ onClose, }) => { const { t } = useTranslation(['common', 'dataset']) - const docLink = useDocLink() - const { setShowExternalKnowledgeAPIModal } = useModalContext() + const { setShowExternalKnowledgeAPIModal } = useModalContext() const queryClient = useQueryClient() const externalKnowledgeApiQueryOptions = consoleQuery.datasets.externalKnowledgeApi.get.queryOptions({ input: {} }) @@ -59,16 +57,6 @@ const ExternalAPIPanel: React.FC = ({
{t(($) => $.externalAPIPanelDescription, { ns: 'dataset' })}
- - -
- {t(($) => $.externalAPIPanelDocumentation, { ns: 'dataset' })} -
-
{ const { t } = useTranslation(['dataset']) - const docLink = useDocLink() return (
@@ -18,24 +16,8 @@ const InfoPanel = () => { {t(($) => $['connectDatasetIntro.content.front'], { ns: 'dataset' })} - - {t(($) => $['connectDatasetIntro.content.link'], { ns: 'dataset' })} - {t(($) => $['connectDatasetIntro.content.end'], { ns: 'dataset' })} - - {t(($) => $['connectDatasetIntro.learnMore'], { ns: 'dataset' })} -

diff --git a/demo-dify/dify/web/app/components/datasets/external-knowledge-base/create/index.tsx b/demo-dify/dify/web/app/components/datasets/external-knowledge-base/create/index.tsx index f24caf90..a82c7396 100644 --- a/demo-dify/dify/web/app/components/datasets/external-knowledge-base/create/index.tsx +++ b/demo-dify/dify/web/app/components/datasets/external-knowledge-base/create/index.tsx @@ -6,7 +6,6 @@ import { IconButton } from '@langgenius/dify-ui/icon-button' import { Separator } from '@langgenius/dify-ui/separator' import { useCallback, useState } from 'react' import { useTranslation } from 'react-i18next' -import { useDocLink } from '@/context/i18n' import Link from '@/next/link' import { useRouter } from '@/next/navigation' import ExternalApiSelection from './ExternalApiSelection' @@ -24,7 +23,6 @@ const ExternalKnowledgeBaseCreate: React.FC = loading, }) => { const { t } = useTranslation(['common', 'dataset']) - const docLink = useDocLink() const router = useRouter() const [formData, setFormData] = useState({ name: '', @@ -69,14 +67,6 @@ const ExternalKnowledgeBaseCreate: React.FC = {t(($) => $['connectHelper.helper2'], { ns: 'dataset' })}
{t(($) => $['connectHelper.helper3'], { ns: 'dataset' })} - - {t(($) => $['connectHelper.helper4'], { ns: 'dataset' })} - {t(($) => $['connectHelper.helper5'], { ns: 'dataset' })}

{ await user.keyboard('{Enter}') expect(await screen.findByText('dataset.serviceApi.enabled')).toBeInTheDocument() expect( - screen.getByRole('link', { name: 'appOverview.overview.apiInfo.doc' }), - ).toHaveAttribute('href', 'https://docs.dify.ai/api-reference/datasets') + screen.queryByRole('link', { name: 'appOverview.overview.apiInfo.doc' }), + ).not.toBeInTheDocument() }, ) diff --git a/demo-dify/dify/web/app/components/datasets/extra-info/api-access/card.tsx b/demo-dify/dify/web/app/components/datasets/extra-info/api-access/card.tsx index 2564e9e5..6a24d5d8 100644 --- a/demo-dify/dify/web/app/components/datasets/extra-info/api-access/card.tsx +++ b/demo-dify/dify/web/app/components/datasets/extra-info/api-access/card.tsx @@ -10,6 +10,7 @@ import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail' import { workspacePermissionKeysAtom } from '@/context/permission-state' import { userProfileQueryOptions } from '@/features/account-profile/client' import { useDatasetApiAccessUrl } from '@/hooks/use-api-access-url' +import { isOfficialDifyUrl } from '@/utils/official-link' import Link from '@/next/link' import { consoleQuery } from '@/service/console' import { getDatasetACLCapabilities } from '@/utils/permission' @@ -85,20 +86,22 @@ const Card = ({ apiEnabled }: CardProps) => {
-
- - -
- {t(($) => $['overview.apiInfo.doc'], { ns: 'appOverview' })} -
- - -
+ {apiReferenceUrl && !isOfficialDifyUrl(apiReferenceUrl) ? ( +
+ + +
+ {t(($) => $['overview.apiInfo.doc'], { ns: 'appOverview' })} +
+ + +
+ ) : null} ) } diff --git a/demo-dify/dify/web/app/components/datasets/extra-info/service-api/__tests__/index.spec.tsx b/demo-dify/dify/web/app/components/datasets/extra-info/service-api/__tests__/index.spec.tsx index 656a7dce..aecb75ef 100644 --- a/demo-dify/dify/web/app/components/datasets/extra-info/service-api/__tests__/index.spec.tsx +++ b/demo-dify/dify/web/app/components/datasets/extra-info/service-api/__tests__/index.spec.tsx @@ -52,8 +52,8 @@ describe('ServiceApi', () => { expect(screen.getByText('https://api.example.com')).toBeInTheDocument() expect( - screen.getByRole('link', { name: 'dataset.serviceApi.card.apiReference' }), - ).toHaveAttribute('href', 'https://docs.dify.ai/api-reference/datasets') + screen.queryByRole('link', { name: 'dataset.serviceApi.card.apiReference' }), + ).not.toBeInTheDocument() await user.click(screen.getByRole('button', { name: 'dataset.serviceApi.card.apiKey' })) const dialog = await screen.findByRole('dialog', { name: 'appApi.apiKeyModal.apiSecretKey' }) diff --git a/demo-dify/dify/web/app/components/datasets/extra-info/service-api/card.tsx b/demo-dify/dify/web/app/components/datasets/extra-info/service-api/card.tsx index 00a4d94e..92be49b4 100644 --- a/demo-dify/dify/web/app/components/datasets/extra-info/service-api/card.tsx +++ b/demo-dify/dify/web/app/components/datasets/extra-info/service-api/card.tsx @@ -6,6 +6,7 @@ import { StatusDot } from '@langgenius/dify-ui/status-dot' import { useTranslation } from 'react-i18next' import { CopyFeedback } from '@/app/components/base/copy-feedback' import { useDatasetApiAccessUrl } from '@/hooks/use-api-access-url' +import { isOfficialDifyUrl } from '@/utils/official-link' import Link from '@/next/link' type CardProps = { @@ -74,17 +75,19 @@ export function ServiceApiCard({ apiBaseUrl, apiReferenceUrl, canManageApiKey }: {t(($) => $['serviceApi.card.apiKey'], { ns: 'dataset' })} - - - - {t(($) => $['serviceApi.card.apiReference'], { ns: 'dataset' })} - - + {referenceUrl && !isOfficialDifyUrl(referenceUrl) ? ( + + + + {t(($) => $['serviceApi.card.apiReference'], { ns: 'dataset' })} + + + ) : null} ) diff --git a/demo-dify/dify/web/app/components/datasets/hit-testing/modify-retrieval-modal.tsx b/demo-dify/dify/web/app/components/datasets/hit-testing/modify-retrieval-modal.tsx index 9ac5012a..f20476f8 100644 --- a/demo-dify/dify/web/app/components/datasets/hit-testing/modify-retrieval-modal.tsx +++ b/demo-dify/dify/web/app/components/datasets/hit-testing/modify-retrieval-modal.tsx @@ -14,7 +14,6 @@ import EconomicalRetrievalMethodConfig from '@/app/components/datasets/common/ec import RetrievalMethodConfig from '@/app/components/datasets/common/retrieval-method-config' import { toast } from '@/app/notifications' import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail' -import { useDocLink } from '@/context/i18n' import { consoleQuery } from '@/service/console' import { ModelTypeEnum } from '../../header/account-setting/model-provider-page/declarations' import { checkShowMultiModalTip } from '../settings/utils' @@ -29,8 +28,7 @@ type Props = Readonly<{ const ModifyRetrievalModal: FC = ({ indexMethod, value, isShow, onHide, onSave }) => { const ref = useRef(null) const { t } = useTranslation(['appDebug', 'common', 'datasetSettings']) - const docLink = useDocLink() - const [retrievalConfig, setRetrievalConfig] = useState(value) + const [retrievalConfig, setRetrievalConfig] = useState(value) const embeddingModel = useDatasetDetailContextWithSelector( (state) => state.dataset?.embedding_model, ) @@ -109,14 +107,6 @@ const ModifyRetrievalModal: FC = ({ indexMethod, value, isShow, onHide, o {t(($) => $['form.retrievalSetting.title'], { ns: 'datasetSettings' })}
- - {t(($) => $['form.retrievalSetting.learnMore'], { ns: 'datasetSettings' })} - {t(($) => $['form.retrievalSetting.description'], { ns: 'datasetSettings' })}
diff --git a/demo-dify/dify/web/app/components/datasets/no-linked-apps-panel.tsx b/demo-dify/dify/web/app/components/datasets/no-linked-apps-panel.tsx index 727df983..3d333657 100644 --- a/demo-dify/dify/web/app/components/datasets/no-linked-apps-panel.tsx +++ b/demo-dify/dify/web/app/components/datasets/no-linked-apps-panel.tsx @@ -1,13 +1,10 @@ -import { RiApps2AddLine, RiBookOpenLine } from '@remixicon/react' +import { RiApps2AddLine } from '@remixicon/react' import * as React from 'react' import { useTranslation } from 'react-i18next' -import { useDocLink } from '@/context/i18n' const NoLinkedAppsPanel = () => { const { t } = useTranslation(['common']) - const docLink = useDocLink() - - return ( + return (
@@ -15,15 +12,6 @@ const NoLinkedAppsPanel = () => {
{t(($) => $['datasetMenus.emptyTip'], { ns: 'common' })}
- - - {t(($) => $['datasetMenus.viewDoc'], { ns: 'common' })} -
) } diff --git a/demo-dify/dify/web/app/components/datasets/settings/form/components/indexing-section.tsx b/demo-dify/dify/web/app/components/datasets/settings/form/components/indexing-section.tsx index 70ec20a6..96e3767d 100644 --- a/demo-dify/dify/web/app/components/datasets/settings/form/components/indexing-section.tsx +++ b/demo-dify/dify/web/app/components/datasets/settings/form/components/indexing-section.tsx @@ -16,7 +16,6 @@ import { } from '@/app/components/datasets/common/multimodal-retrieval-guidance' import RetrievalMethodConfig from '@/app/components/datasets/common/retrieval-method-config' import { ModelSelector } from '@/app/components/header/account-setting/model-provider-page/model-selector' -import { useDocLink } from '@/context/i18n' import { systemFeaturesQueryOptions } from '@/features/system-features/client' import { ChunkingMode } from '@/models/datasets' import { IndexingType } from '../../../create/step-two' @@ -73,8 +72,7 @@ const IndexingSection = ({ select: ({ deployment_edition }) => deployment_edition, }) const isNonCloudEdition = deploymentEdition === 'COMMUNITY' || deploymentEdition === 'ENTERPRISE' - const docLink = useDocLink() - const chunkingMode = toChunkingMode(currentDataset?.doc_form) + const chunkingMode = toChunkingMode(currentDataset?.doc_form) const isShowIndexMethod = currentDataset && @@ -104,14 +102,6 @@ const IndexingSection = ({ {t(($) => $['form.chunkStructure.title'], { ns: 'datasetSettings' })}
- - {t(($) => $['form.chunkStructure.learnMore'], { ns: 'datasetSettings' })} - {t(($) => $['form.chunkStructure.description'], { ns: 'datasetSettings' })}
@@ -205,14 +195,6 @@ const IndexingSection = ({ {t(($) => $['form.retrievalSetting.title'], { ns: 'datasetSettings' })}
- - {t(($) => $['form.retrievalSetting.learnMore'], { ns: 'datasetSettings' })} - {t(($) => $['form.retrievalSetting.description'], { ns: 'datasetSettings' })}
diff --git a/demo-dify/dify/web/app/components/goto-anything/actions/commands/__tests__/commands.spec.tsx b/demo-dify/dify/web/app/components/goto-anything/actions/commands/__tests__/commands.spec.tsx index c86cf9d9..e72defa8 100644 --- a/demo-dify/dify/web/app/components/goto-anything/actions/commands/__tests__/commands.spec.tsx +++ b/demo-dify/dify/web/app/components/goto-anything/actions/commands/__tests__/commands.spec.tsx @@ -3,7 +3,6 @@ import { createInstance } from 'i18next' import { renderToString } from 'react-dom/server' import { accountCommand } from '../account' import { slashCommandRegistry } from '../catalog' -import { discordCommand } from '../discord' import { docsCommand } from '../docs' import { goCommand } from '../go' import { languageCommand } from '../language' @@ -41,7 +40,7 @@ describe('command journeys', () => { }) it('uses the current destination for direct and search-result activation', async () => { - for (const command of [accountCommand, modelsCommand, docsCommand, discordCommand]) { + for (const command of [accountCommand, modelsCommand, docsCommand]) { const context = createCommandContext({ getDocsHomeUrl: () => 'https://enterprise.example/help/zh', }) @@ -58,9 +57,7 @@ describe('command journeys', () => { ? '/account' : command === modelsCommand ? SYSTEM_MODELS_PATH - : command === docsCommand - ? 'https://enterprise.example/help/zh' - : 'https://discord.gg/5AEfbxcd9k' + : 'https://enterprise.example/help/zh' expect(callback).toHaveBeenCalledTimes(2) expect(callback).toHaveBeenLastCalledWith(destination) } diff --git a/demo-dify/dify/web/app/components/goto-anything/actions/commands/catalog.ts b/demo-dify/dify/web/app/components/goto-anything/actions/commands/catalog.ts index e1b6e5fd..c1d6ccf8 100644 --- a/demo-dify/dify/web/app/components/goto-anything/actions/commands/catalog.ts +++ b/demo-dify/dify/web/app/components/goto-anything/actions/commands/catalog.ts @@ -1,7 +1,6 @@ import { ENABLE_FEATURE_PREVIEW } from '@/config' import { accountCommand } from './account' import { createCommand } from './create' -import { discordCommand } from './discord' import { docsCommand } from './docs' import { goCommand } from './go' import { languageCommand } from './language' @@ -14,7 +13,6 @@ export const slashCommandRegistry = new SlashCommandRegistry([ themeCommand, languageCommand, docsCommand, - discordCommand, modelsCommand, accountCommand, goCommand, diff --git a/demo-dify/dify/web/app/components/goto-anything/actions/commands/discord.tsx b/demo-dify/dify/web/app/components/goto-anything/actions/commands/discord.tsx index 920856db..44fd669c 100644 --- a/demo-dify/dify/web/app/components/goto-anything/actions/commands/discord.tsx +++ b/demo-dify/dify/web/app/components/goto-anything/actions/commands/discord.tsx @@ -1,32 +1,13 @@ import type { SlashCommand } from './types' -const DISCORD_URL = 'https://discord.gg/5AEfbxcd9k' - export const discordCommand: SlashCommand = { name: 'discord', - description: 'Open Discord community', + description: 'Discord community', mode: 'direct', - execute: (_args, context) => context.openExternal(DISCORD_URL), + execute: () => {}, - search(args: string, context) { - return [ - { - id: 'discord', - title: 'Discord', - description: - context.t(($) => $['gotoAnything.actions.discordDesc'], { - ns: 'app', - lng: context.locale, - }) || 'Open Discord community', - type: 'command' as const, - icon: ( -
- -
- ), - data: { command: 'discord', args: { url: DISCORD_URL } }, - }, - ] + search() { + return [] }, } diff --git a/demo-dify/dify/web/app/components/goto-anything/actions/commands/docs.tsx b/demo-dify/dify/web/app/components/goto-anything/actions/commands/docs.tsx index 26d3ed21..c166894a 100644 --- a/demo-dify/dify/web/app/components/goto-anything/actions/commands/docs.tsx +++ b/demo-dify/dify/web/app/components/goto-anything/actions/commands/docs.tsx @@ -1,4 +1,5 @@ import type { SlashCommand } from './types' +import { isOfficialDifyUrl } from '@/utils/official-link' /** * Documentation command - Opens help documentation @@ -8,9 +9,16 @@ export const docsCommand: SlashCommand = { description: 'Open documentation', mode: 'direct', - execute: (_args, context) => context.openExternal(context.getDocsHomeUrl()), + execute: (_args, context) => { + const url = context.getDocsHomeUrl() + if (!url || isOfficialDifyUrl(url)) return + context.openExternal(url) + }, search(args: string, context) { + const url = context.getDocsHomeUrl() + if (!url || isOfficialDifyUrl(url)) return [] + return [ { id: 'doc', diff --git a/demo-dify/dify/web/app/components/header/account-setting/access-rules-page/permission-set-modal/index.tsx b/demo-dify/dify/web/app/components/header/account-setting/access-rules-page/permission-set-modal/index.tsx index 3b6114a3..f1fe015f 100644 --- a/demo-dify/dify/web/app/components/header/account-setting/access-rules-page/permission-set-modal/index.tsx +++ b/demo-dify/dify/web/app/components/header/account-setting/access-rules-page/permission-set-modal/index.tsx @@ -15,9 +15,6 @@ import { Input } from '@langgenius/dify-ui/input' import { Textarea } from '@langgenius/dify-ui/textarea' import { useState } from 'react' import { useTranslation } from 'react-i18next' -import { useLocale } from '#i18n' -import { getEnterpriseDocUrl } from '@/context/i18n' -import { getDocLanguage } from '@/i18n/language' import PermissionPicker from './permission-picker' export type PermissionSetModalMode = 'create' | 'edit' | 'view' @@ -47,8 +44,6 @@ const PermissionSetModalBody = ({ onSubmit, }: PermissionSetModalBodyProps) => { const { t } = useTranslation(['common', 'permission']) - const locale = useLocale() - const docLanguage = getDocLanguage(locale) const [name, setName] = useState(initialValues?.name ?? '') const [description, setDescription] = useState(initialValues?.description ?? '') const [permissionKeys, setPermissionKeys] = useState( @@ -158,15 +153,6 @@ const PermissionSetModalBody = ({ {t(($) => $['api.actionFailed'], { ns: 'common' })}

)} - - {t(($) => $['permissionSet.learnMore'], { ns: 'permission' })} - - -
- - {t(($) => $['modelProvider.discoverMore'], { ns: 'modelProvider' })} - - {onOpenMarketplace ? ( - - ) : ( - - {t(($) => $['marketplace.difyMarketplace'], { ns: 'plugin' })} -
{!!searchText.trim() && !isAllPluginsLoading && !collapse && (
diff --git a/demo-dify/dify/web/app/components/header/account-setting/index.tsx b/demo-dify/dify/web/app/components/header/account-setting/index.tsx index 152ce53f..6eabb238 100644 --- a/demo-dify/dify/web/app/components/header/account-setting/index.tsx +++ b/demo-dify/dify/web/app/components/header/account-setting/index.tsx @@ -13,6 +13,7 @@ import { useQuery, useSuspenseQuery } from '@tanstack/react-query' import { useAtomValue } from 'jotai' import { lazy, Suspense, useRef } from 'react' import { useTranslation } from 'react-i18next' +import { isOfficialDifyUrl } from '@/utils/official-link' import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder' import BillingPage from '@/app/components/billing/billing-page' import CustomPage from '@/app/components/custom/custom-page' @@ -306,7 +307,7 @@ export default function AccountSetting({ {activeItem?.description && (

{activeItem.description} - {activeItem?.docLink && ( + {activeItem?.docLink?.href && !isOfficialDifyUrl(activeItem.docLink.href) && ( { }) expect(autoUpdateButton).toBeInTheDocument() expect(systemModelSelector).toBeInTheDocument() - expect(screen.getByTestId('install-from-marketplace')).toBeInTheDocument() + expect(screen.queryByTestId('install-from-marketplace')).not.toBeInTheDocument() }) it('should skip system model settings without plugin preference access', () => { diff --git a/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/index.tsx b/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/index.tsx index 772231fd..0251d3ce 100644 --- a/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/index.tsx +++ b/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/index.tsx @@ -12,7 +12,6 @@ import { useTranslation } from 'react-i18next' import { SearchInput } from '@/app/components/base/search-input' import { usePluginSettingsAccess } from '@/app/components/plugins/plugin-page/use-reference-setting' import { PluginCategoryEnum } from '@/app/components/plugins/types' -import { useMarketplace } from '@/features/marketplace/client' import { consoleQuery } from '@/service/console' import { UpdateSettingDialog } from '../update-setting-dialog' import { ModelTypeEnum } from './declarations' @@ -102,7 +101,6 @@ const ModelProviderPage = ({ } return map }, [latestVersionData, modelProviderPlugins]) - const marketplace = useMarketplace() const isDefaultModelLoading = isTextGenerationDefaultModelLoading || isEmbeddingsDefaultModelLoading || @@ -261,10 +259,7 @@ const ModelProviderPage = ({ showEmptyProvider={showEmptyProvider} showConfiguredProviders={showConfiguredProviders} showNotConfiguredProviders={showNotConfiguredProviders} - marketplace={marketplace} - searchText={searchText} pluginSummaryMap={pluginSummaryMap} - onOpenMarketplace={onOpenMarketplace} /> ) diff --git a/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/install-from-marketplace.tsx b/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/install-from-marketplace.tsx index 850c6dd0..3e14bd33 100644 --- a/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/install-from-marketplace.tsx +++ b/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/install-from-marketplace.tsx @@ -3,15 +3,12 @@ import type { MarketplaceLinks } from '@/features/marketplace/links' import { cn } from '@langgenius/dify-ui/cn' import { Separator } from '@langgenius/dify-ui/separator' import { useQuery } from '@tanstack/react-query' -import { useTheme } from 'next-themes' import { useCallback, useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder' import List from '@/app/components/plugins/marketplace/list' import { usePluginSettingsAccess } from '@/app/components/plugins/plugin-page/use-reference-setting' import ProviderCard from '@/app/components/plugins/provider-card' -import { PluginCategoryEnum } from '@/app/components/plugins/types' -import Link from '@/next/link' import { consoleQuery } from '@/service/console' import { useMarketplaceAllPlugins } from './hooks' @@ -23,12 +20,10 @@ type InstallFromMarketplaceProps = { } const InstallFromMarketplace = ({ marketplace, - onOpenMarketplace, searchText, stepByStepTourTarget, }: InstallFromMarketplaceProps) => { const { t } = useTranslation(['plugin', 'modelProvider']) - const { theme } = useTheme() const { canInstallPlugin } = usePluginSettingsAccess() const [collapse, setCollapse] = useState(false) const [hasEnteredViewport, setHasEnteredViewport] = useState( @@ -114,37 +109,6 @@ const InstallFromMarketplace = ({ /> {t(($) => $['modelProvider.installProvider'], { ns: 'modelProvider' })} -

{!collapse && shouldLoadMarketplace && !hasLoadedInstalledPluginIds && ( diff --git a/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-modal/index.tsx b/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-modal/index.tsx index dcad71f7..d67faf91 100644 --- a/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-modal/index.tsx +++ b/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-modal/index.tsx @@ -1,4 +1,5 @@ import type { FC } from 'react' +import { isOfficialDifyUrl } from '@/utils/official-link' import type { Credential, CustomConfigurationModelFixedFields, @@ -383,7 +384,9 @@ const ModelModal: FC = ({ )} - {provider.help && (provider.help.title || provider.help.url) && ( + {provider.help && + (provider.help.title || provider.help.url) && + !isOfficialDifyUrl(provider.help?.url[language] || provider.help?.url.en_US) && ( - onOpenMarketplace?: () => void } function ModelProviderCardSkeleton() { @@ -58,14 +53,8 @@ function ModelProviderListSkeleton() { ) } -function EmptyProviderState({ - enableMarketplace, - stepByStepTourTarget, -}: { - enableMarketplace: boolean - stepByStepTourTarget?: string -}) { - const { t } = useTranslation(['plugin', 'modelProvider', 'navigation']) +function EmptyProviderState({ stepByStepTourTarget }: { stepByStepTourTarget?: string }) { + const { t } = useTranslation(['modelProvider']) return (
$['modelProvider.emptyProviderTitle'], { ns: 'modelProvider' })}

- {enableMarketplace ? ( - $['modelProvider.emptyProviderTipWithMarketplace']} - ns="modelProvider" - components={{ - marketplace: ( - $['marketplace.difyMarketplace'], { ns: 'plugin' })} - className="system-xs-medium text-text-accent hover:underline" - > - {t(($) => $['mainNav.marketplace'], { ns: 'navigation' })} - - ), - }} - /> - ) : ( - t(($) => $['modelProvider.emptyProviderTip'], { ns: 'modelProvider' }) - )} + {t(($) => $['modelProvider.emptyProviderTip'], { ns: 'modelProvider' })}

) @@ -162,10 +133,7 @@ const ModelProviderPageBody: FC = ({ showEmptyProvider, showConfiguredProviders, showNotConfiguredProviders, - marketplace, - searchText, pluginSummaryMap, - onOpenMarketplace, }) => { const { t } = useTranslation(['modelProvider']) const { data: deploymentEdition } = useSuspenseQuery({ @@ -189,7 +157,6 @@ const ModelProviderPageBody: FC = ({ )} {showEmptyProvider && ( = ({ /> )} - {!isLoadingModelProviders && marketplace && ( -
- -
- )} ) } diff --git a/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-selector/__tests__/popup.spec.tsx b/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-selector/__tests__/popup.spec.tsx index 6cb27aec..5e078f0c 100644 --- a/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-selector/__tests__/popup.spec.tsx +++ b/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-selector/__tests__/popup.spec.tsx @@ -522,10 +522,9 @@ describe('workspace credits and marketplace availability', () => { it('keeps marketplace discovery available without installation permission', async () => { await setup({ modelList: [] }, { marketplace: true, installPermission: false }) expect(screen.queryByRole('button', { name: /selector.install/ })).not.toBeInTheDocument() - expect(screen.getByRole('link', { name: /discoverMoreInMarketplace/ })).toHaveAttribute( - 'href', - expect.stringMatching(/\/plugins\/model$/), - ) + expect( + screen.queryByRole('link', { name: /discoverMoreInMarketplace/ }), + ).not.toBeInTheDocument() }) }) diff --git a/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-selector/marketplace-section.tsx b/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-selector/marketplace-section.tsx index cfe14c58..54fb0a47 100644 --- a/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-selector/marketplace-section.tsx +++ b/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-selector/marketplace-section.tsx @@ -5,7 +5,6 @@ import { cn } from '@langgenius/dify-ui/cn' import { Collapsible, CollapsiblePanel, CollapsibleTrigger } from '@langgenius/dify-ui/collapsible' import { useId } from 'react' import { useTranslation } from 'react-i18next' -import { PluginCategoryEnum } from '@/app/components/plugins/types' import { modelNameMap, providerLogoMap } from '../utils' type MarketplaceSectionProps = { @@ -21,15 +20,12 @@ type MarketplaceSectionProps = { } function MarketplaceSection({ - marketplace, marketplaceProviders, marketplaceCollapsed, installingProvider, canInstallPlugin, - theme, onMarketplaceCollapsedChange, onInstallPlugin, - onOpenMarketplace, }: MarketplaceSectionProps) { const { t } = useTranslation(['plugin', 'modelProvider']) const headingId = useId() @@ -116,43 +112,6 @@ function MarketplaceSection({ ) })} -
- {onOpenMarketplace ? ( - - ) : ( - - - {t(($) => $['modelProvider.selector.discoverMoreInMarketplace'], { - ns: 'modelProvider', - })} - - - )} -
diff --git a/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-selector/popup.tsx b/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-selector/popup.tsx index 233909ab..bd4fec73 100644 --- a/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-selector/popup.tsx +++ b/demo-dify/dify/web/app/components/header/account-setting/model-provider-page/model-selector/popup.tsx @@ -306,7 +306,7 @@ function Popup({ onClick={() => setShowIncompatibleModels((value) => !value)} /> )} - {marketplace && ( + {marketplace && canInstallPlugin && ( { const { t } = useTranslation(['common', 'permission']) - const locale = useLocale() - const docLanguage = getDocLanguage(locale) const [name, setName] = useState(role?.name ?? '') const [desc, setDesc] = useState(role?.description ?? '') const [permissionKeys, setPermissionKeys] = useState(role?.permission_keys ?? []) @@ -116,15 +111,6 @@ const RoleModal = ({ mode, open, role, onClose, onSubmit }: RoleModalProps) => { /> - - {t(($) => $['permissionSet.learnMore'], { ns: 'permission' })} - - + + )} + {title} + + + {showInstall && ( + setShowInstall(false)} + onSuccess={() => { + setShowInstall(false) + onOpenChange(false) + }} + /> + )} + + ) +} diff --git a/demo-dify/dify/web/app/components/plugins/marketplace/home/__tests__/embedded-marketplace-search.spec.tsx b/demo-dify/dify/web/app/components/plugins/marketplace/home/__tests__/embedded-marketplace-search.spec.tsx index 8b61c413..f42b0f24 100644 --- a/demo-dify/dify/web/app/components/plugins/marketplace/home/__tests__/embedded-marketplace-search.spec.tsx +++ b/demo-dify/dify/web/app/components/plugins/marketplace/home/__tests__/embedded-marketplace-search.spec.tsx @@ -208,19 +208,9 @@ describe('EmbeddedMarketplaceSearch', () => { const option = await screen.findByRole('option') if (interaction === 'mouse') await user.click(option) else await user.keyboard('{ArrowDown}{Enter}') - expect(open).toHaveBeenCalledTimes(1) - const [href, target, features] = open.mock.calls[0]! - const url = new URL(String(href)) - expect(url.origin).toBe('https://marketplace.dify.ai') - expect(url.pathname).toBe( - kind === 'plugin' ? '/plugin/langgenius/google-search' : '/template/dify/template-1', - ) - expect(url.searchParams.get('source')).toBe(window.location.origin) - expect(target).toBe('_blank') - expect(features).toBe('noopener,noreferrer') - expect(input).toHaveValue('search') + expect(open).not.toHaveBeenCalled() expect(onUrlUpdate).not.toHaveBeenCalled() - expect(screen.queryByRole('dialog')).not.toBeInTheDocument() + expect(await screen.findByRole('dialog')).toBeInTheDocument() }, ) }) diff --git a/demo-dify/dify/web/app/components/plugins/marketplace/home/__tests__/home-header.spec.tsx b/demo-dify/dify/web/app/components/plugins/marketplace/home/__tests__/home-header.spec.tsx index cb626740..9402689a 100644 --- a/demo-dify/dify/web/app/components/plugins/marketplace/home/__tests__/home-header.spec.tsx +++ b/demo-dify/dify/web/app/components/plugins/marketplace/home/__tests__/home-header.spec.tsx @@ -47,37 +47,13 @@ describe('HomeHeader', () => { mocks.marketplaceUrlPrefix = 'https://marketplace.dify.ai' }) - it('keeps Creator Center and docs in the in-app header', () => { + it('does not link the header to Creator Center or the official guide', () => { render() - expect(screen.getByRole('link', { name: 'marketplace.home.creatorCenter' })).toBeInTheDocument() - expect(screen.getByRole('button', { name: /marketplace\.home\.guide/ })).toBeInTheDocument() - }) - - it('links Creator Center alongside the docs dropdown', () => { - render() - - const creatorCenterLink = screen.getByRole('link', { name: 'marketplace.home.creatorCenter' }) - expect(screen.getByRole('button', { name: /marketplace\.home\.guide/ })).toBeInTheDocument() - - expect(creatorCenterLink).toHaveAttribute('href', 'https://creators.dify.ai/') - expect(creatorCenterLink).toHaveAttribute('target', '_blank') - expect(creatorCenterLink).toHaveAttribute('rel', 'noopener noreferrer') - - // Creator Center must be a single interactive element, not a link-wrapped button. - expect(creatorCenterLink.querySelector('button')).toBeNull() - expect(screen.queryByRole('link', { name: 'marketplace.home.guide' })).not.toBeInTheDocument() - }) - - it('links Creator Center to the staging Creators site in staging', () => { - mocks.marketplaceUrlPrefix = 'https://marketplace-staging.dify.dev' - - render() - - expect(screen.getByRole('link', { name: 'marketplace.home.creatorCenter' })).toHaveAttribute( - 'href', - 'https://creators-staging.dify.dev/', - ) + expect( + screen.queryByRole('link', { name: 'marketplace.home.creatorCenter' }), + ).not.toBeInTheDocument() + expect(screen.queryByRole('button', { name: /marketplace\.home\.guide/ })).not.toBeInTheDocument() }) it('selects neither catalog tab on non-catalog pages', () => { diff --git a/demo-dify/dify/web/app/components/plugins/marketplace/home/__tests__/home-trending.spec.tsx b/demo-dify/dify/web/app/components/plugins/marketplace/home/__tests__/home-trending.spec.tsx index ac11bf30..2740ebe8 100644 --- a/demo-dify/dify/web/app/components/plugins/marketplace/home/__tests__/home-trending.spec.tsx +++ b/demo-dify/dify/web/app/components/plugins/marketplace/home/__tests__/home-trending.spec.tsx @@ -220,21 +220,14 @@ describe('HomeTrending', () => { expect(screen.getByRole('heading', { name: 'Dify v1.9 new launch' })).toBeInTheDocument() const blogSlide = screen.getByRole('group', { name: 'Dify Updates' }) - const blogLink = within(blogSlide).getByRole('link', { - name: /^plugin\.marketplace\.home\.trendingReadMoreAbout/, - }) - expect(blogLink).toHaveAttribute('href', 'https://dify.ai/blog') - expect(within(blogSlide).getAllByRole('link')).toHaveLength(1) + expect(within(blogSlide).queryByRole('link')).not.toBeInTheDocument() expect( - within(blogLink).getByRole('heading', { name: 'Dify v1.9 new launch' }), + within(blogSlide).getByRole('heading', { name: 'Dify v1.9 new launch' }), ).toBeInTheDocument() await user.click(screen.getByRole('button', { name: 'Duck Duck Go' })) - expect(screen.getByRole('link', { name: 'DuckDuckGo plugin' })).toHaveAttribute( - 'href', - 'https://marketplace.dify.ai/plugin/langgenius/duckduckgo', - ) + expect(screen.queryByRole('link', { name: 'DuckDuckGo plugin' })).not.toBeInTheDocument() }) it('renders the delivered blog cover instead of bundled art', () => { @@ -255,10 +248,8 @@ describe('HomeTrending', () => { render() - const blogLink = screen.getByRole('link', { - name: /^plugin\.marketplace\.home\.trendingReadMoreAbout/, - }) - expect(blogLink.querySelector('img')?.getAttribute('src')).toContain( + const blogSlide = screen.getByRole('group', { name: 'Research' }) + expect(blogSlide.querySelector('img')?.getAttribute('src')).toContain( '/api/v1/banners/images/banners/trust-cover.png', ) }) @@ -266,10 +257,8 @@ describe('HomeTrending', () => { it('omits blog cover art when the payload has no cover_image', () => { render() - const blogLink = screen.getByRole('link', { - name: /^plugin\.marketplace\.home\.trendingReadMoreAbout/, - }) - expect(blogLink.querySelector('img')).toBeNull() + const blogSlide = screen.getByRole('group', { name: 'Dify Updates' }) + expect(blogSlide.querySelector('img')).toBeNull() }) it('keeps only the selected slide in the accessibility tree', async () => { @@ -999,34 +988,22 @@ describe('HomeTrending', () => { ) }) - it('tracks whole-slide blog and event links as frame clicks', async () => { + it('does not link official blog and event banners', async () => { const user = userEvent.setup() render() await user.click(screen.getByRole('button', { name: 'Dify Updates' })) - await user.click( - screen.getByRole('link', { name: /^plugin\.marketplace\.home\.trendingReadMoreAbout/ }), - ) - - expect(mockTrackEvent).toHaveBeenCalledWith('marketplace_banner_click', { - banner_id: 'blog', - sort: 1, - page: 'plugins', - language: 'en', - style_type: 'blog', - }) + expect( + screen.queryByRole('link', { name: /^plugin\.marketplace\.home\.trendingReadMoreAbout/ }), + ).not.toBeInTheDocument() await user.click(screen.getByRole('button', { name: 'Duck Duck Go' })) - await user.click(screen.getByRole('link', { name: 'DuckDuckGo plugin' })) - - expect(mockTrackEvent).toHaveBeenCalledWith('marketplace_banner_click', { - banner_id: 'event', - sort: 2, - page: 'plugins', - language: 'en', - style_type: 'event', - }) + expect(screen.queryByRole('link', { name: 'DuckDuckGo plugin' })).not.toBeInTheDocument() + expect(mockTrackEvent).not.toHaveBeenCalledWith( + 'marketplace_banner_click', + expect.objectContaining({ style_type: 'blog' }), + ) }) it('does not render banner slides whose CMS link is not http(s) or relative', () => { @@ -1083,7 +1060,7 @@ describe('HomeTrending', () => { } }) it.each(['COMMUNITY', 'ENTERPRISE'] as const)( - 'links %s recommendations directly to the official site', + 'keeps %s recommendations inside the app', (edition) => { const mixedBanner: PluginBanner = { id: 'mixed', @@ -1116,20 +1093,10 @@ describe('HomeTrending', () => { , { systemFeatures: { deployment_edition: edition } }, ) - const links = [ - screen.getByRole('link', { name: 'Dropbox' }), - screen.getByRole('link', { name: 'Support Bot' }), - ] - expect(new URL(links[0]!.getAttribute('href')!).pathname).toBe('/plugin/langgenius/dropbox') - expect(new URL(links[1]!.getAttribute('href')!).pathname).toBe('/template/aisa-team/tpl-1') - for (const link of links) - expect(new URL(link.getAttribute('href')!).origin).toBe('https://marketplace.dify.ai') - for (const link of links) { - expect(link).toHaveAttribute('target', '_blank') - expect(new URL(link.getAttribute('href')!).searchParams.get('source')).toBe( - window.location.origin, - ) - } + expect(screen.getByRole('button', { name: 'Dropbox' })).toBeInTheDocument() + expect(screen.getByRole('button', { name: 'Support Bot' })).toBeInTheDocument() + expect(screen.queryByRole('link', { name: 'Dropbox' })).not.toBeInTheDocument() + expect(screen.queryByRole('link', { name: 'Support Bot' })).not.toBeInTheDocument() expect(screen.queryByRole('dialog')).not.toBeInTheDocument() }, ) diff --git a/demo-dify/dify/web/app/components/plugins/marketplace/home/home-creator-center.tsx b/demo-dify/dify/web/app/components/plugins/marketplace/home/home-creator-center.tsx index 7dc4ef00..56e9c6d5 100644 --- a/demo-dify/dify/web/app/components/plugins/marketplace/home/home-creator-center.tsx +++ b/demo-dify/dify/web/app/components/plugins/marketplace/home/home-creator-center.tsx @@ -5,12 +5,14 @@ import { cn } from '@langgenius/dify-ui/cn' import { useTranslation } from '#i18n' import Link from '@/next/link' import { trackMarketplaceSiteEvent } from '@/utils/marketplace-site-track' +import { isOfficialDifyUrl } from '@/utils/official-link' import { useCreatorCenterUrl } from '../creator-center-url' export default function HomeCreatorCenter() { const { t } = useTranslation(['plugin']) const creatorCenterUrl = useCreatorCenterUrl() const label = t(($) => $['marketplace.home.creatorCenter']) + if (!creatorCenterUrl || isOfficialDifyUrl(creatorCenterUrl)) return null return (
-
- - -
{actions}
diff --git a/demo-dify/dify/web/app/components/plugins/marketplace/home/home-trending-slides.tsx b/demo-dify/dify/web/app/components/plugins/marketplace/home/home-trending-slides.tsx index 017b9659..a516067a 100644 --- a/demo-dify/dify/web/app/components/plugins/marketplace/home/home-trending-slides.tsx +++ b/demo-dify/dify/web/app/components/plugins/marketplace/home/home-trending-slides.tsx @@ -12,7 +12,7 @@ import type { import type { MarketplaceBannerPage } from './banners' import type { Plugin } from '@/app/components/plugins/types' import { cn } from '@langgenius/dify-ui/cn' -import { useState } from 'react' +import { useState, type ReactNode } from 'react' import { useTranslation } from '#i18n' import { trackEvent } from '@/app/components/base/amplitude' import Partner from '@/app/components/plugins/base/badges/partner' @@ -29,6 +29,8 @@ import Link from '@/next/link' import { useRouter } from '@/next/navigation' import { fetchPluginInfoFromMarketPlace } from '@/service/plugins' import { resolveEmoji } from '@/utils/emoji' +import { isOfficialDifyUrl } from '@/utils/official-link' +import { visibleAuthorName } from '@/utils/visible-author' import { rememberMarketplaceSiteReferrer, trackMarketplaceSiteEvent, @@ -151,7 +153,7 @@ const getLocalCardHref = (card: BannerRecommendCard) => { const getCardHref = (card: BannerRecommendCard, isMarketplacePlatform: boolean) => { if (isMarketplacePlatform) return getLocalCardHref(card) const deliveryHref = card.link ? sanitizeMarketplaceHref(card.link) : null - if (deliveryHref) return deliveryHref + if (deliveryHref && !isOfficialDifyUrl(deliveryHref)) return deliveryHref return getLocalCardHref(card) } @@ -255,7 +257,7 @@ function trackRecommendCardClick( function RecommendCardFace({ card }: { card: BannerRecommendCard }) { const { t } = useTranslation(['plugin']) const iconURL = resolveMarketplaceAssetUrl(card.icon_url) - const creator = getCardCreator(card) + const creator = visibleAuthorName(getCardCreator(card)) const isPartner = card.badges?.includes('partner') const isVerified = card.badges?.includes('verified') @@ -581,6 +583,36 @@ function TrendingRecommendationSlide({ ) } +function SlideFrame({ + href, + className, + label, + onClick, + children, +}: { + href: string | null + className: string + label: string + onClick: () => void + children: ReactNode +}) { + if (!href) return
{children}
+ + const opensInNewTab = /^https?:\/\//.test(href) + return ( + + {children} + + ) +} + function BlogBannerSlide({ banner, isMarketplacePlatform, @@ -591,21 +623,18 @@ function BlogBannerSlide({ page: MarketplaceBannerPage }) { const { t } = useTranslation(['plugin']) - const href = sanitizeMarketplaceHref(banner.content.link) - if (!href) return null - const opensInNewTab = /^https?:\/\//.test(href) + const sanitized = sanitizeMarketplaceHref(banner.content.link) + if (!sanitized || isOfficialDifyUrl(sanitized)) return null const coverSrc = resolveMarketplaceAssetUrl(banner.content.cover_image) return ( - { trackEvent('marketplace_banner_click', getBannerFrameProps(banner, page)) trackMarketplaceBannerClick(banner) }} - aria-label={t(($) => $['marketplace.home.trendingReadMoreAbout'], { + label={t(($) => $['marketplace.home.trendingReadMoreAbout'], { title: banner.content.blog_title, })} className={cn( @@ -693,7 +722,7 @@ function BlogBannerSlide({ )} /> ) : null} - + ) } @@ -706,8 +735,8 @@ function ImageBannerSlide({ isMarketplacePlatform: boolean page: MarketplaceBannerPage }) { - const href = sanitizeMarketplaceHref(banner.content.link) - if (!href) return null + const sanitized = sanitizeMarketplaceHref(banner.content.link) + if (!sanitized || isOfficialDifyUrl(sanitized)) return null const resolved = resolveEventAdBannerImageSrcs({ desktop: resolveMarketplaceAssetUrl(banner.content.images.desktop), tablet: resolveMarketplaceAssetUrl(banner.content.images.tablet) || undefined, @@ -715,15 +744,13 @@ function ImageBannerSlide({ }) return ( - { trackEvent('marketplace_banner_click', getBannerFrameProps(banner, page)) trackMarketplaceBannerClick(banner) }} - aria-label={banner.content.alt_text || banner.title} + label={banner.content.alt_text || banner.title} className={cn( 'block h-[200px] w-full overflow-hidden rounded-2xl outline-hidden focus-visible:ring-2 focus-visible:ring-state-accent-solid', isMarketplacePlatform && styles.imageSlide, @@ -751,7 +778,7 @@ function ImageBannerSlide({ className="size-full object-cover object-left" /> - + ) } diff --git a/demo-dify/dify/web/app/components/plugins/marketplace/home/marketplace-search-autocomplete.tsx b/demo-dify/dify/web/app/components/plugins/marketplace/home/marketplace-search-autocomplete.tsx index 30dc9578..20e628dc 100644 --- a/demo-dify/dify/web/app/components/plugins/marketplace/home/marketplace-search-autocomplete.tsx +++ b/demo-dify/dify/web/app/components/plugins/marketplace/home/marketplace-search-autocomplete.tsx @@ -31,6 +31,7 @@ import { getPluginDetailPath, getTemplateDetailPath } from '@/features/marketpla import { renderI18nObject } from '@/i18n/metadata' import { marketplaceQuery } from '@/service/marketplace' import { markMarketplaceSiteSearch } from '@/utils/marketplace-site-track' +import { visibleAuthorName } from '@/utils/visible-author' import { getPluginIconInMarketplace } from '../utils' type MarketplaceSearchScope = 'all' | 'plugins' | 'templates' @@ -80,7 +81,7 @@ const toTemplateSuggestion = (template: MarketplaceTemplate): MarketplaceSuggest id: `template:${template.id}`, kind: 'template', label: template.template_name, - meta: template.publisher_handle || template.publisher_unique_handle || '', + meta: visibleAuthorName(template.publisher_handle || template.publisher_unique_handle), selection: { kind: 'template', template }, }) @@ -90,7 +91,7 @@ const toPluginSuggestion = (plugin: MarketplacePlugin, locale: string): Marketpl id: `plugin:${plugin.org}/${plugin.name}`, kind: 'plugin', label: getPluginText(plugin.label, locale) || plugin.name, - meta: plugin.org, + meta: visibleAuthorName(plugin.org), selection: { kind: 'plugin', plugin }, }) diff --git a/demo-dify/dify/web/app/components/plugins/marketplace/list/__tests__/card-wrapper.spec.tsx b/demo-dify/dify/web/app/components/plugins/marketplace/list/__tests__/card-wrapper.spec.tsx index 668397f3..aaea6886 100644 --- a/demo-dify/dify/web/app/components/plugins/marketplace/list/__tests__/card-wrapper.spec.tsx +++ b/demo-dify/dify/web/app/components/plugins/marketplace/list/__tests__/card-wrapper.spec.tsx @@ -154,24 +154,13 @@ describe('CardWrapper', () => { }) it.each(['COMMUNITY', 'ENTERPRISE'] as const)( - 'links %s plugin details to the official site while preserving direct installation', + 'opens %s plugin details in the app while preserving direct installation', async (edition) => { const user = userEvent.setup() renderCardWrapper({ showInstallButton: true }, edition) - const card = screen.getByRole('link', { name: 'Plugin A' }) - const url = new URL(card.getAttribute('href')!) - expect(url.origin).toBe('https://marketplace.dify.ai') - expect(url.pathname).toBe('/plugin/dify/plugin-a') - expect(url.searchParams.get('source')).toBe(window.location.origin) - expect(url.searchParams.get('theme')).toBe('dark') - expect(card).toHaveAttribute('target', '_blank') - expect(card).toHaveAttribute('rel', 'noopener noreferrer') - expect( - screen.getByRole('link', { name: 'plugin.detailPanel.operation.detail' }), - ).toHaveAttribute('href', url.toString()) - expect(screen.queryByTitle(detailTitle)).not.toBeInTheDocument() - await user.click(screen.getByRole('button', { name: 'plugin.detailPanel.operation.install' })) - expect(await screen.findByRole('dialog', { name: installTitle })).toBeInTheDocument() + expect(screen.queryByRole('link', { name: 'Plugin A' })).not.toBeInTheDocument() + await user.click(screen.getByRole('button', { name: 'Plugin A' })) + expect(await screen.findByRole('dialog', { name: detailTitle })).toBeInTheDocument() }, ) diff --git a/demo-dify/dify/web/app/components/plugins/marketplace/list/__tests__/list-with-collection.spec.tsx b/demo-dify/dify/web/app/components/plugins/marketplace/list/__tests__/list-with-collection.spec.tsx index 390b77bd..dbad222c 100644 --- a/demo-dify/dify/web/app/components/plugins/marketplace/list/__tests__/list-with-collection.spec.tsx +++ b/demo-dify/dify/web/app/components/plugins/marketplace/list/__tests__/list-with-collection.spec.tsx @@ -168,14 +168,9 @@ describe('ListWithCollection', () => { />, ) - const partnerLink = screen.getByRole('link', { name: 'plugin.marketplace.becomePartner' }) - - expect(partnerLink).toHaveAttribute( - 'href', - 'https://share-na2.hsforms.com/1NiS4r9lsSqGcuNBB77DeEQ40s9fk', - ) - expect(partnerLink).toHaveAttribute('target', '_blank') - expect(partnerLink).toHaveAttribute('rel', 'noopener noreferrer') + expect( + screen.queryByRole('link', { name: 'plugin.marketplace.becomePartner' }), + ).not.toBeInTheDocument() expect( screen.getAllByText(/^(?:Plugin (?:One|Two)|Partner Plugin|Featured Plugin)$/), ).toHaveLength(2) diff --git a/demo-dify/dify/web/app/components/plugins/marketplace/list/card-wrapper.tsx b/demo-dify/dify/web/app/components/plugins/marketplace/list/card-wrapper.tsx index 3bc0e989..59dd8268 100644 --- a/demo-dify/dify/web/app/components/plugins/marketplace/list/card-wrapper.tsx +++ b/demo-dify/dify/web/app/components/plugins/marketplace/list/card-wrapper.tsx @@ -12,6 +12,7 @@ import { useOptionalPluginInstallPermission } from '@/app/components/plugins/ins import InstallFromMarketplace from '@/app/components/plugins/install-plugin/install-from-marketplace' import { useGetLanguage } from '@/context/i18n' import { getPluginDetailPath } from '@/features/marketplace/links' +import { isOfficialDifyUrl } from '@/utils/official-link' import { renderI18nObject } from '@/i18n/metadata' import Link from '@/next/link' import { trackMarketplaceSiteCardClick } from '@/utils/marketplace-site-track' @@ -31,8 +32,8 @@ const CardWrapperContent = ({ isInstalled = false, linkToMarketplaceDetail = false, section = 'list', - externalDetailHref, -}: CardWrapperProps & { externalDetailHref?: string }) => { + detailHref: externalDetailHref, +}: CardWrapperProps & { detailHref?: string }) => { const { t } = useTranslation(['plugin']) const locale = useGetLanguage() const [ @@ -46,6 +47,8 @@ const CardWrapperContent = ({ const { canInstallPlugin } = useOptionalPluginInstallPermission() const { getTagLabel } = useTags() const pluginLabel = renderI18nObject(plugin.label, locale) || plugin.name + const detailHref = + externalDetailHref && !isOfficialDifyUrl(externalDetailHref) ? externalDetailHref : undefined // Memoize tag labels to prevent recreating array on every render const tagLabels = useMemo( @@ -96,9 +99,9 @@ const CardWrapperContent = ({ className="group relative cursor-pointer rounded-xl" data-marketplace-card={plugin.plugin_id} > - {externalDetailHref ? ( + {detailHref ? (
$['task.installed'], { ns: 'plugin' }) : t(($) => $['detailPanel.operation.install'], { ns: 'plugin' })} - {externalDetailHref ? ( + {detailHref ? ( )} - {!externalDetailHref && ( + {!detailHref && ( + return } function CardWrapperComponent(props: CardWrapperProps) { diff --git a/demo-dify/dify/web/app/components/plugins/marketplace/list/list-with-collection.tsx b/demo-dify/dify/web/app/components/plugins/marketplace/list/list-with-collection.tsx index 90ff9547..e35b55ea 100644 --- a/demo-dify/dify/web/app/components/plugins/marketplace/list/list-with-collection.tsx +++ b/demo-dify/dify/web/app/components/plugins/marketplace/list/list-with-collection.tsx @@ -6,13 +6,12 @@ import { cn } from '@langgenius/dify-ui/cn' import { useEffect, useId, useMemo, useRef, useState } from 'react' import { useLocale, useTranslation } from '#i18n' import { getPluginLanguage } from '@/i18n/metadata' -import { trackMarketplaceSiteEvent } from '@/utils/marketplace-site-track' import { useMarketplaceMoreClick } from '../atoms' import { MARKETPLACE_CONTAINER_ID } from '../constants' import { buildCarouselPages } from '../utils' import CardWrapper from './card-wrapper' import Carousel from './carousel' -import { BECOME_PARTNER_URL, GRID_CLASS, PARTNER_COLLECTION_NAMES } from './collection-constants' +import { GRID_CLASS, PARTNER_COLLECTION_NAMES } from './collection-constants' import styles from './partner-header.module.css' import { useCarouselItemsPerPage } from './use-carousel-items-per-page' @@ -211,36 +210,6 @@ const CollectionSection = ({ ) : ( collection.description[getPluginLanguage(locale)] )} - {isPartnersCollection && ( - <> - | - { - trackMarketplaceSiteEvent('marketplace_creator_partner_click', { - click_target: 'Become a Partner', - }) - }} - > - - {t(($) => $['marketplace.becomePartner'], { ns: 'plugin' })} - - - - - )} {collection.searchable && !hasMultiplePages && ( diff --git a/demo-dify/dify/web/app/components/plugins/marketplace/templates/__tests__/template-card.spec.tsx b/demo-dify/dify/web/app/components/plugins/marketplace/templates/__tests__/template-card.spec.tsx index 7ccee4a4..fffcc225 100644 --- a/demo-dify/dify/web/app/components/plugins/marketplace/templates/__tests__/template-card.spec.tsx +++ b/demo-dify/dify/web/app/components/plugins/marketplace/templates/__tests__/template-card.spec.tsx @@ -132,7 +132,7 @@ describe('TemplateCard', () => { }), ) expect(mockPush).toHaveBeenCalledWith('/apps?template-id=template%2Fone') - expect(screen.getByText('dify')).toBeInTheDocument() + expect(screen.queryByText('dify')).not.toBeInTheDocument() expect(screen.getByText('1.2k')).toBeInTheDocument() expect(screen.getByText('Verified by a Dify partner')).toBeInTheDocument() }) @@ -156,32 +156,20 @@ describe('TemplateCard', () => { expect(screen.getByRole('dialog')).toBeInTheDocument() }) it.each(['COMMUNITY', 'ENTERPRISE'] as const)( - 'opens %s template links outside Dify without changing the catalog route', - (edition) => { + 'opens %s template details in the app', + async (edition) => { + const user = userEvent.setup() deploymentState.deploymentEdition = edition - ;(window as unknown as Window).happyDOM.setURL( - 'https://ai.njueai.com:8443/templates?q=research', - ) - const before = window.location.href render( , ) - const link = screen.getByRole('link', { name: template.template_name }) - const url = new URL(link.getAttribute('href')!) - expect(url.origin).toBe('https://marketplace.dify.ai') - expect(url.pathname).toBe('/template/dify/template%2Fone') - expect(Object.fromEntries(url.searchParams)).toEqual({ - source: window.location.origin, - language: 'en-US', - theme: 'dark', - }) - expect(link).toHaveAttribute('target', '_blank') - expect(link).toHaveAttribute('rel', 'noopener noreferrer') - expect(screen.queryByRole('dialog')).not.toBeInTheDocument() - expect(document.querySelector('iframe')).toBeNull() - expect(window.location.href).toBe(before) + expect( + screen.queryByRole('link', { name: template.template_name }), + ).not.toBeInTheDocument() + await user.click(screen.getByRole('button', { name: template.template_name })) + expect(screen.getByRole('dialog')).toBeInTheDocument() }, ) }) diff --git a/demo-dify/dify/web/app/components/plugins/marketplace/templates/__tests__/template-detail-route.spec.tsx b/demo-dify/dify/web/app/components/plugins/marketplace/templates/__tests__/template-detail-route.spec.tsx index 30af204c..dfbdd00a 100644 --- a/demo-dify/dify/web/app/components/plugins/marketplace/templates/__tests__/template-detail-route.spec.tsx +++ b/demo-dify/dify/web/app/components/plugins/marketplace/templates/__tests__/template-detail-route.spec.tsx @@ -113,7 +113,7 @@ describe('TemplateDetailRouteProvider', () => { expect(window.location.pathname).toBe('/templates/marketing') }) it.each(['COMMUNITY', 'ENTERPRISE'] as const)( - 'replaces a legacy %s template detail URL with its official detail', + 'keeps a legacy %s template detail inside the app', (edition) => { deploymentState.deploymentEdition = edition window.history.replaceState(window.history.state, '', `/templates/dify/${id}`) @@ -123,13 +123,8 @@ describe('TemplateDetailRouteProvider', () => { catalog , ) - expect(replace).toHaveBeenCalledOnce() - const url = new URL(replace.mock.calls[0]![0]) - expect(url.origin).toBe('https://marketplace.dify.ai') - expect(url.pathname).toBe(`/template/dify/${id}`) - expect(url.searchParams.get('source')).toBe(window.location.origin) - expect(url.searchParams.has('view')).toBe(false) - expect(screen.queryByRole('dialog')).not.toBeInTheDocument() + expect(replace).not.toHaveBeenCalled() + expect(screen.getByRole('dialog')).toBeInTheDocument() replace.mockRestore() }, ) diff --git a/demo-dify/dify/web/app/components/plugins/marketplace/templates/template-card.tsx b/demo-dify/dify/web/app/components/plugins/marketplace/templates/template-card.tsx index a60b5a92..714cf64b 100644 --- a/demo-dify/dify/web/app/components/plugins/marketplace/templates/template-card.tsx +++ b/demo-dify/dify/web/app/components/plugins/marketplace/templates/template-card.tsx @@ -12,6 +12,8 @@ import { } from '@/features/marketplace/api' import { useRouter } from '@/next/navigation' import { formatNumberAbbreviated } from '@/utils/format' +import { isOfficialDifyUrl } from '@/utils/official-link' +import { visibleAuthorName } from '@/utils/visible-author' import { useMarketplaceDetailNavigation } from '../use-detail-navigation' import TemplateDetailDialog from './template-detail-dialog' import { useOptionalTemplateDetailRoute } from './use-optional-template-detail-route' @@ -30,8 +32,9 @@ export default function TemplateCard({ template, className, partnerText }: Templ const externalHref = navigation.templateHref(template) const templateDetailRoute = useOptionalTemplateDetailRoute() const [isDetailOpen, { setTrue: showDetail, setFalse: hideDetail }] = useBoolean(false) - const publisher = - template.publisher_handle || template.publisher_unique_handle || template.creator_email || '' + const publisher = visibleAuthorName( + template.publisher_handle || template.publisher_unique_handle || template.creator_email, + ) const visiblePlugins = template.deps_plugins?.slice(0, MAX_VISIBLE_PLUGIN_DEPENDENCIES) ?? [] const remainingPluginCount = Math.max( 0, @@ -60,7 +63,7 @@ export default function TemplateCard({ template, className, partnerText }: Templ className, )} > - {externalHref ? ( + {externalHref && !isOfficialDifyUrl(externalHref) ? ( - | - { - trackMarketplaceSiteEvent('marketplace_creator_partner_click', { - click_target: 'Become a Partner', - }) - }} - > - {becomePartnerText} - - - - )} {collection.searchable && ( diff --git a/demo-dify/dify/web/app/components/plugins/marketplace/use-detail-navigation.ts b/demo-dify/dify/web/app/components/plugins/marketplace/use-detail-navigation.ts index 6c0fa930..598f54a0 100644 --- a/demo-dify/dify/web/app/components/plugins/marketplace/use-detail-navigation.ts +++ b/demo-dify/dify/web/app/components/plugins/marketplace/use-detail-navigation.ts @@ -1,16 +1,6 @@ 'use client' import type { MarketplacePlugin, MarketplaceTemplate } from '@dify/contracts/marketplace' -import { useAtomValue } from 'jotai' -import { useTheme } from 'next-themes' -import { useSyncExternalStore } from 'react' -import { useLocale } from '#i18n' -import { marketplaceLinks } from '@/features/marketplace/links' -import { deploymentEditionAtom } from '@/features/system-features/state' - -const subscribe = () => () => {} -const getOrigin = () => window.location.origin -const getServerOrigin = () => '' type PluginDetail = Pick type TemplateDetail = Pick< @@ -18,39 +8,15 @@ type TemplateDetail = Pick< 'id' | 'publisher_handle' | 'publisher_unique_handle' > -// Only Dify entrypoints use this hook. Standalone Marketplace components must -// not depend on the Console's deployment state or query its system features. +// Local deployments stay inside the console. Plugin and template details open +// in-app instead of marketplace.dify.ai or creators.dify.ai. export function useMarketplaceDetailNavigation() { - const edition = useAtomValue(deploymentEditionAtom) - const language = useLocale() - const { resolvedTheme } = useTheme() - const source = useSyncExternalStore(subscribe, getOrigin, getServerOrigin) - const opensExternally = edition === 'COMMUNITY' || edition === 'ENTERPRISE' - - const detailParams = { language, theme: resolvedTheme } - const pluginHref = (plugin: PluginDetail) => - opensExternally && plugin.type !== 'bundle' - ? marketplaceLinks.officialPluginDetail(plugin, detailParams, source) - : undefined - const templateHref = (template: TemplateDetail) => - opensExternally - ? marketplaceLinks.officialTemplateDetail(template, detailParams, source) - : undefined - - // Search selections are commands, so open synchronously within the gesture. - // Ordinary cards use the href directly to retain native link behavior. - const open = (href: string | undefined) => { - if (!href) return false - window.open(href, '_blank', 'noopener,noreferrer') - return true - } - return { - source, - opensExternally, - pluginHref, - templateHref, - openPlugin: (plugin: PluginDetail) => open(pluginHref(plugin)), - openTemplate: (template: TemplateDetail) => open(templateHref(template)), + source: '', + opensExternally: false, + pluginHref: (_plugin: PluginDetail) => undefined as string | undefined, + templateHref: (_template: TemplateDetail) => undefined as string | undefined, + openPlugin: (_plugin: PluginDetail) => false, + openTemplate: (_template: TemplateDetail) => false, } } diff --git a/demo-dify/dify/web/app/components/plugins/plugin-detail-panel/endpoint-list.tsx b/demo-dify/dify/web/app/components/plugins/plugin-detail-panel/endpoint-list.tsx index 54682df8..10dcbd35 100644 --- a/demo-dify/dify/web/app/components/plugins/plugin-detail-panel/endpoint-list.tsx +++ b/demo-dify/dify/web/app/components/plugins/plugin-detail-panel/endpoint-list.tsx @@ -8,7 +8,6 @@ import { useBoolean } from 'ahooks' import * as React from 'react' import { useTranslation } from 'react-i18next' import { toast } from '@/app/notifications' -import { useDocLink } from '@/context/i18n' import { consoleQuery } from '@/service/console' import { getErrorMessage } from '@/utils/error-message' import EndpointCard from './endpoint-card' @@ -25,8 +24,7 @@ type EndpointListContentProps = Readonly<{ const EndpointListContent = ({ declaration, detail }: EndpointListContentProps) => { const { t } = useTranslation(['common', 'plugin']) - const docLink = useDocLink() - const pluginUniqueID = detail.plugin_unique_identifier + const pluginUniqueID = detail.plugin_unique_identifier const showTopBorder = detail.declaration.tool const { data } = useQuery( consoleQuery.workspaces.current.endpoints.list.plugin.get.queryOptions({ @@ -82,15 +80,6 @@ const EndpointListContent = ({ declaration, detail }: EndpointListContentProps)
{t(($) => $['detailPanel.endpointsTip'], { ns: 'plugin' })}
- - - {t(($) => $['detailPanel.endpointsDocLink'], { ns: 'plugin' })} - diff --git a/demo-dify/dify/web/app/components/plugins/plugin-detail-panel/endpoint-modal.tsx b/demo-dify/dify/web/app/components/plugins/plugin-detail-panel/endpoint-modal.tsx index 8c45dee5..c3e6251f 100644 --- a/demo-dify/dify/web/app/components/plugins/plugin-detail-panel/endpoint-modal.tsx +++ b/demo-dify/dify/web/app/components/plugins/plugin-detail-panel/endpoint-modal.tsx @@ -26,6 +26,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import Form from '@/app/components/header/account-setting/model-provider-page/model-modal/Form' import { useRenderI18nObject } from '@/hooks/use-i18n' +import { isOfficialDifyUrl } from '@/utils/official-link' import { FormTypeEnum } from '../../header/account-setting/model-provider-page/declarations' import { ReadmeEntrance } from '../readme-panel/entrance' @@ -214,7 +215,7 @@ const EndpointModal = ({ validating={false} inputClassName="bg-components-input-bg-normal hover:bg-components-input-bg-hover" fieldMoreInfo={(item) => - item.url ? ( + item.url && !isOfficialDifyUrl(item.url) ? ( )} - {url && ( + {url && !isOfficialDifyUrl(url) && ( = ({ )} {source === PluginSource.marketplace && marketplace && ( - <> - -
- {t(($) => $.from, { ns: 'plugin' })}{' '} - marketplace -
- -
- +
+
+ {t(($) => $.from, { ns: 'plugin' })}{' '} + marketplace +
+
)} {source === PluginSource.local && ( <> diff --git a/demo-dify/dify/web/app/components/plugins/plugin-page/__tests__/category-marketplace-panel.spec.tsx b/demo-dify/dify/web/app/components/plugins/plugin-page/__tests__/category-marketplace-panel.spec.tsx index bbc3689b..06f87a3e 100644 --- a/demo-dify/dify/web/app/components/plugins/plugin-page/__tests__/category-marketplace-panel.spec.tsx +++ b/demo-dify/dify/web/app/components/plugins/plugin-page/__tests__/category-marketplace-panel.spec.tsx @@ -136,10 +136,9 @@ it.each([Category.trigger, Category.agent, Category.extension])( }, expect.anything(), ) - const link = screen.getByRole('link', { name: 'plugin.marketplace.difyMarketplace' }) - const url = new URL(link.getAttribute('href')!, window.location.origin) - expect(url.pathname).toBe(`/plugins/${category}`) - expect(url.searchParams.get('theme')).toBe('light') + expect( + screen.queryByRole('link', { name: 'plugin.marketplace.difyMarketplace' }), + ).not.toBeInTheDocument() }, ) @@ -170,21 +169,13 @@ it('shows provider information and opens the selected package in the real instal }) it.each(['CLOUD', 'COMMUNITY', 'ENTERPRISE'] as const)( - 'links provider details to the appropriate destination for %s', - async (edition) => { - setup({}, { systemFeatures: { deployment_edition: edition, rbac_enabled: true } }) + 'keeps %s provider details inside the app', + async (_edition) => { + setup({}, { systemFeatures: { deployment_edition: _edition, rbac_enabled: true } }) const card = within(await screen.findByRole('article', { name: 'Calendar' })) - const link = card.getByRole('link', { name: 'plugin.detailPanel.operation.detail Calendar' }) - const url = new URL(link.getAttribute('href')!, window.location.origin) - expect(url.pathname).toBe(`${edition === 'CLOUD' ? '/plugins' : '/plugin'}/langgenius/calendar`) - expect(url.searchParams.get('language')).toBe('en-US') - expect(url.searchParams.get('theme')).toBe('light') - if (edition !== 'CLOUD') { - expect(url.origin).toBe('https://marketplace.dify.ai') - expect(url.searchParams.get('source')).toBe(window.location.origin) - } - expect(link).toHaveAttribute('target', '_blank') - expect(link).toHaveAttribute('rel', 'noopener noreferrer') + expect( + card.queryByRole('link', { name: 'plugin.detailPanel.operation.detail Calendar' }), + ).not.toBeInTheDocument() }, ) @@ -192,8 +183,8 @@ it('keeps provider details available but hides installation without workspace pe setup({}, { workspacePermissionKeys: [] }) const card = within(await screen.findByRole('article', { name: 'Calendar' })) expect( - card.getByRole('link', { name: 'plugin.detailPanel.operation.detail Calendar' }), - ).toBeVisible() + card.queryByRole('link', { name: 'plugin.detailPanel.operation.detail Calendar' }), + ).not.toBeInTheDocument() expect( card.queryByRole('button', { name: /plugin.detailPanel.operation.install/ }), ).not.toBeInTheDocument() diff --git a/demo-dify/dify/web/app/components/plugins/plugin-page/__tests__/plugins-panel.spec.tsx b/demo-dify/dify/web/app/components/plugins/plugin-page/__tests__/plugins-panel.spec.tsx index 067f8b4e..6acd2122 100644 --- a/demo-dify/dify/web/app/components/plugins/plugin-page/__tests__/plugins-panel.spec.tsx +++ b/demo-dify/dify/web/app/components/plugins/plugin-page/__tests__/plugins-panel.spec.tsx @@ -265,7 +265,7 @@ describe('Plugin list panel', () => { expect(screen.queryByRole('button', { name: 'Rag Plugin' })).not.toBeInTheDocument() expect(screen.getByRole('button', { name: /Search Builtin/ })).toBeInTheDocument() expect(screen.queryByRole('button', { name: /Rag Builtin/ })).not.toBeInTheDocument() - expect(screen.getByRole('region', { name: 'Tool marketplace' })).toHaveTextContent('search') + expect(screen.queryByRole('region', { name: 'Tool marketplace' })).not.toBeInTheDocument() expect(requests.list).toHaveBeenLastCalledWith( expect.objectContaining({ query: expect.objectContaining({ tags: ['search'] }) }), ) @@ -314,14 +314,16 @@ describe('Plugin list panel', () => { supportsTags: false, }, ])( - 'keeps the $category catalog browsable without install permission and hides unsupported filters', + 'shows the $category empty state without an uninstalled marketplace catalog', async ({ category, empty, target, supportsTags }) => { await renderPanel({ fixedCategory: category, canInstall: false }) expect(screen.getByText(`plugin.list.${empty}`)).toBeInTheDocument() - expect(screen.getByRole('region', { name: `${category} marketplace` })).toBeInTheDocument() expect( - screen.getByRole('link', { name: 'plugin.marketplace.difyMarketplace' }), - ).toHaveAttribute('href', `#plugin-category-marketplace-${category}`) + screen.queryByRole('region', { name: `${category} marketplace` }), + ).not.toBeInTheDocument() + expect( + screen.queryByRole('link', { name: 'plugin.marketplace.difyMarketplace' }), + ).not.toBeInTheDocument() expect(screen.queryByRole('button', { name: 'plugin.allCategories' })).not.toBeInTheDocument() expect(!!screen.queryByRole('button', { name: 'common.tag.tags' })).toBe(supportsTags) expect(document.querySelector(getStepByStepTourTargetSelector(target))).toContainElement( @@ -356,13 +358,13 @@ describe('Plugin list panel', () => { expect(requests.list).toHaveBeenCalledWith( expect.objectContaining({ query: { page: 1, page_size: 30, language: 'en_US' } }), ) - expect(screen.getByRole('region', { name: `${category} marketplace` })).not.toHaveTextContent( - 'search', - ) + expect( + screen.queryByRole('region', { name: `${category} marketplace` }), + ).not.toBeInTheDocument() }, ) - it('debounces search changes and filters installed and builtin tools while forwarding marketplace search', async () => { + it('debounces search changes and filters installed and builtin tools', async () => { vi.useFakeTimers({ shouldAdvanceTime: true }) const user = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }) plugins = [ @@ -381,7 +383,7 @@ describe('Plugin list panel', () => { expect(screen.queryByRole('button', { name: 'Alpha Plugin' })).not.toBeInTheDocument() expect(screen.getByRole('button', { name: /Beta Builtin/ })).toBeInTheDocument() expect(screen.queryByRole('button', { name: /Alpha Builtin/ })).not.toBeInTheDocument() - expect(screen.getByRole('region', { name: 'Tool marketplace' })).toHaveTextContent('beta') + expect(screen.queryByRole('region', { name: 'Tool marketplace' })).not.toBeInTheDocument() }) it('offers manual pagination on the standalone plugin page and appends the returned cards', async () => { @@ -459,7 +461,7 @@ describe('Plugin list panel', () => { expect(screen.queryByRole('region', { name: 'Plugin details' })).not.toBeInTheDocument() }) - it('keeps category marketplace search available without presenting a no-installation prompt for unmatched searches', async () => { + it('hides the uninstalled marketplace catalog when a category search has no installed match', async () => { plugins = [createPlugin('trigger', 'Trigger Plugin', [], PluginCategoryEnum.trigger)] await renderPanel( { fixedCategory: PluginCategoryEnum.trigger }, @@ -468,7 +470,7 @@ describe('Plugin list panel', () => { expect(screen.queryByRole('button', { name: 'Trigger Plugin' })).not.toBeInTheDocument() expect(screen.queryByText('plugin.list.noTriggerFound')).not.toBeInTheDocument() expect(screen.queryByText('plugin.list.noInstalled')).not.toBeInTheDocument() - expect(screen.getByRole('region', { name: 'trigger marketplace' })).toHaveTextContent('missing') + expect(screen.queryByRole('region', { name: 'trigger marketplace' })).not.toBeInTheDocument() }) }) diff --git a/demo-dify/dify/web/app/components/plugins/plugin-page/category-marketplace-panel.tsx b/demo-dify/dify/web/app/components/plugins/plugin-page/category-marketplace-panel.tsx index 23372341..831c3657 100644 --- a/demo-dify/dify/web/app/components/plugins/plugin-page/category-marketplace-panel.tsx +++ b/demo-dify/dify/web/app/components/plugins/plugin-page/category-marketplace-panel.tsx @@ -8,7 +8,6 @@ import { Button } from '@langgenius/dify-ui/button' import { cn } from '@langgenius/dify-ui/cn' import { Separator } from '@langgenius/dify-ui/separator' import { useQuery } from '@tanstack/react-query' -import { useTheme } from 'next-themes' import { useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder' @@ -16,7 +15,6 @@ import List from '@/app/components/plugins/marketplace/list' import { useMarketplacePlugins } from '@/app/components/plugins/marketplace/query' import { usePluginSettingsAccess } from '@/app/components/plugins/plugin-page/use-reference-setting' import ProviderCard from '@/app/components/plugins/provider-card' -import Link from '@/next/link' import { consoleQuery } from '@/service/console' import { getCategoryMarketplaceId } from './category-marketplace' @@ -34,7 +32,6 @@ const CategoryMarketplacePanel = ({ tags?: string[] }) => { const { t } = useTranslation(['common', 'plugin', 'workflow', 'modelProvider']) - const { theme } = useTheme() const { canInstallPlugin } = usePluginSettingsAccess() const [collapsed, setCollapsed] = useState(false) const { @@ -74,7 +71,6 @@ const CategoryMarketplacePanel = ({ [data, installedPluginIds], ) - const marketplaceLink = marketplace.category(category, { theme }) const showInstalledPluginIdsError = hasInstalledPluginIdsError && !hasLoadedInstalledPluginIds const showLoading = isLoadingInstalledPluginIds || !!(marketplaceSearchParams && isPending) const cardRender = useCallback( @@ -112,23 +108,6 @@ const CategoryMarketplacePanel = ({ /> {t(($) => $['list.source.marketplace'], { ns: 'plugin' })} -
- - {t(($) => $['modelProvider.discoverMore'], { ns: 'modelProvider' })} - - - {t(($) => $['marketplace.difyMarketplace'], { ns: 'plugin' })} - - -
{!collapsed && (
diff --git a/demo-dify/dify/web/app/components/plugins/plugin-page/debug-info.tsx b/demo-dify/dify/web/app/components/plugins/plugin-page/debug-info.tsx index 19adeec7..b675a5ab 100644 --- a/demo-dify/dify/web/app/components/plugins/plugin-page/debug-info.tsx +++ b/demo-dify/dify/web/app/components/plugins/plugin-page/debug-info.tsx @@ -5,7 +5,6 @@ import { Button } from '@langgenius/dify-ui/button' import { cn } from '@langgenius/dify-ui/cn' import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/popover' import { useTranslation } from 'react-i18next' -import { useDocLink } from '@/context/i18n' import { useDebugKey } from '@/service/use-plugins' import KeyValueItem from '../base/key-value-item' import { PluginSidecarPanel } from './plugin-sidecar-panel' @@ -24,8 +23,7 @@ function DebugInfo({ triggerVariant = 'secondary', }: DebugInfoProps) { const { t } = useTranslation(['plugin']) - const docLink = useDocLink() - const { data: info, isLoading } = useDebugKey() + const { data: info, isLoading } = useDebugKey() const title = t(($) => $[`${i18nPrefix}.title`], { ns: 'plugin' }) const trigger = triggerContent ?? const triggerClassNames = cn( @@ -56,28 +54,7 @@ function DebugInfo({ } /> - - -
- } - > +
- {options.map((option, index) => ( + {options + .filter((option) => option.href && !isOfficialDifyUrl(option.href)) + .map((option, index) => ( {dividerAfterFirst && index === 1 && } contentFrameClassName: string - contentInset: PluginPageContentInset currentBuiltinToolID?: string firstBuiltinToolTarget?: string firstPluginTarget?: string filteredBuiltinTools: Collection[] filteredList: Array - hasToolMarketplacePanel: boolean - marketplace: MarketplaceLinks | null hasVisibleBuiltinTools: boolean hasVisiblePlugins: boolean hasEmbeddedMarketplace: boolean isFetching: boolean isLastPage: boolean - keywords: string loadNextPage: () => void onSelectBuiltinTool: (id: string) => void scrollAreaLabel?: string showCategoryEmptyState: boolean - tagFilterValue: string[] } const PluginsPanelResults = ({ @@ -56,28 +46,22 @@ const PluginsPanelResults = ({ canDeletePlugin, canUpdatePlugin, categoryEmptyState, - categoryMarketplace, containerRef, contentFrameClassName, - contentInset, currentBuiltinToolID, firstBuiltinToolTarget, firstPluginTarget, filteredBuiltinTools, filteredList, - hasToolMarketplacePanel, - marketplace, hasVisibleBuiltinTools, hasVisiblePlugins, hasEmbeddedMarketplace, isFetching, isLastPage, - keywords, loadNextPage, onSelectBuiltinTool, scrollAreaLabel, showCategoryEmptyState, - tagFilterValue, }: PluginsPanelResultsProps) => { const { t } = useTranslation(['common', 'plugin', 'workflow']) const loadMoreAnchorRef = useRef(null) @@ -144,10 +128,7 @@ const PluginsPanelResults = ({ className={cn('flex min-h-full flex-col', hasEmbeddedMarketplace && 'pt-1')} > {showCategoryEmptyState && categoryEmptyState && ( - + )} {(hasVisiblePlugins || hasVisibleBuiltinTools) && ( )} - {marketplace && hasToolMarketplacePanel && ( - - )} - {marketplace && categoryMarketplace && ( - - )} diff --git a/demo-dify/dify/web/app/components/plugins/plugin-page/plugins-panel.tsx b/demo-dify/dify/web/app/components/plugins/plugin-page/plugins-panel.tsx index 449adcf4..8df78306 100644 --- a/demo-dify/dify/web/app/components/plugins/plugin-page/plugins-panel.tsx +++ b/demo-dify/dify/web/app/components/plugins/plugin-page/plugins-panel.tsx @@ -12,7 +12,6 @@ import PluginDetailPanel from '@/app/components/plugins/plugin-detail-panel' import { STEP_BY_STEP_TOUR_TARGETS } from '@/app/components/step-by-step-tour/target-registry' import ProviderDetail from '@/app/components/tools/provider/detail' import { useGetLanguage } from '@/context/i18n' -import { useMarketplace } from '@/features/marketplace/client' import { renderI18nObject } from '@/i18n/metadata' import { normalizePluginCategoryListLanguage, @@ -105,7 +104,6 @@ const PluginsPanel = ({ : undefined, [filters.searchQuery, filters.tags, isIntegrationCategoryPage, locale, supportsTagFilter], ) - const marketplace = useMarketplace() const { data: pluginList, isLoading: isPluginListLoading, @@ -192,8 +190,6 @@ const PluginsPanel = ({ }, [currentBuiltinToolID, filteredBuiltinTools]) const handleDetailHide = () => setSelectedItem(undefined) - const hasToolMarketplacePanel = marketplace !== null && isToolIntegrationPage - const categoryMarketplace = marketplace && hasEmbeddedMarketplace ? fixedCategory : undefined const contentPaddingClassName = pluginPageContentInsetClassNames[contentInset] const contentFrameClassName = cn( pluginPageContentFrameClassNames[contentInset], @@ -246,15 +242,11 @@ const PluginsPanel = ({ {isPluginListLoading && } {!isPluginListLoading && ( <> - {hasVisiblePlugins || - hasVisibleBuiltinTools || - hasToolMarketplacePanel || - hasEmbeddedMarketplace ? ( + {hasVisiblePlugins || hasVisibleBuiltinTools || hasEmbeddedMarketplace ? ( setSelectedItem({ type: 'builtinTool', id })} - tagFilterValue={filters.tags} canDeletePlugin={canDeletePlugin} canUpdatePlugin={canUpdatePlugin} categoryEmptyState={hasEmbeddedMarketplace ? fixedCategory : undefined} - categoryMarketplace={categoryMarketplace} showCategoryEmptyState={ hasEmbeddedMarketplace && !isFilteringCategory && diff --git a/demo-dify/dify/web/app/components/plugins/provider-card.tsx b/demo-dify/dify/web/app/components/plugins/provider-card.tsx index 99e9ef92..26ea55a0 100644 --- a/demo-dify/dify/web/app/components/plugins/provider-card.tsx +++ b/demo-dify/dify/web/app/components/plugins/provider-card.tsx @@ -2,18 +2,16 @@ import type { FC } from 'react' import type { Plugin } from './types' import type { MarketplaceLinks } from '@/features/marketplace/links' -import { Button, buttonVariants } from '@langgenius/dify-ui/button' +import { Button } from '@langgenius/dify-ui/button' import { cn } from '@langgenius/dify-ui/cn' import { useBoolean } from 'ahooks' -import { useTheme } from 'next-themes' import * as React from 'react' -import { useId, useMemo } from 'react' +import { useId } from 'react' import { useTranslation } from 'react-i18next' -import { useLocale } from '#i18n' import usePluginInstallPermission from '@/app/components/plugins/install-plugin/hooks/use-plugin-install-permission' import InstallFromMarketplace from '@/app/components/plugins/install-plugin/install-from-marketplace' -import { useMarketplaceDetailNavigation } from '@/app/components/plugins/marketplace/use-detail-navigation' import { useRenderI18nObject } from '@/hooks/use-i18n' +import { visibleAuthorName } from '@/utils/visible-author' import Badge from '../base/badge' import Icon from './card/base/card-icon' import Description from './card/base/description' @@ -25,23 +23,18 @@ type Props = Readonly<{ payload: Plugin }> -const ProviderCardComponent: FC = ({ className, marketplace, payload }) => { +const ProviderCardComponent: FC = ({ className, payload }) => { const getValueFromI18nObject = useRenderI18nObject() const { t } = useTranslation(['plugin']) - const { theme } = useTheme() const [ isShowInstallFromMarketplace, { setTrue: showInstallFromMarketplace, setFalse: hideInstallFromMarketplace }, ] = useBoolean(false) const { canInstallPlugin } = usePluginInstallPermission() const { org, label } = payload + const publicOrg = visibleAuthorName(org) const pluginLabel = getValueFromI18nObject(label) const titleId = useId() - const locale = useLocale() - const navigation = useMarketplaceDetailNavigation() - - // Memoize the marketplace link params to prevent unnecessary re-renders - const marketplaceLinkParams = useMemo(() => ({ language: locale, theme }), [locale, theme]) return (
= ({ className, marketplace, payload }) =
-
{org}
-
·
+ {publicOrg ? ( +
{publicOrg}
+ ) : null} + {publicOrg ?
·
: null}
@@ -84,8 +79,8 @@ const ProviderCardComponent: FC = ({ className, marketplace, payload }) = ))} -
- {canInstallPlugin && ( + {canInstallPlugin && ( +
- )} - $['detailPanel.operation.detail'], { ns: 'plugin' })} ${pluginLabel}`} - href={ - navigation.pluginHref(payload) ?? marketplace.plugin(payload, marketplaceLinkParams) - } - target="_blank" - rel="noopener noreferrer" - className={cn(buttonVariants({ variant: 'secondary' }), 'grow gap-0.5')} - > - {t(($) => $['detailPanel.operation.detail'], { ns: 'plugin' })} - - -
+
+ )} {isShowInstallFromMarketplace && ( = ({ payload, isChecked, onCheckChange }) => { const language = useGetLanguage() const { plugin_id, declaration } = payload - const { label, author: org } = declaration + const { label, author } = declaration + const org = visibleAuthorName(author) return (
@@ -26,7 +28,9 @@ const ToolItem: FC = ({ payload, isChecked, onCheckChange }) => {
{renderI18nObject(label, language)}
-
{org}
+ {org ? ( +
{org}
+ ) : null}
{ const [confirmVisible, { setFalse: hideConfirm, setTrue: showConfirm }] = useBoolean(false) const { handleSyncWorkflowDraft } = useNodesSyncDraft() const canPipelineRelease = useHooksStore((s) => s.accessControl.canReleaseAndVersion) - const docLink = useDocLink() const pipelineId = useAtomValue(knowledgePipelineIdentityAtom).pipelineId const queryClient = useQueryClient() const { mutateAsync: publishAsCustomizedPipeline } = useMutation( @@ -70,13 +68,6 @@ const Publisher = () => { {t(($) => $['publishTemplate.success.tip'], { ns: 'datasetPipeline' })} - - {t(($) => $['publishTemplate.success.learnMore'], { ns: 'datasetPipeline' })} -
), }, @@ -97,7 +88,6 @@ const Publisher = () => { } }, [ - docLink, hidePublishAsKnowledgePipelineModal, queryClient, pipelineId, diff --git a/demo-dify/dify/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx b/demo-dify/dify/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx index ce79b710..aa7b5224 100644 --- a/demo-dify/dify/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx +++ b/demo-dify/dify/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx @@ -39,6 +39,7 @@ import { import { userProfileQueryOptions } from '@/features/account-profile/client' import { systemFeaturesQueryOptions } from '@/features/system-features/client' import { useDatasetApiAccessUrl } from '@/hooks/use-api-access-url' +import { isOfficialDifyUrl } from '@/utils/official-link' import { useFormatTimeFromNow } from '@/hooks/use-format-time-from-now' import Link from '@/next/link' import { useParams } from '@/next/navigation' @@ -289,7 +290,7 @@ export function Popup({ )} - {publishedAt ? ( + {publishedAt && apiReferenceUrl && !isOfficialDifyUrl(apiReferenceUrl) ? ( - ) : ( + ) : !publishedAt ? ( - )} + ) : null} - {task.learnMoreHref && task.learnMoreLabel && ( + {task.learnMoreHref && + task.learnMoreLabel && + !isOfficialDifyUrl(task.learnMoreHref) && ( { const user = userEvent.setup() diff --git a/demo-dify/dify/web/app/components/tools/marketplace/index.tsx b/demo-dify/dify/web/app/components/tools/marketplace/index.tsx index 36e1d42f..0bce8aa9 100644 --- a/demo-dify/dify/web/app/components/tools/marketplace/index.tsx +++ b/demo-dify/dify/web/app/components/tools/marketplace/index.tsx @@ -4,9 +4,7 @@ import type { useToolMarketplace } from './hooks' import type { MarketplaceLinks } from '@/features/marketplace/links' import { cn } from '@langgenius/dify-ui/cn' import { IconButton } from '@langgenius/dify-ui/icon-button' -import { useTheme } from 'next-themes' import { useTranslation } from 'react-i18next' -import { useLocale } from '#i18n' import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder' import List from '@/app/components/plugins/marketplace/list' import { usePluginSettingsAccess } from '@/app/components/plugins/plugin-page/use-reference-setting' @@ -23,17 +21,12 @@ type MarketplaceProps = { contentInset?: ToolsContentInset } const Marketplace = ({ - marketplace, - searchPluginText, - filterPluginTags, isMarketplaceArrowVisible, showMarketplacePanel, marketplaceContext, contentInset = 'default', }: MarketplaceProps) => { - const locale = useLocale() const { t } = useTranslation(['common', 'plugin']) - const { theme } = useTheme() const router = useRouter() const { canInstallPlugin } = usePluginSettingsAccess() const { isLoading, marketplaceCollections, marketplaceCollectionPluginsMap, plugins, page } = @@ -98,23 +91,6 @@ const Marketplace = ({ {t(($) => $['category.bundles'], { ns: 'plugin' })} - {t(($) => $['operation.in'], { ns: 'common' })} - - {t(($) => $['marketplace.difyMarketplace'], { ns: 'plugin' })} - diff --git a/demo-dify/dify/web/app/components/tools/provider/__tests__/empty.spec.tsx b/demo-dify/dify/web/app/components/tools/provider/__tests__/empty.spec.tsx index bbc25823..996331bc 100644 --- a/demo-dify/dify/web/app/components/tools/provider/__tests__/empty.spec.tsx +++ b/demo-dify/dify/web/app/components/tools/provider/__tests__/empty.spec.tsx @@ -18,10 +18,7 @@ describe('Empty', () => { render() expect(screen.getByRole('link', { name: /goToStudio/i })).toHaveAttribute('href', '/apps') - expect(screen.getByRole('link', { name: /learnMore/i })).toHaveAttribute( - 'href', - 'https://docs.dify.ai/en/self-host/use-dify/workspace/tools#workflow', - ) + expect(screen.queryByRole('link', { name: /learnMore/i })).not.toBeInTheDocument() }) it('does not offer installation navigation in an agent empty state', () => { diff --git a/demo-dify/dify/web/app/components/tools/provider/create-entry-card.tsx b/demo-dify/dify/web/app/components/tools/provider/create-entry-card.tsx index 97d9758b..9b537a1d 100644 --- a/demo-dify/dify/web/app/components/tools/provider/create-entry-card.tsx +++ b/demo-dify/dify/web/app/components/tools/provider/create-entry-card.tsx @@ -1,6 +1,7 @@ 'use client' import { cn } from '@langgenius/dify-ui/cn' import { RiAddLine, RiArrowRightUpLine } from '@remixicon/react' +import { isOfficialDifyUrl } from '@/utils/official-link' type CreateEntryCardProps = { className?: string @@ -47,20 +48,22 @@ const CreateEntryCard = ({ - - ) } diff --git a/demo-dify/dify/web/app/components/tools/provider/detail.tsx b/demo-dify/dify/web/app/components/tools/provider/detail.tsx index 7d364007..8c76b7b7 100644 --- a/demo-dify/dify/web/app/components/tools/provider/detail.tsx +++ b/demo-dify/dify/web/app/components/tools/provider/detail.tsx @@ -63,6 +63,7 @@ import { updateCustomCollection, } from '@/service/tools' import { basePath } from '@/utils/var' +import { visibleAuthorName } from '@/utils/visible-author' import { AuthHeaderPrefix, AuthType, CollectionType } from '../types' import ToolItem from './tool-item' @@ -287,13 +288,13 @@ const ProviderDetail = ({ collection, onHide, onRefreshData }: Props) => { {collection.type === CollectionType.workflow || collection.type === CollectionType.custom ? (
- {collection.author && - `${t(($) => $.author, { ns: 'tools' })} ${collection.author}`} + {visibleAuthorName(collection.author) && + `${t(($) => $.author, { ns: 'tools' })} ${visibleAuthorName(collection.author)}`}
) : ( )} diff --git a/demo-dify/dify/web/app/components/tools/provider/empty.tsx b/demo-dify/dify/web/app/components/tools/provider/empty.tsx index d2e336fe..2e6f42ff 100644 --- a/demo-dify/dify/web/app/components/tools/provider/empty.tsx +++ b/demo-dify/dify/web/app/components/tools/provider/empty.tsx @@ -3,7 +3,6 @@ import { cn } from '@langgenius/dify-ui/cn' import { RiArrowRightLine, RiArrowRightUpLine } from '@remixicon/react' import { useTranslation } from 'react-i18next' import { buildIntegrationPath } from '@/app/components/integrations/routes' -import { useDocLink } from '@/context/i18n' import useTheme from '@/hooks/use-theme' import Link from '@/next/link' import { ToolType } from '../../workflow/block-selector/types' @@ -31,8 +30,7 @@ const getLink = (type?: ToolType) => { } const Empty = ({ type, isAgent }: Props) => { const { t } = useTranslation(['tools']) - const docLink = useDocLink() - const { theme } = useTheme() + const { theme } = useTheme() const hasLink = type === ToolType.Custom || type === ToolType.MCP const renderType = isAgent ? ('agent' as const) : type @@ -94,14 +92,6 @@ const Empty = ({ type, isAgent }: Props) => {
- - {t(($) => $['workflowToolEmpty.learnMore'], { ns: 'tools' })} - ) } diff --git a/demo-dify/dify/web/app/components/tools/setting/build-in/config-credentials.tsx b/demo-dify/dify/web/app/components/tools/setting/build-in/config-credentials.tsx index bb303b33..14471b7c 100644 --- a/demo-dify/dify/web/app/components/tools/setting/build-in/config-credentials.tsx +++ b/demo-dify/dify/web/app/components/tools/setting/build-in/config-credentials.tsx @@ -1,5 +1,6 @@ 'use client' import type { FC } from 'react' +import { isOfficialDifyUrl } from '@/utils/official-link' import type { Collection } from '../../types' import { Button } from '@langgenius/dify-ui/button' import { cn } from '@langgenius/dify-ui/cn' @@ -134,7 +135,7 @@ const ConfigCredential: FC = ({ validating={false} inputClassName="bg-components-input-bg-normal!" fieldMoreInfo={(item) => - item.url ? ( + item.url && !isOfficialDifyUrl(item.url) ? ( { ) }) - it('should link to the trigger marketplace when marketplace is enabled', async () => { + it('does not link to the official trigger marketplace', async () => { enableMarketplaceForRender = true render( @@ -206,30 +206,14 @@ describe('AllStartBlocks', () => { />, ) - const footerLink = await screen.findByRole('link', { - name: /plugin\.findMoreInMarketplace/, - }) - expect(footerLink.closest('footer')).toBeInTheDocument() - expect(footerLink).toHaveAttribute('href', 'https://marketplace.test/plugins/trigger') - }) - - it('should expose the panel marketplace destination', async () => { - enableMarketplaceForRender = true - - render( - , - ) - - const footerLink = await screen.findByRole('link', { - name: /workflow\.nodes\.startPlaceholder\.browseMoreOnMarketplace/, - }) - expect(footerLink.closest('footer')).toBeInTheDocument() - expect(footerLink).toHaveAttribute('href', 'https://marketplace.test/plugins/trigger') + expect( + screen.queryByRole('link', { name: /plugin\.findMoreInMarketplace/ }), + ).not.toBeInTheDocument() + expect( + screen.queryByRole('link', { + name: /workflow\.nodes\.startPlaceholder\.browseMoreOnMarketplace/, + }), + ).not.toBeInTheDocument() }) it('should render searched marketplace results after built-in and installed trigger options', async () => { @@ -267,7 +251,9 @@ describe('AllStartBlocks', () => { const text = container.textContent || '' expect(text.indexOf('workflow.blocks.start')).toBeLessThan(text.indexOf('Start Provider')) expect(text.indexOf('Start Provider')).toBeLessThan(text.indexOf('Start Marketplace')) - expect(screen.getAllByRole('link', { name: /plugin\.searchInMarketplace/i })).toHaveLength(1) + expect( + screen.queryByRole('link', { name: /plugin\.searchInMarketplace/i }), + ).not.toBeInTheDocument() }) it('shows installed triggers once and keeps other marketplace results available', async () => { @@ -313,10 +299,11 @@ describe('AllStartBlocks', () => { const userInputButton = screen.getByRole('button', { name: 'workflow.blocks.start' }) expect(userInputButton).toHaveAttribute('aria-disabled', 'true') expect(screen.getByText('common.operation.added')).toBeInTheDocument() - const footer = screen.getByRole('link', { name: /plugin\.findMoreInMarketplace/ }) const disabledRegion = userInputButton.closest('[inert]') expect(disabledRegion).toHaveAttribute('inert') - expect(disabledRegion).not.toContainElement(footer) + expect( + screen.queryByRole('link', { name: /plugin\.findMoreInMarketplace/ }), + ).not.toBeInTheDocument() fireEvent.click(userInputButton) fireEvent.click(screen.getByText('Provider One')) @@ -406,10 +393,9 @@ describe('AllStartBlocks', () => { 'href', 'https://github.com/langgenius/dify-plugins/issues/new?template=plugin_request.yaml', ) - expect(screen.getByRole('link', { name: /plugin\.findMoreInMarketplace/ })).toHaveAttribute( - 'href', - 'https://marketplace.test/plugins/trigger', - ) + expect( + screen.queryByRole('link', { name: /plugin\.findMoreInMarketplace/ }), + ).not.toBeInTheDocument() }) it('should debounce marketplace requests across search and tag changes', async () => { diff --git a/demo-dify/dify/web/app/components/workflow/block-selector/__tests__/tool-browser.spec.tsx b/demo-dify/dify/web/app/components/workflow/block-selector/__tests__/tool-browser.spec.tsx index 395d398b..cfc0a2aa 100644 --- a/demo-dify/dify/web/app/components/workflow/block-selector/__tests__/tool-browser.spec.tsx +++ b/demo-dify/dify/web/app/components/workflow/block-selector/__tests__/tool-browser.spec.tsx @@ -1,5 +1,5 @@ import type { ReactElement } from 'react' -import { act, cleanup, screen, waitFor, within } from '@testing-library/react' +import { act, cleanup, screen, waitFor } from '@testing-library/react' import userEvent from '@testing-library/user-event' import { CollectionType } from '@/app/components/tools/types' import { renderWithConsoleQuery } from '@/test/console/query-data' @@ -99,9 +99,7 @@ describe('ToolBrowser', () => { ) expect(screen.queryByText(/workflowToolEmpty\.step/)).not.toBeInTheDocument() - const footer = screen.getByRole('contentinfo') - expect(within(footer).getAllByRole('link')).toHaveLength(1) - expect(within(footer).getByRole('link', { name: /findMoreInMarketplace/ })).toBeInTheDocument() + expect(screen.queryByRole('link', { name: /findMoreInMarketplace/ })).not.toBeInTheDocument() }) it('filters providers and updates the heading for each category', async () => { diff --git a/demo-dify/dify/web/app/components/workflow/block-selector/__tests__/tool-picker.spec.tsx b/demo-dify/dify/web/app/components/workflow/block-selector/__tests__/tool-picker.spec.tsx index 43586e30..d477f8bd 100644 --- a/demo-dify/dify/web/app/components/workflow/block-selector/__tests__/tool-picker.spec.tsx +++ b/demo-dify/dify/web/app/components/workflow/block-selector/__tests__/tool-picker.spec.tsx @@ -350,14 +350,15 @@ describe('ToolPicker', () => { expect(trigger).toHaveFocus() }) - it('should link the find-more footer to the marketplace tool category', async () => { + it('does not link the tool picker to the official marketplace', async () => { renderToolPicker({ isShow: true, selectedTools: [], }) - const footerLink = await screen.findByRole('link', { name: /plugin\.findMoreInMarketplace/i }) - expect(footerLink).toHaveAttribute('href', 'https://marketplace.test/plugins/tool') + expect( + screen.queryByRole('link', { name: /plugin\.findMoreInMarketplace/i }), + ).not.toBeInTheDocument() }) it('should render real search and tool lists, then forward tool selections', async () => { diff --git a/demo-dify/dify/web/app/components/workflow/block-selector/all-start-blocks.tsx b/demo-dify/dify/web/app/components/workflow/block-selector/all-start-blocks.tsx index e3080e78..9418526c 100644 --- a/demo-dify/dify/web/app/components/workflow/block-selector/all-start-blocks.tsx +++ b/demo-dify/dify/web/app/components/workflow/block-selector/all-start-blocks.tsx @@ -21,10 +21,6 @@ import PluginList from './marketplace-plugin/list' import StartBlocks from './start-blocks' import TriggerPluginList from './trigger-plugin/list' -const popoverMarketplaceFooterClassName = - 'system-sm-medium z-10 flex h-8 flex-none items-center border-t border-divider-subtle bg-components-panel-bg-blur px-4 py-1' -const panelMarketplaceFooterClassName = - 'system-xs-regular z-10 flex flex-none flex-col items-start gap-2 rounded-lg px-4 pt-2 pb-4' const DEFAULT_TAGS: string[] = [] const SectionDivider = () => ( @@ -33,11 +29,6 @@ const SectionDivider = () => ( ) -const MarketplaceFooterDivider = () => ( -
- -
-) type AllStartBlocksProps = { className?: string @@ -260,46 +251,6 @@ function AllStartBlocks({ )} - - {marketplace && ( -
- {isPanelVariant && } - - {isPanelVariant ? ( - - - - {t(($) => $['nodes.startPlaceholder.browseMoreOnMarketplace'], { - ns: 'workflow', - })} - - - ) : ( - <> - {t(($) => $.findMoreInMarketplace, { ns: 'plugin' })} - - - )} - -
- )} ) diff --git a/demo-dify/dify/web/app/components/workflow/block-selector/featured-tools.tsx b/demo-dify/dify/web/app/components/workflow/block-selector/featured-tools.tsx index 47c8f70b..6bae4881 100644 --- a/demo-dify/dify/web/app/components/workflow/block-selector/featured-tools.tsx +++ b/demo-dify/dify/web/app/components/workflow/block-selector/featured-tools.tsx @@ -24,9 +24,7 @@ import InstallFromMarketplace from '@/app/components/plugins/install-plugin/inst import Action from '@/app/components/workflow/block-selector/marketplace-plugin/action' import { useFeaturedToolsCollapsed } from '@/app/components/workflow/block-selector/storage' import { useGetLanguage } from '@/context/i18n' -import Link from '@/next/link' import { formatNumber } from '@/utils/format' -import { PluginCategoryEnum } from '../../plugins/types' import BlockIcon from '../block-icon' import { BlockEnum } from '../types' import { BlockSelectorPreviewCardContent } from './preview-card' @@ -146,14 +144,7 @@ const FeaturedTools = ({ {showEmptyState && (

- - {t(($) => $['tabs.noFeaturedPlugins'], { ns: 'workflow' })} - + {t(($) => $['tabs.noResult'], { ns: 'workflow' })}

)} @@ -279,12 +270,7 @@ function FeaturedToolUninstalledItem({ }, [actionOpen]) const detailsLink = ( - +
{label} {installCountLabel} - +
) return ( diff --git a/demo-dify/dify/web/app/components/workflow/block-selector/featured-triggers.tsx b/demo-dify/dify/web/app/components/workflow/block-selector/featured-triggers.tsx index 5999cfa6..1c388228 100644 --- a/demo-dify/dify/web/app/components/workflow/block-selector/featured-triggers.tsx +++ b/demo-dify/dify/web/app/components/workflow/block-selector/featured-triggers.tsx @@ -24,9 +24,7 @@ import InstallFromMarketplace from '@/app/components/plugins/install-plugin/inst import Action from '@/app/components/workflow/block-selector/marketplace-plugin/action' import { useFeaturedTriggersCollapsed } from '@/app/components/workflow/block-selector/storage' import { useGetLanguage } from '@/context/i18n' -import Link from '@/next/link' import { formatNumber } from '@/utils/format' -import { PluginCategoryEnum } from '../../plugins/types' import BlockIcon from '../block-icon' import { BlockEnum } from '../types' import { BlockSelectorPreviewCardContent } from './preview-card' @@ -150,14 +148,7 @@ const FeaturedTriggers = ({ {showEmptyState && (

- - {t(($) => $['tabs.noFeaturedTriggers'], { ns: 'workflow' })} - + {t(($) => $['tabs.noResult'], { ns: 'workflow' })}

)} @@ -280,12 +271,7 @@ function FeaturedTriggerUninstalledItem({ }, [actionOpen]) const detailsLink = ( - +
{installCountLabel} - +
) return ( diff --git a/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/__tests__/action.spec.tsx b/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/__tests__/action.spec.tsx index 9dfd3fab..66c972b3 100644 --- a/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/__tests__/action.spec.tsx +++ b/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/__tests__/action.spec.tsx @@ -116,12 +116,11 @@ describe('MarketplaceOperationMenu', () => { expect(mockDownloadPlugin).toHaveBeenCalledTimes(1) }) - it('should link to the marketplace detail page', () => { + it('does not link plugin actions to the official marketplace', () => { renderComponent({ open: true }) - expect(screen.getByRole('menuitem', { name: 'common.operation.viewDetails' })).toHaveAttribute( - 'href', - 'https://marketplace.example/plugins/langgenius/test-plugin?theme=light', - ) + expect( + screen.queryByRole('menuitem', { name: 'common.operation.viewDetails' }), + ).not.toBeInTheDocument() }) }) diff --git a/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/__tests__/item-list.spec.tsx b/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/__tests__/item-list.spec.tsx index d9fcd0fa..86e94c06 100644 --- a/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/__tests__/item-list.spec.tsx +++ b/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/__tests__/item-list.spec.tsx @@ -161,13 +161,12 @@ describe('Marketplace plugin selector components', () => { ) const scrollButton = screen.getByRole('button', { name: 'plugin.fromMarketplace' }) - const searchLink = screen.getByRole('link', { name: 'plugin.searchInMarketplace' }) scrollButton.focus() await user.keyboard('{Enter}') expect(scrollIntoView).toHaveBeenCalledWith({ behavior: 'smooth', block: 'start' }) - expect(searchLink).toHaveAttribute('href', expect.stringContaining('q=filtered')) + expect(screen.queryByRole('link', { name: 'plugin.searchInMarketplace' })).not.toBeInTheDocument() } finally { HTMLElement.prototype.scrollIntoView = originalScrollIntoView } @@ -190,10 +189,9 @@ describe('Marketplace plugin selector components', () => { />, ) - const marketplaceLink = screen.getByRole('link', { name: 'plugin.fromMarketplace' }) - expect(marketplaceLink).toHaveAttribute('href', expect.stringContaining('q=filtered')) - expect(marketplaceLink).toHaveAttribute('href', expect.stringContaining('tags=rag')) - expect(screen.queryByRole('button', { name: 'plugin.fromMarketplace' })).not.toBeInTheDocument() + expect(screen.getByText('plugin.fromMarketplace')).toBeInTheDocument() + expect(screen.queryByRole('link', { name: 'plugin.fromMarketplace' })).not.toBeInTheDocument() + expect(screen.queryByRole('link', { name: 'plugin.searchInMarketplace' })).not.toBeInTheDocument() }) it('should render find-more footer for empty filters and marketplace results for filtered searches', () => { @@ -213,10 +211,9 @@ describe('Marketplace plugin selector components', () => { />, ) - const findMoreLink = screen.getByRole('link', { name: /plugin\.findMoreInMarketplace/i }) - expect(new URL(findMoreLink.getAttribute('href')!, window.location.href).pathname).toBe( - '/plugins/tool', - ) + expect( + screen.queryByRole('link', { name: /plugin\.findMoreInMarketplace/i }), + ).not.toBeInTheDocument() rerender( { expect(screen.getByText('plugin.fromMarketplace')).toBeInTheDocument() expect(screen.getByText('Filtered Plugin')).toBeInTheDocument() - const marketplaceSearchLinks = screen.getAllByRole('link', { - name: /plugin\.searchInMarketplace/i, - }) - expect(marketplaceSearchLinks).toHaveLength(1) - expect(marketplaceSearchLinks[0]).toHaveAttribute('href', expect.stringContaining('q=filtered')) - expect(marketplaceSearchLinks[0]).toHaveAttribute( - 'href', - expect.stringContaining('/plugins/tool'), - ) + expect( + screen.queryByRole('link', { name: /plugin\.searchInMarketplace/i }), + ).not.toBeInTheDocument() }) it('should hide the marketplace footer when requested and no filters are active', () => { diff --git a/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/action.tsx b/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/action.tsx index de2d1bfa..293a5551 100644 --- a/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/action.tsx +++ b/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/action.tsx @@ -1,9 +1,8 @@ 'use client' import type { MarketplaceLinks } from '@/features/marketplace/links' import { IconButton } from '@langgenius/dify-ui/icon-button' -import { Menu, MenuContent, MenuItem, MenuLinkItem, MenuTrigger } from '@langgenius/dify-ui/menu' +import { Menu, MenuContent, MenuItem, MenuTrigger } from '@langgenius/dify-ui/menu' import { useMutation } from '@tanstack/react-query' -import { useTheme } from 'next-themes' import { memo } from 'react' import { useTranslation } from 'react-i18next' import { marketplaceQuery } from '@/service/marketplace' @@ -18,9 +17,8 @@ type Props = Readonly<{ version: string }> -function OperationMenu({ marketplace, open, onOpenChange, author, name, version }: Props) { +function OperationMenu({ open, onOpenChange, author, name, version }: Props) { const { t } = useTranslation(['common']) - const { theme } = useTheme() const downloadMutation = useMutation( marketplaceQuery.downloadPlugin.mutationOptions({ @@ -64,14 +62,6 @@ function OperationMenu({ marketplace, open, onOpenChange, author, name, version {t(($) => $['operation.download'], { ns: 'common' })} - - {t(($) => $['operation.viewDetails'], { ns: 'common' })} - ) diff --git a/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/list.tsx b/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/list.tsx index 3ae757c0..f9f8fccb 100644 --- a/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/list.tsx +++ b/demo-dify/dify/web/app/components/workflow/block-selector/marketplace-plugin/list.tsx @@ -5,7 +5,6 @@ import type { MarketplaceLinks } from '@/features/marketplace/links' import { cn } from '@langgenius/dify-ui/cn' import { useEffect, useImperativeHandle, useMemo, useRef } from 'react' import { useTranslation } from 'react-i18next' -import Link from '@/next/link' import useStickyScroll, { ScrollPosition } from '../use-sticky-scroll' import Item from './item' @@ -30,19 +29,13 @@ function List({ searchText, tags, list, - category, toolContentClassName, disableMaxWidth = false, - hideFindMoreFooter = false, ref, }: ListProps) { const { t } = useTranslation(['plugin']) const noFilter = !searchText && tags.length === 0 const hasRes = list.length > 0 - const urlWithSearchText = marketplace.category(category, { - q: searchText, - tags: tags.join(','), - }) const nextToStickyELemRef = useRef(null) const { handleScroll, scrollPosition } = useStickyScroll({ @@ -72,23 +65,7 @@ function List({ nextToStickyELemRef.current?.scrollIntoView({ behavior: 'smooth', block: 'start' }) } - if (noFilter) { - if (hideFindMoreFooter) return null - - return ( -
- - {t(($) => $.findMoreInMarketplace, { ns: 'plugin' })} - - -
- ) - } + if (noFilter) return null const maxWidthClassName = toolContentClassName || 'max-w-full' @@ -111,24 +88,10 @@ function List({ {t(($) => $.fromMarketplace, { ns: 'plugin' })} ) : ( - + {t(($) => $.fromMarketplace, { ns: 'plugin' })} - + )} - - {t(($) => $.searchInMarketplace, { ns: 'plugin' })} - - )}
diff --git a/demo-dify/dify/web/app/components/workflow/block-selector/rag-tool-recommendations/index.tsx b/demo-dify/dify/web/app/components/workflow/block-selector/rag-tool-recommendations/index.tsx index e850a290..c16d5f28 100644 --- a/demo-dify/dify/web/app/components/workflow/block-selector/rag-tool-recommendations/index.tsx +++ b/demo-dify/dify/web/app/components/workflow/block-selector/rag-tool-recommendations/index.tsx @@ -5,13 +5,11 @@ import { Button } from '@langgenius/dify-ui/button' import { cn } from '@langgenius/dify-ui/cn' import { useQuery } from '@tanstack/react-query' import { useMemo } from 'react' -import { Trans, useTranslation } from 'react-i18next' +import { useTranslation } from 'react-i18next' import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder' import { getFormattedPlugin } from '@/app/components/plugins/marketplace/utils' import { selectRAGRecommendedPlugins } from '@/app/components/tools/utils/query-select' import { useRAGRecommendationsCollapsed } from '@/app/components/workflow/block-selector/storage' -import { useMarketplace } from '@/features/marketplace/client' -import Link from '@/next/link' import { consoleQuery } from '@/service/console' import List from './list' @@ -28,7 +26,6 @@ export function RAGToolRecommendations({ }: RAGToolRecommendationsProps) { const { t } = useTranslation(['common', 'pipeline']) const [isCollapsed, setIsCollapsed] = useRAGRecommendationsCollapsed() - const marketplace = useMarketplace() const { data: ragRecommendedPlugins, @@ -79,27 +76,6 @@ export function RAGToolRecommendations({
)} - {marketplace && - !isFetchingRAGRecommendedPlugins && - recommendedPlugins.length === 0 && - unInstalledPlugins.length === 0 && ( -

- $['ragToolSuggestions.noRecommendationPlugins']} - ns="pipeline" - components={{ - CustomLink: ( - - ), - }} - /> -

- )} {(recommendedPlugins.length > 0 || unInstalledPlugins.length > 0) && ( <> @@ -374,19 +371,6 @@ function ToolBrowser({ /> )} - {marketplace && !hasFilter && ( -
- - {t(($) => $.findMoreInMarketplace, { ns: 'plugin' })} - - -
- )} ) diff --git a/demo-dify/dify/web/app/components/workflow/block-selector/tool/tool-list-tree-view/item.tsx b/demo-dify/dify/web/app/components/workflow/block-selector/tool/tool-list-tree-view/item.tsx index 3e9a1323..ca290e6b 100644 --- a/demo-dify/dify/web/app/components/workflow/block-selector/tool/tool-list-tree-view/item.tsx +++ b/demo-dify/dify/web/app/components/workflow/block-selector/tool/tool-list-tree-view/item.tsx @@ -30,9 +30,11 @@ const Item: FC = ({ }) => { return (
-
- {groupName} -
+ {groupName ? ( +
+ {groupName} +
+ ) : null}
{toolList.map((tool: ToolWithProvider) => ( { const { t } = useTranslation(['workflow']) const getGroupName = (group: ToolGroup) => { - if (group.kind === 'author') return group.author + if (group.kind === 'author') return visibleAuthorName(group.author) switch (group.category) { case 'custom': diff --git a/demo-dify/dify/web/app/components/workflow/block-selector/tool/tool.tsx b/demo-dify/dify/web/app/components/workflow/block-selector/tool/tool.tsx index ef2fdc0d..9ae48401 100644 --- a/demo-dify/dify/web/app/components/workflow/block-selector/tool/tool.tsx +++ b/demo-dify/dify/web/app/components/workflow/block-selector/tool/tool.tsx @@ -15,6 +15,7 @@ import useTheme from '@/hooks/use-theme' import { Theme } from '@/types/app' import { getProviderReference, matchesProviderReference } from '@/utils/provider-reference' import { basePath } from '@/utils/var' +import { visibleAuthorName } from '@/utils/visible-author' import { CollectionType } from '../../../tools/types' import BlockIcon from '../../block-icon' import McpToolNotSupportTooltip from '../../nodes/_base/components/mcp-tool-not-support-tooltip' @@ -104,7 +105,7 @@ function Tool({ } const groupName = useMemo(() => { - if (payload.type === CollectionType.builtIn) return payload.author + if (payload.type === CollectionType.builtIn) return visibleAuthorName(payload.author) if (payload.type === CollectionType.custom) return t(($) => $['tabs.customTool'], { ns: 'workflow' }) diff --git a/demo-dify/dify/web/app/components/workflow/block-selector/trigger-plugin/item.tsx b/demo-dify/dify/web/app/components/workflow/block-selector/trigger-plugin/item.tsx index 2a477d23..3ed09be7 100644 --- a/demo-dify/dify/web/app/components/workflow/block-selector/trigger-plugin/item.tsx +++ b/demo-dify/dify/web/app/components/workflow/block-selector/trigger-plugin/item.tsx @@ -18,6 +18,7 @@ import * as React from 'react' import { useMemo, useRef } from 'react' import { useTranslation } from 'react-i18next' import { CollectionType } from '@/app/components/tools/types' +import { visibleAuthorName } from '@/utils/visible-author' import BlockIcon from '@/app/components/workflow/block-icon' import { BlockEnum } from '@/app/components/workflow/types' import { useGetLanguage } from '@/context/i18n' @@ -74,7 +75,7 @@ const TriggerPluginItem: FC = ({ const FoldIcon = isFold ? RiArrowRightSLine : RiArrowDownSLine const groupName = useMemo(() => { - if (payload.type === CollectionType.builtIn) return payload.author + if (payload.type === CollectionType.builtIn) return visibleAuthorName(payload.author) if (payload.type === CollectionType.custom) return t(($) => $['tabs.customTool'], { ns: 'workflow' }) @@ -82,7 +83,7 @@ const TriggerPluginItem: FC = ({ if (payload.type === CollectionType.workflow) return t(($) => $['tabs.workflowTool'], { ns: 'workflow' }) - return payload.author || '' + return visibleAuthorName(payload.author) }, [payload.author, payload.type, t]) const normalizedIcon = useMemo(() => { return normalizeProviderIcon(payload.icon) ?? payload.icon diff --git a/demo-dify/dify/web/app/components/workflow/node-actions-menu/context-menu-content.tsx b/demo-dify/dify/web/app/components/workflow/node-actions-menu/context-menu-content.tsx index 077cbe52..b89349b6 100644 --- a/demo-dify/dify/web/app/components/workflow/node-actions-menu/context-menu-content.tsx +++ b/demo-dify/dify/web/app/components/workflow/node-actions-menu/context-menu-content.tsx @@ -15,6 +15,8 @@ import { } from '@langgenius/dify-ui/popover' import { useRef } from 'react' import { useTranslation } from 'react-i18next' +import { isOfficialDifyUrl } from '@/utils/official-link' +import { visibleAuthorName } from '@/utils/visible-author' import { useStoreApi } from 'reactflow' import { handleWorkflowMenuKeyDown } from '../shortcuts/handle-workflow-menu-key-down' import { ChangeBlockPopup } from './change-block-popup' @@ -29,6 +31,12 @@ import { useNodeActionsMenuModel } from './use-node-actions-menu-model' export function NodeActionsContextMenuContent(props: NodeActionsMenuProps) { const { t } = useTranslation(['common', 'workflow', 'workflowDebug']) const model = useNodeActionsMenuModel(props) + const helpHref = model.helpLinkUri + const showNodeHelp = Boolean(helpHref) && !isOfficialDifyUrl(helpHref) + const authorName = visibleAuthorName(model.about.author) + const authorLabel = authorName + ? `${t(($) => $['panel.createdBy'], { ns: 'workflow' })} ${authorName}` + : undefined const flowStore = useStoreApi() const deletingRef = useRef(false) const hasRunGroup = model.canRun || model.canChangeBlock @@ -92,7 +100,7 @@ export function NodeActionsContextMenuContent(props: NodeActionsMenuProps) { )} {hasRunGroup && - (hasEditGroup || hasDeleteGroup || model.workflowAppHref || model.helpLinkUri) && ( + (hasEditGroup || hasDeleteGroup || model.workflowAppHref || showNodeHelp) && ( )} {hasEditGroup && ( @@ -115,7 +123,7 @@ export function NodeActionsContextMenuContent(props: NodeActionsMenuProps) { )} - {hasEditGroup && (hasDeleteGroup || model.workflowAppHref || model.helpLinkUri) && ( + {hasEditGroup && (hasDeleteGroup || model.workflowAppHref || showNodeHelp) && ( )} {hasDeleteGroup && ( @@ -131,7 +139,7 @@ export function NodeActionsContextMenuContent(props: NodeActionsMenuProps) { )} - {hasDeleteGroup && (model.workflowAppHref || model.helpLinkUri) && } + {hasDeleteGroup && (model.workflowAppHref || showNodeHelp) && } {model.workflowAppHref && ( )} - {model.workflowAppHref && model.helpLinkUri && } - {model.helpLinkUri && ( + {model.workflowAppHref && showNodeHelp && } + {showNodeHelp && ( - + {t(($) => $['panel.helpLink'], { ns: 'workflow' })} @@ -155,7 +163,7 @@ export function NodeActionsContextMenuContent(props: NodeActionsMenuProps) { $['panel.about'], { ns: 'workflow' })} description={model.about.description} - author={`${t(($) => $['panel.createdBy'], { ns: 'workflow' })} ${model.about.author}`} + author={authorLabel} /> ) diff --git a/demo-dify/dify/web/app/components/workflow/node-actions-menu/index.tsx b/demo-dify/dify/web/app/components/workflow/node-actions-menu/index.tsx index acfdeb03..f6fda405 100644 --- a/demo-dify/dify/web/app/components/workflow/node-actions-menu/index.tsx +++ b/demo-dify/dify/web/app/components/workflow/node-actions-menu/index.tsx @@ -22,6 +22,8 @@ import { } from '@langgenius/dify-ui/popover' import { useCallback, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' +import { isOfficialDifyUrl } from '@/utils/official-link' +import { visibleAuthorName } from '@/utils/visible-author' import { useStoreApi } from 'reactflow' import { handleWorkflowMenuKeyDown } from '../shortcuts/handle-workflow-menu-key-down' import { ChangeBlockPopup } from './change-block-popup' @@ -92,6 +94,8 @@ export function NodeActionsMenu({ function NodeActionsMenuContent(props: NodeActionsContentProps) { const { t } = useTranslation(['common', 'workflow', 'workflowDebug']) const model = useNodeActionsMenuModel(props) + const helpHref = model.helpLinkUri + const showNodeHelp = Boolean(helpHref) && !isOfficialDifyUrl(helpHref) const flowStore = useStoreApi() const deletingRef = useRef(false) const hasRunGroup = model.canRun || model.canChangeBlock @@ -100,6 +104,10 @@ function NodeActionsMenuContent(props: NodeActionsContentProps) { const singleRunActionLabel = model.isSingleRunning ? t(($) => $['debug.variableInspect.trigger.stop'], { ns: 'workflowDebug' }) : t(($) => $['panel.runThisStep'], { ns: 'workflow' }) + const authorName = visibleAuthorName(model.about.author) + const authorLabel = authorName + ? `${t(($) => $['panel.createdBy'], { ns: 'workflow' })} ${authorName}` + : undefined function handleDelete() { deletingRef.current = true @@ -154,7 +162,7 @@ function NodeActionsMenuContent(props: NodeActionsContentProps) { )} {hasRunGroup && - (hasEditGroup || hasDeleteGroup || model.workflowAppHref || model.helpLinkUri) && ( + (hasEditGroup || hasDeleteGroup || model.workflowAppHref || showNodeHelp) && ( )} {hasEditGroup && ( @@ -177,7 +185,7 @@ function NodeActionsMenuContent(props: NodeActionsContentProps) { )} - {hasEditGroup && (hasDeleteGroup || model.workflowAppHref || model.helpLinkUri) && ( + {hasEditGroup && (hasDeleteGroup || model.workflowAppHref || showNodeHelp) && ( )} {hasDeleteGroup && ( @@ -193,7 +201,7 @@ function NodeActionsMenuContent(props: NodeActionsContentProps) { )} - {hasDeleteGroup && (model.workflowAppHref || model.helpLinkUri) && } + {hasDeleteGroup && (model.workflowAppHref || showNodeHelp) && } {model.workflowAppHref && ( @@ -201,10 +209,10 @@ function NodeActionsMenuContent(props: NodeActionsContentProps) { )} - {model.workflowAppHref && model.helpLinkUri && } - {model.helpLinkUri && ( + {model.workflowAppHref && showNodeHelp && } + {showNodeHelp && ( - + {t(($) => $['panel.helpLink'], { ns: 'workflow' })} @@ -213,7 +221,7 @@ function NodeActionsMenuContent(props: NodeActionsContentProps) { $['panel.about'], { ns: 'workflow' })} description={model.about.description} - author={`${t(($) => $['panel.createdBy'], { ns: 'workflow' })} ${model.about.author}`} + author={authorLabel} /> diff --git a/demo-dify/dify/web/app/components/workflow/node-actions-menu/shared.tsx b/demo-dify/dify/web/app/components/workflow/node-actions-menu/shared.tsx index 6951943c..24abcdaa 100644 --- a/demo-dify/dify/web/app/components/workflow/node-actions-menu/shared.tsx +++ b/demo-dify/dify/web/app/components/workflow/node-actions-menu/shared.tsx @@ -33,7 +33,7 @@ export function NodeActionsMenuAbout({
{title.toLocaleUpperCase()}
{description}
-
{author}
+ {author ?
{author}
: null}
) } diff --git a/demo-dify/dify/web/app/components/workflow/nodes/_base/components/__tests__/agent-strategy-selector.spec.tsx b/demo-dify/dify/web/app/components/workflow/nodes/_base/components/__tests__/agent-strategy-selector.spec.tsx index 7cbd52a6..69d25e53 100644 --- a/demo-dify/dify/web/app/components/workflow/nodes/_base/components/__tests__/agent-strategy-selector.spec.tsx +++ b/demo-dify/dify/web/app/components/workflow/nodes/_base/components/__tests__/agent-strategy-selector.spec.tsx @@ -204,10 +204,9 @@ it('keeps marketplace search and its category link alongside the installed catal systemFeatures: { enable_marketplace: true }, }) await user.click(screen.getByText('workflowAgent.nodes.agent.strategy.selectTip')) - const link = screen.getByRole('link', { name: 'plugin.findMoreInMarketplace' }) - expect(new URL(link.getAttribute('href')!, window.location.href).pathname).toBe( - '/plugins/agent-strategy', - ) + expect( + screen.queryByRole('link', { name: 'plugin.findMoreInMarketplace' }), + ).not.toBeInTheDocument() await screen.findByRole('button', { name: 'Agent provider' }) await runDebouncedUserInteraction(MARKETPLACE_SEARCH_DEBOUNCE_MS, async (search) => { await search.type( diff --git a/demo-dify/dify/web/app/components/workflow/nodes/_base/components/agent-strategy-list.tsx b/demo-dify/dify/web/app/components/workflow/nodes/_base/components/agent-strategy-list.tsx index 48744a84..3e6a73a3 100644 --- a/demo-dify/dify/web/app/components/workflow/nodes/_base/components/agent-strategy-list.tsx +++ b/demo-dify/dify/web/app/components/workflow/nodes/_base/components/agent-strategy-list.tsx @@ -17,6 +17,7 @@ import useGetIcon from '@/app/components/plugins/install-plugin/base/use-get-ico import Empty from '@/app/components/tools/provider/empty' import { useGetLanguage } from '@/context/i18n' import { renderI18nObject } from '@/i18n/metadata' +import { visibleAuthorName } from '@/utils/visible-author' import BlockIcon from '../../../block-icon' import { IndexBar } from '../../../block-selector/index-bar' import { BlockSelectorPreviewCardContent } from '../../../block-selector/preview-card' @@ -213,11 +214,15 @@ export function AgentStrategyList({
) : (
- {authorGroups.map(([author, providers]) => ( + {authorGroups.map(([author, providers]) => { + const authorLabel = visibleAuthorName(author) + return (
-
- {author} -
+ {authorLabel ? ( +
+ {authorLabel} +
+ ) : null} {providers.map((provider) => ( ))}
- ))} + ) + })}
)} diff --git a/demo-dify/dify/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx b/demo-dify/dify/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx index 3b7233cf..68aff42f 100644 --- a/demo-dify/dify/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx +++ b/demo-dify/dify/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx @@ -34,7 +34,6 @@ import { } from '@/app/components/header/account-setting/model-provider-page/declarations' import { useDefaultModel } from '@/app/components/header/account-setting/model-provider-page/hooks' import Form from '@/app/components/header/account-setting/model-provider-page/model-modal/Form' -import { useDocLink } from '@/context/i18n' import { useRenderI18nObject } from '@/hooks/use-i18n' import Link from '@/next/link' import { useWorkflowStore } from '../../../store' @@ -89,8 +88,7 @@ export const AgentStrategy = memo((props: AgentStrategyProps) => { nodeId, } = props const { t } = useTranslation(['workflowAgent']) - const docLink = useDocLink() - const defaultModel = useDefaultModel(ModelTypeEnum.textGeneration) + const defaultModel = useDefaultModel(ModelTypeEnum.textGeneration) const renderI18nObject = useRenderI18nObject() const workflowStore = useWorkflowStore() const { setControlPromptEditorRerenderKey } = workflowStore.getState() @@ -280,15 +278,7 @@ export const AgentStrategy = memo((props: AgentStrategyProps) => { title={t(($) => $['nodes.agent.strategy.configureTip'], { ns: 'workflowAgent' })} description={
- {t(($) => $['nodes.agent.strategy.configureTipDesc'], { ns: 'workflowAgent' })}
- - {t(($) => $['nodes.agent.learnMore'], { ns: 'workflowAgent' })} - + {t(($) => $['nodes.agent.strategy.configureTipDesc'], { ns: 'workflowAgent' })}
} /> diff --git a/demo-dify/dify/web/app/components/workflow/nodes/_base/components/error-handle/fail-branch-card.tsx b/demo-dify/dify/web/app/components/workflow/nodes/_base/components/error-handle/fail-branch-card.tsx index c8cab8aa..52390fb2 100644 --- a/demo-dify/dify/web/app/components/workflow/nodes/_base/components/error-handle/fail-branch-card.tsx +++ b/demo-dify/dify/web/app/components/workflow/nodes/_base/components/error-handle/fail-branch-card.tsx @@ -1,12 +1,9 @@ import { RiMindMap } from '@remixicon/react' import { useTranslation } from 'react-i18next' -import { useDocLink } from '@/context/i18n' const FailBranchCard = () => { const { t } = useTranslation(['workflow']) - const docLink = useDocLink() - - return ( + return (
diff --git a/demo-dify/dify/web/app/components/workflow/nodes/_base/components/help-link.tsx b/demo-dify/dify/web/app/components/workflow/nodes/_base/components/help-link.tsx index 33ea6681..fcfba18d 100644 --- a/demo-dify/dify/web/app/components/workflow/nodes/_base/components/help-link.tsx +++ b/demo-dify/dify/web/app/components/workflow/nodes/_base/components/help-link.tsx @@ -4,6 +4,7 @@ import { iconButtonVariants } from '@langgenius/dify-ui/icon-button' import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip' import { memo } from 'react' import { useTranslation } from 'react-i18next' +import { isOfficialDifyUrl } from '@/utils/official-link' import { useNodeHelpLink } from '../hooks/use-node-help-link' type HelpLinkProps = { @@ -13,7 +14,7 @@ const HelpLink = ({ nodeType }: HelpLinkProps) => { const { t } = useTranslation(['common']) const link = useNodeHelpLink(nodeType) - if (!link) return null + if (!link || isOfficialDifyUrl(link)) return null const label = t(($) => $['userProfile.helpCenter'], { ns: 'common' }) diff --git a/demo-dify/dify/web/app/components/workflow/nodes/_base/components/switch-plugin-version.tsx b/demo-dify/dify/web/app/components/workflow/nodes/_base/components/switch-plugin-version.tsx index c2a15f9b..c0fae2cb 100644 --- a/demo-dify/dify/web/app/components/workflow/nodes/_base/components/switch-plugin-version.tsx +++ b/demo-dify/dify/web/app/components/workflow/nodes/_base/components/switch-plugin-version.tsx @@ -36,7 +36,6 @@ import useWorkspacePluginInstallPermission from '@/app/components/plugins/instal import { pluginManifestToCardPluginProps } from '@/app/components/plugins/install-plugin/utils' import { useMarketplace, useMarketplacePluginVersions } from '@/features/marketplace/client' import useTimestamp from '@/hooks/use-timestamp' -import Link from '@/next/link' import { consoleQuery } from '@/service/console' import { normalizeInstalledPluginDetail, @@ -181,7 +180,6 @@ export const SwitchPluginVersion: FC = (props) => { } function PluginVersionInstallConfirmation({ - marketplace, selection, onInstalled, }: { @@ -222,22 +220,6 @@ function PluginVersionInstallConfirmation({
- {marketplace && ( - - - {t(($) => $['nodes.agent.installPlugin.changelog'], { ns: 'workflowAgent' })} - - - - )} {!mutation.isPending && ( }> {t(($) => $['nodes.agent.installPlugin.cancel'], { ns: 'workflowAgent' })} diff --git a/demo-dify/dify/web/app/components/workflow/nodes/agent-v2/components/agent-task-field.tsx b/demo-dify/dify/web/app/components/workflow/nodes/agent-v2/components/agent-task-field.tsx index fee83e40..939cd080 100644 --- a/demo-dify/dify/web/app/components/workflow/nodes/agent-v2/components/agent-task-field.tsx +++ b/demo-dify/dify/web/app/components/workflow/nodes/agent-v2/components/agent-task-field.tsx @@ -12,7 +12,6 @@ import { useCallback, useId } from 'react' import { useTranslation } from 'react-i18next' import PromptEditor from '@/app/components/base/prompt-editor' import { $createCustomTextNode } from '@/app/components/base/prompt-editor/plugins/custom-text/node' -import { useDocLink } from '@/context/i18n' import { useWorkflowVariableType } from '../../../hooks/use-workflow-variables' import { BlockEnum } from '../../../types' import useAvailableVarList from '../../_base/hooks/use-available-var-list' @@ -71,8 +70,7 @@ export function AgentTaskField({ const taskLabelId = useId() const { t } = useTranslation(['workflow', 'workflowAgent']) - const docLink = useDocLink() - const getVarType = useWorkflowVariableType() + const getVarType = useWorkflowVariableType() const { availableVars, availableNodesWithParent } = useAvailableVarList(id) const [isFocus, { setTrue: setFocus, setFalse: setBlur }] = useBoolean(false) @@ -105,16 +103,7 @@ export function AgentTaskField({ - {t(($) => $[`${i18nPrefix}.task.tooltip`], { ns: 'workflowAgent' })}{' '} - - {t(($) => $[`${i18nPrefix}.task.learnMore`], { ns: 'workflowAgent' })} - - + {t(($) => $[`${i18nPrefix}.task.tooltip`], { ns: 'workflowAgent' })} diff --git a/demo-dify/dify/web/app/components/workflow/nodes/document-extractor/panel.tsx b/demo-dify/dify/web/app/components/workflow/nodes/document-extractor/panel.tsx index 453c9326..daccea82 100644 --- a/demo-dify/dify/web/app/components/workflow/nodes/document-extractor/panel.tsx +++ b/demo-dify/dify/web/app/components/workflow/nodes/document-extractor/panel.tsx @@ -6,13 +6,11 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import { useLocale } from '#i18n' import Field from '@/app/components/workflow/nodes/_base/components/field' -import { BlockEnum } from '@/app/components/workflow/types' import { LanguagesSupported } from '@/i18n/language' import { consoleQuery } from '@/service/console' import OutputVars, { VarItem } from '../_base/components/output-vars' import Split from '../_base/components/split' import VarReferencePicker from '../_base/components/variable/var-reference-picker' -import { useNodeHelpLink } from '../_base/hooks/use-node-help-link' import useConfig from './use-config' const i18nPrefix = 'nodes.docExtractor' @@ -20,7 +18,6 @@ const i18nPrefix = 'nodes.docExtractor' const Panel: FC> = ({ id, data }) => { const { t } = useTranslation(['workflow']) const locale = useLocale() - const link = useNodeHelpLink(BlockEnum.DocExtractor) const { data: supportFileTypesResponse } = useQuery( consoleQuery.files.supportType.get.queryOptions(), ) @@ -61,9 +58,6 @@ const Panel: FC> = ({ id, data }) => { ns: 'workflow', types: supportTypesShowNames, })} - - {t(($) => $[`${i18nPrefix}.learnMore`], { ns: 'workflow' })} - diff --git a/demo-dify/dify/web/app/components/workflow/nodes/human-input-v2/migration/migration-banner.tsx b/demo-dify/dify/web/app/components/workflow/nodes/human-input-v2/migration/migration-banner.tsx index 06743b96..652d91c6 100644 --- a/demo-dify/dify/web/app/components/workflow/nodes/human-input-v2/migration/migration-banner.tsx +++ b/demo-dify/dify/web/app/components/workflow/nodes/human-input-v2/migration/migration-banner.tsx @@ -3,6 +3,7 @@ import { memo } from 'react' import { useTranslation } from 'react-i18next' import BlockIcon from '@/app/components/workflow/block-icon' import { BlockEnum } from '@/app/components/workflow/types' +import { isOfficialDifyUrl } from '@/utils/official-link' type HumanInputMigrationBannerProps = { canEdit: boolean @@ -23,7 +24,7 @@ const HumanInputMigrationBanner = ({
{t(($) => $['nodes.humanInputMigration.banner.description'], { ns: 'workflow' })}
- {helpLink && ( + {helpLink && !isOfficialDifyUrl(helpLink) && ( = ({ data, onAdd, onShowUpgradeTip }) => { const { t } = useTranslation(['workflowHumanInput']) - const { data: deploymentEdition } = useSuspenseQuery({ - ...systemFeaturesQueryOptions(), - select: ({ deployment_edition }) => deployment_edition, - }) const { data: humanInputEmailDeliveryEnabled } = useQuery( consoleQuery.features.get.queryOptions({ select: (features) => features.human_input_email_delivery_enabled, @@ -278,40 +273,6 @@ const MethodSelector: FC = ({ data, onAdd, onShowUpgradeTip - {deploymentEdition === 'CLOUD' && ( - - )} ) diff --git a/demo-dify/dify/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/instruction/index.tsx b/demo-dify/dify/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/instruction/index.tsx index b5a2a806..389d8f50 100644 --- a/demo-dify/dify/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/instruction/index.tsx +++ b/demo-dify/dify/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/instruction/index.tsx @@ -1,7 +1,6 @@ import { cn } from '@langgenius/dify-ui/cn' import * as React from 'react' import { useTranslation } from 'react-i18next' -import { useDocLink } from '@/context/i18n' import Line from './line' type InstructionProps = { @@ -10,9 +9,7 @@ type InstructionProps = { const Instruction = ({ className }: InstructionProps) => { const { t } = useTranslation(['workflow']) - const docLink = useDocLink() - - return ( + return (
{

{t(($) => $['nodes.knowledgeBase.chunkStructureTip.message'], { ns: 'workflow' })}

- - {t(($) => $['nodes.knowledgeBase.chunkStructureTip.learnMore'], { ns: 'workflow' })} -
diff --git a/demo-dify/dify/web/app/components/workflow/nodes/knowledge-base/components/retrieval-setting/index.tsx b/demo-dify/dify/web/app/components/workflow/nodes/knowledge-base/components/retrieval-setting/index.tsx index 8bb93340..18b603c6 100644 --- a/demo-dify/dify/web/app/components/workflow/nodes/knowledge-base/components/retrieval-setting/index.tsx +++ b/demo-dify/dify/web/app/components/workflow/nodes/knowledge-base/components/retrieval-setting/index.tsx @@ -12,7 +12,6 @@ import { RadioGroup } from '@langgenius/dify-ui/radio-group' import { memo } from 'react' import { useTranslation } from 'react-i18next' import { Field as WorkflowField } from '@/app/components/workflow/nodes/_base/components/layout' -import { useDocLink } from '@/context/i18n' import { useRetrievalSetting } from './hooks' import { SearchMethodOption } from './search-method-option' @@ -59,8 +58,7 @@ const RetrievalSetting = ({ showMultiModalTip, }: RetrievalSettingProps) => { const { t } = useTranslation(['datasetSettings', 'workflow']) - const docLink = useDocLink() - const { options, hybridSearchModeOptions } = useRetrievalSetting(indexMethod) + const { options, hybridSearchModeOptions } = useRetrievalSetting(indexMethod) return ( $['form.retrievalSetting.title'], { ns: 'datasetSettings' }), subTitle: (
- - {t(($) => $['form.retrievalSetting.learnMore'], { ns: 'datasetSettings' })} - -   {t(($) => $['nodes.knowledgeBase.aboutRetrieval'], { ns: 'workflow' })}
), diff --git a/demo-dify/dify/web/app/components/workflow/nodes/tool/components/tool-form/item.tsx b/demo-dify/dify/web/app/components/workflow/nodes/tool/components/tool-form/item.tsx index ae73825b..bc0b139f 100644 --- a/demo-dify/dify/web/app/components/workflow/nodes/tool/components/tool-form/item.tsx +++ b/demo-dify/dify/web/app/components/workflow/nodes/tool/components/tool-form/item.tsx @@ -10,6 +10,7 @@ import { FormTypeEnum } from '@/app/components/header/account-setting/model-prov import { useLanguage } from '@/app/components/header/account-setting/model-provider-page/hooks' import { SchemaDialog } from '@/app/components/plugins/plugin-detail-panel/tool-selector/components/schema-dialog' import FormInputItem from '@/app/components/workflow/nodes/_base/components/form-input-item' +import { isOfficialDifyUrl } from '@/utils/official-link' const URL_REGEX = /(https?:\/\/\S+)/g @@ -27,6 +28,11 @@ const renderDescriptionWithLinks = (description: string): ReactNode => { if (start > currentIndex) parts.push(description.slice(currentIndex, start)) + if (isOfficialDifyUrl(url)) { + currentIndex = start + url.length + return + } + parts.push( = ({ [hideProcessDetail], ) const { t } = useTranslation(['workflow', 'workflowLogic', 'workflowHumanInput', 'runLog']) - const docLink = useDocLink() - const detailsId = useId() + const detailsId = useId() const Header = hideProcessDetail ? 'div' : 'button' const statusLabels: Record = { succeeded: t(($) => $['tracing.status.succeeded'], { ns: 'workflow' }), @@ -307,14 +305,6 @@ const NodePanel: FC = ({ {nodeInfo.status === 'exception' && ( {localizedError} - - {t(($) => $['common.learnMore'], { ns: 'workflow' })} - )} {nodeInfo.status === 'failed' && ( diff --git a/demo-dify/dify/web/app/components/workflow/run/status.tsx b/demo-dify/dify/web/app/components/workflow/run/status.tsx index d7a4fe4b..3cb91b63 100644 --- a/demo-dify/dify/web/app/components/workflow/run/status.tsx +++ b/demo-dify/dify/web/app/components/workflow/run/status.tsx @@ -7,9 +7,9 @@ import { useMemo } from 'react' import { Trans, useTranslation } from 'react-i18next' import StatusContainer from '@/app/components/workflow/run/status-container' import { ENABLE_HITL_IM } from '@/config' -import { useDocLink } from '@/context/i18n' import { resolveConsoleHumanInputFormURL } from '@/features/human-input/console/links' import { consoleQuery } from '@/service/console' +import { isOfficialDifyUrl } from '@/utils/official-link' import { basePath } from '@/utils/var' type ResultProps = { @@ -34,8 +34,7 @@ const StatusPanel: FC = ({ onOpenTracingTab, }) => { const { t } = useTranslation(['runLog', 'workflow', 'appLog', 'workflowHumanInput', 'share']) - const docLink = useDocLink() - const { data: pausedDetails } = useQuery( + const { data: pausedDetails } = useQuery( consoleQuery.workflow.byWorkflowRunId.pauseDetails.get.queryOptions({ input: status === 'paused' && workflowRunId @@ -225,14 +224,6 @@ const StatusPanel: FC = ({
)} @@ -259,14 +250,14 @@ const StatusPanel: FC = ({ {t(($) => $['humanInputV2.unavailable'], { ns: 'share' })}

)} - {pausedInputURLs.length > 0 && ( + {pausedInputURLs.some((url) => !isOfficialDifyUrl(url)) && (
{t(($) => $['nodes.humanInput.log.backstageInputURL'], { ns: 'workflowHumanInput', })}
- {pausedInputURLs.map((url) => ( + {pausedInputURLs.filter((url) => !isOfficialDifyUrl(url)).map((url) => ( { const { t } = useTranslation(['workflowDebug']) - const docLink = useDocLink() - - return ( + return ( ) diff --git a/demo-dify/dify/web/app/education/apply/application-form.tsx b/demo-dify/dify/web/app/education/apply/application-form.tsx index 51e910de..2655335b 100644 --- a/demo-dify/dify/web/app/education/apply/application-form.tsx +++ b/demo-dify/dify/web/app/education/apply/application-form.tsx @@ -22,7 +22,6 @@ import { Trans, useTranslation } from 'react-i18next' import { billingErrorMessageKey } from '@/app/components/billing/billing-error' import { useEducationDiscount } from '@/app/components/billing/hooks/use-education-discount' import { toast } from '@/app/notifications' -import { useDocLink } from '@/context/i18n' import { currentWorkspaceAtom, isCurrentWorkspaceManagerAtom } from '@/context/workspace-state' import { useAsyncWindowOpen } from '@/hooks/use-async-window-open' import Link from '@/next/link' @@ -87,8 +86,7 @@ const EducationApplyPage = ({ plan, token }: EducationApplyPageProps) => { ) const currentWorkspace = useAtomValue(currentWorkspaceAtom) const isCurrentWorkspaceManager = useAtomValue(isCurrentWorkspaceManagerAtom) - const docLink = useDocLink() - const { handleEducationDiscount } = useEducationDiscount() + const { handleEducationDiscount } = useEducationDiscount() const openAsyncWindow = useAsyncWindowOpen() const switchWorkspaceMutation = useMutation( consoleQuery.workspaces.switch.post.mutationOptions({ context: { silent: true } }), @@ -247,27 +245,6 @@ const EducationApplyPage = ({ plan, token }: EducationApplyPageProps) => { {t(($) => $['form.terms.title'], { ns: 'education' })} - {t(($) => $['form.terms.desc.front'], { ns: 'education' })} -   - - {t(($) => $['form.terms.desc.termsOfService'], { ns: 'education' })} - -   - {t(($) => $['form.terms.desc.and'], { ns: 'education' })} -   - - {t(($) => $['form.terms.desc.privacyPolicy'], { ns: 'education' })} - {t(($) => $['form.terms.desc.end'], { ns: 'education' })}
@@ -306,15 +283,12 @@ const EducationApplyPage = ({ plan, token }: EducationApplyPageProps) => {

)}
- {t(($) => $.learn, { ns: 'education' })} + )} diff --git a/demo-dify/dify/web/app/education/expire-notice/modal.tsx b/demo-dify/dify/web/app/education/expire-notice/modal.tsx index ec4d004c..375e0fa4 100644 --- a/demo-dify/dify/web/app/education/expire-notice/modal.tsx +++ b/demo-dify/dify/web/app/education/expire-notice/modal.tsx @@ -19,6 +19,7 @@ import { pricingQueryParser, } from '@/app/components/billing/pricing/query-params' import { useDocLink } from '@/context/i18n' +import { isOfficialDifyUrl } from '@/utils/official-link' import { systemFeaturesQueryOptions } from '@/features/system-features/client' import useTimestamp from '@/hooks/use-timestamp' import Link from '@/next/link' @@ -107,15 +108,17 @@ const ExpireNoticeModal: React.FC = ({ expireAt, expired, onClose }) => {
- - {t(($) => $.learn, { ns: 'education' })} -
{agent?.app_id && !agent.hidden_app_backed && capabilities.canViewAccessPoint && ( diff --git a/demo-dify/dify/web/features/agent-v2/agent-detail/configure/components/orchestrate/common/docs-link.tsx b/demo-dify/dify/web/features/agent-v2/agent-detail/configure/components/orchestrate/common/docs-link.tsx index 6b1e6193..61b54d1f 100644 --- a/demo-dify/dify/web/features/agent-v2/agent-detail/configure/components/orchestrate/common/docs-link.tsx +++ b/demo-dify/dify/web/features/agent-v2/agent-detail/configure/components/orchestrate/common/docs-link.tsx @@ -1,6 +1,9 @@ import type { ReactNode } from 'react' +import { isOfficialDifyUrl } from '@/utils/official-link' export function DocsLink({ children, href }: { children?: ReactNode; href: string }) { + if (!href || isOfficialDifyUrl(href)) return null + return ( void }) { - const { t } = useTranslation(['agentV2', 'plugin']) - const marketplace = useMarketplace() + const { t } = useTranslation(['agentV2']) - if (!marketplace && !onAddCliTool) return null + if (!onAddCliTool) return null return (
- {marketplace && ( - - - - {t(($) => $.findMoreInMarketplace, { ns: 'plugin' })} - - - )} {onAddCliTool && (
- - {t(($) => $['agentDetail.configure.tools.cliDialog.learnMore'])} - - {mode === 'edit' && tool && onDeleteCliTool && ( <>
diff --git a/demo-dify/dify/web/features/agent-v2/roster/page.tsx b/demo-dify/dify/web/features/agent-v2/roster/page.tsx index 3e8382f2..93c252bc 100644 --- a/demo-dify/dify/web/features/agent-v2/roster/page.tsx +++ b/demo-dify/dify/web/features/agent-v2/roster/page.tsx @@ -7,7 +7,6 @@ import { useDebounce } from 'ahooks' import { useQueryState } from 'nuqs' import { useId } from 'react' import { useTranslation } from 'react-i18next' -import { useDocLink } from '@/context/i18n' import useDocumentTitle from '@/hooks/use-document-title' import { consoleQuery } from '@/service/console' import { AgentRosterList } from './components/agent-roster-list' @@ -28,8 +27,7 @@ const EMPTY_PUBLICATION_COUNTS: AgentPublicationCountsResponse = { export default function RosterPage() { const { t } = useTranslation(['agentRoster']) - const docLink = useDocLink() - const [keyword] = useQueryState(rosterQueryParamNames.keyword, rosterKeywordQueryParser) + const [keyword] = useQueryState(rosterQueryParamNames.keyword, rosterKeywordQueryParser) const [rosterFilter] = useQueryState(rosterQueryParamNames.filter, rosterFilterQueryParser) const [createdByMe] = useQueryState( rosterQueryParamNames.createdByMe, @@ -109,21 +107,6 @@ export default function RosterPage() { > {pageTitle} - - - {t(($) => $['roster.learnMore'], { ns: 'agentRoster' })} - - - -
diff --git a/demo-dify/dify/web/features/app-access-error/page.tsx b/demo-dify/dify/web/features/app-access-error/page.tsx index adaa5db1..30285768 100644 --- a/demo-dify/dify/web/features/app-access-error/page.tsx +++ b/demo-dify/dify/web/features/app-access-error/page.tsx @@ -61,7 +61,7 @@ function PageContent({ clientIp, embedded }: AppNotAccessibleProps) { >
- +
(null) + const formRef = useRef(null) const saveCredentials = useSaveContactImCredentials() const testConnection = useTestContactImConnection() const [values, setValues] = useState(() => ({ @@ -144,15 +142,7 @@ export function ContactEmailConfigContent({ ns="contacts" i18nKey={($) => $['imPlatform.email.description']} components={{ emphasis: }} - />{' '} - - {t(($) => $['imPlatform.learnMore'])} - + /> diff --git a/demo-dify/dify/web/features/home/banner/banner-item.tsx b/demo-dify/dify/web/features/home/banner/banner-item.tsx index 2d2f9379..c0f73e2a 100644 --- a/demo-dify/dify/web/features/home/banner/banner-item.tsx +++ b/demo-dify/dify/web/features/home/banner/banner-item.tsx @@ -1,5 +1,6 @@ import type { BannerResponse } from '@dify/contracts/api/console/explore/types.gen' import { trackEvent } from '@/app/components/base/amplitude' +import { isOfficialDifyUrl } from '@/utils/official-link' type BannerItemProps = { banner: BannerResponse @@ -59,7 +60,7 @@ export function BannerItem({ banner, sort, language, accountId, titleId }: Banne />
- {banner.link && ( + {banner.link && !isOfficialDifyUrl(banner.link) && ( { ).not.toBeInTheDocument() }) - it('links more templates to Marketplace only when Marketplace is enabled', () => { + it('does not link more templates to the official Marketplace', () => { const { unmount } = renderHomeContent({ enableMarketplace: true }) - expect(screen.getByRole('link', { name: 'explore.apps.viewMore' })).toHaveAttribute( - 'href', - expect.stringContaining('/templates'), - ) + expect(screen.queryByRole('link', { name: 'explore.apps.viewMore' })).not.toBeInTheDocument() unmount() renderHomeContent({ enableMarketplace: false }) diff --git a/demo-dify/dify/web/features/home/home-content/home-content.tsx b/demo-dify/dify/web/features/home/home-content/home-content.tsx index dcd7fd38..17b7698e 100644 --- a/demo-dify/dify/web/features/home/home-content/home-content.tsx +++ b/demo-dify/dify/web/features/home/home-content/home-content.tsx @@ -157,6 +157,7 @@ export function HomeContent() { item.description?.toLowerCase().includes(searchKeywords), ) }, [keywords, filteredList]) + const showTemplates = templatesData.recommended_apps.length > 0 const [currApp, setCurrApp] = useState(null) const [isShowCreateModal, setIsShowCreateModal] = useState(false) @@ -471,48 +472,52 @@ export function HomeContent() { onTry={handleTryAppFromLearnDify} /> - + {showTemplates && ( + <> + -
-
- {searchFilteredList.length > 0 ? ( -
    - {searchFilteredList.map((app) => ( - handleCreateFromTemplate(app)} - onTry={handleTryApp} - /> - ))} -
- ) : ( -
-

- {t(($) => $['newApp.noTemplateFound'], { ns: 'app' })} -

- {keywords.trim() && ( -

- {t(($) => $['newApp.noTemplateFoundTip'], { ns: 'app' })} -

+
+
+ {searchFilteredList.length > 0 ? ( +
    + {searchFilteredList.map((app) => ( + handleCreateFromTemplate(app)} + onTry={handleTryApp} + /> + ))} +
+ ) : ( +
+

+ {t(($) => $['newApp.noTemplateFound'], { ns: 'app' })} +

+ {keywords.trim() && ( +

+ {t(($) => $['newApp.noTemplateFoundTip'], { ns: 'app' })} +

+ )} +
)} -
- )} -
-
+ +
+ + )}
void }) { const { t } = useTranslation(['explore', 'app']) - const marketplace = useMarketplace() return (
diff --git a/demo-dify/dify/web/features/human-input/form/__tests__/loaded-form-content.browser.spec.tsx b/demo-dify/dify/web/features/human-input/form/__tests__/loaded-form-content.browser.spec.tsx index 146f211a..d3449a04 100644 --- a/demo-dify/dify/web/features/human-input/form/__tests__/loaded-form-content.browser.spec.tsx +++ b/demo-dify/dify/web/features/human-input/form/__tests__/loaded-form-content.browser.spec.tsx @@ -240,7 +240,9 @@ describe('LoadedFormContent', () => { , ) await expect.element(page.getByRole('heading', { name: 'Legacy app' })).not.toBeInTheDocument() - await expect.element(page.getByRole('img', { name: 'Dify', exact: true })).toBeInTheDocument() + await expect + .element(page.getByRole('img', { name: '甘肃省房地产价格评估行业协会', exact: true })) + .toBeInTheDocument() }) }) diff --git a/demo-dify/dify/web/features/human-input/form/branding-footer.tsx b/demo-dify/dify/web/features/human-input/form/branding-footer.tsx index e09cfb5b..c4a90a9b 100644 --- a/demo-dify/dify/web/features/human-input/form/branding-footer.tsx +++ b/demo-dify/dify/web/features/human-input/form/branding-footer.tsx @@ -31,7 +31,7 @@ const BrandingFooter = ({ {replaceWebappLogo ? ( logo ) : ( - + )}
diff --git a/demo-dify/dify/web/features/new-rag/list/knowledge-view-switcher.tsx b/demo-dify/dify/web/features/new-rag/list/knowledge-view-switcher.tsx index 10616e18..e226f4f5 100644 --- a/demo-dify/dify/web/features/new-rag/list/knowledge-view-switcher.tsx +++ b/demo-dify/dify/web/features/new-rag/list/knowledge-view-switcher.tsx @@ -11,7 +11,6 @@ import { SegmentedControl, SegmentedControlItem } from '@langgenius/dify-ui/segm import { useIsClient } from 'foxact/use-is-client' import { useRef, useState } from 'react' import { useTranslation } from 'react-i18next' -import { useDocLink } from '@/context/i18n' import { useNewKnowledgeGuideDismissedValue, useSetNewKnowledgeGuideDismissed, @@ -24,8 +23,7 @@ export type KnowledgeViewSwitcherProps = { export function KnowledgeViewSwitcher({ value, onChange }: KnowledgeViewSwitcherProps) { const { t } = useTranslation(['knowledgeSpace', 'dataset']) - const docLink = useDocLink() - const guideDismissed = useNewKnowledgeGuideDismissedValue() + const guideDismissed = useNewKnowledgeGuideDismissedValue() const setGuideDismissed = useSetNewKnowledgeGuideDismissed() const isClient = useIsClient() const [guideOpenOverride, setGuideOpenOverride] = useState(null) @@ -89,14 +87,6 @@ export function KnowledgeViewSwitcher({ value, onChange }: KnowledgeViewSwitcher {t(($) => $.guideDescription)}
- - {t(($) => $.learnMore)} - diff --git a/demo-dify/dify/web/features/new-rag/space/api-access-dialog.tsx b/demo-dify/dify/web/features/new-rag/space/api-access-dialog.tsx index 8722df23..57d6191c 100644 --- a/demo-dify/dify/web/features/new-rag/space/api-access-dialog.tsx +++ b/demo-dify/dify/web/features/new-rag/space/api-access-dialog.tsx @@ -1,6 +1,6 @@ 'use client' -import { Button, buttonVariants } from '@langgenius/dify-ui/button' +import { Button } from '@langgenius/dify-ui/button' import { Dialog, DialogBody, @@ -18,7 +18,6 @@ import { useTranslation } from 'react-i18next' import { DatasetApiKeyDialogContent } from '@/app/components/api-key/dataset-api-key-dialog-content' import { useDatasetApiKeyMutations } from '@/app/components/api-key/use-dataset-api-key-mutations' import { CopyFeedback } from '@/app/components/base/copy-feedback' -import { useDocLink } from '@/context/i18n' import { workspacePermissionKeysAtom } from '@/context/permission-state' import Link from '@/next/link' import { consoleQuery } from '@/service/console' @@ -40,8 +39,7 @@ export function KnowledgeFsApiAccessDialog({ const { t } = useTranslation(['knowledgeSpace', 'dataset']) const { t: tAppApi } = useTranslation(['appApi']) const { t: tCommon } = useTranslation(['common']) - const docLink = useDocLink() - const workspacePermissionKeys = useAtomValue(workspacePermissionKeysAtom) + const workspacePermissionKeys = useAtomValue(workspacePermissionKeysAtom) const canManageApiKey = hasPermission(workspacePermissionKeys, 'dataset.api_key.manage') const [apiKeyModalOpen, setApiKeyModalOpen] = useState(false) const apiKeyMutations = useDatasetApiKeyMutations() @@ -101,15 +99,6 @@ export function KnowledgeFsApiAccessDialog({ ) : null} - - - {t(($) => $['serviceApi.card.apiReference'], { ns: 'dataset' })} - {status === 'active' && canManageApiKey && ( )} - {t(($) => $['upgrade.contactSupport'], { ns: 'knowledgeUpgrade' })} - +
)} diff --git a/demo-dify/dify/web/features/new-rag/upgrade/knowledge-upgrade-dialog.tsx b/demo-dify/dify/web/features/new-rag/upgrade/knowledge-upgrade-dialog.tsx index a252d305..02eb624f 100644 --- a/demo-dify/dify/web/features/new-rag/upgrade/knowledge-upgrade-dialog.tsx +++ b/demo-dify/dify/web/features/new-rag/upgrade/knowledge-upgrade-dialog.tsx @@ -18,7 +18,6 @@ import { isDefinedError } from '@orpc/client' import { skipToken, useMutation, useQuery } from '@tanstack/react-query' import { useId, useRef } from 'react' import { Trans, useTranslation } from 'react-i18next' -import { useDocLink } from '@/context/i18n' import { ModelCostNotice } from '@/features/new-rag/components/model-cost-notice' import { CreationModelField } from '@/features/new-rag/create/model-settings' import { createRequestId } from '@/features/new-rag/request-id' @@ -43,8 +42,7 @@ export function KnowledgeUpgradeDialog({ const { t } = useTranslation(['knowledgeUpgrade', 'knowledgeSpace']) const { t: tCommon } = useTranslation(['common']) const { t: tModels } = useTranslation(['knowledgeSettings', 'modelProvider', 'knowledgeCreate']) - const docLink = useDocLink() - const cancelRef = useRef(null) + const cancelRef = useRef(null) const modelCostNoticeId = useId() // Network retries of the same model choice reuse the key; any model change starts a new intent. const idempotencyKeyRef = useRef<{ fingerprint: string; key: string } | undefined>(undefined) @@ -163,14 +161,6 @@ export function KnowledgeUpgradeDialog({ /> - - {t(($) => $.learnMore, { ns: 'knowledgeSpace' })} - {(discoveryQuery.isError || startMutation.isError) && (

{modelsRejected diff --git a/demo-dify/dify/web/i18n/locales/en-US/app-overview.json b/demo-dify/dify/web/i18n/locales/en-US/app-overview.json index e0919ea7..62b64d55 100644 --- a/demo-dify/dify/web/i18n/locales/en-US/app-overview.json +++ b/demo-dify/dify/web/i18n/locales/en-US/app-overview.json @@ -73,7 +73,7 @@ "overview.appInfo.settings.more.inputPlaceholderTooltip": "Upgrade to customize the placeholder", "overview.appInfo.settings.more.privacyPolicy": "Privacy Policy", "overview.appInfo.settings.more.privacyPolicyPlaceholder": "Enter the privacy policy link", - "overview.appInfo.settings.more.privacyPolicyTip": "Helps visitors understand the data the application collects, see Privacy Policy.", + "overview.appInfo.settings.more.privacyPolicyTip": "Helps visitors understand the data the application collects.", "overview.appInfo.settings.multiEnvironmentNotice": "Web app settings apply to all environments.", "overview.appInfo.settings.title": "Branding", "overview.appInfo.settings.webDesc": "Web App Description", diff --git a/demo-dify/dify/web/i18n/locales/en-US/billing.json b/demo-dify/dify/web/i18n/locales/en-US/billing.json index c25cf058..6df95e1d 100644 --- a/demo-dify/dify/web/i18n/locales/en-US/billing.json +++ b/demo-dify/dify/web/i18n/locales/en-US/billing.json @@ -16,7 +16,7 @@ "plans.community.features": [ "All Core Features Released Under the Public Repository", "Single Workspace", - "Complies with Dify Open Source License" + "Complies with the Open Source License" ], "plans.community.includesTitle": "Free Features:", "plans.community.name": "Community", @@ -30,9 +30,9 @@ "Exclusive Enterprise Features", "Multiple Workspaces & Enterprise Management", "SSO", - "Negotiated SLAs by Dify Partners", + "Negotiated SLAs by partners", "Advanced Security & Controls", - "Updates and Maintenance by Dify Officially", + "Official updates and maintenance", "Professional Technical Support" ], "plans.enterprise.includesTitle": "Everything from Premium, plus:", diff --git a/demo-dify/dify/web/i18n/locales/zh-Hans/agent-v-2.json b/demo-dify/dify/web/i18n/locales/zh-Hans/agent-v-2.json index 3535eb48..78d1755f 100644 --- a/demo-dify/dify/web/i18n/locales/zh-Hans/agent-v-2.json +++ b/demo-dify/dify/web/i18n/locales/zh-Hans/agent-v-2.json @@ -91,7 +91,7 @@ "agentDetail.configure.communityEditionIsolationTip": "免责声明:在 Community Edition 中,sandbox 以非 root 用户身份运行,采用 Docker 默认 capability 配置,并且只通过 Landlock 为 Agent 自有文件和会话文件提供有限保护。服务器和所有 shell 子进程共享同一个 PID namespace 和容器级 capability 边界,因此不应将其视为具备强隔离能力的多层安全 sandbox。", "agentDetail.configure.files.add": "添加文件", "agentDetail.configure.files.buildNote.generated": "已生成", - "agentDetail.configure.files.buildNote.richTooltip": "Agent 在构建模式中完成的设置都记录在这里。每次对话开始时,它会连同提示词一起读取这份记录。了解更多", + "agentDetail.configure.files.buildNote.richTooltip": "Agent 在构建模式中完成的设置都记录在这里。每次对话开始时,它会连同提示词一起读取这份记录。", "agentDetail.configure.files.download": "下载 {{name}}", "agentDetail.configure.files.empty.description": "上传 Agent 可读取的文档,例如规格、模板或指南", "agentDetail.configure.files.empty.title": "暂无文件", @@ -102,8 +102,8 @@ "agentDetail.configure.files.preview.truncated": "仅显示该文件的开头部分。", "agentDetail.configure.files.preview.unsupported": "该文件不支持预览。", "agentDetail.configure.files.remove": "移除 {{name}}", - "agentDetail.configure.files.richTip": "上传过长、不适合放入提示词的参考资料:规格、模板、指南。了解更多\n\n在构建模式中,Agent 可帮你完成这些设置。", - "agentDetail.configure.files.tip": "上传过长、不适合放入提示词的参考资料:规格、模板、指南。了解更多\n\n在构建模式中,Agent 可帮你完成这些设置。", + "agentDetail.configure.files.richTip": "上传过长、不适合放入提示词的参考资料:规格、模板、指南。\n\n在构建模式中,Agent 可帮你完成这些设置。", + "agentDetail.configure.files.tip": "上传过长、不适合放入提示词的参考资料:规格、模板、指南。\n\n在构建模式中,Agent 可帮你完成这些设置。", "agentDetail.configure.files.treeLabel": "Agent 文件", "agentDetail.configure.files.upload.action": "上传", "agentDetail.configure.files.upload.browse": "选择", @@ -153,8 +153,8 @@ "agentDetail.configure.knowledgeRetrieval.remove": "删除 {{name}}", "agentDetail.configure.knowledgeRetrieval.retrievalOne": "Retrieval 1", "agentDetail.configure.knowledgeRetrieval.retrievalTwo": "Retrieval 2", - "agentDetail.configure.knowledgeRetrieval.richTip": "连接 Agent 工作时可检索的知识库,以基于其内容生成回复。了解更多", - "agentDetail.configure.knowledgeRetrieval.tip": "连接 Agent 工作时可检索的知识库,以基于其内容生成回复。了解更多", + "agentDetail.configure.knowledgeRetrieval.richTip": "连接 Agent 工作时可检索的知识库,以基于其内容生成回复。", + "agentDetail.configure.knowledgeRetrieval.tip": "连接 Agent 工作时可检索的知识库,以基于其内容生成回复。", "agentDetail.configure.knowledgeRetrieval.toggle": "展开或收起知识检索", "agentDetail.configure.knowledgeRetrieval.validation.metadataModelRequired": "请在元数据过滤中配置模型", "agentDetail.configure.model.label": "模型", @@ -175,7 +175,7 @@ "agentDetail.configure.prompt.label": "提示词", "agentDetail.configure.prompt.placeholder": "在此编写指令,", "agentDetail.configure.prompt.referenceMissing": "{{name}} 不存在", - "agentDetail.configure.prompt.richTip": "设定 Agent 的角色和工作方式。了解更多", + "agentDetail.configure.prompt.richTip": "设定 Agent 的角色和工作方式。", "agentDetail.configure.publishBar.draft": "草稿", "agentDetail.configure.publishBar.publishUpdate": "发布更新", "agentDetail.configure.publishBar.published": "已发布", @@ -223,8 +223,8 @@ "agentDetail.configure.skills.moreActions": "{{name}} 的更多操作", "agentDetail.configure.skills.openInLibrary": "在 Skill 库中打开", "agentDetail.configure.skills.removeAction": "移除", - "agentDetail.configure.skills.richTip": "将重复任务所需的指令、文件和脚本打包成 Skill。了解更多\n\n在构建模式中,Agent 可帮你完成这些设置。", - "agentDetail.configure.skills.tip": "将重复任务所需的指令、文件和脚本打包成 Skill。了解更多\n\n在构建模式中,Agent 可帮你完成这些设置。", + "agentDetail.configure.skills.richTip": "将重复任务所需的指令、文件和脚本打包成 Skill。\n\n在构建模式中,Agent 可帮你完成这些设置。", + "agentDetail.configure.skills.tip": "将重复任务所需的指令、文件和脚本打包成 Skill。\n\n在构建模式中,Agent 可帮你完成这些设置。", "agentDetail.configure.skills.upload.action": "上传", "agentDetail.configure.skills.upload.browse": "选择", "agentDetail.configure.skills.upload.description": "为此 Agent 上传 .zip 或 .skill 格式的 Skill 包。", @@ -276,7 +276,7 @@ "agentDetail.configure.tools.moreActions": "{{name}} 的更多操作", "agentDetail.configure.tools.removeAction": "移除 {{name}}", "agentDetail.configure.tools.removeProvider": "移除所有工具", - "agentDetail.configure.tools.richTip": "添加工作空间中的 工具。了解更多\n\nAgent 在沙箱中自行安装的工具不会显示在这里,但仍然可用。", + "agentDetail.configure.tools.richTip": "添加工作空间中的 工具。\n\nAgent 在沙箱中自行安装的工具不会显示在这里,但仍然可用。", "agentDetail.configure.tools.toolTabs.all": "全部", "agentDetail.configure.tools.toolTabs.cli": "CLI", "agentDetail.configure.tools.toolTabs.custom": "自定义", diff --git a/demo-dify/dify/web/i18n/locales/zh-Hans/app-debug.json b/demo-dify/dify/web/i18n/locales/zh-Hans/app-debug.json index cf342c49..d530a484 100644 --- a/demo-dify/dify/web/i18n/locales/zh-Hans/app-debug.json +++ b/demo-dify/dify/web/i18n/locales/zh-Hans/app-debug.json @@ -194,7 +194,7 @@ "variableConfig.file.supportFileTypes": "支持的文件类型", "variableConfig.file.video.name": "视频", "variableConfig.hidden": "隐藏并预填", - "variableConfig.hiddenDescription": "对终端用户隐藏此字段,并由你预填字段值。与 必填 互斥。了解更多", + "variableConfig.hiddenDescription": "对终端用户隐藏此字段,并由你预填字段值。与 必填 互斥。", "variableConfig.inputPlaceholder": "请输入", "variableConfig.json": "JSON", "variableConfig.jsonSchema": "JSON Schema", diff --git a/demo-dify/dify/web/i18n/locales/zh-Hans/app-overview.json b/demo-dify/dify/web/i18n/locales/zh-Hans/app-overview.json index 9cbabdc4..b54da021 100644 --- a/demo-dify/dify/web/i18n/locales/zh-Hans/app-overview.json +++ b/demo-dify/dify/web/i18n/locales/zh-Hans/app-overview.json @@ -73,7 +73,7 @@ "overview.appInfo.settings.more.inputPlaceholderTooltip": "升级后可自定义提示语", "overview.appInfo.settings.more.privacyPolicy": "隐私政策", "overview.appInfo.settings.more.privacyPolicyPlaceholder": "请输入隐私政策链接", - "overview.appInfo.settings.more.privacyPolicyTip": "帮助访问者了解该应用收集的数据,可参考 隐私政策。", + "overview.appInfo.settings.more.privacyPolicyTip": "帮助访问者了解该应用收集的数据。", "overview.appInfo.settings.multiEnvironmentNotice": "Web App 设置将应用于所有环境。", "overview.appInfo.settings.title": "品牌设置", "overview.appInfo.settings.webDesc": "Web App 描述", diff --git a/demo-dify/dify/web/i18n/locales/zh-Hans/billing.json b/demo-dify/dify/web/i18n/locales/zh-Hans/billing.json index d019bf61..7a626d9a 100644 --- a/demo-dify/dify/web/i18n/locales/zh-Hans/billing.json +++ b/demo-dify/dify/web/i18n/locales/zh-Hans/billing.json @@ -16,7 +16,7 @@ "plans.community.features": [ "所有核心功能已在公共仓库发布", "单一工作区", - "遵守 Dify 开源许可证" + "遵守开源许可证" ], "plans.community.includesTitle": "免费功能:", "plans.community.name": "Community", @@ -30,9 +30,9 @@ "专属企业功能", "多个工作区与企业管理", "单点登录", - "由 Dify 合作伙伴协商的服务水平协议", + "由合作伙伴协商的服务水平协议", "高级安全与控制", - "由 Dify 官方进行的更新和维护", + "由官方进行的更新和维护", "专业技术支持" ], "plans.enterprise.includesTitle": "Premium 版的所有功能,加上:", diff --git a/demo-dify/dify/web/i18n/locales/zh-Hans/dataset.json b/demo-dify/dify/web/i18n/locales/zh-Hans/dataset.json index 4280c931..ce809b68 100644 --- a/demo-dify/dify/web/i18n/locales/zh-Hans/dataset.json +++ b/demo-dify/dify/web/i18n/locales/zh-Hans/dataset.json @@ -17,7 +17,7 @@ "chunkingMode.qa": "问答", "connectDataset": "连接外部知识库", "connectDatasetIntro.content.end": "。然后找到相应的知识库 ID 并填写在左侧表单中。如果所有信息正确,点击连接按钮后将自动跳转到知识库中的检索测试。", - "connectDatasetIntro.content.front": "要连接到外部知识库,您需要先创建一个外部 API。请仔细阅读并参考", + "connectDatasetIntro.content.front": "要连接到外部知识库,您需要先创建一个外部 API", "connectDatasetIntro.content.link": "了解如何创建外部 API", "connectDatasetIntro.learnMore": "了解更多", "connectDatasetIntro.title": "如何连接到外部知识库", diff --git a/demo-dify/dify/web/i18n/locales/zh-Hans/education.json b/demo-dify/dify/web/i18n/locales/zh-Hans/education.json index 5aee8fb3..9018510e 100644 --- a/demo-dify/dify/web/i18n/locales/zh-Hans/education.json +++ b/demo-dify/dify/web/i18n/locales/zh-Hans/education.json @@ -19,7 +19,7 @@ "form.schoolRole.option.teacher": "教师", "form.schoolRole.title": "您在学校的身份", "form.terms.desc.and": "和", - "form.terms.desc.end": "。提交即表示:", + "form.terms.desc.end": "提交即表示您确认以下内容:", "form.terms.desc.front": "您的信息和教育版认证资格的使用需遵守我们的", "form.terms.desc.privacyPolicy": "隐私政策", "form.terms.desc.termsOfService": "服务条款", diff --git a/demo-dify/dify/web/service/__tests__/chinese-system-message.spec.ts b/demo-dify/dify/web/service/__tests__/chinese-system-message.spec.ts new file mode 100644 index 00000000..0c098436 --- /dev/null +++ b/demo-dify/dify/web/service/__tests__/chinese-system-message.spec.ts @@ -0,0 +1,19 @@ +import { describe, expect, it } from 'vite-plus/test' +import { localizeSystemMessage } from '../chinese-system-message' + +const INTERNAL_ERROR = 'The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.' + +describe('localizeSystemMessage', () => { + it('translates known system errors when the locale is Chinese', () => { + expect(localizeSystemMessage(INTERNAL_ERROR, 'zh-Hans')).toBe('服务器处理这次请求时出错,暂时无法完成。请稍后重试。') + expect(localizeSystemMessage('App not found.', 'zh-Hans')).toBe('找不到该应用。') + expect(localizeSystemMessage('File size exceeded. 12MB', 'zh-Hans')).toBe('文件超出大小限制。12MB') + expect(localizeSystemMessage('Too many login emails have been sent. Please try again in 5 minutes.', 'zh-Hans')).toBe('登录邮件发送过于频繁,请在 5 分钟后再试。') + }) + + it('keeps the original message for English locales and unknown text', () => { + expect(localizeSystemMessage(INTERNAL_ERROR, 'en-US')).toBe(INTERNAL_ERROR) + expect(localizeSystemMessage('插件作者撰写的介绍', 'zh-Hans')).toBe('插件作者撰写的介绍') + expect(localizeSystemMessage('A custom provider detail', 'zh-Hans')).toBe('A custom provider detail') + }) +}) diff --git a/demo-dify/dify/web/service/chinese-system-message.ts b/demo-dify/dify/web/service/chinese-system-message.ts new file mode 100644 index 00000000..8c1f2d80 --- /dev/null +++ b/demo-dify/dify/web/service/chinese-system-message.ts @@ -0,0 +1,292 @@ +import Cookies from 'js-cookie' +import { getI18n } from 'react-i18next' +import { LOCALE_COOKIE_NAME } from '@/config' + +const ZH_MESSAGES: Record = { + 'The specified filename does not exist.': '指定的文件名不存在。', + 'Error uploading remote file.': '上传远程文件失败。', + 'The remote file URL is invalid.': '远程文件地址无效。', + 'The remote file URL is not allowed.': '不允许使用该远程文件地址。', + 'The remote file could not be found.': '找不到该远程文件。', + 'The remote file cannot be accessed without authorization.': '访问该远程文件需要授权。', + 'The remote file is temporarily unavailable.': '远程文件暂时无法访问。', + 'The remote file server returned an invalid response.': '远程文件服务器返回了无效响应。', + 'File size exceeded. {message}': '文件超出大小限制。', + 'File type not allowed.': '不允许上传该类型的文件。', + 'The file extension is blocked for security reasons.': '出于安全原因,已禁止该文件扩展名。', + 'Only one file is allowed.': '只能上传一个文件。', + 'Please upload your file.': '请上传文件。', + 'The conversation was not found for this user and app.': '找不到该用户在此应用中的对话。', + 'The conversation cursor is not in the current list. Refresh the list and try again.': '当前列表中没有这条对话位置。请刷新列表后再试。', + 'The conversation variable was not found for this conversation.': '找不到该对话中的变量。', + 'The new value does not match the conversation variable\'s type.': '新的值与对话变量的类型不一致。', + 'The conversation has no message from which to generate a name.': '这条对话还没有可用于生成名称的消息。', + 'A rating is required when there is no existing feedback to remove.': '没有可取消的反馈时,需要先给出评分。', + 'Authentication is required.': '请先登录。', + 'You don\'t have the permission to access the requested resource.': '你没有访问该内容的权限。', + 'The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.': '服务器处理这次请求时出错,暂时无法完成。请稍后重试。', + 'Server Error': '服务器出错,请稍后重试。', + 'Failed to fetch': '无法连接服务器,请检查网络后重试。', + 'TypeError: Failed to fetch': '无法连接服务器,请检查网络后重试。', + 'Network Error': '无法连接服务器,请检查网络后重试。', + 'NetworkError when attempting to fetch resource.': '无法连接服务器,请检查网络后重试。', + 'Load failed': '加载失败,请稍后重试。', + 'App unavailable, please check your app configurations.': '应用暂不可用,请检查应用配置。', + 'Agent has not been published. Please publish the Agent before using the web app.': '智能体尚未发布。请先发布后再使用网页应用。', + 'Please check if your Completion app mode matches the right API route.': '请确认文本生成应用的模式与接口路径一致。', + 'Please check if your app mode matches the right API route.': '请确认应用模式与接口路径一致。', + 'Please check if your Workflow app mode matches the right API route.': '请确认工作流应用的模式与接口路径一致。', + 'The conversation has ended. Please start a new conversation.': '这条对话已结束,请开始新的对话。', + 'No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.': '没有可用的模型供应商凭证。请前往「设置 → 模型供应商」填写凭证。', + 'Your quota for Dify Hosted OpenAI has been exhausted. Please go to Settings -> Model Provider to complete your own provider credentials.': '托管 OpenAI 的可用额度已用完。请前往「设置 → 模型供应商」填写自己的供应商凭证。', + 'Dify Hosted OpenAI trial currently not support the GPT-4 model.': '托管 OpenAI 试用暂不支持 GPT-4 模型。', + 'Completion request failed.': '文本生成请求失败。', + 'The \'More like this\' feature is disabled. Please refresh your page.': '「类似内容」功能未开启。请刷新页面。', + 'The \'Suggested Questions After Answer\' feature is disabled. Please refresh your page.': '「回答后推荐问题」功能未开启。请刷新页面。', + 'Please upload your audio.': '请上传音频。', + 'Audio size exceeded. {message}': '音频超出大小限制。', + 'Audio type not allowed.': '不允许上传该类型的音频。', + 'Provider not support speech to text.': '该供应商不支持语音转文字。', + 'Speech to text is disabled.': '语音转文字未开启。', + 'Web app authentication required.': '使用网页应用需要先登录。', + 'You do not have permission to access this web app.': '你没有访问该网页应用的权限。', + 'App not found.': '找不到该应用。', + 'Web app access service is unavailable.': '网页应用访问服务暂不可用。', + 'Rate Limit Error': '请求过于频繁。', + 'Too many form requests. Please try again later.': '表单提交过于频繁,请稍后再试。', + 'This feature requires a paid plan.': '此功能需要付费方案。', + 'Dify has been successfully installed. Please refresh the page or return to the dashboard homepage.': '系统已安装完成。请刷新页面或返回首页。', + 'Dify has not been initialized and installed yet. Please proceed with the initialization and installation process first.': '系统尚未初始化安装。请先完成初始化。', + 'Init validation has not been completed yet. Please proceed with the init validation process first.': '初始化校验尚未完成。请先完成校验。', + 'Init validation failed. Please check the password and try again.': '初始化校验失败。请核对密码后再试。', + 'Account not link tenant.': '账号尚未加入工作区。', + 'Auth Token is invalid or account already activated, please check again.': '验证令牌无效,或账号已激活,请再检查一次。', + 'Workspace not found, please contact system admin to invite you to join in a workspace.': '找不到工作区。请联系管理员邀请你加入。', + 'Unable to add member because the maximum workspace\'s member limit was exceeded': '已达到工作区成员上限,无法继续添加。', + 'Unable to create workspace because the maximum workspace limit was exceeded': '已达到工作区数量上限,无法继续创建。', + 'Unable to create account because the licensed seats limit was exceeded': '已达到授权席位上限,无法继续创建账号。', + 'Account is banned.': '该账号已被停用。', + 'Account not found.': '找不到该账号。', + 'The password does not satisfy the account password policy.': '密码不符合账号密码规则。', + 'Too many emails have been sent from this IP address recently. Please try again later.': '该 IP 近期发送的邮件过多,请稍后再试。', + 'Unauthorized and force logout.': '登录已失效,请重新登录。', + 'This email account has been deleted within the past 30 days and is temporarily unavailable for new account registration.': '该邮箱在过去 30 天内注销过,暂时不能用于注册新账号。', + 'This email domain has been suspended.': '该邮箱域名已被停用。', + 'Rate limit exceeded': '请求过于频繁。', + 'We couldn\'t verify your education status.': '无法核验教育身份。', + 'We couldn\'t activate your education discount.': '无法开通教育优惠。', + 'The API key limit has been reached.': '已达到 API 密钥数量上限。', + 'annotation_ids are required if the parameter is provided.': '传入该参数时必须提供标注编号。', + 'Trigger not found.': '找不到该触发器。', + 'Webhook trigger not found for this node.': '找不到该节点的 Webhook 触发器。', + 'Your quota for Dify Hosted Model Provider has been exhausted. Please go to Settings -> Model Provider to complete your own provider credentials.': '托管模型供应商的可用额度已用完。请前往「设置 → 模型供应商」填写自己的供应商凭证。', + 'Provider does not support text to speech.': '该供应商不支持文字转语音。', + 'Draft workflow need to be initialized.': '需要先初始化草稿工作流。', + 'Workflow graph might have been modified, please refresh and resubmit.': '工作流可能已被修改,请刷新后再提交。', + 'Tracing configuration not found.': '找不到追踪配置。', + 'A tracing configuration already exists for this provider.': '该供应商已有追踪配置。', + 'The tracing provider is not supported.': '不支持该追踪供应商。', + 'The tracing provider is not available in this deployment.': '当前部署不提供该追踪供应商。', + 'The tracing configuration is invalid.': '追踪配置无效。', + 'The tracing configuration could not be verified.': '无法校验追踪配置。', + 'The tracing configuration could not be processed.': '无法处理追踪配置。', + 'Need to add ids.': '需要添加编号。', + 'No active sandbox binding.': '没有正在使用的沙箱绑定。', + 'Sandbox inspector is unavailable.': '沙箱检查器暂不可用。', + 'Sandbox file download is unavailable.': '沙箱文件暂时无法下载。', + 'Agent backend is unreachable.': '无法连接智能体后端。', + 'no agent is bound for this app/node': '该应用或节点尚未绑定智能体。', + 'Tracing configuration changed. Refresh and try again.': '追踪配置已变化。请刷新后再试。', + 'The data-source API-key authentication provider is not supported.': '不支持该数据源的 API 密钥认证。', + 'The data-source API-key authentication credentials are invalid.': '数据源的 API 密钥凭证无效。', + 'The data-source provider rejected the API-key authentication credentials.': '数据源供应商拒绝了该 API 密钥凭证。', + 'The data-source API-key authentication provider is temporarily unavailable.': '数据源的 API 密钥认证暂时不可用。', + 'The email address is not valid.': '邮箱地址无效。', + 'This invitation was sent to another account. Please sign in with the invited account.': '该邀请发给了另一个账号。请使用受邀账号登录。', + 'The passwords do not match.': '两次输入的密码不一致。', + 'The token is invalid or has expired.': '令牌无效或已过期。', + 'Email code is invalid or expired.': '邮箱验证码无效或已过期。', + 'Email code verification is temporarily unavailable. Please try again later.': '邮箱验证码暂时无法校验,请稍后再试。', + 'The email or password is mismatched.': '邮箱或密码不正确。', + 'Invalid email or password.': '邮箱或密码不正确。', + 'Too many incorrect password attempts. Please try again later.': '密码错误次数过多,请稍后再试。', + 'Turnstile verification failed. Please try again.': '人机验证失败,请重试。', + 'Turnstile verification is temporarily unavailable. Please try again later.': '人机验证暂时不可用,请稍后再试。', + 'Too many failed password reset attempts. Please try again in 24 hours.': '重置密码失败次数过多,请 24 小时后再试。', + 'Too many failed email register attempts. Please try again in 24 hours.': '邮箱注册失败次数过多,请 24 小时后再试。', + 'Too many failed email change attempts. Please try again in 24 hours.': '更换邮箱失败次数过多,请 24 小时后再试。', + 'A user with this email already exists.': '该邮箱已被注册。', + 'An account with an equivalent email address already exists.': '已有使用相同邮箱的账号。', + 'Too many failed owner transfer attempts. Please try again in 24 hours.': '转让所有者失败次数过多,请 24 小时后再试。', + 'You are not the owner of the workspace.': '你不是该工作区的所有者。', + 'You cannot transfer ownership to yourself.': '不能把所有权转让给自己。', + 'The member is not in the workspace.': '该成员不在此工作区中。', + 'The current workspace has been archived.': '当前工作区已归档。', + 'New password and repeat password does not match.': '新密码与确认密码不一致。', + 'Current password is incorrect.': '当前密码不正确。', + 'Invalid invitation code.': '邀请码无效。', + 'Invitation code is required.': '请填写邀请码。', + 'The account has been initialized. Please refresh the page.': '账号已完成初始化。请刷新页面。', + 'The account has not been initialized yet. Please proceed with the initialization process first.': '账号尚未初始化。请先完成初始化。', + 'Invalid account deletion code.': '账号注销验证码无效。', + 'Invalid role.': '角色无效。', + 'Centrally managed IM bindings cannot be edited from a workspace.': '集中管理的即时通讯绑定不能在工作区里修改。', + 'Workspace IM overrides require centrally managed bindings.': '工作区覆盖即时通讯设置前,需要先有集中管理的绑定。', + 'Plugin operation failed.': '插件操作失败。', + 'Invalid skill request.': '技能请求无效。', + 'filename is required': '请填写文件名。', + 'Cannot operate on yourself.': '不能对自己执行该操作。', + 'Member not found.': '找不到该成员。', + 'Role already assigned.': '该角色已经分配。', + 'Invalid network access group request.': '网络访问组请求无效。', + 'Network access groups are not available for this workspace.': '此工作区不提供网络访问组。', + 'Network access group was not found.': '找不到该网络访问组。', + 'The network access resource changed. Refresh it and try again.': '网络访问设置已变化。请刷新后再试。', + 'An IP policy with this name already exists.': '已有同名的 IP 策略。', + 'This IP policy is still used by one or more apps.': '仍有应用在使用该 IP 策略。', + 'Your workspace role does not allow this network access operation.': '你的工作区角色不能执行该网络访问操作。', + 'Network access control is not supported for this app mode.': '该应用模式不支持网络访问控制。', + 'Some access points are not supported for this app.': '此应用不支持其中部分访问入口。', + 'A Channel is already configured for this kind.': '该类型已经配置了渠道。', + 'Channel not found.': '找不到该渠道。', + 'The Channel configuration was updated.': '渠道配置已更新。', + 'Explicit IM Channel replacement is required.': '需要明确替换即时通讯渠道。', + 'The dataset is still being initialized or indexing. Please wait a moment.': '知识库仍在初始化或建立索引,请稍候。', + 'One or more selected upgrade models are unavailable.': '所选的一个或多个升级模型不可用。', + 'The archived document is not editable.': '已归档的文档不能编辑。', + 'The dataset name already exists. Please modify your dataset name.': '知识库名称已存在,请修改名称。', + 'Invalid action.': '操作无效。', + 'Dataset access denied.': '没有访问该知识库的权限。', + 'The document has been processed. Please refresh the page or go to the document details.': '文档已处理完成。请刷新页面或查看文档详情。', + 'The document is being processed and cannot be edited.': '文档正在处理,暂时不能编辑。', + 'The metadata content is incorrect. Please check and verify.': '元数据内容不正确,请核对后再试。', + '{message}': '请求没有完成。', + 'Pipeline not found.': '找不到该流水线。', + 'Agent config version not found.': '找不到该智能体配置版本。', + 'The app was not found in this workspace.': '在此工作区中找不到该应用。', + 'The app is not available in this app library.': '应用库中没有该应用。', + 'The app list cursor is invalid. Refresh the list and try again.': '应用列表位置无效。请刷新列表后再试。', + 'The app access service is unavailable. Try again later.': '应用访问服务暂不可用,请稍后再试。', + 'The conversation was not found for this account and app.': '找不到该账号在此应用中的对话。', + 'A name is required when automatic naming is disabled.': '关闭自动命名后,需要填写名称。', + 'The message was not found for this account and app.': '找不到该账号在此应用中的消息。', + 'The message cursor is not in this conversation. Refresh the list and try again.': '这条对话中没有该消息位置。请刷新列表后再试。', + 'Not Completion App': '这不是文本生成应用。', + 'App mode is invalid.': '应用模式无效。', + 'Only support workflow app.': '仅支持工作流应用。', + 'Function Suggested questions after answer disabled.': '回答后推荐问题功能未开启。', + 'App access denied.': '没有访问该应用的权限。', + 'Recommended app not found.': '找不到推荐应用。', + 'The app preview site is unavailable.': '应用预览站暂不可用。', + 'The app preview owner is unavailable.': '应用预览所有者暂不可用。', + 'the app is not allowed to be trial.': '该应用不能试用。', + 'The user has exceeded the trial app limit.': '已超过可试用的应用数量。', + 'Trial app feature is not enabled.': '试用应用功能未开启。', + 'Agent Knowledge Base was not found.': '找不到智能体知识库。', + 'Agent Knowledge Base resource was not found.': '找不到智能体知识库中的资源。', + 'Agent Knowledge Base operation is not available.': '智能体知识库操作暂不可用。', + 'Agent Knowledge Base is unavailable.': '智能体知识库暂不可用。', + 'Agent Knowledge Base request timed out.': '智能体知识库请求超时。', + 'Agent Knowledge Base request is invalid.': '智能体知识库请求无效。', + 'Agent Knowledge Base operation is not allowed.': '不允许执行该智能体知识库操作。', + 'Agent Knowledge Base operation conflicts with the current resource state.': '智能体知识库操作与当前资源状态冲突。', + 'Agent Knowledge Base request is too large.': '智能体知识库请求过大。', + 'Agent Knowledge Base request was rejected.': '智能体知识库请求被拒绝。', + 'Agent Knowledge Base request rate limit exceeded.': '智能体知识库请求过于频繁。', + 'Rate limit exceeded for downloading compliance report.': '下载合规报告过于频繁。', + 'The compliance document was not found.': '找不到该合规文档。', + 'Your current plan does not allow downloading this compliance document.': '当前方案不能下载该合规文档。', + 'A previous request is still being processed. Please try again shortly.': '上一条请求仍在处理,请稍后再试。', + 'We couldn\'t complete this request. Please try again. If the problem persists, contact support.': '这次请求没有完成。请重试;如果仍然失败,请联系管理员。', + 'This operation is temporarily unavailable. Please try again later.': '该操作暂时不可用,请稍后再试。', + 'Subscription builder not initialized': '订阅配置尚未初始化。', + 'Please fill in all required credentials': '请填写所有必填凭证。', + 'Subscription builder not found': '找不到订阅配置。', + 'SSO protocol is not supported.': '不支持该单点登录协议。', + 'Verifying email failed': '邮箱验证失败。', + 'Web Audio API is not supported in this browser': '当前浏览器不支持网页音频。', + 'Audio element not found': '找不到音频。', + 'Missing plugin metadata for GitHub update': '缺少用于 GitHub 更新的插件信息。', + 'Invalid email format': '邮箱格式不正确。', + 'tag name is empty': '标签名称不能为空。', +} + +const ZH_PATTERNS: Array<{ pattern: RegExp, translate: (match: RegExpMatchArray) => string }> = [ + { + pattern: /^File size exceeded\. ?(.*)$/, + translate: match => match[1] ? `文件超出大小限制。${match[1]}` : '文件超出大小限制。', + }, + { + pattern: /^Audio size exceeded\. ?(.*)$/, + translate: match => match[1] ? `音频超出大小限制。${match[1]}` : '音频超出大小限制。', + }, + { + pattern: /^Knowledge indexing estimate failed: ?(.*)$/, + translate: match => `知识库索引估算失败:${match[1]}`, + }, + { + pattern: /^Create child chunk index failed: ?(.*)$/, + translate: match => `创建子分段索引失败:${match[1]}`, + }, + { + pattern: /^Delete child chunk index failed: ?(.*)$/, + translate: match => `删除子分段索引失败:${match[1]}`, + }, + { + pattern: /^Too many password reset emails have been sent\. Please try again in (.+) minutes\.?$/, + translate: match => `重置密码邮件发送过于频繁,请在 ${match[1]} 分钟后再试。`, + }, + { + pattern: /^Too many email register emails have been sent\. Please try again in (.+) minutes\.?$/, + translate: match => `注册邮件发送过于频繁,请在 ${match[1]} 分钟后再试。`, + }, + { + pattern: /^Too many email change emails have been sent\. Please try again in (.+) minutes\.?$/, + translate: match => `更换邮箱邮件发送过于频繁,请在 ${match[1]} 分钟后再试。`, + }, + { + pattern: /^Too many owner transfer emails have been sent\. Please try again in (.+) minutes\.?$/, + translate: match => `转让所有者邮件发送过于频繁,请在 ${match[1]} 分钟后再试。`, + }, + { + pattern: /^Too many login emails have been sent\. Please try again in (.+) minutes\.?$/, + translate: match => `登录邮件发送过于频繁,请在 ${match[1]} 分钟后再试。`, + }, + { + pattern: /^Too many account deletion emails have been sent\. Please try again in (.+) minutes\.?$/, + translate: match => `注销账号邮件发送过于频繁,请在 ${match[1]} 分钟后再试。`, + }, +] + +function readLocale(): string { + try { + const language = getI18n()?.language + if (language) + return language + } + catch { + // i18next is not ready during the first paint. + } + if (typeof document === 'undefined') + return '' + return Cookies.get(LOCALE_COOKIE_NAME) ?? '' +} + +export function isChineseLocale(locale?: string) { + return (locale ?? readLocale()).toLowerCase().startsWith('zh') +} + +export function localizeSystemMessage(message: string, locale?: string) { + if (!isChineseLocale(locale)) + return message + const normalized = message.replace(/\s+/g, ' ').trim() + const exact = ZH_MESSAGES[normalized] + if (exact) + return exact + for (const { pattern, translate } of ZH_PATTERNS) { + const match = pattern.exec(normalized) + if (match) + return translate(match) + } + return message +} diff --git a/demo-dify/dify/web/utils/official-link.ts b/demo-dify/dify/web/utils/official-link.ts new file mode 100644 index 00000000..4482716d --- /dev/null +++ b/demo-dify/dify/web/utils/official-link.ts @@ -0,0 +1,18 @@ +const OFFICIAL_HOST = /(^|\.)dify\.(ai|com)$/i + +export function isOfficialDifyUrl(value?: string | null): boolean { + const trimmed = value?.trim() ?? '' + if (!trimmed) return false + + const mailto = trimmed.match(/^mailto:([^?]+)/i) + if (mailto) { + const host = mailto[1]?.split('@').pop() ?? '' + return OFFICIAL_HOST.test(host) + } + + try { + return OFFICIAL_HOST.test(new URL(trimmed).hostname) + } catch { + return false + } +} diff --git a/demo-dify/dify/web/utils/visible-author.ts b/demo-dify/dify/web/utils/visible-author.ts new file mode 100644 index 00000000..4f78830e --- /dev/null +++ b/demo-dify/dify/web/utils/visible-author.ts @@ -0,0 +1,8 @@ +// Official plugin metadata still uses the upstream product name as the author. +// Local deployments hide that label and keep other authors visible. +export function visibleAuthorName(value?: string | null): string { + const text = value?.trim() ?? '' + if (!text) return '' + if (text.toLowerCase() === 'dify' || text.toLowerCase().startsWith('dify ')) return '' + return text +}