sumba 1.2.10 → 1.2.11

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.
@@ -0,0 +1,12 @@
1
+ async function afterBuildPagesMenu (pages, req) {
2
+ if (!this.config.license) return
3
+ const { find } = this.lib._
4
+ const item = find(pages, { title: 'help' })
5
+ if (!item) return
6
+ item.children.push(
7
+ { title: '-' },
8
+ { title: 'license', href: 'sumba:/info/license' }
9
+ )
10
+ }
11
+
12
+ export default afterBuildPagesMenu
@@ -106,6 +106,8 @@
106
106
  "contactFormSubmitted": "Contact form successfully submitted",
107
107
  "currentApiKey": "Current API Key",
108
108
  "downloadList": "Download List",
109
+ "manageDownload": "Manage Download",
110
+ "license": "License",
109
111
  "field": {
110
112
  "currentPassword": "Current Password",
111
113
  "newPassword": "New Password",
package/bajo/intl/id.json CHANGED
@@ -107,6 +107,8 @@
107
107
  "contactFormSubmitted": "Form kontak sukses dikirim",
108
108
  "currentApiKey": "Kunci API Saat Ini",
109
109
  "downloadList": "Daftar Unduh",
110
+ "manageDownload": "Kelola Unduhan",
111
+ "license": "Lisensi",
110
112
  "field": {
111
113
  "currentPassword": "Kata Sandi Saat Ini",
112
114
  "newPassword": "Kata Sandi Baru",
package/index.js CHANGED
@@ -10,6 +10,7 @@ async function factory (pkgName) {
10
10
  this.dependencies = ['bajo-extra', 'bajo-common-db', 'bajo-config']
11
11
  this.config = {
12
12
  multiSite: false,
13
+ license: false,
13
14
  waibu: {
14
15
  title: 'Sumba',
15
16
  prefix: 'site'
@@ -169,6 +170,7 @@ async function factory (pkgName) {
169
170
  { title: 'manageUser', href: `waibuAdmin:/${prefix}/user/list` },
170
171
  { title: 'manageTeam', href: `waibuAdmin:/${prefix}/team/list` },
171
172
  { title: 'manageTeamUser', href: `waibuAdmin:/${prefix}/team-user/list` },
173
+ { title: 'manageDownload', href: `waibuAdmin:/${prefix}/download/list` },
172
174
  { title: 'resetUserPassword', href: `waibuAdmin:/${prefix}/reset-user-password` }
173
175
  ]
174
176
  }]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sumba",
3
- "version": "1.2.10",
3
+ "version": "1.2.11",
4
4
  "description": "Bajo Framework's Biz Suite",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -2,10 +2,9 @@ async function download () {
2
2
  return {
3
3
  common: {
4
4
  disabled: ['create', 'update', 'get'],
5
- hidden: ['id'],
6
5
  formatter: {
7
6
  description: async function (val, rec) {
8
- const sentence = `<c:a target="_blank" href="sumba:/your-stuff/download/get/${rec.file}" content="${val}" />`
7
+ const sentence = `<c:a target="_blank" href="sumba:/your-stuff/download/get/${rec.file}" content="${val}" @click.stop />`
9
8
  return await this.component.buildSentence(sentence)
10
9
  }
11
10
  }
@@ -0,0 +1,11 @@
1
+ const action = {
2
+ method: ['GET', 'POST'],
3
+ title: 'manageDownload',
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, 'SumbaDownload', req, reply)
8
+ }
9
+ }
10
+
11
+ export default action
@@ -0,0 +1,10 @@
1
+ async function license (req, reply) {
2
+ if (!this.config.license) throw this.error('_notFound')
3
+ const { fs } = this.lib
4
+ const base = `${this.app.main.dir.pkg}/../LICENSE`
5
+ let tpl = `${base}.${req.lang}.md`
6
+ if (!fs.existsSync(tpl)) tpl = `${base}.md`
7
+ return await reply.view(tpl, { page: { title: req.t('license') }, license: this.config.license })
8
+ }
9
+
10
+ export default license
@@ -5,7 +5,8 @@ const download = {
5
5
  const crudSkel = await importModule('waibuAdmin:/lib/crud-skel.js')
6
6
  const layoutTpl = 'main.layout:/with-addons.html'
7
7
  const tpl = 'waibuAdmin.template:/crud/list-notitle.html'
8
- return await crudSkel.call(this, 'SumbaDownload', req, reply, { tpl, layoutTpl, title: req.t('downloadList') })
8
+ const options = { forceShowId: false, hidden: ['id'] }
9
+ return await crudSkel.call(this, 'SumbaDownload', req, reply, { tpl, layoutTpl, title: req.t('downloadList'), options })
9
10
  }
10
11
  }
11
12