waibu-mpa 2.15.0 → 2.15.2
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.
- package/lib/build-routes.js +1 -1
- package/lib/class/component.js +2 -2
- package/lib/class/widget/page-end.js +1 -1
- package/lib/class/widget.js +2 -1
- package/lib/error-handler.js +4 -6
- package/package.json +1 -1
- package/wiki/CHANGES.md +9 -0
package/lib/build-routes.js
CHANGED
|
@@ -45,7 +45,7 @@ export async function build ({ files, pathPrefix, dir, ns, cfg, parent, urlPrefi
|
|
|
45
45
|
m.config.prefix = getPluginPrefix(ns)
|
|
46
46
|
m.config.pathSrc = m.url
|
|
47
47
|
m.config.webApp = parent ?? ns
|
|
48
|
-
m.config.
|
|
48
|
+
m.config.xSite = m.xSite
|
|
49
49
|
m.config.ns = ns
|
|
50
50
|
m.config.subNs = ''
|
|
51
51
|
m.config.title = m.title ?? camelCase(last(m.url.split('/')))
|
package/lib/class/component.js
CHANGED
|
@@ -105,7 +105,7 @@ async function componentFactory () {
|
|
|
105
105
|
await this.iconAttr(params, method)
|
|
106
106
|
await this.beforeBuildTag(method, params)
|
|
107
107
|
const Widget = await this.getWidget(method)
|
|
108
|
-
const widget = new Widget({ component: this, params })
|
|
108
|
+
const widget = new Widget({ component: this, params, options: opts })
|
|
109
109
|
const resp = await widget.build()
|
|
110
110
|
if (resp === false) {
|
|
111
111
|
return false
|
|
@@ -243,7 +243,7 @@ async function componentFactory () {
|
|
|
243
243
|
return { value: item, text: (item + '') }
|
|
244
244
|
})
|
|
245
245
|
}
|
|
246
|
-
if (!isEmpty(prop)
|
|
246
|
+
if (!isEmpty(prop)) options.unshift({ value: '', text: '_blank_' })
|
|
247
247
|
for (const opt of options) {
|
|
248
248
|
const sel = find(values, v => opt.value === v)
|
|
249
249
|
const ttext = camelCase(`${prop.name} ${opt.text}`)
|
|
@@ -23,7 +23,7 @@ async function pageEndFactory () {
|
|
|
23
23
|
let tc = ''
|
|
24
24
|
if (!this.params.attr.noToastContainer && widget.toastStack && widget.toast) {
|
|
25
25
|
const toasts = []
|
|
26
|
-
if (get(locals, 'error')) {
|
|
26
|
+
if (get(locals, 'error') && get(locals, '_meta.flash.notify')) {
|
|
27
27
|
const details = get(locals.error, 'details', [])
|
|
28
28
|
if (details.length > 0) {
|
|
29
29
|
const list = [`<ul class="m-0 ${details.length === 1 ? 'list-unstyled' : ''}">`]
|
package/lib/class/widget.js
CHANGED
|
@@ -10,7 +10,7 @@ async function widgetFactory () {
|
|
|
10
10
|
static inlineScript = null
|
|
11
11
|
static inlineCss = null
|
|
12
12
|
|
|
13
|
-
constructor ({ component = {}, params = {} } = {}) {
|
|
13
|
+
constructor ({ component = {}, params = {}, options = {} } = {}) {
|
|
14
14
|
super(component.plugin)
|
|
15
15
|
const names = kebabCase(this.constructor.name).split('-')
|
|
16
16
|
const alias = names.length > 1 ? names[0] : 'wbs'
|
|
@@ -21,6 +21,7 @@ async function widgetFactory () {
|
|
|
21
21
|
this.component = component
|
|
22
22
|
this.params = params
|
|
23
23
|
this.block = {}
|
|
24
|
+
this.options = options
|
|
24
25
|
this.setting = this._parseBase64Attr(this.params.attr.setting)
|
|
25
26
|
this.formData = get(this, `component.locals.${this.params.attr.keyLocals ?? 'form'}`, {})
|
|
26
27
|
this.oldData = get(this, `component.locals.${this.params.attr.keyOldData ?? 'oldData'}`, {})
|
package/lib/error-handler.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import notFoundHandler from './not-found-handler.js'
|
|
2
2
|
|
|
3
3
|
async function errorHandler (err, req, reply) {
|
|
4
|
-
const {
|
|
5
|
-
const { resolveTemplate, compile } = this.app.bajoTemplate
|
|
4
|
+
const { resolveTemplate } = this.app.bajoTemplate
|
|
6
5
|
err.statusCode = err.statusCode ?? 500
|
|
7
6
|
reply.code(err.statusCode)
|
|
8
7
|
reply.header('Content-Type', `text/html; charset=${this.config.page.charset}`)
|
|
@@ -16,12 +15,11 @@ async function errorHandler (err, req, reply) {
|
|
|
16
15
|
// let result
|
|
17
16
|
let tpl = `${ns}.template:/${err.statusCode ?? 500}.html`
|
|
18
17
|
try {
|
|
19
|
-
|
|
18
|
+
resolveTemplate(tpl)
|
|
20
19
|
} catch (err) {
|
|
21
|
-
tpl =
|
|
20
|
+
tpl = `${this.ns}.template:/500.html`
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
return await compile(content, { error: err })
|
|
22
|
+
return reply.view(tpl, { error: err }, { noFlash: true })
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
export default errorHandler
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-05-22
|
|
4
|
+
|
|
5
|
+
- [2.15.2] Bug fix in ```error-handler.js```
|
|
6
|
+
- [2.15.2] Bug fix in ```component.buildTag()```
|
|
7
|
+
|
|
8
|
+
## 2026-05-16
|
|
9
|
+
|
|
10
|
+
- [2.15.1] Bug fix in ```component.js```
|
|
11
|
+
|
|
3
12
|
## 2026-05-11
|
|
4
13
|
|
|
5
14
|
- [2.15.0] Updates to match ```dobo@2.23.0``` specs
|