Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
39 lines
817 B
JavaScript
39 lines
817 B
JavaScript
'use strict';
|
|
|
|
var util = require('./_util');
|
|
|
|
module.exports = function defFunc(ajv) {
|
|
if (ajv.RULES.keywords.switch && ajv.RULES.keywords.if) return;
|
|
|
|
var metaSchemaRef = util.metaSchemaRef(ajv);
|
|
|
|
defFunc.definition = {
|
|
inline: require('./dotjs/switch'),
|
|
statements: true,
|
|
errors: 'full',
|
|
metaSchema: {
|
|
type: 'array',
|
|
items: {
|
|
required: [ 'then' ],
|
|
properties: {
|
|
'if': metaSchemaRef,
|
|
'then': {
|
|
anyOf: [
|
|
{ type: 'boolean' },
|
|
metaSchemaRef
|
|
]
|
|
},
|
|
'continue': { type: 'boolean' }
|
|
},
|
|
additionalProperties: false,
|
|
dependencies: {
|
|
'continue': [ 'if' ]
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
ajv.addKeyword('switch', defFunc.definition);
|
|
return ajv;
|
|
};
|