1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00

Merge branch 'main' into autofill/pm-5189-fix-issues-present-with-inline-menu-rendering-in-iframes

This commit is contained in:
Cesar Gonzalez
2024-04-02 16:18:16 -05:00
committed by GitHub
9 changed files with 81 additions and 107 deletions

View File

@@ -3,7 +3,6 @@ import { FormBuilder } from "@angular/forms";
import { ActivatedRoute, Router } from "@angular/router";
import { Subject, takeUntil } from "rxjs";
import { EnvironmentSelectorComponent } from "@bitwarden/angular/auth/components/environment-selector.component";
import { LoginComponent as BaseLoginComponent } from "@bitwarden/angular/auth/components/login.component";
import { FormValidationErrorsService } from "@bitwarden/angular/platform/abstractions/form-validation-errors.service";
import { ModalService } from "@bitwarden/angular/services/modal.service";
@@ -37,8 +36,6 @@ const BroadcasterSubscriptionId = "LoginComponent";
export class LoginComponent extends BaseLoginComponent implements OnDestroy {
@ViewChild("environment", { read: ViewContainerRef, static: true })
environmentModal: ViewContainerRef;
@ViewChild("environmentSelector", { read: ViewContainerRef, static: true })
environmentSelector: EnvironmentSelectorComponent;
protected componentDestroyed$: Subject<void> = new Subject();
webVaultHostname = "";

View File

@@ -26,6 +26,10 @@ export class OrganizationUserView {
twoFactorEnabled: boolean;
usesKeyConnector: boolean;
hasMasterPassword: boolean;
/**
* True if this organizaztion user has been granted access to Secrets Manager, false otherwise.
*/
accessSecretsManager: boolean;
collections: CollectionAccessSelectionView[] = [];
groups: string[] = [];

View File

@@ -571,7 +571,8 @@ export class PeopleComponent
}
async bulkEnableSM() {
const users = this.getCheckedUsers();
const users = this.getCheckedUsers().filter((ou) => !ou.accessSecretsManager);
if (users.length === 0) {
this.platformUtilsService.showToast(
"error",
@@ -588,6 +589,7 @@ export class PeopleComponent
await lastValueFrom(dialogRef.closed);
this.selectAll(false);
await this.load();
}
async events(user: OrganizationUserView) {

View File

@@ -1,31 +0,0 @@
import { Component, OnInit } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { map, Observable, switchMap } from "rxjs";
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
@Component({
templateUrl: "organization-billing-tab.component.html",
})
export class OrganizationBillingTabComponent implements OnInit {
showPaymentAndHistory$: Observable<boolean>;
constructor(
private route: ActivatedRoute,
private organizationService: OrganizationService,
private platformUtilsService: PlatformUtilsService,
) {}
ngOnInit() {
this.showPaymentAndHistory$ = this.route.params.pipe(
switchMap((params) => this.organizationService.get$(params.organizationId)),
map(
(org) =>
!this.platformUtilsService.isSelfHost() &&
org.canViewBillingHistory &&
org.canEditPaymentMethods,
),
);
}
}

View File

@@ -41,7 +41,7 @@ export class BulkMoveDialogComponent implements OnInit {
cipherIds: string[] = [];
formGroup = this.formBuilder.group({
folderId: ["", [Validators.required]],
folderId: ["", [Validators.nullValidator]],
});
folders$: Observable<FolderView[]>;

View File

@@ -1,4 +1,9 @@
<div class="environment-selector-btn">
<ng-container
*ngIf="{
selectedRegion: selectedRegion$ | async
} as data"
>
<div class="environment-selector-btn">
{{ "loggingInOn" | i18n }}:
<button
type="button"
@@ -9,8 +14,8 @@
aria-controls="cdk-overlay-container"
>
<span class="text-primary">
<ng-container *ngIf="selectedRegion$ | async as selectedRegion; else fallback">
{{ selectedRegion.domain }}
<ng-container *ngIf="data.selectedRegion; else fallback">
{{ data.selectedRegion.domain }}
</ng-container>
<ng-template #fallback>
{{ "selfHostedServer" | i18n }}
@@ -18,9 +23,9 @@
</span>
<i class="bwi bwi-fw bwi-sm bwi-angle-down" aria-hidden="true"></i>
</button>
</div>
</div>
<ng-template
<ng-template
cdkConnectedOverlay
[cdkConnectedOverlayOrigin]="trigger"
[cdkConnectedOverlayOpen]="isOpen"
@@ -29,7 +34,7 @@
[cdkConnectedOverlayBackdropClass]="'cdk-overlay-transparent-backdrop'"
(backdropClick)="isOpen = false"
(detach)="close()"
>
>
<div class="box-content">
<div
class="environment-selector-dialog"
@@ -44,13 +49,13 @@
type="button"
class="environment-selector-dialog-item"
(click)="toggle(region.key)"
[attr.aria-pressed]="selectedEnvironment === region.key ? 'true' : 'false'"
[attr.aria-pressed]="data.selectedRegion === region ? 'true' : 'false'"
>
<i
class="bwi bwi-fw bwi-sm bwi-check"
style="padding-bottom: 1px"
aria-hidden="true"
[style.visibility]="selectedEnvironment === region.key ? 'visible' : 'hidden'"
[style.visibility]="data.selectedRegion === region ? 'visible' : 'hidden'"
></i>
<span>{{ region.domain }}</span>
</button>
@@ -60,20 +65,17 @@
type="button"
class="environment-selector-dialog-item"
(click)="toggle(ServerEnvironmentType.SelfHosted)"
[attr.aria-pressed]="
selectedEnvironment === ServerEnvironmentType.SelfHosted ? 'true' : 'false'
"
[attr.aria-pressed]="data.selectedRegion ? 'false' : 'true'"
>
<i
class="bwi bwi-fw bwi-sm bwi-check"
style="padding-bottom: 1px"
aria-hidden="true"
[style.visibility]="
selectedEnvironment === ServerEnvironmentType.SelfHosted ? 'visible' : 'hidden'
"
[style.visibility]="data.selectedRegion ? 'hidden' : 'visible'"
></i>
<span>{{ "selfHostedServer" | i18n }}</span>
</button>
</div>
</div>
</ng-template>
</ng-template>
</ng-container>

View File

@@ -36,11 +36,9 @@ import {
})
export class EnvironmentSelectorComponent {
@Output() onOpenSelfHostedSettings = new EventEmitter();
isOpen = false;
showingModal = false;
selectedEnvironment: Region;
ServerEnvironmentType = Region;
overlayPosition: ConnectedPosition[] = [
protected isOpen = false;
protected ServerEnvironmentType = Region;
protected overlayPosition: ConnectedPosition[] = [
{
originX: "start",
originY: "bottom",

View File

@@ -1,4 +1,5 @@
<div
class="tw-my-2 tw-border-0 tw-border-t tw-border-solid tw-border-t-secondary-500"
role="separator"
aria-hidden="true"
></div>

View File

@@ -88,6 +88,7 @@ export class MenuTriggerForDirective implements OnDestroy {
}
this.destroyMenu();
});
this.menu.keyManager.setFirstItemActive();
this.keyDownEventsSub =
this.menu.keyManager &&
this.overlayRef