forked from github/plane
style: adjust tooltip position and spacing in workspace id and title in spreadsheet (#1420)
This commit is contained in:
parent
1a668c19a5
commit
01f465fdfa
@ -368,7 +368,6 @@ export const SingleBoardIssue: React.FC<Props> = ({
|
|||||||
issue={issue}
|
issue={issue}
|
||||||
partialUpdateIssue={partialUpdateIssue}
|
partialUpdateIssue={partialUpdateIssue}
|
||||||
isNotAllowed={isNotAllowed}
|
isNotAllowed={isNotAllowed}
|
||||||
tooltipPosition="left"
|
|
||||||
user={user}
|
user={user}
|
||||||
selfPositioned
|
selfPositioned
|
||||||
/>
|
/>
|
||||||
@ -378,7 +377,6 @@ export const SingleBoardIssue: React.FC<Props> = ({
|
|||||||
issue={issue}
|
issue={issue}
|
||||||
partialUpdateIssue={partialUpdateIssue}
|
partialUpdateIssue={partialUpdateIssue}
|
||||||
isNotAllowed={isNotAllowed}
|
isNotAllowed={isNotAllowed}
|
||||||
tooltipPosition="left"
|
|
||||||
user={user}
|
user={user}
|
||||||
selfPositioned
|
selfPositioned
|
||||||
/>
|
/>
|
||||||
|
@ -43,6 +43,7 @@ import { copyTextToClipboard } from "helpers/string.helper";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
issue: IIssue;
|
issue: IIssue;
|
||||||
|
index: number;
|
||||||
expanded: boolean;
|
expanded: boolean;
|
||||||
handleToggleExpand: (issueId: string) => void;
|
handleToggleExpand: (issueId: string) => void;
|
||||||
properties: Properties;
|
properties: Properties;
|
||||||
@ -57,6 +58,7 @@ type Props = {
|
|||||||
|
|
||||||
export const SingleSpreadsheetIssue: React.FC<Props> = ({
|
export const SingleSpreadsheetIssue: React.FC<Props> = ({
|
||||||
issue,
|
issue,
|
||||||
|
index,
|
||||||
expanded,
|
expanded,
|
||||||
handleToggleExpand,
|
handleToggleExpand,
|
||||||
properties,
|
properties,
|
||||||
@ -165,6 +167,8 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({
|
|||||||
|
|
||||||
const paddingLeft = `${nestingLevel * 68}px`;
|
const paddingLeft = `${nestingLevel * 68}px`;
|
||||||
|
|
||||||
|
const tooltipPosition = index === 0 ? "bottom" : "top";
|
||||||
|
|
||||||
const isNotAllowed = userAuth.isGuest || userAuth.isViewer;
|
const isNotAllowed = userAuth.isGuest || userAuth.isViewer;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -241,16 +245,16 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="h-6 w-6 flex justify-center items-center">
|
{issue.sub_issues_count > 0 && (
|
||||||
{issue.sub_issues_count > 0 && (
|
<div className="h-6 w-6 flex justify-center items-center">
|
||||||
<button
|
<button
|
||||||
className="h-5 w-5 hover:bg-brand-surface-1 hover:text-brand-base rounded-sm cursor-pointer"
|
className="h-5 w-5 hover:bg-brand-surface-1 hover:text-brand-base rounded-sm cursor-pointer"
|
||||||
onClick={() => handleToggleExpand(issue.id)}
|
onClick={() => handleToggleExpand(issue.id)}
|
||||||
>
|
>
|
||||||
<Icon iconName="chevron_right" className={`${expanded ? "rotate-90" : ""}`} />
|
<Icon iconName="chevron_right" className={`${expanded ? "rotate-90" : ""}`} />
|
||||||
</button>
|
</button>
|
||||||
)}
|
</div>
|
||||||
</div>
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Link href={`/${workspaceSlug}/projects/${issue?.project_detail?.id}/issues/${issue.id}`}>
|
<Link href={`/${workspaceSlug}/projects/${issue?.project_detail?.id}/issues/${issue.id}`}>
|
||||||
@ -265,6 +269,7 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({
|
|||||||
issue={issue}
|
issue={issue}
|
||||||
partialUpdateIssue={partialUpdateIssue}
|
partialUpdateIssue={partialUpdateIssue}
|
||||||
position="left"
|
position="left"
|
||||||
|
tooltipPosition={tooltipPosition}
|
||||||
customButton
|
customButton
|
||||||
user={user}
|
user={user}
|
||||||
isNotAllowed={isNotAllowed}
|
isNotAllowed={isNotAllowed}
|
||||||
@ -277,6 +282,7 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({
|
|||||||
issue={issue}
|
issue={issue}
|
||||||
partialUpdateIssue={partialUpdateIssue}
|
partialUpdateIssue={partialUpdateIssue}
|
||||||
position="left"
|
position="left"
|
||||||
|
tooltipPosition={tooltipPosition}
|
||||||
noBorder
|
noBorder
|
||||||
user={user}
|
user={user}
|
||||||
isNotAllowed={isNotAllowed}
|
isNotAllowed={isNotAllowed}
|
||||||
@ -289,6 +295,7 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({
|
|||||||
issue={issue}
|
issue={issue}
|
||||||
partialUpdateIssue={partialUpdateIssue}
|
partialUpdateIssue={partialUpdateIssue}
|
||||||
position="left"
|
position="left"
|
||||||
|
tooltipPosition={tooltipPosition}
|
||||||
customButton
|
customButton
|
||||||
user={user}
|
user={user}
|
||||||
isNotAllowed={isNotAllowed}
|
isNotAllowed={isNotAllowed}
|
||||||
@ -301,6 +308,7 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({
|
|||||||
issue={issue}
|
issue={issue}
|
||||||
partialUpdateIssue={partialUpdateIssue}
|
partialUpdateIssue={partialUpdateIssue}
|
||||||
position="left"
|
position="left"
|
||||||
|
tooltipPosition={tooltipPosition}
|
||||||
customButton
|
customButton
|
||||||
user={user}
|
user={user}
|
||||||
isNotAllowed={isNotAllowed}
|
isNotAllowed={isNotAllowed}
|
||||||
@ -313,6 +321,7 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({
|
|||||||
<ViewDueDateSelect
|
<ViewDueDateSelect
|
||||||
issue={issue}
|
issue={issue}
|
||||||
partialUpdateIssue={partialUpdateIssue}
|
partialUpdateIssue={partialUpdateIssue}
|
||||||
|
tooltipPosition={tooltipPosition}
|
||||||
noBorder
|
noBorder
|
||||||
user={user}
|
user={user}
|
||||||
isNotAllowed={isNotAllowed}
|
isNotAllowed={isNotAllowed}
|
||||||
@ -325,6 +334,7 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({
|
|||||||
issue={issue}
|
issue={issue}
|
||||||
partialUpdateIssue={partialUpdateIssue}
|
partialUpdateIssue={partialUpdateIssue}
|
||||||
position="left"
|
position="left"
|
||||||
|
tooltipPosition={tooltipPosition}
|
||||||
user={user}
|
user={user}
|
||||||
isNotAllowed={isNotAllowed}
|
isNotAllowed={isNotAllowed}
|
||||||
/>
|
/>
|
||||||
|
@ -10,6 +10,7 @@ import { ICurrentUserResponse, IIssue, Properties, UserAuth } from "types";
|
|||||||
type Props = {
|
type Props = {
|
||||||
key: string;
|
key: string;
|
||||||
issue: IIssue;
|
issue: IIssue;
|
||||||
|
index: number;
|
||||||
expandedIssues: string[];
|
expandedIssues: string[];
|
||||||
setExpandedIssues: React.Dispatch<React.SetStateAction<string[]>>;
|
setExpandedIssues: React.Dispatch<React.SetStateAction<string[]>>;
|
||||||
properties: Properties;
|
properties: Properties;
|
||||||
@ -24,6 +25,7 @@ type Props = {
|
|||||||
|
|
||||||
export const SpreadsheetIssues: React.FC<Props> = ({
|
export const SpreadsheetIssues: React.FC<Props> = ({
|
||||||
key,
|
key,
|
||||||
|
index,
|
||||||
issue,
|
issue,
|
||||||
expandedIssues,
|
expandedIssues,
|
||||||
setExpandedIssues,
|
setExpandedIssues,
|
||||||
@ -57,6 +59,7 @@ export const SpreadsheetIssues: React.FC<Props> = ({
|
|||||||
<div>
|
<div>
|
||||||
<SingleSpreadsheetIssue
|
<SingleSpreadsheetIssue
|
||||||
issue={issue}
|
issue={issue}
|
||||||
|
index={index}
|
||||||
expanded={isExpanded}
|
expanded={isExpanded}
|
||||||
handleToggleExpand={handleToggleExpand}
|
handleToggleExpand={handleToggleExpand}
|
||||||
gridTemplateColumns={gridTemplateColumns}
|
gridTemplateColumns={gridTemplateColumns}
|
||||||
@ -77,6 +80,7 @@ export const SpreadsheetIssues: React.FC<Props> = ({
|
|||||||
<SpreadsheetIssues
|
<SpreadsheetIssues
|
||||||
key={subIssue.id}
|
key={subIssue.id}
|
||||||
issue={subIssue}
|
issue={subIssue}
|
||||||
|
index={index}
|
||||||
expandedIssues={expandedIssues}
|
expandedIssues={expandedIssues}
|
||||||
setExpandedIssues={setExpandedIssues}
|
setExpandedIssues={setExpandedIssues}
|
||||||
gridTemplateColumns={gridTemplateColumns}
|
gridTemplateColumns={gridTemplateColumns}
|
||||||
|
@ -70,6 +70,7 @@ export const SpreadsheetView: React.FC<Props> = ({
|
|||||||
{spreadsheetIssues.map((issue: IIssue, index) => (
|
{spreadsheetIssues.map((issue: IIssue, index) => (
|
||||||
<SpreadsheetIssues
|
<SpreadsheetIssues
|
||||||
key={`${issue.id}_${index}`}
|
key={`${issue.id}_${index}`}
|
||||||
|
index={index}
|
||||||
issue={issue}
|
issue={issue}
|
||||||
expandedIssues={expandedIssues}
|
expandedIssues={expandedIssues}
|
||||||
setExpandedIssues={setExpandedIssues}
|
setExpandedIssues={setExpandedIssues}
|
||||||
|
@ -20,8 +20,8 @@ type Props = {
|
|||||||
issue: IIssue;
|
issue: IIssue;
|
||||||
partialUpdateIssue: (formData: Partial<IIssue>, issue: IIssue) => void;
|
partialUpdateIssue: (formData: Partial<IIssue>, issue: IIssue) => void;
|
||||||
position?: "left" | "right";
|
position?: "left" | "right";
|
||||||
|
tooltipPosition?: "top" | "bottom";
|
||||||
selfPositioned?: boolean;
|
selfPositioned?: boolean;
|
||||||
tooltipPosition?: "left" | "right";
|
|
||||||
customButton?: boolean;
|
customButton?: boolean;
|
||||||
user: ICurrentUserResponse | undefined;
|
user: ICurrentUserResponse | undefined;
|
||||||
isNotAllowed: boolean;
|
isNotAllowed: boolean;
|
||||||
@ -32,7 +32,7 @@ export const ViewAssigneeSelect: React.FC<Props> = ({
|
|||||||
partialUpdateIssue,
|
partialUpdateIssue,
|
||||||
position = "left",
|
position = "left",
|
||||||
selfPositioned = false,
|
selfPositioned = false,
|
||||||
tooltipPosition = "right",
|
tooltipPosition = "top",
|
||||||
user,
|
user,
|
||||||
isNotAllowed,
|
isNotAllowed,
|
||||||
customButton = false,
|
customButton = false,
|
||||||
@ -69,7 +69,7 @@ export const ViewAssigneeSelect: React.FC<Props> = ({
|
|||||||
|
|
||||||
const assigneeLabel = (
|
const assigneeLabel = (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
position={`top-${tooltipPosition}`}
|
position={tooltipPosition}
|
||||||
tooltipHeading="Assignees"
|
tooltipHeading="Assignees"
|
||||||
tooltipContent={
|
tooltipContent={
|
||||||
issue.assignee_details.length > 0
|
issue.assignee_details.length > 0
|
||||||
|
@ -12,6 +12,7 @@ import { ICurrentUserResponse, IIssue } from "types";
|
|||||||
type Props = {
|
type Props = {
|
||||||
issue: IIssue;
|
issue: IIssue;
|
||||||
partialUpdateIssue: (formData: Partial<IIssue>, issue: IIssue) => void;
|
partialUpdateIssue: (formData: Partial<IIssue>, issue: IIssue) => void;
|
||||||
|
tooltipPosition?: "top" | "bottom";
|
||||||
noBorder?: boolean;
|
noBorder?: boolean;
|
||||||
user: ICurrentUserResponse | undefined;
|
user: ICurrentUserResponse | undefined;
|
||||||
isNotAllowed: boolean;
|
isNotAllowed: boolean;
|
||||||
@ -20,6 +21,7 @@ type Props = {
|
|||||||
export const ViewDueDateSelect: React.FC<Props> = ({
|
export const ViewDueDateSelect: React.FC<Props> = ({
|
||||||
issue,
|
issue,
|
||||||
partialUpdateIssue,
|
partialUpdateIssue,
|
||||||
|
tooltipPosition = "top",
|
||||||
noBorder = false,
|
noBorder = false,
|
||||||
user,
|
user,
|
||||||
isNotAllowed,
|
isNotAllowed,
|
||||||
@ -28,7 +30,11 @@ export const ViewDueDateSelect: React.FC<Props> = ({
|
|||||||
const { workspaceSlug } = router.query;
|
const { workspaceSlug } = router.query;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip tooltipHeading="Due Date" tooltipContent={issue.target_date ?? "N/A"}>
|
<Tooltip
|
||||||
|
tooltipHeading="Due Date"
|
||||||
|
tooltipContent={issue.target_date ?? "N/A"}
|
||||||
|
position={tooltipPosition}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
className={`group relative max-w-[6.5rem] ${
|
className={`group relative max-w-[6.5rem] ${
|
||||||
issue.target_date === null
|
issue.target_date === null
|
||||||
|
@ -17,6 +17,7 @@ type Props = {
|
|||||||
issue: IIssue;
|
issue: IIssue;
|
||||||
partialUpdateIssue: (formData: Partial<IIssue>, issue: IIssue) => void;
|
partialUpdateIssue: (formData: Partial<IIssue>, issue: IIssue) => void;
|
||||||
position?: "left" | "right";
|
position?: "left" | "right";
|
||||||
|
tooltipPosition?: "top" | "bottom";
|
||||||
selfPositioned?: boolean;
|
selfPositioned?: boolean;
|
||||||
customButton?: boolean;
|
customButton?: boolean;
|
||||||
user: ICurrentUserResponse | undefined;
|
user: ICurrentUserResponse | undefined;
|
||||||
@ -27,6 +28,7 @@ export const ViewEstimateSelect: React.FC<Props> = ({
|
|||||||
issue,
|
issue,
|
||||||
partialUpdateIssue,
|
partialUpdateIssue,
|
||||||
position = "left",
|
position = "left",
|
||||||
|
tooltipPosition = "top",
|
||||||
selfPositioned = false,
|
selfPositioned = false,
|
||||||
customButton = false,
|
customButton = false,
|
||||||
user,
|
user,
|
||||||
@ -40,7 +42,7 @@ export const ViewEstimateSelect: React.FC<Props> = ({
|
|||||||
const estimateValue = estimatePoints?.find((e) => e.key === issue.estimate_point)?.value;
|
const estimateValue = estimatePoints?.find((e) => e.key === issue.estimate_point)?.value;
|
||||||
|
|
||||||
const estimateLabels = (
|
const estimateLabels = (
|
||||||
<Tooltip tooltipHeading="Estimate" tooltipContent={estimateValue}>
|
<Tooltip tooltipHeading="Estimate" tooltipContent={estimateValue} position={tooltipPosition}>
|
||||||
<div className="flex items-center gap-1 text-brand-secondary">
|
<div className="flex items-center gap-1 text-brand-secondary">
|
||||||
<PlayIcon className="h-3.5 w-3.5 -rotate-90" />
|
<PlayIcon className="h-3.5 w-3.5 -rotate-90" />
|
||||||
{estimateValue ?? "None"}
|
{estimateValue ?? "None"}
|
||||||
|
@ -22,7 +22,7 @@ type Props = {
|
|||||||
partialUpdateIssue: (formData: Partial<IIssue>, issue: IIssue) => void;
|
partialUpdateIssue: (formData: Partial<IIssue>, issue: IIssue) => void;
|
||||||
position?: "left" | "right";
|
position?: "left" | "right";
|
||||||
selfPositioned?: boolean;
|
selfPositioned?: boolean;
|
||||||
tooltipPosition?: "left" | "right";
|
tooltipPosition?: "top" | "bottom";
|
||||||
customButton?: boolean;
|
customButton?: boolean;
|
||||||
user: ICurrentUserResponse | undefined;
|
user: ICurrentUserResponse | undefined;
|
||||||
isNotAllowed: boolean;
|
isNotAllowed: boolean;
|
||||||
@ -33,7 +33,7 @@ export const ViewLabelSelect: React.FC<Props> = ({
|
|||||||
partialUpdateIssue,
|
partialUpdateIssue,
|
||||||
position = "left",
|
position = "left",
|
||||||
selfPositioned = false,
|
selfPositioned = false,
|
||||||
tooltipPosition = "right",
|
tooltipPosition = "top",
|
||||||
user,
|
user,
|
||||||
isNotAllowed,
|
isNotAllowed,
|
||||||
customButton = false,
|
customButton = false,
|
||||||
@ -68,7 +68,7 @@ export const ViewLabelSelect: React.FC<Props> = ({
|
|||||||
|
|
||||||
const labelsLabel = (
|
const labelsLabel = (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
position={`top-${tooltipPosition}`}
|
position={tooltipPosition}
|
||||||
tooltipHeading="Labels"
|
tooltipHeading="Labels"
|
||||||
tooltipContent={
|
tooltipContent={
|
||||||
issue.label_details.length > 0
|
issue.label_details.length > 0
|
||||||
|
@ -19,6 +19,7 @@ type Props = {
|
|||||||
issue: IIssue;
|
issue: IIssue;
|
||||||
partialUpdateIssue: (formData: Partial<IIssue>, issue: IIssue) => void;
|
partialUpdateIssue: (formData: Partial<IIssue>, issue: IIssue) => void;
|
||||||
position?: "left" | "right";
|
position?: "left" | "right";
|
||||||
|
tooltipPosition?: "top" | "bottom";
|
||||||
selfPositioned?: boolean;
|
selfPositioned?: boolean;
|
||||||
noBorder?: boolean;
|
noBorder?: boolean;
|
||||||
user: ICurrentUserResponse | undefined;
|
user: ICurrentUserResponse | undefined;
|
||||||
@ -29,6 +30,7 @@ export const ViewPrioritySelect: React.FC<Props> = ({
|
|||||||
issue,
|
issue,
|
||||||
partialUpdateIssue,
|
partialUpdateIssue,
|
||||||
position = "left",
|
position = "left",
|
||||||
|
tooltipPosition = "top",
|
||||||
selfPositioned = false,
|
selfPositioned = false,
|
||||||
noBorder = false,
|
noBorder = false,
|
||||||
user,
|
user,
|
||||||
@ -75,7 +77,11 @@ export const ViewPrioritySelect: React.FC<Props> = ({
|
|||||||
: "border-brand-base"
|
: "border-brand-base"
|
||||||
} items-center`}
|
} items-center`}
|
||||||
>
|
>
|
||||||
<Tooltip tooltipHeading="Priority" tooltipContent={issue.priority ?? "None"}>
|
<Tooltip
|
||||||
|
tooltipHeading="Priority"
|
||||||
|
tooltipContent={issue.priority ?? "None"}
|
||||||
|
position={tooltipPosition}
|
||||||
|
>
|
||||||
<span className="flex gap-1 items-center text-brand-secondary text-xs">
|
<span className="flex gap-1 items-center text-brand-secondary text-xs">
|
||||||
{getPriorityIcon(
|
{getPriorityIcon(
|
||||||
issue.priority && issue.priority !== "" ? issue.priority ?? "" : "None",
|
issue.priority && issue.priority !== "" ? issue.priority ?? "" : "None",
|
||||||
|
@ -21,6 +21,7 @@ type Props = {
|
|||||||
issue: IIssue;
|
issue: IIssue;
|
||||||
partialUpdateIssue: (formData: Partial<IIssue>, issue: IIssue) => void;
|
partialUpdateIssue: (formData: Partial<IIssue>, issue: IIssue) => void;
|
||||||
position?: "left" | "right";
|
position?: "left" | "right";
|
||||||
|
tooltipPosition?: "top" | "bottom";
|
||||||
selfPositioned?: boolean;
|
selfPositioned?: boolean;
|
||||||
customButton?: boolean;
|
customButton?: boolean;
|
||||||
user: ICurrentUserResponse | undefined;
|
user: ICurrentUserResponse | undefined;
|
||||||
@ -31,6 +32,7 @@ export const ViewStateSelect: React.FC<Props> = ({
|
|||||||
issue,
|
issue,
|
||||||
partialUpdateIssue,
|
partialUpdateIssue,
|
||||||
position = "left",
|
position = "left",
|
||||||
|
tooltipPosition = "top",
|
||||||
selfPositioned = false,
|
selfPositioned = false,
|
||||||
customButton = false,
|
customButton = false,
|
||||||
user,
|
user,
|
||||||
@ -64,6 +66,7 @@ export const ViewStateSelect: React.FC<Props> = ({
|
|||||||
<Tooltip
|
<Tooltip
|
||||||
tooltipHeading="State"
|
tooltipHeading="State"
|
||||||
tooltipContent={addSpaceIfCamelCase(selectedOption?.name ?? "")}
|
tooltipContent={addSpaceIfCamelCase(selectedOption?.name ?? "")}
|
||||||
|
position={tooltipPosition}
|
||||||
>
|
>
|
||||||
<div className="flex items-center cursor-pointer gap-2 text-brand-secondary">
|
<div className="flex items-center cursor-pointer gap-2 text-brand-secondary">
|
||||||
{selectedOption &&
|
{selectedOption &&
|
||||||
|
Loading…
Reference in New Issue
Block a user