Skip to content

Commit

Permalink
Update M500__JsonConfig.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm1957 committed Nov 1, 2024
1 parent 268e9b2 commit 03663ed
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/M500__JsonConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,13 @@ function checkComponent(context, path, jsonConfig) {

}

function checkPanel(context, path, jsonConfig) {
function checkPanel(context, path, jsonConfig, isRoot) {
common.debug(`checkPanel(${path})`);

const rootAttributes = [
'i18n',
];

const myAttributes = [
'type',

Expand All @@ -457,7 +461,7 @@ function checkPanel(context, path, jsonConfig) {
'label',
];

const validAttributes = stdAttributes.concat(myAttributes);
const validAttributes = stdAttributes.concat(myAttributes).concat(isRoot?rootAttributes:[]);

for (const key in jsonConfig) {
common.debug(` scanning ${key}`);
Expand Down Expand Up @@ -570,9 +574,9 @@ function checkJsonConfig(context, path, jsonConfig) {
}
if (key === 'items') {
if (baseType == 'panel') {
checkPanel( context, `${path}/items`, jsonConfig['items']);
checkPanel( context, `${path}/items`, jsonConfig, true);
} else if (baseType == 'tabs') {
checkTabs( context, `${path}/items`, jsonConfig['items']);
checkTabs( context, `${path}/items`, jsonConfig['items'], false);
}
}
}
Expand Down

0 comments on commit 03663ed

Please sign in to comment.