Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Apr 26, 2024
2 parents 1e927aa + 6f3e6f0 commit 2232275
Show file tree
Hide file tree
Showing 120 changed files with 604 additions and 501 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ getInstanceFieldValue = (objField, formField, record, object_field, spaceId, rec
value = selectFieldValue
else if formField && objField && formField.type == 'date' && recordFieldValue
value = uuflowManagerForInitApproval.formatDate(recordFieldValue) # Date转String
else if formField && objField && formField.type == 'time' && recordFieldValue
value = uuflowManagerForInitApproval.formatTime(recordFieldValue) # Time转String
else if formField && objField && recordFieldValue && (formField.type == 'image' || formField.type == 'file')
value = getFileFieldValue(recordFieldValue, formField.type)
else if formField && objField && recordFieldValue && formField.type == 'lookup' && ['lookup', 'master_detail'].includes(objField.type) && _.isString(objField.reference_to)
Expand Down Expand Up @@ -721,4 +723,7 @@ uuflowManagerForInitApproval.checkIsInApproval = (recordIds, spaceId) ->


uuflowManagerForInitApproval.formatDate = (date) ->
return moment(date).format("YYYY-MM-DD")
return moment(date).format("YYYY-MM-DD")

uuflowManagerForInitApproval.formatTime = (date) ->
return moment(date).utcOffset(0).format("1970-01-01THH:mm:00.000[Z]")
21 changes: 18 additions & 3 deletions creator/packages/steedos-formbuilder/lib/options.coffee
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 定义 formBuilder 所有的字段类型
FORMBUILDERFIELDTYPES = ["autocomplete", "paragraph", "header", "select",
"checkbox-group", "radio-group", "checkbox", "text", "file", "image", "lookup"
"checkbox-group", "radio-group", "checkbox", "text", "file", "image", "lookup",
"date", "number", "textarea",
"dateTime", "dateNew", "checkboxBoolean", "email", "url", "password", "user", "group",
"dateTime", "dateNew", "time", "checkboxBoolean", "email", "url", "password", "user", "group",
"table", "section",
"odata", "html"]

Expand All @@ -17,7 +17,7 @@ DISABLEDATTRS = ['description', 'maxlength', 'placeholder', "access", "value", '
'toggle', 'rows', 'subtype', 'multiple', 'name']

# 定义字段类型排序
CONTROLORDER = ['text', 'textarea', 'number', 'dateNew', 'dateTime', 'date', 'checkboxBoolean',
CONTROLORDER = ['text', 'textarea', 'number', 'dateNew', 'dateTime', 'date', "time", 'checkboxBoolean',
'email', 'url', 'password', 'select', 'user', 'group', "radio-group", "checkbox-group", "file", "image", "lookup", "odata", "html", 'table', 'section']

# 获取各字段类型禁用的字段属性
Expand Down Expand Up @@ -177,6 +177,8 @@ getTypeUserAttrs = ()->
typeUserAttrs[item] = _.extend {}, CODEUSERATTRS, BASEUSERATTRS
when 'dateTime'
typeUserAttrs[item] = _.extend {}, CODEUSERATTRS, BASEUSERATTRS
when 'time'
typeUserAttrs[item] = _.extend {}, CODEUSERATTRS, BASEUSERATTRS
when 'checkboxBoolean'
typeUserAttrs[item] = _.extend {}, CODEUSERATTRS, BASEUSERATTRS
when 'email'
Expand Down Expand Up @@ -328,6 +330,13 @@ getFields = ()->
}
icon: "🕛"
},
{
label: "时间",
attrs: {
type: 'time'
}
icon: "🕛"
},
{
label: "勾选框"
attrs: {
Expand Down Expand Up @@ -433,6 +442,12 @@ getFieldTemplates = ()->
return {
field: "<input id='#{fieldData.name}' placeholder='yyyy-MM-dd HH:mm' type='text' #{Creator.formBuilder.utils.attrString(fieldData)} readonly>",
};
time: (fieldData) ->
if !fieldData.className
fieldData.className = 'form-control'
return {
field: "<input id='#{fieldData.name}' placeholder='HH:mm' type='text' #{Creator.formBuilder.utils.attrString(fieldData)} readonly>",
};
checkboxBoolean: (fieldData)->
if fieldData.value
fieldData.checked = fieldData.value
Expand Down
3 changes: 3 additions & 0 deletions creator/packages/steedos-formbuilder/lib/transform.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ Creator.formBuilder.transformFormFieldsIn = (formFields)->
when 'lookup'
field.type = 'lookup';
fields.push field;
when 'time'
field.type = 'time';
fields.push field;
else
console.log(f.code, f.name, f.type)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ SteedosTable.getTDValue = function (field, value) {
case 'file':
case 'lookup':
case 'image':
case 'time':
td_value = InstanceReadOnlyTemplate.getValue(value, field);
break
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@
display: none;
}
}

.form-control{
height: 100%;
min-height: 34px;
}

}

.steedosTable-item-add{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* @Author: [email protected]
* @Date: 2023-10-28 15:25:17
* @LastEditors: baozhoutao@steedos.com
* @LastEditTime: 2023-11-23 13:27:39
* @LastEditors: 孙浩林 sunhaolin@steedos.com
* @LastEditTime: 2024-04-26 10:45:13
* @Description:
*/
if (Meteor.isClient) {
Expand Down Expand Up @@ -110,6 +110,14 @@ if (Meteor.isClient) {
$("[name='"+atts.name+"']").data('value', values);
$("[name='"+atts.name+"']").data('multiple', atts.multiple);
const config = JSON.parse(atts.config || "{}");

let data = disabled ? {[atts.name]: values, _display: {}} : {_display: {}};
let value = values;
if (atts.fieldType === 'time') { // 因为time类型在amis中给value赋值时,在编辑状态下值显示会多8小时,所以这里特殊处理。
data = {[atts.name]: values, _display: {}};
value = undefined;
}

const schema = {
render_engine: 'amis',
name: "steedos-field-"+atts.id,
Expand All @@ -123,7 +131,7 @@ if (Meteor.isClient) {
"actions": false,
"wrapWithPanel": false,
id: 'steedosField_' + atts.id,
data: disabled ? {[atts.name]: values, _display: {}} : {_display: {}},
data: data,
body: [
{
type: 'steedos-field',
Expand All @@ -137,7 +145,7 @@ if (Meteor.isClient) {
reference_to_field: atts.reference_to_field,
filters: _.isString(atts.filters) ? JSON.parse(atts.filters) : atts.filters,
amis: {
value: values,
value: value,
static: disabled,
disabled: disabled,
disabledOn: undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,13 @@ var s_autoform = function (schema, field) {
autoform.filters = field.filters;
autoform.config = field.config;
break;
case 'time':
schema.type = String;
autoform.readonly = (permission == 'readonly');
autoform.disabled = (permission == 'readonly');
autoform.type = 'steedos-field'
autoform.fieldType = 'time'
break;
default:
schema.type = String;
autoform.readonly = (permission == 'readonly');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,23 @@ InstanceReadOnlyTemplate.getValue = (value, field, locale, utcOffset) ->
value = new Date(value)

value = InstanceReadOnlyTemplate.formatDate(value, utcOffset);
when 'time'
if value && value.length == 16
t = value.split("T")
t0 = t[0].split("-");
t1 = t[1].split(":");

year = t0[0];
month = t0[1];
date = t0[2];
hours = t1[0];
seconds = t1[1];

value = new Date(year, month - 1, date, hours, seconds)
else
value = new Date(value)

value = InstanceReadOnlyTemplate.formatTime(value);
when 'input'
if field.is_textarea
value = value
Expand Down Expand Up @@ -553,6 +570,10 @@ InstanceReadOnlyTemplate.formatDate = (date, utcOffset)->

return moment(date).utcOffset(utcOffset, passing).format("YYYY-MM-DD HH:mm");

InstanceReadOnlyTemplate.formatTime = (date)->
utcOffset = 0
return moment(date).utcOffset(utcOffset).format("HH:mm");

InstanceReadOnlyTemplate.getInstanceView = (user, space, instance, options)->

steedosData = _getTemplateData(user, space, instance, options)
Expand Down
10 changes: 5 additions & 5 deletions ee/sso-oidc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@steedos/ee_sso-oidc",
"version": "2.7.1-beta.4",
"version": "2.7.1-beta.5",
"main": "package.service.js",
"scripts": {
"build": "tsc"
Expand All @@ -11,14 +11,14 @@
"access": "public"
},
"dependencies": {
"@steedos/accounts": "2.7.1-beta.4",
"@steedos/objectql": "2.7.1-beta.4",
"@steedos/service-package-loader": "2.7.1-beta.4",
"@steedos/accounts": "2.7.1-beta.5",
"@steedos/objectql": "2.7.1-beta.5",
"@steedos/service-package-loader": "2.7.1-beta.5",
"@techpass/passport-openidconnect": "^0.3.2",
"express": "4.18.1",
"node-fetch": "^2.6.7",
"passport": "^0.6.0",
"request-ip": "^2.2.0"
},
"gitHead": "e7cff53d00640d5eaa84c9993e213510b30ed2ad"
"gitHead": "7a72f5a45906ef75f267a6da6fb9913169685323"
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
],
"useWorkspaces": true,
"npmClient": "yarn",
"version": "2.7.1-beta.4"
"version": "2.7.1-beta.5"
}
14 changes: 7 additions & 7 deletions packages/accounts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@steedos/accounts",
"private": false,
"version": "2.7.1-beta.4",
"version": "2.7.1-beta.5",
"main": "lib/index.js",
"files": [
"/package.json",
Expand Down Expand Up @@ -29,7 +29,7 @@
"@accounts/two-factor": "^0.20.1",
"@accounts/types": "0.20.1",
"@babel/runtime": "^7.12.18",
"@steedos/utils": "2.7.1-beta.4",
"@steedos/utils": "2.7.1-beta.5",
"app-root-path": "^2.2.1",
"bcryptjs": "^2.4.3",
"body-parser": "1.19.0",
Expand All @@ -56,20 +56,20 @@
"validator": "^13.6.0"
},
"devDependencies": {
"@steedos/auth": "2.7.1-beta.4",
"@steedos/meteor-bundle-runner": "2.7.1-beta.4",
"@steedos/objectql": "2.7.1-beta.4",
"@steedos/auth": "2.7.1-beta.5",
"@steedos/meteor-bundle-runner": "2.7.1-beta.5",
"@steedos/objectql": "2.7.1-beta.5",
"@types/dotenv-flow": "^3.0.0",
"@types/node": "12.6.8",
"cross-env": "^7.0.3",
"dotenv": "^8.2.0",
"dotenv-flow": "^3.1.0",
"nodemon": "^2.0.19",
"steedos-server": "2.7.1-beta.4",
"steedos-server": "2.7.1-beta.5",
"typescript": "4.6.3"
},
"publishConfig": {
"access": "public"
},
"gitHead": "e7cff53d00640d5eaa84c9993e213510b30ed2ad"
"gitHead": "7a72f5a45906ef75f267a6da6fb9913169685323"
}
8 changes: 4 additions & 4 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@steedos/auth",
"private": false,
"version": "2.7.1-beta.4",
"version": "2.7.1-beta.5",
"main": "lib/index.js",
"scripts": {
"watch": "tsc --watch",
Expand All @@ -13,8 +13,8 @@
"access": "public"
},
"dependencies": {
"@steedos/cachers": "2.7.1-beta.4",
"@steedos/objectql": "2.7.1-beta.4",
"@steedos/cachers": "2.7.1-beta.5",
"@steedos/objectql": "2.7.1-beta.5",
"bcryptjs": "^2.4.3",
"cookies": "^0.8.0",
"express": "^4.16.4",
Expand All @@ -26,5 +26,5 @@
"devDependencies": {
"typescript": "4.6.3"
},
"gitHead": "e7cff53d00640d5eaa84c9993e213510b30ed2ad"
"gitHead": "7a72f5a45906ef75f267a6da6fb9913169685323"
}
4 changes: 2 additions & 2 deletions packages/cachers/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@steedos/cachers",
"private": false,
"version": "2.7.1-beta.4",
"version": "2.7.1-beta.5",
"description": "",
"main": "lib/index.js",
"scripts": {
Expand All @@ -19,5 +19,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "e7cff53d00640d5eaa84c9993e213510b30ed2ad"
"gitHead": "7a72f5a45906ef75f267a6da6fb9913169685323"
}
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "steedos-cli",
"version": "2.7.1-beta.4",
"version": "2.7.1-beta.5",
"description": "Develop and run your enterprise apps in miniutes",
"main": "dist/index.js",
"scripts": {
Expand Down Expand Up @@ -38,8 +38,8 @@
"@oclif/command": "^1.8.16",
"@oclif/config": "^1.8.3",
"@oclif/plugin-help": "^5.1.12",
"@steedos/metadata-core": "2.7.1-beta.4",
"@steedos/metadata-registrar": "2.7.1-beta.4",
"@steedos/metadata-core": "2.7.1-beta.5",
"@steedos/metadata-registrar": "2.7.1-beta.5",
"archiver": "^5.0.2",
"chalk": "2.4.2",
"change-case": "^3.1.0",
Expand Down Expand Up @@ -82,5 +82,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "e7cff53d00640d5eaa84c9993e213510b30ed2ad"
"gitHead": "7a72f5a45906ef75f267a6da6fb9913169685323"
}
6 changes: 3 additions & 3 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": false,
"name": "@steedos/client",
"version": "2.7.1-beta.4",
"version": "2.7.1-beta.5",
"description": "client lib for steedos",
"main": "lib/index.js",
"scripts": {
Expand All @@ -17,8 +17,8 @@
},
"license": "MIT",
"dependencies": {
"@steedos/filters": "2.7.1-beta.4",
"@steedos/filters": "2.7.1-beta.5",
"node-fetch": "^2.6.7"
},
"gitHead": "e7cff53d00640d5eaa84c9993e213510b30ed2ad"
"gitHead": "7a72f5a45906ef75f267a6da6fb9913169685323"
}
Loading

0 comments on commit 2232275

Please sign in to comment.