Skip to content

Commit f649550

Browse files
authored
[DPC-4567] Update my organizations list page (#2565)
## 🎫 Ticket [DPC-4567](https://jira.cms.gov/browse/DPC-4567) ## 🛠 Changes <!-- What was added, updated, or removed in this PR? --> - updates existing Organization List page to use the list format instead of cards - see figma design spec [HERE](https://www.figma.com/design/cvJ8ru6pzsVTS5zAmMwIAC/DPC-Production-Portal?node-id=3-17042&p=f&m=dev) ## ℹ️ Context <!-- Why were these changes made? Add background context suitable for a non-technical audience. --> <!-- If any of the following security implications apply, this PR must not be merged without Stephen Walter's approval. Explain in this section and add @SJWalter11 as a reviewer. - Adds a new software dependency or dependencies. - Modifies or invalidates one or more of our security controls. - Stores or transmits data that was not stored or transmitted before. - Requires additional review of security implications for other reasons. --> ## 🧪 Validation <!-- How were the changes verified? Did you fully test the acceptance criteria in the ticket? Provide reproducible testing instructions and screenshots if applicable. --> Manual testing... AO and CD links show up in the same list <img width="1083" alt="Screenshot 2025-04-03 at 5 43 49 PM" src="https://github.com/user-attachments/assets/61839ef1-ed41-4b34-bc5b-d9843f153d6c" /> Tested "Sign terms of service", "Configuration needed", and "Configuration complete" status icons manually
1 parent 77e8c6d commit f649550

16 files changed

+174
-390
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
$visited-blue-link-color: #005ea2;
2+
3+
.visited\:text-blue{
4+
color: $visited-blue-link-color;
5+
6+
&:visited {
7+
color: $visited-blue-link-color;
8+
}
9+
}
10+
11+
.truncate-text-ellipsis {
12+
overflow: hidden;
13+
text-overflow: ellipsis;
14+
white-space: nowrap;
15+
}
16+
17+
.table-bg-transparent {
18+
th, td {
19+
background-color: transparent;
20+
}
21+
}

dpc-portal/app/assets/stylesheets/application.sass.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717
*/
1818
@forward "uswds-theme";
1919
@forward "uswds";
20+
@use "organizations-list";

dpc-portal/app/components/core/card/organization_card_component.html.erb

Lines changed: 0 additions & 28 deletions
This file was deleted.

dpc-portal/app/components/core/card/organization_card_component_preview.rb

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<tr>
2+
<th scope="row" style="width: 50%;" aria-label="<%= @organization.name %>" >
3+
<a class="display-block maxw-full visited:text-blue text-underline text-normal truncate-text-ellipsis" href="<%= organization_path(@organization)%>" aria-label="<%= @organization.name %>">
4+
<%= @organization.name %>
5+
</a>
6+
</th>
7+
<td style="width: 16.67%;"> <%= @organization.npi %> </td>
8+
<td style="width: 8.33%;">
9+
<% if @link.ao? %>
10+
AO
11+
<% else %>
12+
CD
13+
<% end %>
14+
</td>
15+
<td style="width: 25%;">
16+
<div class="clearfix">
17+
<div class="float-left"><%= render Core::Icon::UswdsComponent.new(@icon, additional_classes: @classes) %></div>
18+
<div class="float-left margin-left-1 margin-top-neg-2px"><%= @status %></div>
19+
</div>
20+
</td>
21+
</tr>

dpc-portal/app/components/core/card/organization_card_component.rb renamed to dpc-portal/app/components/core/organization_list_row/organization_list_row_component.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# frozen_string_literal: true
22

33
module Core
4-
module Card
4+
module OrganizationListRow
55
# Render a USWDS-styled card for an organization.
6-
class OrganizationCardComponent < ViewComponent::Base
6+
class OrganizationListRowComponent < ViewComponent::Base
77
include OrganizationUtils
88
with_collection_parameter :link
99

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
11
<div>
2-
<% if ao? %>
3-
<h1>Welcome to the DPC Portal</h1>
4-
<p>As an Authorized Official (AO), use this portal to manage access to Medicare claims data through the Data at the Point of Care (DPC) application programming interface (API)</p>
5-
<div class="display-flex flex-row flex-justify">
6-
<div class="flex-align-self-center">
7-
<h2 class="margin-bottom-0">My organizations</h2>
8-
</div>
2+
<h1>Welcome to the DPC Portal</h1>
3+
<p>Use this portal to manage your organization's access to Data at the Point of Care (DPC). Depending on your role, you can register your organization, sign terms of service, and complete API configuration.</p>
4+
<div class="display-flex flex-row flex-justify">
5+
<div class="flex-align-self-center">
6+
<h2 class="margin-bottom-0">My organizations</h2>
97
</div>
10-
<p>These are organizations for which you serve as an AO. Organizations cannot access Medicare claims data without an AO agreement to follow terms of service.</p>
8+
</div>
9+
<p>You’re designated as an Authorized Official (AO) and/or Credential Delegate (CD) of the following organizations. An AO is accountable for organization-level access to the API. The AO can can assign a CD to complete configuration steps on their behalf.</p>
10+
11+
<% if @links.present? %>
12+
<table class="usa-table usa-table--borderless organizations-list table-bg-transparent" style="table-layout: fixed; width: 100%;">
13+
<caption class="usa-sr-only">
14+
A list of organizations you are affiliated with, including name, NPI-2, your role, and the status for API access.
15+
</caption>
16+
<thead>
17+
<tr>
18+
<th scope="col" style="width: 50%;">Organization Name</th>
19+
<th scope="col" style="width: 16.67%;">NPI-2</th>
20+
<th scope="col" style="width: 8.33%;">Role</th>
21+
<th scope="col" style="width: 25%;">Status</th>
22+
</tr>
23+
</thead>
24+
<tbody>
25+
<%= render Core::OrganizationListRow::OrganizationListRowComponent.with_collection(@links)%>
26+
</tbody>
27+
</table>
28+
<% else %>
29+
<p>You don't have any organizations to show.</p>
1130
<% end %>
12-
<ul class="usa-card-group">
13-
<%= render Core::Card::OrganizationCardComponent.with_collection(@links)%>
14-
</ul>
15-
<%=raw "<p>You don't have any organizations to show.</p>" if @links.blank? %>
1631
</div>

dpc-portal/app/components/page/organization/organization_list_component_preview.rb

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,19 @@ module Organization
1212
class OrganizationListComponentPreview < ViewComponent::Preview
1313
OrgStruct = Struct.new(:name, :npi, :api_id)
1414

15-
def multiple_orgs_ao
16-
links = []
17-
3.times do |i|
18-
org = ProviderOrganization.new(name: "Test Organization #{i}", npi: "#{i}111111111", id: i,
19-
terms_of_service_accepted_at: 2.days.ago)
20-
links << AoOrgLink.new(provider_organization: org)
21-
end
22-
render(Page::Organization::OrganizationListComponent.new(ao_or_cd: :ao, links:))
23-
end
24-
2515
def multiple_orgs
2616
links = []
27-
3.times do |i|
28-
org = ProviderOrganization.new(name: "Test Organization #{i}", npi: "#{i}111111111", id: i,
29-
terms_of_service_accepted_at: 2.days.ago)
30-
links << CdOrgLink.new(provider_organization: org)
31-
end
32-
render(Page::Organization::OrganizationListComponent.new(ao_or_cd: :cd, links:))
17+
org = ProviderOrganization.new(name: 'Test Organization 0 - needs ToS', npi: '0111111111', id: 0,
18+
terms_of_service_accepted_at: nil)
19+
links << AoOrgLink.new(provider_organization: org)
20+
org = ProviderOrganization.new(name: 'Test Organization 1 - configuration needed', npi: '1111111111', id: 1,
21+
terms_of_service_accepted_at: 2.days.ago)
22+
links << CdOrgLink.new(provider_organization: org)
23+
org = ProviderOrganization.new(name: 'Test Organization 2 - configuration complete', npi: '2111111111', id: 2,
24+
terms_of_service_accepted_at: 2.days.ago, config_complete: true)
25+
links << AoOrgLink.new(provider_organization: org)
26+
27+
render(Page::Organization::OrganizationListComponent.new(ao_or_cd: :ao, links:))
3328
end
3429

3530
def one_org

dpc-portal/app/concerns/organization_utils.rb

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ module OrganizationUtils
77
included do
88
def org_status(organization, link)
99
message_prefix = link.is_a?(AoOrgLink) ? 'verification' : 'cd_access'
10-
if organization.rejected?
11-
['lock', %i[text-gray-50], t("#{message_prefix}.#{organization.verification_reason}_status")]
12-
elsif !link.verification_status?
13-
['lock', %i[text-gray-50], t("verification.#{link.verification_reason}_status")]
14-
elsif organization.terms_of_service_accepted_at.blank?
15-
['warning', %i[text-gold], t("#{message_prefix}.tos_not_signed")]
10+
11+
if organization.terms_of_service_accepted_at.blank?
12+
['warning', %i[text-gold], t("#{message_prefix}.sign_tos")]
13+
elsif organization.rejected?
14+
['lock', %i[text-gray-50], t("#{message_prefix}.access_denied")]
15+
elsif link.user && !link.user.can_access?(organization)
16+
['link_off', %i[text-gray-50], t("#{message_prefix}.api_disabled")]
17+
elsif !organization.config_complete
18+
['warning', %i[text-gold], t("#{message_prefix}.configuration_needed")]
1619
else
17-
['verified', %i[text-accent-cool], t("#{message_prefix}.manage_org")]
20+
['check', %i[text-green], t("#{message_prefix}.configuration_complete")]
1821
end
1922
end
2023
end

dpc-portal/app/models/ao_org_link.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ class AoOrgLink < ApplicationRecord
1616
belongs_to :user, required: true
1717
belongs_to :provider_organization, required: true
1818
belongs_to :invitation, required: false
19+
20+
def ao?
21+
true
22+
end
1923
end

0 commit comments

Comments
 (0)