@giteeteam/apps-manifest 0.7.0 → 0.7.1
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/validate.js +19 -6
- package/package.json +1 -1
package/lib/validate.js
CHANGED
|
@@ -124,13 +124,26 @@ const validateWorkspacePage = (json) => {
|
|
|
124
124
|
const groupKey = modules.filter(item => item.type === 'group').map(item => item.key);
|
|
125
125
|
for (const module of modules) {
|
|
126
126
|
if (module.type === 'group') {
|
|
127
|
-
|
|
127
|
+
if (module.title && (module.title.length < 2 || module.title.length > 10)) {
|
|
128
|
+
errors.push({
|
|
129
|
+
path: `/modules/workspacePage/${module.key}`,
|
|
130
|
+
message: `Group title length must be between 2 and 10! `,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
128
133
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
else {
|
|
135
|
+
if (module.parent && !groupKey.includes(module.parent)) {
|
|
136
|
+
errors.push({
|
|
137
|
+
path: `/modules/workspacePage/${module.key}`,
|
|
138
|
+
message: `Parent '${module.parent}' not found! `,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
if (module.title && (module.title.length < 2 || module.title.length > 30)) {
|
|
142
|
+
errors.push({
|
|
143
|
+
path: `/modules/workspacePage/${module.key}`,
|
|
144
|
+
message: `Title length must be between 2 and 30! `,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
134
147
|
}
|
|
135
148
|
}
|
|
136
149
|
}
|