From 03bd47e3907f942d03c9fff686724f89fa1dbbc4 Mon Sep 17 00:00:00 2001 From: Jared McCannon Date: Thu, 19 Sep 2024 10:57:42 -0500 Subject: [PATCH] [PM-12324] Add HTML ids to Bitwarden Portal for automated testing (#4789) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adding ids to org page in admin portal. Co-authored-by: Rui Tomé <108268980+r-tome@users.noreply.github.com> --- .../Organizations/_ViewInformation.cshtml | 46 +++++------ .../Views/Shared/_BillingInformation.cshtml | 78 ++++++++++--------- 2 files changed, 64 insertions(+), 60 deletions(-) diff --git a/src/Admin/AdminConsole/Views/Organizations/_ViewInformation.cshtml b/src/Admin/AdminConsole/Views/Organizations/_ViewInformation.cshtml index b017e7ccb..db2e2c601 100644 --- a/src/Admin/AdminConsole/Views/Organizations/_ViewInformation.cshtml +++ b/src/Admin/AdminConsole/Views/Organizations/_ViewInformation.cshtml @@ -1,73 +1,73 @@ @model OrganizationViewModel
Id
-
@Model.Organization.Id
+
@Model.Organization.Id
Plan
-
@Model.Organization.Plan
+
@Model.Organization.Plan
Expires
-
@(Model.Organization.ExpirationDate?.ToString() ?? "-")
+
@(Model.Organization.ExpirationDate?.ToString() ?? "-")
Users
-
+
@Model.OccupiedSeatCount / @(Model.Organization.Seats?.ToString() ?? "-") - (@Model.UserInvitedCount / - @Model.UserAcceptedCount / - @Model.UserConfirmedCount) + (@Model.UserInvitedCount / + @Model.UserAcceptedCount / + @Model.UserConfirmedCount)
Owners
-
@(string.IsNullOrWhiteSpace(Model.Owners) ? "None" : Model.Owners)
+
@(string.IsNullOrWhiteSpace(Model.Owners) ? "None" : Model.Owners)
Admins
-
@(string.IsNullOrWhiteSpace(Model.Admins) ? "None" : Model.Admins)
+
@(string.IsNullOrWhiteSpace(Model.Admins) ? "None" : Model.Admins)
Using 2FA
-
@(Model.Organization.TwoFactorIsEnabled() ? "Yes" : "No")
+
@(Model.Organization.TwoFactorIsEnabled() ? "Yes" : "No")
Groups
-
@Model.GroupCount
+
@Model.GroupCount
Policies
-
@Model.PolicyCount
+
@Model.PolicyCount
Public/Private Keys
-
@(Model.HasPublicPrivateKeys ? "Yes" : "No")
+
@(Model.HasPublicPrivateKeys ? "Yes" : "No")
Created
-
@Model.Organization.CreationDate.ToString()
+
@Model.Organization.CreationDate.ToString()
Modified
-
@Model.Organization.RevisionDate.ToString()
+
@Model.Organization.RevisionDate.ToString()

Password Manager

Items
-
@Model.CipherCount
+
@Model.CipherCount
Collections
-
@Model.CollectionCount
+
@Model.CollectionCount
Administrators manage all collections
-
@(Model.Organization.AllowAdminAccessToAllCollectionItems ? "On" : "Off")
+
@(Model.Organization.AllowAdminAccessToAllCollectionItems ? "On" : "Off")
Limit collection creation to administrators
-
@(Model.Organization.LimitCollectionCreationDeletion ? "On" : "Off")
+
@(Model.Organization.LimitCollectionCreationDeletion ? "On" : "Off")

Secrets Manager

Secrets
-
@(Model.UseSecretsManager ? Model.SecretsCount: "N/A")
+
@(Model.UseSecretsManager ? Model.SecretsCount: "N/A")
Projects
-
@(Model.UseSecretsManager ? Model.ProjectsCount: "N/A")
+
@(Model.UseSecretsManager ? Model.ProjectsCount: "N/A")
Machine Accounts
-
@(Model.UseSecretsManager ? Model.ServiceAccountsCount: "N/A")
+
@(Model.UseSecretsManager ? Model.ServiceAccountsCount: "N/A")
Secrets Manager Seats
-
@(Model.UseSecretsManager ? Model.OccupiedSmSeatsCount: "N/A" )
+
@(Model.UseSecretsManager ? Model.OccupiedSmSeatsCount: "N/A" )
diff --git a/src/Admin/Views/Shared/_BillingInformation.cshtml b/src/Admin/Views/Shared/_BillingInformation.cshtml index bdae3c421..0307562e4 100644 --- a/src/Admin/Views/Shared/_BillingInformation.cshtml +++ b/src/Admin/Views/Shared/_BillingInformation.cshtml @@ -11,8 +11,8 @@ }
-
Account @(Model.BillingInfo.Balance <= 0 ? "Credit" : "Balance")
-
@Math.Abs(Model.BillingInfo.Balance).ToString("C")
+
Account @(Model.BillingInfo.Balance <= 0 ? "Credit" : "Balance")
+
@Math.Abs(Model.BillingInfo.Balance).ToString("C")
Invoices
@@ -20,24 +20,26 @@ { - @foreach(var invoice in Model.BillingHistoryInfo.Invoices) - { - - - + + + + + @if (canDownloadInvoice) + { + - - - @if (canDownloadInvoice) - { - - } - - } + } + + invoiceIndex++; + }
@invoice.Date@invoice.Number + @{ var invoiceIndex = 0; } + @foreach (var invoice in Model.BillingHistoryInfo.Invoices) + { +
@invoice.Date@invoice.Number + @invoice.Amount.ToString("C")@(invoice.Paid ? "Paid" : "Unpaid") + + + @invoice.Amount.ToString("C")@(invoice.Paid ? "Paid" : "Unpaid") - - - -
} @@ -53,23 +55,25 @@ { - @foreach(var transaction in Model.BillingHistoryInfo.Transactions) - { - - - - - - - @if (canManageTransactions) - { - - } - - } + @{ var transactionIndex = 0; } + @foreach (var transaction in Model.BillingHistoryInfo.Transactions) + { + + + + + + + @if (canManageTransactions) + { + + } + + transactionIndex++; + }
@transaction.CreatedDate@transaction.Type.ToString()@transaction.PaymentMethodType.ToString()@transaction.Details@transaction.Amount.ToString("C") - -
@transaction.CreatedDate@transaction.Type.ToString()@transaction.PaymentMethodType.ToString()@transaction.Details@transaction.Amount.ToString("C") + +
} @@ -79,7 +83,7 @@ } @if (canManageTransactions) { - New Transaction