-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from IowaComputerGurus/feature/updated-for-req…
…uired Added Ability to Designate Required Fields
- Loading branch information
Showing
8 changed files
with
58 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,28 +24,6 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
|
||
- name: Cache SonarCloud packages | ||
uses: actions/[email protected] | ||
with: | ||
path: ~\sonar\cache | ||
key: ${{ runner.os }}-sonar | ||
restore-keys: ${{ runner.os }}-sonar | ||
|
||
- name: Cache SonarCloud scanner | ||
id: cache-sonar-scanner | ||
uses: actions/[email protected] | ||
with: | ||
path: .\.sonar\scanner | ||
key: ${{ runner.os }}-sonar-scanner | ||
restore-keys: ${{ runner.os }}-sonar-scanner | ||
|
||
- name: Install SonarCloud scanner | ||
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' | ||
shell: powershell | ||
run: | | ||
New-Item -Path .\.sonar\scanner -ItemType Directory | ||
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner | ||
|
||
- name: Install GitVersion | ||
run: dotnet tool install --global GitVersion.Tool | ||
|
@@ -62,8 +40,16 @@ jobs: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
shell: powershell | ||
run: | | ||
.\.sonar\scanner\dotnet-sonarscanner begin /k:"IowaComputerGurus_aspnetcore.utilities.bootstrap5taghelpers" /o:"iowacomputergurus-github" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /n:"AspNetCore Utilities Bootstrap5 Tag Helpers" | ||
dotnet restore "${{ env.solution-path }}" | ||
dotnet build "${{ env.solution-path }}" --no-restore --configuration Release -p:version=${{ steps.gitversion.outputs.majorMinorPatch }} | ||
dotnet test "${{ env.solution-path }}" --no-build --configuration Release --collect "XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover --logger "trx;LogFileName=unittests.trx" | ||
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" | ||
- name: Push Coverage to Codacy | ||
shell: bash | ||
env: | ||
CODACY_ORGANIZATION_PROVIDER: ${{ secrets.CODACY_ORGANIZATION_PROVIDER }} | ||
CODACY_USERNAME: ${{ secrets.CODACY_USERNAME }} | ||
CODACY_PROJECT_NAME: ${{ secrets.CODACY_PROJECT_NAME }} | ||
CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }} | ||
run: | | ||
bash <(curl -Ls https://coverage.codacy.com/get.sh) report $(find . -name '*.opencover.xml' -printf '-r %p ') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,13 @@ | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" integrity="sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg==" crossorigin="anonymous" referrerpolicy="no-referrer" /> | ||
</head> | ||
<style> | ||
label.required:after { | ||
content: " *"; | ||
color: red; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<header> | ||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
src/AspNetCore.Utilities.Bootstrap5TagHelpers.Tests/Form/TestModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
namespace ICG.AspNetCore.Utilities.Bootstrap5TagHelpers.Tests.Form; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace ICG.AspNetCore.Utilities.Bootstrap5TagHelpers.Tests.Form; | ||
public class TestModel | ||
{ | ||
public string TextField { get; set; } | ||
|
||
[Required] | ||
public int? RequiredIntField { get; set; } | ||
} |
5 changes: 5 additions & 0 deletions
5
...sts/VerifySnapshots/FormInputTagHelperTests.Renders_RequiredClassWhenNeeded.verified.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
| ||
<div class="mb-3"> | ||
<label class="HtmlEncode[[form-label required]]" for="HtmlEncode[[RequiredIntField]]">HtmlEncode[[RequiredIntField]]</label> | ||
<input type="HtmlEncode[[number]]" id="HtmlEncode[[RequiredIntField]]" name="HtmlEncode[[RequiredIntField]]" value="HtmlEncode[[ICG.AspNetCore.Utilities.Bootstrap5TagHelpers.Tests.Form.TestModel]]" class="HtmlEncode[[form-control-plaintext]]" readonly="HtmlEncode[[readonly]]"> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters