Skip to content

Commit

Permalink
fix: show name if numberSeries naming
Browse files Browse the repository at this point in the history
  • Loading branch information
18alantom committed Oct 9, 2023
1 parent e0b0105 commit 00ec722
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions src/importer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,12 +587,7 @@ function getTemplateFields(
}

for (const field of schema.fields) {
if (
field.computed ||
field.meta ||
field.hidden ||
(field.readOnly && !field.required)
) {
if (shouldSkipField(field, schema)) {
continue;
}

Expand Down Expand Up @@ -650,3 +645,23 @@ export function getColumnLabel(field: TemplateField): string {

return field.label;
}

function shouldSkipField(field: Field, schema: Schema): boolean {
if (field.computed || field.meta) {
return true;
}

if (schema.naming === 'numberSeries' && field.fieldname === 'name') {
return false;
}

if (field.hidden) {
return true;
}

if (field.readOnly && !field.required) {
return true;
}

return false;
}

0 comments on commit 00ec722

Please sign in to comment.