Merge branch 'main' into fix/transfer-timeout-error

This commit is contained in:
Bassel Kanso 2023-03-14 11:44:46 +02:00 committed by GitHub
commit 65afa72d30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 956 additions and 737 deletions

View File

@ -216,6 +216,10 @@ const createYupSchemaAttribute = (type, validations, options) => {
schema = yup
.mixed(errorsTrads.json)
.test('isJSON', errorsTrads.json, (value) => {
if (!value || !value.length) {
return true;
}
try {
JSON.parse(value);
@ -226,7 +230,9 @@ const createYupSchemaAttribute = (type, validations, options) => {
})
.nullable()
.test('required', errorsTrads.required, (value) => {
if (validations.required && !value.length) return false;
if (validations.required && (!value || !value.length)) {
return false;
}
return true;
});

View File

@ -5,14 +5,6 @@ const createDefaultForm = (attributes, allComponentsSchema) => {
const attribute = get(attributes, [current], {});
const { default: defaultValue, component, type, required, min, repeatable } = attribute;
if (type === 'json') {
acc[current] = null;
}
if (type === 'json' && required === true) {
acc[current] = {};
}
if (defaultValue !== undefined) {
acc[current] = defaultValue;
}

View File

@ -11,11 +11,6 @@ describe('CONTENT MANAGER | utils | createDefaultForm', () => {
expect(createDefaultForm(attributes, {})).toEqual({});
});
it('should set the json type with the correct value', () => {
expect(createDefaultForm({ test: { type: 'json' } }, {})).toEqual({ test: null });
expect(createDefaultForm({ test: { type: 'json', required: true } }, {})).toEqual({ test: {} });
});
it('should init the requide dynamic zone type with an empty array', () => {
expect(createDefaultForm({ test: { type: 'dynamiczone', required: true } })).toEqual({
test: [],

View File

@ -69,6 +69,7 @@ const FormHead = ({
})}
</Link>
}
ellipsis
/>
);
};

View File

@ -63,8 +63,8 @@ const Table = ({
condition: canUpdate,
})}
>
<Td>
<Typography textColor="neutral800" fontWeight="bold">
<Td maxWidth={pxToRem(250)}>
<Typography textColor="neutral800" fontWeight="bold" ellipsis>
{token.name}
</Typography>
</Td>

View File

@ -275,6 +275,10 @@ exports[`ADMIN | Pages | API TOKENS | EditView renders and matches the snapshot
font-weight: 600;
font-size: 2rem;
line-height: 1.25;
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #32324d;
}
@ -1824,6 +1828,10 @@ exports[`ADMIN | Pages | API TOKENS | EditView renders and matches the snapshot
font-weight: 600;
font-size: 2rem;
line-height: 1.25;
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #32324d;
}

View File

@ -2,7 +2,7 @@ import * as yup from 'yup';
import { translatedErrors } from '@strapi/helper-plugin';
const schema = yup.object().shape({
name: yup.string(translatedErrors.string).required(translatedErrors.required),
name: yup.string(translatedErrors.string).max(100).required(translatedErrors.required),
type: yup
.string(translatedErrors.string)
.oneOf(['read-only', 'full-access', 'custom'])

View File

@ -158,7 +158,7 @@ describe('ADMIN | Pages | API TOKENS | ListPage', () => {
cursor: pointer;
}
.c36 {
.c35 {
max-width: 15.625rem;
}
@ -255,9 +255,13 @@ describe('ADMIN | Pages | API TOKENS | ListPage', () => {
color: #666687;
}
.c35 {
.c36 {
font-size: 0.875rem;
line-height: 1.43;
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-weight: 600;
color: #32324d;
}
@ -919,19 +923,19 @@ describe('ADMIN | Pages | API TOKENS | ListPage', () => {
>
<td
aria-colindex="1"
class="c25"
class="c35 c25"
role="gridcell"
tabindex="-1"
>
<span
class="c5 c35"
class="c5 c36"
>
My super token
</span>
</td>
<td
aria-colindex="2"
class="c36 c25"
class="c35 c25"
role="gridcell"
tabindex="-1"
>

View File

@ -148,6 +148,10 @@ exports[`ADMIN | Pages | TRANSFER TOKENS | EditView renders and matches the snap
font-weight: 600;
font-size: 2rem;
line-height: 1.25;
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #32324d;
}
@ -1121,6 +1125,10 @@ exports[`ADMIN | Pages | TRANSFER TOKENS | EditView renders and matches the snap
font-weight: 600;
font-size: 2rem;
line-height: 1.25;
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #32324d;
}

View File

@ -2,7 +2,7 @@ import * as yup from 'yup';
import { translatedErrors } from '@strapi/helper-plugin';
const schema = yup.object().shape({
name: yup.string(translatedErrors.string).required(translatedErrors.required),
name: yup.string(translatedErrors.string).max(100).required(translatedErrors.required),
description: yup.string().nullable(),
lifespan: yup.number().integer().min(0).nullable().defined(translatedErrors.required),
});

View File

@ -158,7 +158,7 @@ describe('ADMIN | Pages | TRANSFER TOKENS | ListPage', () => {
cursor: pointer;
}
.c36 {
.c35 {
max-width: 15.625rem;
}
@ -255,9 +255,13 @@ describe('ADMIN | Pages | TRANSFER TOKENS | ListPage', () => {
color: #666687;
}
.c35 {
.c36 {
font-size: 0.875rem;
line-height: 1.43;
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-weight: 600;
color: #32324d;
}
@ -919,19 +923,19 @@ describe('ADMIN | Pages | TRANSFER TOKENS | ListPage', () => {
>
<td
aria-colindex="1"
class="c25"
class="c35 c25"
role="gridcell"
tabindex="-1"
>
<span
class="c5 c35"
class="c5 c36"
>
My super token
</span>
</td>
<td
aria-colindex="2"
class="c36 c25"
class="c35 c25"
role="gridcell"
tabindex="-1"
>

View File

@ -55,6 +55,7 @@
"Auth.login.sso.subtitle": "通过SSO登录到你的账户",
"Auth.privacy-policy-agreement.policy": "隐私政策",
"Auth.privacy-policy-agreement.terms": "使用条款",
"Auth.reset-password.title": "Reset password",
"Content Manager": "内容管理",
"Content Type Builder": "内容类型构建器",
"Documentation": "文档",
@ -75,22 +76,95 @@
"Roles.ListPage.notification.delete-all-not-allowed": "一些角色不能被删除,因为它们与用户相关。",
"Roles.ListPage.notification.delete-not-allowed": "如果一个角色与用户相关联,则不能被删除",
"Roles.RoleRow.select-all": "选择 {name} 进行批量操作",
"Roles.RoleRow.user-count": "{number, plural, =0 {# user} one {# user} other {# users}}",
"Roles.components.List.empty.withSearch": "找不到你搜索的角色 ({search})...",
"Settings.PageTitle": "设置 - {name}",
"Settings.apiTokens.ListView.headers.createdAt": "创建于",
"Settings.apiTokens.ListView.headers.description": "描述",
"Settings.apiTokens.ListView.headers.lastUsedAt": "上次使用",
"Settings.apiTokens.ListView.headers.name": "名称",
"Settings.apiTokens.ListView.headers.type": "令牌类型",
"Settings.apiTokens.regenerate": "重新生成",
"Settings.apiTokens.createPage.title": "创建 API 令牌",
"Settings.transferTokens.createPage.title": "创建转移令牌",
"Settings.tokens.RegenerateDialog.title": "重新生成令牌",
"Settings.apiTokens.addFirstToken": "添加你的第一个 API 令牌。",
"Settings.apiTokens.addNewToken": "添加新的 API 令牌",
"Settings.tokens.copy.editMessage": "出于安全原因,你只能看到你的令牌一次。",
"Settings.tokens.copy.editTitle": "这个令牌已经无法使用了。",
"Settings.tokens.copy.lastWarning": "请确保复制这个令牌,你将无法再看到它了!",
"Settings.apiTokens.create": "创建",
"Settings.apiTokens.createPage.permissions.description": "下面只列出绑定到路由的操作。",
"Settings.apiTokens.createPage.permissions.title": "权限",
"Settings.apiTokens.description": "已添加的可使用 API 的令牌列表",
"Settings.apiTokens.createPage.BoundRoute.title": "绑定路由到",
"Settings.apiTokens.createPage.permissions.header.title": "高级设置",
"Settings.apiTokens.createPage.permissions.header.hint": "选择应用程序的操作或插件的操作,然后单击齿轮图标以显示绑定路由",
"Settings.tokens.duration.30-days": "30 天",
"Settings.tokens.duration.7-days": "7 天",
"Settings.tokens.duration.90-days": "90 天",
"Settings.tokens.duration.expiration-date": "过期日期",
"Settings.tokens.duration.unlimited": "无限制",
"Settings.apiTokens.emptyStateLayout": "你还没有任何内容...",
"Settings.tokens.form.duration": "令牌时长",
"Settings.tokens.form.type": "令牌类型",
"Settings.tokens.form.name": "名称",
"Settings.tokens.form.description": "描述",
"Settings.tokens.notification.copied": "令牌已被复制至剪贴板。",
"Settings.apiTokens.title": "API 令牌",
"Settings.tokens.popUpWarning.message": "您确定要重新生成此令牌吗?",
"Settings.tokens.Button.cancel": "取消",
"Settings.tokens.Button.regenerate": "重新生成",
"Settings.tokens.types.full-access": "完全访问",
"Settings.tokens.types.read-only": "只读",
"Settings.tokens.types.custom": "自定义",
"Settings.tokens.regenerate": "重新生成",
"Settings.transferTokens.title": "转移令牌",
"Settings.transferTokens.description": "已生成的转移令牌列表",
"Settings.transferTokens.create": "创建新的转移令牌",
"Settings.transferTokens.addFirstToken": "添加第一个转移令牌",
"Settings.transferTokens.addNewToken": "添加新的转移令牌",
"Settings.transferTokens.emptyStateLayout": "您还没有任何内容...",
"Settings.tokens.ListView.headers.name": "名称",
"Settings.tokens.ListView.headers.description": "描述",
"Settings.transferTokens.ListView.headers.type": "令牌类型",
"Settings.tokens.ListView.headers.createdAt": "创建于",
"Settings.tokens.ListView.headers.lastUsedAt": "上次使用",
"Settings.application.ee.admin-seats.count": "<text>{enforcementUserCount}</text>/{permittedSeats}",
"Settings.application.ee.admin-seats.at-limit-tooltip": "已达到限制:添加席位以邀请更多用户",
"Settings.application.ee.admin-seats.add-seats": "{isHostedOnStrapiCloud, select, true {添加席位} other {联系销售}}",
"Settings.application.customization": "自定义",
"Settings.application.customization.auth-logo.carousel-hint": "更换身份验证页面中的 Logo",
"Settings.application.customization.carousel-hint": "更改管理面板的 Logo (最大尺寸: {dimension}x{dimension}, 最大文件大小: {size}KB)",
"Settings.application.customization.carousel-slide.label": "Logo 幻灯片",
"Settings.application.customization.carousel.auth-logo.title": "认证 Logo",
"Settings.application.customization.carousel.change-action": "更换 Logo",
"Settings.application.customization.carousel.menu-logo.title": "菜单 Logo",
"Settings.application.customization.carousel.reset-action": "重置 Logo",
"Settings.application.customization.carousel.title": "Logo",
"Settings.application.customization.menu-logo.carousel-hint": "更换主导航栏中的 Logo",
"Settings.application.customization.modal.cancel": "取消",
"Settings.application.customization.modal.pending": "待定 Logo",
"Settings.application.customization.modal.pending.card-badge": "图像",
"Settings.application.customization.modal.pending.choose-another": "选择另一个",
"Settings.application.customization.modal.pending.subtitle": "在上传前管理选择的 Logo",
"Settings.application.customization.modal.pending.title": "准备上传的 Logo",
"Settings.application.customization.modal.pending.upload": "上传",
"Settings.application.customization.modal.tab.label": "您想如何上传您的资产?",
"Settings.application.customization.modal.upload": "上传 Logo",
"Settings.application.customization.modal.upload.cta.browse": "浏览文件",
"Settings.application.customization.modal.upload.drag-drop": "拖放到此处或",
"Settings.application.customization.modal.upload.error-format": "上传格式不正确仅支持格式jpeg、jpg、png、svg。",
"Settings.application.customization.modal.upload.error-network": "网络错误",
"Settings.application.customization.modal.upload.error-size": "上传的文件过大(最大尺寸:{dimension}×{dimension},最大文件大小:{size}KB",
"Settings.application.customization.modal.upload.file-validation": "最大尺寸:{dimension}×{dimension},最大文件大小:{size}KB",
"Settings.application.customization.modal.upload.from-computer": "从本地上传",
"Settings.application.customization.modal.upload.from-url": "从 URL 上传",
"Settings.application.customization.modal.upload.from-url.input-label": "URL",
"Settings.application.customization.modal.upload.next": "下一步",
"Settings.application.customization.size-details": "最大尺寸:{dimension}×{dimension},最大文件大小:{size}KB",
"Settings.application.description": "查看项目的详细信息",
"Settings.application.edition-title": "当前方案",
"Settings.application.ee-or-ce": "{communityEdition, select, true {社区版} other {企业版}}",
"Settings.application.get-help": "获取帮助",
"Settings.application.link-pricing": "查看所有价格",
"Settings.application.link-upgrade": "升级你的管理后台",
@ -101,12 +175,47 @@
"Settings.error": "错误",
"Settings.global": "全局设置",
"Settings.permissions": "管理员权限",
"Settings.permissions.auditLogs.action": "操作",
"Settings.permissions.auditLogs.admin.auth.success": "管理员登录",
"Settings.permissions.auditLogs.admin.logout": "管理员登出",
"Settings.permissions.auditLogs.component.create": "创建组件",
"Settings.permissions.auditLogs.component.delete": "删除组件",
"Settings.permissions.auditLogs.component.update": "更新组件",
"Settings.permissions.auditLogs.content-type.create": "创建内容类型",
"Settings.permissions.auditLogs.content-type.delete": "删除内容类型",
"Settings.permissions.auditLogs.content-type.update": "更新内容类型",
"Settings.permissions.auditLogs.date": "日期",
"Settings.permissions.auditLogs.details": "日志详情",
"Settings.permissions.auditLogs.entry.create": "创建条目{model, select, undefined {} other { ({model})}}",
"Settings.permissions.auditLogs.entry.delete": "删除条目{model, select, undefined {} other { ({model})}}",
"Settings.permissions.auditLogs.entry.publish": "发布条目{model, select, undefined {} other {({model})}}",
"Settings.permissions.auditLogs.entry.unpublish": "取消发布条目{model, select, undefined {} other { ({model})}}",
"Settings.permissions.auditLogs.entry.update": "更新条目{model, select, undefined {} other { ({model})}}",
"Settings.permissions.auditLogs.filters.combobox.aria-label": "搜索并选择一个选项来筛选",
"Settings.permissions.auditLogs.listview.header.subtitle": "记录发生在您的环境中所有活动的日志",
"Settings.permissions.auditLogs.media.create": "创建媒体",
"Settings.permissions.auditLogs.media.delete": "删除媒体",
"Settings.permissions.auditLogs.media.update": "更新媒体",
"Settings.permissions.auditLogs.payload": "负载",
"Settings.permissions.auditLogs.permission.create": "创建权限",
"Settings.permissions.auditLogs.permission.delete": "删除权限",
"Settings.permissions.auditLogs.permission.update": "更新权限",
"Settings.permissions.auditLogs.role.create": "创建角色",
"Settings.permissions.auditLogs.role.delete": "删除角色",
"Settings.permissions.auditLogs.role.update": "更新角色",
"Settings.permissions.auditLogs.user": "用户",
"Settings.permissions.auditLogs.user.create": "创建用户",
"Settings.permissions.auditLogs.user.delete": "删除用户",
"Settings.permissions.auditLogs.user.fullname": "{lastname}{firstname} ",
"Settings.permissions.auditLogs.user.update": "更新用户",
"Settings.permissions.auditLogs.userId": "用户 ID",
"Settings.permissions.category": "{category} 的权限设置",
"Settings.permissions.category.plugins": "{category} 插件的权限设置",
"Settings.permissions.conditions.anytime": "任何时候",
"Settings.permissions.conditions.apply": "启用",
"Settings.permissions.conditions.can": "可以",
"Settings.permissions.conditions.conditions": "定义条件",
"Settings.permissions.conditions.define-conditions": "定义条件",
"Settings.permissions.conditions.links": "链接",
"Settings.permissions.conditions.no-actions": "你首先需要选择动作(创建、读取、更新......),然后再对其定义条件。",
"Settings.permissions.conditions.none-selected": "任何时候",
@ -114,61 +223,31 @@
"Settings.permissions.conditions.when": "当",
"Settings.permissions.select-all-by-permission": "选择所有 {label} 权限",
"Settings.permissions.select-by-permission": "选择 {label} 权限",
"Settings.permissions.users.active": "已激活",
"Settings.permissions.users.create": "邀请新用户",
"Settings.permissions.users.email": "电子邮件",
"Settings.permissions.users.firstname": "名字",
"Settings.permissions.users.lastname": "姓氏",
"Settings.permissions.users.user-status": "是否激活",
"Settings.permissions.users.roles": "用户角色",
"Settings.permissions.users.username": "用户名",
"Settings.permissions.users.active": "已激活",
"Settings.permissions.users.inactive": "未激活",
"Settings.permissions.users.form.sso": "通过 SSO 登录",
"Settings.permissions.users.form.sso.description": "当启用这个选项ON用户可以通过SSO登录",
"Settings.permissions.users.inactive": "未激活",
"Settings.permissions.users.lastname": "姓氏",
"Settings.permissions.users.listview.header.subtitle": "所有能够访问 Strapi 管理后台的用户",
"Settings.permissions.users.tabs.label": "标签页权限",
"Settings.permissions.users.strapi-super-admin": "超级管理员",
"Settings.permissions.users.strapi-editor": "编辑",
"Settings.permissions.users.roles": "用户角色",
"Settings.permissions.users.strapi-author": "作者",
"Settings.permissions.users.strapi-editor": "编辑",
"Settings.permissions.users.strapi-super-admin": "超级管理员",
"Settings.permissions.users.tabs.label": "标签页权限",
"Settings.permissions.users.user-status": "是否激活",
"Settings.permissions.users.username": "用户名",
"Settings.profile.form.notify.data.loaded": "你的个人数据已经加载完成",
"Settings.profile.form.section.experience.clear.select": "清除已选择的界面语言",
"Settings.profile.form.section.experience.here": "文档",
"Settings.profile.form.section.experience.interfaceLanguage": "界面语言",
"Settings.profile.form.section.experience.interfaceLanguage.hint": "将会用所选择的语言显示你的界面",
"Settings.profile.form.section.experience.interfaceLanguageHelp": "当前的语言选择只会更改你当前帐号界面语言。 请参考此 {here} 为你的团队提供其他语言。",
"Settings.profile.form.section.experience.mode.label": "界面风格",
"Settings.profile.form.section.experience.mode.hint": "将会用所选择的风格显示你的界面",
"Settings.profile.form.section.experience.mode.label": "界面风格",
"Settings.profile.form.section.experience.mode.option-label": "{name}界面",
"Settings.application.customization": "自定义",
"Settings.application.customization.size-details": "最大尺寸:{dimension}×{dimension},最大文件大小:{size}KB",
"Settings.application.customization.carousel.menu-logo.title": "菜单 Logo",
"Settings.application.customization.carousel.auth-logo.title": "认证 Logo",
"Settings.application.customization.carousel.change-action": "更换 Logo",
"Settings.application.customization.carousel.reset-action": "重置 Logo",
"Settings.application.customization.carousel-slide.label": "Logo 幻灯片",
"Settings.application.customization.menu-logo.carousel-hint": "更换主导航栏中的 Logo",
"Settings.application.customization.auth-logo.carousel-hint": "更换身份验证页面中的 Logo",
"Settings.application.customization.modal.cancel": "取消",
"Settings.application.customization.modal.upload": "上传 Logo",
"Settings.application.customization.modal.tab.label": "您想如何上传您的资产?",
"Settings.application.customization.modal.upload.from-computer": "从本地上传",
"Settings.application.customization.modal.upload.file-validation": "最大尺寸:{dimension}×{dimension},最大文件大小:{size}KB",
"Settings.application.customization.modal.upload.error-format": "上传格式不正确仅支持格式jpeg、jpg、png、svg。",
"Settings.application.customization.modal.upload.error-size": "上传的文件过大(最大尺寸:{dimension}×{dimension},最大文件大小:{size}KB",
"Settings.application.customization.modal.upload.error-network": "网络错误",
"Settings.application.customization.modal.upload.cta.browse": "浏览文件",
"Settings.application.customization.modal.upload.drag-drop": "拖放到此处或",
"Settings.application.customization.modal.upload.from-url": "从 URL 上传",
"Settings.application.customization.modal.upload.from-url.input-label": "URL",
"Settings.application.customization.modal.upload.next": "下一步",
"Settings.application.customization.modal.pending": "待定 Logo",
"Settings.application.customization.modal.pending.choose-another": "选择另一个",
"Settings.application.customization.modal.pending.title": "准备上传的 Logo",
"Settings.application.customization.modal.pending.subtitle": "在上传前管理选择的 Logo",
"Settings.application.customization.modal.pending.upload": "上传",
"Settings.application.customization.modal.pending.card-badge": "图像",
"light": "浅色",
"dark": "深色",
"Settings.profile.form.section.experience.title": "体验",
"Settings.profile.form.section.helmet.title": "用户个人信息",
"Settings.profile.form.section.profile.page.title": "个人信息页面",
@ -176,7 +255,7 @@
"Settings.roles.create.title": "创建角色",
"Settings.roles.created": "角色已创建",
"Settings.roles.edit.title": "编辑角色",
"Settings.roles.form.button.users-with-role": "{number, plural, =0 {# users} one {# user} other {# users}} 是这个角色",
"Settings.roles.form.button.users-with-role": "{number, plural, =0 {# user} one {# user} other {# users}} 是这个角色",
"Settings.roles.form.created": "已创建",
"Settings.roles.form.description": "角色的名称与描述",
"Settings.roles.form.permission.property-label": "{label} 权限",
@ -226,21 +305,69 @@
"Settings.webhooks.trigger.test": "测试触发",
"Settings.webhooks.trigger.title": "触发前先保存",
"Settings.webhooks.value": "值",
"Usecase.back-end": "后端开发人员",
"Usecase.button.skip": "跳过此问题",
"Usecase.content-creator": "内容创作者",
"Usecase.front-end": "前端开发人员",
"Usecase.full-stack": "全栈开发人员",
"Usecase.input.work-type": "您从事什么类型的工作?",
"Usecase.notification.success.project-created": "项目已成功创建",
"Usecase.other": "其他",
"Usecase.title": "向我们介绍更多关于您自己的信息",
"Username": "用户名",
"Users": "用户",
"Users & Permissions": "用户和权限",
"Users": "用户",
"Users.components.List.empty": "还没有用户...",
"Users.components.List.empty.withFilters": "没有符合条件的用户...",
"Users.components.List.empty.withSearch": "没有符合搜索条件 ({search}) 的用户...",
"admin.pages.MarketPlacePage.filters.categories": "分类",
"admin.pages.MarketPlacePage.filters.categoriesSelected": "{count, plural, =0 {没有选择分类} one {已选择 # 个分类} other {已选择 # 个分类}}",
"admin.pages.MarketPlacePage.filters.collections": "集合",
"admin.pages.MarketPlacePage.filters.collectionsSelected": "{count, plural, =0 {没有选择集合} one {已选择 # 集合} other {已选择 # 集合}}",
"admin.pages.MarketPlacePage.helmet": "市场 - 插件",
"admin.pages.MarketPlacePage.missingPlugin.description": "告诉我们您正在寻找什么插件,我们会通知我们的社区插件开发人员,在他们寻找灵感时可以使用这些信息!",
"admin.pages.MarketPlacePage.missingPlugin.title": "缺少插件?",
"admin.pages.MarketPlacePage.offline.subtitle": "您需要连接到互联网才能访问 Strapi 市场。",
"admin.pages.MarketPlacePage.offline.title": "您处于离线状态",
"admin.pages.MarketPlacePage.plugin.copy": "复制安装命令",
"admin.pages.MarketPlacePage.plugin.copy.success": "安装命令已准备好粘贴到您的终端",
"admin.pages.MarketPlacePage.plugin.downloads": "该插件每周下载次数为 {downloadsCount} 次",
"admin.pages.MarketPlacePage.plugin.githubStars": "该插件在 GitHub 上有 {starsCount} on GitHub",
"admin.pages.MarketPlacePage.plugin.info": "了解更多",
"admin.pages.MarketPlacePage.plugin.info.label": "了解有关 {pluginName} 的更多信息",
"admin.pages.MarketPlacePage.plugin.info.text": "更多",
"admin.pages.MarketPlacePage.plugin.installed": "已安装",
"admin.pages.MarketPlacePage.plugin.tooltip.madeByStrapi": "由 Strapi 开发",
"admin.pages.MarketPlacePage.plugin.tooltip.verified": "插件已经通过 Strapi 验证",
"admin.pages.MarketPlacePage.plugin.version": "更新 Strapi 版本: \"{strapiAppVersion}\" 到: \"{versionRange}\"",
"admin.pages.MarketPlacePage.plugin.version.null": "无法验证与您的 Strapi 版本: \"{strapiAppVersion}\" 的兼容性",
"admin.pages.MarketPlacePage.plugins": "插件",
"admin.pages.MarketPlacePage.provider.downloads": "该提供商每周下载次数为 {downloadsCount} 次",
"admin.pages.MarketPlacePage.provider.githubStars": "该提供商在 GitHub 上有 {starsCount} 个星标",
"admin.pages.MarketPlacePage.providers": "提供商",
"admin.pages.MarketPlacePage.search.clear": "清除搜索",
"admin.pages.MarketPlacePage.search.empty": "没有搜索结果符合 \"{target}\"",
"admin.pages.MarketPlacePage.search.placeholder": "搜索",
"admin.pages.MarketPlacePage.sort.alphabetical": "字母顺序",
"admin.pages.MarketPlacePage.sort.alphabetical.selected": "按字母顺序排序",
"admin.pages.MarketPlacePage.sort.githubStars": "GitHub 星标数",
"admin.pages.MarketPlacePage.sort.githubStars.selected": "按 GitHub 星标数排序",
"admin.pages.MarketPlacePage.sort.newest": "最新",
"admin.pages.MarketPlacePage.sort.newest.selected": "按最新排序",
"admin.pages.MarketPlacePage.sort.npmDownloads": "下载数",
"admin.pages.MarketPlacePage.sort.npmDownloads.selected": "按 NPM 下载数排序",
"admin.pages.MarketPlacePage.submit.plugin.link": "提交您的插件",
"admin.pages.MarketPlacePage.submit.provider.link": "提交提供商",
"admin.pages.MarketPlacePage.subtitle": "从Strapi中获得更多",
"admin.pages.MarketPlacePage.tab-group.label": "Strapi 插件和提供商",
"anErrorOccurred": "唉呀! 出错了。请再试一次。",
"app.component.CopyToClipboard.label": "复制到剪贴板",
"app.component.search.label": "搜索 {target}",
"app.component.table.duplicate": "创建 {target} 的副本",
"app.component.table.edit": "编辑 {target}",
"app.component.table.read": "Read {target}",
"app.component.table.select.one-entry": "选择 {target}",
"app.component.table.view": "{target} details",
"app.components.BlockLink.blog": "博客",
"app.components.BlockLink.blog.content": "阅读有关Strapi和生态系统的最新消息。",
"app.components.BlockLink.code": "代码示例",
@ -248,6 +375,8 @@
"app.components.BlockLink.documentation.content": "探索基本概念、指南和说明。",
"app.components.BlockLink.tutorial": "教程",
"app.components.BlockLink.tutorial.content": "按照手把手指引来使用和定制Strapi。",
"app.components.BlockLink.cloud": "Strapi 云",
"app.components.BlockLink.cloud.content": "一个完全可组合的、协作的平台,提升你团队的速度。",
"app.components.Button.cancel": "取消",
"app.components.Button.confirm": "确认",
"app.components.Button.reset": "重置",
@ -258,6 +387,29 @@
"app.components.EmptyAttributes.title": "目前还没有任何字段",
"app.components.EmptyStateLayout.content-document": "目前还没有任何内容。",
"app.components.EmptyStateLayout.content-permissions": "你没有访问该内容的权限",
"app.components.GuidedTour.CM.create.content": "<p>在内容管理器中创建和管理所有内容。</p><p>例如:以博客网站为例,用户可以编写一篇文章,随心所欲地保存并发布。</p><p>💡 快速提示——不要忘记发布您创建的内容。</p>",
"app.components.GuidedTour.CM.create.title": "⚡️ 创建内容",
"app.components.GuidedTour.CM.success.content": "<p>太棒了,只剩下最后一步了!</p><b>🚀 查看内容运行情况</b>",
"app.components.GuidedTour.CM.success.cta.title": "测试 API",
"app.components.GuidedTour.CM.success.title": "第二步:已完成 ✅",
"app.components.GuidedTour.CTB.create.content": "<p>集合类型可帮助您管理多个条目,单个类型适合仅管理一个条目。</p> <p>例如:对于博客网站,文章将是集合类型,而主页将是单个类型。</p>",
"app.components.GuidedTour.CTB.create.cta.title": "构建集合类型",
"app.components.GuidedTour.CTB.create.title": "🧠 创建第一个集合类型",
"app.components.GuidedTour.CTB.success.content": "<p>干得好!</p><b>⚡️ 您想与世界分享什么?</b>",
"app.components.GuidedTour.CTB.success.title": "第一步:已完成 ✅",
"app.components.GuidedTour.apiTokens.create.content": "<p>在此生成验证令牌,并检索刚刚创建的内容。</p>",
"app.components.GuidedTour.apiTokens.create.cta.title": "生成 API 令牌",
"app.components.GuidedTour.apiTokens.create.title": "🚀 查看内容运行情况",
"app.components.GuidedTour.apiTokens.success.content": "<p>通过发出 HTTP 请求查看内容的运行情况: </p><ul><li><p>到这个 URL: <light>https://'<'YOUR_DOMAIN'>'/api/'<'YOUR_CT'>'</light></p></li><li><p>带上这个 header: <light>Authorization: bearer '<'YOUR_API_TOKEN'>'</light></p></li></ul><p>有关与内容交互的更多方法,请参见 <documentationLink>文档</documentationLink>。</p>",
"app.components.GuidedTour.apiTokens.success.cta.title": "返回首页",
"app.components.GuidedTour.apiTokens.success.title": "第三步:已完成 ✅",
"app.components.GuidedTour.create-content": "创建内容",
"app.components.GuidedTour.home.CM.title": "⚡️ 您想与世界分享什么?",
"app.components.GuidedTour.home.CTB.cta.title": "进入内容类型构建器",
"app.components.GuidedTour.home.CTB.title": "🧠 构建内容结构",
"app.components.GuidedTour.home.apiTokens.cta.title": "测试 API",
"app.components.GuidedTour.skip": "跳过教程",
"app.components.GuidedTour.title": "3步就可开始",
"app.components.HomePage.button.blog": "在博客上察看更多内容",
"app.components.HomePage.community": "加入社区",
"app.components.HomePage.community.content": "在不同的频道中与团队成员、贡献者和开发者进行讨论。",
@ -282,10 +434,11 @@
"app.components.LeftMenu.collapse": "收起导航栏",
"app.components.LeftMenu.expand": "展开导航栏",
"app.components.LeftMenu.general": "通用",
"app.components.LeftMenu.logo.alt": "Application logo",
"app.components.LeftMenu.logout": "退出",
"app.components.LeftMenu.plugins": "插件",
"app.components.LeftMenu.navbrand.title": "Strapi 仪表盘",
"app.components.LeftMenu.navbrand.workplace": "工作空间",
"app.components.LeftMenu.plugins": "插件",
"app.components.LeftMenuFooter.help": "帮助",
"app.components.LeftMenuFooter.poweredBy": "由以下机构提供",
"app.components.LeftMenuLinkContainer.collectionTypes": "集合类型",
@ -308,6 +461,10 @@
"app.components.Official": "官方",
"app.components.Onboarding.help.button": "帮助按钮",
"app.components.Onboarding.label.completed": "完成 %",
"app.components.Onboarding.link.build-content": "构建内容结构",
"app.components.Onboarding.link.manage-content": "添加和管理内容",
"app.components.Onboarding.link.manage-media": "管理媒体",
"app.components.Onboarding.link.more-videos": "观看更多视频",
"app.components.Onboarding.title": "入门影片",
"app.components.PluginCard.Button.label.download": "下载",
"app.components.PluginCard.Button.label.install": "已安装",
@ -353,11 +510,13 @@
"app.containers.Users.EditPage.roles-bloc-title": "归属的角色",
"app.containers.Users.ModalForm.footer.button-success": "邀请用户",
"app.links.configure-view": "配置视图",
"app.page.not.found": "糟糕!我们似乎找不到您要找的页面...",
"app.static.links.cheatsheet": "快速手册",
"app.utils.SelectOption.defaultMessage": " ",
"app.utils.add-filter": "添加过滤器",
"app.utils.close-label": "关闭",
"app.utils.defaultMessage": " ",
"app.utils.delete": "Delete",
"app.utils.duplicate": "创建副本",
"app.utils.edit": "编辑",
"app.utils.errors.file-too-big.message": "文件太大了",
@ -399,6 +558,7 @@
"components.Input.error.password.noMatch": "密码不匹配",
"components.Input.error.validation.email": "邮箱格式不正确",
"components.Input.error.validation.json": "JSON格式不正确",
"components.Input.error.validation.lowercase": "该值必须为小写字符串",
"components.Input.error.validation.max": "大于最大值 {max}",
"components.Input.error.validation.maxLength": "长度太长 {max}",
"components.Input.error.validation.min": "小于最小值 {min}",
@ -441,12 +601,14 @@
"components.popUpWarning.button.confirm": "是, 确认",
"components.popUpWarning.message": "你确定要删除这个吗?",
"components.popUpWarning.title": "请确认",
"containers.SettingPage.editSettings.description": "拖放字段来构建布局",
"content-manager.App.schemas.data-loaded": "模式已经成功加载",
"content-manager.DynamicTable.relation-loaded": "关联已经成功加载",
"content-manager.DynamicTable.relation-loading": "Relations are loading",
"content-manager.DynamicTable.relation-more": "This relation contains more entities than displayed",
"content-manager.EditRelations.title": "关联数据",
"content-manager.HeaderLayout.button.label-add-entry": "添加条目",
"content-manager.api.id": "API ID",
"content-manager.apiError.This attribute must be unique": "{field} must be unique",
"content-manager.components.AddFilterCTA.add": "过滤器",
"content-manager.components.AddFilterCTA.hide": "过滤器",
"content-manager.components.DragHandle-label": "拖曳",
@ -479,6 +641,7 @@
"content-manager.components.LeftMenu.single-types": "单一类型",
"content-manager.components.LimitSelect.itemsPerPage": "每页显示条目数",
"content-manager.components.NotAllowedInput.text": "没有权限显示此字段",
"content-manager.components.RelationInput.icon-button-aria-label": "Drag",
"content-manager.components.RepeatableComponent.error-message": "这个组件包含错误",
"content-manager.components.Search.placeholder": "搜索...",
"content-manager.components.Select.draft-info-title": "状态: 草稿",
@ -535,6 +698,7 @@
"content-manager.containers.ListPage.table-headers.publishedAt": "状态",
"content-manager.containers.ListSettingsView.modal-form.edit-label": "编辑 {fieldName}",
"content-manager.containers.SettingPage.add.field": "添加字段",
"content-manager.containers.SettingPage.add.relational-field": "插入另一个关联字段",
"content-manager.containers.SettingPage.attributes": "属性",
"content-manager.containers.SettingPage.attributes.description": "定义字段的排序",
"content-manager.containers.SettingPage.editSettings.description": "拖放字段以建立布局",
@ -546,6 +710,7 @@
"content-manager.containers.SettingPage.listSettings.description": "配置集合类型的选项",
"content-manager.containers.SettingPage.listSettings.title": "列表视图 (设置)",
"content-manager.containers.SettingPage.pluginHeaderDescription": "配置指定集合类型的设置",
"content-manager.containers.SettingPage.relations": "Related fields",
"content-manager.containers.SettingPage.settings": "设置",
"content-manager.containers.SettingPage.view": "视图",
"content-manager.containers.SettingViewModel.pluginHeader.title": "内容管理器 - {名称}",
@ -556,6 +721,11 @@
"content-manager.containers.SettingsPage.pluginHeaderDescription": "为你所有的集合类型和组配置设置",
"content-manager.containers.SettingsView.list.subtitle": "配置你的集合类型和组的布局和显示",
"content-manager.containers.SettingsView.list.title": "显示配置",
"content-manager.dnd.cancel-item": "{item}, 已取消拖放。重新排序已取消。",
"content-manager.dnd.drop-item": "{item}, 已拖放。列表中的最终位置: {position}.",
"content-manager.dnd.grab-item": "{item}, 已抓取。列表中的当前位置: {position}。按上下箭头更改位置,按空格键放置,按 Escape 键取消。",
"content-manager.dnd.instructions": "按空格键抓取和重新排序",
"content-manager.dnd.reorder": "{item}, 已移动。列表中的新位置: {position}。",
"content-manager.edit-settings-view.link-to-ctb.components": "编辑组件",
"content-manager.edit-settings-view.link-to-ctb.content-types": "编辑内容类型",
"content-manager.emptyAttributes.button": "前往集合类型构建器",
@ -587,6 +757,9 @@
"content-manager.form.Input.description.placeholder": "这个字段的描述",
"content-manager.form.Input.editable": "可编辑字段",
"content-manager.form.Input.filters": "开启过滤器",
"content-manager.form.Input.hint.character.unit": "{maxValue, plural, one { 个字} other { 个字}}",
"content-manager.form.Input.hint.minMaxDivider": " / ",
"content-manager.form.Input.hint.text": "{min, select, undefined {} other {最小值。 {min}}}{divider}{max, select, undefined {} other {最大值。 {max}}}{unit}{br}{description}",
"content-manager.form.Input.label": "标签",
"content-manager.form.Input.label.inputDescription": "该值会覆盖显示在表头的标签",
"content-manager.form.Input.pageEntries": "每页条目数",
@ -618,69 +791,83 @@
"content-manager.permissions.not-allowed.update": "你不被允许查看文件",
"content-manager.plugin.description.long": "查看、编辑和删除数据库中的数据的快速方法。",
"content-manager.plugin.description.short": "查看、编辑和删除数据库中的数据的快速方法。",
"content-manager.popUpWarning.bodyMessage.contentType.delete": "您确定要删除内容类型吗?",
"content-manager.popUpWarning.bodyMessage.contentType.delete.all": "您确定要删除所有内容类型吗?",
"content-manager.popUpWarning.warning.has-draft-relations.title": "确认",
"content-manager.popUpWarning.warning.publish-question": "你还想发布这个条目吗?",
"content-manager.popUpWarning.warning.unpublish": "如果您不发布此内容,它将自动变为草稿。",
"content-manager.popUpWarning.warning.unpublish-question": "您确定不要发布它吗?",
"content-manager.popUpWarning.warning.updateAllSettings": "这将修改所有设置",
"content-manager.popUpwarning.warning.has-draft-relations.button-confirm": "是, 发布",
"content-manager.popUpwarning.warning.has-draft-relations.message": "<b>{count, plural, =0 { 个关联的内容} one { 个关联的内容} other { 个关联的内容}}</b> 尚未发布。<br></br>它可能会在你的项目上产生关联失效和错误。",
"content-manager.popover.display-relations.label": "显示关联",
"content-manager.relation.add": "添加关联",
"content-manager.relation.disconnect": "删除",
"content-manager.relation.isLoading": "正在加载关联",
"content-manager.relation.loadMore": "加载更多",
"content-manager.relation.notAvailable": "没有可用的关联",
"content-manager.relation.publicationState.draft": "草稿",
"content-manager.relation.publicationState.published": "已发布",
"content-manager.select.currently.selected": "已选中 {count} 项",
"content-manager.success.record.delete": "已删除",
"content-manager.success.record.publish": "已发布",
"content-manager.success.record.save": "已保存",
"content-manager.success.record.unpublish": "已取消发布",
"content-manager.utils.data-loaded": "这个 {number, plural, =1 {条目} other {条目}} 已成功加载",
"content-manager.popUpWarning.warning.publish-question": "你还想发布这个条目吗?",
"content-manager.popUpwarning.warning.has-draft-relations.button-confirm": "是, 发布",
"content-manager.popUpwarning.warning.has-draft-relations.message": "<b>{count, plural, =0 { 个关联的内容} one { 个关联的内容} other { 个关联的内容}}</b> 尚未发布。<br></br>它可能会在你的项目上产生关联失效和错误。",
"content-type-builder.button.component.create": "创建一个新的组件",
"content-type-builder.button.model.create": "创建一个新的集合类型",
"content-type-builder.button.single-types.create": "创建一个新的单一类型",
"content-type-builder.form.button.add.field.to.collectionType": "为这个集合类型添加另一个字段",
"content-type-builder.form.button.add.field.to.singleType": "为这个单一类型添加另一个字段",
"content-type-builder.listView.headerLayout.description": "定义内容的数据结构",
"content-type-builder.menu.section.components.name": "组件",
"content-type-builder.menu.section.models.name": "集合类型",
"content-type-builder.menu.section.single-types.name": "单一类型",
"content-type-builder.plugin.name": "模型构建器",
"form.button.done": "完成",
"content-manager.utils.data-loaded": "已成功加载 {number, plural, =1 {个条目} other {个条目}}",
"dark": "深色",
"form.button.continue": "继续",
"global.search": "搜索",
"form.button.done": "完成",
"global.actions": "Actions",
"global.auditLogs": "Audit Logs",
"global.back": "返回",
"global.cancel": "取消",
"global.continue": "继续",
"global.change-password": "修改密码",
"global.content-manager": "内容管理",
"global.continue": "继续",
"global.delete": "删除",
"global.delete-target": "删除 {target}",
"global.description": "描述",
"global.details": "详情",
"global.disabled": "Disabled",
"global.documentation": "文档",
"global.enabled": "Enabled",
"global.finish": "完成",
"global.marketplace": "市场",
"global.name": "名称",
"global.none": "None",
"global.password": "密码",
"global.plugins": "插件",
"global.plugins.content-manager": "内容管理",
"global.plugins.content-manager.description": "在你的数据库里,快速的查看、编辑和删除数据。",
"global.plugins.content-type-builder": "模型构建器",
"global.plugins.content-type-builder.description": "对你的 API 数据结构进行建模。在短短的一分钟内创建新的字段和关系。这些文件会在你的项目中自动创建和更新。",
"global.plugins.email": "电子邮件",
"global.plugins.email.description": "配置你的应用程序来发送电子邮件。",
"global.plugins.upload": "媒体库",
"global.plugins.upload.description": "媒体文件管理。",
"global.plugins.graphql": "GraphQL",
"global.plugins.graphql.description": "添加具有默认 API 方法的 GraphQL 端点",
"global.plugins.documentation": "文档",
"global.plugins.documentation.description": "创建一个 OpenAPI 文档,用 SWAGGER UI 来可视化你的 API。",
"global.plugins.email": "电子邮件",
"global.plugins.email.description": "配置你的应用程序来发送电子邮件。",
"global.plugins.graphql": "GraphQL",
"global.plugins.graphql.description": "添加具有默认 API 方法的 GraphQL 端点",
"global.plugins.i18n": "国际化",
"global.plugins.i18n.description": "这个插件可以从管理面板和 API 中创建、阅读和更新不同语言的内容。",
"global.plugins.sentry": "Sentry",
"global.plugins.sentry.description": "将 Strapi 错误事件发送给 Sentry。",
"global.plugins.upload": "媒体库",
"global.plugins.upload.description": "媒体文件管理。",
"global.plugins.users-permissions": "角色和权限",
"global.plugins.users-permissions.description": "用一个基于 JWT 的完整认证过程来保护你的 API。这个插件还带有一个 ACL 策略,允许你管理用户组之间的权限。",
"global.profile": "个人资料",
"global.prompt.unsaved": "您确定要离开这个页面吗?您所有的未保存的修改都将丢失",
"global.reset-password": "Reset password",
"global.roles": "角色列表",
"global.save": "保存",
"global.search": "搜索",
"global.see-more": "See more",
"global.select": "Select",
"global.select-all-entries": "选择所有条目",
"global.settings": "设置",
"global.users": "用户列表",
"global.type": "类型",
"global.users": "用户列表",
"light": "浅色",
"notification.contentType.relations.conflict": "内容类型有关联冲突",
"notification.default.title": "通知:",
"notification.error": "发生错误",
@ -692,10 +879,19 @@
"notification.success.delete": "条目已删除",
"notification.success.saved": "已保存",
"notification.success.title": "成功:",
"notification.success.apitokencreated": "API 令牌已成功创建",
"notification.success.apitokenedited": "API 令牌已成功编辑",
"notification.success.transfertokencreated": "转移令牌已成功创建",
"notification.success.transfertokenedited": "转移令牌已成功编辑",
"notification.error.tokennamenotunique": "该名称已分配给另一个令牌",
"notification.version.update.message": "有新版本的 Strapi 可用!",
"notification.warning.title": "警告:",
"notification.warning.404": "404 - 未找到",
"notification.ee.warning.over-.message": "为 {licenseLimitStatus, select, OVER_LIMIT {邀请} AT_LIMIT {重新启用}} 用户添加席位。如果您已经这样做,但 Strapi 尚未反映,请确保重新启动您的应用。",
"notification.ee.warning.at-seat-limit.title": "{licenseLimitStatus, select, OVER_LIMIT {超过} AT_LIMIT {达到}} 席位限制 ({currentUserCount}/{permittedSeats})",
"or": "或",
"request.error.model.unknown": "模型不存在",
"selectButtonTitle": "Select",
"skipToContent": "跳至内容",
"submit": "提交"
}

View File

@ -48,6 +48,7 @@ const formatAttribute = (key, attribute) => {
multiple: !!attribute.multiple,
required: !!required,
configurable: configurable === false ? false : undefined,
private: !!attribute.private,
allowedTypes: attribute.allowedTypes,
pluginOptions,
};

View File

@ -10,14 +10,14 @@ import DateTimePicker from './index';
argTypes={{
label: {
control: {
type: 'text'
}
type: 'text',
},
},
value: {
control: {
type: 'date'
}
}
type: 'date',
},
},
}}
/>
@ -37,7 +37,7 @@ Description...
<DateTimePicker
onClear={() => setValue(undefined)}
value={value}
onChange={e => setValue(e)}
onChange={(e) => setValue(e)}
label="Date time picker"
hint="This is a super description"
/>
@ -53,6 +53,7 @@ Description...
<Canvas>
<Story name="error">
<DateTimePicker
label="Date time picker"
hint="This is a super description"
error="Very very very very very very very long error"
/>

View File

@ -4,6 +4,7 @@ import { useEffect, useState, useRef } from 'react';
import { Meta, ArgsTable, Canvas, Story } from '@storybook/addon-docs';
import { Button, Box, Main, Flex } from '@strapi/design-system';
import useQueryParams from '../../hooks/useQueryParams';
import useTracking from '../../hooks/useTracking';
import FilterListURLQuery from '../FilterListURLQuery';
import FilterPopoverURLQuery from './index';
@ -51,6 +52,7 @@ import { FilterListURLQuery } from '@strapi/helper-plugin';
metadatas: { label: 'city' },
},
];
const { trackUsage } = useTracking();
return (
<Main>
<Flex direction="column" alignItems="stretch" gap={6}>

View File

@ -142,11 +142,12 @@ const GenericInput = ({
labelAction={labelAction}
value={value}
error={errorMessage}
disabled={disabled}
hint={hint}
required={required}
onChange={(json) => {
// Default to null when the field is not required and there is no input value
const value = !attribute.required && !json.length ? 'null' : json;
const value = !attribute.required && !json.length ? null : json;
onChange({ target: { name, value } });
}}
minHeight={pxToRem(252)}