docs: change report issue link (#10160)
This commit is contained in:
@@ -10,7 +10,6 @@ import MDXContentClient from "@/components/MDXContent/Client"
|
||||
import { useArea } from "../../../../providers/area"
|
||||
import { Feedback, Badge, Link, FeatureFlagNotice } from "docs-ui"
|
||||
import { usePathname } from "next/navigation"
|
||||
import formatReportLink from "../../../../utils/format-report-link"
|
||||
import { TagsOperationDescriptionSectionWorkflowBadgeProps } from "./WorkflowBadge"
|
||||
|
||||
const TagsOperationDescriptionSectionSecurity =
|
||||
@@ -82,7 +81,6 @@ const TagsOperationDescriptionSection = ({
|
||||
section: operation.summary,
|
||||
}}
|
||||
pathName={pathname}
|
||||
reportLink={formatReportLink(area, operation.summary)}
|
||||
className="!my-2"
|
||||
vertical={true}
|
||||
question="Did this API Route run successfully?"
|
||||
|
||||
@@ -21,7 +21,6 @@ import SectionDivider from "../../Section/Divider"
|
||||
import clsx from "clsx"
|
||||
import { Feedback, Loading, Link } from "docs-ui"
|
||||
import { usePathname, useRouter } from "next/navigation"
|
||||
import formatReportLink from "@/utils/format-report-link"
|
||||
import { PathsObject, SchemaObject, TagObject } from "@/types/openapi"
|
||||
import { TagSectionSchemaProps } from "./Schema"
|
||||
import checkElementInViewport from "../../../utils/check-element-in-viewport"
|
||||
@@ -165,7 +164,6 @@ const TagSectionComponent = ({ tag }: TagSectionProps) => {
|
||||
section: tag.name,
|
||||
}}
|
||||
pathName={pathname}
|
||||
reportLink={formatReportLink(area, tag.name)}
|
||||
vertical
|
||||
question="Was this section helpful?"
|
||||
/>
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
DividedMarkdownCode
|
||||
} from "@/layouts/DividedMarkdown/Sections"
|
||||
import Section from "@/components/Section"
|
||||
import formatReportLink from "@/utils/format-report-link"
|
||||
|
||||
import ClientLibraries from "./client-libraries.mdx"
|
||||
|
||||
@@ -28,7 +27,6 @@ All API Routes are prefixed with `/admin`. So, during development, the API Route
|
||||
area: "admin",
|
||||
section: "introduction"
|
||||
}}
|
||||
reportLink={formatReportLink("admin", "Introduction")}
|
||||
pathName="/api/admin"
|
||||
question="Was this section helpful?"
|
||||
vertical={true}
|
||||
@@ -305,7 +303,6 @@ fetch(`<BACKEND_URL>/admin/products`, {
|
||||
area: "admin",
|
||||
section: "authentication-cookie"
|
||||
}}
|
||||
reportLink={formatReportLink("admin", "Authentication - Cookie Session ID")}
|
||||
pathName="/api/admin"
|
||||
question="Was this section helpful?"
|
||||
vertical={true}
|
||||
@@ -355,7 +352,6 @@ x-no-compression: true
|
||||
area: "admin",
|
||||
section: "http-compression"
|
||||
}}
|
||||
reportLink={formatReportLink("admin", "Authentication - Cookie Session ID")}
|
||||
pathName="/api/admin"
|
||||
question="Was this section helpful?"
|
||||
vertical={true}
|
||||
@@ -687,7 +683,6 @@ curl -g "http://localhost:9000/admin/products?created_at[$lt]=2023-02-17&created
|
||||
area: "admin",
|
||||
section: "query-parameters"
|
||||
}}
|
||||
reportLink={formatReportLink("admin", "Query Parameter Types")}
|
||||
pathName="/api/admin"
|
||||
question="Was this section helpful?"
|
||||
vertical={true}
|
||||
@@ -814,7 +809,6 @@ This sorts the products by their `created_at` field in the descending order.
|
||||
area: "admin",
|
||||
section: "pagination"
|
||||
}}
|
||||
reportLink={formatReportLink("admin", "Pagination")}
|
||||
pathName="/api/admin"
|
||||
question="Was this section helpful?"
|
||||
vertical={true}
|
||||
@@ -846,7 +840,6 @@ Refer to [this guide](https://docs.medusajs.com/customization/extend-models/exte
|
||||
area: "admin",
|
||||
section: "workflows"
|
||||
}}
|
||||
reportLink={formatReportLink("admin", "Workflows")}
|
||||
pathName="/api/admin"
|
||||
question="Was this section helpful?"
|
||||
vertical={true}
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
} from "@/layouts/DividedMarkdown/Sections"
|
||||
import Section from "@/components/Section"
|
||||
import { Feedback, CodeTabs, CodeTab } from "docs-ui"
|
||||
import formatReportLink from "@/utils/format-report-link"
|
||||
|
||||
import ClientLibraries from "./client-libraries.mdx"
|
||||
|
||||
@@ -28,7 +27,6 @@ All API Routes are prefixed with `/store`. So, during development, the API Route
|
||||
area: "store",
|
||||
section: "introduction"
|
||||
}}
|
||||
reportLink={formatReportLink("store", "Introduction")}
|
||||
pathName="/api/store"
|
||||
question="Was this section helpful?"
|
||||
vertical={true}
|
||||
@@ -242,7 +240,6 @@ fetch(`<BACKEND_URL>/store/products`, {
|
||||
area: "store",
|
||||
section: "authentication-cookie"
|
||||
}}
|
||||
reportLink={formatReportLink("store", "Authentication - Cookie Session ID")}
|
||||
pathName="/api/store"
|
||||
question="Was this section helpful?"
|
||||
vertical={true}
|
||||
@@ -307,7 +304,6 @@ Where `{your_publishable_api_key}` is the token of the publishable API key.
|
||||
area: "store",
|
||||
section: "publishable-api-key"
|
||||
}}
|
||||
reportLink={formatReportLink("store", "Publishable API Key")}
|
||||
pathName="/api/store"
|
||||
question="Was this section helpful?"
|
||||
vertical={true}
|
||||
@@ -357,7 +353,6 @@ x-no-compression: true
|
||||
area: "store",
|
||||
section: "http-compression"
|
||||
}}
|
||||
reportLink={formatReportLink("store", "HTTP Compression")}
|
||||
pathName="/api/store"
|
||||
question="Was this section helpful?"
|
||||
vertical={true}
|
||||
@@ -481,7 +476,6 @@ This returns the variants of each product, but the variants only have their `id`
|
||||
area: "store",
|
||||
section: "select-fields"
|
||||
}}
|
||||
reportLink={formatReportLink("store", "Selecting Fields")}
|
||||
pathName="/api/store"
|
||||
question="Was this section helpful?"
|
||||
vertical={true}
|
||||
@@ -694,7 +688,6 @@ curl -g "http://localhost:9000/store/products?created_at[$lt]=2023-02-17&created
|
||||
area: "store",
|
||||
section: "query-parameters"
|
||||
}}
|
||||
reportLink={formatReportLink("store", "Query Parameter Types")}
|
||||
pathName="/api/store"
|
||||
question="Was this section helpful?"
|
||||
vertical={true}
|
||||
@@ -819,7 +812,6 @@ This sorts the products by their `created_at` field in the descending order.
|
||||
area: "store",
|
||||
section: "pagination"
|
||||
}}
|
||||
reportLink={formatReportLink("store", "Pagination")}
|
||||
pathName="/api/store"
|
||||
question="Was this section helpful?"
|
||||
vertical={true}
|
||||
@@ -847,7 +839,6 @@ Refer to [this guide](https://docs.medusajs.com/customization/extend-models/exte
|
||||
area: "admin",
|
||||
section: "workflows"
|
||||
}}
|
||||
reportLink={formatReportLink("admin", "Workflows")}
|
||||
pathName="/api/admin"
|
||||
question="Was this section helpful?"
|
||||
vertical={true}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
"use client"
|
||||
|
||||
import {
|
||||
formatReportLink,
|
||||
getNavDropdownItems,
|
||||
MainNavProvider as UiMainNavProvider,
|
||||
useIsBrowser,
|
||||
} from "docs-ui"
|
||||
import { useMemo } from "react"
|
||||
import { config } from "../config"
|
||||
@@ -14,7 +12,6 @@ type MainNavProviderProps = {
|
||||
}
|
||||
|
||||
export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
const { isBrowser } = useIsBrowser()
|
||||
const navigationDropdownItems = useMemo(
|
||||
() =>
|
||||
getNavDropdownItems({
|
||||
@@ -23,20 +20,8 @@ export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
[]
|
||||
)
|
||||
|
||||
const reportLink = useMemo(
|
||||
() =>
|
||||
formatReportLink(
|
||||
config.titleSuffix || "",
|
||||
isBrowser ? document.title : ""
|
||||
),
|
||||
[isBrowser]
|
||||
)
|
||||
|
||||
return (
|
||||
<UiMainNavProvider
|
||||
navItems={navigationDropdownItems}
|
||||
reportIssueLink={reportLink}
|
||||
>
|
||||
<UiMainNavProvider navItems={navigationDropdownItems}>
|
||||
{children}
|
||||
</UiMainNavProvider>
|
||||
)
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import { formatReportLink as uiFormatReportLink } from "docs-ui"
|
||||
|
||||
export default function formatReportLink(area = "admin", sectionTitle: string) {
|
||||
return uiFormatReportLink(`API Ref(${area})`, sectionTitle)
|
||||
}
|
||||
@@ -3,11 +3,8 @@
|
||||
import {
|
||||
Feedback as UiFeedback,
|
||||
FeedbackProps as UiFeedbackProps,
|
||||
formatReportLink,
|
||||
useIsBrowser,
|
||||
} from "docs-ui"
|
||||
import { usePathname } from "next/navigation"
|
||||
import { config } from "../../config"
|
||||
import { basePathUrl } from "../../utils/base-path-url"
|
||||
import { useMemo } from "react"
|
||||
|
||||
@@ -15,23 +12,13 @@ type FeedbackProps = Omit<UiFeedbackProps, "event" | "pathName">
|
||||
|
||||
const Feedback = (props: FeedbackProps) => {
|
||||
const pathname = usePathname()
|
||||
const { isBrowser } = useIsBrowser()
|
||||
|
||||
const feedbackPathname = useMemo(() => basePathUrl(pathname), [pathname])
|
||||
const reportLink = useMemo(
|
||||
() =>
|
||||
formatReportLink(
|
||||
config.titleSuffix || "",
|
||||
isBrowser ? document.title : ""
|
||||
),
|
||||
[isBrowser]
|
||||
)
|
||||
|
||||
return (
|
||||
<UiFeedback
|
||||
event="survey"
|
||||
pathName={feedbackPathname}
|
||||
reportLink={reportLink}
|
||||
question={props.question || "Was this chapter helpful?"}
|
||||
{...props}
|
||||
/>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
"use client"
|
||||
|
||||
import {
|
||||
formatReportLink,
|
||||
getNavDropdownItems,
|
||||
MainNavProvider as UiMainNavProvider,
|
||||
useIsBrowser,
|
||||
} from "docs-ui"
|
||||
import { useMemo } from "react"
|
||||
import { config } from "../config"
|
||||
@@ -16,7 +14,6 @@ type MainNavProviderProps = {
|
||||
}
|
||||
|
||||
export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
const { isBrowser } = useIsBrowser()
|
||||
const pathname = usePathname()
|
||||
const navigationDropdownItems = useMemo(
|
||||
() =>
|
||||
@@ -26,15 +23,6 @@ export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
[]
|
||||
)
|
||||
|
||||
const reportLink = useMemo(
|
||||
() =>
|
||||
formatReportLink(
|
||||
config.titleSuffix || "",
|
||||
isBrowser ? document.title : ""
|
||||
),
|
||||
[isBrowser]
|
||||
)
|
||||
|
||||
const editDate = useMemo(
|
||||
() =>
|
||||
(generatedEditDates as Record<string, string>)[
|
||||
@@ -44,11 +32,7 @@ export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
)
|
||||
|
||||
return (
|
||||
<UiMainNavProvider
|
||||
navItems={navigationDropdownItems}
|
||||
reportIssueLink={reportLink}
|
||||
editDate={editDate}
|
||||
>
|
||||
<UiMainNavProvider navItems={navigationDropdownItems} editDate={editDate}>
|
||||
{children}
|
||||
</UiMainNavProvider>
|
||||
)
|
||||
|
||||
@@ -3,11 +3,8 @@
|
||||
import {
|
||||
Feedback as UiFeedback,
|
||||
FeedbackProps as UiFeedbackProps,
|
||||
formatReportLink,
|
||||
useIsBrowser,
|
||||
} from "docs-ui"
|
||||
import { usePathname } from "next/navigation"
|
||||
import { config } from "../../config"
|
||||
import { useMemo } from "react"
|
||||
import { basePathUrl } from "../../utils/base-path-url"
|
||||
|
||||
@@ -15,23 +12,13 @@ type FeedbackProps = Omit<UiFeedbackProps, "event" | "pathName">
|
||||
|
||||
export const Feedback = (props: FeedbackProps) => {
|
||||
const pathname = usePathname()
|
||||
const { isBrowser } = useIsBrowser()
|
||||
|
||||
const feedbackPathname = useMemo(() => basePathUrl(pathname), [pathname])
|
||||
const reportLink = useMemo(
|
||||
() =>
|
||||
formatReportLink(
|
||||
config.titleSuffix || "",
|
||||
isBrowser ? document.title : ""
|
||||
),
|
||||
[isBrowser]
|
||||
)
|
||||
|
||||
return (
|
||||
<UiFeedback
|
||||
event="survey"
|
||||
pathName={feedbackPathname}
|
||||
reportLink={reportLink}
|
||||
question="Was this page helpful?"
|
||||
{...props}
|
||||
/>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
"use client"
|
||||
|
||||
import {
|
||||
formatReportLink,
|
||||
getNavDropdownItems,
|
||||
MainNavProvider as UiMainNavProvider,
|
||||
useIsBrowser,
|
||||
} from "docs-ui"
|
||||
import { useMemo } from "react"
|
||||
import { config } from "../config"
|
||||
@@ -16,7 +14,6 @@ type MainNavProviderProps = {
|
||||
}
|
||||
|
||||
export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
const { isBrowser } = useIsBrowser()
|
||||
const pathname = usePathname()
|
||||
const navigationDropdownItems = useMemo(
|
||||
() =>
|
||||
@@ -26,15 +23,6 @@ export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
[]
|
||||
)
|
||||
|
||||
const reportLink = useMemo(
|
||||
() =>
|
||||
formatReportLink(
|
||||
config.titleSuffix || "",
|
||||
isBrowser ? document.title : ""
|
||||
),
|
||||
[isBrowser]
|
||||
)
|
||||
|
||||
const editDate = useMemo(
|
||||
() =>
|
||||
(generatedEditDates as Record<string, string>)[
|
||||
@@ -44,11 +32,7 @@ export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
)
|
||||
|
||||
return (
|
||||
<UiMainNavProvider
|
||||
navItems={navigationDropdownItems}
|
||||
reportIssueLink={reportLink}
|
||||
editDate={editDate}
|
||||
>
|
||||
<UiMainNavProvider navItems={navigationDropdownItems} editDate={editDate}>
|
||||
{children}
|
||||
</UiMainNavProvider>
|
||||
)
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import {
|
||||
Feedback as UiFeedback,
|
||||
FeedbackProps as UiFeedbackProps,
|
||||
formatReportLink,
|
||||
} from "docs-ui"
|
||||
import { usePathname } from "next/navigation"
|
||||
import { absoluteUrl } from "@/lib/absolute-url"
|
||||
@@ -20,7 +19,6 @@ export const Feedback = ({ title, ...props }: FeedbackProps) => {
|
||||
<UiFeedback
|
||||
event="survey"
|
||||
pathName={absoluteUrl(pathname)}
|
||||
reportLink={formatReportLink("UI Docs", title, "ui")}
|
||||
extraData={{
|
||||
section: title,
|
||||
}}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
"use client"
|
||||
|
||||
import {
|
||||
formatReportLink,
|
||||
getNavDropdownItems,
|
||||
MainNavProvider as UiMainNavProvider,
|
||||
useIsBrowser,
|
||||
} from "docs-ui"
|
||||
import { useMemo } from "react"
|
||||
import { siteConfig } from "../config/site"
|
||||
@@ -14,7 +12,6 @@ type MainNavProviderProps = {
|
||||
}
|
||||
|
||||
export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
const { isBrowser } = useIsBrowser()
|
||||
const navigationDropdownItems = useMemo(
|
||||
() =>
|
||||
getNavDropdownItems({
|
||||
@@ -23,16 +20,8 @@ export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
[]
|
||||
)
|
||||
|
||||
const reportLink = useMemo(
|
||||
() => formatReportLink("UI Docs", isBrowser ? document.title : "", "ui"),
|
||||
[isBrowser]
|
||||
)
|
||||
|
||||
return (
|
||||
<UiMainNavProvider
|
||||
navItems={navigationDropdownItems}
|
||||
reportIssueLink={reportLink}
|
||||
>
|
||||
<UiMainNavProvider navItems={navigationDropdownItems}>
|
||||
{children}
|
||||
</UiMainNavProvider>
|
||||
)
|
||||
|
||||
@@ -3,11 +3,8 @@
|
||||
import {
|
||||
Feedback as UiFeedback,
|
||||
FeedbackProps as UiFeedbackProps,
|
||||
formatReportLink,
|
||||
useIsBrowser,
|
||||
} from "docs-ui"
|
||||
import { usePathname } from "next/navigation"
|
||||
import { config } from "../../config"
|
||||
import { basePathUrl } from "../../utils/base-path-url"
|
||||
import { useMemo } from "react"
|
||||
|
||||
@@ -15,23 +12,13 @@ type FeedbackProps = Omit<UiFeedbackProps, "event" | "pathName">
|
||||
|
||||
const Feedback = (props: FeedbackProps) => {
|
||||
const pathname = usePathname()
|
||||
const { isBrowser } = useIsBrowser()
|
||||
|
||||
const feedbackPathname = useMemo(() => basePathUrl(pathname), [pathname])
|
||||
const reportLink = useMemo(
|
||||
() =>
|
||||
formatReportLink(
|
||||
config.titleSuffix || "",
|
||||
isBrowser ? document.title : ""
|
||||
),
|
||||
[isBrowser]
|
||||
)
|
||||
|
||||
return (
|
||||
<UiFeedback
|
||||
event="survey"
|
||||
pathName={feedbackPathname}
|
||||
reportLink={reportLink}
|
||||
question="Was this chapter helpful?"
|
||||
{...props}
|
||||
/>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
"use client"
|
||||
|
||||
import {
|
||||
formatReportLink,
|
||||
getNavDropdownItems,
|
||||
MainNavProvider as UiMainNavProvider,
|
||||
useIsBrowser,
|
||||
} from "docs-ui"
|
||||
import { useMemo } from "react"
|
||||
import { config } from "../config"
|
||||
@@ -14,7 +12,6 @@ type MainNavProviderProps = {
|
||||
}
|
||||
|
||||
export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
const { isBrowser } = useIsBrowser()
|
||||
const navigationDropdownItems = useMemo(
|
||||
() =>
|
||||
getNavDropdownItems({
|
||||
@@ -23,20 +20,8 @@ export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
[]
|
||||
)
|
||||
|
||||
const reportLink = useMemo(
|
||||
() =>
|
||||
formatReportLink(
|
||||
config.titleSuffix || "",
|
||||
isBrowser ? document.title : ""
|
||||
),
|
||||
[isBrowser]
|
||||
)
|
||||
|
||||
return (
|
||||
<UiMainNavProvider
|
||||
navItems={navigationDropdownItems}
|
||||
reportIssueLink={reportLink}
|
||||
>
|
||||
<UiMainNavProvider navItems={navigationDropdownItems}>
|
||||
{children}
|
||||
</UiMainNavProvider>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user