Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/components/core/views/board-view/single-board.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export const SingleBoard: React.FC<Props> = (props) => {
type={type}
index={index}
issue={issue}
projectId={issue.project_detail.id}
groupTitle={groupTitle}
editIssue={() => handleIssueAction(issue, "edit")}
makeIssueCopy={() => handleIssueAction(issue, "copy")}
Expand Down
7 changes: 6 additions & 1 deletion web/components/core/views/board-view/single-issue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type Props = {
provided: DraggableProvided;
snapshot: DraggableStateSnapshot;
issue: IIssue;
projectId: string;
groupTitle?: string;
index: number;
editIssue: () => void;
Expand All @@ -77,6 +78,7 @@ export const SingleBoardIssue: React.FC<Props> = ({
provided,
snapshot,
issue,
projectId,
index,
editIssue,
makeIssueCopy,
Expand Down Expand Up @@ -104,7 +106,7 @@ export const SingleBoardIssue: React.FC<Props> = ({
const { displayFilters, properties, mutateIssues } = viewProps;

const router = useRouter();
const { workspaceSlug, projectId, cycleId, moduleId } = router.query;
const { workspaceSlug, cycleId, moduleId } = router.query;

const isDraftIssue = router.pathname.includes("draft-issues");

Expand Down Expand Up @@ -452,6 +454,7 @@ export const SingleBoardIssue: React.FC<Props> = ({
<StateSelect
value={issue.state_detail}
onChange={handleStateChange}
projectId={projectId}
hideDropdownArrow
disabled={isNotAllowed}
/>
Expand Down Expand Up @@ -479,6 +482,7 @@ export const SingleBoardIssue: React.FC<Props> = ({
{properties.labels && issue.labels.length > 0 && (
<LabelSelect
value={issue.labels}
projectId={projectId}
onChange={handleLabelChange}
labelsDetails={issue.label_details}
hideDropdownArrow
Expand All @@ -489,6 +493,7 @@ export const SingleBoardIssue: React.FC<Props> = ({
{properties.assignee && (
<MembersSelect
value={issue.assignees}
projectId={projectId}
onChange={handleAssigneeChange}
membersDetails={issue.assignee_details}
hideDropdownArrow
Expand Down
1 change: 1 addition & 0 deletions web/components/core/views/calendar-view/single-date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const SingleCalendarDate: React.FC<Props> = (props) => {
provided={provided}
snapshot={snapshot}
issue={issue}
projectId={issue.project_detail.id}
handleEditIssue={() => handleIssueAction(issue, "edit")}
handleDeleteIssue={() => handleIssueAction(issue, "delete")}
user={user}
Expand Down
7 changes: 6 additions & 1 deletion web/components/core/views/calendar-view/single-issue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type Props = {
provided: DraggableProvided;
snapshot: DraggableStateSnapshot;
issue: IIssue;
projectId: string;
user: ICurrentUserResponse | undefined;
isNotAllowed: boolean;
};
Expand All @@ -52,11 +53,12 @@ export const SingleCalendarIssue: React.FC<Props> = ({
provided,
snapshot,
issue,
projectId,
user,
isNotAllowed,
}) => {
const router = useRouter();
const { workspaceSlug, projectId, cycleId, moduleId, viewId } = router.query;
const { workspaceSlug, cycleId, moduleId, viewId } = router.query;

const { setToastAlert } = useToast();

Expand Down Expand Up @@ -310,6 +312,7 @@ export const SingleCalendarIssue: React.FC<Props> = ({
{properties.state && (
<StateSelect
value={issue.state_detail}
projectId={projectId}
onChange={handleStateChange}
hideDropdownArrow
disabled={isNotAllowed}
Expand All @@ -334,6 +337,7 @@ export const SingleCalendarIssue: React.FC<Props> = ({
{properties.labels && issue.labels.length > 0 && (
<LabelSelect
value={issue.labels}
projectId={projectId}
onChange={handleLabelChange}
labelsDetails={issue.label_details}
hideDropdownArrow
Expand All @@ -345,6 +349,7 @@ export const SingleCalendarIssue: React.FC<Props> = ({
{properties.assignee && (
<MembersSelect
value={issue.assignees}
projectId={projectId}
onChange={handleAssigneeChange}
membersDetails={issue.assignee_details}
hideDropdownArrow
Expand Down
7 changes: 6 additions & 1 deletion web/components/core/views/list-view/single-issue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
type Props = {
type?: string;
issue: IIssue;
projectId: string;
groupTitle?: string;
editIssue: () => void;
index: number;
Expand All @@ -69,6 +70,7 @@ type Props = {
export const SingleListIssue: React.FC<Props> = ({
type,
issue,
projectId,
editIssue,
index,
makeIssueCopy,
Expand All @@ -88,7 +90,7 @@ export const SingleListIssue: React.FC<Props> = ({
const [contextMenuPosition, setContextMenuPosition] = useState<React.MouseEvent | null>(null);

const router = useRouter();
const { workspaceSlug, projectId, cycleId, moduleId, userId } = router.query;
const { workspaceSlug, cycleId, moduleId, userId } = router.query;
const isArchivedIssues = router.pathname.includes("archived-issues");
const isDraftIssues = router.pathname?.split("/")?.[4] === "draft-issues";

Expand Down Expand Up @@ -376,6 +378,7 @@ export const SingleListIssue: React.FC<Props> = ({
{properties.state && (
<StateSelect
value={issue.state_detail}
projectId={projectId}
onChange={handleStateChange}
hideDropdownArrow
disabled={isNotAllowed}
Expand All @@ -400,6 +403,7 @@ export const SingleListIssue: React.FC<Props> = ({
{properties.labels && (
<LabelSelect
value={issue.labels}
projectId={projectId}
onChange={handleLabelChange}
labelsDetails={issue.label_details}
hideDropdownArrow
Expand All @@ -411,6 +415,7 @@ export const SingleListIssue: React.FC<Props> = ({
{properties.assignee && (
<MembersSelect
value={issue.assignees}
projectId={projectId}
onChange={handleAssigneeChange}
membersDetails={issue.assignee_details}
hideDropdownArrow
Expand Down
1 change: 1 addition & 0 deletions web/components/core/views/list-view/single-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export const SingleList: React.FC<Props> = (props) => {
key={issue.id}
type={type}
issue={issue}
projectId={issue.project_detail.id}
groupTitle={groupTitle}
index={index}
editIssue={() => handleIssueAction(issue, "edit")}
Expand Down
17 changes: 8 additions & 9 deletions web/components/core/views/spreadsheet-view/single-issue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import { renderLongDetailDateFormat } from "helpers/date-time.helper";

type Props = {
issue: IIssue;
projectId: string;
index: number;
expanded: boolean;
handleToggleExpand: (issueId: string) => void;
Expand All @@ -64,6 +65,7 @@ type Props = {

export const SingleSpreadsheetIssue: React.FC<Props> = ({
issue,
projectId,
index,
expanded,
handleToggleExpand,
Expand All @@ -80,7 +82,7 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({

const router = useRouter();

const { workspaceSlug, projectId, cycleId, moduleId, viewId } = router.query;
const { workspaceSlug, cycleId, moduleId, viewId } = router.query;

const { params } = useSpreadsheetIssuesView();

Expand All @@ -96,7 +98,7 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({
? MODULE_ISSUES_WITH_PARAMS(moduleId.toString(), params)
: viewId
? VIEW_ISSUES(viewId.toString(), params)
: PROJECT_ISSUES_LIST_WITH_PARAMS(projectId.toString(), params);
: PROJECT_ISSUES_LIST_WITH_PARAMS(projectId, params);

if (issue.parent)
mutate<ISubIssueResponse>(
Expand Down Expand Up @@ -136,13 +138,7 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({
);

issuesService
.patchIssue(
workspaceSlug as string,
projectId as string,
issue.id as string,
formData,
user
)
.patchIssue(workspaceSlug as string, projectId, issue.id as string, formData, user)
.then(() => {
if (issue.parent) {
mutate(SUB_ISSUES(issue.parent as string));
Expand Down Expand Up @@ -368,6 +364,7 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({
<div className="flex items-center text-xs text-custom-text-200 text-center p-2 group-hover:bg-custom-background-80 border-custom-border-200">
<StateSelect
value={issue.state_detail}
projectId={projectId}
onChange={handleStateChange}
buttonClassName="!p-0 !rounded-none !shadow-none !border-0"
hideDropdownArrow
Expand All @@ -390,6 +387,7 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({
<div className="flex items-center text-xs text-custom-text-200 text-center p-2 group-hover:bg-custom-background-80 border-custom-border-200">
<MembersSelect
value={issue.assignees}
projectId={projectId}
onChange={handleAssigneeChange}
membersDetails={issue.assignee_details}
buttonClassName="!p-0 !rounded-none !shadow-none !border-0"
Expand All @@ -402,6 +400,7 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({
<div className="flex items-center text-xs text-custom-text-200 text-center p-2 group-hover:bg-custom-background-80 border-custom-border-200">
<LabelSelect
value={issue.labels}
projectId={projectId}
onChange={handleLabelChange}
labelsDetails={issue.label_details}
hideDropdownArrow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const SpreadsheetIssues: React.FC<Props> = ({
<div>
<SingleSpreadsheetIssue
issue={issue}
projectId={issue.project_detail.id}
index={index}
expanded={isExpanded}
handleToggleExpand={handleToggleExpand}
Expand Down
10 changes: 6 additions & 4 deletions web/components/project/label-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { PROJECT_ISSUE_LABELS } from "constants/fetch-keys";

type Props = {
value: string[];
projectId: string;
onChange: (data: any) => void;
labelsDetails: any[];
className?: string;
Expand All @@ -37,6 +38,7 @@ type Props = {

export const LabelSelect: React.FC<Props> = ({
value,
projectId,
onChange,
labelsDetails,
className = "",
Expand All @@ -54,15 +56,15 @@ export const LabelSelect: React.FC<Props> = ({
const [labelModal, setLabelModal] = useState(false);

const router = useRouter();
const { workspaceSlug, projectId } = router.query;
const { workspaceSlug } = router.query;

const dropdownBtn = useRef<any>(null);
const dropdownOptions = useRef<any>(null);

const { data: issueLabels } = useSWR<IIssueLabels[]>(
projectId && fetchStates ? PROJECT_ISSUE_LABELS(projectId.toString()) : null,
projectId && fetchStates ? PROJECT_ISSUE_LABELS(projectId) : null,
workspaceSlug && projectId && fetchStates
? () => issuesService.getIssueLabels(workspaceSlug as string, projectId as string)
? () => issuesService.getIssueLabels(workspaceSlug as string, projectId)
: null
);

Expand Down Expand Up @@ -150,7 +152,7 @@ export const LabelSelect: React.FC<Props> = ({
<CreateLabelModal
isOpen={labelModal}
handleClose={() => setLabelModal(false)}
projectId={projectId.toString()}
projectId={projectId}
user={user}
/>
)}
Expand Down
6 changes: 4 additions & 2 deletions web/components/project/members-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { IUser } from "types";

type Props = {
value: string | string[];
projectId: string;
onChange: (data: any) => void;
membersDetails: IUser[];
renderWorkspaceMembers?: boolean;
Expand All @@ -30,6 +31,7 @@ type Props = {

export const MembersSelect: React.FC<Props> = ({
value,
projectId,
onChange,
membersDetails,
renderWorkspaceMembers = false,
Expand All @@ -44,14 +46,14 @@ export const MembersSelect: React.FC<Props> = ({
const [fetchStates, setFetchStates] = useState(false);

const router = useRouter();
const { workspaceSlug, projectId } = router.query;
const { workspaceSlug } = router.query;

const dropdownBtn = useRef<any>(null);
const dropdownOptions = useRef<any>(null);

const { members } = useProjectMembers(
workspaceSlug?.toString(),
projectId?.toString(),
projectId,
fetchStates && !renderWorkspaceMembers
);

Expand Down
8 changes: 5 additions & 3 deletions web/components/states/state-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { getStatesList } from "helpers/state.helper";
type Props = {
value: IState;
onChange: (data: any, states: IState[] | undefined) => void;
projectId: string;
className?: string;
buttonClassName?: string;
optionsClassName?: string;
Expand All @@ -35,6 +36,7 @@ type Props = {
export const StateSelect: React.FC<Props> = ({
value,
onChange,
projectId,
className = "",
buttonClassName = "",
optionsClassName = "",
Expand All @@ -50,12 +52,12 @@ export const StateSelect: React.FC<Props> = ({
const [fetchStates, setFetchStates] = useState<boolean>(false);

const router = useRouter();
const { workspaceSlug, projectId } = router.query;
const { workspaceSlug } = router.query;

const { data: stateGroups } = useSWR(
workspaceSlug && projectId && fetchStates ? STATES_LIST(projectId as string) : null,
workspaceSlug && projectId && fetchStates ? STATES_LIST(projectId) : null,
workspaceSlug && projectId && fetchStates
? () => stateService.getStates(workspaceSlug as string, projectId as string)
? () => stateService.getStates(workspaceSlug as string, projectId)
: null
);

Expand Down