mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-08 23:19:26 +08:00
feat: rename filter to helper
This commit is contained in:
parent
51693d9a82
commit
a9f1e15ec6
@ -476,6 +476,8 @@
|
||||
"Action permissions": "Action permissions",
|
||||
"Menu permissions": "Menu permissions",
|
||||
"Menu item name": "Menu item name",
|
||||
"Input value": "Input value",
|
||||
"Output value": "Output value",
|
||||
"Allow access": "Allow access",
|
||||
"Action name": "Action name",
|
||||
"Allow action": "Allow action",
|
||||
|
@ -1033,6 +1033,8 @@
|
||||
"Left": "左",
|
||||
"Center": "居中",
|
||||
"Right": "右",
|
||||
"Input value": "输入值",
|
||||
"Output value": "输出值",
|
||||
"Divider line color": "分割线颜色",
|
||||
"Label align": "字段标题对齐方式",
|
||||
"Label width": "字段标题宽度",
|
||||
|
@ -8,14 +8,14 @@
|
||||
*/
|
||||
|
||||
import { Plugin } from '@nocobase/client';
|
||||
import { filterGroups, variableFilters } from '../json-template-filters';
|
||||
import { helperGroups, helpers } from '../json-template-helpers';
|
||||
export class PluginVariableFiltersClient extends Plugin {
|
||||
async afterAdd() {
|
||||
filterGroups.forEach((group) => {
|
||||
helperGroups.forEach((group) => {
|
||||
this.app.jsonTemplateParser.registerFilterGroup(group);
|
||||
});
|
||||
|
||||
variableFilters.forEach((filter) => {
|
||||
helpers.forEach((filter) => {
|
||||
this.app.jsonTemplateParser.registerFilter(filter);
|
||||
});
|
||||
}
|
||||
|
@ -9,13 +9,13 @@
|
||||
|
||||
import { first } from './array';
|
||||
import { dateAdd, dateFormat, dateSubtract } from './date';
|
||||
const NAMESPACE = 'variable-filters';
|
||||
const NAMESPACE = 'variable-helpers';
|
||||
|
||||
function tval(text: string) {
|
||||
return `{{t(${JSON.stringify(text)}, ${JSON.stringify({ ns: NAMESPACE, nsMode: 'fallback' })})}}`;
|
||||
}
|
||||
|
||||
export const variableFilters = [
|
||||
export const helpers = [
|
||||
{
|
||||
name: 'date_format',
|
||||
title: 'format',
|
||||
@ -112,7 +112,7 @@ export const variableFilters = [
|
||||
},
|
||||
];
|
||||
|
||||
export const filterGroups = [
|
||||
export const helperGroups = [
|
||||
{
|
||||
name: 'date',
|
||||
title: "{{t('Date')}}",
|
@ -8,18 +8,18 @@
|
||||
*/
|
||||
|
||||
import { Plugin } from '@nocobase/server';
|
||||
import { variableFilters, filterGroups } from '../json-template-filters';
|
||||
import { helperGroups, helpers } from '../json-template-helpers';
|
||||
export class PluginVariableFiltersServer extends Plugin {
|
||||
async afterAdd() {}
|
||||
|
||||
async beforeLoad() {}
|
||||
|
||||
async load() {
|
||||
filterGroups.forEach((group) => {
|
||||
helperGroups.forEach((group) => {
|
||||
this.app.jsonTemplateParser.registerFilterGroup(group);
|
||||
});
|
||||
|
||||
variableFilters.forEach((filter) => {
|
||||
helpers.forEach((filter) => {
|
||||
this.app.jsonTemplateParser.registerFilter(filter);
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user