Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Oct 22, 2024
1 parent 910cb31 commit 8610a8a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
14 changes: 7 additions & 7 deletions packages/hoppscotch-common/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
"turn_on": "Turn on",
"undo": "Undo",
"verify": "Verify",
"yes": "Yes"
"yes": "Yes",
"enable": "Enable",
"disable": "Disable"
},
"add": {
"new": "Add new",
Expand Down Expand Up @@ -714,18 +716,16 @@
"account_email_description": "Your primary email address.",
"account_name_description": "This is your display name.",
"additional": "Additional Settings",
"auto_mode": "Auto",
"auto_mode_tooltip": "Encode the parameters in the request only if some special characters are present",
"auto_encode_mode": "Auto",
"auto_encode_mode_tooltip": "Encode the parameters in the request only if some special characters are present",
"background": "Background",
"black_mode": "Black",
"choose_language": "Choose language",
"dark_mode": "Dark",
"delete_account": "Delete account",
"delete_account_description": "Once you delete your account, all your data will be permanently deleted. This action cannot be undone.",
"disable_mode": "Disable",
"disable_mode_tooltip": "Never encode the parameters in the request",
"encode_mode": "Encode",
"encode_mode_tooltip": "Always encode the parameters in the request",
"disable_encode_mode_tooltip": "Never encode the parameters in the request",
"enable_encode_mode_tooltip": "Always encode the parameters in the request",
"expand_navigation": "Expand navigation",
"experiments": "Experiments",
"experiments_notice": "This is a collection of experiments we're working on that might turn out to be useful, fun, both, or neither. They're not final and may not be stable, so if something overly weird happens, don't panic. Just turn the dang thing off. Jokes aside, ",
Expand Down
22 changes: 11 additions & 11 deletions packages/hoppscotch-common/src/components/smart/EncodingPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
v-tippy="{ theme: 'tooltip', maxWidth: 500 }"
:value="mode"
:label="t(getEncodingModeName(mode))"
:title="t(getEncodeingModeTooltip(mode))"
:title="t(getEncodingModeTooltip(mode))"
:selected="mode === activeMode"
:class="'!px-0 hover:bg-transparent'"
@change="changeMode(mode)"
Expand All @@ -34,27 +34,27 @@ const changeMode = (mode: EncodeMode) => {
const getEncodingModeName = (mode: string) => {
switch (mode) {
case "encode":
return "settings.encode_mode"
case "enable":
return "action.enable"
case "disable":
return "settings.disable_mode"
return "action.disable"
case "auto":
return "settings.auto_mode"
return "settings.auto_encode_mode"
default:
return "settings.encode_mode"
}
}
const getEncodeingModeTooltip = (mode: string) => {
const getEncodingModeTooltip = (mode: string) => {
switch (mode) {
case "encode":
return "settings.encode_mode_tooltip"
case "enable":
return "settings.enable_encode_mode_tooltip"
case "disable":
return "settings.disable_mode_tooltip"
return "settings.disable_encode_mode_tooltip"
case "auto":
return "settings.auto_mode_tooltip"
return "settings.auto_encode_mode_tooltip"
default:
return "settings.encode_mode_tooltip"
return "settings.enable_encode_mode_tooltip"
}
}
</script>
4 changes: 2 additions & 2 deletions packages/hoppscotch-common/src/newstore/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const HoppAccentColors = [
"pink",
] as const

export const EncodeModes = ["encode", "disable", "auto"] as const
export const EncodeModes = ["enable", "disable", "auto"] as const

export type EncodeMode = (typeof EncodeModes)[number]

Expand Down Expand Up @@ -112,7 +112,7 @@ export const getDefaultSettings = (): SettingsDef => ({
},
THEME_COLOR: "indigo",
BG_COLOR: "system",
ENCODE_MODE: "encode",
ENCODE_MODE: "enable",
TELEMETRY_ENABLED: true,
EXPAND_NAVIGATION: false,
SIDEBAR: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const preProcessRequest = (
for (const [key, value] of reqClone.params.entries()) {
let finalValue = value
if (
encodeMode.value === "encode" ||
encodeMode.value === "enable" ||
(encodeMode.value === "auto" &&
/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+/.test(value))
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const ThemeColorSchema = z.enum([

const BgColorSchema = z.enum(["system", "light", "dark", "black"])

const EncodeMode = z.enum(["encode", "disable", "auto"])
const EncodeMode = z.enum(["enable", "disable", "auto"])

const SettingsDefSchema = z.object({
syncCollections: z.boolean(),
Expand All @@ -43,7 +43,7 @@ const SettingsDefSchema = z.object({
}),
THEME_COLOR: ThemeColorSchema,
BG_COLOR: BgColorSchema,
ENCODE_MODE: EncodeMode.catch("encode"),
ENCODE_MODE: EncodeMode.catch("enable"),
TELEMETRY_ENABLED: z.boolean(),
EXPAND_NAVIGATION: z.boolean(),
SIDEBAR: z.boolean(),
Expand Down

0 comments on commit 8610a8a

Please sign in to comment.