Skip to content

Commit

Permalink
Merge branch 'main' into pt-br-translation
Browse files Browse the repository at this point in the history
  • Loading branch information
stelardn committed Apr 30, 2024
2 parents 4b57889 + eecc3db commit a1d84f8
Show file tree
Hide file tree
Showing 59 changed files with 217 additions and 208 deletions.
4 changes: 1 addition & 3 deletions packages/hoppscotch-backend/nest-cli.json
Expand Up @@ -3,9 +3,7 @@
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"assets": [
"**/*.hbs"
],
"assets": [{ "include": "mailer/templates/**/*", "outDir": "dist" }],
"watchAssets": true
}
}
2 changes: 1 addition & 1 deletion packages/hoppscotch-backend/package.json
@@ -1,6 +1,6 @@
{
"name": "hoppscotch-backend",
"version": "2024.3.1",
"version": "2024.3.2",
"description": "",
"author": "",
"private": true,
Expand Down
4 changes: 3 additions & 1 deletion packages/hoppscotch-common/locales/en.json
Expand Up @@ -374,7 +374,8 @@
"mutations": "Mutations",
"schema": "Schema",
"subscriptions": "Subscriptions",
"switch_connection": "Switch connection"
"switch_connection": "Switch connection",
"url_placeholder": "Enter a GraphQL endpoint URL"
},
"graphql_collections": {
"title": "GraphQL Collections"
Expand Down Expand Up @@ -598,6 +599,7 @@
"title": "Request",
"type": "Request type",
"url": "URL",
"url_placeholder": "Enter a URL or paste a cURL command",
"variables": "Variables",
"view_my_links": "View my links"
},
Expand Down
40 changes: 20 additions & 20 deletions packages/hoppscotch-common/locales/fr.json
Expand Up @@ -58,24 +58,6 @@
"new": "Ajouter un nouveau",
"star": "Ajouter une étoile"
},
"cookies": {
"modal": {
"new_domain_name": "Nouveau nom de domaine",
"set": "Définir un cookie",
"cookie_string": "Chaîne de caractères de cookie",
"enter_cookie_string": "Saisir la chaîne de caractères du cookie",
"cookie_name": "Nom",
"cookie_value": "Valeur",
"cookie_path": "Chemin d'accès",
"cookie_expires": "Expiration",
"managed_tab": "Gestion",
"raw_tab": "Brut",
"interceptor_no_support": "L'intercepteur que vous avez sélectionné ne prend pas en charge les cookies. Sélectionnez un autre intercepteur et réessayez.",
"empty_domains": "La liste des domaines est vide",
"empty_domain": "Le domaine est vide",
"no_cookies_in_domain": "Aucun cookie n'est défini pour ce domaine"
}
},
"app": {
"chat_with_us": "Discuter avec nous",
"contact_us": "Nous contacter",
Expand Down Expand Up @@ -187,7 +169,7 @@
},
"confirm": {
"close_unsaved_tab": "Êtes-vous sûr de vouloir fermer cet onglet ?",
"close_unsaved_tabs": "Êtes-vous sûr de vouloir fermer tous les onglets ? {Les onglets non enregistrés seront perdus.",
"close_unsaved_tabs": "Êtes-vous sûr de vouloir fermer tous les onglets ? {count} onglets non enregistrés seront perdus",
"exit_team": "Êtes-vous sûr de vouloir quitter cette équipe ?",
"logout": "Êtes-vous sûr de vouloir vous déconnecter?",
"remove_collection": "Voulez-vous vraiment supprimer définitivement cette collection ?",
Expand All @@ -207,6 +189,24 @@
"open_request_in_new_tab": "Ouvrir la demande dans un nouvel onglet",
"set_environment_variable": "Définir comme variable"
},
"cookies": {
"modal": {
"new_domain_name": "Nouveau nom de domaine",
"set": "Définir un cookie",
"cookie_string": "Chaîne de caractères de cookie",
"enter_cookie_string": "Saisir la chaîne de caractères du cookie",
"cookie_name": "Nom",
"cookie_value": "Valeur",
"cookie_path": "Chemin d'accès",
"cookie_expires": "Expiration",
"managed_tab": "Gestion",
"raw_tab": "Brut",
"interceptor_no_support": "L'intercepteur que vous avez sélectionné ne prend pas en charge les cookies. Sélectionnez un autre intercepteur et réessayez.",
"empty_domains": "La liste des domaines est vide",
"empty_domain": "Le domaine est vide",
"no_cookies_in_domain": "Aucun cookie n'est défini pour ce domaine"
}
},
"count": {
"header": "En-tête {count}",
"message": "Message {compte}",
Expand Down Expand Up @@ -410,7 +410,7 @@
"description": "Inspecter les erreurs possibles",
"environment": {
"add_environment": "Ajouter à l'environnement",
"not_found": "La variable d'environnement “{environnement}“ n'a pas été trouvée."
"not_found": "La variable d'environnement “{environment}“ n'a pas été trouvée."
},
"header": {
"cookie": "Le navigateur ne permet pas à Hoppscotch de définir l'en-tête Cookie. Pendant que nous travaillons sur l'application de bureau Hoppscotch (bientôt disponible), veuillez utiliser l'en-tête d'autorisation à la place."
Expand Down
4 changes: 2 additions & 2 deletions packages/hoppscotch-common/package.json
@@ -1,7 +1,7 @@
{
"name": "@hoppscotch/common",
"private": true,
"version": "2024.3.1",
"version": "2024.3.2",
"scripts": {
"dev": "pnpm exec npm-run-all -p -l dev:*",
"test": "vitest --run",
Expand Down Expand Up @@ -50,7 +50,7 @@
"axios": "1.6.2",
"buffer": "6.0.3",
"cookie-es": "1.0.0",
"dioc": "1.0.1",
"dioc": "3.0.1",
"esprima": "4.0.1",
"events": "3.3.0",
"fp-ts": "2.16.1",
Expand Down
1 change: 1 addition & 0 deletions packages/hoppscotch-common/src/components.d.ts
Expand Up @@ -32,6 +32,7 @@ declare module 'vue' {
AppSpotlightEntryRESTHistory: typeof import('./components/app/spotlight/entry/RESTHistory.vue')['default']
AppSpotlightEntryRESTRequest: typeof import('./components/app/spotlight/entry/RESTRequest.vue')['default']
AppSpotlightEntryRESTTeamRequestEntry: typeof import('./components/app/spotlight/entry/RESTTeamRequestEntry.vue')['default']
AppSpotlightSearch: typeof import('./components/app/SpotlightSearch.vue')['default']
AppSupport: typeof import('./components/app/Support.vue')['default']
Collections: typeof import('./components/collections/index.vue')['default']
CollectionsAdd: typeof import('./components/collections/Add.vue')['default']
Expand Down
Expand Up @@ -54,9 +54,7 @@
:key="tab.id"
:label="tab.label"
>
<div
class="divide-y divide-dividerLight rounded border border-divider"
>
<div class="divide-y divide-dividerLight">
<HoppSmartPlaceholder
v-if="tab.variables.length === 0"
:src="`/images/states/${colorMode.value}/blockchain.svg`"
Expand Down
Expand Up @@ -56,9 +56,7 @@
:key="tab.id"
:label="tab.label"
>
<div
class="divide-y divide-dividerLight rounded border border-divider"
>
<div class="divide-y divide-dividerLight">
<HoppSmartPlaceholder
v-if="tab.variables.length === 0"
:src="`/images/states/${colorMode.value}/blockchain.svg`"
Expand Down
Expand Up @@ -10,7 +10,7 @@
autocomplete="off"
spellcheck="false"
class="w-full rounded border border-divider bg-primaryLight px-4 py-2 text-secondaryDark"
:placeholder="`${t('request.url')}`"
:placeholder="`${t('graphql.url_placeholder')}`"
:disabled="connected"
@keyup.enter="onConnectClick"
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/hoppscotch-common/src/components/http/Request.vue
Expand Up @@ -54,7 +54,7 @@
>
<SmartEnvInput
v-model="tab.document.request.endpoint"
:placeholder="`${t('request.url')}`"
:placeholder="`${t('request.url_placeholder')}`"
:auto-complete-source="userHistories"
:auto-complete-env="true"
:inspection-results="tabResults"
Expand Down
Expand Up @@ -201,7 +201,7 @@ export class TeamSearchService extends Service {
expandingCollections: Ref<string[]> = ref([])
expandedCollections: Ref<string[]> = ref([])

// FUTURE-TODO: ideally this should return the search results / formatted results instead of directly manipulating the result set
// TODO: ideally this should return the search results / formatted results instead of directly manipulating the result set
// eg: do the spotlight formatting in the spotlight searcher and not here
searchTeams = async (query: string, teamID: string) => {
if (!query.length) {
Expand Down
7 changes: 3 additions & 4 deletions packages/hoppscotch-common/src/modules/dioc.ts
@@ -1,5 +1,5 @@
import { HoppModule } from "."
import { Container, Service } from "dioc"
import { Container, ServiceClassInstance } from "dioc"
import { diocPlugin } from "dioc/vue"
import { DebugService } from "~/services/debug.service"
import { platform } from "~/platform"
Expand All @@ -22,19 +22,18 @@ if (import.meta.env.DEV) {
* services. Please use `useService` if within components or try to convert your
* legacy subsystem into a service if possible.
*/
export function getService<T extends typeof Service<any> & { ID: string }>(
export function getService<T extends ServiceClassInstance<any>>(
service: T
): InstanceType<T> {
return serviceContainer.bind(service)
}

export default <HoppModule>{
onVueAppInit(app) {
// TODO: look into this
// @ts-expect-error Something weird with Vue versions
app.use(diocPlugin, {
container: serviceContainer,
})

for (const service of platform.addedServices ?? []) {
serviceContainer.bind(service)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/hoppscotch-common/src/platform/index.ts
Expand Up @@ -8,14 +8,14 @@ import { AnalyticsPlatformDef } from "./analytics"
import { InterceptorsPlatformDef } from "./interceptors"
import { HoppModule } from "~/modules"
import { InspectorsPlatformDef } from "./inspectors"
import { Service } from "dioc"
import { ServiceClassInstance } from "dioc"
import { IOPlatformDef } from "./io"
import { SpotlightPlatformDef } from "./spotlight"

export type PlatformDef = {
ui?: UIPlatformDef
addedHoppModules?: HoppModule[]
addedServices?: Array<typeof Service<unknown> & { ID: string }>
addedServices?: Array<ServiceClassInstance<unknown>>
auth: AuthPlatformDef
analytics?: AnalyticsPlatformDef
io: IOPlatformDef
Expand Down
7 changes: 4 additions & 3 deletions packages/hoppscotch-common/src/platform/inspectors.ts
@@ -1,4 +1,4 @@
import { Service } from "dioc"
import { Container, ServiceClassInstance } from "dioc"
import { Inspector } from "~/services/inspection"

/**
Expand All @@ -8,8 +8,9 @@ export type PlatformInspectorsDef = {
// We are keeping this as the only mode for now
// So that if we choose to add other modes, we can do without breaking
type: "service"
service: typeof Service<unknown> & { ID: string } & {
new (): Service & Inspector
// TODO: I don't think this type is effective, we have to come up with a better impl
service: ServiceClassInstance<unknown> & {
new (c: Container): Inspector
}
}

Expand Down
7 changes: 4 additions & 3 deletions packages/hoppscotch-common/src/platform/interceptors.ts
@@ -1,12 +1,13 @@
import { Service } from "dioc"
import { Container, ServiceClassInstance } from "dioc"
import { Interceptor } from "~/services/interceptor.service"

export type PlatformInterceptorDef =
| { type: "standalone"; interceptor: Interceptor }
| {
type: "service"
service: typeof Service<unknown> & { ID: string } & {
new (): Service & Interceptor
// TODO: I don't think this type is effective, we have to come up with a better impl
service: ServiceClassInstance<unknown> & {
new (c: Container): Interceptor
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/hoppscotch-common/src/platform/spotlight.ts
@@ -1,10 +1,10 @@
import { Service } from "dioc"
import { Container, ServiceClassInstance } from "dioc"
import { SpotlightSearcher } from "~/services/spotlight"

export type SpotlightPlatformDef = {
additionalSearchers?: Array<
typeof Service<unknown> & { ID: string } & {
new (): Service & SpotlightSearcher
ServiceClassInstance<unknown> & {
new (c: Container): SpotlightSearcher
}
>
}
Expand Up @@ -31,9 +31,7 @@ export class ExtensionInspectorService extends Service implements Inspector {

private readonly inspection = this.bind(InspectionService)

constructor() {
super()

override onServiceInit() {
this.inspection.registerInspector(this)
}

Expand Down
Expand Up @@ -133,9 +133,7 @@ export class ExtensionInterceptorService

public selectable = { type: "selectable" as const }

constructor() {
super()

override onServiceInit() {
this.listenForExtensionStatus()
}

Expand Down
Expand Up @@ -24,9 +24,7 @@ export class EnvironmentMenuService extends Service implements ContextMenu {

private readonly contextMenu = this.bind(ContextMenuService)

constructor() {
super()

override onServiceInit() {
this.contextMenu.registerMenu(this)
}

Expand Down
Expand Up @@ -41,9 +41,7 @@ export class ParameterMenuService extends Service implements ContextMenu {

private readonly contextMenu = this.bind(ContextMenuService)

constructor() {
super()

override onServiceInit() {
this.contextMenu.registerMenu(this)
}

Expand Down
Expand Up @@ -39,9 +39,7 @@ export class URLMenuService extends Service implements ContextMenu {
private readonly contextMenu = this.bind(ContextMenuService)
private readonly restTab = this.bind(RESTTabService)

constructor() {
super()

override onServiceInit() {
this.contextMenu.registerMenu(this)
}

Expand Down
4 changes: 0 additions & 4 deletions packages/hoppscotch-common/src/services/cookie-jar.service.ts
Expand Up @@ -20,10 +20,6 @@ export class CookieJarService extends Service {
*/
public cookieJar = ref(new Map<string, string[]>())

constructor() {
super()
}

public parseSetCookieString(setCookieString: string) {
return setCookieParse(setCookieString)
}
Expand Down
4 changes: 1 addition & 3 deletions packages/hoppscotch-common/src/services/debug.service.ts
Expand Up @@ -14,9 +14,7 @@ import { Service } from "dioc"
export class DebugService extends Service {
public static readonly ID = "DEBUG_SERVICE"

constructor() {
super()

override onServiceInit() {
console.log("DebugService is initialized...")

const container = this.getContainer()
Expand Down
4 changes: 1 addition & 3 deletions packages/hoppscotch-common/src/services/inspection/index.ts
Expand Up @@ -107,9 +107,7 @@ export class InspectionService extends Service {

private readonly restTab = this.bind(RESTTabService)

constructor() {
super()

override onServiceInit() {
this.initializeListeners()
}

Expand Down
Expand Up @@ -53,9 +53,7 @@ export class EnvironmentInspectorService extends Service implements Inspector {
}
)[0]

constructor() {
super()

override onServiceInit() {
this.inspection.registerInspector(this)
}

Expand Down
Expand Up @@ -22,9 +22,7 @@ export class HeaderInspectorService extends Service implements Inspector {
private readonly inspection = this.bind(InspectionService)
private readonly interceptorService = this.bind(InterceptorService)

constructor() {
super()

override onServiceInit() {
this.inspection.registerInspector(this)
}

Expand Down
Expand Up @@ -23,9 +23,7 @@ export class ResponseInspectorService extends Service implements Inspector {

private readonly inspection = this.bind(InspectionService)

constructor() {
super()

override onServiceInit() {
this.inspection.registerInspector(this)
}

Expand Down

0 comments on commit a1d84f8

Please sign in to comment.