forked from github/plane
refactor: remove true
from boolean attribute (#2579)
When using a boolean attribute in JSX, you can set the attribute value to true or omit the value. This helps to keep consistency in code. Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
parent
b7d5a42d45
commit
80e6d7e1ea
@ -23,8 +23,8 @@ export const ImageResizer = ({ editor }: { editor: Editor }) => {
|
|||||||
origin={false}
|
origin={false}
|
||||||
edge={false}
|
edge={false}
|
||||||
throttleDrag={0}
|
throttleDrag={0}
|
||||||
keepRatio={true}
|
keepRatio
|
||||||
resizable={true}
|
resizable
|
||||||
throttleResize={0}
|
throttleResize={0}
|
||||||
onResize={({ target, width, height, delta }: any) => {
|
onResize={({ target, width, height, delta }: any) => {
|
||||||
delta[0] && (target!.style.width = `${width}px`);
|
delta[0] && (target!.style.width = `${width}px`);
|
||||||
@ -33,7 +33,7 @@ export const ImageResizer = ({ editor }: { editor: Editor }) => {
|
|||||||
onResizeEnd={() => {
|
onResizeEnd={() => {
|
||||||
updateMediaSize();
|
updateMediaSize();
|
||||||
}}
|
}}
|
||||||
scalable={true}
|
scalable
|
||||||
renderDirections={["w", "e"]}
|
renderDirections={["w", "e"]}
|
||||||
onScale={({ target, transform }: any) => {
|
onScale={({ target, transform }: any) => {
|
||||||
target!.style.transform = transform;
|
target!.style.transform = transform;
|
||||||
|
@ -334,7 +334,7 @@ export const SingleCycleCard: React.FC<TSingleStatProps> = ({
|
|||||||
position="bottom"
|
position="bottom"
|
||||||
>
|
>
|
||||||
<div className="flex w-full items-center">
|
<div className="flex w-full items-center">
|
||||||
<LinearProgressIndicator data={progressIndicatorData} noTooltip={true} />
|
<LinearProgressIndicator data={progressIndicatorData} noTooltip />
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Disclosure.Button>
|
<Disclosure.Button>
|
||||||
|
@ -128,7 +128,7 @@ export const Exporter: React.FC<Props> = observer((props) => {
|
|||||||
value={value ?? []}
|
value={value ?? []}
|
||||||
onChange={(val: string[]) => onChange(val)}
|
onChange={(val: string[]) => onChange(val)}
|
||||||
options={options}
|
options={options}
|
||||||
input={true}
|
input
|
||||||
label={
|
label={
|
||||||
value && value.length > 0
|
value && value.length > 0
|
||||||
? projects &&
|
? projects &&
|
||||||
|
@ -150,7 +150,7 @@ const IntegrationGuide = () => {
|
|||||||
</>
|
</>
|
||||||
{provider && (
|
{provider && (
|
||||||
<Exporter
|
<Exporter
|
||||||
isOpen={true}
|
isOpen
|
||||||
handleClose={() => handleCsvClose()}
|
handleClose={() => handleCsvClose()}
|
||||||
data={null}
|
data={null}
|
||||||
user={user}
|
user={user}
|
||||||
|
@ -114,7 +114,7 @@ export const IssueDescriptionForm: FC<IssueDetailsProps> = (props) => {
|
|||||||
onChange(e.target.value);
|
onChange(e.target.value);
|
||||||
debouncedFormSave();
|
debouncedFormSave();
|
||||||
}}
|
}}
|
||||||
required={true}
|
required
|
||||||
className="min-h-10 block w-full resize-none overflow-hidden rounded border-none bg-transparent px-3 py-2 text-xl outline-none ring-0 focus:ring-1 focus:ring-custom-primary"
|
className="min-h-10 block w-full resize-none overflow-hidden rounded border-none bg-transparent px-3 py-2 text-xl outline-none ring-0 focus:ring-1 focus:ring-custom-primary"
|
||||||
hasError={Boolean(errors?.description)}
|
hasError={Boolean(errors?.description)}
|
||||||
role="textbox"
|
role="textbox"
|
||||||
|
@ -111,7 +111,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
|||||||
onChange={handleState}
|
onChange={handleState}
|
||||||
states={states}
|
states={states}
|
||||||
disabled={false}
|
disabled={false}
|
||||||
hideDropdownArrow={true}
|
hideDropdownArrow
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
|||||||
value={issue?.priority || null}
|
value={issue?.priority || null}
|
||||||
onChange={handlePriority}
|
onChange={handlePriority}
|
||||||
disabled={false}
|
disabled={false}
|
||||||
hideDropdownArrow={true}
|
hideDropdownArrow
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
|||||||
onChange={handleLabel}
|
onChange={handleLabel}
|
||||||
labels={labels}
|
labels={labels}
|
||||||
disabled={false}
|
disabled={false}
|
||||||
hideDropdownArrow={true}
|
hideDropdownArrow
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
|||||||
{displayProperties && displayProperties?.assignee && (
|
{displayProperties && displayProperties?.assignee && (
|
||||||
<IssuePropertyAssignee
|
<IssuePropertyAssignee
|
||||||
value={issue?.assignees || null}
|
value={issue?.assignees || null}
|
||||||
hideDropdownArrow={true}
|
hideDropdownArrow
|
||||||
onChange={handleAssignee}
|
onChange={handleAssignee}
|
||||||
members={members}
|
members={members}
|
||||||
disabled={false}
|
disabled={false}
|
||||||
@ -174,7 +174,7 @@ export const KanBanProperties: React.FC<IKanBanProperties> = observer((props) =>
|
|||||||
onChange={handleEstimate}
|
onChange={handleEstimate}
|
||||||
estimatePoints={estimates}
|
estimatePoints={estimates}
|
||||||
disabled={false}
|
disabled={false}
|
||||||
hideDropdownArrow={true}
|
hideDropdownArrow
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ export const List: React.FC<IList> = observer((props) => {
|
|||||||
handleIssues={handleIssues}
|
handleIssues={handleIssues}
|
||||||
quickActions={quickActions}
|
quickActions={quickActions}
|
||||||
display_properties={display_properties}
|
display_properties={display_properties}
|
||||||
is_list={true}
|
is_list
|
||||||
states={states}
|
states={states}
|
||||||
labels={labels}
|
labels={labels}
|
||||||
members={members}
|
members={members}
|
||||||
|
@ -62,7 +62,7 @@ export const KanBanProperties: FC<IKanBanProperties> = observer((props) => {
|
|||||||
{display_properties && display_properties?.state && states && (
|
{display_properties && display_properties?.state && states && (
|
||||||
<IssuePropertyState
|
<IssuePropertyState
|
||||||
value={issue?.state_detail || null}
|
value={issue?.state_detail || null}
|
||||||
hideDropdownArrow={true}
|
hideDropdownArrow
|
||||||
onChange={handleState}
|
onChange={handleState}
|
||||||
disabled={false}
|
disabled={false}
|
||||||
states={states}
|
states={states}
|
||||||
@ -75,7 +75,7 @@ export const KanBanProperties: FC<IKanBanProperties> = observer((props) => {
|
|||||||
value={issue?.priority || null}
|
value={issue?.priority || null}
|
||||||
onChange={handlePriority}
|
onChange={handlePriority}
|
||||||
disabled={false}
|
disabled={false}
|
||||||
hideDropdownArrow={true}
|
hideDropdownArrow
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ export const KanBanProperties: FC<IKanBanProperties> = observer((props) => {
|
|||||||
onChange={handleLabel}
|
onChange={handleLabel}
|
||||||
labels={labels}
|
labels={labels}
|
||||||
disabled={false}
|
disabled={false}
|
||||||
hideDropdownArrow={true}
|
hideDropdownArrow
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ export const KanBanProperties: FC<IKanBanProperties> = observer((props) => {
|
|||||||
{display_properties && display_properties?.assignee && members && (
|
{display_properties && display_properties?.assignee && members && (
|
||||||
<IssuePropertyAssignee
|
<IssuePropertyAssignee
|
||||||
value={issue?.assignees || null}
|
value={issue?.assignees || null}
|
||||||
hideDropdownArrow={true}
|
hideDropdownArrow
|
||||||
onChange={handleAssignee}
|
onChange={handleAssignee}
|
||||||
disabled={false}
|
disabled={false}
|
||||||
members={members}
|
members={members}
|
||||||
@ -126,7 +126,7 @@ export const KanBanProperties: FC<IKanBanProperties> = observer((props) => {
|
|||||||
<IssuePropertyEstimates
|
<IssuePropertyEstimates
|
||||||
value={issue?.estimate_point || null}
|
value={issue?.estimate_point || null}
|
||||||
estimatePoints={estimates}
|
estimatePoints={estimates}
|
||||||
hideDropdownArrow={true}
|
hideDropdownArrow
|
||||||
onChange={handleEstimate}
|
onChange={handleEstimate}
|
||||||
disabled={false}
|
disabled={false}
|
||||||
/>
|
/>
|
||||||
|
@ -57,7 +57,7 @@ export const PeekOverviewProperties: FC<IPeekOverviewProperties> = (props) => {
|
|||||||
onChange={handleState}
|
onChange={handleState}
|
||||||
states={states}
|
states={states}
|
||||||
disabled={false}
|
disabled={false}
|
||||||
hideDropdownArrow={true}
|
hideDropdownArrow
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -75,7 +75,7 @@ export const PeekOverviewProperties: FC<IPeekOverviewProperties> = (props) => {
|
|||||||
value={issue?.assignees || null}
|
value={issue?.assignees || null}
|
||||||
onChange={(ids: string[]) => handleAssignee(ids)}
|
onChange={(ids: string[]) => handleAssignee(ids)}
|
||||||
disabled={false}
|
disabled={false}
|
||||||
hideDropdownArrow={true}
|
hideDropdownArrow
|
||||||
members={members}
|
members={members}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -94,7 +94,7 @@ export const PeekOverviewProperties: FC<IPeekOverviewProperties> = (props) => {
|
|||||||
value={issue?.priority || null}
|
value={issue?.priority || null}
|
||||||
onChange={handlePriority}
|
onChange={handlePriority}
|
||||||
disabled={false}
|
disabled={false}
|
||||||
hideDropdownArrow={true}
|
hideDropdownArrow
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -50,7 +50,7 @@ export const IssueAssigneeSelect: React.FC<Props> = ({ projectId, value = [], on
|
|||||||
<div className="flex items-center gap-2 cursor-pointer text-xs text-custom-text-200">
|
<div className="flex items-center gap-2 cursor-pointer text-xs text-custom-text-200">
|
||||||
{value && value.length > 0 && Array.isArray(value) ? (
|
{value && value.length > 0 && Array.isArray(value) ? (
|
||||||
<div className="-my-0.5 flex items-center justify-center gap-2">
|
<div className="-my-0.5 flex items-center justify-center gap-2">
|
||||||
<AssigneesList userIds={value} length={3} showLength={true} />
|
<AssigneesList userIds={value} length={3} showLength />
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="flex items-center justify-center gap-2 px-1.5 py-1 rounded shadow-sm border border-custom-border-300 hover:bg-custom-background-80">
|
<div className="flex items-center justify-center gap-2 px-1.5 py-1 rounded shadow-sm border border-custom-border-300 hover:bg-custom-background-80">
|
||||||
|
@ -49,7 +49,7 @@ export const IssueLabelSelect: React.FC<Props> = ({ setIsOpen, value, onChange,
|
|||||||
<IssueLabelsList
|
<IssueLabelsList
|
||||||
labels={value.map((v) => issueLabels?.find((l) => l.id === v)) ?? []}
|
labels={value.map((v) => issueLabels?.find((l) => l.id === v)) ?? []}
|
||||||
length={3}
|
length={3}
|
||||||
showLength={true}
|
showLength
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
|
@ -177,7 +177,7 @@ export const ProjectCard: React.FC<ProjectCardProps> = observer((props) => {
|
|||||||
>
|
>
|
||||||
{projectMembersIds.length > 0 ? (
|
{projectMembersIds.length > 0 ? (
|
||||||
<div className="flex items-center cursor-pointer gap-2 text-custom-text-200">
|
<div className="flex items-center cursor-pointer gap-2 text-custom-text-200">
|
||||||
<AssigneesList userIds={projectMembersIds} length={3} showLength={true} />
|
<AssigneesList userIds={projectMembersIds} length={3} showLength />
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<span className="text-sm italic text-custom-text-400">No Member Yet</span>
|
<span className="text-sm italic text-custom-text-400">No Member Yet</span>
|
||||||
|
@ -87,7 +87,7 @@ export const MembersSelect: React.FC<Props> = ({
|
|||||||
>
|
>
|
||||||
<div className="flex items-center cursor-pointer h-full w-full gap-2 text-custom-text-200">
|
<div className="flex items-center cursor-pointer h-full w-full gap-2 text-custom-text-200">
|
||||||
{value && value.length > 0 && Array.isArray(value) ? (
|
{value && value.length > 0 && Array.isArray(value) ? (
|
||||||
<AssigneesList userIds={value} length={3} showLength={true} />
|
<AssigneesList userIds={value} length={3} showLength />
|
||||||
) : (
|
) : (
|
||||||
<span
|
<span
|
||||||
className="flex items-center justify-between gap-1 h-full w-full text-xs px-2.5 py-1 rounded border-[0.5px] border-custom-border-300 duration-300 focus:outline-none
|
className="flex items-center justify-between gap-1 h-full w-full text-xs px-2.5 py-1 rounded border-[0.5px] border-custom-border-300 duration-300 focus:outline-none
|
||||||
|
@ -121,7 +121,7 @@ export const ProjectSidebarList: FC = observer(() => {
|
|||||||
{(provided) => (
|
{(provided) => (
|
||||||
<div ref={provided.innerRef} {...provided.droppableProps}>
|
<div ref={provided.innerRef} {...provided.droppableProps}>
|
||||||
{orderedFavProjects && orderedFavProjects.length > 0 && (
|
{orderedFavProjects && orderedFavProjects.length > 0 && (
|
||||||
<Disclosure as="div" className="flex flex-col" defaultOpen={true}>
|
<Disclosure as="div" className="flex flex-col" defaultOpen>
|
||||||
{({ open }) => (
|
{({ open }) => (
|
||||||
<>
|
<>
|
||||||
{!isCollapsed && (
|
{!isCollapsed && (
|
||||||
@ -186,7 +186,7 @@ export const ProjectSidebarList: FC = observer(() => {
|
|||||||
{(provided) => (
|
{(provided) => (
|
||||||
<div ref={provided.innerRef} {...provided.droppableProps}>
|
<div ref={provided.innerRef} {...provided.droppableProps}>
|
||||||
{orderedJoinedProjects && orderedJoinedProjects.length > 0 && (
|
{orderedJoinedProjects && orderedJoinedProjects.length > 0 && (
|
||||||
<Disclosure as="div" className="flex flex-col" defaultOpen={true}>
|
<Disclosure as="div" className="flex flex-col" defaultOpen>
|
||||||
{({ open }) => (
|
{({ open }) => (
|
||||||
<>
|
<>
|
||||||
{!isCollapsed && (
|
{!isCollapsed && (
|
||||||
|
@ -43,7 +43,7 @@ export const BarGraph: React.FC<Props & TGraph & Omit<BarSvgProps<any>, "height"
|
|||||||
}}
|
}}
|
||||||
labelTextColor={{ from: "color", modifiers: [["darker", 1.6]] }}
|
labelTextColor={{ from: "color", modifiers: [["darker", 1.6]] }}
|
||||||
theme={{ ...CHARTS_THEME, ...(theme ?? {}) }}
|
theme={{ ...CHARTS_THEME, ...(theme ?? {}) }}
|
||||||
animate={true}
|
animate
|
||||||
enableLabel={rest.enableLabel ?? false}
|
enableLabel={rest.enableLabel ?? false}
|
||||||
{...rest}
|
{...rest}
|
||||||
/>
|
/>
|
||||||
|
@ -30,7 +30,7 @@ export const LineGraph: React.FC<Props & TGraph & LineSvgProps> = ({
|
|||||||
: undefined,
|
: undefined,
|
||||||
}}
|
}}
|
||||||
theme={{ ...CHARTS_THEME, ...(theme ?? {}) }}
|
theme={{ ...CHARTS_THEME, ...(theme ?? {}) }}
|
||||||
animate={true}
|
animate
|
||||||
{...rest}
|
{...rest}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,7 +16,7 @@ export const PieGraph: React.FC<TGraph & Omit<PieSvgProps<any>, "height" | "widt
|
|||||||
<ResponsivePie
|
<ResponsivePie
|
||||||
margin={{ ...DEFAULT_MARGIN, ...(margin ?? {}) }}
|
margin={{ ...DEFAULT_MARGIN, ...(margin ?? {}) }}
|
||||||
theme={{ ...CHARTS_THEME, ...(theme ?? {}) }}
|
theme={{ ...CHARTS_THEME, ...(theme ?? {}) }}
|
||||||
animate={true}
|
animate
|
||||||
{...rest}
|
{...rest}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,7 +11,7 @@ export const ScatterPlotGraph: React.FC<
|
|||||||
<div style={{ height, width }}>
|
<div style={{ height, width }}>
|
||||||
<ResponsiveScatterPlot
|
<ResponsiveScatterPlot
|
||||||
margin={{ ...DEFAULT_MARGIN, ...(margin ?? {}) }}
|
margin={{ ...DEFAULT_MARGIN, ...(margin ?? {}) }}
|
||||||
animate={true}
|
animate
|
||||||
theme={{ ...CHARTS_THEME, ...(theme ?? {}) }}
|
theme={{ ...CHARTS_THEME, ...(theme ?? {}) }}
|
||||||
{...rest}
|
{...rest}
|
||||||
/>
|
/>
|
||||||
|
@ -89,7 +89,7 @@ export const IssueWebViewForm: React.FC<Props> = (props) => {
|
|||||||
setIsSubmitting("submitting");
|
setIsSubmitting("submitting");
|
||||||
debouncedTitleSave();
|
debouncedTitleSave();
|
||||||
}}
|
}}
|
||||||
required={true}
|
required
|
||||||
className="min-h-10 block w-full resize-none overflow-hidden rounded border bg-transparent px-3 py-2 text-xl outline-none ring-0 focus:ring-1 focus:ring-custom-primary"
|
className="min-h-10 block w-full resize-none overflow-hidden rounded border bg-transparent px-3 py-2 text-xl outline-none ring-0 focus:ring-1 focus:ring-custom-primary"
|
||||||
role="textbox"
|
role="textbox"
|
||||||
disabled={!isAllowed}
|
disabled={!isAllowed}
|
||||||
@ -125,7 +125,7 @@ export const IssueWebViewForm: React.FC<Props> = (props) => {
|
|||||||
? "<p></p>"
|
? "<p></p>"
|
||||||
: value
|
: value
|
||||||
}
|
}
|
||||||
debouncedUpdatesEnabled={true}
|
debouncedUpdatesEnabled
|
||||||
setShouldShowAlert={setShowAlert}
|
setShouldShowAlert={setShowAlert}
|
||||||
setIsSubmitting={setIsSubmitting}
|
setIsSubmitting={setIsSubmitting}
|
||||||
customClassName={isAllowed ? "min-h-[150px] shadow-sm" : "!p-0 !pt-2 text-custom-text-200"}
|
customClassName={isAllowed ? "min-h-[150px] shadow-sm" : "!p-0 !pt-2 text-custom-text-200"}
|
||||||
|
@ -338,7 +338,7 @@ const SinglePage: NextPage = () => {
|
|||||||
placeholder="Page Title"
|
placeholder="Page Title"
|
||||||
onBlur={handleSubmit(updatePage)}
|
onBlur={handleSubmit(updatePage)}
|
||||||
onChange={(e) => setValue("name", e.target.value)}
|
onChange={(e) => setValue("name", e.target.value)}
|
||||||
required={true}
|
required
|
||||||
className="min-h-10 block w-full resize-none overflow-hidden rounded border-none bg-transparent !px-3 !py-2 text-xl font-semibold outline-none ring-0"
|
className="min-h-10 block w-full resize-none overflow-hidden rounded border-none bg-transparent !px-3 !py-2 text-xl font-semibold outline-none ring-0"
|
||||||
role="textbox"
|
role="textbox"
|
||||||
/>
|
/>
|
||||||
|
@ -62,7 +62,7 @@ const Editor: NextPage = () => {
|
|||||||
deleteFile={fileService.deleteImage}
|
deleteFile={fileService.deleteImage}
|
||||||
borderOnFocus={false}
|
borderOnFocus={false}
|
||||||
value={!value || value === "" ? "<p></p>" : value}
|
value={!value || value === "" ? "<p></p>" : value}
|
||||||
noBorder={true}
|
noBorder
|
||||||
customClassName="h-full shadow-sm overflow-auto"
|
customClassName="h-full shadow-sm overflow-auto"
|
||||||
editorContentCustomClassNames="pb-9"
|
editorContentCustomClassNames="pb-9"
|
||||||
onChange={(description: Object, description_html: string) => {
|
onChange={(description: Object, description_html: string) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user