mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
[SM-628] Add trim validator to SM dialogs (#4993)
* Add trim validator to SM dialogs * Swap to creating a generic component * Swap to BitValidators.trimValidator * Fix storybook * update validator to auto trim whitespace * update storybook copy * fix copy * update trim validator to run on submit * add validator to project name in secret dialog; update secret name validation to on submit --------- Co-authored-by: William Martin <contact@willmartian.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import { Router } from "@angular/router";
|
||||
|
||||
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
||||
import { BitValidators } from "@bitwarden/components";
|
||||
|
||||
import { ProjectView } from "../../models/view/project.view";
|
||||
import { ProjectService } from "../../projects/project.service";
|
||||
@@ -25,7 +26,10 @@ export interface ProjectOperation {
|
||||
})
|
||||
export class ProjectDialogComponent implements OnInit {
|
||||
protected formGroup = new FormGroup({
|
||||
name: new FormControl("", [Validators.required]),
|
||||
name: new FormControl("", {
|
||||
validators: [Validators.required, BitValidators.trimValidator],
|
||||
updateOn: "submit",
|
||||
}),
|
||||
});
|
||||
protected loading = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user