From 3bd9ee19258aa8745bcdb7674e4def2a4763685c Mon Sep 17 00:00:00 2001 From: Daniel James Smith <2670567+djsmith85@users.noreply.github.com> Date: Fri, 19 Dec 2025 16:33:40 +0100 Subject: [PATCH] Delete unused models (#18063) These were used prior to the extension refresh work. Co-authored-by: Daniel James Smith --- .github/whitelist-capital-letters.txt | 2 - .../src/models/browserComponentState.ts | 16 ------- .../models/browserGroupingsComponentState.ts | 46 ------------------- 3 files changed, 64 deletions(-) delete mode 100644 apps/browser/src/models/browserComponentState.ts delete mode 100644 apps/browser/src/models/browserGroupingsComponentState.ts diff --git a/.github/whitelist-capital-letters.txt b/.github/whitelist-capital-letters.txt index db5097e5268..b9f904d7613 100644 --- a/.github/whitelist-capital-letters.txt +++ b/.github/whitelist-capital-letters.txt @@ -19,8 +19,6 @@ ./apps/cli/stores/chocolatey/tools/VERIFICATION.txt ./apps/browser/store/windows/AppxManifest.xml ./apps/browser/src/background/nativeMessaging.background.ts -./apps/browser/src/models/browserComponentState.ts -./apps/browser/src/models/browserGroupingsComponentState.ts ./apps/browser/src/models/biometricErrors.ts ./apps/browser/src/browser/safariApp.ts ./apps/browser/src/safari/desktop/ViewController.swift diff --git a/apps/browser/src/models/browserComponentState.ts b/apps/browser/src/models/browserComponentState.ts deleted file mode 100644 index 50ee9fe34d4..00000000000 --- a/apps/browser/src/models/browserComponentState.ts +++ /dev/null @@ -1,16 +0,0 @@ -// FIXME: Update this file to be type safe and remove this and next line -// @ts-strict-ignore -import { Jsonify } from "type-fest"; - -export class BrowserComponentState { - scrollY: number; - searchText: string; - - static fromJSON(json: Jsonify) { - if (json == null) { - return null; - } - - return Object.assign(new BrowserComponentState(), json); - } -} diff --git a/apps/browser/src/models/browserGroupingsComponentState.ts b/apps/browser/src/models/browserGroupingsComponentState.ts deleted file mode 100644 index 364f4beb6bf..00000000000 --- a/apps/browser/src/models/browserGroupingsComponentState.ts +++ /dev/null @@ -1,46 +0,0 @@ -// FIXME: Update this file to be type safe and remove this and next line -// @ts-strict-ignore -import { CollectionView } from "@bitwarden/admin-console/common"; -import { Utils } from "@bitwarden/common/platform/misc/utils"; -import { DeepJsonify } from "@bitwarden/common/types/deep-jsonify"; -import { CipherType } from "@bitwarden/common/vault/enums"; -import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; - -import { BrowserComponentState } from "./browserComponentState"; - -export class BrowserGroupingsComponentState extends BrowserComponentState { - favoriteCiphers: CipherView[]; - noFolderCiphers: CipherView[]; - ciphers: CipherView[]; - collectionCounts: Map; - folderCounts: Map; - typeCounts: Map; - folders: FolderView[]; - collections: CollectionView[]; - deletedCount: number; - - toJSON() { - return Utils.merge(this, { - collectionCounts: Utils.mapToRecord(this.collectionCounts), - folderCounts: Utils.mapToRecord(this.folderCounts), - typeCounts: Utils.mapToRecord(this.typeCounts), - }); - } - - static fromJSON(json: DeepJsonify) { - if (json == null) { - return null; - } - - return Object.assign(new BrowserGroupingsComponentState(), json, { - favoriteCiphers: json.favoriteCiphers?.map((c) => CipherView.fromJSON(c)), - noFolderCiphers: json.noFolderCiphers?.map((c) => CipherView.fromJSON(c)), - ciphers: json.ciphers?.map((c) => CipherView.fromJSON(c)), - collectionCounts: Utils.recordToMap(json.collectionCounts), - folderCounts: Utils.recordToMap(json.folderCounts), - typeCounts: Utils.recordToMap(json.typeCounts), - folders: json.folders?.map((f) => FolderView.fromJSON(f)), - }); - } -}