diff --git a/backend/src/entities/table/application/data-structures/found-table-rows.ds.ts b/backend/src/entities/table/application/data-structures/found-table-rows.ds.ts index bbcd5753d..317f7ba4b 100644 --- a/backend/src/entities/table/application/data-structures/found-table-rows.ds.ts +++ b/backend/src/entities/table/application/data-structures/found-table-rows.ds.ts @@ -9,6 +9,34 @@ import { TablePermissionDs } from '../../../permission/application/data-structur import { FoundActionEventDTO } from '../../../table-actions/table-action-rules-module/application/dto/found-action-rules-with-actions-and-events.dto.js'; import { CreatedTableFilterRO } from '../../../table-filters/application/response-objects/created-table-filters.ro.js'; +export class TableSettingsInRowsDS { + @ApiProperty({ isArray: true }) + sortable_by: Array; + + @ApiProperty({ enum: QueryOrderingEnum }) + ordering: QueryOrderingEnum; + + @ApiProperty() + identity_column: string; + + @ApiProperty({ isArray: true }) + list_fields: Array; + + @ApiProperty() + allow_csv_export: boolean; + + @ApiProperty() + allow_csv_import: boolean; + + @ApiProperty() + can_delete: boolean; + + @ApiProperty() + can_update: boolean; + + @ApiProperty() + can_add: boolean; +} export class FoundTableRowsDs { @ApiProperty({ isArray: true }) rows: Array>; @@ -72,6 +100,9 @@ export class FoundTableRowsDs { @ApiProperty({ type: CreatedTableFilterRO, isArray: true }) saved_filters: Array; + + @ApiProperty({ type: TableSettingsInRowsDS }) + table_settings: TableSettingsInRowsDS; } export class OrderingFiledDs { diff --git a/backend/src/entities/table/use-cases/get-table-rows.use.case.ts b/backend/src/entities/table/use-cases/get-table-rows.use.case.ts index 5358b1756..7fe1a9fba 100644 --- a/backend/src/entities/table/use-cases/get-table-rows.use.case.ts +++ b/backend/src/entities/table/use-cases/get-table-rows.use.case.ts @@ -244,6 +244,17 @@ export class GetTableRowsUseCase extends AbstractUseCase 0 ? tableSettings.sortable_by : [], + ordering: tableSettings.ordering ? tableSettings.ordering : undefined, + identity_column: tableSettings.identity_column ? tableSettings.identity_column : null, + list_fields: tableSettings?.list_fields?.length > 0 ? tableSettings.list_fields : [], + allow_csv_export: allowCsvExport, + allow_csv_import: allowCsvImport, + can_delete: tableSettings ? tableSettings.can_delete : true, + can_update: tableSettings ? tableSettings.can_update : true, + can_add: tableSettings ? tableSettings.can_add : true, + }, }; const identitiesMap = new Map();