mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
[AC-2420] Hide SM checkbox on member invite when org is on SM Standalone (#8644)
* Refactoring * Hide SM toggle on member invite and default to true for SM standalone org * changed from hide sm checkbox to default and disable * Removed errant addition from conflict resolution
This commit is contained in:
@@ -385,7 +385,12 @@
|
||||
</h3>
|
||||
<p class="tw-text-muted">{{ "secretsManagerAccessDescription" | i18n }}</p>
|
||||
<bit-form-control>
|
||||
<input type="checkbox" bitCheckbox formControlName="accessSecretsManager" />
|
||||
<input
|
||||
type="checkbox"
|
||||
[disabled]="isOnSecretsManagerStandalone"
|
||||
bitCheckbox
|
||||
formControlName="accessSecretsManager"
|
||||
/>
|
||||
<bit-label>
|
||||
{{ "userAccessSecretsManagerGA" | i18n }}
|
||||
</bit-label>
|
||||
|
||||
@@ -63,6 +63,7 @@ export interface MemberDialogParams {
|
||||
organizationUserId: string;
|
||||
allOrganizationUserEmails: string[];
|
||||
usesKeyConnector: boolean;
|
||||
isOnSecretsManagerStandalone: boolean;
|
||||
initialTab?: MemberDialogTab;
|
||||
numConfirmedMembers: number;
|
||||
}
|
||||
@@ -88,6 +89,7 @@ export class MemberDialogComponent implements OnDestroy {
|
||||
organizationUserType = OrganizationUserType;
|
||||
PermissionMode = PermissionMode;
|
||||
showNoMasterPasswordWarning = false;
|
||||
isOnSecretsManagerStandalone: boolean;
|
||||
|
||||
protected organization$: Observable<Organization>;
|
||||
protected collectionAccessItems: AccessItemView[] = [];
|
||||
@@ -160,6 +162,13 @@ export class MemberDialogComponent implements OnDestroy {
|
||||
this.editMode = this.params.organizationUserId != null;
|
||||
this.tabIndex = this.params.initialTab ?? MemberDialogTab.Role;
|
||||
this.title = this.i18nService.t(this.editMode ? "editMember" : "inviteMember");
|
||||
this.isOnSecretsManagerStandalone = this.params.isOnSecretsManagerStandalone;
|
||||
|
||||
if (this.isOnSecretsManagerStandalone) {
|
||||
this.formGroup.patchValue({
|
||||
accessSecretsManager: true,
|
||||
});
|
||||
}
|
||||
|
||||
const groups$ = this.organization$.pipe(
|
||||
switchMap((organization) =>
|
||||
|
||||
@@ -37,6 +37,7 @@ import {
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { Policy } from "@bitwarden/common/admin-console/models/domain/policy";
|
||||
import { OrganizationKeysRequest } from "@bitwarden/common/admin-console/models/request/organization-keys.request";
|
||||
import { OrganizationBillingServiceAbstraction as OrganizationBillingService } from "@bitwarden/common/billing/abstractions/organization-billing.service";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { ListResponse } from "@bitwarden/common/models/response/list.response";
|
||||
import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service";
|
||||
@@ -93,6 +94,7 @@ export class PeopleComponent extends BasePeopleComponent<OrganizationUserView> {
|
||||
organization: Organization;
|
||||
status: OrganizationUserStatusType = null;
|
||||
orgResetPasswordPolicyEnabled = false;
|
||||
orgIsOnSecretsManagerStandalone = false;
|
||||
|
||||
protected canUseSecretsManager$: Observable<boolean>;
|
||||
|
||||
@@ -119,6 +121,7 @@ export class PeopleComponent extends BasePeopleComponent<OrganizationUserView> {
|
||||
private groupService: GroupService,
|
||||
private collectionService: CollectionService,
|
||||
organizationManagementPreferencesService: OrganizationManagementPreferencesService,
|
||||
private organizationBillingService: OrganizationBillingService,
|
||||
) {
|
||||
super(
|
||||
apiService,
|
||||
@@ -187,6 +190,11 @@ export class PeopleComponent extends BasePeopleComponent<OrganizationUserView> {
|
||||
.find((p) => p.organizationId === this.organization.id);
|
||||
this.orgResetPasswordPolicyEnabled = resetPasswordPolicy?.enabled;
|
||||
|
||||
this.orgIsOnSecretsManagerStandalone =
|
||||
await this.organizationBillingService.isOnSecretsManagerStandalone(
|
||||
this.organization.id,
|
||||
);
|
||||
|
||||
await this.load();
|
||||
|
||||
this.searchText = qParams.search;
|
||||
@@ -446,6 +454,7 @@ export class PeopleComponent extends BasePeopleComponent<OrganizationUserView> {
|
||||
organizationUserId: user != null ? user.id : null,
|
||||
allOrganizationUserEmails: this.allUsers?.map((user) => user.email) ?? [],
|
||||
usesKeyConnector: user?.usesKeyConnector,
|
||||
isOnSecretsManagerStandalone: this.orgIsOnSecretsManagerStandalone,
|
||||
initialTab: initialTab,
|
||||
numConfirmedMembers: this.confirmedCount,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user