mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
style: calender quick-add same width as single date (#2280)
* style: calender quick-add same width as single date * style: margin bottom in quick-add in spreadsheet view * fix: quick add opening in list-layout * style: reduced margin left
This commit is contained in:
parent
a243bb6a15
commit
e00ae0b48a
@ -75,9 +75,7 @@ export const SingleBoard: React.FC<Props> = (props) => {
|
|||||||
|
|
||||||
const isNotAllowed = userAuth.isGuest || userAuth.isViewer || disableUserActions;
|
const isNotAllowed = userAuth.isGuest || userAuth.isViewer || disableUserActions;
|
||||||
|
|
||||||
const onCreateClick = () => {
|
const scrollToBottom = () => {
|
||||||
setIsInlineCreateIssueFormOpen(true);
|
|
||||||
|
|
||||||
const boardListElement = document.getElementById(`board-list-${groupTitle}`);
|
const boardListElement = document.getElementById(`board-list-${groupTitle}`);
|
||||||
|
|
||||||
// timeout is needed because the animation
|
// timeout is needed because the animation
|
||||||
@ -93,6 +91,11 @@ export const SingleBoard: React.FC<Props> = (props) => {
|
|||||||
}, 10);
|
}, 10);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onCreateClick = () => {
|
||||||
|
setIsInlineCreateIssueFormOpen(true);
|
||||||
|
scrollToBottom();
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`flex-shrink-0 ${!isCollapsed ? "" : "flex h-full flex-col w-96"}`}>
|
<div className={`flex-shrink-0 ${!isCollapsed ? "" : "flex h-full flex-col w-96"}`}>
|
||||||
<BoardHeader
|
<BoardHeader
|
||||||
@ -201,6 +204,7 @@ export const SingleBoard: React.FC<Props> = (props) => {
|
|||||||
<BoardInlineCreateIssueForm
|
<BoardInlineCreateIssueForm
|
||||||
isOpen={isInlineCreateIssueFormOpen}
|
isOpen={isInlineCreateIssueFormOpen}
|
||||||
handleClose={() => setIsInlineCreateIssueFormOpen(false)}
|
handleClose={() => setIsInlineCreateIssueFormOpen(false)}
|
||||||
|
onSuccess={() => scrollToBottom()}
|
||||||
prePopulatedData={{
|
prePopulatedData={{
|
||||||
...(cycleId && { cycle: cycleId.toString() }),
|
...(cycleId && { cycle: cycleId.toString() }),
|
||||||
...(moduleId && { module: moduleId.toString() }),
|
...(moduleId && { module: moduleId.toString() }),
|
||||||
|
@ -67,7 +67,7 @@ const InlineInput = () => {
|
|||||||
{...register("name", {
|
{...register("name", {
|
||||||
required: "Issue title is required.",
|
required: "Issue title is required.",
|
||||||
})}
|
})}
|
||||||
className="w-full px-2 py-1.5 rounded-md bg-transparent text-sm font-medium leading-5 text-custom-text-200 outline-none"
|
className="w-full pr-2 py-1.5 rounded-md bg-transparent text-sm font-medium leading-5 text-custom-text-200 outline-none"
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@ -84,13 +84,13 @@ export const CalendarInlineCreateIssueForm: React.FC<Props> = (props) => {
|
|||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={`absolute w-60 top-5 transition-all z-20 ${
|
className={`absolute top-10 transition-all z-20 w-full max-w-[calc(100%-1.25rem)] ${
|
||||||
isOpen ? "opacity-100 scale-100" : "opacity-0 pointer-events-none scale-95"
|
isOpen ? "opacity-100 scale-100" : "opacity-0 pointer-events-none scale-95"
|
||||||
} right-0`}
|
} right-2.5`}
|
||||||
>
|
>
|
||||||
<InlineCreateIssueFormWrapper
|
<InlineCreateIssueFormWrapper
|
||||||
{...props}
|
{...props}
|
||||||
className="flex w-full p-1 px-1.5 rounded z-50 items-center gap-x-3 bg-custom-background-100 shadow-custom-shadow-sm transition-opacity"
|
className="flex w-full p-1 px-1.5 rounded z-50 items-center gap-x-2 bg-custom-background-100 shadow-custom-shadow-sm transition-opacity"
|
||||||
>
|
>
|
||||||
<InlineInput />
|
<InlineInput />
|
||||||
</InlineCreateIssueFormWrapper>
|
</InlineCreateIssueFormWrapper>
|
||||||
|
@ -80,12 +80,7 @@ export const SingleCalendarDate: React.FC<Props> = (props) => {
|
|||||||
)}
|
)}
|
||||||
</Draggable>
|
</Draggable>
|
||||||
))}
|
))}
|
||||||
<div
|
|
||||||
className="fixed top-0 left-0 z-50"
|
|
||||||
style={{
|
|
||||||
transform: `translate(${formPosition.x}px, ${formPosition.y}px)`,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<CalendarInlineCreateIssueForm
|
<CalendarInlineCreateIssueForm
|
||||||
isOpen={isCreateIssueFormOpen}
|
isOpen={isCreateIssueFormOpen}
|
||||||
dependencies={[showWeekEnds]}
|
dependencies={[showWeekEnds]}
|
||||||
@ -96,7 +91,6 @@ export const SingleCalendarDate: React.FC<Props> = (props) => {
|
|||||||
...(moduleId && { module: moduleId.toString() }),
|
...(moduleId && { module: moduleId.toString() }),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
|
|
||||||
{totalIssues > 4 && (
|
{totalIssues > 4 && (
|
||||||
<button
|
<button
|
||||||
|
@ -197,7 +197,7 @@ export const InlineCreateIssueFormWrapper: React.FC<Props> = (props) => {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
mutate(PROJECT_ISSUES_LIST_WITH_PARAMS(projectId.toString(), params));
|
await mutate(PROJECT_ISSUES_LIST_WITH_PARAMS(projectId.toString(), params));
|
||||||
if (formData.cycle && formData.cycle !== "")
|
if (formData.cycle && formData.cycle !== "")
|
||||||
await addIssueToCycle(
|
await addIssueToCycle(
|
||||||
workspaceSlug.toString(),
|
workspaceSlug.toString(),
|
||||||
|
@ -240,7 +240,11 @@ export const SingleList: React.FC<Props> = (props) => {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="p-1 text-custom-text-200 hover:bg-custom-background-80"
|
className="p-1 text-custom-text-200 hover:bg-custom-background-80"
|
||||||
onClick={() => setIsCreateIssueFormOpen(true)}
|
onClick={() => {
|
||||||
|
if (isDraftIssuesPage || isMyIssuesPage || isProfileIssuesPage) {
|
||||||
|
addIssueToGroup();
|
||||||
|
} else setIsCreateIssueFormOpen(true);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<PlusIcon className="h-4 w-4" />
|
<PlusIcon className="h-4 w-4" />
|
||||||
</button>
|
</button>
|
||||||
|
@ -288,6 +288,7 @@ export const SpreadsheetView: React.FC<Props> = ({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
<div className="mb-3 z-50 sticky bottom-0 left-0">
|
||||||
<ListInlineCreateIssueForm
|
<ListInlineCreateIssueForm
|
||||||
isOpen={isInlineCreateIssueFormOpen}
|
isOpen={isInlineCreateIssueFormOpen}
|
||||||
handleClose={() => setIsInlineCreateIssueFormOpen(false)}
|
handleClose={() => setIsInlineCreateIssueFormOpen(false)}
|
||||||
@ -296,6 +297,7 @@ export const SpreadsheetView: React.FC<Props> = ({
|
|||||||
...(moduleId && { module: moduleId.toString() }),
|
...(moduleId && { module: moduleId.toString() }),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
{type === "issue"
|
{type === "issue"
|
||||||
? !disableUserActions &&
|
? !disableUserActions &&
|
||||||
|
Loading…
Reference in New Issue
Block a user