Skip to content
Merged

Dev #2085

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Unity.Flex.Reporting.Configuration
{
public interface IWorksheetsMetadataService
{
Task<WorksheetComponentMetaDataDto> GetWorksheetSchemaMetaDataAsync(Guid worksheetId);
Task<WorksheetComponentMetaDataDto> GetWorksheetSchemaMetaDataAsync(Guid worksheetId, Guid formVersionId);
Task<WorksheetComponentMetaDataDto> GetWorksheetSchemaMetaDataItemAsync(Guid worksheetId, string fieldKey);
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@
using System.Linq;
using System.Threading.Tasks;
using Unity.Flex.Domain.Worksheets;
using Unity.GrantManager.ApplicationForms;
using Volo.Abp.DependencyInjection;

namespace Unity.Flex.Reporting.Configuration
{
public class WorksheetsMetadataService(IWorksheetRepository worksheetRepository)
public class WorksheetsMetadataService(IWorksheetRepository worksheetRepository,
IApplicationFormVersionAppService formVersionAppService)
: IWorksheetsMetadataService, ITransientDependency
{
public async Task<WorksheetComponentMetaDataDto> GetWorksheetSchemaMetaDataAsync(Guid worksheetId)
public async Task<WorksheetComponentMetaDataDto> GetWorksheetSchemaMetaDataAsync(Guid worksheetId, Guid formVersionId)
{
var worksheet = await worksheetRepository.GetAsync(worksheetId);

var version = await formVersionAppService.GetAsync(formVersionId);

// Use the utility class to parse all fields in the worksheet
var components = WorksheetFieldSchemaParser.ParseWorksheet(worksheet);
var components = WorksheetFieldSchemaParser.ParseWorksheet(worksheet, version.FormSchema, version.SubmissionHeaderMapping);

return new WorksheetComponentMetaDataDto()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class DataGridDefinitionColumn

[JsonPropertyName("type")]
public string Type { get; set; } = string.Empty;

[JsonPropertyName("key")]
public string Key { get; set; } = string.Empty;
}

public enum DataGridDefinitionSummaryOption
Expand Down
Loading
Loading