-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
/// </summary> | ||
let validateAnnotationTable context = | ||
let validateAnnotationTable excelTable context = |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Closes #451