fix: ui fixes (#392)

* fix: ui fixes

* chore: kanban issue title length
This commit is contained in:
Aaryan Khandelwal 2023-03-07 20:27:16 +05:30 committed by GitHub
parent cadb67a018
commit 88fca3c67c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 13 deletions

View File

@ -40,7 +40,7 @@ export const AllBoards: React.FC<Props> = ({
<> <>
{groupedByIssues ? ( {groupedByIssues ? (
<div className="h-[calc(100vh-157px)] w-full lg:h-[calc(100vh-115px)]"> <div className="h-[calc(100vh-157px)] w-full lg:h-[calc(100vh-115px)]">
<div className="flex h-full gap-x-9 overflow-x-auto horizontal-scroll-enable overflow-y-hidden"> <div className="horizontal-scroll-enable flex h-full gap-x-4 overflow-x-auto overflow-y-hidden">
{Object.keys(groupedByIssues).map((singleGroup, index) => { {Object.keys(groupedByIssues).map((singleGroup, index) => {
const currentState = const currentState =
selectedGroup === "state_detail.name" selectedGroup === "state_detail.name"

View File

@ -104,7 +104,7 @@ export const SingleBoard: React.FC<Props> = ({
<div <div
className={`absolute ${ className={`absolute ${
snapshot.isDraggingOver ? "block" : "hidden" snapshot.isDraggingOver ? "block" : "hidden"
} pointer-events-none top-0 left-0 z-[99999998] h-full w-full bg-indigo-200 opacity-50`} } pointer-events-none top-0 left-0 z-[99999998] h-full w-full bg-gray-100 opacity-50`}
/> />
<div <div
className={`absolute ${ className={`absolute ${

View File

@ -24,7 +24,7 @@ import {
ViewStateSelect, ViewStateSelect,
} from "components/issues/view-select"; } from "components/issues/view-select";
// ui // ui
import { ContextMenu, CustomMenu } from "components/ui"; import { ContextMenu, CustomMenu, Tooltip } from "components/ui";
// icons // icons
import { import {
ClipboardDocumentCheckIcon, ClipboardDocumentCheckIcon,
@ -33,7 +33,7 @@ import {
TrashIcon, TrashIcon,
} from "@heroicons/react/24/outline"; } from "@heroicons/react/24/outline";
// helpers // helpers
import { copyTextToClipboard } from "helpers/string.helper"; import { copyTextToClipboard, truncateText } from "helpers/string.helper";
// types // types
import { import {
CycleIssueResponse, CycleIssueResponse,
@ -265,12 +265,12 @@ export const SingleBoardIssue: React.FC<Props> = ({
className="text-sm group-hover:text-theme" className="text-sm group-hover:text-theme"
style={{ lineClamp: 3, WebkitLineClamp: 3 }} style={{ lineClamp: 3, WebkitLineClamp: 3 }}
> >
{issue.name} {truncateText(issue.name, 100)}
</h5> </h5>
</a> </a>
</Link> </Link>
<div className="relative mt-2.5 flex flex-wrap items-center gap-2 text-xs"> <div className="relative mt-2.5 flex flex-wrap items-center gap-2 text-xs">
{properties.priority && selectedGroup !== "priority" && ( {properties.priority && (
<ViewPrioritySelect <ViewPrioritySelect
issue={issue} issue={issue}
partialUpdateIssue={partialUpdateIssue} partialUpdateIssue={partialUpdateIssue}
@ -278,7 +278,7 @@ export const SingleBoardIssue: React.FC<Props> = ({
selfPositioned selfPositioned
/> />
)} )}
{properties.state && selectedGroup !== "state_detail.name" && ( {properties.state && (
<ViewStateSelect <ViewStateSelect
issue={issue} issue={issue}
partialUpdateIssue={partialUpdateIssue} partialUpdateIssue={partialUpdateIssue}

View File

@ -10,7 +10,7 @@ import projectService from "services/project.service";
// ui // ui
import { Avatar, CustomSearchSelect } from "components/ui"; import { Avatar, CustomSearchSelect } from "components/ui";
// icons // icons
import { UserCircleIcon, UserIcon } from "@heroicons/react/24/outline"; import { UserCircleIcon } from "@heroicons/react/24/outline";
import User from "public/user.png"; import User from "public/user.png";
// fetch-keys // fetch-keys
import { PROJECT_MEMBERS } from "constants/fetch-keys"; import { PROJECT_MEMBERS } from "constants/fetch-keys";
@ -54,7 +54,6 @@ export const SidebarLeadSelect: React.FC<Props> = ({ value, onChange }) => {
return ( return (
<div className="flex items-center justify-start gap-1"> <div className="flex items-center justify-start gap-1">
<div className="flex w-40 items-center justify-start gap-2"> <div className="flex w-40 items-center justify-start gap-2">
<UserCircleIcon className="h-5 w-5 text-gray-400" /> <UserCircleIcon className="h-5 w-5 text-gray-400" />
<span>Lead</span> <span>Lead</span>
@ -85,6 +84,8 @@ export const SidebarLeadSelect: React.FC<Props> = ({ value, onChange }) => {
</div> </div>
} }
options={options} options={options}
height="md"
position="right"
onChange={onChange} onChange={onChange}
/> />
</div> </div>

View File

@ -71,6 +71,8 @@ export const SidebarMembersSelect: React.FC<Props> = ({ value, onChange }) => {
} }
options={options} options={options}
onChange={onChange} onChange={onChange}
height="md"
position="right"
multiple multiple
/> />
</div> </div>

View File

@ -15,6 +15,7 @@ type CustomSearchSelectProps = {
}[]; }[];
label?: string | JSX.Element; label?: string | JSX.Element;
textAlignment?: "left" | "center" | "right"; textAlignment?: "left" | "center" | "right";
height?: "sm" | "md" | "rg" | "lg";
position?: "right" | "left"; position?: "right" | "left";
noChevron?: boolean; noChevron?: boolean;
customButton?: JSX.Element; customButton?: JSX.Element;
@ -28,6 +29,7 @@ type CustomSearchSelectProps = {
export const CustomSearchSelect = ({ export const CustomSearchSelect = ({
label, label,
textAlignment, textAlignment,
height = "sm",
value, value,
onChange, onChange,
options, options,
@ -95,7 +97,7 @@ export const CustomSearchSelect = ({
<Combobox.Options <Combobox.Options
className={`${optionsClassName} absolute min-w-[10rem] p-2 ${ className={`${optionsClassName} absolute min-w-[10rem] p-2 ${
position === "right" ? "right-0" : "left-0" position === "right" ? "right-0" : "left-0"
} z-10 mt-1 origin-top-right overflow-y-auto rounded-md bg-white text-xs shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none`} } z-10 mt-1 origin-top-right rounded-md bg-white text-xs shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none`}
> >
<div className="flex w-full items-center justify-start rounded-sm border-[0.6px] bg-gray-100 px-2"> <div className="flex w-full items-center justify-start rounded-sm border-[0.6px] bg-gray-100 px-2">
<MagnifyingGlassIcon className="h-3 w-3 text-gray-500" /> <MagnifyingGlassIcon className="h-3 w-3 text-gray-500" />
@ -106,7 +108,19 @@ export const CustomSearchSelect = ({
displayValue={(assigned: any) => assigned?.name} displayValue={(assigned: any) => assigned?.name}
/> />
</div> </div>
<div className="mt-2 space-y-1"> <div
className={`mt-2 space-y-1 ${
height === "sm"
? "max-h-28"
: height === "md"
? "max-h-44"
: height === "rg"
? "max-h-56"
: height === "lg"
? "max-h-80"
: ""
} overflow-y-scroll`}
>
{filteredOptions ? ( {filteredOptions ? (
filteredOptions.length > 0 ? ( filteredOptions.length > 0 ? (
filteredOptions.map((option) => ( filteredOptions.map((option) => (
@ -192,7 +206,7 @@ export const CustomSearchSelect = ({
<Combobox.Options <Combobox.Options
className={`${optionsClassName} absolute min-w-[10rem] p-2 ${ className={`${optionsClassName} absolute min-w-[10rem] p-2 ${
position === "right" ? "right-0" : "left-0" position === "right" ? "right-0" : "left-0"
} z-10 mt-1 origin-top-right overflow-y-auto rounded-md bg-white text-xs shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none`} } z-10 mt-1 origin-top-right rounded-md bg-white text-xs shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none`}
> >
<div className="flex w-full items-center justify-start rounded-sm border bg-gray-100 px-2 text-gray-500"> <div className="flex w-full items-center justify-start rounded-sm border bg-gray-100 px-2 text-gray-500">
<MagnifyingGlassIcon className="h-3 w-3" /> <MagnifyingGlassIcon className="h-3 w-3" />
@ -203,7 +217,19 @@ export const CustomSearchSelect = ({
displayValue={(assigned: any) => assigned?.name} displayValue={(assigned: any) => assigned?.name}
/> />
</div> </div>
<div className="mt-2 space-y-1"> <div
className={`mt-2 space-y-1 ${
height === "sm"
? "max-h-28"
: height === "md"
? "max-h-44"
: height === "rg"
? "max-h-56"
: height === "lg"
? "max-h-80"
: ""
} overflow-y-scroll`}
>
{filteredOptions ? ( {filteredOptions ? (
filteredOptions.length > 0 ? ( filteredOptions.length > 0 ? (
filteredOptions.map((option) => ( filteredOptions.map((option) => (