mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +00:00
[AC-2443] Update unassigned items banner text for self-hosted (#8719)
* Update banner text for self-hosted environments * Fix tests * Fix web vault wording * Actually fix web vault wording
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { MockProxy, mock } from "jest-mock-extended";
|
||||
import { firstValueFrom } from "rxjs";
|
||||
import { firstValueFrom, of } from "rxjs";
|
||||
|
||||
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||
import { FakeStateProvider, mockAccountServiceWith } from "@bitwarden/common/spec";
|
||||
import { UserId } from "@bitwarden/common/types/guid";
|
||||
|
||||
@@ -10,13 +11,17 @@ import { SHOW_BANNER_KEY, UnassignedItemsBannerService } from "./unassigned-item
|
||||
describe("UnassignedItemsBanner", () => {
|
||||
let stateProvider: FakeStateProvider;
|
||||
let apiService: MockProxy<UnassignedItemsBannerApiService>;
|
||||
let environmentService: MockProxy<EnvironmentService>;
|
||||
|
||||
const sutFactory = () => new UnassignedItemsBannerService(stateProvider, apiService);
|
||||
const sutFactory = () =>
|
||||
new UnassignedItemsBannerService(stateProvider, apiService, environmentService);
|
||||
|
||||
beforeEach(() => {
|
||||
const fakeAccountService = mockAccountServiceWith("userId" as UserId);
|
||||
stateProvider = new FakeStateProvider(fakeAccountService);
|
||||
apiService = mock();
|
||||
environmentService = mock();
|
||||
environmentService.environment$ = of(null);
|
||||
});
|
||||
|
||||
it("shows the banner if showBanner local state is true", async () => {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import { concatMap } from "rxjs";
|
||||
import { concatMap, map } from "rxjs";
|
||||
|
||||
import {
|
||||
EnvironmentService,
|
||||
Region,
|
||||
} from "@bitwarden/common/platform/abstractions/environment.service";
|
||||
import {
|
||||
StateProvider,
|
||||
UNASSIGNED_ITEMS_BANNER_DISK,
|
||||
@@ -36,9 +40,18 @@ export class UnassignedItemsBannerService {
|
||||
}),
|
||||
);
|
||||
|
||||
bannerText$ = this.environmentService.environment$.pipe(
|
||||
map((e) =>
|
||||
e?.getRegion() == Region.SelfHosted
|
||||
? "unassignedItemsBannerSelfHost"
|
||||
: "unassignedItemsBanner",
|
||||
),
|
||||
);
|
||||
|
||||
constructor(
|
||||
private stateProvider: StateProvider,
|
||||
private apiService: UnassignedItemsBannerApiService,
|
||||
private environmentService: EnvironmentService,
|
||||
) {}
|
||||
|
||||
async hideBanner() {
|
||||
|
||||
Reference in New Issue
Block a user