1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-18 18:33:50 +00:00

Merge branch 'main' into uif/cl-349/popover-arrow

This commit is contained in:
Vicki League
2025-02-18 12:24:39 -05:00
committed by GitHub
196 changed files with 6584 additions and 2653 deletions

View File

@@ -6,10 +6,6 @@ import * as stories from "./anon-layout-wrapper.stories";
# Anon Layout Wrapper
NOTE: These stories will treat "Light & Dark" mode as "Light" mode. This is done to avoid a bug with
the way that we render the same component twice in the same iframe and how that interacts with the
`router-outlet`.
## Anon Layout Wrapper Component
The auth owned `AnonLayoutWrapperComponent` orchestrates routing configuration data and feeds it

View File

@@ -8,7 +8,6 @@ export enum FeatureFlag {
ProviderClientVaultPrivacyBanner = "ac-2833-provider-client-vault-privacy-banner",
AccountDeprovisioning = "pm-10308-account-deprovisioning",
VerifiedSsoDomainEndpoint = "pm-12337-refactor-sso-details-endpoint",
PM14505AdminConsoleIntegrationPage = "pm-14505-admin-console-integration-page",
LimitItemDeletion = "pm-15493-restrict-item-deletion-to-can-manage-permission",
/* Autofill */
@@ -69,7 +68,6 @@ export const DefaultFeatureFlagValue = {
[FeatureFlag.ProviderClientVaultPrivacyBanner]: FALSE,
[FeatureFlag.AccountDeprovisioning]: FALSE,
[FeatureFlag.VerifiedSsoDomainEndpoint]: FALSE,
[FeatureFlag.PM14505AdminConsoleIntegrationPage]: FALSE,
[FeatureFlag.LimitItemDeletion]: FALSE,
/* Autofill */

View File

@@ -65,7 +65,6 @@ export default class Domain {
key: SymmetricCryptoKey = null,
objectContext: string = "No Domain Context",
): Promise<T> {
const promises = [];
const self: any = this;
for (const prop in map) {
@@ -74,27 +73,15 @@ export default class Domain {
continue;
}
(function (theProp) {
const p = Promise.resolve()
.then(() => {
const mapProp = map[theProp] || theProp;
if (self[mapProp]) {
return self[mapProp].decrypt(
orgId,
key,
`Property: ${prop}; ObjectContext: ${objectContext}`,
);
}
return null;
})
.then((val: any) => {
(viewModel as any)[theProp] = val;
});
promises.push(p);
})(prop);
const mapProp = map[prop] || prop;
if (self[mapProp]) {
(viewModel as any)[prop] = await self[mapProp].decrypt(
orgId,
key,
`Property: ${prop}; ObjectContext: ${objectContext}`,
);
}
}
await Promise.all(promises);
return viewModel;
}
@@ -121,22 +108,20 @@ export default class Domain {
_: Constructor<TThis> = this.constructor as Constructor<TThis>,
objectContext: string = "No Domain Context",
): Promise<DecryptedObject<TThis, TEncryptedKeys>> {
const promises = [];
const decryptedObjects = [];
for (const prop of encryptedProperties) {
const value = (this as any)[prop] as EncString;
promises.push(
this.decryptProperty(
prop,
value,
key,
encryptService,
`Property: ${prop.toString()}; ObjectContext: ${objectContext}`,
),
const decrypted = await this.decryptProperty(
prop,
value,
key,
encryptService,
`Property: ${prop.toString()}; ObjectContext: ${objectContext}`,
);
decryptedObjects.push(decrypted);
}
const decryptedObjects = await Promise.all(promises);
const decryptedObject = decryptedObjects.reduce(
(acc, obj) => {
return { ...acc, ...obj };

View File

@@ -12,7 +12,10 @@ import { CipherRepromptType } from "../../enums/cipher-reprompt-type";
import { CipherType } from "../../enums/cipher-type";
import { CipherData } from "../data/cipher.data";
import { LocalData } from "../data/local.data";
import { AttachmentView } from "../view/attachment.view";
import { CipherView } from "../view/cipher.view";
import { FieldView } from "../view/field.view";
import { PasswordHistoryView } from "../view/password-history.view";
import { Attachment } from "./attachment";
import { Card } from "./card";
@@ -136,6 +139,7 @@ export class Cipher extends Domain implements Decryptable<CipherView> {
if (this.key != null) {
const encryptService = Utils.getContainerService().getEncryptService();
const keyBytes = await encryptService.decryptToBytes(
this.key,
encKey,
@@ -198,44 +202,28 @@ export class Cipher extends Domain implements Decryptable<CipherView> {
}
if (this.attachments != null && this.attachments.length > 0) {
const attachments: any[] = [];
await this.attachments.reduce((promise, attachment) => {
return promise
.then(() => {
return attachment.decrypt(this.organizationId, `Cipher Id: ${this.id}`, encKey);
})
.then((decAttachment) => {
attachments.push(decAttachment);
});
}, Promise.resolve());
const attachments: AttachmentView[] = [];
for (const attachment of this.attachments) {
attachments.push(
await attachment.decrypt(this.organizationId, `Cipher Id: ${this.id}`, encKey),
);
}
model.attachments = attachments;
}
if (this.fields != null && this.fields.length > 0) {
const fields: any[] = [];
await this.fields.reduce((promise, field) => {
return promise
.then(() => {
return field.decrypt(this.organizationId, encKey);
})
.then((decField) => {
fields.push(decField);
});
}, Promise.resolve());
const fields: FieldView[] = [];
for (const field of this.fields) {
fields.push(await field.decrypt(this.organizationId, encKey));
}
model.fields = fields;
}
if (this.passwordHistory != null && this.passwordHistory.length > 0) {
const passwordHistory: any[] = [];
await this.passwordHistory.reduce((promise, ph) => {
return promise
.then(() => {
return ph.decrypt(this.organizationId, encKey);
})
.then((decPh) => {
passwordHistory.push(decPh);
});
}, Promise.resolve());
const passwordHistory: PasswordHistoryView[] = [];
for (const ph of this.passwordHistory) {
passwordHistory.push(await ph.decrypt(this.organizationId, encKey));
}
model.passwordHistory = passwordHistory;
}

View File

@@ -45,7 +45,6 @@ export type ChipSelectOption<T> = Option<T> & {
multi: true,
},
],
preserveWhitespaces: false,
})
export class ChipSelectComponent<T = unknown> implements ControlValueAccessor, AfterViewInit {
@ViewChild(MenuComponent) menu: MenuComponent;

View File

@@ -22,7 +22,6 @@ enum CharacterType {
}
</span>
}`,
preserveWhitespaces: false,
standalone: true,
})
export class ColorPasswordComponent {

View File

@@ -29,7 +29,6 @@ import { SideNavService } from "./side-nav.service";
],
standalone: true,
imports: [CommonModule, NavItemComponent, IconButtonModule, I18nPipe],
preserveWhitespaces: false,
})
export class NavGroupComponent extends NavBaseComponent implements AfterContentInit {
@ContentChildren(NavBaseComponent, {

View File

@@ -13,7 +13,7 @@ export const Table = (args) => (
<table class={"border tw-table-auto !tw-text-main " + args.class}>
<thead>
<tr>
<th>General usage</th>
<th class="tw-w-40">General usage</th>
<th class="tw-w-20"></th>
</tr>
</thead>
@@ -119,6 +119,4 @@ Below are all the permited colors. Please consult design before considering addi
<div class="tw-flex tw-space-x-4">
<Table />
<Table class="theme_dark tw-bg-background" />
<Table class="theme_nord tw-bg-background" />
<Table class="theme_solarize tw-bg-background" />
</div>

View File

@@ -56,12 +56,6 @@ class KitchenSinkDialog {
isolated stories. The stories for the Kitchen Sink exist to be tested by the Chromatic UI
tests.
</p>
<p bitTypography="body1">
NOTE: These stories will treat "Light & Dark" mode as "Light" mode. This is done to avoid a
bug with the way that we render the same component twice in the same iframe and how that
interacts with the <code>router-outlet</code>.
</p>
</bit-callout>
<bit-tab-group label="Main content tabs" class="tw-text-main">

View File

@@ -9,7 +9,3 @@ import * as stories from "./kitchen-sink.stories";
The purpose of this story is to compose together all of our components. When snapshot tests run,
we'll be able to spot-check visual changes in a more app-like environment than just the isolated
stories. The stories for the Kitchen Sink exist to be tested by the Chromatic UI tests.
NOTE: These stories will treat "Light & Dark" mode as "Light" mode. This is done to avoid a bug with
the way that we render the same component twice in the same iframe and how that interacts with the
`router-outlet`.

View File

@@ -23,7 +23,6 @@ import { ToastComponent } from "./toast.component";
transition("active => removed", animate("{{ easeTime }}ms {{ easing }}")),
]),
],
preserveWhitespaces: false,
standalone: true,
imports: [ToastComponent],
})

View File

@@ -12,7 +12,6 @@ let nextId = 0;
@Component({
selector: "bit-toggle-group",
templateUrl: "./toggle-group.component.html",
preserveWhitespaces: false,
standalone: true,
})
export class ToggleGroupComponent<TValue = unknown> {

View File

@@ -19,7 +19,6 @@ let nextId = 0;
@Component({
selector: "bit-toggle",
templateUrl: "./toggle.component.html",
preserveWhitespaces: false,
standalone: true,
imports: [NgClass],
})

View File

@@ -368,20 +368,20 @@ export class DefaultKeyService implements KeyServiceAbstraction {
await this.stateProvider.getUser(userId, USER_ENCRYPTED_ORGANIZATION_KEYS).update(() => {
const encOrgKeyData: { [orgId: string]: EncryptedOrganizationKeyData } = {};
orgs.forEach((org) => {
for (const org of orgs) {
encOrgKeyData[org.id] = {
type: "organization",
key: org.key,
};
});
}
providerOrgs.forEach((org) => {
for (const org of providerOrgs) {
encOrgKeyData[org.id] = {
type: "provider",
providerId: org.providerId,
key: org.key,
};
});
}
return encOrgKeyData;
});
}