Skip to content

Commit

Permalink
Merge pull request #699 from yatish27/fix_typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
knadh committed Feb 16, 2022
2 parents 17e723a + 6c90323 commit caa27f3
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cmd/campaigns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions cmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions cmd/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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()))
Expand Down
2 changes: 1 addition & 1 deletion frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ListSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/Campaigns.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/Import.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions internal/subimporter/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"`
Expand Down

0 comments on commit caa27f3

Please sign in to comment.