sumba 2.17.0 → 2.18.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.
@@ -135,6 +135,7 @@
135
135
  "statusDisabled": "Disabled",
136
136
  "statusOpen": "Open",
137
137
  "statusClosed": "Closed",
138
+ "allSites": "All Sites",
138
139
  "field": {
139
140
  "currentPassword": "Current Password",
140
141
  "newPassword": "New Password",
@@ -136,6 +136,7 @@
136
136
  "statusDisabled": "Dimatikan",
137
137
  "statusOpen": "Terbuka",
138
138
  "statusClosed": "Tertutup",
139
+ "allSites": "Semua Situs",
139
140
  "field": {
140
141
  "currentPassword": "Kata Sandi Saat Ini",
141
142
  "newPassword": "Kata Sandi Baru",
@@ -5,7 +5,7 @@ async function siteId (opts = {}) {
5
5
  type: 'string',
6
6
  maxLength: 50,
7
7
  ref: {
8
- site: {
8
+ siteDetail: {
9
9
  model: 'SumbaSite',
10
10
  field: 'id',
11
11
  type: '1:1'
@@ -2,7 +2,7 @@ async function download () {
2
2
  return {
3
3
  common: {
4
4
  disabled: ['create', 'update', 'get'],
5
- formatter: {
5
+ format: {
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)
@@ -1,24 +1,4 @@
1
1
  async function site (req = {}) {
2
- const isInterSite = (req.url ?? '').includes('/_is_/')
3
- let details
4
- let edit
5
- if (!isInterSite) {
6
- details = {
7
- control: {
8
- noBackBtn: true,
9
- noCloneBtn: true,
10
- editHref: 'waibuAdmin:/site/site?edit=true'
11
- }
12
- }
13
- edit = {
14
- control: {
15
- noBackBtn: true,
16
- noCloneBtn: true,
17
- detailsHref: 'waibuAdmin:/site/site'
18
- },
19
- readonly: ['id', 'createdAt', 'updatedAt']
20
- }
21
- }
22
2
  const result = {
23
3
  common: {
24
4
  attachment: true,
@@ -29,10 +9,6 @@ async function site (req = {}) {
29
9
  { 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'] },
30
10
  { name: 'socialMedia', fields: ['socX:3-md 6-sm', 'socInstagram:3-md 6-sm', 'socFacebook:3-md 6-sm', 'socLinkedIn:3-md 6-sm'] }
31
11
  ]
32
- },
33
- view: {
34
- details,
35
- edit
36
12
  }
37
13
  }
38
14
  return result
@@ -8,7 +8,7 @@ async function teamUser () {
8
8
  calcFields: [
9
9
  { name: 'team', type: 'string' }
10
10
  ],
11
- valueFormatter: {
11
+ formatValue: {
12
12
  team: (val, rec) => {
13
13
  return rec._ref.team.name
14
14
  }
@@ -8,7 +8,7 @@ async function teamUser ({ req } = {}) {
8
8
  calcFields: [
9
9
  { name: 'user', type: 'string' }
10
10
  ],
11
- valueFormatter: {
11
+ formatValue: {
12
12
  user: (val, rec) => {
13
13
  return rec._ref.user.name
14
14
  }
@@ -7,7 +7,7 @@ async function user ({ req } = {}) {
7
7
  { 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'] },
8
8
  { name: 'socialMedia', fields: ['socX:3-md 6-sm', 'socInstagram:3-md 6-sm', 'socFacebook:3-md 6-sm', 'socLinkedIn:3-md 6-sm'] }
9
9
  ],
10
- valueFormatter: {
10
+ formatValue: {
11
11
  token: async function (val, rec) {
12
12
  const { hash } = this.app.bajoExtra
13
13
  return await hash(rec.salt)
@@ -11,7 +11,51 @@ const manageSite = {
11
11
  req.params.id = req.site.id
12
12
  req.query.id = req.site.id
13
13
  req.params.base = ''
14
- return await action.call(this, { req, reply, model, template })
14
+ const options = {
15
+ modelOpts: {
16
+ formatValue: true,
17
+ retainOriginalValue: true
18
+ },
19
+ schema: {
20
+ view: {
21
+ details: {
22
+ control: {
23
+ wdbBtnBack: {
24
+ disabled: true
25
+ },
26
+ wdbBtnClone: {
27
+ disabled: true
28
+ },
29
+ wdbBtnDelete: {
30
+ disabled: true
31
+ },
32
+ wdbBtnEdit: {
33
+ href: 'waibuAdmin:/site/site?edit=true'
34
+ }
35
+ }
36
+ },
37
+ edit: {
38
+ control: {
39
+ wdbBtnBack: {
40
+ disabled: true
41
+ },
42
+ wdbBtnClone: {
43
+ disabled: true
44
+ },
45
+ wdbBtnDelete: {
46
+ disabled: true
47
+ },
48
+ wdbBtnDetails: {
49
+ href: 'waibuAdmin:/site/site'
50
+ }
51
+ },
52
+ readonly: ['id', 'createdAt', 'updatedAt']
53
+ }
54
+ }
55
+ }
56
+ }
57
+
58
+ return await action.call(this, { req, reply, model, template, options })
15
59
  }
16
60
  }
17
61
 
@@ -26,7 +26,7 @@ const id = {
26
26
  schema.view.disabled = ['update', 'remove']
27
27
  schema.view.fields = ['createdAt']
28
28
  schema.view.label = { createdAt: 'conversation' }
29
- schema.view.formatter = {
29
+ schema.view.format = {
30
30
  createdAt: async function (val, rec) {
31
31
  const message = this.app.bajoMarkdown ? this.app.bajoMarkdown.parseContent(rec.message) : rec.message
32
32
  const isMe = rec.userId === req.user.id
@@ -11,7 +11,7 @@ const list = {
11
11
  schema.view.disabled = ['update', 'remove']
12
12
  schema.view.fields = ['createdAt', 'subject', 'status']
13
13
  schema.view.label = { subject: 'Your Message' }
14
- schema.view.formatter = {
14
+ schema.view.format = {
15
15
  subject: (val, rec) => {
16
16
  return `<strong>${val}</strong><br />${getExcerpt(rec.message, 35)}`
17
17
  }
package/index.js CHANGED
@@ -209,7 +209,8 @@ async function factory (pkgName) {
209
209
  title: 'manageSite',
210
210
  children: [
211
211
  { title: 'siteProfile', href: `waibuAdmin:/${prefix}/site` },
212
- { title: 'siteSetting', href: `waibuAdmin:/${prefix}/site-setting/list` }
212
+ { title: 'siteSetting', href: `waibuAdmin:/${prefix}/site-setting/list` },
213
+ { title: 'allSites', href: `waibuAdmin:/${prefix}/all-sites/list` }
213
214
  ]
214
215
  }, {
215
216
  title: 'manageUser',
@@ -236,25 +237,13 @@ async function factory (pkgName) {
236
237
  }, {
237
238
  title: 'misc',
238
239
  children: [
239
- { title: 'manageDownload', href: `waibuAdmin:/${prefix}/download/list` }
240
- ]
241
- }, {
242
- title: 'manageAllSite',
243
- interSite: true,
244
- href: `waibuAdmin:/${prefix}/_is_/site/list`
245
- }, {
246
- title: '-',
247
- interSite: true
248
- }, {
249
- title: 'misc',
250
- interSite: true,
251
- children: [
252
- { title: 'userSession', href: `waibuAdmin:/${prefix}/_is_/session/list` }
240
+ { title: 'manageDownload', href: `waibuAdmin:/${prefix}/download/list` },
241
+ { title: 'userSession', href: `waibuAdmin:/${prefix}/session/list` }
253
242
  ]
254
243
  }]
255
244
  if (this.app.bajoCache) {
256
245
  const item = items.find(i => i.title === 'misc')
257
- if (item) item.children.push({ title: 'cacheStorage', href: `waibuAdmin:/${prefix}/_is_/cache/list` })
246
+ if (item) item.children.push({ title: 'cacheStorage', href: `waibuAdmin:/${prefix}/cache/list` })
258
247
  }
259
248
  return items
260
249
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sumba",
3
- "version": "2.17.0",
3
+ "version": "2.18.0",
4
4
  "description": "Biz Suite for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-04-11
4
+
5
+ - [2.18.0] Some major rewrites :/
6
+
3
7
  ## 2026-04-07
4
8
 
5
9
  - [2.17.0] Change all ```opts.fieldName``` to ```opts.field``` in features