sumba 1.1.19 → 1.1.20

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.
@@ -98,6 +98,7 @@
98
98
  "manageSite": "Manage Site",
99
99
  "manageUser": "Manage User",
100
100
  "manageTeam": "Manage Team",
101
+ "manageTeamUser": "Manage Team Member",
101
102
  "field": {
102
103
  "currentPassword": "Current Password",
103
104
  "newPassword": "New Password",
@@ -110,7 +111,8 @@
110
111
  "subject": "Subject",
111
112
  "message": "Message",
112
113
  "cat": "Category",
113
- "waPhone": "WA Phone"
114
+ "waPhone": "WA Phone",
115
+ "teamId": "Team ID"
114
116
  },
115
117
  "validation": {
116
118
  "password": {
package/bajo/intl/id.json CHANGED
@@ -99,6 +99,7 @@
99
99
  "manageSite": "Kelola Situs",
100
100
  "manageUser": "Kelola Pengguna",
101
101
  "manageTeam": "Kelola Tim",
102
+ "manageTeamUser": "Manage Anggota Tim",
102
103
  "field": {
103
104
  "currentPassword": "Kata Sandi Saat Ini",
104
105
  "newPassword": "Kata Sandi Baru",
@@ -111,7 +112,8 @@
111
112
  "subject": "Judul",
112
113
  "message": "Pesan",
113
114
  "cat": "Kategori",
114
- "waPhone": "WA Phone"
115
+ "waPhone": "WA Phone",
116
+ "teamId": "ID Tim"
115
117
  },
116
118
  "validation": {
117
119
  "password": {
@@ -1,5 +1,5 @@
1
1
  [{
2
2
  "userId": "?:SumbaUser::username:admin",
3
- "parentId": "?:SumbaTeam::alias:administrator",
3
+ "teamId": "?:SumbaTeam::alias:administrator",
4
4
  "siteId": "?:SumbaSite::alias:default"
5
5
  }]
@@ -1,15 +1,25 @@
1
1
  {
2
- "properties": [
3
- ],
2
+ "properties": [{
3
+ "name": "teamId",
4
+ "type": "string",
5
+ "maxLength": 50,
6
+ "required": true,
7
+ "rel": {
8
+ "team": {
9
+ "schema": "SumbaTeam",
10
+ "propName": "id",
11
+ "type": "one-to-one"
12
+ }
13
+ }
14
+ }],
4
15
  "indexes": [{
5
- "fields": ["userId", "siteId", "id"],
16
+ "fields": ["userId", "siteId", "teamId"],
6
17
  "unique": true
7
18
  }],
8
19
  "feature": {
9
20
  "createdAt": true,
10
21
  "updatedAt": true,
11
22
  "sumba.siteId": true,
12
- "sumba.userId": true,
13
- "sumba.parentId": true
23
+ "sumba.userId": true
14
24
  }
15
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sumba",
3
- "version": "1.1.19",
3
+ "version": "1.1.20",
4
4
  "description": "Bajo Framework's Biz Suite",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/plugin/factory.js CHANGED
@@ -78,6 +78,7 @@ async function factory (pkgName) {
78
78
  },
79
79
  waibuAdmin: {
80
80
  menuHandler: 'sumba:adminMenu',
81
+ menuCollapsible: true,
81
82
  modelDisabled: 'all'
82
83
  },
83
84
  auth: {
@@ -145,33 +146,25 @@ async function factory (pkgName) {
145
146
 
146
147
  adminMenu = async (locals, req) => {
147
148
  if (!this.app.waibuAdmin) return
148
- const { buildAccordionMenu } = this.app.waibuAdmin
149
-
150
- const allMenus = async (locals, req) => {
151
- const { runHook } = this.app.bajo
152
- const { getPluginPrefix } = this.app.waibu
153
- const prefix = getPluginPrefix(this.name)
154
- const menu = [{
155
- title: 'supportSystem',
156
- children: [
157
- { title: 'contactForm', href: `waibuAdmin:/${prefix}/contact-form/list` },
158
- { title: 'contactFormCat', href: `waibuAdmin:/${prefix}/contact-form-cat/list` },
159
- { title: 'ticket', href: `waibuAdmin:/${prefix}/ticket/list` },
160
- { title: 'ticketCat', href: `waibuAdmin:/${prefix}/ticket-cat/list` }
161
- ]
162
- }, {
163
- title: 'management',
164
- children: [
165
- { title: 'manageSite', href: `waibuAdmin:/${prefix}/site/list` },
166
- { title: 'manageUser', href: `waibuAdmin:/${prefix}/user/list` },
167
- { title: 'manageTeam', href: `waibuAdmin:/${prefix}/team/list` }
168
- ]
169
- }]
170
- await runHook(`${this.name}:afterAdminMenu`, menu, locals, req)
171
- return menu
172
- }
173
-
174
- return await buildAccordionMenu(await allMenus.call(this, locals, req), locals, req)
149
+ const { getPluginPrefix } = this.app.waibu
150
+ const prefix = getPluginPrefix(this.name)
151
+ return [{
152
+ title: 'supportSystem',
153
+ children: [
154
+ { title: 'contactForm', href: `waibuAdmin:/${prefix}/contact-form/list` },
155
+ { title: 'contactFormCat', href: `waibuAdmin:/${prefix}/contact-form-cat/list` },
156
+ { title: 'ticket', href: `waibuAdmin:/${prefix}/ticket/list` },
157
+ { title: 'ticketCat', href: `waibuAdmin:/${prefix}/ticket-cat/list` }
158
+ ]
159
+ }, {
160
+ title: 'management',
161
+ children: [
162
+ { title: 'manageSite', href: `waibuAdmin:/${prefix}/site/list` },
163
+ { title: 'manageUser', href: `waibuAdmin:/${prefix}/user/list` },
164
+ { title: 'manageTeam', href: `waibuAdmin:/${prefix}/team/list` },
165
+ { title: 'manageTeamUser', href: `waibuAdmin:/${prefix}/team-user/list` }
166
+ ]
167
+ }]
175
168
  }
176
169
 
177
170
  getUser = async (rec, safe = true) => {
@@ -0,0 +1,32 @@
1
+ async function teamUser () {
2
+ return {
3
+ common: {
4
+ hidden: ['siteId'],
5
+ layout: [
6
+ { name: 'meta', fields: ['id', 'createdAt', 'updatedAt'] },
7
+ { name: 'general', fields: ['userId:6-md', 'teamId:6-md'] }
8
+ ]
9
+ },
10
+ view: {
11
+ list: {
12
+ fields: ['userId', 'teamId', 'createdAt', 'updatedAt'],
13
+ stat: {
14
+ aggregate: [
15
+ { fields: ['userId'], group: 'userId', aggregate: ['count'] },
16
+ { fields: ['teamId'], group: 'teamId', aggregate: ['count'] }
17
+ ]
18
+ }
19
+ },
20
+ details: {
21
+ },
22
+ add: {
23
+ hidden: ['id', 'createdAt', 'updatedAt']
24
+ },
25
+ edit: {
26
+ readonly: ['id', 'createdAt', 'updatedAt']
27
+ }
28
+ }
29
+ }
30
+ }
31
+
32
+ export default teamUser
@@ -0,0 +1,31 @@
1
+ {
2
+ "common": {
3
+ "hidden": ["siteId"],
4
+ "layout": [
5
+ { "name": "meta", "fields": ["id", "createdAt", "updatedAt", "status"] },
6
+ { "name": "general", "fields": ["alias:6-md", "name:6-md"] }
7
+ ]
8
+ },
9
+ "view": {
10
+ "list": {
11
+ "qs": {
12
+ "sort": "alias:1",
13
+ "limit": 10
14
+ },
15
+ "fields": ["alias", "name", "status", "createdAt", "updatedAt"],
16
+ "stat": {
17
+ "aggregate": [
18
+ { "fields": ["status"], "group": "status", "aggregate": ["count"] }
19
+ ]
20
+ }
21
+ },
22
+ "details": {
23
+ },
24
+ "add": {
25
+ "hidden": ["id", "createdAt", "updatedAt", "status"]
26
+ },
27
+ "edit": {
28
+ "readonly": ["id", "createdAt", "updatedAt", "alias"]
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,11 @@
1
+ const action = {
2
+ method: ['GET', 'POST'],
3
+ title: 'manageTeam',
4
+ handler: async function (req, reply) {
5
+ const { importModule } = this.app.bajo
6
+ const crudSkel = await importModule('waibuAdmin:/lib/crud-skel.js')
7
+ return await crudSkel.call(this, 'SumbaTeam', req, reply)
8
+ }
9
+ }
10
+
11
+ export default action
@@ -0,0 +1,11 @@
1
+ const action = {
2
+ method: ['GET', 'POST'],
3
+ title: 'manageTeamUser',
4
+ handler: async function (req, reply) {
5
+ const { importModule } = this.app.bajo
6
+ const crudSkel = await importModule('waibuAdmin:/lib/crud-skel.js')
7
+ return await crudSkel.call(this, 'SumbaTeamUser', req, reply)
8
+ }
9
+ }
10
+
11
+ export default action
@@ -1,19 +0,0 @@
1
- async function parentId (opts = {}) {
2
- return {
3
- properties: [{
4
- name: 'parentId',
5
- type: 'string',
6
- maxLength: 50,
7
- rel: {
8
- site: {
9
- schema: 'SumbaSite',
10
- propName: 'id',
11
- type: 'one-to-one'
12
- }
13
- },
14
- index: true
15
- }]
16
- }
17
- }
18
-
19
- export default parentId