Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Excel, enable export of metadata as json #540

Merged
merged 5 commits into from
Oct 25, 2024

Conversation

Etschbeijer
Copy link
Collaborator

Closes #451

@Etschbeijer Etschbeijer changed the base branch from main to developer October 23, 2024 09:06
@Etschbeijer Etschbeijer marked this pull request as ready for review October 23, 2024 09:07
/// </summary>
let validateAnnotationTable context =
let validateAnnotationTable excelTable context =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unify with validateExcelTable. Keep only one

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed the method because we have to keep it. It is used by another function, that checks whether the selected building block is valid or not.

@@ -1982,7 +1979,8 @@ let validateAnnotationTable context =
let rectifyTermColumns () =
Excel.run(fun context ->
promise {
let! result = validateAnnotationTable context
let! excelTable = getActiveAnnotationTable context
let! result = validateAnnotationTable excelTable context
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

integrate validation into getArcTable-like function

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

let mainColumn =
if snd buildingBlock.[1] = "Unit" then
if buildingBlock.Length > 1 && snd buildingBlock.[1] = "Unit" then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensure correct table read in readTable-like function. There should be no syntax adaption/validation outside of getTable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

let mutable errors = List.empty

for i in 0 .. annotationTables.Length-1 do
let! potErrors = validateAnnotationTable annotationTables.[i] context
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see as above, should be part of getTable-like function

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

)
)

let inMemoryTables = Array.init annotationTables.Length (fun _ -> None)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want to keep this mutable, use ResizeArray.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

)

let inMemoryTables = Array.init annotationTables.Length (fun _ -> None)
let mutable errors = List.empty
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want to keep this mutable use ResizeArray

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

inMemoryTables
|> Array.choose (fun x -> x)

return (results, errors)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Result.Ok of results and Result.Error of errors

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@Freymaurer Freymaurer merged commit 1c2b856 into developer Oct 25, 2024
@Freymaurer Freymaurer deleted the Feature_Excel_JsonExport branch October 28, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Excel] Json export
2 participants