Merge pull request 'audit_logs_i18n' (#393) from audit_logs_i18n into @hera/dev

Reviewed-on: daoyoucloud/tachycode#393
This commit is contained in:
sealday 2024-03-15 19:20:13 +08:00
commit bf091d0247
7 changed files with 95 additions and 17 deletions

View File

@ -6,7 +6,6 @@ export const AuditLogsBlockProvider: React.FC = ({ children, ...restProps }) =>
const auditChangesCollection = useAuditChangesCollection(); const auditChangesCollection = useAuditChangesCollection();
const auditLogsCollection = useAuditLogsCollection(); const auditLogsCollection = useAuditLogsCollection();
const collectionsCollection = useCollectionsCollection(); const collectionsCollection = useCollectionsCollection();
console.log('audit logs blocks');
return ( return (
<ExtendCollectionsProvider collections={[auditLogsCollection, auditChangesCollection, collectionsCollection]}> <ExtendCollectionsProvider collections={[auditLogsCollection, auditChangesCollection, collectionsCollection]}>

View File

@ -144,7 +144,6 @@ export const AuditLogs: any = () => {
type: 'void', type: 'void',
title: tval('Filter'), title: tval('Filter'),
'x-action': 'filter', 'x-action': 'filter',
// 'x-designer': 'Filter.Action.Designer',
'x-component': 'Filter.Action', 'x-component': 'Filter.Action',
'x-component-props': { 'x-component-props': {
icon: 'FilterOutlined', icon: 'FilterOutlined',
@ -184,8 +183,7 @@ export const AuditLogs: any = () => {
properties: { properties: {
o80rypwmeeg: { o80rypwmeeg: {
type: 'void', type: 'void',
title: '{{ t("View") }}', title: tval('View'),
// 'x-designer': 'Action.Designer',
'x-toolbar': 'ActionSchemaToolbar', 'x-toolbar': 'ActionSchemaToolbar',
'x-settings': 'actionSettings:view', 'x-settings': 'actionSettings:view',
'x-component': 'Action.Link', 'x-component': 'Action.Link',
@ -195,7 +193,7 @@ export const AuditLogs: any = () => {
properties: { properties: {
drawer: { drawer: {
type: 'void', type: 'void',
title: '{{ t("View record") }}', title: tval('View record'),
'x-component': 'Action.Container', 'x-component': 'Action.Container',
'x-component-props': { 'x-component-props': {
className: 'nb-action-popup', className: 'nb-action-popup',

View File

@ -55,8 +55,9 @@ export const auditLogsTableColumnInitializers = new SchemaInitializer({
} }
return { return {
type: 'void', type: 'void',
'x-toolbar': 'TableColumnSchemaToolbar',
'x-settings': 'fieldSettings:TableColumn',
'x-decorator': 'TableV2.Column.Decorator', 'x-decorator': 'TableV2.Column.Decorator',
'x-designer': 'TableV2.Column.Designer',
'x-component': 'TableV2.Column', 'x-component': 'TableV2.Column',
properties: { properties: {
[s.name]: { [s.name]: {

View File

@ -1,7 +1,7 @@
import { i18n, tval as nTval } from '@nocobase/client'; import { i18n, tval as nTval } from '@nocobase/client';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
export const NAMESPACE = 'audit-logs'; export const NAMESPACE = '@hera/plugin-audit-logs';
export function lang(key: string) { export function lang(key: string) {
return i18n.t(key, { ns: NAMESPACE }); return i18n.t(key, { ns: NAMESPACE });

View File

@ -158,9 +158,9 @@ export const createSchema = () => {
'x-component': 'Select', 'x-component': 'Select',
'x-read-pretty': true, 'x-read-pretty': true,
enum: [ enum: [
{ label: "{{ t('Add new') }}", value: 'create', color: 'green' }, { label: tval('Add new'), value: 'create', color: 'green' },
{ label: "{{ t('Update') }}", value: 'update', color: 'blue' }, { label: tval('Update'), value: 'update', color: 'blue' },
{ label: "{{ t('Delete') }}", value: 'destroy', color: 'red' }, { label: tval('Delete'), value: 'destroy', color: 'red' },
], ],
}, },
}, },
@ -175,7 +175,7 @@ export const createSchema = () => {
}, },
properties: { properties: {
[uid()]: { [uid()]: {
title: '{{ t("View") }}', title: tval('View'),
type: 'void', type: 'void',
'x-action': 'view', 'x-action': 'view',
'x-component': 'Action.Link', 'x-component': 'Action.Link',
@ -189,7 +189,7 @@ export const createSchema = () => {
'x-component-props': { 'x-component-props': {
className: 'nb-action-popup', className: 'nb-action-popup',
}, },
title: '{{ t("View record") }}', title: tval('View record'),
properties: { properties: {
created_at: { created_at: {
type: 'string', type: 'string',
@ -266,7 +266,7 @@ export const createSchema = () => {
column2: { column2: {
type: 'void', type: 'void',
'x-component': 'Table.Column', 'x-component': 'Table.Column',
'x-component-props': { title: "{{ t('Before change') }}" }, 'x-component-props': { title: tval('Before change') },
properties: { properties: {
before: { before: {
type: 'string', type: 'string',
@ -278,7 +278,7 @@ export const createSchema = () => {
column3: { column3: {
type: 'void', type: 'void',
'x-component': 'Table.Column', 'x-component': 'Table.Column',
'x-component-props': { title: "{{ t('After change') }}" }, 'x-component-props': { title: tval('After change') },
properties: { properties: {
after: { after: {
type: 'string', type: 'string',

View File

@ -1,4 +1,44 @@
{ {
"Action column": "Action column",
"Action type": "Action type",
"Actions": "Actions",
"Add new": "Add new",
"After change": "After change",
"Audit Changes": "Audit Changes",
"Audit Logs": "Audit Logs",
"Audit logs": "Audit logs",
"Before change": "Before change",
"Cancel": "Cancel",
"Collection display name": "Collection display name",
"Collection name": "Collection name",
"Collection": "Collection",
"Collections": "Collections",
"Column width": "Column width",
"Configure actions": "Configure actions",
"Configure columns": "Configure columns",
"Create record": "Create record",
"Created at": "Created at",
"Created by": "Created by",
"Data changes": "Data changes",
"Delete record": "Delete record",
"Delete": "Delete",
"Details of changes": "Details of changes", "Details of changes": "Details of changes",
"Create record": "Create record" "Details": "Details",
"Display fields": "Display fields",
"Display association fields": "Display association fields",
"Enable actions": "Enable actions",
"Field display name": "Field display name",
"Field value changes": "Field value changes",
"Field": "Field",
"Filter": "Filter",
"Insert": "Insert",
"Record ID": "Record ID",
"Records per page": "Records per page",
"Refresh": "Refresh",
"Submit": "Submit",
"Update record": "Update record",
"Update": "Update",
"User": "User",
"View record": "View record",
"View": "View"
} }

View File

@ -1,4 +1,44 @@
{ {
"Details of changes": "变更详情", "Action column": "操作列",
"Create record": "创建数据" "Action type": "操作类型",
"Actions": "操作",
"Add new": "添加",
"After change": "变化后",
"Audit Changes": "审计变化",
"Audit Logs": "审计日志",
"Audit logs": "审计日志",
"Before change": "变化前",
"Cancel": "取消",
"Collection display name": "数据集显示名称",
"Collection name": "数据集名称",
"Collection": "数据集",
"Collections": "数据集",
"Column width": "列宽",
"Configure actions": "操作配置",
"Configure columns": "列配置",
"Create record": "新增数据",
"Created at": "创建于",
"Created by": "由创建",
"Data changes": "数据变化",
"Delete record": "删除数据",
"Delete": "删除",
"Details of changes": "变化详情",
"Details": "详情",
"Display association fields": "显示关联字段",
"Display fields": "显示字段",
"Enable actions": "启用的操作",
"Field display name": "字段显示名称",
"Field value changes": "字段值变化",
"Field": "字段",
"Filter": "过滤",
"Insert": "插入",
"Record ID": "数据 ID",
"Records per page": "每页数据",
"Refresh": "刷新",
"Submit": "提交",
"Update record": "编辑数据",
"Update": "编辑",
"User": "用户",
"View record": "查看数据",
"View": "查看"
} }