Skip to content

Commit

Permalink
Fix worksheet name issue and added Stereotype/type values on SlimElement
Browse files Browse the repository at this point in the history
  • Loading branch information
antoineatstariongroup committed Dec 6, 2024
1 parent 87ab6f9 commit cae7ef5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion EA-ModelKit/Model/Slims/SlimElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,24 @@ public SlimElement(Element element, IReadOnlyList<SlimTaggedValue> taggedValues)
this.Name = element.Name;
this.Notes = element.Notes;
this.Alias = element.Alias;
this.ElementKind = string.IsNullOrEmpty(element.Stereotype) ? element.Type : element.Stereotype;
this.ElementType = element.Type;
this.Stereotype = element.Stereotype;
this.ElementKind = string.IsNullOrEmpty(this.Stereotype) ? this.ElementType : this.Stereotype;

this.TaggedValues = taggedValues.GroupBy(x => x.Name)
.ToDictionary(x => x.Key, IReadOnlyList<SlimTaggedValue> (x) => x.ToList());
}

/// <summary>
/// Gets the type of the <see cref="Element" />
/// </summary>
public string ElementType { get; }

/// <summary>
/// Gets the applied stereotype to the associated <see cref="Element" />
/// </summary>
public string Stereotype { get; }

/// <summary>
/// Gets the kind of Element that is represented
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion EA-ModelKit/Services/Writer/ExcelWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public Task WriteAsync(IReadOnlyDictionary<string, IReadOnlyList<ExportableObjec
private static void CreateExcelWorkSheet(IXLWorkbook workBook, string workSheetName, IReadOnlyList<ExportableObject> exportableObjects)
{
var headerContent = exportableObjects[0].Headers;
var workSheet = workBook.AddWorksheet(workSheetName);
var workSheet = workBook.AddWorksheet(workSheetName.Replace("/", ""));

WriteHeader(workSheet, headerContent);
WorkSheetContent(workSheet, headerContent, exportableObjects);
Expand Down

0 comments on commit cae7ef5

Please sign in to comment.