diff --git a/packages/core/client/src/css-variable/CSSVariableProvider.tsx b/packages/core/client/src/css-variable/CSSVariableProvider.tsx index de6912bf77..dfb35f7d42 100644 --- a/packages/core/client/src/css-variable/CSSVariableProvider.tsx +++ b/packages/core/client/src/css-variable/CSSVariableProvider.tsx @@ -46,6 +46,7 @@ export const CSSVariableProvider = ({ children }) => { document.body.style.setProperty('--colorBgScrollBarActive', colorBgScrollBarActive); document.body.style.setProperty('--colorSettings', token.colorSettings || defaultTheme.token.colorSettings); document.body.style.setProperty('--colorBgSettingsHover', token.colorBgSettingsHover); + document.body.style.setProperty('--colorTemplateBgSettingsHover', token.colorTemplateBgSettingsHover); document.body.style.setProperty('--colorBorderSettingsHover', token.colorBorderSettingsHover); // 设置登录页面的背景色 @@ -58,6 +59,7 @@ export const CSSVariableProvider = ({ children }) => { token.colorBgContainer, token.colorBgLayout, token.colorBgSettingsHover, + token.colorTemplateBgSettingsHover, token.colorBorderSettingsHover, token.colorInfoBg, token.colorInfoBorder, diff --git a/packages/core/client/src/global-theme/defaultTheme.ts b/packages/core/client/src/global-theme/defaultTheme.ts index 990958a4e0..eb5de459d5 100644 --- a/packages/core/client/src/global-theme/defaultTheme.ts +++ b/packages/core/client/src/global-theme/defaultTheme.ts @@ -24,6 +24,7 @@ const defaultTheme: ThemeConfig = { // UI 配置组件 colorSettings: '#F18B62', colorBgSettingsHover: 'rgba(241, 139, 98, 0.06)', + colorTemplateBgSettingsHover: 'rgba(98, 200, 241, 0.06)', // 默认为colorBgSettingsHover的互补色 colorBorderSettingsHover: 'rgba(241, 139, 98, 0.3)', // 动画相关 diff --git a/packages/core/client/src/global-theme/type.ts b/packages/core/client/src/global-theme/type.ts index d41b7ffee1..319cf01086 100644 --- a/packages/core/client/src/global-theme/type.ts +++ b/packages/core/client/src/global-theme/type.ts @@ -30,6 +30,8 @@ export interface CustomToken extends AliasToken { colorSettings: string; /** 鼠标悬浮时显示的背景色 */ colorBgSettingsHover: string; + /** 鼠标悬浮模板区块时显示的背景色 */ + colorTemplateBgSettingsHover: string; /** 鼠标悬浮时显示的边框色 */ colorBorderSettingsHover: string; diff --git a/packages/core/client/src/locale/en-US.json b/packages/core/client/src/locale/en-US.json index 01ddf4f08e..1699dc4b4e 100644 --- a/packages/core/client/src/locale/en-US.json +++ b/packages/core/client/src/locale/en-US.json @@ -164,6 +164,7 @@ "Chart type": "Chart type", "Chart config": "Chart config", "Templates": "Templates", + "Template": "Template", "Select template": "Select template", "Action logs": "Action logs", "Create template": "Create template", @@ -882,5 +883,7 @@ "Are you sure you want to hide this menu?": "Are you sure you want to hide this menu?", "After hiding, this menu will no longer appear in the menu bar. To show it again, you need to go to the route management page to configure it.": "After hiding, this menu will no longer appear in the menu bar. To show it again, you need to go to the route management page to configure it.", "If selected, the page will display Tab pages.": "If selected, the page will display Tab pages.", - "If selected, the route will be displayed in the menu.": "If selected, the route will be displayed in the menu." + "If selected, the route will be displayed in the menu.": "If selected, the route will be displayed in the menu.", + "Deprecated": "Deprecated", + "The following old template features have been deprecated and will be removed in next version.": "The following old template features have been deprecated and will be removed in next version." } diff --git a/packages/core/client/src/locale/es-ES.json b/packages/core/client/src/locale/es-ES.json index 328137f0e3..2bd4e25ad4 100644 --- a/packages/core/client/src/locale/es-ES.json +++ b/packages/core/client/src/locale/es-ES.json @@ -148,6 +148,7 @@ "Chart type": "Tipo del gráfico", "Chart config": "Configuración del gráfico", "Templates": "Plantillas", + "Template": "Plantilla", "Select template": "Seleccione plantilla", "Action logs": "Acción logs", "Create template": "Crear plantilla", @@ -799,5 +800,7 @@ "Are you sure you want to hide this menu?": "¿Estás seguro de que quieres ocultar este menú?", "After hiding, this menu will no longer appear in the menu bar. To show it again, you need to go to the route management page to configure it.": "Después de ocultar, este menú ya no aparecerá en la barra de menú. Para mostrarlo de nuevo, debe ir a la página de administración de rutas para configurarlo.", "If selected, the page will display Tab pages.": "Si se selecciona, la página mostrará páginas de pestañas.", - "If selected, the route will be displayed in the menu.": "Si se selecciona, la ruta se mostrará en el menú." + "If selected, the route will be displayed in the menu.": "Si se selecciona, la ruta se mostrará en el menú.", + "Deprecated": "Obsoleto", + "The following old template features have been deprecated and will be removed in next version.": "Las siguientes características de plantilla antigua han quedado obsoletas y se eliminarán en la próxima versión." } diff --git a/packages/core/client/src/locale/fr-FR.json b/packages/core/client/src/locale/fr-FR.json index 4342e0cca1..c8864c011d 100644 --- a/packages/core/client/src/locale/fr-FR.json +++ b/packages/core/client/src/locale/fr-FR.json @@ -159,6 +159,7 @@ "Chart type": "Type de graphique", "Chart config": "Configuration du graphique", "Templates": "Modèles", + "Template": "Modèle", "Select template": "Sélectionner un modèle", "Action logs": "Logs d'action", "Create template": "Créer un modèle", @@ -819,5 +820,7 @@ "Are you sure you want to hide this menu?": "Êtes-vous sûr de vouloir masquer ce menu ?", "After hiding, this menu will no longer appear in the menu bar. To show it again, you need to go to the route management page to configure it.": "Après avoir masqué, ce menu ne sera plus affiché dans la barre de menu. Pour le réafficher, vous devez aller à la page de gestion des routes pour le configurer.", "If selected, the page will display Tab pages.": "Si sélectionné, la page affichera des onglets.", - "If selected, the route will be displayed in the menu.": "Si sélectionné, la route sera affichée dans le menu." + "If selected, the route will be displayed in the menu.": "Si sélectionné, la route sera affichée dans le menu.", + "Deprecated": "Déprécié", + "The following old template features have been deprecated and will be removed in next version.": "Les fonctionnalités des anciens modèles ont été dépréciées et seront supprimées dans la prochaine version." } diff --git a/packages/core/client/src/locale/ja-JP.json b/packages/core/client/src/locale/ja-JP.json index 326f25aca1..4fd2c9053c 100644 --- a/packages/core/client/src/locale/ja-JP.json +++ b/packages/core/client/src/locale/ja-JP.json @@ -145,6 +145,7 @@ "Chart type": "チャートタイプ", "Chart config": "チャート設定", "Templates": "テンプレート", + "Template": "テンプレート", "Select template": "テンプレートを選択してください", "Action logs": "操作履歴", "Create template": "テンプレートを作成", @@ -1037,5 +1038,7 @@ "Are you sure you want to hide this menu?": "このメニューを非表示にしますか?", "After hiding, this menu will no longer appear in the menu bar. To show it again, you need to go to the route management page to configure it.": "非表示にすると、このメニューはメニューバーに表示されなくなります。再表示するには、ルート管理ページで設定する必要があります。", "If selected, the page will display Tab pages.": "選択されている場合、ページはタブページを表示します。", - "If selected, the route will be displayed in the menu.": "選択されている場合、ルートはメニューに表示されます。" + "If selected, the route will be displayed in the menu.": "選択されている場合、ルートはメニューに表示されます。", + "Deprecated": "非推奨", + "The following old template features have been deprecated and will be removed in next version.": "次の古いテンプレート機能は非推奨になり、次のバージョンで削除されます。" } diff --git a/packages/core/client/src/locale/ko-KR.json b/packages/core/client/src/locale/ko-KR.json index caf538a964..57b261ef57 100644 --- a/packages/core/client/src/locale/ko-KR.json +++ b/packages/core/client/src/locale/ko-KR.json @@ -183,6 +183,7 @@ "Chart type": "차트 유형", "Chart config": "차트 구성", "Templates": "템플릿", + "Template": "템플릿", "Select template": "템플릿 선택", "Action logs": "작업 로그", "Create template": "템플릿 생성", @@ -910,5 +911,7 @@ "Are you sure you want to hide this menu?": "이 메뉴를 숨기시겠습니까?", "After hiding, this menu will no longer appear in the menu bar. To show it again, you need to go to the route management page to configure it.": "숨기면 이 메뉴는 메뉴 바에 더 이상 표시되지 않습니다. 다시 표시하려면 라우트 관리 페이지에서 설정해야 합니다.", "If selected, the page will display Tab pages.": "선택되면 페이지는 탭 페이지를 표시합니다.", - "If selected, the route will be displayed in the menu.": "선택되면 라우트는 메뉴에 표시됩니다." + "If selected, the route will be displayed in the menu.": "선택되면 라우트는 메뉴에 표시됩니다.", + "Deprecated": "사용 중단됨", + "The following old template features have been deprecated and will be removed in next version.": "다음 오래된 템플릿 기능은 사용 중단되었으며 다음 버전에서 제거될 것입니다." } diff --git a/packages/core/client/src/locale/pt-BR.json b/packages/core/client/src/locale/pt-BR.json index 155f98f68f..83211216fa 100644 --- a/packages/core/client/src/locale/pt-BR.json +++ b/packages/core/client/src/locale/pt-BR.json @@ -112,6 +112,7 @@ "Chart type": "Tipo de gráfico", "Chart config": "Configuração do gráfico", "Templates": "Modelos", + "Template": "Modelo", "Select template": "Selecione um modelo", "Action logs": "Registros de ação", "Create template": "Criar modelo", @@ -776,5 +777,7 @@ "Are you sure you want to hide this menu?": "Tem certeza de que deseja ocultar este menu?", "After hiding, this menu will no longer appear in the menu bar. To show it again, you need to go to the route management page to configure it.": "Depois de ocultar, este menu não aparecerá mais na barra de menus. Para mostrar novamente, você precisa ir à página de gerenciamento de rotas para configurá-lo.", "If selected, the page will display Tab pages.": "Se selecionado, a página exibirá páginas de abas.", - "If selected, the route will be displayed in the menu.": "Se selecionado, a rota será exibida no menu." + "If selected, the route will be displayed in the menu.": "Se selecionado, a rota será exibida no menu.", + "Deprecated": "Descontinuado", + "The following old template features have been deprecated and will be removed in next version.": "As seguintes funcionalidades de modelo antigo foram descontinuadas e serão removidas na próxima versão." } diff --git a/packages/core/client/src/locale/ru-RU.json b/packages/core/client/src/locale/ru-RU.json index bf4f6775ce..01750eff7c 100644 --- a/packages/core/client/src/locale/ru-RU.json +++ b/packages/core/client/src/locale/ru-RU.json @@ -102,6 +102,7 @@ "Chart type": "Тип диаграммы", "Chart config": "Конфиг. диаграммы", "Templates": "Шаблоны", + "Template": "Шаблон", "Select template": "Выбрать шаблон", "Action logs": "Журналы действий", "Create template": "Создать шаблон", @@ -605,5 +606,7 @@ "Are you sure you want to hide this menu?": "Вы уверены, что хотите скрыть это меню?", "After hiding, this menu will no longer appear in the menu bar. To show it again, you need to go to the route management page to configure it.": "После скрытия этого меню он больше не будет отображаться в меню. Чтобы снова отобразить его, вам нужно будет перейти на страницу управления маршрутами и настроить его.", "If selected, the page will display Tab pages.": "Если выбран, страница будет отображать страницы с вкладками.", - "If selected, the route will be displayed in the menu.": "Если выбран, маршрут будет отображаться в меню." + "If selected, the route will be displayed in the menu.": "Если выбран, маршрут будет отображаться в меню.", + "Deprecated": "Устаревший", + "The following old template features have been deprecated and will be removed in next version.": "Следующие старые функции шаблонов устарели и будут удалены в следующей версии." } diff --git a/packages/core/client/src/locale/tr-TR.json b/packages/core/client/src/locale/tr-TR.json index 126267b0c8..2532479a2f 100644 --- a/packages/core/client/src/locale/tr-TR.json +++ b/packages/core/client/src/locale/tr-TR.json @@ -102,6 +102,7 @@ "Chart type": "Grafik türü", "Chart config": "Grafik yapılandırması", "Templates": "Şablonlar", + "Template": "Şablon", "Select template": "Şablon seç", "Action logs": "Eylem günlükleri", "Create template": "Şablon oluştur", @@ -603,5 +604,7 @@ "Are you sure you want to hide this menu?": "Bu menüyü gizlemek istediğinizden emin misiniz?", "After hiding, this menu will no longer appear in the menu bar. To show it again, you need to go to the route management page to configure it.": "Gizlendikten sonra, bu menü artık menü çubuğunda görünmeyecektir. Tekrar görüntülemek için, yönlendirme yönetimi sayfasına gidip onu yapılandırmanız gerekecektir.", "If selected, the page will display Tab pages.": "Seçildiğinde, sayfa Tab sayfalarını görüntüleyecektir.", - "If selected, the route will be displayed in the menu.": "Seçildiğinde, yol menüde görüntülenecektir." + "If selected, the route will be displayed in the menu.": "Seçildiğinde, yol menüde görüntülenecektir.", + "Deprecated": "Kullanımdan kaldırıldı", + "The following old template features have been deprecated and will be removed in next version.": "Aşağıdaki eski şablon özellikleri kullanımdan kaldırıldı ve gelecek sürümlerde kaldırılacaktır." } diff --git a/packages/core/client/src/locale/uk-UA.json b/packages/core/client/src/locale/uk-UA.json index bac2c81d1a..040e64841f 100644 --- a/packages/core/client/src/locale/uk-UA.json +++ b/packages/core/client/src/locale/uk-UA.json @@ -159,6 +159,7 @@ "Chart type": "Тип діаграми", "Chart config": "Налаштування діаграми", "Templates": "Шаблони", + "Template": "Шаблон", "Select template": "Вибрати шаблон", "Action logs": "Журнал дій", "Create template": "Створити шаблон", @@ -819,5 +820,7 @@ "Are you sure you want to hide this menu?": "Ви впевнені, що хочете приховати це меню?", "After hiding, this menu will no longer appear in the menu bar. To show it again, you need to go to the route management page to configure it.": "Після приховування цього меню він більше не з'явиться в меню. Щоб знову показати його, вам потрібно перейти на сторінку керування маршрутами і налаштувати його.", "If selected, the page will display Tab pages.": "Якщо вибрано, сторінка відобразить сторінки з вкладками.", - "If selected, the route will be displayed in the menu.": "Якщо вибрано, маршрут буде відображений в меню." + "If selected, the route will be displayed in the menu.": "Якщо вибрано, маршрут буде відображений в меню.", + "Deprecated": "Застаріло", + "The following old template features have been deprecated and will be removed in next version.": "Наступні старі функції шаблонів були застарілі і будуть видалені в наступній версії." } diff --git a/packages/core/client/src/locale/zh-CN.json b/packages/core/client/src/locale/zh-CN.json index c74fdb80d3..50cb78fc94 100644 --- a/packages/core/client/src/locale/zh-CN.json +++ b/packages/core/client/src/locale/zh-CN.json @@ -183,6 +183,7 @@ "Chart type": "图表类型", "Chart config": "图表配置", "Templates": "模板", + "Template": "模板", "Select template": "选择模板", "Action logs": "操作日志", "Create template": "创建模板", @@ -1078,5 +1079,7 @@ "Are you sure you want to hide this menu?": "你确定要隐藏这个菜单吗?", "After hiding, this menu will no longer appear in the menu bar. To show it again, you need to go to the route management page to configure it.": "隐藏后,这个菜单将不再出现在菜单栏中。要再次显示它,你需要到路由管理页面进行设置。", "If selected, the page will display Tab pages.": "如果选中,该页面将显示标签页。", - "If selected, the route will be displayed in the menu.": "如果选中,该路由将显示在菜单中。" + "If selected, the route will be displayed in the menu.": "如果选中,该路由将显示在菜单中。", + "Deprecated": "已弃用", + "The following old templates have been deprecated and will be removed in next version.": "以下旧的模板功能已弃用,将在下个版本移除。" } diff --git a/packages/core/client/src/locale/zh-TW.json b/packages/core/client/src/locale/zh-TW.json index 1d4361c0af..fe64fe55c6 100644 --- a/packages/core/client/src/locale/zh-TW.json +++ b/packages/core/client/src/locale/zh-TW.json @@ -183,6 +183,7 @@ "Chart type": "圖表型別", "Chart config": "圖表設定", "Templates": "模板", + "Template": "模板", "Select template": "選擇模板", "Action logs": "動作日誌", "Create template": "建立模板", @@ -910,6 +911,8 @@ "Are you sure you want to hide this menu?": "你確定要隱藏這個菜單嗎?", "After hiding, this menu will no longer appear in the menu bar. To show it again, you need to go to the route management page to configure it.": "隱藏後,這個菜單將不再出現在菜單欄中。要再次顯示它,你需要到路由管理頁面進行設置。", "If selected, the page will display Tab pages.": "如果選中,該頁面將顯示標籤頁。", - "If selected, the route will be displayed in the menu.": "如果選中,該路由將顯示在菜單中。" + "If selected, the route will be displayed in the menu.": "如果選中,該路由將顯示在菜單中。", + "Deprecated": "已棄用", + "The following old template features have been deprecated and will be removed in next version.": "以下舊的模板功能已棄用,將在下個版本移除。" } diff --git a/packages/core/client/src/modules/actions/__e2e__/submit/refreshData.test.ts b/packages/core/client/src/modules/actions/__e2e__/submit/refreshData.test.ts index a2667087fe..02cc55f49c 100644 --- a/packages/core/client/src/modules/actions/__e2e__/submit/refreshData.test.ts +++ b/packages/core/client/src/modules/actions/__e2e__/submit/refreshData.test.ts @@ -15,7 +15,7 @@ import { } from './templates'; test.describe('Submit: should refresh data after submit', () => { - test('submit in reference template block', async ({ page, mockPage, clearBlockTemplates, mockRecord }) => { + test.skip('submit in reference template block', async ({ page, mockPage, clearBlockTemplates, mockRecord }) => { const nocoPage = await mockPage(submitInReferenceTemplateBlock).waitForInit(); await mockRecord('collection', { nickname: 'abc' }); await nocoPage.goto(); diff --git a/packages/core/client/src/modules/blocks/data-blocks/details-multi/__e2e__/schemaSettings.test.ts b/packages/core/client/src/modules/blocks/data-blocks/details-multi/__e2e__/schemaSettings.test.ts index 8dfeba7b33..23faffa28b 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/details-multi/__e2e__/schemaSettings.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/details-multi/__e2e__/schemaSettings.test.ts @@ -33,7 +33,7 @@ test.describe('multi data details block schema settings', () => { 'Linkage rules', 'Set the data scope', 'Set default sorting rules', - 'Save as template', + // 'Save as template', 'Delete', ], }); diff --git a/packages/core/client/src/modules/blocks/data-blocks/details-single/__e2e__/schemaInitializer.test.ts b/packages/core/client/src/modules/blocks/data-blocks/details-single/__e2e__/schemaInitializer.test.ts index 990305dba6..ceb518239b 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/details-single/__e2e__/schemaInitializer.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/details-single/__e2e__/schemaInitializer.test.ts @@ -26,7 +26,7 @@ test.describe('where single data details block can be added', () => { }); // https://nocobase.height.app/T-3848/description - test('popup opened by clicking on the button for the relationship field', async ({ + test.skip('popup opened by clicking on the button for the relationship field', async ({ page, mockPage, mockRecord, diff --git a/packages/core/client/src/modules/blocks/data-blocks/details-single/__e2e__/schemaSettings.test.ts b/packages/core/client/src/modules/blocks/data-blocks/details-single/__e2e__/schemaSettings.test.ts index 4a9cbda2ca..99bed01c67 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/details-single/__e2e__/schemaSettings.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/details-single/__e2e__/schemaSettings.test.ts @@ -24,7 +24,7 @@ test.describe('single details block schema settings', () => { await page.getByLabel('block-item-CardItem-general-form').hover(); await page.getByLabel('designer-schema-settings-CardItem-FormV2.ReadPrettyDesigner-general').hover(); }, - supportedOptions: ['Edit block title', 'Linkage rules', 'Save as block template', 'Delete'], + supportedOptions: ['Edit block title', 'Linkage rules', 'Delete'], }); }); }); diff --git a/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/schemaSettings1.test.ts b/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/schemaSettings1.test.ts index a822b97936..99965cbaab 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/schemaSettings1.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/schemaSettings1.test.ts @@ -51,7 +51,8 @@ test.describe('creation form block schema settings', () => { await runExpect(); }); - test('Save as block template & convert reference to duplicate', async ({ page, mockPage }) => { + // deprecated + test.skip('Save as block template & convert reference to duplicate', async ({ page, mockPage }) => { await mockPage(oneTableBlockWithActionsAndFormBlocks).goto(); await page.getByRole('button', { name: 'Add new' }).click(); @@ -115,7 +116,7 @@ test.describe('creation form block schema settings', () => { await expect(page.getByLabel('block-item-CardItem-general-form')).not.toBeVisible(); }); - test('save as block Template', async ({ page, mockPage }) => { + test.skip('save as block Template', async ({ page, mockPage }) => { await mockPage(oneEmptyForm).goto(); // 先保存为模板 ------------------------------------------------------------------------ @@ -270,7 +271,7 @@ test.describe('creation form block schema settings', () => { }); }); - test('save block template & using block template', async ({ page, mockPage, clearBlockTemplates }) => { + test.skip('save block template & using block template', async ({ page, mockPage, clearBlockTemplates }) => { // 确保测试结束后已保存的模板会被清空 await clearBlockTemplates(); const nocoPage = await mockPage({ diff --git a/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/schemaSettings2.test.ts b/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/schemaSettings2.test.ts index 32be64963f..1f9cdfa55b 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/schemaSettings2.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/schemaSettings2.test.ts @@ -236,7 +236,7 @@ test.describe('linkage rules', () => { }); // https://nocobase.height.app/T-3806 - test('after save as block template', async ({ page, mockPage }) => { + test.skip('after save as block template', async ({ page, mockPage }) => { await mockPage(T3806).goto(); // 1. 一开始联动规则应该正常 diff --git a/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-edit/schemaInitializer.test.ts b/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-edit/schemaInitializer.test.ts index 40ea937b17..cf11928201 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-edit/schemaInitializer.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-edit/schemaInitializer.test.ts @@ -26,7 +26,7 @@ test.describe('where edit form block can be added', () => { }); // https://nocobase.height.app/T-3848/description - test('popup opened by clicking on the button for the relationship field', async ({ + test.skip('popup opened by clicking on the button for the relationship field', async ({ page, mockPage, mockRecord, diff --git a/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-edit/schemaSettings.test.ts b/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-edit/schemaSettings.test.ts index 10ea4f6aa6..787d818657 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-edit/schemaSettings.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-edit/schemaSettings.test.ts @@ -84,7 +84,7 @@ test.describe('edit form block schema settings', () => { await runExpect(); }); - test('Convert reference to duplicate & Save as block template', async ({ page, mockPage, mockRecord }) => { + test.skip('Convert reference to duplicate & Save as block template', async ({ page, mockPage, mockRecord }) => { const nocoPage = await mockPage(oneTableBlockWithActionsAndFormBlocks).waitForInit(); await mockRecord('general'); await nocoPage.goto(); diff --git a/packages/core/client/src/modules/blocks/data-blocks/form/hooks/useEditFormBlockDecoratorProps.ts b/packages/core/client/src/modules/blocks/data-blocks/form/hooks/useEditFormBlockDecoratorProps.ts index 5eeb123e45..56e28c10a6 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/form/hooks/useEditFormBlockDecoratorProps.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/form/hooks/useEditFormBlockDecoratorProps.ts @@ -12,9 +12,8 @@ import { useDetailsParentRecord } from '../../details-single/hooks/useDetailsDec import { useHiddenForInherit } from './useHiddenForInherit'; export function useEditFormBlockDecoratorProps(props) { - const params = useFormBlockParams(); + const params = useFormBlockParams(props); let parentRecord; - const { hidden } = useHiddenForInherit(props); // association 的值是固定不变的,所以这里可以使用 hooks @@ -31,6 +30,6 @@ export function useEditFormBlockDecoratorProps(props) { }; } -function useFormBlockParams() { - return useParamsFromRecord(); +function useFormBlockParams(props) { + return useParamsFromRecord(props); } diff --git a/packages/core/client/src/modules/blocks/data-blocks/grid-card/__e2e__/schemaSettings.test.ts b/packages/core/client/src/modules/blocks/data-blocks/grid-card/__e2e__/schemaSettings.test.ts index c9547186ba..fec8fa7ba9 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/grid-card/__e2e__/schemaSettings.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/grid-card/__e2e__/schemaSettings.test.ts @@ -25,7 +25,7 @@ test.describe('grid card block schema settings', () => { 'Set the data scope', 'Set default sorting rules', 'Records per page', - 'Save as template', + // 'Save as template', 'Delete', ], }); diff --git a/packages/core/client/src/modules/blocks/data-blocks/list/__e2e__/schemaSettings.test.ts b/packages/core/client/src/modules/blocks/data-blocks/list/__e2e__/schemaSettings.test.ts index 1bb977926e..1561b015c7 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/list/__e2e__/schemaSettings.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/list/__e2e__/schemaSettings.test.ts @@ -24,7 +24,7 @@ test.describe('list block schema settings', () => { 'Set the data scope', 'Set default sorting rules', 'Records per page', - 'Save as template', + // 'Save as template', 'Delete', ], }); diff --git a/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/blockTemplate.test.ts b/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/blockTemplate.test.ts index 57837da786..bfdacbaac0 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/blockTemplate.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/blockTemplate.test.ts @@ -10,7 +10,7 @@ import { expect, test } from '@nocobase/test/e2e'; import { ordinaryBlockTemplatesCannotBeUsedToCreateAssociationBlocksAndViceVersa } from './templatesOfBug'; -test.describe('block template', () => { +test.skip('block template', () => { test('Ordinary block templates cannot be used to create association blocks, and vice versa', async ({ page, mockPage, diff --git a/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaSettings1.test.ts b/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaSettings1.test.ts index 39ae0df88d..f0272c2a6c 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaSettings1.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaSettings1.test.ts @@ -34,7 +34,7 @@ test.describe('table block schema settings', () => { 'Set the data scope', 'Records per page', 'Connect data blocks', - 'Save as template', + // 'Save as template', 'Delete', ], }); diff --git a/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaSettings2.test.ts b/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaSettings2.test.ts index 7e3ae3d6a4..a74a136d5b 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaSettings2.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaSettings2.test.ts @@ -9,8 +9,8 @@ import { expect, test } from '@nocobase/test/e2e'; -test.describe('save as template', () => { - test('save as template, then delete it', async ({ page, mockPage, clearBlockTemplates }) => { +test.skip('save as template', () => { + test.skip('save as template, then delete it', async ({ page, mockPage, clearBlockTemplates }) => { // 1. 创建一个区块,然后保存为模板 await mockPage().goto(); await page.getByLabel('schema-initializer-Grid-page:').hover(); diff --git a/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/tree/schemaSettings.test.ts b/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/tree/schemaSettings.test.ts index 7092c2c685..e2c17c112b 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/tree/schemaSettings.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/tree/schemaSettings.test.ts @@ -25,7 +25,7 @@ test.describe('tree table block schema settings', () => { 'Set default sorting rules', 'Records per page', 'Connect data blocks', - 'Save as template', + // 'Save as template', 'Delete', ], }); diff --git a/packages/core/client/src/modules/blocks/filter-blocks/collapse/__e2e__/schemaSettings.test.ts b/packages/core/client/src/modules/blocks/filter-blocks/collapse/__e2e__/schemaSettings.test.ts index 7092bd15cc..5bfbfa7818 100644 --- a/packages/core/client/src/modules/blocks/filter-blocks/collapse/__e2e__/schemaSettings.test.ts +++ b/packages/core/client/src/modules/blocks/filter-blocks/collapse/__e2e__/schemaSettings.test.ts @@ -25,7 +25,7 @@ test.describe('collapse schema settings', () => { await page.getByLabel('block-item-CardItem-general-filter-collapse').hover(); await page.getByLabel('designer-schema-settings-CardItem-AssociationFilter.BlockDesigner-general').hover(); }, - supportedOptions: ['Edit block title', 'Save as template', 'Connect data blocks', 'Delete'], + supportedOptions: ['Edit block title', 'Connect data blocks', 'Delete'], }); }); diff --git a/packages/core/client/src/modules/blocks/filter-blocks/form/__e2e__/schemaSettings.test.ts b/packages/core/client/src/modules/blocks/filter-blocks/form/__e2e__/schemaSettings.test.ts index 1b0fc57a40..1e1d82959b 100644 --- a/packages/core/client/src/modules/blocks/filter-blocks/form/__e2e__/schemaSettings.test.ts +++ b/packages/core/client/src/modules/blocks/filter-blocks/form/__e2e__/schemaSettings.test.ts @@ -28,7 +28,7 @@ test.describe('filter block schema settings', () => { }, supportedOptions: [ 'Edit block title', - 'Save as block template', + // 'Save as block template', 'Linkage rules', 'Connect data blocks', 'Delete', @@ -37,7 +37,7 @@ test.describe('filter block schema settings', () => { }); test.describe('connect data blocks', () => { - test('connecting two blocks of the same collection', async ({ + test.skip('connecting two blocks of the same collection', async ({ page, mockPage, mockRecords, diff --git a/packages/core/client/src/pm/index.tsx b/packages/core/client/src/pm/index.tsx index 06cb7133c0..2a33621e53 100644 --- a/packages/core/client/src/pm/index.tsx +++ b/packages/core/client/src/pm/index.tsx @@ -35,12 +35,14 @@ export class PMPlugin extends Plugin { // Component: ACLPane, // aclSnippet: 'pm.acl.roles', // }); - this.app.pluginSettingsManager.add('ui-schema-storage', { - title: '{{t("Block templates")}}', - icon: 'LayoutOutlined', - Component: BlockTemplatesPane, - aclSnippet: 'pm.ui-schema-storage.block-templates', - }); + + // Replaced by plugin-block-template + // this.app.pluginSettingsManager.add('ui-schema-storage', { + // title: '{{t("Block templates")}}', + // icon: 'LayoutOutlined', + // Component: BlockTemplatesPane, + // aclSnippet: 'pm.ui-schema-storage.block-templates', + // }); this.app.pluginSettingsManager.add('system-settings', { icon: 'SettingOutlined', title: '{{t("System settings")}}', diff --git a/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx b/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx index 63e758f4fb..ba020e71f3 100644 --- a/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx +++ b/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx @@ -167,6 +167,13 @@ export function AssignedFieldValues() { 'x-component': 'Grid', 'x-initializer': 'assignFieldValuesForm:configureFields', }; + if (fieldSchema['x-template-uid']) { + initialSchema['x-template-root-ref'] = { + 'x-template-uid': fieldSchema['x-template-uid'], + 'x-path': 'x-action-settings.schemaUid', + }; + } + const tips = { 'customize:update': t( 'After clicking the custom button, the following fields of the current record will be saved according to the following form.', diff --git a/packages/core/client/src/schema-component/antd/action/Action.style.ts b/packages/core/client/src/schema-component/antd/action/Action.style.ts index ccf047cf03..14f991d228 100644 --- a/packages/core/client/src/schema-component/antd/action/Action.style.ts +++ b/packages/core/client/src/schema-component/antd/action/Action.style.ts @@ -34,6 +34,9 @@ const useStyles = genStyleHook('nb-action', (token) => { background: 'var(--colorBgSettingsHover)', border: '0', pointerEvents: 'none', + '&.nb-in-template': { + background: 'var(--colorTemplateBgSettingsHover)', + }, '> .general-schema-designer-icons': { position: 'absolute', right: '2px', diff --git a/packages/core/client/src/schema-component/antd/association-field/InternalViewer.tsx b/packages/core/client/src/schema-component/antd/association-field/InternalViewer.tsx index d58e19c3dd..3611a77391 100644 --- a/packages/core/client/src/schema-component/antd/association-field/InternalViewer.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/InternalViewer.tsx @@ -13,7 +13,14 @@ import _ from 'lodash'; import React, { FC, Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useDesignable, usePopupSettings } from '../../'; import { WithoutTableFieldResource } from '../../../block-provider'; -import { CollectionRecordProvider, useCollectionManager, useCollectionRecordData } from '../../../data-source'; +import { + CollectionRecordProvider, + DataBlockProvider, + useAssociationName, + useCollection, + useCollectionManager, + useCollectionRecordData, +} from '../../../data-source'; import { NocoBaseRecursionField } from '../../../formily/NocoBaseRecursionField'; import { useOpenModeContext } from '../../../modules/popup/OpenModeProvider'; import { VariablePopupRecordProvider } from '../../../modules/variable/variablesProvider/VariablePopupRecordProvider'; @@ -278,12 +285,14 @@ export const ReadPrettyInternalViewer: React.FC = const field = useField(); const [visible, setVisible] = useState(false); const { options: collectionField } = useAssociationFieldContext(); + const associationName = useAssociationName(); const { visibleWithURL, setVisibleWithURL } = usePopupUtils(); const [btnHover, setBtnHover] = useState(!!visibleWithURL); const { defaultOpenMode } = useOpenModeContext(); const parentRecordData = useCollectionRecordData(); const [recordData, setRecordData] = useState(null); const { isPopupVisibleControlledByURL } = usePopupSettings(); + const collection = useCollection(); const onClickItem = useCallback((props: { recordData: any }) => { setRecordData(props.recordData); @@ -329,14 +338,24 @@ export const ReadPrettyInternalViewer: React.FC = } return ( - - {/* The recordData here is only provided when the popup is opened, not the current row record */} - - - - - - + + + {/* The recordData here is only provided when the popup is opened, not the current row record */} + + + + + + + ); }; diff --git a/packages/core/client/src/schema-component/antd/association-field/Nester.tsx b/packages/core/client/src/schema-component/antd/association-field/Nester.tsx index 0b5f1a59e2..2d86a2eee1 100644 --- a/packages/core/client/src/schema-component/antd/association-field/Nester.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/Nester.tsx @@ -255,7 +255,7 @@ const ToManyNester = observer( return (
- {!field.readPretty && allowed && ( + {!field.readPretty && allowed && (!fieldSchema['x-template-uid'] || index > 0) && ( { expect(container).toMatchInlineSnapshot(`