From 120fd142135b23e8f7ae9ca5e0e285ac1f638fba Mon Sep 17 00:00:00 2001 From: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com> Date: Thu, 4 May 2023 10:48:01 -0400 Subject: [PATCH] Remove all TypeScript region use as it is now against the Bitwarden code style guide. (#5356) --- .../src/autofill/content/notification-bar.ts | 18 +++++++++--------- .../domain-add-edit-dialog.component.ts | 12 ++++++------ .../domain-verification.component.ts | 4 +--- libs/common/src/enums/http-status-code.enum.ts | 15 ++++----------- 4 files changed, 20 insertions(+), 29 deletions(-) diff --git a/apps/browser/src/autofill/content/notification-bar.ts b/apps/browser/src/autofill/content/notification-bar.ts index 7edc730dec..330196dc64 100644 --- a/apps/browser/src/autofill/content/notification-bar.ts +++ b/apps/browser/src/autofill/content/notification-bar.ts @@ -124,7 +124,7 @@ document.addEventListener("DOMContentLoaded", (event) => { } }); - //#region Message Processing + // Message Processing // Listen for messages from the background script // Note: onMessage events are fired when a message is sent from either an extension process @@ -182,7 +182,7 @@ document.addEventListener("DOMContentLoaded", (event) => { return true; } } - //#endregion Message Processing + // End Message Processing /** * Observe the DOM for changes and collect page details if forms are added to the page @@ -367,9 +367,9 @@ document.addEventListener("DOMContentLoaded", (event) => { }); } - //#endregion Page Detail Collection Methods + // End Page Detail Collection Methods - // #region Form Detection and Submission Handling + // Form Detection and Submission Handling /** * Iterates through the given array of forms and adds an event listener to each form. @@ -825,9 +825,9 @@ document.addEventListener("DOMContentLoaded", (event) => { }, 500); } - //#endregion Form Detection and Submission Handling + // End Form Detection and Submission Handling - //#region Notification Bar Functions (open, close, height adjustment, etc.) + // Notification Bar Functions (open, close, height adjustment, etc.) function closeExistingAndOpenBar(type: string, typeData: any) { const barQueryParams = { type, @@ -924,9 +924,9 @@ document.addEventListener("DOMContentLoaded", (event) => { el.style.height = heightStyle; } } - //#endregion Notification Bar Functions (open, close, height adjustment, etc.) + // End Notification Bar Functions (open, close, height adjustment, etc.) - //#region Helper Functions + // Helper Functions function sendPlatformMessage(msg: any) { chrome.runtime.sendMessage(msg); } @@ -992,5 +992,5 @@ document.addEventListener("DOMContentLoaded", (event) => { return theEl === document; } - //#endregion Helper Functions + // End Helper Functions }); diff --git a/bitwarden_license/bit-web/src/app/admin-console/organizations/manage/domain-verification/domain-add-edit-dialog/domain-add-edit-dialog.component.ts b/bitwarden_license/bit-web/src/app/admin-console/organizations/manage/domain-verification/domain-add-edit-dialog/domain-add-edit-dialog.component.ts index 94990daea0..c205f766d5 100644 --- a/bitwarden_license/bit-web/src/app/admin-console/organizations/manage/domain-verification/domain-add-edit-dialog/domain-add-edit-dialog.component.ts +++ b/bitwarden_license/bit-web/src/app/admin-console/organizations/manage/domain-verification/domain-add-edit-dialog/domain-add-edit-dialog.component.ts @@ -69,7 +69,7 @@ export class DomainAddEditDialogComponent implements OnInit, OnDestroy { private dialogService: DialogServiceAbstraction ) {} - //#region Angular Method Implementations + // Angular Method Implementations async ngOnInit(): Promise { // If we have data.orgDomain, then editing, otherwise creating new domain @@ -81,9 +81,9 @@ export class DomainAddEditDialogComponent implements OnInit, OnDestroy { this.componentDestroyed$.complete(); } - //#endregion + // End Angular Method Implementations - //#region Form methods + // Form methods async populateForm(): Promise { if (this.data.orgDomain) { @@ -118,9 +118,9 @@ export class DomainAddEditDialogComponent implements OnInit, OnDestroy { this.orgDomainService.copyDnsTxt(this.txtCtrl.value); } - //#endregion + // End Form methods - //#region Async Form Actions + // Async Form Actions saveDomain = async (): Promise => { if (this.domainForm.invalid) { this.platformUtilsService.showToast("error", null, this.i18nService.t("domainFormInvalid")); @@ -266,5 +266,5 @@ export class DomainAddEditDialogComponent implements OnInit, OnDestroy { this.dialogRef.close(); }; - //#endregion + // End Async Form Actions } diff --git a/bitwarden_license/bit-web/src/app/admin-console/organizations/manage/domain-verification/domain-verification.component.ts b/bitwarden_license/bit-web/src/app/admin-console/organizations/manage/domain-verification/domain-verification.component.ts index f650db766f..8de4077478 100644 --- a/bitwarden_license/bit-web/src/app/admin-console/organizations/manage/domain-verification/domain-verification.component.ts +++ b/bitwarden_license/bit-web/src/app/admin-console/organizations/manage/domain-verification/domain-verification.component.ts @@ -96,7 +96,7 @@ export class DomainVerificationComponent implements OnInit, OnDestroy { return existingDomainNames; } - //#region Options + // Options copyDnsTxt(dnsTxt: string): void { this.orgDomainService.copyDnsTxt(dnsTxt); @@ -169,8 +169,6 @@ export class DomainVerificationComponent implements OnInit, OnDestroy { this.platformUtilsService.showToast("success", null, this.i18nService.t("domainRemoved")); } - //#endregion - ngOnDestroy(): void { this.componentDestroyed$.next(); this.componentDestroyed$.complete(); diff --git a/libs/common/src/enums/http-status-code.enum.ts b/libs/common/src/enums/http-status-code.enum.ts index 602d7fde1b..94226c8255 100644 --- a/libs/common/src/enums/http-status-code.enum.ts +++ b/libs/common/src/enums/http-status-code.enum.ts @@ -27,7 +27,7 @@ export enum HttpStatusCode { Processing = 102, // ********************************************************************************************************** - //#region 200s - SUCCESS + // 200s - SUCCESS // ********************************************************************************************************** /** @@ -92,10 +92,8 @@ export enum HttpStatusCode { */ ImUsed = 226, - // #endregion - // ********************************************************************************************************** - //#region 300s - Redirections + // 300s - Redirections // ********************************************************************************************************** /** @@ -161,10 +159,8 @@ export enum HttpStatusCode { */ PermanentRedirect = 308, - // #endregion - // ********************************************************************************************************** - // #region - 400s - Client / User messed up + // 400s - Client / User messed up // ********************************************************************************************************** /** @@ -335,10 +331,8 @@ export enum HttpStatusCode { */ UnavailableForLegalReasons = 451, - // #endregion - // ********************************************************************************************************** - // #region - 500s - Serve messed up + // 500s - Server messed up // ********************************************************************************************************** /** @@ -399,5 +393,4 @@ export enum HttpStatusCode { * to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot). */ NetworkAuthenticationRequired = 511, - // #endregion }