From 5eb868e07d5c30e1fbb437288d5f262f81d8b02e Mon Sep 17 00:00:00 2001 From: Akshita Goyal <36129505+gakshita@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:24:07 +0530 Subject: [PATCH 1/2] [WEB 2418] Fix minor UI inconsistencies (#5568) * fix: project features modal padding * fix: minor ui inconsistencies * fix: lint issue --- web/core/components/cycles/list/root.tsx | 2 +- web/core/components/dropdowns/module/index.tsx | 12 ++++++++++-- .../components/issues/issue-detail/module-select.tsx | 1 + web/core/store/issue/issue.store.ts | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/web/core/components/cycles/list/root.tsx b/web/core/components/cycles/list/root.tsx index 880ed62c6f..17482c7d66 100644 --- a/web/core/components/cycles/list/root.tsx +++ b/web/core/components/cycles/list/root.tsx @@ -19,7 +19,7 @@ export const CyclesList: FC = observer((props) => { const { completedCycleIds, upcomingCycleIds, cycleIds, workspaceSlug, projectId, isArchived = false } = props; return ( - + {isArchived ? ( <> diff --git a/web/core/components/dropdowns/module/index.tsx b/web/core/components/dropdowns/module/index.tsx index c4cb660d21..f4a46a1e27 100644 --- a/web/core/components/dropdowns/module/index.tsx +++ b/web/core/components/dropdowns/module/index.tsx @@ -27,6 +27,7 @@ type Props = TDropdownProps & { showCount?: boolean; onClose?: () => void; renderByDefault?: boolean; + itemClassName?: string; } & ( | { multiple: false; @@ -51,6 +52,7 @@ type ButtonContentProps = { showCount: boolean; showTooltip?: boolean; value: string | string[] | null; + className?: string; }; const ButtonContent: React.FC = (props) => { @@ -65,6 +67,7 @@ const ButtonContent: React.FC = (props) => { showCount, showTooltip = false, value, + className, } = props; // store hooks const { getModuleById } = useModule(); @@ -87,13 +90,16 @@ const ButtonContent: React.FC = (props) => { )} ) : value.length > 0 ? ( -
+
{value.map((moduleId) => { const moduleDetails = getModuleById(moduleId); return (
{!hideIcon && } {!hideText && ( @@ -159,6 +165,7 @@ export const ModuleDropdown: React.FC = observer((props) => { const { button, buttonClassName, + itemClassName = "", buttonContainerClassName, buttonVariant, className = "", @@ -270,6 +277,7 @@ export const ModuleDropdown: React.FC = observer((props) => { showTooltip={showTooltip} value={value} onChange={onChange as any} + className={itemClassName} /> diff --git a/web/core/components/issues/issue-detail/module-select.tsx b/web/core/components/issues/issue-detail/module-select.tsx index 2856d09bd8..c51e884819 100644 --- a/web/core/components/issues/issue-detail/module-select.tsx +++ b/web/core/components/issues/issue-detail/module-select.tsx @@ -69,6 +69,7 @@ export const IssueModuleSelect: React.FC = observer((props) dropdownArrow dropdownArrowClassName="h-3.5 w-3.5 hidden group-hover:inline" multiple + itemClassName="px-2" />
); diff --git a/web/core/store/issue/issue.store.ts b/web/core/store/issue/issue.store.ts index f94188e641..ed4ecc4d57 100644 --- a/web/core/store/issue/issue.store.ts +++ b/web/core/store/issue/issue.store.ts @@ -1,6 +1,6 @@ -import update from "lodash/update"; import isEmpty from "lodash/isEmpty"; import set from "lodash/set"; +import update from "lodash/update"; import { action, makeObservable, observable, runInAction } from "mobx"; import { computedFn } from "mobx-utils"; // types From 069f8b950e862f7eb1cdbc47eeb90b7178e58fe1 Mon Sep 17 00:00:00 2001 From: "M. Palanikannan" <73993394+Palanikannan1437@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:27:27 +0530 Subject: [PATCH 2/2] fix: svg not supported in image uploads in the editor (#5558) * fix: svg not supported in image uploads * fix: svg image file error message fixed --- packages/editor/src/core/helpers/editor-commands.ts | 2 +- packages/editor/src/core/plugins/image/utils/validate-file.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/editor/src/core/helpers/editor-commands.ts b/packages/editor/src/core/helpers/editor-commands.ts index db3b4d66d0..7cf3e8d1f1 100644 --- a/packages/editor/src/core/helpers/editor-commands.ts +++ b/packages/editor/src/core/helpers/editor-commands.ts @@ -146,7 +146,7 @@ export const insertImageCommand = ( if (range) editor.chain().focus().deleteRange(range).run(); const input = document.createElement("input"); input.type = "file"; - input.accept = ".jpeg, .jpg, .png, .webp, .svg"; + input.accept = ".jpeg, .jpg, .png, .webp"; input.onchange = async () => { if (input.files?.length) { const file = input.files[0]; diff --git a/packages/editor/src/core/plugins/image/utils/validate-file.ts b/packages/editor/src/core/plugins/image/utils/validate-file.ts index a7952a0e11..b79ca6683e 100644 --- a/packages/editor/src/core/plugins/image/utils/validate-file.ts +++ b/packages/editor/src/core/plugins/image/utils/validate-file.ts @@ -4,9 +4,9 @@ export function isFileValid(file: File): boolean { return false; } - const allowedTypes = ["image/jpeg", "image/jpg", "image/png", "image/webp", "image/svg+xml"]; + const allowedTypes = ["image/jpeg", "image/jpg", "image/png", "image/webp"]; if (!allowedTypes.includes(file.type)) { - alert("Invalid file type. Please select a JPEG, JPG, PNG, WEBP, or SVG image file."); + alert("Invalid file type. Please select a JPEG, JPG, PNG, or WEBP image file."); return false; }