sumba 1.2.13 → 1.2.15

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.
@@ -126,7 +126,9 @@
126
126
  "socInstagram": "Instagram",
127
127
  "socFacebook": "Facebook",
128
128
  "socLinkedIn": "LinkedIn",
129
- "size": "Size"
129
+ "size": "Size",
130
+ "user": "User",
131
+ "team": "Team"
130
132
  },
131
133
  "validation": {
132
134
  "password": {
package/bajo/intl/id.json CHANGED
@@ -99,7 +99,7 @@
99
99
  "manageSite": "Kelola Situs",
100
100
  "manageUser": "Kelola Pengguna",
101
101
  "manageTeam": "Kelola Tim",
102
- "manageTeamUser": "Manage Anggota Tim",
102
+ "manageTeamUser": "Kelola Anggota Tim",
103
103
  "resetUserPassword": "Reset Kata Sandi Pengguna",
104
104
  "unknownUser": "Pengguna Tidak Dikenal/Tidak Valid",
105
105
  "socialMedia": "Media Sosial",
@@ -127,7 +127,9 @@
127
127
  "socInstagram": "Instagram",
128
128
  "socFacebook": "Facebook",
129
129
  "socLinkedIn": "LinkedIn",
130
- "size": "Besaran"
130
+ "size": "Besaran",
131
+ "user": "Pengguna",
132
+ "team": "Tim"
131
133
  },
132
134
  "validation": {
133
135
  "password": {
@@ -9,7 +9,13 @@ async function userId (opts = {}) {
9
9
  site: {
10
10
  schema: 'SumbaSite',
11
11
  propName: 'id',
12
- type: 'one-on-one'
12
+ type: 'one-to-one'
13
+ },
14
+ user: {
15
+ schema: 'SumbaUser',
16
+ propName: 'id',
17
+ type: 'one-to-one',
18
+ fields: ['id', 'username', 'email', 'firstName', 'lastName']
13
19
  }
14
20
  },
15
21
  index: true
@@ -8,7 +8,8 @@
8
8
  "team": {
9
9
  "schema": "SumbaTeam",
10
10
  "propName": "id",
11
- "type": "one-to-one"
11
+ "type": "one-to-one",
12
+ "fields": ["id", "name"]
12
13
  }
13
14
  }
14
15
  }],
@@ -26,7 +26,6 @@
26
26
  "type": "string",
27
27
  "maxLength": 50,
28
28
  "index": true,
29
- "required": true,
30
29
  "default": "local"
31
30
  }, {
32
31
  "name": "email",
package/index.js CHANGED
@@ -494,6 +494,14 @@ async function factory (pkgName) {
494
494
  jobQueue.payload.data.download = { id: rec.data.id, file }
495
495
  await push(jobQueue)
496
496
  }
497
+
498
+ getApiKeyFromUserId = async id => {
499
+ const { hash } = this.app.bajoExtra
500
+ const { recordGet } = this.app.dobo
501
+ const options = { forceNoHidden: true, noHook: true, noCache: true, attachment: true, mimeType: true }
502
+ const resp = await recordGet('SumbaUser', id, options)
503
+ return await hash(resp.salt)
504
+ }
497
505
  }
498
506
  }
499
507
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sumba",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "Bajo Framework's Biz Suite",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,4 +8,7 @@
8
8
  }, {
9
9
  "path": "/your-stuff/**/*",
10
10
  "routeHandler": "restapi"
11
+ }, {
12
+ "path": "/manage/**/*",
13
+ "routeHandler": "restapi"
11
14
  }]
@@ -6,6 +6,10 @@ async function download () {
6
6
  description: async function (val, rec) {
7
7
  const sentence = `<c:a target="_blank" href="sumba:/your-stuff/download/get/${rec.file}" content="${val}" @click.stop />`
8
8
  return await this.component.buildSentence(sentence)
9
+ },
10
+ size: function (val, rec) {
11
+ const { formatByte } = this.plugin.app.bajoExtra
12
+ return formatByte(rec.size)
9
13
  }
10
14
  }
11
15
  },
@@ -4,11 +4,45 @@ async function teamUser () {
4
4
  layout: [
5
5
  { name: 'meta', fields: ['id', 'createdAt', 'updatedAt'] },
6
6
  { name: 'general', fields: ['userId:6-md', 'teamId:6-md'] }
7
- ]
7
+ ],
8
+ calcFields: [
9
+ { name: 'user', type: 'string' },
10
+ { name: 'team', type: 'string' }
11
+ ],
12
+ valueFormatter: {
13
+ user: (val, rec) => {
14
+ return rec._rel.user.username
15
+ },
16
+ team: (val, rec) => {
17
+ return rec._rel.team.name
18
+ }
19
+ },
20
+ widget: {
21
+ userId: {
22
+ component: 'form-select-ext',
23
+ attr: {
24
+ remoteUrl: 'sumba.restapi:/manage/user',
25
+ remoteSearchField: 'username',
26
+ remoteLabelField: 'username',
27
+ remoteApiKey: true,
28
+ rel: 'user:username'
29
+ }
30
+ },
31
+ teamId: {
32
+ component: 'form-select-ext',
33
+ attr: {
34
+ remoteUrl: 'sumba.restapi:/manage/team',
35
+ remoteSearchField: 'name',
36
+ remoteLabelField: 'name',
37
+ remoteApiKey: true,
38
+ rel: 'team:name'
39
+ }
40
+ }
41
+ }
8
42
  },
9
43
  view: {
10
44
  list: {
11
- fields: ['userId', 'teamId', 'createdAt', 'updatedAt'],
45
+ fields: ['user', 'team', 'createdAt', 'updatedAt'],
12
46
  stat: {
13
47
  aggregate: [
14
48
  { fields: ['userId'], group: 'userId', aggregate: ['count'] },
@@ -24,7 +24,7 @@
24
24
  "hidden": ["id", "createdAt", "updatedAt", "status"]
25
25
  },
26
26
  "edit": {
27
- "readonly": ["id", "createdAt", "updatedAt", "alias"]
27
+ "readonly": ["id", "createdAt", "updatedAt"]
28
28
  }
29
29
  }
30
30
  }
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "add": {
43
43
  "forceVisible": ["password"],
44
- "hidden": ["id", "createdAt", "updatedAt"]
44
+ "hidden": ["id", "createdAt", "updatedAt", "provider"]
45
45
  },
46
46
  "edit": {
47
47
  "forceVisible": ["password"],
@@ -0,0 +1,4 @@
1
+ {
2
+ "model": "SumbaTeam",
3
+ "disabled": ["create", "update", "remove"]
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "model": "SumbaUser",
3
+ "disabled": ["create", "update", "remove"]
4
+ }