Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/types/src/instance/base.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export interface IInstanceConfig {
// intercom
is_intercom_enabled: boolean;
intercom_app_id: string | undefined;
instance_changelog_url?: string;
}

export interface IInstanceAdmin {
Expand Down
8 changes: 4 additions & 4 deletions web/core/components/common/logo.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"use client";

import { FC } from "react";
// emoji-picker-react
import { Emoji } from "emoji-picker-react";
import useFontFaceObserver from "use-font-face-observer";
// types
import { TLogoProps } from "@plane/types";
// helpers
// ui
import { LUCIDE_ICONS_LIST } from "@plane/ui";
// helpers
import { emojiCodeToUnicode } from "@/helpers/emoji.helper";
// import { icons } from "lucide-react";
import useFontFaceObserver from "use-font-face-observer";

type Props = {
logo: TLogoProps;
Expand Down
55 changes: 9 additions & 46 deletions web/core/components/global/product-updates/modal.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import { FC, useRef } from "react";
import { FC } from "react";
import { observer } from "mobx-react-lite";
import useSWR from "swr";
// editor
import { DocumentReadOnlyEditorWithRef, EditorRefApi } from "@plane/editor";
// ui
import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
// helpers
import { LogoSpinner } from "@/components/common";
// components
import { ProductUpdatesFooter } from "@/components/global";
// hooks
import { useInstance } from "@/hooks/store";
// plane web components
import { ProductUpdatesHeader } from "@/plane-web/components/global";
// services
import { InstanceService } from "@/services/instance.service";

const instanceService = new InstanceService();

export type ProductUpdatesModalProps = {
isOpen: boolean;
Expand All @@ -22,20 +16,16 @@ export type ProductUpdatesModalProps = {

export const ProductUpdatesModal: FC<ProductUpdatesModalProps> = observer((props) => {
const { isOpen, handleClose } = props;
// refs
const editorRef = useRef<EditorRefApi>(null);
// swr
const { data, isLoading, error } = useSWR(`INSTANCE_CHANGELOG`, () => instanceService.getInstanceChangeLog(), {
shouldRetryOnError: false,
revalidateIfStale: false,
revalidateOnFocus: false,
});

const { config } = useInstance();

return (
<ModalCore isOpen={isOpen} handleClose={handleClose} position={EModalPosition.CENTER} width={EModalWidth.XXL}>
<ProductUpdatesHeader />
<div className="flex flex-col h-[60vh] vertical-scrollbar scrollbar-xs overflow-hidden overflow-y-scroll px-6 mx-0.5">
{!isLoading && !!error ? (
{config?.instance_changelog_url && config?.instance_changelog_url !== "" ? (
<iframe src={config?.instance_changelog_url} className="w-full h-full" />
) : (
<div className="flex flex-col items-center justify-center w-full h-full mb-8">
<div className="text-lg font-medium">We are having trouble fetching the updates.</div>
<div className="text-sm text-custom-text-200">
Expand All @@ -50,33 +40,6 @@ export const ProductUpdatesModal: FC<ProductUpdatesModalProps> = observer((props
for the latest updates.
</div>
</div>
) : isLoading ? (
<div className="flex items-center justify-center w-full h-full">
<LogoSpinner />
</div>
) : (
<div className="ml-5">
{data?.id && (
<DocumentReadOnlyEditorWithRef
ref={editorRef}
disabledExtensions={[]}
id={data.id}
initialValue={data.description_html ?? "<p></p>"}
containerClassName="p-0 border-none"
mentionHandler={{
highlights: () => Promise.resolve([]),
}}
embedHandler={{
issue: {
widgetCallback: () => <></>,
},
}}
fileHandler={{
getAssetSrc: () => Promise.resolve(""),
}}
/>
)}
</div>
)}
</div>
<ProductUpdatesFooter />
Expand Down
16 changes: 7 additions & 9 deletions web/core/components/workspace/sidebar/help-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const SidebarHelpSection: React.FC<WorkspaceHelpSectionProps> = observer(
const { canUseLocalDB, toggleLocalDB } = useUserSettings();
// states
const [isNeedHelpOpen, setIsNeedHelpOpen] = useState(false);
const [isChangeLogOpen, setIsChangeLogOpen] = useState(false);
const [isProductUpdatesModalOpen, setProductUpdatesModalOpen] = useState(false);

const handleCrispWindowShow = () => {
toggleIntercom(!isIntercomToggle);
Expand All @@ -42,7 +42,7 @@ export const SidebarHelpSection: React.FC<WorkspaceHelpSectionProps> = observer(

return (
<>
<ProductUpdatesModal isOpen={isChangeLogOpen} handleClose={() => setIsChangeLogOpen(false)} />
<ProductUpdatesModal isOpen={isProductUpdatesModalOpen} handleClose={() => setProductUpdatesModalOpen(false)} />
<div
className={cn(
"flex w-full items-center justify-between px-2 self-baseline border-t border-custom-border-200 bg-custom-sidebar-background-100 h-12 flex-shrink-0",
Expand All @@ -56,8 +56,7 @@ export const SidebarHelpSection: React.FC<WorkspaceHelpSectionProps> = observer(
>
<CustomMenu
customButton={
<button
type="button"
<div
className={cn(
"grid place-items-center rounded-md p-1 outline-none text-custom-text-200 hover:text-custom-text-100 hover:bg-custom-background-90",
{
Expand All @@ -68,7 +67,7 @@ export const SidebarHelpSection: React.FC<WorkspaceHelpSectionProps> = observer(
<Tooltip tooltipContent="Help" isMobile={isMobile} disabled={isNeedHelpOpen}>
<HelpCircle className="h-[18px] w-[18px] outline-none" />
</Tooltip>
</button>
</div>
}
customButtonClassName={`relative grid place-items-center rounded-md p-1.5 outline-none ${isCollapsed ? "w-full" : ""}`}
menuButtonOnClick={() => !isNeedHelpOpen && setIsNeedHelpOpen(true)}
Expand Down Expand Up @@ -135,14 +134,13 @@ export const SidebarHelpSection: React.FC<WorkspaceHelpSectionProps> = observer(
</button>
</CustomMenu.MenuItem>
<CustomMenu.MenuItem>
<a
target="_blank"
<button
type="button"
href="https://plane.so/changelog/community"
onClick={() => setProductUpdatesModalOpen(true)}
className="flex w-full items-center justify-start text-xs hover:bg-custom-background-80"
>
<span className="text-xs">What&apos;s new</span>
</a>
</button>
</CustomMenu.MenuItem>
<CustomMenu.MenuItem>
<a
Expand Down