Skip to content

Commit

Permalink
- Updated name generation functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanSoltis committed Nov 30, 2023
1 parent d8ddad8 commit f0f9490
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Pages/Generate.razor
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
}
else
{
<span>(@resourceComponent.MinLength - @resourceComponent.MaxLength digits) </span>
<span> (@resourceComponent.MinLength - @resourceComponent.MaxLength digits) </span>
}
@if (((selectedResourceTypeOptional.ToLower().Split(',').Contains("instance")) && (multiselectedResourceTypes.Count == 0)))
{
Expand Down
9 changes: 4 additions & 5 deletions src/Services/ResourceNamingRequestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ public static async Task<ResourceNameResponse> RequestName(ResourceNameRequest r
{
// Set the resource type ot the first value
resourceType = resourceTypesByShortName[0];
applyDelimiter = resourceType.ApplyDelimiter;
}
}

Expand Down Expand Up @@ -482,7 +481,7 @@ public static async Task<ResourceNameResponse> RequestName(ResourceNameRequest r
if (name != "")
{
// Check if the component should apply the delimiter
if ((component.ApplyDelimiterBefore) && (previousdelimiterappliedafter) && (applyDelimiter))
if ((component.ApplyDelimiterBefore) && (previousdelimiterappliedafter) && (resourceType.ApplyDelimiter))
{
name += resourceDelimiter.Delimiter;
}
Expand All @@ -501,7 +500,7 @@ public static async Task<ResourceNameResponse> RequestName(ResourceNameRequest r
if (!String.IsNullOrEmpty(name))
{
// Check if the component should apply the delimiter
if ((component.ApplyDelimiterBefore) && (previousdelimiterappliedafter) && (applyDelimiter))
if ((component.ApplyDelimiterBefore) && (previousdelimiterappliedafter) && (resourceType.ApplyDelimiter))
{
name += resourceDelimiter.Delimiter;
}
Expand Down Expand Up @@ -592,7 +591,7 @@ public static async Task<ResourceNameResponse> RequestName(ResourceNameRequest r
}
else
{
if (!String.IsNullOrEmpty(name) && (applyDelimiter))
if (!String.IsNullOrEmpty(name) && (resourceType.ApplyDelimiter))
{
name += resourceDelimiter.Delimiter;
}
Expand Down Expand Up @@ -671,7 +670,7 @@ public static async Task<ResourceNameResponse> RequestName(ResourceNameRequest r
if (!String.IsNullOrEmpty(name))
{
// Check if the component should apply the delimiter
if ((component.ApplyDelimiterBefore) && (previousdelimiterappliedafter) && (applyDelimiter))
if ((component.ApplyDelimiterBefore) && (previousdelimiterappliedafter) && (resourceType.ApplyDelimiter))
{
name += resourceDelimiter.Delimiter;
}
Expand Down

0 comments on commit f0f9490

Please sign in to comment.