waibu-db 2.8.2 → 2.9.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.
|
@@ -17,21 +17,14 @@ async function btnColumns () {
|
|
|
17
17
|
return
|
|
18
18
|
}
|
|
19
19
|
let fields = without(get(this, `component.locals._meta.query.${qsKey.fields}`, '').split(','), '')
|
|
20
|
-
if (isEmpty(fields)) fields = schema.view.fields
|
|
20
|
+
if (isEmpty(fields)) fields = without(schema.view.fields, 'id')
|
|
21
21
|
const items = []
|
|
22
22
|
this.params.attr.color = this.params.attr.color ?? 'secondary-outline'
|
|
23
23
|
if (isEmpty(this.params.attr.content)) this.params.attr.content = req.t('columns')
|
|
24
24
|
for (const f of schema.view.fields) {
|
|
25
|
-
if (!fields.includes(f)) continue
|
|
26
25
|
let prop = find(schema.properties, { name: f })
|
|
27
26
|
if (!prop) prop = find(schema.view.calcFields, { name: f })
|
|
28
27
|
if (!prop) continue
|
|
29
|
-
/*
|
|
30
|
-
if (f === 'id') {
|
|
31
|
-
items.push(await this.component.buildTag({ tag: 'formCheck', attr: { checked: true, label: req.t('ID'), value: f, disabled: true } }))
|
|
32
|
-
continue
|
|
33
|
-
}
|
|
34
|
-
*/
|
|
35
28
|
const attr = { 'x-model': 'selected', label: req.t(get(schema, `view.label.${f}`, `field.${f}`)), value: f }
|
|
36
29
|
if (fields.includes(f)) attr.checked = true
|
|
37
30
|
items.push(await this.component.buildTag({ tag: 'formCheck', attr }))
|
|
@@ -74,7 +74,7 @@ async function table () {
|
|
|
74
74
|
}
|
|
75
75
|
const qsKey = this.app.waibu.config.qsKey
|
|
76
76
|
let fields = without(get(this, `component.locals._meta.query.${qsKey.fields}`, '').split(','), '')
|
|
77
|
-
if (isEmpty(fields)) fields = schema.view.fields
|
|
77
|
+
if (isEmpty(fields)) fields = without(schema.view.fields, 'id')
|
|
78
78
|
let sort = this.params.attr.sort ? attrToArray(this.params.attr.sort) : get(this, `component.locals._meta.query.${qsKey.sort}`, '')
|
|
79
79
|
if (isEmpty(sort) && filter.sort) {
|
|
80
80
|
const keys = Object.keys(filter.sort)
|
|
@@ -175,7 +175,7 @@ async function getSchemaExt (modelName, view, options = {}) {
|
|
|
175
175
|
|
|
176
176
|
const model = isString(modelName) ? this.app.dobo.getModel(modelName) : modelName
|
|
177
177
|
const schema = pick(model, ['name', 'properties', 'indexes', 'disabled', 'attachment', 'sortables', 'view', 'hidden'])
|
|
178
|
-
const base = path.basename(model.file, path.extname(model.file))
|
|
178
|
+
const base = options.base ?? path.basename(model.file, path.extname(model.file))
|
|
179
179
|
let ext = await readConfig(`${model.plugin.ns}:/extend/waibuDb/schema/${base}.*`, { ignoreError: true, options })
|
|
180
180
|
const over = await readConfig(`main:/extend/waibuDb/extend/${model.plugin.ns}/schema/${base}.*`, { ignoreError: true, options })
|
|
181
181
|
ext = defaultsDeep(options.schema ?? {}, over, ext)
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-03-15
|
|
4
|
+
|
|
5
|
+
- [2.9.0] Add ability to overwrite ```base``` through ```options```
|
|
6
|
+
- [2.9.0] Bug fix in ```wdb-btn-columns``` widget
|
|
7
|
+
- [2.9.0] Bug fix in ```wdb-table``` widget
|
|
8
|
+
|
|
3
9
|
## 2026-03-08
|
|
4
10
|
|
|
5
11
|
- [2.8.1] Bug fix in ```build-params.js```
|