From 6c903239ddd27b76f864fdf4359fac6d87f3133c Mon Sep 17 00:00:00 2001 From: Yatish Mehta Date: Sat, 12 Feb 2022 23:37:00 -0800 Subject: [PATCH] Fix typos --- cmd/campaigns.go | 2 +- cmd/import.go | 4 ++-- cmd/init.go | 8 ++++---- cmd/settings.go | 6 +++--- frontend/README.md | 2 +- frontend/src/components/ListSelector.vue | 2 +- frontend/src/views/Campaigns.vue | 2 +- frontend/src/views/Import.vue | 2 +- internal/subimporter/importer.go | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cmd/campaigns.go b/cmd/campaigns.go index 8c8686c3f..dd781a5cd 100644 --- a/cmd/campaigns.go +++ b/cmd/campaigns.go @@ -684,7 +684,7 @@ func handleGetCampaignViewAnalytics(c echo.Context) error { return c.JSON(http.StatusOK, okResp{out}) } -// sendTestMessage takes a campaign and a subsriber and sends out a sample campaign message. +// sendTestMessage takes a campaign and a subscriber and sends out a sample campaign message. func sendTestMessage(sub models.Subscriber, camp *models.Campaign, app *App) error { if err := camp.CompileTemplate(app.manager.TemplateFuncs(camp)); err != nil { app.log.Printf("error compiling template: %v", err) diff --git a/cmd/import.go b/cmd/import.go index 9663c779b..9d30a66f5 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -22,7 +22,7 @@ func handleImportSubscribers(c echo.Context) error { return echo.NewHTTPError(http.StatusBadRequest, app.i18n.T("import.alreadyRunning")) } - // Unmarsal the JSON params. + // Unmarshal the JSON params. var opt subimporter.SessionOpt if err := json.Unmarshal([]byte(c.FormValue("params")), &opt); err != nil { return echo.NewHTTPError(http.StatusBadRequest, @@ -95,7 +95,7 @@ func handleImportSubscribers(c echo.Context) error { // keeping the global import state (failed / successful) etc. across // multiple files becomes complex. Instead, it's just easier for the // end user to concat multiple CSVs (if there are multiple in the first) - // place and uploada as one in the first place. + // place and upload as one in the first place. dir, files, err := impSess.ExtractZIP(out.Name(), 1) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, diff --git a/cmd/init.go b/cmd/init.go index f50140b49..03af623a3 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -104,7 +104,7 @@ func initFlags() { f.StringSlice("config", []string{"config.toml"}, "path to one or more config files (will be merged in order)") f.Bool("install", false, "setup database (first time)") - f.Bool("idempotent", false, "make --install run only if the databse isn't already setup") + f.Bool("idempotent", false, "make --install run only if the database isn't already setup") f.Bool("upgrade", false, "upgrade database to the current version") f.Bool("version", false, "show current version of the build") f.Bool("new-config", false, "generate sample config file") @@ -129,13 +129,13 @@ func initConfigFiles(files []string, ko *koanf.Koanf) { if os.IsNotExist(err) { lo.Fatal("config file not found. If there isn't one yet, run --new-config to generate one.") } - lo.Fatalf("error loadng config from file: %v.", err) + lo.Fatalf("error loading config from file: %v.", err) } } } // initFileSystem initializes the stuffbin FileSystem to provide -// access to bunded static assets to the app. +// access to bundled static assets to the app. func initFS(appDir, frontendDir, staticDir, i18nDir string) stuffbin.FileSystem { var ( // stuffbin real_path:virtual_alias paths to map local assets on disk @@ -429,7 +429,7 @@ func initSMTPMessenger(m *manager.Manager) messenger.Messenger { lo.Fatalf("no SMTP servers found in config") } - // Load the config for multipme SMTP servers. + // Load the config for multiple SMTP servers. for _, item := range items { if !item.Bool("enabled") { continue diff --git a/cmd/settings.go b/cmd/settings.go index 7ee2f7739..0c0259550 100644 --- a/cmd/settings.go +++ b/cmd/settings.go @@ -167,7 +167,7 @@ func handleUpdateSettings(c echo.Context) error { has = true } - // Assign a UUID. The frontend only sends a password when the user explictly + // Assign a UUID. The frontend only sends a password when the user explicitly // changes the password. In other cases, the existing password in the DB // is copied while updating the settings and the UUID is used to match // the incoming array of SMTP blocks with the array in the DB. @@ -191,7 +191,7 @@ func handleUpdateSettings(c echo.Context) error { // Bounce boxes. for i, s := range set.BounceBoxes { - // Assign a UUID. The frontend only sends a password when the user explictly + // Assign a UUID. The frontend only sends a password when the user explicitly // changes the password. In other cases, the existing password in the DB // is copied while updating the settings and the UUID is used to match // the incoming array of blocks with the array in the DB. @@ -316,7 +316,7 @@ func getSettings(app *App) (settings, error) { "name", "{globals.terms.settings}", "error", pqErrMsg(err))) } - // Unmarshall the settings and filter out sensitive fields. + // Unmarshal the settings and filter out sensitive fields. if err := json.Unmarshal([]byte(b), &out); err != nil { return out, echo.NewHTTPError(http.StatusInternalServerError, app.i18n.Ts("settings.errorEncoding", "error", err.Error())) diff --git a/frontend/README.md b/frontend/README.md index b703d7a16..eb3ac2d79 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -18,7 +18,7 @@ The project uses a global `vuex` state to centrally store the responses to prett There is a global state `loading` (eg: loading.campaigns, loading.lists) that indicates whether an API call for that particular "model" is running. This can be used anywhere in the project to show loading spinners for instance. All the API definitions are in `api/index.js`. It also describes how each API call sets the global `loading` status alongside storing the API responses. -*IMPORTANT*: All JSON field names in GET API responses are automatically camel-cased when they're pulled for the sake of consistentcy in the frontend code and for complying with the linter spec in the project (Vue/AirBnB schema). For example, `content_type` becomes `contentType`. When sending responses to the backend, however, they should be snake-cased manually. This is overridden for certain calls such as `/api/config` and `/api/settings` using the `preserveCase: true` param in `api/index.js`. +*IMPORTANT*: All JSON field names in GET API responses are automatically camel-cased when they're pulled for the sake of consistency in the frontend code and for complying with the linter spec in the project (Vue/AirBnB schema). For example, `content_type` becomes `contentType`. When sending responses to the backend, however, they should be snake-cased manually. This is overridden for certain calls such as `/api/config` and `/api/settings` using the `preserveCase: true` param in `api/index.js`. ## Icon pack diff --git a/frontend/src/components/ListSelector.vue b/frontend/src/components/ListSelector.vue index f88e24c6d..5974772d7 100644 --- a/frontend/src/components/ListSelector.vue +++ b/frontend/src/components/ListSelector.vue @@ -93,7 +93,7 @@ export default { computed: { // Return the list of unselected lists. filteredLists() { - // Get a map of IDs of the user subsciptions. eg: {1: true, 2: true}; + // Get a map of IDs of the user subscriptions. eg: {1: true, 2: true}; const subIDs = this.selectedItems.reduce((obj, item) => ({ ...obj, [item.id]: true }), {}); // Filter lists from the global lists whose IDs are not in the user's diff --git a/frontend/src/views/Campaigns.vue b/frontend/src/views/Campaigns.vue index cb886a159..2fa5510f5 100644 --- a/frontend/src/views/Campaigns.vue +++ b/frontend/src/views/Campaigns.vue @@ -350,7 +350,7 @@ export default Vue.extend({ }, // Stats returns the campaign object with stats (sent, toSend etc.) - // if there's live stats availabe for running campaigns. Otherwise, + // if there's live stats available for running campaigns. Otherwise, // it returns the incoming campaign object that has the static stats // values. getCampaignStats(c) { diff --git a/frontend/src/views/Import.vue b/frontend/src/views/Import.vue index 2ee01e2a0..ba7291d88 100644 --- a/frontend/src/views/Import.vue +++ b/frontend/src/views/Import.vue @@ -247,7 +247,7 @@ export default Vue.extend({ ); }, - // Returns true if an import has finished (failed or sucessful). + // Returns true if an import has finished (failed or successful). isDone() { if (this.status.status === 'finished' || this.status.status === 'stopped' diff --git a/internal/subimporter/importer.go b/internal/subimporter/importer.go index 76bff4f37..3bb20befe 100644 --- a/internal/subimporter/importer.go +++ b/internal/subimporter/importer.go @@ -60,7 +60,7 @@ type Importer struct { sync.RWMutex } -// Options represents inport options. +// Options represents import options. type Options struct { UpsertStmt *sql.Stmt BlocklistStmt *sql.Stmt @@ -90,7 +90,7 @@ type SessionOpt struct { ListIDs []int `json:"lists"` } -// Status reporesents statistics from an ongoing import session. +// Status represents statistics from an ongoing import session. type Status struct { Name string `json:"name"` Total int `json:"total"`