Skip to content

Commit

Permalink
[OPIK-296] [FE] All links to documentation should point to production…
Browse files Browse the repository at this point in the history
… documentation
  • Loading branch information
andriidudar committed Oct 23, 2024
1 parent aec99d0 commit be170e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions apps/opik-frontend/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ import isObject from "lodash/isObject";
import isUndefined from "lodash/isUndefined";
import { twMerge } from "tailwind-merge";

const BASE_COMET_URL = import.meta.env.VITE_BASE_COMET_URL;
const BASE_DOCUMENTATION_URL = "https://comet.com/docs/opik";

export const buildDocsUrl = (path: string = "", hash: string = "") => {
const url = BASE_COMET_URL
? `${BASE_COMET_URL}docs/opik`
: "https://comet.com/docs/opik";

return `${url}${path}?from=llm${hash}`;
return `${BASE_DOCUMENTATION_URL}${path}?from=llm${hash}`;
};

export function cn(...inputs: ClassValue[]) {
Expand Down
4 changes: 2 additions & 2 deletions apps/opik-frontend/src/plugins/comet/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
} from "@/components/ui/dropdown-menu";
import TooltipWrapper from "@/components/shared/TooltipWrapper/TooltipWrapper";
import { useToast } from "@/components/ui/use-toast";
import { cn } from "@/lib/utils";
import { buildDocsUrl, cn } from "@/lib/utils";
import useAppStore from "@/store/AppStore";
import api from "./api";
import { Organization, ORGANIZATION_ROLE_TYPE } from "./types";
Expand Down Expand Up @@ -281,7 +281,7 @@ const UserMenu = () => {
<span>Quickstart guide</span>
</DropdownMenuItem>
</Link>
<a href={buildUrl("docs/opik/")} target="_blank" rel="noreferrer">
<a href={buildDocsUrl()} target="_blank" rel="noreferrer">
<DropdownMenuItem className="cursor-pointer">
<Book className="mr-2 size-4" />
<span>Docs</span>
Expand Down

0 comments on commit be170e1

Please sign in to comment.