style: hide cycle and module dropdown placeholder from list and kanban view. (#4044)

This commit is contained in:
Prateek Shourya 2024-03-22 18:39:06 +05:30 committed by GitHub
parent 5c7886d7f3
commit 95d2b6f1c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 11 deletions

View File

@ -41,7 +41,7 @@ export const CycleDropdown: React.FC<Props> = observer((props) => {
hideIcon = false,
onChange,
onClose,
placeholder = "Cycle",
placeholder = "",
placement,
projectId,
showTooltip = false,
@ -132,7 +132,7 @@ export const CycleDropdown: React.FC<Props> = observer((props) => {
variant={buttonVariant}
>
{!hideIcon && <ContrastIcon className="h-3 w-3 flex-shrink-0" />}
{BUTTON_VARIANTS_WITH_TEXT.includes(buttonVariant) && (
{BUTTON_VARIANTS_WITH_TEXT.includes(buttonVariant) && (!!selectedName || !!placeholder) && (
<span className="flex-grow truncate max-w-40">{selectedName ?? placeholder}</span>
)}
{dropdownArrow && (

View File

@ -46,7 +46,7 @@ type ButtonContentProps = {
hideIcon: boolean;
hideText: boolean;
onChange: (moduleIds: string[]) => void;
placeholder: string;
placeholder?: string;
showCount: boolean;
showTooltip?: boolean;
value: string | string[] | null;
@ -75,13 +75,15 @@ const ButtonContent: React.FC<ButtonContentProps> = (props) => {
{showCount ? (
<div className="relative flex items-center gap-1 max-w-full">
{!hideIcon && <DiceIcon className="h-3 w-3 flex-shrink-0" />}
<div className="max-w-40 flex-grow truncate">
{value.length > 0
? value.length === 1
? `${getModuleById(value[0])?.name || "module"}`
: `${value.length} Module${value.length === 1 ? "" : "s"}`
: placeholder}
</div>
{(value.length > 0 || !!placeholder) && (
<div className="max-w-40 flex-grow truncate">
{value.length > 0
? value.length === 1
? `${getModuleById(value[0])?.name || "module"}`
: `${value.length} Module${value.length === 1 ? "" : "s"}`
: placeholder}
</div>
)}
</div>
) : value.length > 0 ? (
<div className="flex max-w-full flex-grow flex-wrap items-center gap-2 truncate py-0.5">
@ -158,7 +160,7 @@ export const ModuleDropdown: React.FC<Props> = observer((props) => {
multiple,
onChange,
onClose,
placeholder = "Module",
placeholder = "",
placement,
projectId,
showCount = false,

View File

@ -601,6 +601,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
onChange(cycleId);
handleFormChange();
}}
placeholder="Cycle"
value={value}
buttonVariant="border-with-text"
tabIndex={getTabIndex("cycle_id")}
@ -622,6 +623,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
onChange(moduleIds);
handleFormChange();
}}
placeholder="Modules"
buttonVariant="border-with-text"
tabIndex={getTabIndex("module_ids")}
multiple