-
+
@@ -40,6 +40,9 @@
check_circle
@@ -55,6 +58,7 @@
type="file"
class="transition cursor-pointer file:transition file:cursor-pointer text-secondaryLight hover:text-secondaryDark file:mr-2 file:py-2 file:px-4 file:rounded file:border-0 file:text-secondary hover:file:text-secondaryDark file:bg-primaryLight hover:file:bg-primaryDark"
:accept="step.metadata.acceptedFileTypes"
+ @change="onFileChange"
/>
@@ -62,17 +66,22 @@
+ {{ enableImportButton }}
+ ---
-
-
-
diff --git a/packages/hoppscotch-app/helpers/import-export/import/hopp.ts b/packages/hoppscotch-app/helpers/import-export/import/hopp.ts
index 65b5d2f3..e0741044 100644
--- a/packages/hoppscotch-app/helpers/import-export/import/hopp.ts
+++ b/packages/hoppscotch-app/helpers/import-export/import/hopp.ts
@@ -6,7 +6,8 @@ import { defineImporter, IMPORTER_INVALID_FILE_FORMAT } from "."
import { translateToNewRESTCollection } from "~/newstore/collections"
export default defineImporter({
- name: "Hoppscotch REST Collection",
+ name: "import.json",
+ icon: "folder-plus",
steps: [
step({
stepName: "FILE_OR_URL_IMPORT",
diff --git a/packages/hoppscotch-app/helpers/import-export/import/index.ts b/packages/hoppscotch-app/helpers/import-export/import/index.ts
index ec6ce751..f01ef34b 100644
--- a/packages/hoppscotch-app/helpers/import-export/import/index.ts
+++ b/packages/hoppscotch-app/helpers/import-export/import/index.ts
@@ -22,6 +22,11 @@ type HoppImporterDefintion = {
*/
name: string
+ /**
+ * Icon for importer button
+ */
+ icon: string
+
/**
* The importer function, It is a Promise because its supposed to be loaded in lazily (dynamic imports ?)
*/
@@ -38,6 +43,7 @@ type HoppImporterDefintion = {
*/
export const defineImporter = (input: {
name: string
+ icon: string
importer: HoppImporter
steps: StepType
}) => {
diff --git a/packages/hoppscotch-app/helpers/import-export/import/insomnia.ts b/packages/hoppscotch-app/helpers/import-export/import/insomnia.ts
index 3168c969..d96e0654 100644
--- a/packages/hoppscotch-app/helpers/import-export/import/insomnia.ts
+++ b/packages/hoppscotch-app/helpers/import-export/import/insomnia.ts
@@ -11,6 +11,7 @@ import { Collection } from "~/newstore/collections"
export default defineImporter({
name: "Insomnia Collection",
+ icon: "insomnia",
steps: [
step({
stepName: "FILE_OR_URL_IMPORT",
diff --git a/packages/hoppscotch-app/helpers/import-export/import/openapi.ts b/packages/hoppscotch-app/helpers/import-export/import/openapi.ts
index 82d01568..8ce706f2 100644
--- a/packages/hoppscotch-app/helpers/import-export/import/openapi.ts
+++ b/packages/hoppscotch-app/helpers/import-export/import/openapi.ts
@@ -585,7 +585,8 @@ const parseOpenAPIDocContent = (str: string) =>
)
export default defineImporter({
- name: "Swagger/OpenAPI v3 Schema",
+ name: "import.from_openapi",
+ icon: "file",
steps: [
step({
stepName: "FILE_OR_URL_IMPORT",
diff --git a/packages/hoppscotch-app/helpers/import-export/import/postman.ts b/packages/hoppscotch-app/helpers/import-export/import/postman.ts
index 2ee0f0d8..a1040e13 100644
--- a/packages/hoppscotch-app/helpers/import-export/import/postman.ts
+++ b/packages/hoppscotch-app/helpers/import-export/import/postman.ts
@@ -180,6 +180,7 @@ const safeParseJSON = (str: string) => O.tryCatch(() => JSON.parse(str))
export default defineImporter({
name: "Postman Collection",
+ icon: "postman",
steps: [
step({
stepName: "FILE_OR_URL_IMPORT",