1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 17:53:39 +00:00

Vault Strict Typing cleanup (#12512)

* remove strict types from `NewDeviceVerificationNotice`
- Add null default value for class properties
- Enforce that the userId is passed
- noticeState$ can return null

* remove strict types from `CopyCipherFieldService`
- refactor title to be a string rather than null

* remove strict types from `PasswordRepromptComponent`
- add guard to exit early on submit but also solves removing null/undefined from typing

* use bang to ensure required input

* remove strict types from `CopyCipherFieldDirective`
- add bang for required types
- add default values for null types

* add bang for constant variables in cipher form stories

* remove strict types from `DeleteAttachmentComponent`
- add bang for required types
- refactor title to be an empty string

* fix tests
This commit is contained in:
Nick Krantz
2025-01-02 15:37:48 -06:00
committed by GitHub
parent 15cc4ff1eb
commit cf9bc7c455
9 changed files with 25 additions and 33 deletions

View File

@@ -1,5 +1,3 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { importProvidersFrom } from "@angular/core";
import { action } from "@storybook/addon-actions";
import {
@@ -234,7 +232,7 @@ export const Edit: Story = {
config: {
...defaultConfig,
mode: "edit",
originalCipher: defaultConfig.originalCipher,
originalCipher: defaultConfig.originalCipher!,
},
},
};
@@ -245,7 +243,7 @@ export const PartialEdit: Story = {
config: {
...defaultConfig,
mode: "partial-edit",
originalCipher: defaultConfig.originalCipher,
originalCipher: defaultConfig.originalCipher!,
},
},
};
@@ -256,7 +254,7 @@ export const Clone: Story = {
config: {
...defaultConfig,
mode: "clone",
originalCipher: defaultConfig.originalCipher,
originalCipher: defaultConfig.originalCipher!,
},
},
};
@@ -269,7 +267,7 @@ export const NoPersonalOwnership: Story = {
mode: "add",
allowPersonalOwnership: false,
originalCipher: defaultConfig.originalCipher,
organizations: defaultConfig.organizations,
organizations: defaultConfig.organizations!,
},
},
};