|
|
@ -47,6 +47,7 @@ export class TableComponent implements AfterViewInit {
|
|
|
|
required?: boolean;
|
|
|
|
required?: boolean;
|
|
|
|
type?: string;
|
|
|
|
type?: string;
|
|
|
|
link?: (row: any) => string;
|
|
|
|
link?: (row: any) => string;
|
|
|
|
|
|
|
|
highlighted: boolean; // whether this column is a bit darker
|
|
|
|
}[] = [];
|
|
|
|
}[] = [];
|
|
|
|
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
@Input()
|
|
|
@ -188,17 +189,27 @@ export class TableComponent implements AfterViewInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
addColumnPropertiesFromGQLSchemaToColumnInfo() {
|
|
|
|
addColumnPropertiesFromGQLSchemaToColumnInfo() {
|
|
|
|
|
|
|
|
let previousColumnDataPathPrefix = null;
|
|
|
|
|
|
|
|
let previousColumnIsHighlighted = false;
|
|
|
|
for (const column of this.columnInfo) {
|
|
|
|
for (const column of this.columnInfo) {
|
|
|
|
const typeInformation = this.schemaService.getTypeInformation(
|
|
|
|
const columnnDataPathPrefix = column.dataPath.split('.')[0];
|
|
|
|
|
|
|
|
if (columnnDataPathPrefix === previousColumnDataPathPrefix) {
|
|
|
|
|
|
|
|
column.highlighted = previousColumnIsHighlighted;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
column.highlighted = !previousColumnIsHighlighted;
|
|
|
|
|
|
|
|
previousColumnIsHighlighted = !previousColumnIsHighlighted;
|
|
|
|
|
|
|
|
previousColumnDataPathPrefix = columnnDataPathPrefix;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let typeInformation = this.schemaService.getTypeInformation(
|
|
|
|
this.tableDataGQLType,
|
|
|
|
this.tableDataGQLType,
|
|
|
|
column.dataPath
|
|
|
|
column.dataPath
|
|
|
|
);
|
|
|
|
);
|
|
|
|
column.type = column.type || typeInformation.type;
|
|
|
|
column.type = column.type || typeInformation.type;
|
|
|
|
column.required =
|
|
|
|
column.required =
|
|
|
|
column.required != null ? column.required : typeInformation.isRequired;
|
|
|
|
column.required != null ? column.required : typeInformation.isRequired;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (const column of this.columnInfo) {
|
|
|
|
typeInformation = this.schemaService.getTypeInformation(
|
|
|
|
const typeInformation = this.schemaService.getTypeInformation(
|
|
|
|
|
|
|
|
this.tableDataGQLUpdateInputType,
|
|
|
|
this.tableDataGQLUpdateInputType,
|
|
|
|
column.dataPath
|
|
|
|
column.dataPath
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -211,9 +222,7 @@ export class TableComponent implements AfterViewInit {
|
|
|
|
column.requiredForUpdating != null
|
|
|
|
column.requiredForUpdating != null
|
|
|
|
? column.requiredForUpdating
|
|
|
|
? column.requiredForUpdating
|
|
|
|
: column.required || typeInformation.isRequired;
|
|
|
|
: column.required || typeInformation.isRequired;
|
|
|
|
}
|
|
|
|
typeInformation = this.schemaService.getTypeInformation(
|
|
|
|
for (const column of this.columnInfo) {
|
|
|
|
|
|
|
|
const typeInformation = this.schemaService.getTypeInformation(
|
|
|
|
|
|
|
|
this.tableDataGQLCreateInputType,
|
|
|
|
this.tableDataGQLCreateInputType,
|
|
|
|
column.dataPath
|
|
|
|
column.dataPath
|
|
|
|
);
|
|
|
|
);
|
|
|
|