feat: keep reference templates feature (#6743)

* feat: be able to create reference template

* chore: update template title

* fix: template menu position inconsitant

* chore: add reference templates into block template management view

* fix: menu not correct

* fix: incorrect label

* chore: remove useless component

* fix: build error

* fix: incorrect translate

* fix: incorrect  translate tab [skip ci]

* chore: remove edit icon[skip ci]

* fix: e2e tests failing
This commit is contained in:
gchust 2025-04-24 23:05:12 +08:00 committed by GitHub
parent 5b0b208515
commit b923d89fa0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
31 changed files with 284 additions and 278 deletions

View File

@ -500,7 +500,8 @@
"Turn pages": "Seiten umblättern", "Turn pages": "Seiten umblättern",
"Others": "Andere", "Others": "Andere",
"Other records": "Andere Datensätze", "Other records": "Andere Datensätze",
"Save as template": "Als Vorlage speichern", "Save as reference template": "Als Referenzvorlage speichern",
"Save as inherited template": "Als vererbte Vorlage speichern",
"Save as block template": "Als Blockvorlage speichern", "Save as block template": "Als Blockvorlage speichern",
"Block templates": "Blockvorlagen", "Block templates": "Blockvorlagen",
"Block template": "Blockvorlage", "Block template": "Blockvorlage",
@ -589,6 +590,7 @@
"Blank block": "Leerer Block", "Blank block": "Leerer Block",
"Duplicate template": "Vorlage duplizieren", "Duplicate template": "Vorlage duplizieren",
"Reference template": "Referenzvorlage", "Reference template": "Referenzvorlage",
"Inherited template": "Vererbte Vorlage",
"Create calendar block": "Kalenderblock erstellen", "Create calendar block": "Kalenderblock erstellen",
"Create kanban block": "Kanban-Block erstellen", "Create kanban block": "Kanban-Block erstellen",
"Grouping field": "Gruppierungsfeld", "Grouping field": "Gruppierungsfeld",

View File

@ -505,7 +505,7 @@
"Save as block template": "Save as block template", "Save as block template": "Save as block template",
"Block templates": "Block templates", "Block templates": "Block templates",
"Block template": "Block template", "Block template": "Block template",
"Convert reference to duplicate": "Convert reference to duplicate", "Convert template to duplicate": "Convert template to duplicate",
"Template name": "Template name", "Template name": "Template name",
"Block type": "Block type", "Block type": "Block type",
"No blocks to connect": "No blocks to connect", "No blocks to connect": "No blocks to connect",
@ -590,6 +590,7 @@
"Blank block": "Blank block", "Blank block": "Blank block",
"Duplicate template": "Duplicate template", "Duplicate template": "Duplicate template",
"Reference template": "Reference template", "Reference template": "Reference template",
"Inherited template": "Inherited template",
"Create calendar block": "Create calendar block", "Create calendar block": "Create calendar block",
"Create kanban block": "Create kanban block", "Create kanban block": "Create kanban block",
"Grouping field": "Grouping field", "Grouping field": "Grouping field",
@ -889,7 +890,6 @@
"No pages yet, please configure first": "No pages yet, please configure first", "No pages yet, please configure first": "No pages yet, please configure first",
"Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode", "Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode",
"Deprecated": "Deprecated", "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.",
"Full permissions": "Full permissions", "Full permissions": "Full permissions",
"Refresh data blocks": "Refresh data blocks", "Refresh data blocks": "Refresh data blocks",
"Select data blocks to refresh": "Select data blocks to refresh", "Select data blocks to refresh": "Select data blocks to refresh",

View File

@ -470,7 +470,8 @@
"Turn pages": "Pasar páginas", "Turn pages": "Pasar páginas",
"Others": "Otros", "Others": "Otros",
"Other records": "Otros registros", "Other records": "Otros registros",
"Save as template": "Guardar como plantilla", "Save as reference template": "Guardar como plantilla de referencia",
"Save as inherited template": "Guardar como plantilla heredada",
"Save as block template": "Guardar como plantilla de bloque", "Save as block template": "Guardar como plantilla de bloque",
"Block templates": "Bloquear plantillas", "Block templates": "Bloquear plantillas",
"Block template": "Plantilla de bloque", "Block template": "Plantilla de bloque",
@ -560,6 +561,7 @@
"Blank block": "Bloque en blanco", "Blank block": "Bloque en blanco",
"Duplicate template": "Duplicar plantilla", "Duplicate template": "Duplicar plantilla",
"Reference template": "Plantilla de referencia", "Reference template": "Plantilla de referencia",
"Inherited template": "Plantilla heredada",
"Create calendar block": "Crear bloque de calendario", "Create calendar block": "Crear bloque de calendario",
"Create kanban block": "Crear bloque kanban", "Create kanban block": "Crear bloque kanban",
"Grouping field": "Campo de agrupación", "Grouping field": "Campo de agrupación",
@ -806,7 +808,6 @@
"No pages yet, please configure first": "Aún no hay páginas, por favor configura primero", "No pages yet, please configure first": "Aún no hay páginas, por favor configura primero",
"Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "Haga clic en el icono \"Editor de UI\" en la esquina superior derecha para entrar en el modo de Editor de UI.", "Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "Haga clic en el icono \"Editor de UI\" en la esquina superior derecha para entrar en el modo de Editor de UI.",
"Deprecated": "Obsoleto", "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.",
"Full permissions": "Todos los derechos", "Full permissions": "Todos los derechos",
"Refresh data blocks": "Actualizar bloques de datos", "Refresh data blocks": "Actualizar bloques de datos",
"Select data blocks to refresh": "Actualizar bloques de datos", "Select data blocks to refresh": "Actualizar bloques de datos",

View File

@ -485,7 +485,8 @@
"Turn pages": "Tourner les pages", "Turn pages": "Tourner les pages",
"Others": "Autres", "Others": "Autres",
"Other records": "Autres enregistrements", "Other records": "Autres enregistrements",
"Save as template": "Enregistrer en tant que modèle", "Save as reference template": "Enregistrer en tant que modèle de référence",
"Save as inherited template": "Enregistrer en tant que modèle hérité",
"Save as block template": "Enregistrer en tant que modèle de bloc", "Save as block template": "Enregistrer en tant que modèle de bloc",
"Block templates": "Modèles de bloc", "Block templates": "Modèles de bloc",
"Block template": "Modèle de bloc", "Block template": "Modèle de bloc",
@ -573,6 +574,7 @@
"Blank block": "Bloc vierge", "Blank block": "Bloc vierge",
"Duplicate template": "Dupliquer le modèle", "Duplicate template": "Dupliquer le modèle",
"Reference template": "Référencer le modèle", "Reference template": "Référencer le modèle",
"Inherited template": "Modèle hérité",
"Create calendar block": "Créer un bloc de calendrier", "Create calendar block": "Créer un bloc de calendrier",
"Create kanban block": "Créer un bloc kanban", "Create kanban block": "Créer un bloc kanban",
"Grouping field": "Champ de regroupement", "Grouping field": "Champ de regroupement",
@ -826,7 +828,6 @@
"No pages yet, please configure first": "Pas encore de pages, veuillez configurer d'abord", "No pages yet, please configure first": "Pas encore de pages, veuillez configurer d'abord",
"Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "Cliquez sur l'icône \"Éditeur d'interface utilisateur\" dans le coin supérieur droit pour entrer en mode Éditeur d'interface utilisateur", "Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "Cliquez sur l'icône \"Éditeur d'interface utilisateur\" dans le coin supérieur droit pour entrer en mode Éditeur d'interface utilisateur",
"Deprecated": "Déprécié", "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.",
"Full permissions": "Tous les droits", "Full permissions": "Tous les droits",
"Refresh data blocks": "Actualiser les blocs de données", "Refresh data blocks": "Actualiser les blocs de données",
"Select data blocks to refresh": "Actualiser les blocs de données", "Select data blocks to refresh": "Actualiser les blocs de données",

View File

@ -494,7 +494,8 @@
"Turn pages": "Volta pagine", "Turn pages": "Volta pagine",
"Others": "Altri", "Others": "Altri",
"Other records": "Altri record", "Other records": "Altri record",
"Save as template": "Salva come modello", "Save as reference template": "Salva come modello di riferimento",
"Save as inherited template": "Salva come modello ereditato",
"Save as block template": "Salva come modello blocco", "Save as block template": "Salva come modello blocco",
"Block templates": "Modelli blocco", "Block templates": "Modelli blocco",
"Block template": "Modello blocco", "Block template": "Modello blocco",
@ -580,6 +581,7 @@
"Blank block": "Blocco vuoto", "Blank block": "Blocco vuoto",
"Duplicate template": "Modello duplicato", "Duplicate template": "Modello duplicato",
"Reference template": "Modello di riferimento", "Reference template": "Modello di riferimento",
"Inherited template": "Modello ereditato",
"Create calendar block": "Crea blocco calendario", "Create calendar block": "Crea blocco calendario",
"Create kanban block": "Crea blocco kanban", "Create kanban block": "Crea blocco kanban",
"Grouping field": "Campo di raggruppamento", "Grouping field": "Campo di raggruppamento",

View File

@ -397,7 +397,8 @@
"Turn pages": "ページをめくる", "Turn pages": "ページをめくる",
"Others": "その他", "Others": "その他",
"Other records": "他のレコード", "Other records": "他のレコード",
"Save as template": "テンプレートとして保存", "Save as reference template": "参照テンプレートとして保存",
"Save as inherited template": "継承テンプレートとして保存",
"Save as block template": "ブロックテンプレートとして保存", "Save as block template": "ブロックテンプレートとして保存",
"Block templates": "ブロックテンプレート", "Block templates": "ブロックテンプレート",
"Block template": "ブロックテンプレート", "Block template": "ブロックテンプレート",
@ -472,6 +473,7 @@
"Blank block": "空のブロック", "Blank block": "空のブロック",
"Duplicate template": "テンプレートをコピー", "Duplicate template": "テンプレートをコピー",
"Reference template": "テンプレートを参照", "Reference template": "テンプレートを参照",
"Inherited template": "継承テンプレート",
"Create calendar block": "カレンダーブロックの作成", "Create calendar block": "カレンダーブロックの作成",
"Create kanban block": "かんばんブロックの作成", "Create kanban block": "かんばんブロックの作成",
"Grouping field": "グループフィールド", "Grouping field": "グループフィールド",
@ -1044,7 +1046,6 @@
"No pages yet, please configure first": "まだページがありません。最初に設定してください", "No pages yet, please configure first": "まだページがありません。最初に設定してください",
"Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "ユーザーインターフェースエディターモードに入るには、右上隅の「UIエディタ」アイコンをクリックしてください", "Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "ユーザーインターフェースエディターモードに入るには、右上隅の「UIエディタ」アイコンをクリックしてください",
"Deprecated": "非推奨", "Deprecated": "非推奨",
"The following old template features have been deprecated and will be removed in next version.": "次の古いテンプレート機能は非推奨になり、次のバージョンで削除されます。",
"Full permissions": "すべての権限", "Full permissions": "すべての権限",
"Refresh data blocks": "データブロックを更新", "Refresh data blocks": "データブロックを更新",
"Select data blocks to refresh": "データブロックを選択して更新", "Select data blocks to refresh": "データブロックを選択して更新",

View File

@ -517,7 +517,8 @@
"Turn pages": "페이지 넘김", "Turn pages": "페이지 넘김",
"Others": "기타", "Others": "기타",
"Other records": "기타 레코드", "Other records": "기타 레코드",
"Save as template": "템플릿으로 저장", "Save as reference template": "참조 템플릿으로 저장",
"Save as inherited template": "상속 템플릿으로 저장",
"Save as block template": "블록 템플릿으로 저장", "Save as block template": "블록 템플릿으로 저장",
"Block templates": "블록 템플릿", "Block templates": "블록 템플릿",
"Block template": "블록 템플릿", "Block template": "블록 템플릿",
@ -601,6 +602,7 @@
"Blank block": "빈 블록", "Blank block": "빈 블록",
"Duplicate template": "템플릿 복제", "Duplicate template": "템플릿 복제",
"Reference template": "참조 템플릿", "Reference template": "참조 템플릿",
"Inherited template": "상속 템플릿",
"Create calendar block": "캘린더 블록 생성", "Create calendar block": "캘린더 블록 생성",
"Create kanban block": "칸반 블록 생성", "Create kanban block": "칸반 블록 생성",
"Grouping field": "그루핑 필드", "Grouping field": "그루핑 필드",
@ -917,7 +919,6 @@
"No pages yet, please configure first": "아직 페이지가 없습니다. 먼저 설정하십시오", "No pages yet, please configure first": "아직 페이지가 없습니다. 먼저 설정하십시오",
"Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "사용자 인터페이스 편집기 모드에 들어가려면 오른쪽 상단의 \"UI 편집기\" 아이콘을 클릭하십시오", "Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "사용자 인터페이스 편집기 모드에 들어가려면 오른쪽 상단의 \"UI 편집기\" 아이콘을 클릭하십시오",
"Deprecated": "사용 중단됨", "Deprecated": "사용 중단됨",
"The following old template features have been deprecated and will be removed in next version.": "다음 오래된 템플릿 기능은 사용 중단되었으며 다음 버전에서 제거될 것입니다.",
"Full permissions": "모든 권한", "Full permissions": "모든 권한",
"Refresh data blocks": "데이터 블록 새로 고침", "Refresh data blocks": "데이터 블록 새로 고침",
"Select data blocks to refresh": "데이터 블록을 선택하여 새로 고침", "Select data blocks to refresh": "데이터 블록을 선택하여 새로 고침",

View File

@ -504,7 +504,8 @@
"Turn pages": "Pagina's omslaan", "Turn pages": "Pagina's omslaan",
"Others": "Overigen", "Others": "Overigen",
"Other records": "Andere records", "Other records": "Andere records",
"Save as template": "Opslaan als sjabloon", "Save as reference template": "Opslaan als referentiesjabloon",
"Save as inherited template": "Opslaan als overerfde sjabloon",
"Save as block template": "Opslaan als bloksjabloon", "Save as block template": "Opslaan als bloksjabloon",
"Block templates": "Bloksjablonen", "Block templates": "Bloksjablonen",
"Block template": "Bloksjabloon", "Block template": "Bloksjabloon",
@ -593,6 +594,7 @@
"Blank block": "Leeg blok", "Blank block": "Leeg blok",
"Duplicate template": "Sjabloon dupliceren", "Duplicate template": "Sjabloon dupliceren",
"Reference template": "Sjabloon refereren", "Reference template": "Sjabloon refereren",
"Inherited template": "Overerfde sjabloon",
"Create calendar block": "Kalenderblok maken", "Create calendar block": "Kalenderblok maken",
"Create kanban block": "Kanbanblok maken", "Create kanban block": "Kanbanblok maken",
"Grouping field": "Groepeer veld", "Grouping field": "Groepeer veld",

View File

@ -433,7 +433,8 @@
"Turn pages": "Virar páginas", "Turn pages": "Virar páginas",
"Others": "Outros", "Others": "Outros",
"Other records": "Outros registros", "Other records": "Outros registros",
"Save as template": "Salvar como modelo", "Save as reference template": "Salvar como modelo de referência",
"Save as inherited template": "Salvar como modelo herdado",
"Save as block template": "Salvar como modelo de bloco", "Save as block template": "Salvar como modelo de bloco",
"Block templates": "Modelos de bloco", "Block templates": "Modelos de bloco",
"Block template": "Modelo de bloco", "Block template": "Modelo de bloco",
@ -525,6 +526,7 @@
"Blank block": "Bloco em branco", "Blank block": "Bloco em branco",
"Duplicate template": "Duplicar modelo", "Duplicate template": "Duplicar modelo",
"Reference template": "Modelo de referência", "Reference template": "Modelo de referência",
"Inherited template": "Modelo herdado",
"Create calendar block": "Criar bloco de calendário", "Create calendar block": "Criar bloco de calendário",
"Create kanban block": "Criar bloco Kanban", "Create kanban block": "Criar bloco Kanban",
"Grouping field": "Campo de agrupamento", "Grouping field": "Campo de agrupamento",
@ -781,7 +783,6 @@
"Are you sure you want to hide this tab?": "Tem certeza de que deseja ocultar esta guia?", "Are you sure you want to hide this tab?": "Tem certeza de que deseja ocultar esta guia?",
"After hiding, this tab will no longer appear in the tab bar. To show it again, you need to go to the route management page to set it.": "Depois de ocultar, esta guia não aparecerá mais na barra de guias. Para mostrá-la novamente, você precisa ir à página de gerenciamento de rotas para configurá-la.", "After hiding, this tab will no longer appear in the tab bar. To show it again, you need to go to the route management page to set it.": "Depois de ocultar, esta guia não aparecerá mais na barra de guias. Para mostrá-la novamente, você precisa ir à página de gerenciamento de rotas para configurá-la.",
"Deprecated": "Descontinuado", "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.",
"Full permissions": "Todas as permissões", "Full permissions": "Todas as permissões",
"No pages yet, please configure first": "Ainda não há páginas, por favor configure primeiro", "No pages yet, please configure first": "Ainda não há páginas, por favor configure primeiro",
"Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "Cliquez sur l'icône \"Éditeur d'interface utilisateur\" dans le coin supérieur droit pour entrer en mode Éditeur d'interface utilisateur", "Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "Cliquez sur l'icône \"Éditeur d'interface utilisateur\" dans le coin supérieur droit pour entrer en mode Éditeur d'interface utilisateur",

View File

@ -337,7 +337,8 @@
"Turn pages": "Перелистывать страницы", "Turn pages": "Перелистывать страницы",
"Others": "Другие", "Others": "Другие",
"Other records": "Другие записи", "Other records": "Другие записи",
"Save as template": "Сохранить как шаблон", "Save as reference template": "Сохранить как шаблон ссылки",
"Save as inherited template": "Сохранить как шаблон наследования",
"Save as block template": "Сохранить как шаблон Блока", "Save as block template": "Сохранить как шаблон Блока",
"Block templates": "Шаблоны блоков", "Block templates": "Шаблоны блоков",
"Convert reference to duplicate": "Преобразовать ссылку в дубликат", "Convert reference to duplicate": "Преобразовать ссылку в дубликат",
@ -411,6 +412,7 @@
"Blank block": "Пустой блок", "Blank block": "Пустой блок",
"Duplicate template": "Дублировать шаблон", "Duplicate template": "Дублировать шаблон",
"Reference template": "Справочный шаблон", "Reference template": "Справочный шаблон",
"Inherited template": "Наследуемый шаблон",
"Create calendar block": "Создать блок календаря", "Create calendar block": "Создать блок календаря",
"Create kanban block": "Создать блок Канбан", "Create kanban block": "Создать блок Канбан",
"Grouping field": "Поле группировки", "Grouping field": "Поле группировки",
@ -610,7 +612,6 @@
"Are you sure you want to hide this tab?": "Вы уверены, что хотите скрыть эту вкладку?", "Are you sure you want to hide this tab?": "Вы уверены, что хотите скрыть эту вкладку?",
"After hiding, this tab will no longer appear in the tab bar. To show it again, you need to go to the route management page to set it.": "После скрытия этой вкладки она больше не будет отображаться во вкладке. Чтобы снова отобразить ее, вам нужно будет перейти на страницу управления маршрутами, чтобы установить ее.", "After hiding, this tab will no longer appear in the tab bar. To show it again, you need to go to the route management page to set it.": "После скрытия этой вкладки она больше не будет отображаться во вкладке. Чтобы снова отобразить ее, вам нужно будет перейти на страницу управления маршрутами, чтобы установить ее.",
"Deprecated": "Устаревший", "Deprecated": "Устаревший",
"The following old template features have been deprecated and will be removed in next version.": "Следующие старые функции шаблонов устарели и будут удалены в следующей версии.",
"Full permissions": "Полные права", "Full permissions": "Полные права",
"No pages yet, please configure first": "Пока нет страниц, пожалуйста, настройте сначала", "No pages yet, please configure first": "Пока нет страниц, пожалуйста, настройте сначала",
"Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "Нажмите на значок \"Редактор пользовательского интерфейса\" в правом верхнем углу, чтобы войти в режим редактора пользовательского интерфейса", "Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "Нажмите на значок \"Редактор пользовательского интерфейса\" в правом верхнем углу, чтобы войти в режим редактора пользовательского интерфейса",

View File

@ -336,7 +336,8 @@
"Turn pages": "Sayfaları çevir", "Turn pages": "Sayfaları çevir",
"Others": "Diğerleri", "Others": "Diğerleri",
"Other records": "Diğer kayıtlar", "Other records": "Diğer kayıtlar",
"Save as template": "Şablon olarak kaydet", "Save as reference template": "Referans şablonu olarak kaydet",
"Save as inherited template": "Kalıtım şablonu olarak kaydet",
"Save as block template": "Blok şablonu olarak kaydet", "Save as block template": "Blok şablonu olarak kaydet",
"Block templates": "Blok şablonları", "Block templates": "Blok şablonları",
"Block template": "Blok şablonu", "Block template": "Blok şablonu",
@ -411,6 +412,7 @@
"Blank block": "Boş blok", "Blank block": "Boş blok",
"Duplicate template": "Şablonun kopyasını oluştur", "Duplicate template": "Şablonun kopyasını oluştur",
"Reference template": "Referans şablon", "Reference template": "Referans şablon",
"Inherited template": "Kalıtım şablonu",
"Create calendar block": "Takvim bloğu oluştur", "Create calendar block": "Takvim bloğu oluştur",
"Create kanban block": "Kanban bloğu oluştur", "Create kanban block": "Kanban bloğu oluştur",
"Grouping field": "Alan gruplandırma", "Grouping field": "Alan gruplandırma",
@ -608,7 +610,6 @@
"Are you sure you want to hide this tab?": "Bu sekmeyi gizlemek istediğinizden emin misiniz?", "Are you sure you want to hide this tab?": "Bu sekmeyi gizlemek istediğinizden emin misiniz?",
"After hiding, this tab will no longer appear in the tab bar. To show it again, you need to go to the route management page to set it.": "Gizlendikten sonra, bu sekme artık sekme çubuğunda görünmeyecek. Onu tekrar göstermek için, rotayı yönetim sayfasına gidip ayarlamanız gerekiyor.", "After hiding, this tab will no longer appear in the tab bar. To show it again, you need to go to the route management page to set it.": "Gizlendikten sonra, bu sekme artık sekme çubuğunda görünmeyecek. Onu tekrar göstermek için, rotayı yönetim sayfasına gidip ayarlamanız gerekiyor.",
"Deprecated": "Kullanımdan kaldırıldı", "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.",
"Full permissions": "Tüm izinler", "Full permissions": "Tüm izinler",
"No pages yet, please configure first": "Henüz sayfa yok, lütfen önce yapılandırın", "No pages yet, please configure first": "Henüz sayfa yok, lütfen önce yapılandırın",
"Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "Kullanıcı arayüzü düzenleyici moduna girmek için sağ üst köşedeki \"Kullanıcı Arayüzü Düzenleyici\" simgesine tıklayın", "Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "Kullanıcı arayüzü düzenleyici moduna girmek için sağ üst köşedeki \"Kullanıcı Arayüzü Düzenleyici\" simgesine tıklayın",

View File

@ -487,7 +487,8 @@
"Turn pages": "Переключати сторінки", "Turn pages": "Переключати сторінки",
"Others": "Інші", "Others": "Інші",
"Other records": "Інші записи", "Other records": "Інші записи",
"Save as template": "Зберегти як шаблон", "Save as reference template": "Зберегти як шаблон посилання",
"Save as inherited template": "Зберегти як шаблон нащадка",
"Save as block template": "Зберегти як шаблон блока", "Save as block template": "Зберегти як шаблон блока",
"Block templates": "Шаблони блоків", "Block templates": "Шаблони блоків",
"Block template": "Шаблон блока", "Block template": "Шаблон блока",
@ -577,6 +578,7 @@
"Blank block": "Порожній блок", "Blank block": "Порожній блок",
"Duplicate template": "Дублювати шаблон", "Duplicate template": "Дублювати шаблон",
"Reference template": "Посилання на шаблон", "Reference template": "Посилання на шаблон",
"Inherited template": "Нащадковий шаблон",
"Create calendar block": "Створити блок календаря", "Create calendar block": "Створити блок календаря",
"Create kanban block": "Створити блок канбану", "Create kanban block": "Створити блок канбану",
"Grouping field": "Поле для групування", "Grouping field": "Поле для групування",
@ -824,7 +826,6 @@
"Are you sure you want to hide this tab?": "Ви впевнені, що хочете приховати цю вкладку?", "Are you sure you want to hide this tab?": "Ви впевнені, що хочете приховати цю вкладку?",
"After hiding, this tab will no longer appear in the tab bar. To show it again, you need to go to the route management page to set it.": "Після приховування цієї вкладки вона більше не з'явиться в панелі вкладок. Щоб знову показати її, вам потрібно перейти на сторінку керування маршрутами, щоб налаштувати її.", "After hiding, this tab will no longer appear in the tab bar. To show it again, you need to go to the route management page to set it.": "Після приховування цієї вкладки вона більше не з'явиться в панелі вкладок. Щоб знову показати її, вам потрібно перейти на сторінку керування маршрутами, щоб налаштувати її.",
"Deprecated": "Застаріло", "Deprecated": "Застаріло",
"The following old template features have been deprecated and will be removed in next version.": "Наступні старі функції шаблонів були застарілі і будуть видалені в наступній версії.",
"Full permissions": "Повні права", "Full permissions": "Повні права",
"No pages yet, please configure first": "Ще немає сторінок, будь ласка, спочатку налаштуйте", "No pages yet, please configure first": "Ще немає сторінок, будь ласка, спочатку налаштуйте",
"Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "Натисніть на значок \"Редактор користувацького інтерфейсу\" в правому верхньому куті, щоб увійти в режим редактора користувацького інтерфейсу.", "Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "Натисніть на значок \"Редактор користувацького інтерфейсу\" в правому верхньому куті, щоб увійти в режим редактора користувацького інтерфейсу.",

View File

@ -527,7 +527,8 @@
"Turn pages": "翻页", "Turn pages": "翻页",
"Others": "其他", "Others": "其他",
"Other records": "其他记录", "Other records": "其他记录",
"Save as template": "保存为模板", "Save as reference template": "保存为引用模板",
"Save as inherited template": "保存为继承模板",
"Save as block template": "保存为区块模板", "Save as block template": "保存为区块模板",
"Block templates": "区块模板", "Block templates": "区块模板",
"Block template": "区块模板", "Block template": "区块模板",
@ -611,6 +612,7 @@
"Blank block": "空区块", "Blank block": "空区块",
"Duplicate template": "复制模板", "Duplicate template": "复制模板",
"Reference template": "引用模板", "Reference template": "引用模板",
"Inherited template": "继承模板",
"Create calendar block": "创建日历区块", "Create calendar block": "创建日历区块",
"Create kanban block": "创建看板区块", "Create kanban block": "创建看板区块",
"Grouping field": "分组字段", "Grouping field": "分组字段",
@ -1088,7 +1090,6 @@
"Are you sure you want to hide this tab?": "你确定要隐藏该标签页吗?", "Are you sure you want to hide this tab?": "你确定要隐藏该标签页吗?",
"After hiding, this tab will no longer appear in the tab bar. To show it again, you need to go to the route management page to set it.": "隐藏后,该标签将不再显示在标签栏中。要想再次显示它,你需要到路由管理页面进行设置。", "After hiding, this tab will no longer appear in the tab bar. To show it again, you need to go to the route management page to set it.": "隐藏后,该标签将不再显示在标签栏中。要想再次显示它,你需要到路由管理页面进行设置。",
"Deprecated": "已弃用", "Deprecated": "已弃用",
"The following old template features have been deprecated and will be removed in next version.": "以下旧的模板功能已弃用,将在下个版本移除。",
"Full permissions": "全部权限", "Full permissions": "全部权限",
"Enable index column": "启用序号列", "Enable index column": "启用序号列",
"Date scope": "日期范围", "Date scope": "日期范围",

View File

@ -518,7 +518,8 @@
"Turn pages": "翻頁", "Turn pages": "翻頁",
"Others": "其他", "Others": "其他",
"Other records": "其他記錄", "Other records": "其他記錄",
"Save as template": "儲存為模板", "Save as reference template": "儲存為引用模板",
"Save as inherited template": "儲存為繼承模板",
"Save as block template": "儲存為區塊模板", "Save as block template": "儲存為區塊模板",
"Block templates": "區塊模板", "Block templates": "區塊模板",
"Block template": "區塊模板", "Block template": "區塊模板",
@ -602,6 +603,7 @@
"Blank block": "空區塊", "Blank block": "空區塊",
"Duplicate template": "複製模板", "Duplicate template": "複製模板",
"Reference template": "引用模板", "Reference template": "引用模板",
"Inherited template": "繼承模板",
"Create calendar block": "建立日曆區塊", "Create calendar block": "建立日曆區塊",
"Create kanban block": "建立看板區塊", "Create kanban block": "建立看板區塊",
"Grouping field": "群組欄位", "Grouping field": "群組欄位",
@ -915,7 +917,6 @@
"Are you sure you want to hide this tab?": "你確定要隱藏這個標籤嗎?", "Are you sure you want to hide this tab?": "你確定要隱藏這個標籤嗎?",
"After hiding, this tab will no longer appear in the tab bar. To show it again, you need to go to the route management page to set it.": "隱藏後,這個標籤將不再出現在標籤欄中。要再次顯示它,你需要到路由管理頁面進行設置。", "After hiding, this tab will no longer appear in the tab bar. To show it again, you need to go to the route management page to set it.": "隱藏後,這個標籤將不再出現在標籤欄中。要再次顯示它,你需要到路由管理頁面進行設置。",
"Deprecated": "已棄用", "Deprecated": "已棄用",
"The following old template features have been deprecated and will be removed in next version.": "以下舊的模板功能已棄用,將在下個版本移除。",
"Full permissions": "完全權限", "Full permissions": "完全權限",
"No pages yet, please configure first": "尚未配置頁面,請先配置", "No pages yet, please configure first": "尚未配置頁面,請先配置",
"Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "點擊右上角的 \"介面設定\" 圖示進入介面設定模式", "Click the \"UI Editor\" icon in the upper right corner to enter the UI Editor mode": "點擊右上角的 \"介面設定\" 圖示進入介面設定模式",

View File

@ -39,7 +39,7 @@ test.describe('where table block can be added', () => {
await page.getByLabel('schema-initializer-Grid-popup').hover(); await page.getByLabel('schema-initializer-Grid-popup').hover();
await page.getByRole('menuitem', { name: 'Table right' }).hover(); await page.getByRole('menuitem', { name: 'Table right' }).hover();
await page.getByRole('menuitem', { name: 'childAssociationField' }).waitFor({ state: 'detached' }); await page.getByRole('menuitem', { name: 'childAssociationField' }).waitFor({ state: 'detached' });
await page.getByRole('menuitem', { name: 'Associated records' }).last().hover(); await page.getByRole('menuitem', { name: 'Associated records right' }).last().hover();
await page.getByRole('menuitem', { name: 'childAssociationField' }).click(); await page.getByRole('menuitem', { name: 'childAssociationField' }).click();
await page await page
.getByTestId('drawer-Action.Container-childCollection-View record') .getByTestId('drawer-Action.Container-childCollection-View record')
@ -50,8 +50,9 @@ test.describe('where table block can be added', () => {
// 添加父表关系区块 // 添加父表关系区块
await page.getByRole('menuitem', { name: 'Table right' }).waitFor({ state: 'detached' }); await page.getByRole('menuitem', { name: 'Table right' }).waitFor({ state: 'detached' });
await page.getByLabel('schema-initializer-Grid-popup').hover(); await page.getByLabel('schema-initializer-Grid-popup').hover();
await page.getByRole('menuitem', { name: 'Associated records right' }).waitFor({ state: 'detached' });
await page.getByRole('menuitem', { name: 'Table right' }).hover(); await page.getByRole('menuitem', { name: 'Table right' }).hover();
await page.getByRole('menuitem', { name: 'Associated records' }).last().hover(); await page.getByRole('menuitem', { name: 'Associated records right' }).hover();
await page.getByRole('menuitem', { name: 'parentAssociationField' }).click(); await page.getByRole('menuitem', { name: 'parentAssociationField' }).click();
await page.getByLabel('schema-initializer-TableV2-table:configureColumns-parentTargetCollection').hover(); await page.getByLabel('schema-initializer-TableV2-table:configureColumns-parentTargetCollection').hover();
await page.getByRole('menuitem', { name: 'parentTargetText' }).click(); await page.getByRole('menuitem', { name: 'parentTargetText' }).click();
@ -72,6 +73,7 @@ test.describe('where table block can be added', () => {
// 通过 Other records 创建一个表格区块 // 通过 Other records 创建一个表格区块
await page.getByLabel('schema-initializer-Grid-popup').hover(); await page.getByLabel('schema-initializer-Grid-popup').hover();
await page.getByRole('menuitem', { name: 'Other records right' }).waitFor({ state: 'detached' });
await page.getByRole('menuitem', { name: 'Table right' }).hover(); await page.getByRole('menuitem', { name: 'Table right' }).hover();
await page.getByRole('menuitem', { name: 'Other records right' }).hover(); await page.getByRole('menuitem', { name: 'Other records right' }).hover();
await page.getByRole('menuitem', { name: 'Users' }).click(); await page.getByRole('menuitem', { name: 'Users' }).click();

View File

@ -41,7 +41,7 @@ export const usePopupSettings = () => {
const isOldMobileMode = pathname?.includes('/mobile/') || hash?.includes('/mobile/'); const isOldMobileMode = pathname?.includes('/mobile/') || hash?.includes('/mobile/');
const isNewMobileMode = pathname?.includes('/m/'); const isNewMobileMode = pathname?.includes('/m/');
const isPCMode = pathname?.includes('/admin/'); const isPCMode = pathname?.includes('/admin/');
const isMobileTemplateSettingsPage = pathname?.includes('/m/block-templates/'); const isMobileTemplateSettingsPage = pathname?.includes('/m/block-templates/inherited');
return ( return (
(isPCMode || isNewMobileMode) && (isPCMode || isNewMobileMode) &&

View File

@ -1,29 +0,0 @@
/**
* This file is part of the NocoBase (R) project.
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
* Authors: NocoBase Team.
*
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
import React from 'react';
import { useTranslation } from 'react-i18next';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { Space, Tooltip } from 'antd';
export const DeprecatedTemplateTitle = () => {
const { t } = useTranslation();
return (
<Space>
{t('Deprecated')}
<Tooltip
title={t('The following old template features have been deprecated and will be removed in next version.')}
>
<QuestionCircleOutlined />
</Tooltip>
</Space>
);
};
export const DeprecatedTemplateTitleElement = <DeprecatedTemplateTitle />;

View File

@ -36,7 +36,6 @@ import { isAssocField } from '../filter-provider/utils';
import { useActionContext, useCompile, useDesignable } from '../schema-component'; import { useActionContext, useCompile, useDesignable } from '../schema-component';
import { useSchemaTemplateManager } from '../schema-templates'; import { useSchemaTemplateManager } from '../schema-templates';
import { useBlockTemplateContext } from '../schema-templates/BlockTemplateProvider'; import { useBlockTemplateContext } from '../schema-templates/BlockTemplateProvider';
import { DeprecatedTemplateTitleElement } from './components/DeprecatedTemplateTitle';
export const itemsMerge = (items1) => { export const itemsMerge = (items1) => {
return items1; return items1;
@ -838,24 +837,22 @@ export const useRecordCollectionDataSourceItems = (
.filter((template) => { .filter((template) => {
return ['FormItem', 'ReadPrettyFormItem'].includes(componentName) || template.resourceName === resourceName; return ['FormItem', 'ReadPrettyFormItem'].includes(componentName) || template.resourceName === resourceName;
}); });
const extralCollectionMenuItems = Array.from(initializerMenusGenerators.values()) const inheritedTemplatesMenuItems = Array.from(initializerMenusGenerators.values())
.map((generator) => generator({ collection, componentName })) .map((generator) => generator({ collection, componentName }))
.filter(Boolean) .filter(Boolean)
.flat(); .flat();
if ((!templates.length && !extralCollectionMenuItems.length) || isInTemplateSettingPage()) { if ((!templates.length && !inheritedTemplatesMenuItems.length) || isInTemplateSettingPage()) {
return []; return [];
} }
const index = 0; const index = 0;
const deprecatedTemplatesMenuItems = []; const allTemplatesMenuItems: SchemaInitializerItemType[] = [
if (templates.length) {
deprecatedTemplatesMenuItems.push(
{ {
type: 'divider', type: 'divider',
name: 'divider',
}, },
{ ];
type: 'itemGroup', if (templates.length) {
title: DeprecatedTemplateTitleElement, allTemplatesMenuItems.push(
children: [
{ {
key: `${collectionName || componentName}_table_subMenu_${index}_copy`, key: `${collectionName || componentName}_table_subMenu_${index}_copy`,
type: 'subMenu', type: 'subMenu',
@ -894,10 +891,17 @@ export const useRecordCollectionDataSourceItems = (
}; };
}), }),
}, },
],
},
); );
} }
if (inheritedTemplatesMenuItems.length) {
allTemplatesMenuItems.push({
type: 'subMenu',
name: 'inherited_templates',
key: `associationFiled_${componentName}_table_subMenu_${index}_inherited`,
title: t('Inherited template'),
children: inheritedTemplatesMenuItems,
});
}
return [ return [
{ {
key: `${collectionName || componentName}_table_blank`, key: `${collectionName || componentName}_table_blank`,
@ -906,8 +910,7 @@ export const useRecordCollectionDataSourceItems = (
title: t('Blank block'), title: t('Blank block'),
item, item,
}, },
...extralCollectionMenuItems, ...allTemplatesMenuItems,
...deprecatedTemplatesMenuItems,
]; ];
}; };
@ -1533,13 +1536,13 @@ const getChildren = ({
return componentName && template.componentName === componentName; return componentName && template.componentName === componentName;
}); });
const extralCollectionMenuItems = Array.from(initializerMenusGenerators.values()) const inheritedTemplatesMenuItems = Array.from(initializerMenusGenerators.values())
.map((generator) => { .map((generator) => {
return generator({ item, index, componentName, association }); return generator({ item, index, componentName, association });
}) })
.filter(Boolean) .filter(Boolean)
.flat(); .flat();
if ((!templates.length && !extralCollectionMenuItems.length) || isInTemplateSettingPage()) { if ((!templates.length && !inheritedTemplatesMenuItems.length) || isInTemplateSettingPage()) {
return { return {
type: 'item', type: 'item',
name: item.name, name: item.name,
@ -1547,16 +1550,14 @@ const getChildren = ({
dataSource, dataSource,
}; };
} }
const deprecatedTemplatesMenuItems = []; const allTemplatesMenuItems: SchemaInitializerItemType[] = [
if (templates.length) {
deprecatedTemplatesMenuItems.push(
{ {
type: 'divider', type: 'divider',
name: 'divider',
}, },
{ ];
type: 'itemGroup', if (templates.length) {
title: DeprecatedTemplateTitleElement, allTemplatesMenuItems.push(
children: [
{ {
key: `${componentName}_table_subMenu_${index}_copy`, key: `${componentName}_table_subMenu_${index}_copy`,
type: 'subMenu', type: 'subMenu',
@ -1603,10 +1604,18 @@ const getChildren = ({
}; };
}), }),
}, },
],
},
); );
} }
if (inheritedTemplatesMenuItems.length) {
allTemplatesMenuItems.push({
type: 'subMenu',
name: 'inherited_templates',
key: `associationFiled_${componentName}_table_subMenu_${index}_inherited`,
dataSource,
title: t('Inherited template'),
children: inheritedTemplatesMenuItems,
});
}
return { return {
key: `${componentName}_table_subMenu_${index}`, key: `${componentName}_table_subMenu_${index}`,
type: 'subMenu', type: 'subMenu',
@ -1620,8 +1629,7 @@ const getChildren = ({
dataSource, dataSource,
title: t('Blank block'), title: t('Blank block'),
}, },
...extralCollectionMenuItems, ...allTemplatesMenuItems,
...deprecatedTemplatesMenuItems,
], ],
}; };
}); });
@ -1804,11 +1812,11 @@ function useAssociationFields({
return template.componentName === componentName; return template.componentName === componentName;
}); });
const keyPrefix = `associationFiled_table_subMenu`; const keyPrefix = `associationFiled_table_subMenu`;
const extralCollectionMenuItems = Array.from(initializerMenusGenerators.values()) const inheritedTemplatesMenuItems = Array.from(initializerMenusGenerators.values())
.map((generator) => generator({ collection, index, field, componentName, keyPrefix, name })) .map((generator) => generator({ collection, index, field, componentName, keyPrefix, name }))
.filter(Boolean) .filter(Boolean)
.flat(); .flat();
if ((!templates.length && !extralCollectionMenuItems.length) || isInTemplateSettingPage()) { if ((!templates.length && !inheritedTemplatesMenuItems.length) || isInTemplateSettingPage()) {
return { return {
type: 'item', type: 'item',
name: `${field.collectionName}.${field.name}`, name: `${field.collectionName}.${field.name}`,
@ -1818,16 +1826,14 @@ function useAssociationFields({
associationField: field, associationField: field,
}; };
} }
const deprecatedTemplatesMenuItems = []; const allTemplatesMenuItems: SchemaInitializerItemType[] = [
if (templates.length) {
deprecatedTemplatesMenuItems.push(
{ {
type: 'divider', type: 'divider',
name: 'divider',
}, },
{ ];
type: 'itemGroup', if (templates.length) {
title: DeprecatedTemplateTitleElement, allTemplatesMenuItems.push(
children: [
{ {
key: `associationFiled_${componentName}_table_subMenu_${index}_copy`, key: `associationFiled_${componentName}_table_subMenu_${index}_copy`,
type: 'subMenu', type: 'subMenu',
@ -1878,10 +1884,19 @@ function useAssociationFields({
}; };
}), }),
}, },
],
},
); );
} }
if (inheritedTemplatesMenuItems.length) {
allTemplatesMenuItems.push({
type: 'subMenu',
name: 'inherited_templates',
key: `associationFiled_${componentName}_table_subMenu_${index}_inherited`,
dataSource,
title: t('Inherited template'),
children: inheritedTemplatesMenuItems,
});
}
return { return {
key: `associationFiled_${componentName}_table_subMenu_${index}`, key: `associationFiled_${componentName}_table_subMenu_${index}`,
type: 'subMenu', type: 'subMenu',
@ -1897,8 +1912,7 @@ function useAssociationFields({
title: t('Blank block'), title: t('Blank block'),
associationField: field, associationField: field,
}, },
...extralCollectionMenuItems, ...allTemplatesMenuItems,
...deprecatedTemplatesMenuItems,
], ],
}; };
}); });
@ -1917,7 +1931,7 @@ function useAssociationFields({
]); ]);
} }
const isInTemplateSettingPage = () => window.location.pathname.includes('/block-templates/'); const isInTemplateSettingPage = () => window.location.pathname.includes('/block-templates/inherited');
const initializerMenusGenerators = new Map< const initializerMenusGenerators = new Map<
string, string,

View File

@ -263,7 +263,7 @@ const InternalSchemaToolbar: FC<SchemaToolbarProps> = React.memo((props) => {
if (typeof title === 'string') return [compile(title)]; if (typeof title === 'string') return [compile(title)];
if (Array.isArray(title)) { if (Array.isArray(title)) {
if (title.length === 1 && fieldSchema['x-template-title']) { if (title.length === 1 && fieldSchema['x-template-title']) {
templateTitleLabel.current = t('Template'); templateTitleLabel.current = t('Inherited template');
return compile([title[0], fieldSchema['x-template-title']]); return compile([title[0], fieldSchema['x-template-title']]);
} }
return compile(title); return compile(title);

View File

@ -342,13 +342,13 @@ export const SchemaSettingsFormItemTemplate = function FormItemTemplate(props) {
} }
return ( return (
<SchemaSettingsItem <SchemaSettingsItem
title="Save as block template" title={t('Save as reference template')}
onClick={async () => { onClick={async () => {
setVisible(false); setVisible(false);
const collection = collectionName && cm?.getCollection(collectionName); const collection = collectionName && cm?.getCollection(collectionName);
const gridSchema = findGridSchema(fieldSchema); const gridSchema = findGridSchema(fieldSchema);
const values = await FormDialog( const values = await FormDialog(
t('Save as template'), t('Save as reference template'),
() => { () => {
const componentTitle = { const componentTitle = {
FormItem: t('Form'), FormItem: t('Form'),
@ -414,7 +414,7 @@ export const SchemaSettingsFormItemTemplate = function FormItemTemplate(props) {
dn.refresh(); dn.refresh();
}} }}
> >
{t('Save as block template')} {t('Save as reference template')}
</SchemaSettingsItem> </SchemaSettingsItem>
); );
}; };

View File

@ -40,7 +40,7 @@ export function SchemaSettingsTemplate(props) {
if (template) { if (template) {
return ( return (
<SchemaSettingsItem <SchemaSettingsItem
title="Convert reference to duplicate" title={t('Convert reference to duplicate')}
onClick={async () => { onClick={async () => {
const schema = await copyTemplateSchema(template); const schema = await copyTemplateSchema(template);
const removed = tdn.removeWithoutEmit(); const removed = tdn.removeWithoutEmit();
@ -59,12 +59,12 @@ export function SchemaSettingsTemplate(props) {
} }
return ( return (
<SchemaSettingsItem <SchemaSettingsItem
title="Save as template" title={t('Save as reference template')}
onClick={async () => { onClick={async () => {
setVisible(false); setVisible(false);
const collection = collectionName && getCollection(collectionName); const collection = collectionName && getCollection(collectionName);
const values = await FormDialog( const values = await FormDialog(
t('Save as template'), t('Save as reference template'),
() => { () => {
return ( return (
<FormLayout layout={'vertical'}> <FormLayout layout={'vertical'}>
@ -115,7 +115,7 @@ export function SchemaSettingsTemplate(props) {
}); });
}} }}
> >
{t('Save as template')} {t('Save as reference template')}
</SchemaSettingsItem> </SchemaSettingsItem>
); );
} }

View File

@ -82,8 +82,8 @@ export const BlockTemplateMenusProvider = ({ children }) => {
useEffect(() => { useEffect(() => {
const isLeavingTemplatesPage = const isLeavingTemplatesPage =
previousPathRef.current.includes('/settings/block-templates') && previousPathRef.current.includes('/settings/block-templates/inherited') &&
!location.pathname.includes('/settings/block-templates'); !location.pathname.includes('/settings/block-templates/inherited');
if (isLeavingTemplatesPage) { if (isLeavingTemplatesPage) {
refresh(); refresh();
} }
@ -159,7 +159,7 @@ export const BlockTemplateMenusProvider = ({ children }) => {
collectionName = field?.target; collectionName = field?.target;
} }
const isDetails = name === 'details' || componentName === 'ReadPrettyFormItem'; const isDetails = name === 'details' || componentName === 'ReadPrettyFormItem';
const children = data?.data const children: SchemaInitializerItemType[] = data?.data
?.filter( ?.filter(
(d) => (d) =>
(d.componentType === componentName || (d.componentType === componentName ||
@ -197,16 +197,7 @@ export const BlockTemplateMenusProvider = ({ children }) => {
if (!children?.length) { if (!children?.length) {
return null; return null;
} }
return [ return children;
{
type: 'divider',
},
{
type: 'itemGroup',
title: t('Block template'),
children,
},
] as SchemaInitializerItemType[];
}; };
registerInitializerMenusGenerator('block_template', generator); registerInitializerMenusGenerator('block_template', generator);
}, [data?.data, plugin.isInBlockTemplateConfigPage, handleTemplateClick, t, plugin]); }, [data?.data, plugin.isInBlockTemplateConfigPage, handleTemplateClick, t, plugin]);

View File

@ -15,9 +15,9 @@ export const ConfigureLink = () => {
const value = useFilterByTk(); const value = useFilterByTk();
const recordData = useCollectionRecordData(); const recordData = useCollectionRecordData();
const t = useT(); const t = useT();
let to = `/admin/settings/block-templates/${value}`; let to = `/admin/settings/block-templates/inherited/${value}`;
if (recordData.type === 'Mobile') { if (recordData.type === 'Mobile') {
to = `/m/block-templates/${recordData.key}/${recordData.uid}`; to = `/m/block-templates/inherited/${recordData.key}/${recordData.uid}`;
} }
return <Link to={to}>{t('Configure')}</Link>; return <Link to={to}>{t('Configure')}</Link>;

View File

@ -58,11 +58,11 @@ export const SaveAsTemplateSetting = () => {
return ( return (
<SchemaSettingsModalItem <SchemaSettingsModalItem
title={t('Save as template')} title={t('Save as inherited template')}
schema={ schema={
{ {
type: 'object', type: 'object',
title: t('Save as template'), title: t('Save as inherited template'),
properties: { properties: {
title: { title: {
type: 'string', type: 'string',

View File

@ -23,7 +23,7 @@ export const useIsPageBlock = () => {
const notInPopup = !location.pathname.includes('/popups/'); const notInPopup = !location.pathname.includes('/popups/');
const notInSetting = !location.pathname.startsWith('/admin/settings/'); const notInSetting = !location.pathname.startsWith('/admin/settings/');
const notInWorkflow = !location.pathname.startsWith('/admin/workflow/workflows/'); const notInWorkflow = !location.pathname.startsWith('/admin/workflow/workflows/');
const notInBlockTemplate = !location.pathname.startsWith('/block-templates/'); const notInBlockTemplate = !location.pathname.startsWith('/block-templates/inherited/');
return isPage && notInPopup && notInSetting && notInWorkflow && notInBlockTemplate; return isPage && notInPopup && notInSetting && notInWorkflow && notInBlockTemplate;
}, [location.pathname, fieldSchema]); }, [location.pathname, fieldSchema]);

View File

@ -7,7 +7,7 @@
* For more information, please refer to: https://www.nocobase.com/agreement. * For more information, please refer to: https://www.nocobase.com/agreement.
*/ */
import { Plugin } from '@nocobase/client'; import { BlockTemplatesPane, Plugin, SchemaSettingsFormItemTemplate, SchemaSettingsTemplate } from '@nocobase/client';
import { templateBlockInitializerItem } from './initializers'; import { templateBlockInitializerItem } from './initializers';
import { NAMESPACE } from './constants'; import { NAMESPACE } from './constants';
import { BlockTemplateList, BlockTemplatePage } from './components'; import { BlockTemplateList, BlockTemplatePage } from './components';
@ -91,10 +91,20 @@ export class PluginBlockTemplateClient extends Plugin {
this.app.pluginSettingsManager.add('block-templates', { this.app.pluginSettingsManager.add('block-templates', {
title: `{{t("Block templates", { ns: "${NAMESPACE}" })}}`, title: `{{t("Block templates", { ns: "${NAMESPACE}" })}}`,
icon: 'ProfileOutlined', icon: 'ProfileOutlined',
// Component: BlockTemplateList,
});
this.app.pluginSettingsManager.add(`block-templates.reference`, {
title: `{{t("Reference template")}}`,
Component: BlockTemplatesPane,
});
this.app.pluginSettingsManager.add(`block-templates.inherited`, {
title: `{{t("Inherited template")}}`,
Component: BlockTemplateList, Component: BlockTemplateList,
}); });
this.app.pluginSettingsManager.add(`block-templates/:key`, { this.app.pluginSettingsManager.add(`block-templates/inherited/:key`, {
title: false, title: false,
pluginKey: 'block-templates', pluginKey: 'block-templates',
isTopLevel: false, isTopLevel: false,
@ -103,14 +113,15 @@ export class PluginBlockTemplateClient extends Plugin {
// add mobile router // add mobile router
this.app.pluginManager.get<PluginMobileClient>('mobile')?.mobileRouter?.add('mobile.schema.blockTemplate', { this.app.pluginManager.get<PluginMobileClient>('mobile')?.mobileRouter?.add('mobile.schema.blockTemplate', {
path: `/block-templates/:key/:pageSchemaUid`, path: `/block-templates/inherited/:key/:pageSchemaUid`,
Component: BlockTemplateMobilePage, Component: BlockTemplateMobilePage,
}); });
} }
isInBlockTemplateConfigPage() { isInBlockTemplateConfigPage() {
const mobilePath = this.app.pluginManager.get<PluginMobileClient>('mobile')?.mobileBasename + '/block-templates'; const mobilePath =
const desktopPath = 'admin/settings/block-templates'; this.app.pluginManager.get<PluginMobileClient>('mobile')?.mobileBasename + '/block-templates/inherited';
const desktopPath = 'admin/settings/block-templates/inherited';
return window.location.pathname.includes(desktopPath) || window.location.pathname.includes(mobilePath); return window.location.pathname.includes(desktopPath) || window.location.pathname.includes(mobilePath);
} }
@ -141,7 +152,7 @@ export class PluginBlockTemplateClient extends Plugin {
// if not filter out fieldSettings:component:, we will show two revert setting item // if not filter out fieldSettings:component:, we will show two revert setting item
if (schemaSetting && !key.startsWith('fieldSettings:component:')) { if (schemaSetting && !key.startsWith('fieldSettings:component:')) {
for (let i = 0; i < schemaSetting.items.length; i++) { for (let i = 0; i < schemaSetting.items.length; i++) {
// hide convert to block setting item // hide reference template setting item
hideConvertToBlockSettingItem( hideConvertToBlockSettingItem(
schemaSetting.items[i], schemaSetting.items[i],
schemaSetting.items[i - 1], schemaSetting.items[i - 1],
@ -189,13 +200,15 @@ export class PluginBlockTemplateClient extends Plugin {
'FormDetailsSettings', 'FormDetailsSettings',
]; ];
if (blockSettings.includes(key)) { if (blockSettings.includes(key)) {
// schemaSetting.add('template-saveAsTemplateItem', saveAsTemplateSetting); const referenceTemplateItemIndex = schemaSetting.items.findIndex(
// 放到template-revertSettingItem上方 (item) =>
const revertItemIndex = schemaSetting.items.findIndex((item) => item.name === 'template-revertSettingItem'); item['Component'] === SchemaSettingsTemplate || item['Component'] === SchemaSettingsFormItemTemplate,
if (revertItemIndex !== -1) { );
schemaSetting.items.splice(revertItemIndex, 0, saveAsTemplateSetting); if (referenceTemplateItemIndex !== -1) {
} else { schemaSetting.items.splice(referenceTemplateItemIndex + 1, 0, {
schemaSetting.items.push(saveAsTemplateSetting); ...saveAsTemplateSetting,
sort: schemaSetting.items[referenceTemplateItemIndex].sort,
});
} }
} }
} }

View File

@ -88,9 +88,6 @@ export const blockTemplatesSchema: ISchema = {
type: 'void', type: 'void',
title: '{{ t("Title") }}', title: '{{ t("Title") }}',
'x-component': 'TableV2.Column', 'x-component': 'TableV2.Column',
'x-component-props': {
width: 150,
},
properties: { properties: {
title: { title: {
type: 'string', type: 'string',

View File

@ -10,7 +10,6 @@
import { useFieldSchema } from '@formily/react'; import { useFieldSchema } from '@formily/react';
import { ConvertToNormalBlockSetting } from '../components/ConvertToNormalBlockSetting'; import { ConvertToNormalBlockSetting } from '../components/ConvertToNormalBlockSetting';
import { tStr } from '../locale'; import { tStr } from '../locale';
import { useIsInTemplate } from '../hooks/useIsInTemplate';
export const convertToNormalBlockSettingItem = { export const convertToNormalBlockSettingItem = {
name: 'template-convertToNormalBlockSettingItem', name: 'template-convertToNormalBlockSettingItem',

View File

@ -7,6 +7,7 @@
* For more information, please refer to: https://www.nocobase.com/agreement. * For more information, please refer to: https://www.nocobase.com/agreement.
*/ */
import { useSchemaSettings } from '@nocobase/client';
import { SaveAsTemplateSetting } from '../components/SaveAsTemplateSetting'; import { SaveAsTemplateSetting } from '../components/SaveAsTemplateSetting';
import { useIsPageBlock } from '../hooks/useIsPageBlock'; import { useIsPageBlock } from '../hooks/useIsPageBlock';
@ -15,6 +16,7 @@ export const saveAsTemplateSetting = {
Component: SaveAsTemplateSetting, Component: SaveAsTemplateSetting,
useVisible: () => { useVisible: () => {
const isPageBlock = useIsPageBlock(); const isPageBlock = useIsPageBlock();
return isPageBlock; const { template: deprecatedTemplate } = useSchemaSettings();
return isPageBlock && !deprecatedTemplate;
}, },
}; };

View File

@ -16,7 +16,6 @@ import {
SchemaSettingsTemplate, SchemaSettingsTemplate,
SchemaSettingsConnectDataBlocks, SchemaSettingsConnectDataBlocks,
usePlugin, usePlugin,
useSchemaSettings,
} from '@nocobase/client'; } from '@nocobase/client';
export const hideConvertToBlockSettingItem = ( export const hideConvertToBlockSettingItem = (
@ -29,19 +28,21 @@ export const hideConvertToBlockSettingItem = (
settingItem['Component'] === SchemaSettingsFormItemTemplate settingItem['Component'] === SchemaSettingsFormItemTemplate
) { ) {
// hide covert to block setting item // hide covert to block setting item
const visible = settingItem['useVisible'] || (() => true);
settingItem['useVisible'] = function useVisible() { settingItem['useVisible'] = function useVisible() {
const { template: deprecatedTemplate } = useSchemaSettings(); return !useIsInTemplate() && visible();
if (deprecatedTemplate && ['formItemTemplate', 'ConvertReferenceToDuplicate'].includes(settingItem['name'])) {
// still allow user to convert reference to duplicate, this way user can migrate to new template easily
return true;
}
return false;
}; };
if (preSettingItem?.['type'] === 'divider') { if (preSettingItem?.['type'] === 'divider') {
preSettingItem['useVisible'] = () => false; const preVisible = preSettingItem['useVisible'] || (() => true);
preSettingItem['useVisible'] = function useVisible() {
return !useIsInTemplate() && preVisible();
};
} }
if (nextSettingItem?.['type'] === 'divider') { if (nextSettingItem?.['type'] === 'divider') {
nextSettingItem['useVisible'] = () => false; const nextVisible = nextSettingItem['useVisible'] || (() => true);
nextSettingItem['useVisible'] = function useVisible() {
return !useIsInTemplate() && nextVisible();
};
} }
} }
}; };

View File

@ -20,7 +20,7 @@ export const ShowTipWhenNoPages: FC = ({ children }) => {
const { designable } = useDesignable(); const { designable } = useDesignable();
const { routeList } = useMobileRoutes(); const { routeList } = useMobileRoutes();
const { t } = usePluginTranslation(); const { t } = usePluginTranslation();
const isInBlockTemplateSettingsPage = window.location.pathname?.includes('/m/block-templates/'); const isInBlockTemplateSettingsPage = window.location.pathname?.includes('/m/block-templates/inherited/');
if (!isInBlockTemplateSettingsPage && (!designable || isMobile) && _.isEmpty(routeList)) { if (!isInBlockTemplateSettingsPage && (!designable || isMobile) && _.isEmpty(routeList)) {
return ( return (