sumba 2.27.2 → 2.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extend/waibuDb/schema/user.js +54 -15
- package/package.json +1 -1
- package/wiki/CHANGES.md +5 -0
|
@@ -1,32 +1,65 @@
|
|
|
1
1
|
async function user ({ req } = {}) {
|
|
2
2
|
const { merge } = this.app.lib._
|
|
3
|
+
const { routePath } = this.app.waibu
|
|
3
4
|
const details = {
|
|
5
|
+
layout: [
|
|
6
|
+
{ name: 'meta', fields: ['id:3', 'createdAt:3', 'updatedAt:3', 'status:3'] },
|
|
7
|
+
{ name: 'account', fields: ['username:3', 'email:3', 'provider:3', 'password:3', 'firstName:3', 'lastName:3', 'apiKey:6'] },
|
|
8
|
+
{ name: 'address', fields: ['address1:12', 'address2:12', 'city:6-md 8-sm', 'zipCode:2-md 4-sm', 'provinceState:4-md', 'country:6-md', 'phone:6-md', 'website:12'] },
|
|
9
|
+
{ name: 'socialMedia', fields: ['socX:3-md 6-sm', 'socInstagram:3-md 6-sm', 'socFacebook:3-md 6-sm', 'socLinkedIn:3-md 6-sm'] }
|
|
10
|
+
],
|
|
4
11
|
forceVisible: ['password', 'token'],
|
|
5
12
|
format: {
|
|
6
13
|
password: function (val, rec) {
|
|
7
|
-
return
|
|
14
|
+
return {
|
|
15
|
+
value: '*************',
|
|
16
|
+
icon: 'arrowsRepeat',
|
|
17
|
+
href: routePath('waibuAdmin:/site/reset-user-password', { query: { username: rec.username } })
|
|
18
|
+
}
|
|
19
|
+
// return `<a href="waibuAdmin:/site/reset-user-password?username=${rec.username}">${req.t('resetPassword')}</a>`
|
|
8
20
|
}
|
|
9
21
|
},
|
|
10
22
|
widget: {
|
|
23
|
+
username: {
|
|
24
|
+
attr: {
|
|
25
|
+
id: 'fusername'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
11
28
|
password: {
|
|
12
|
-
component: 'form-plaintext'
|
|
29
|
+
component: 'form-plaintext',
|
|
30
|
+
attr: {
|
|
31
|
+
font: 'monospace'
|
|
32
|
+
}
|
|
33
|
+
/*
|
|
34
|
+
addons: [{
|
|
35
|
+
attr: {
|
|
36
|
+
'x-data': true,
|
|
37
|
+
'@click': `location.href='${routePath('waibuAdmin:/site/reset-user-password?username=')}' + document.getElementById('fusername').textContent`,
|
|
38
|
+
icon: 'arrowsRepeat'
|
|
39
|
+
},
|
|
40
|
+
type: 'button',
|
|
41
|
+
position: 'append'
|
|
42
|
+
}]
|
|
43
|
+
*/
|
|
44
|
+
},
|
|
45
|
+
apiKey: {
|
|
46
|
+
attr: {
|
|
47
|
+
id: 'fapi-key',
|
|
48
|
+
text: 'truncate'
|
|
49
|
+
},
|
|
50
|
+
addons: [{
|
|
51
|
+
attr: {
|
|
52
|
+
'x-data': true,
|
|
53
|
+
'@click': "await wbs.copyToClipboard('#fapi-key', true)",
|
|
54
|
+
icon: 'copy'
|
|
55
|
+
},
|
|
56
|
+
type: 'button',
|
|
57
|
+
position: 'append'
|
|
58
|
+
}]
|
|
13
59
|
}
|
|
14
60
|
}
|
|
15
61
|
}
|
|
16
62
|
return {
|
|
17
|
-
common: {
|
|
18
|
-
layout: [
|
|
19
|
-
{ name: 'meta', fields: ['id:3', 'createdAt:3', 'updatedAt:3', 'status:3'] },
|
|
20
|
-
{ name: 'account', fields: ['username:3', 'email:3', 'provider:3', 'password:3', 'firstName:3', 'lastName:3'] },
|
|
21
|
-
{ name: 'address', fields: ['address1:12', 'address2:12', 'city:6-md 8-sm', 'zipCode:2-md 4-sm', 'provinceState:4-md', 'country:6-md', 'phone:6-md', 'website:12'] },
|
|
22
|
-
{ name: 'socialMedia', fields: ['socX:3-md 6-sm', 'socInstagram:3-md 6-sm', 'socFacebook:3-md 6-sm', 'socLinkedIn:3-md 6-sm'] }
|
|
23
|
-
],
|
|
24
|
-
widget: {
|
|
25
|
-
token: {
|
|
26
|
-
component: 'form-plaintext'
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
63
|
view: {
|
|
31
64
|
list: {
|
|
32
65
|
qs: {
|
|
@@ -44,6 +77,12 @@ async function user ({ req } = {}) {
|
|
|
44
77
|
},
|
|
45
78
|
details,
|
|
46
79
|
add: {
|
|
80
|
+
layout: [
|
|
81
|
+
{ name: 'meta', fields: ['id:3', 'createdAt:3', 'updatedAt:3', 'status:3'] },
|
|
82
|
+
{ name: 'account', fields: ['username:4', 'email:4', 'password:4', 'firstName:6', 'lastName:6'] },
|
|
83
|
+
{ name: 'address', fields: ['address1:12', 'address2:12', 'city:6-md 8-sm', 'zipCode:2-md 4-sm', 'provinceState:4-md', 'country:6-md', 'phone:6-md', 'website:12'] },
|
|
84
|
+
{ name: 'socialMedia', fields: ['socX:3-md 6-sm', 'socInstagram:3-md 6-sm', 'socFacebook:3-md 6-sm', 'socLinkedIn:3-md 6-sm'] }
|
|
85
|
+
],
|
|
47
86
|
forceVisible: ['password'],
|
|
48
87
|
hidden: ['id', 'createdAt', 'updatedAt', 'provider']
|
|
49
88
|
},
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED