diff --git a/packages/hoppscotch-backend/src/auth/auth.module.ts b/packages/hoppscotch-backend/src/auth/auth.module.ts index 27a76634..0e6c48ec 100644 --- a/packages/hoppscotch-backend/src/auth/auth.module.ts +++ b/packages/hoppscotch-backend/src/auth/auth.module.ts @@ -34,6 +34,10 @@ import { InfraConfigModule } from 'src/infra-config/infra-config.module'; }) export class AuthModule { static async register() { + if (process.env.GENERATE_GQL_SCHEMA === 'true') { + return { module: AuthModule }; + } + const isInfraConfigPopulated = await isInfraConfigTablePopulated(); if (!isInfraConfigPopulated) { return { module: AuthModule }; diff --git a/packages/hoppscotch-backend/src/published-docs/published-docs.resolver.ts b/packages/hoppscotch-backend/src/published-docs/published-docs.resolver.ts index 1a120fb9..0f038bd6 100644 --- a/packages/hoppscotch-backend/src/published-docs/published-docs.resolver.ts +++ b/packages/hoppscotch-backend/src/published-docs/published-docs.resolver.ts @@ -119,8 +119,9 @@ export class PublishedDocsResolver { name: 'collectionID', type: () => ID, description: 'Id of the collection to add to', + nullable: true, }) - collectionID: string, + collectionID: string | undefined, @Args() args: OffsetPaginationArgs, ) { const docs = await this.publishedDocsService.getAllTeamPublishedDocs( diff --git a/packages/hoppscotch-backend/src/published-docs/published-docs.service.spec.ts b/packages/hoppscotch-backend/src/published-docs/published-docs.service.spec.ts index 6e4447a2..624517fb 100644 --- a/packages/hoppscotch-backend/src/published-docs/published-docs.service.spec.ts +++ b/packages/hoppscotch-backend/src/published-docs/published-docs.service.spec.ts @@ -23,7 +23,6 @@ import { import { TeamAccessRole } from 'src/team/team.model'; import { TreeLevel } from './published-docs.dto'; import { ConfigService } from '@nestjs/config'; -import { right } from 'fp-ts/lib/EitherT'; const mockPrisma = mockDeep(); const mockUserCollectionService = mockDeep(); diff --git a/packages/hoppscotch-backend/src/published-docs/published-docs.service.ts b/packages/hoppscotch-backend/src/published-docs/published-docs.service.ts index 0707832a..215e2fcc 100644 --- a/packages/hoppscotch-backend/src/published-docs/published-docs.service.ts +++ b/packages/hoppscotch-backend/src/published-docs/published-docs.service.ts @@ -23,7 +23,6 @@ import { OffsetPaginationArgs } from 'src/types/input-types.args'; import { stringToJson } from 'src/utils'; import { UserCollectionService } from 'src/user-collection/user-collection.service'; import { TeamCollectionService } from 'src/team-collection/team-collection.service'; -import { CollectionFolder } from 'src/types/CollectionFolder'; import { GetPublishedDocsQueryDto, TreeLevel } from './published-docs.dto'; import { ConfigService } from '@nestjs/config'; @@ -275,7 +274,7 @@ export class PublishedDocsService { */ async getAllTeamPublishedDocs( teamID: string, - collectionID: string, + collectionID: string | undefined, args: OffsetPaginationArgs, ) { const docs = await this.prisma.publishedDocs.findMany({ diff --git a/packages/hoppscotch-backend/src/user-collection/user-collection.resolver.ts b/packages/hoppscotch-backend/src/user-collection/user-collection.resolver.ts index c1da4a6d..504bef06 100644 --- a/packages/hoppscotch-backend/src/user-collection/user-collection.resolver.ts +++ b/packages/hoppscotch-backend/src/user-collection/user-collection.resolver.ts @@ -18,7 +18,6 @@ import { UserCollection, UserCollectionDuplicatedData, UserCollectionExportJSONData, - UserCollectionImportResult, UserCollectionRemovedData, UserCollectionReorderData, } from './user-collections.model'; diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.json index 929f59b5..a692d510 100644 --- a/packages/hoppscotch-common/locales/en.json +++ b/packages/hoppscotch-common/locales/en.json @@ -41,6 +41,7 @@ "more": "More", "new": "New", "no": "No", + "open": "Open", "open_workspace": "Open workspace", "paste": "Paste", "prettify": "Prettify", @@ -69,6 +70,7 @@ "turn_off": "Turn off", "turn_on": "Turn on", "undo": "Undo", + "unpublish": "Unpublish", "yes": "Yes", "verify": "Verify", "enable": "Enable", @@ -504,13 +506,15 @@ "auto_sync_description": "Automatically update published docs when collection changes", "button": "Publish", "copy_url": "Copy URL", - "delete_published_doc": "Are you sure you want to delete the published documentation?", + "delete": "Delete Documentation", + "unpublish_doc": "Are you sure you want to unpublish the documentation?", "delete_success": "Published documentation deleted successfully", "doc_title": "Title", "doc_version": "Version", "edit_published_doc": "Edit Published Doc", "last_updated": "Last Updated", "metadata": "Metadata (JSON)", + "open_published_doc": "Open Published Documentation in new tab", "publish_error": "Failed to publish documentation", "publish_success": "Documentation published successfully!", "published": "Published", @@ -520,6 +524,7 @@ "update_error": "Failed to update documentation", "update_published_docs": "Update Published Docs", "update_success": "Documentation updated successfully!", + "unpublish": "Unpublish", "update_title": "Update Published Documentation", "url_copied": "URL copied to clipboard!", "view_published": "View Published Docs", diff --git a/packages/hoppscotch-common/src/components/collections/Collection.vue b/packages/hoppscotch-common/src/components/collections/Collection.vue index 37bbf7b6..2a9af3ba 100644 --- a/packages/hoppscotch-common/src/components/collections/Collection.vue +++ b/packages/hoppscotch-common/src/components/collections/Collection.vue @@ -76,8 +76,18 @@ }" /> + + + + +
+ - + { return getMockServerStatus(collectionId || "") }) +// Published Doc Status +const documentationService = useService(DocumentationService) + +const publishedDocStatus = computed(() => { + const collectionId = + props.collectionsType === "my-collections" + ? ((props.data as HoppCollection).id ?? + (props.data as HoppCollection)._ref_id) + : (props.data as TeamCollection).id + + return documentationService.getPublishedDocStatus(collectionId || "") +}) + // Determine if this is a root collection (not a child folder) const isRootCollection = computed(() => { return props.folderType === "collection" diff --git a/packages/hoppscotch-common/src/components/collections/MyCollections.vue b/packages/hoppscotch-common/src/components/collections/MyCollections.vue index 264d70f3..09dd2424 100644 --- a/packages/hoppscotch-common/src/components/collections/MyCollections.vue +++ b/packages/hoppscotch-common/src/components/collections/MyCollections.vue @@ -875,18 +875,13 @@ const updateCollectionOrder = ( } const debouncedSorting = useDebounceFn(() => { - sortCollection() -}, 250) - -const sortCollection = () => { currentSortOrder.value = currentSortOrder.value === "asc" ? "desc" : "asc" - emit("sort-collections", { collectionID: null, sortOrder: currentSortOrder.value, collectionRefID: "personal", }) -} +}, 250) type MyCollectionNode = Collection | Folder | Requests diff --git a/packages/hoppscotch-common/src/components/collections/documentation/MarkdownEditor.vue b/packages/hoppscotch-common/src/components/collections/documentation/MarkdownEditor.vue index 28296add..b277fa43 100644 --- a/packages/hoppscotch-common/src/components/collections/documentation/MarkdownEditor.vue +++ b/packages/hoppscotch-common/src/components/collections/documentation/MarkdownEditor.vue @@ -1,11 +1,15 @@