1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-04 01:23:57 +00:00
Files
browser/bitwarden_license/bit-web/src/app/admin-console/providers/providers.component.html
Rui Tomé b455cb5986 [PM-24146] Remove stateProvider.activeUserId from ProviderService (#16258)
* Refactor provider service calls to include userId parameter

- Updated multiple components and services to pass userId when fetching provider data.
- Adjusted the ProviderService interface to require userId for get, get$, and getAll methods.
- Ensured consistent handling of userId across various components, enhancing data retrieval based on active user context.

* Remove deprecated type safety comments and use the getById utility for fetching providers.

* Update ProviderService methods to return undefined for non-existent providers

- Modified the return types of get$ and get methods in ProviderService to allow for undefined values, enhancing type safety.
- Adjusted the providers$ method to return only defined Provider arrays, ensuring consistent handling of provider data.

* Enhance provider permissions guard tests to include userId parameter

- Updated test cases in provider-permissions.guard.spec.ts to pass userId when calling ProviderService methods.
- Mocked AccountService to provide active account details for improved test coverage.
- Ensured consistent handling of userId across all relevant test scenarios.

* remove promise based api's from provider service, continue refactor

* cleanup observable logic

* cleanup

---------

Co-authored-by: Brandon <btreston@bitwarden.com>
2025-09-22 11:06:28 -04:00

32 lines
1.1 KiB
HTML

@let providers = providers$ | async;
<app-header></app-header>
<bit-container>
<p *ngIf="!loaded" class="tw-text-muted">
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
<span class="tw-sr-only">{{ "loading" | i18n }}</span>
</p>
<ng-container *ngIf="loaded && providers && providers.length">
<bit-table>
<ng-template body>
<tr bitRow *ngFor="let p of providers">
<td bitCell class="tw-w-1">
<bit-avatar [text]="p.name" [id]="p.id" size="small"></bit-avatar>
</td>
<td bitCell>
<a href="#" [routerLink]="['/providers', p.id]">{{ p.name }}</a>
<ng-container *ngIf="!p.enabled">
<i
class="bwi bwi-exclamation-triangle tw-text-danger"
title="{{ 'providerIsDisabled' | i18n }}"
aria-hidden="true"
></i>
<span class="tw-sr-only">{{ "providerIsDisabled" | i18n }}</span>
</ng-container>
</td>
</tr>
</ng-template>
</bit-table>
</ng-container>
</bit-container>