1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

Merge branch 'main' into auth/pm-8111/browser-refresh-login-component

This commit is contained in:
Alec Rippberger
2024-10-16 10:28:22 -05:00
6 changed files with 18 additions and 7 deletions

View File

@@ -105,6 +105,11 @@ export class DomainAddEditDialogComponent implements OnInit, OnDestroy {
copyDnsTxt(): void { copyDnsTxt(): void {
this.orgDomainService.copyDnsTxt(this.txtCtrl.value); this.orgDomainService.copyDnsTxt(this.txtCtrl.value);
this.toastService.showToast({
variant: "success",
title: null,
message: this.i18nService.t("valueCopied", this.i18nService.t("dnsTxtRecord")),
});
} }
// End Form methods // End Form methods

View File

@@ -101,6 +101,11 @@ export class DomainVerificationComponent implements OnInit, OnDestroy {
copyDnsTxt(dnsTxt: string): void { copyDnsTxt(dnsTxt: string): void {
this.orgDomainService.copyDnsTxt(dnsTxt); this.orgDomainService.copyDnsTxt(dnsTxt);
this.toastService.showToast({
variant: "success",
title: null,
message: this.i18nService.t("valueCopied", this.i18nService.t("dnsTxtRecord")),
});
} }
async verifyDomain(orgDomainId: string, domainName: string): Promise<void> { async verifyDomain(orgDomainId: string, domainName: string): Promise<void> {

View File

@@ -180,6 +180,5 @@ describe("Org Domain Service", () => {
it("copyDnsTxt copies DNS TXT to clipboard and shows toast", () => { it("copyDnsTxt copies DNS TXT to clipboard and shows toast", () => {
orgDomainService.copyDnsTxt("fakeTxt"); orgDomainService.copyDnsTxt("fakeTxt");
expect(jest.spyOn(platformUtilService, "copyToClipboard")).toHaveBeenCalled(); expect(jest.spyOn(platformUtilService, "copyToClipboard")).toHaveBeenCalled();
expect(jest.spyOn(platformUtilService, "showToast")).toHaveBeenCalled();
}); });
}); });

View File

@@ -23,11 +23,6 @@ export class OrgDomainService implements OrgDomainInternalServiceAbstraction {
copyDnsTxt(dnsTxt: string): void { copyDnsTxt(dnsTxt: string): void {
this.platformUtilsService.copyToClipboard(dnsTxt); this.platformUtilsService.copyToClipboard(dnsTxt);
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("valueCopied", this.i18nService.t("dnsTxtRecord")),
);
} }
upsert(orgDomains: OrganizationDomainResponse[]): void { upsert(orgDomains: OrganizationDomainResponse[]): void {

View File

@@ -58,6 +58,13 @@ describe("UriOptionComponent", () => {
expect(component["uriMatchOptions"][0].label).toBe("default"); expect(component["uriMatchOptions"][0].label).toBe("default");
}); });
it("should update the default uri match strategy label when it is domain", () => {
component.defaultMatchDetection = UriMatchStrategy.Domain;
fixture.detectChanges();
expect(component["uriMatchOptions"][0].label).toBe("defaultLabel baseDomain");
});
it("should update the default uri match strategy label", () => { it("should update the default uri match strategy label", () => {
component.defaultMatchDetection = UriMatchStrategy.Exact; component.defaultMatchDetection = UriMatchStrategy.Exact;
fixture.detectChanges(); fixture.detectChanges();

View File

@@ -84,7 +84,7 @@ export class UriOptionComponent implements ControlValueAccessor {
@Input({ required: true }) @Input({ required: true })
set defaultMatchDetection(value: UriMatchStrategySetting) { set defaultMatchDetection(value: UriMatchStrategySetting) {
// The default selection has a value of `null` avoid showing "Default (Default)" // The default selection has a value of `null` avoid showing "Default (Default)"
if (!value) { if (value === null) {
return; return;
} }