Skip to content

Commit 16f6a5c

Browse files
authored
Version history table rendering update for accessibility (#8287)
* Narrator-friendlier signature and deprecation information.
1 parent 3d6fd21 commit 16f6a5c

1 file changed

Lines changed: 30 additions & 11 deletions

File tree

src/NuGetGallery/Views/Packages/DisplayPackage.cshtml

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,14 @@
680680
{
681681
<th>Status</th>
682682
}
683-
<th aria-label="Signature Information" abbr="Signature Information"></th>
684-
<th aria-label="Deprecation Information" abbr="Deprecation Information"></th>
683+
@if (Model.IsCertificatesUIEnabled)
684+
{
685+
<th aria-label="Signature Information" abbr="Signature Information"></th>
686+
}
687+
@if (Model.IsPackageDeprecationEnabled)
688+
{
689+
<th aria-label="Deprecation Information" abbr="Deprecation Information"></th>
690+
}
685691
</tr>
686692
</thead>
687693
<tbody class="no-border">
@@ -734,15 +740,26 @@
734740
</td>
735741
}
736742

737-
<td class="package-icon-cell">
738-
@if (Model.IsCertificatesUIEnabled && !string.IsNullOrEmpty(packageVersion.SignatureInformation))
743+
@if (Model.IsCertificatesUIEnabled)
744+
{
745+
if (string.IsNullOrEmpty(packageVersion.SignatureInformation))
739746
{
740-
<i class="ms-Icon ms-Icon--Ribbon package-icon" title="@packageVersion.SignatureInformation"></i>
747+
<td class="package-icon-cell" aria-label="No signature"></td>
741748
}
742-
</td>
743-
744-
<td class="package-icon-cell">
745-
@if (Model.IsPackageDeprecationEnabled && packageVersion.DeprecationStatus != PackageDeprecationStatus.NotDeprecated)
749+
else
750+
{
751+
<td class="package-icon-cell">
752+
<i class="ms-Icon ms-Icon--Ribbon package-icon" title="@packageVersion.SignatureInformation"></i>
753+
</td>
754+
}
755+
}
756+
@if (Model.IsPackageDeprecationEnabled)
757+
{
758+
if (packageVersion.DeprecationStatus == PackageDeprecationStatus.NotDeprecated)
759+
{
760+
<td class="package-icon-cell" aria-label="Not deprecated"></td>
761+
}
762+
else
746763
{
747764
var deprecationTitle = packageVersion.Version;
748765
var isLegacy = packageVersion.DeprecationStatus.HasFlag(PackageDeprecationStatus.Legacy);
@@ -767,9 +784,11 @@
767784
deprecationTitle += " is deprecated.";
768785
}
769786

770-
<i class="ms-Icon ms-Icon--Warning package-icon" title="@deprecationTitle"></i>
787+
<td class="package-icon-cell">
788+
<i class="ms-Icon ms-Icon--Warning package-icon" title="@deprecationTitle"></i>
789+
</td>
771790
}
772-
</td>
791+
}
773792
</tr>
774793
}
775794
else if (packageVersion.Deleted && packageVersion.CanDisplayPrivateMetadata)

0 commit comments

Comments
 (0)