sumba 2.32.3 → 2.33.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.
- package/extend/bajo/hook.js +7 -2
- package/extend/bajo/intl/en-US.json +2 -1
- package/extend/bajo/intl/id.json +2 -1
- package/extend/dobo/feature/site-id.js +3 -2
- package/extend/dobo/fixture/team-user.json +2 -2
- package/extend/waibuDb/schema/site-setting.js +15 -0
- package/extend/waibuMpa/extend/waibuAdmin/route/x/site-setting/@action.js +12 -0
- package/index.js +1 -0
- package/lib/create-new-site.js +2 -2
- package/package.json +1 -1
- package/wiki/CHANGES.md +8 -1
package/extend/bajo/hook.js
CHANGED
|
@@ -40,8 +40,13 @@ async function applyModelGuard ({ model, q, teamIds, options }) {
|
|
|
40
40
|
for (const field of fields) {
|
|
41
41
|
if (!model.getNonVirtualProperties(true).includes(field)) continue // or, should it throws exception instead?
|
|
42
42
|
const opValue = req.getSetting(`sumba:modelGuard.${field}`, {})
|
|
43
|
-
for (const op of ['in', 'nin']) {
|
|
44
|
-
if (
|
|
43
|
+
for (const op of ['in', 'nin', 'inOrNull']) {
|
|
44
|
+
if (isEmpty(opValue[op]) || !isArray(opValue[op])) continue
|
|
45
|
+
if (op === 'inOrNull') {
|
|
46
|
+
const val = set({}, field, set({}, '$in', opValue[op]))
|
|
47
|
+
const nl = set({}, field, { $eq: null })
|
|
48
|
+
results.push({ $or: [val, nl] })
|
|
49
|
+
} else results.push(set({}, field, set({}, '$' + op, opValue[op])))
|
|
45
50
|
}
|
|
46
51
|
const prop = model.getProperty(field)
|
|
47
52
|
const items = rules.filter(item => item.field === field)
|
package/extend/bajo/intl/id.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[{
|
|
2
2
|
"siteId": "?:SumbaSite::alias:default",
|
|
3
|
-
"userId": "?:SumbaUser::username:
|
|
4
|
-
"teamId": "?:SumbaTeam::alias:
|
|
3
|
+
"userId": "?:SumbaUser::username:admin+siteId:'{siteId}'",
|
|
4
|
+
"teamId": "?:SumbaTeam::alias:administrator+siteId:'{siteId}'",
|
|
5
5
|
"_immutable": ["*"]
|
|
6
6
|
}]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const action = {
|
|
2
|
+
method: ['GET', 'POST'],
|
|
3
|
+
title: 'siteSetting',
|
|
4
|
+
xSite: true,
|
|
5
|
+
handler: async function (req, reply) {
|
|
6
|
+
const { importModule } = this.app.bajo
|
|
7
|
+
const crudSkel = await importModule('waibuAdmin:/lib/crud-skel.js')
|
|
8
|
+
return await crudSkel.call(this, 'SumbaSiteSetting', req, reply)
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default action
|
package/index.js
CHANGED
|
@@ -351,6 +351,7 @@ async function factory (pkgName) {
|
|
|
351
351
|
title: 'xSite',
|
|
352
352
|
children: [
|
|
353
353
|
{ title: 'allSites', href: `waibuAdmin:/${prefix}/x/site/:action`, params },
|
|
354
|
+
{ title: 'siteSetting', href: `waibuAdmin:/${prefix}/x/site-setting/:action`, params },
|
|
354
355
|
sessionMenu
|
|
355
356
|
]
|
|
356
357
|
})
|
package/lib/create-new-site.js
CHANGED
|
@@ -60,8 +60,8 @@ export async function createRefs (site, data, options, verbose) {
|
|
|
60
60
|
const mdl = getModel(m)
|
|
61
61
|
const fixtures = data[m]
|
|
62
62
|
for (const f of fixtures) {
|
|
63
|
-
f.siteId = site.id
|
|
64
|
-
const lv = {}
|
|
63
|
+
f.siteId = site.id + ''
|
|
64
|
+
const lv = { siteId: f.siteId }
|
|
65
65
|
for (const key in f) {
|
|
66
66
|
const val = f[key]
|
|
67
67
|
if (isString(val) && val.slice(0, 2) === '?:') f[key] = await mdl._simpleLookup(val.slice(2), lv, options)
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
-
## 2026-06-
|
|
3
|
+
## 2026-06-17
|
|
4
|
+
|
|
5
|
+
- [2.33.0] Add ```Site Setting``` in ```Cross-Site```
|
|
6
|
+
- [2.33.0] Bug fix in ```hook.js```
|
|
7
|
+
- [2.33.0] Bug fix in ```feature:siteId```
|
|
8
|
+
|
|
9
|
+
## 2026-06-15
|
|
4
10
|
|
|
5
11
|
- [2.32.3] Bug fix in ```hook.js```
|
|
12
|
+
- [2.32.4] Bug fix in ```create-new-site.js```
|
|
6
13
|
|
|
7
14
|
## 2026-06-12
|
|
8
15
|
|