Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: zendesk search integration #2722

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

LeahMarieBush
Copy link
Contributor

@LeahMarieBush LeahMarieBush commented Mar 20, 2025

πŸ”— Relevant links

πŸ—’οΈ What

This PR adds a 'Support' tab to the dev-portal search modal. The content from this tab is sourced from the algolia indexes for zendesk (dev_ZENDESK and prod_ZENDESK depending on environment). It also adds a little external link icon to the end of the url for support items.

Since zendesk articles don't have descriptions like the docs or tutorials articles do, I used the algolia snippet component to get a section of where the search term originated in the body of the zendesk article.

πŸ“Έ Design Screenshots

Screenshot 2025-03-26 at 4 01 45β€―PM Screenshot 2025-03-26 at 4 02 07β€―PM

πŸ§ͺ Testing

  1. Go to preview link
  2. Open search modal by clicking search bar or command k
  3. Type in a search query
  4. Go to support tab and see the content from zendesk
  5. Click on an item and verify it opens in a new tab and goes to the right article

Copy link

vercel bot commented Mar 20, 2025

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
dev-portal βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Mar 27, 2025 9:07pm

Copy link

github-actions bot commented Mar 20, 2025

πŸ“¦ Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action πŸ€–

Ninety-three Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 134.62 KB (🟑 +1.18 KB) 329.6 KB
/404 118.5 KB (🟑 +1.18 KB) 313.48 KB
/500 118.5 KB (🟑 +1.18 KB) 313.48 KB
/[productSlug]/docs 175.62 KB (🟑 +1.18 KB) 370.6 KB
/[productSlug]/integrations 149.27 KB (🟑 +1.18 KB) 344.25 KB
/[productSlug]/integrations/[organizationSlug]/[integrationSlug] 172.52 KB (🟑 +1.18 KB) 367.5 KB
/[productSlug]/integrations/[organizationSlug]/[integrationSlug]/[integrationVersion] 172.52 KB (🟑 +1.18 KB) 367.5 KB
/[productSlug]/integrations/[organizationSlug]/[integrationSlug]/[integrationVersion]/components/[componentType]/[componentSlug] 178.44 KB (🟑 +1.18 KB) 373.42 KB
/[productSlug]/tutorials 148.41 KB (🟑 +1.18 KB) 343.38 KB
/[productSlug]/tutorials/[...tutorialSlug] 229.81 KB (🟑 +1.18 KB) 424.79 KB
/[productSlug]/tutorials/[collectionSlug] 194.38 KB (🟑 +1.18 KB) 389.36 KB
/_error 118.53 KB (🟑 +1.18 KB) 313.51 KB
/boundary 159.62 KB (🟑 +1.18 KB) 354.59 KB
/boundary/api-docs/[[...page]] 161.76 KB (🟑 +1.18 KB) 356.74 KB
/boundary/docs/[...page] 173.62 KB (🟑 +1.18 KB) 368.59 KB
/boundary/install 179.65 KB (🟑 +1.18 KB) 374.63 KB
/certifications 174.4 KB (🟑 +1.18 KB) 369.38 KB
/certifications/[slug] 175.05 KB (🟑 +1.18 KB) 370.03 KB
/consul 159.61 KB (🟑 +1.18 KB) 354.59 KB
/consul/api-docs/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/consul/commands/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.59 KB
/consul/docs/[...page] 173.61 KB (🟑 +1.18 KB) 368.59 KB
/consul/install 173.14 KB (🟑 +1.18 KB) 368.12 KB
/consul/install/enterprise 173.17 KB (🟑 +1.18 KB) 368.15 KB
/hcp 159.61 KB (🟑 +1.18 KB) 354.59 KB
/hcp/api-docs/consul/[[...page]] 158.92 KB (🟑 +1.18 KB) 353.9 KB
/hcp/api-docs/identity/[[...page]] 158.92 KB (🟑 +1.18 KB) 353.9 KB
/hcp/api-docs/packer/[[...page]] 158.92 KB (🟑 +1.18 KB) 353.89 KB
/hcp/api-docs/vagrant-box-registry/[[...page]] 158.93 KB (🟑 +1.18 KB) 353.91 KB
/hcp/api-docs/vault-secrets/[[...page]] 157.55 KB (🟑 +1.18 KB) 352.52 KB
/hcp/api-docs/waypoint/[[...page]] 158.92 KB (🟑 +1.18 KB) 353.9 KB
/hcp/api-docs/webhook/[[...page]] 158.92 KB (🟑 +1.18 KB) 353.9 KB
/hcp/docs/[...page] 173.61 KB (🟑 +1.18 KB) 368.59 KB
/nomad 159.61 KB (🟑 +1.18 KB) 354.59 KB
/nomad/api-docs/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/nomad/docs/[...page] 173.61 KB (🟑 +1.18 KB) 368.59 KB
/nomad/install 172.62 KB (🟑 +1.18 KB) 367.6 KB
/nomad/install/enterprise 172.6 KB (🟑 +1.18 KB) 367.58 KB
/nomad/intro/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.59 KB
/nomad/plugins/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/nomad/tools/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.59 KB
/open-api-docs-preview 163.03 KB (🟑 +1.18 KB) 358 KB
/open-api-docs-preview-v2/[[...page]] 162.04 KB (🟑 +1.18 KB) 357.02 KB
/packer 159.61 KB (🟑 +1.18 KB) 354.59 KB
/packer/docs/[...page] 173.61 KB (🟑 +1.18 KB) 368.59 KB
/packer/guides/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.59 KB
/packer/install 172.59 KB (🟑 +1.18 KB) 367.57 KB
/profile/account 138.63 KB (🟑 +1.18 KB) 333.6 KB
/profile/bookmarks 139.62 KB (🟑 +1.18 KB) 334.6 KB
/sentinel 159.61 KB (🟑 +1.18 KB) 354.59 KB
/sentinel/docs/[...page] 173.61 KB (🟑 +1.18 KB) 368.59 KB
/sentinel/install 172.6 KB (🟑 +1.18 KB) 367.57 KB
/terraform 159.62 KB (🟑 +1.18 KB) 354.59 KB
/terraform/cdktf/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/terraform/cli/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/terraform/cloud-docs/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/terraform/cloud-docs/agents/[[...page]] 173.63 KB (🟑 +1.18 KB) 368.61 KB
/terraform/docs/[...page] 173.62 KB (🟑 +1.18 KB) 368.59 KB
/terraform/enterprise/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/terraform/install 172.6 KB (🟑 +1.18 KB) 367.58 KB
/terraform/internals/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/terraform/intro/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/terraform/language/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/terraform/plugin/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/terraform/plugin/framework/[[...page]] 173.63 KB (🟑 +1.18 KB) 368.61 KB
/terraform/plugin/log/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/terraform/plugin/mux/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/terraform/plugin/sdkv2/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/terraform/plugin/testing/[[...page]] 173.63 KB (🟑 +1.18 KB) 368.6 KB
/terraform/registry/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/tutorials 129.97 KB (🟑 +1.18 KB) 324.95 KB
/tutorials/library 151.48 KB (🟑 +1.18 KB) 346.46 KB
/vagrant 159.61 KB (🟑 +1.18 KB) 354.59 KB
/vagrant/docs/[...page] 173.62 KB (🟑 +1.18 KB) 368.59 KB
/vagrant/install 173.1 KB (🟑 +1.18 KB) 368.08 KB
/vagrant/install/vmware 172.6 KB (🟑 +1.18 KB) 367.58 KB
/vagrant/intro/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/vagrant/vagrant-cloud/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/validated-designs 125.08 KB (🟑 +1.18 KB) 320.06 KB
/validated-designs/[...slug] 170.73 KB (🟑 +1.18 KB) 365.7 KB
/validated-patterns 151.79 KB (🟑 +1.18 KB) 346.77 KB
/validated-patterns/[...tutorialSlug] 193.77 KB (🟑 +1.18 KB) 388.75 KB
/validated-patterns/[collectionSlug] 139.95 KB (🟑 +1.18 KB) 334.93 KB
/vault 159.61 KB (🟑 +1.18 KB) 354.59 KB
/vault/api-docs/[[...page]] 173.62 KB (🟑 +1.18 KB) 368.6 KB
/vault/docs/[...page] 173.61 KB (🟑 +1.18 KB) 368.59 KB
/vault/install 172.59 KB (🟑 +1.18 KB) 367.57 KB
/vault/install/enterprise 172.6 KB (🟑 +1.18 KB) 367.58 KB
/waypoint 159.62 KB (🟑 +1.18 KB) 354.59 KB
/waypoint/docs/[...page] 173.61 KB (🟑 +1.18 KB) 368.59 KB
/well-architected-framework 151.8 KB (🟑 +1.18 KB) 346.78 KB
/well-architected-framework/[...tutorialSlug] 193.78 KB (🟑 +1.18 KB) 388.76 KB
/well-architected-framework/[collectionSlug] 139.96 KB (🟑 +1.18 KB) 334.94 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

@LeahMarieBush LeahMarieBush changed the title WIP: zendesk integration feat: zendesk search integration Mar 26, 2025
@LeahMarieBush LeahMarieBush marked this pull request as ready for review March 27, 2025 21:10
@LeahMarieBush LeahMarieBush requested review from a team, RubenSandwich and rmainwork and removed request for a team March 27, 2025 21:10
@LeahMarieBush
Copy link
Contributor Author

Adding do not merge label until support team is ready for launch

@@ -23,7 +23,7 @@ const PRODUCT_SLUGS_WITH_INTEGRATIONS =
* Each content type tab has a set of properties required for rendering.
*/
export interface UnifiedSearchTabContent {
type: 'global' | 'docs' | 'tutorials' | 'integrations'
type: 'global' | 'docs' | 'tutorials' | 'integrations' | 'knowledgebase'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type: 'global' | 'docs' | 'tutorials' | 'integrations' | 'knowledgebase'
type: UnifiedSearchableContentType

@@ -7,7 +7,10 @@ import { ReactNode, createContext, useContext, useState } from 'react'

const SearchHitsContext = createContext([])

type HitCounts = Record<'docs' | 'tutorials' | 'integrations', number>
type HitCounts = Record<
'docs' | 'tutorials' | 'integrations' | 'knowledgebase',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about using the existing UnifiedSearchableContentType to replace these unions (albeit with Exclude to yank 'global' out of there in this specific instance) instead?

Suggested change
'docs' | 'tutorials' | 'integrations' | 'knowledgebase',
Exclude<UnifiedSearchableContentType, 'global'>

@@ -36,6 +36,7 @@ export type UnifiedSearchableContentType =
| 'docs'
| 'integration'
| 'tutorial'
| 'knowledgebase'
Copy link
Contributor

@rmainwork rmainwork Mar 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about rewriting this union type as an enum (as the source of truth for the values) and then a template literal type to generate the union type.

export enum SearchContentTypes {
	GLOBAL = 'global',
	DOCS = 'docs',
	INTEGRATION = 'integration',
	TUTORIAL = 'tutorial',
	KNOWLEDGEBASE = 'knowledgebase',
}

/**
 * Derived union type from {@link SearchContentTypes}
 */
export type UnifiedSearchableContentType =`${SearchContentTypes}`

It should be functionally the same

image

However, it would also provide some advantages

  1. It would give us the advantages of using an enum (such as the ability to refer canonically to those values elsewhere in the code like here) so we could use SearchContentTypes.GLOBAL instead of just the string 'global'. This seems trivial, but during the discovery phase of this ticket, I noticed there are a few typos in the existing code (we have 'global' | 'docs' | 'tutorials' | 'integrations' here, here and here......and then hit.type !== 'integration' here)

  2. It would also allow us to provide documentation for the enum values (if we wanted) like this:

    export enum SearchContentTypes {
        GLOBAL = 'global',
        DOCS = 'docs',
        INTEGRATION = 'integration',
        TUTORIAL = 'tutorial',
        /**
         * Data from zendesk
         */
        KNOWLEDGEBASE = 'knowledgebase'
    }

    image

What do you think?

@@ -16,7 +16,7 @@ import type { UnifiedHitProps } from '../types'
*/
export function getUnifiedHitProps(hit: Hit): UnifiedHitProps {
// Content type, for icon
const type = hit.type as 'docs' | 'tutorial' | 'integration'
const type = hit.type as 'docs' | 'tutorial' | 'integration' | 'knowledgebase'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const type = hit.type as 'docs' | 'tutorial' | 'integration' | 'knowledgebase'
const type = hit.type as Exclude<SearchContentTypes, 'global'>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants