sumba 1.1.10 → 1.1.12

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.
@@ -87,6 +87,7 @@
87
87
  "catQuestion": "General Question",
88
88
  "catMisc": "Misc",
89
89
  "catTechnical": "Technical Problem",
90
+ "activation": "Activation",
90
91
  "field": {
91
92
  "currentPassword": "Current Password",
92
93
  "newPassword": "New Password",
package/bajo/intl/id.json CHANGED
@@ -88,6 +88,7 @@
88
88
  "catQuestion": "Pertanyaan Umum",
89
89
  "catMisc": "Lain-lain",
90
90
  "catTechnical": "Masalah Teknis",
91
+ "activation": "Aktivasi",
91
92
  "field": {
92
93
  "currentPassword": "Kata Sandi Saat Ini",
93
94
  "newPassword": "Kata Sandi Baru",
@@ -1,6 +1,6 @@
1
1
  <c:form referer enctype="multipart/form-data">
2
2
  <c:grid-row>
3
- <c:grid-col col="8-md">
3
+ <c:grid-col col="9-md">
4
4
  <c:fieldset t:legend="meta" grid-gutter="2" margin="bottom-3">
5
5
  <c:form-plaintext name="createdAt" label-floating col="6-md"/>
6
6
  <c:form-plaintext name="updatedAt" label-floating col="6-md"/>
@@ -22,7 +22,7 @@
22
22
  <c:form-input name="website" label-floating col="6-lg"/>
23
23
  </c:fieldset>
24
24
  </c:grid-col>
25
- <c:grid-col col="4-md">
25
+ <c:grid-col col="3-md">
26
26
  <c:heading type="5" t:content="image" />
27
27
  <c:div border rounded flex="justify-content:center">
28
28
  <c:img src="dobo:/attachment/SumbaUser/<%= form.id %>/profile/main.png?notfound=sumba.asset:/user-profile.png" responsive rounded />
@@ -1,5 +1,5 @@
1
1
  <c:grid-row gutter="4">
2
- <c:grid-col col="8-md">
2
+ <c:grid-col col="9-md">
3
3
  <c:fieldset t:legend="meta" grid-gutter="2" margin="bottom-3">
4
4
  <c:form-plaintext name="createdAt" label-floating col="6-md"/>
5
5
  <c:form-plaintext name="updatedAt" label-floating col="6-md"/>
@@ -21,7 +21,7 @@
21
21
  <c:form-plaintext name="website" label-floating col="6-lg"/>
22
22
  </c:fieldset>
23
23
  </c:grid-col>
24
- <c:grid-col col="4-md">
24
+ <c:grid-col col="3-md">
25
25
  <c:heading type="5" t:content="image" />
26
26
  <c:div border rounded flex="justify-content:center">
27
27
  <c:img src="dobo:/attachment/SumbaUser/<%= form.id %>/profile/main.png?notfound=sumba.asset:/user-profile.png" responsive rounded />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sumba",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "Bajo Framework's Biz Suite",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/plugin/factory.js CHANGED
@@ -28,7 +28,7 @@ async function factory (pkgName) {
28
28
  constructor () {
29
29
  super(pkgName, me.app)
30
30
  this.alias = 'sumba'
31
- this.dependencies = ['waibu', 'waibu-db', 'bajo-extra', 'bajo-common-db']
31
+ this.dependencies = ['bajo-extra', 'bajo-common-db']
32
32
  this.config = {
33
33
  multiSite: false,
34
34
  waibu: {
@@ -169,15 +169,6 @@ async function factory (pkgName) {
169
169
  return { token, expiresAt }
170
170
  }
171
171
 
172
- // based on: https://medium.com/@paulohfev/problem-solving-how-to-create-an-excerpt-fdb048687928
173
- createExcerpt = (content, maxWords = 100, trailChars = '...') => {
174
- const listOfWords = content.trim().split(' ')
175
- const truncatedContent = listOfWords.slice(0, maxWords).join(' ')
176
- const excerpt = truncatedContent + trailChars
177
- const output = listOfWords.length > maxWords ? excerpt : content
178
- return output
179
- }
180
-
181
172
  verifySession = async (req, reply, source, payload) => {
182
173
  const { getUser } = this
183
174
  const { routePath } = this.app.waibu
@@ -4,6 +4,7 @@ const list = {
4
4
  method: ['GET'],
5
5
  handler: async function (req, reply) {
6
6
  const { recordFind, getSchemaExt } = this.app.waibuDb
7
+ const { getExcerpt } = this.app.bajoTemplate
7
8
  const { schema } = await getSchemaExt(model, 'list')
8
9
  const options = { count: true }
9
10
  const list = await recordFind({ model, req, options })
@@ -12,7 +13,7 @@ const list = {
12
13
  schema.view.label = { subject: 'Your Message' }
13
14
  schema.view.formatter = {
14
15
  subject: (val, rec) => {
15
- return `<strong>${val}</strong><br />${this.createExcerpt(rec.message, 35)}`
16
+ return `<strong>${val}</strong><br />${getExcerpt(rec.message, 35)}`
16
17
  }
17
18
  }
18
19
  return reply.view('sumba.template:/help/trouble-tickets/list.html', { list, schema })