feat: deleted collection field give some tips (#1744)

* feat: deleted collection field give some tips

* chore: optimize traslation

---------

Co-authored-by: Rairn <958414905@qq.com>
This commit is contained in:
李小斐 2023-04-24 21:49:56 +08:00 committed by GitHub
parent cd596925ee
commit c03d271481
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 78 additions and 65 deletions

View File

@ -3,6 +3,7 @@ import { connect, useField, useFieldSchema } from '@formily/react';
import { merge } from '@formily/shared';
import { concat } from 'lodash';
import React, { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { useActionContext, useCompile, useComponent, useFormBlockContext, useRecord } from '..';
import { CollectionFieldProvider } from './CollectionFieldProvider';
import { useCollectionField } from './hooks';
@ -97,6 +98,12 @@ export const InternalFallbackField = () => {
return <div>{displayText}</div>;
};
// 当字段被删除时,显示一个提示占位符
const DeletedField = () => {
const { t } = useTranslation()
return <div style={{ color: '#ccc' }}>{t('The field has bee deleted')}</div>;
}
export const CollectionField = connect((props) => {
const fieldSchema = useFieldSchema();
const field = fieldSchema?.['x-component-props']?.['field'];
@ -105,7 +112,7 @@ export const CollectionField = connect((props) => {
<CollectionFieldProvider
name={fieldSchema.name}
field={field}
fallback={snapshot ? <InternalFallbackField /> : null}
fallback={snapshot ? <InternalFallbackField /> : <DeletedField />}
>
<InternalField {...props} />
</CollectionFieldProvider>

View File

@ -498,6 +498,7 @@ export default {
"Skip required validation": "Skip required validation",
"Form values": "Form values",
"Fields values": "Fields values",
'The field has bee deleted': 'The field has bee deleted',
"When submitting the following fields, the saved values are": "When submitting the following fields, the saved values are",
"After successful submission": "After successful submission",
"Then": "Then",

View File

@ -54,40 +54,40 @@ export default {
"Delete": "削除",
"UI editor": "UI エディタ",
"Collection": "コレクション",
"Enable child collections":"启用子表",
"Allow adding records to the current collection":"現在のデータ・フォームへのレコードの追加を許可する",
"Enable child collections": "启用子表",
"Allow adding records to the current collection": "現在のデータ・フォームへのレコードの追加を許可する",
"Collections & Fields": "コレクションとフィールド",
"All collections":"すべてのデータテーブル",
"Add category":"分類の追加",
"Edit category":"分類の編集",
"Sort":"ソート#ソート#",
"Categories":"データテーブルカテゴリ",
"Category name":"分類名",
"Delete category":"分類の削除",
"Collection category":"Collection category",
'Add child':'サブレコードの追加',
'Collapse all':'すべて閉じる',
'Expand all':'すべて展開',
'Expand/Collapse':'展開と終了',
"Tree table":"ツリーテーブル",
"Visible":"表示",
"Read only":"読み取り専用(編集不可)",
"Easy reading":"読み取り専用(読取りモード)",
"Hidden":"非表示",
"Hidden(reserved value)":"非表示(値の保持)",
"Not required":"必須ではありません",
"Value":"フィールド値",
"Disabled":"無効化",
"Enabled":"有効化",
'On':'有効化',
'Off':'無効化',
"Empty":"くうきち",
"Linkage rule":"連動規則",
"Linkage rules":"連動規則",
"Condition":"条件#ジョウケン#",
"Properties":"属性#ゾクセイ#",
"Add linkage rule":"連動規則の追加",
"Add property":"属性の追加",
"All collections": "すべてのデータテーブル",
"Add category": "分類の追加",
"Edit category": "分類の編集",
"Sort": "ソート#ソート#",
"Categories": "データテーブルカテゴリ",
"Category name": "分類名",
"Delete category": "分類の削除",
"Collection category": "Collection category",
'Add child': 'サブレコードの追加',
'Collapse all': 'すべて閉じる',
'Expand all': 'すべて展開',
'Expand/Collapse': '展開と終了',
"Tree table": "ツリーテーブル",
"Visible": "表示",
"Read only": "読み取り専用(編集不可)",
"Easy reading": "読み取り専用(読取りモード)",
"Hidden": "非表示",
"Hidden(reserved value)": "非表示(値の保持)",
"Not required": "必須ではありません",
"Value": "フィールド値",
"Disabled": "無効化",
"Enabled": "有効化",
'On': '有効化',
'Off': '無効化',
"Empty": "くうきち",
"Linkage rule": "連動規則",
"Linkage rules": "連動規則",
"Condition": "条件#ジョウケン#",
"Properties": "属性#ゾクセイ#",
"Add linkage rule": "連動規則の追加",
"Add property": "属性の追加",
"Roles & Permissions": "役割と権限",
"Edit profile": "プロフィール",
"Change password": "パスワード変更",
@ -104,22 +104,22 @@ export default {
"Set the data scope": "データ範囲の設定",
"Data blocks": "データブロック",
"Filter blocks": "フィルターブロック",
"Table OID(Inheritance)":"データテーブルOID(継承)",
"Table OID(Inheritance)": "データテーブルOID(継承)",
"Table": "テーブル",
"Form": "フォーム",
"Collapse": "折りたたみ",
"Select data source": "データソースを選択",
"Calendar": "カレンダー",
"Kanban": "かんばん",
"Gantt":"ガント図",
"Create gantt block":"ガントチャートブロックの作成",
"Progress field":"進捗フィールド",
"Time scale":"時間スケールレベル",
"Hour":"時間",
"Quarter of day":"四分の一日",
"Half of day":"半日",
"Year":"年",
"QuarterYear":"四半期",
"Gantt": "ガント図",
"Create gantt block": "ガントチャートブロックの作成",
"Progress field": "進捗フィールド",
"Time scale": "時間スケールレベル",
"Hour": "時間",
"Quarter of day": "四分の一日",
"Half of day": "半日",
"Year": "年",
"QuarterYear": "四半期",
"Select grouping field": "グループフィールドを選択してください",
"Media": "メディア",
"Markdown": "マークダウン",
@ -174,20 +174,20 @@ export default {
"Create collection": "コレクションの作成",
"Collection display name": "コレクション名",
"Collection name": "コレクション識別子",
"Inherits":"継承",
"AutoGenId":"IDフィールドの自動生成",
"CreatedBy":"レコード作成者",
"UpdatedBy":"レコード最終更新者",
"CreatedAt":"レコード作成時間",
"UpdatedAt":"レコード最終更新時間",
"Records can be sorted":"ソート可能",
"Collection template":"データテーブルテンプレート",
"Calendar collection":"カレンダデータテーブル",
"General collection":"一般データテーブル",
"Connect to database view":"ビューに接続",
"Source collections":"ソースデータセット",
"Field source":"ソースフィールド",
"Preview":"プレビュー",
"Inherits": "継承",
"AutoGenId": "IDフィールドの自動生成",
"CreatedBy": "レコード作成者",
"UpdatedBy": "レコード最終更新者",
"CreatedAt": "レコード作成時間",
"UpdatedAt": "レコード最終更新時間",
"Records can be sorted": "ソート可能",
"Collection template": "データテーブルテンプレート",
"Calendar collection": "カレンダデータテーブル",
"General collection": "一般データテーブル",
"Connect to database view": "ビューに接続",
"Source collections": "ソースデータセット",
"Field source": "ソースフィールド",
"Preview": "プレビュー",
"Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.": "ランダムに生成され、変更可能です。 アルファベット、数字、アンダースコアをサポートし、アルファベットから始まる必要があります。",
"Storage type": "ストレージタイプ",
"Edit": "編集",
@ -195,8 +195,8 @@ export default {
"Configure fields": "フィールドの設定",
"Configure columns": "カラムの設定",
"Edit field": "フィールドの編集",
"Override":"書き換え",
"Override field":"フィールドの上書き",
"Override": "書き換え",
"Override field": "フィールドの上書き",
"Configure fields of {{title}}": "{{title}}のフィールド設定",
"Basic": "基本タイプ",
"Single line text": "一行テキスト",
@ -421,6 +421,7 @@ export default {
"Skip required validation": "必須のバリデーションをスキップ",
"Form values": "フォームの値",
"Fields values": "フィールドの値",
'The field has bee deleted': 'フィールドが削除されました',
"When submitting the following fields, the saved values are": "次のフィールドを送信すると、保存された値は",
"After successful submission": "送信が成功した後",
"Then": "その後",
@ -475,10 +476,10 @@ export default {
"General permissions": "一般設定",
"Global action permissions": "グローバル操作権限",
"General action permissions": "一般操作権限",
"Plugin settings permissions":"中央権限の設定",
'Allow to desgin pages':"インタフェース構成の許可",
"Allow to manage plugins":"管理プラグインの許可",
"Allow to configure plugins":"管理構成センターの許可",
"Plugin settings permissions": "中央権限の設定",
'Allow to desgin pages': "インタフェース構成の許可",
"Allow to manage plugins": "管理プラグインの許可",
"Allow to configure plugins": "管理構成センターの許可",
"Action display name": "操作名",
"Allow": "許可する",
"Data scope": "レコードスコープ",

View File

@ -457,7 +457,8 @@ export default {
"Delete table column": "Excluir coluna da tabela",
"Skip required validation": "Ignorar validação obrigatória",
"Form values": "Valores do formulário",
"Fields values": "Valores dos campos",
"Fields values": "campo removido",
'The field has bee deleted': 'O campo foi excluído',
"When submitting the following fields, the saved values are": "Ao enviar os seguintes campos, os valores salvos são",
"After successful submission": "Depois do envio bem-sucedido",
"Then": "Então",

View File

@ -363,6 +363,7 @@ export default {
"Skip required validation": "Пропустить обязатеьную проверку",
"Form values": "Значения формы",
"Fields values": "Значения полей",
'The field has bee deleted': 'Поле было удалено',
"When submitting the following fields, the saved values are": "При отправке следующих полей, сохраненные значения такие",
"After successful submission": "После удачной отправки",
"Then": "Затем",

View File

@ -362,6 +362,7 @@ export default {
"Skip required validation": "Zorunlu alan kontrollerini atla",
"Form values": "Form değerleri",
"Fields values": "Alanların değerleri",
'The field has bee deleted': 'Alan silindi',
"When submitting the following fields, the saved values are": "Aşağıdaki alanlar gönderilirken kaydedilen değerler",
"After successful submission": "Başarılı gönderimden sonra",
"Then": "Then",

View File

@ -536,6 +536,7 @@ export default {
'Skip required validation': '跳过必填校验',
'Form values': '表单值',
'Fields values': '字段值',
'The field has bee deleted': '字段已删除',
'When submitting the following fields, the saved values are': '提交以下字段时,保存的值为',
'After successful submission': '提交成功后',
'Then': '然后',