1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-11 14:04:03 +00:00

Merge branch 'main' into fix-ci

This commit is contained in:
Addison Beck
2025-01-08 13:37:40 -05:00
4 changed files with 64 additions and 12 deletions

16
.github/renovate.json vendored
View File

@@ -104,6 +104,8 @@
"matchPackageNames": [
"@babel/core",
"@babel/preset-env",
"@bitwarden/sdk-internal",
"@electron/fuses",
"@electron/notarize",
"@electron/rebuild",
"@ngtools/webpack",
@@ -115,7 +117,7 @@
"@types/node",
"@types/node-forge",
"@types/node-ipc",
"@yao-pkg",
"@yao-pkg/pkg",
"babel-loader",
"browserslist",
"copy-webpack-plugin",
@@ -135,6 +137,7 @@
"tsconfig-paths-webpack-plugin",
"type-fest",
"typescript",
"typescript-strict-plugin",
"webpack",
"webpack-cli",
"webpack-dev-server",
@@ -151,12 +154,13 @@
"@angular/cdk",
"@angular/cli",
"@angular/common",
"@angular/compiler",
"@angular/compiler-cli",
"@angular/compiler",
"@angular/core",
"@angular/forms",
"@angular/platform-browser-dynamic",
"@angular/platform-browser",
"@angular/platform",
"@angular/compiler",
"@angular/router",
"@compodoc/compodoc",
"@ng-select/ng-select",
@@ -164,8 +168,11 @@
"@storybook/addon-actions",
"@storybook/addon-designs",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-links",
"@storybook/angular",
"@storybook/manager-api",
"@storybook/theming",
"@types/react",
"autoprefixer",
"bootstrap",
@@ -188,7 +195,9 @@
"matchPackageNames": [
"@angular-eslint/eslint-plugin",
"@angular-eslint/eslint-plugin-template",
"@angular-eslint/schematics",
"@angular-eslint/template-parser",
"@angular/elements",
"@types/jest",
"@typescript-eslint/eslint-plugin",
"@typescript-eslint/parser",
@@ -201,6 +210,7 @@
"eslint-plugin-storybook",
"eslint-plugin-tailwindcss",
"husky",
"jest-extended",
"jest-junit",
"jest-mock-extended",
"jest-preset-angular",

View File

@@ -779,16 +779,26 @@ export class VaultComponent implements OnInit, OnDestroy {
null,
cipherType,
);
const collectionId =
this.activeFilter.collectionId !== "AllCollections" && this.activeFilter.collectionId != null
? this.activeFilter.collectionId
: null;
let organizationId =
this.activeFilter.organizationId !== "MyVault" && this.activeFilter.organizationId != null
? this.activeFilter.organizationId
: null;
// Attempt to get the organization ID from the collection if present
if (collectionId) {
const organizationIdFromCollection = (
await firstValueFrom(this.vaultFilterService.filteredCollections$)
).find((c) => c.id === this.activeFilter.collectionId)?.organizationId;
if (organizationIdFromCollection) {
organizationId = organizationIdFromCollection;
}
}
cipherFormConfig.initialValues = {
organizationId:
this.activeFilter.organizationId !== "MyVault" && this.activeFilter.organizationId != null
? (this.activeFilter.organizationId as OrganizationId)
: null,
collectionIds:
this.activeFilter.collectionId !== "AllCollections" &&
this.activeFilter.collectionId != null
? [this.activeFilter.collectionId as CollectionId]
: [],
organizationId: organizationId as OrganizationId,
collectionIds: [collectionId as CollectionId],
folderId: this.activeFilter.folderId,
};

View File

@@ -23,6 +23,7 @@
"test:watch:all": "jest --watchAll",
"test:types": "node ./scripts/test-types.js",
"test:locales": "tsc --project ./scripts/tsconfig.json && node ./scripts/dist/test-locales.js",
"lint:dep-ownership": "tsc --project ./scripts/tsconfig.json && node ./scripts/dist/dep-ownership.js",
"docs:json": "compodoc -p ./tsconfig.json -e json -d . --disableRoutesGraph",
"storybook": "ng run components:storybook",
"build-storybook": "ng run components:build-storybook",

31
scripts/dep-ownership.ts Normal file
View File

@@ -0,0 +1,31 @@
/* eslint-disable no-console */
/// Ensure that all dependencies in package.json have an owner in the renovate.json file.
import fs from "fs";
import path from "path";
const renovateConfig = JSON.parse(
fs.readFileSync(path.join(__dirname, "..", "..", ".github", "renovate.json"), "utf8"),
);
const packagesWithOwners = renovateConfig.packageRules
.flatMap((rule: any) => rule.matchPackageNames)
.filter((packageName: string) => packageName != null);
const packageJson = JSON.parse(
fs.readFileSync(path.join(__dirname, "..", "..", "package.json"), "utf8"),
);
const dependencies = Object.keys(packageJson.dependencies).concat(
Object.keys(packageJson.devDependencies),
);
const missingOwners = dependencies.filter((dep) => !packagesWithOwners.includes(dep));
if (missingOwners.length > 0) {
console.error("Missing owners for the following dependencies:");
console.error(missingOwners.join("\n"));
process.exit(1);
}
console.log("All dependencies have owners.");