mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: allow guests/ viewers to comment. (#3515)
This commit is contained in:
parent
f0836ceb10
commit
c9d2ea36b8
@ -79,7 +79,7 @@ export const InboxIssueMainContent: React.FC<Props> = observer((props) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="pb-12">
|
<div className="pb-12">
|
||||||
<IssueActivity workspaceSlug={workspaceSlug} projectId={projectId} issueId={issueId} disabled={!is_editable} />
|
<IssueActivity workspaceSlug={workspaceSlug} projectId={projectId} issueId={issueId} />
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -17,7 +17,6 @@ const fileService = new FileService();
|
|||||||
type TIssueCommentCreate = {
|
type TIssueCommentCreate = {
|
||||||
workspaceSlug: string;
|
workspaceSlug: string;
|
||||||
activityOperations: TActivityOperations;
|
activityOperations: TActivityOperations;
|
||||||
disabled: boolean;
|
|
||||||
showAccessSpecifier?: boolean;
|
showAccessSpecifier?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -40,7 +39,7 @@ const commentAccess: commentAccessType[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const IssueCommentCreate: FC<TIssueCommentCreate> = (props) => {
|
export const IssueCommentCreate: FC<TIssueCommentCreate> = (props) => {
|
||||||
const { workspaceSlug, activityOperations, disabled, showAccessSpecifier = false } = props;
|
const { workspaceSlug, activityOperations, showAccessSpecifier = false } = props;
|
||||||
const workspaceStore = useWorkspace();
|
const workspaceStore = useWorkspace();
|
||||||
const workspaceId = workspaceStore.getWorkspaceBySlug(workspaceSlug as string)?.id as string;
|
const workspaceId = workspaceStore.getWorkspaceBySlug(workspaceSlug as string)?.id as string;
|
||||||
|
|
||||||
@ -94,7 +93,7 @@ export const IssueCommentCreate: FC<TIssueCommentCreate> = (props) => {
|
|||||||
}
|
}
|
||||||
submitButton={
|
submitButton={
|
||||||
<Button
|
<Button
|
||||||
disabled={isSubmitting || disabled}
|
disabled={isSubmitting}
|
||||||
variant="primary"
|
variant="primary"
|
||||||
type="submit"
|
type="submit"
|
||||||
className="!px-2.5 !py-1.5 !text-xs"
|
className="!px-2.5 !py-1.5 !text-xs"
|
||||||
|
@ -13,7 +13,6 @@ type TIssueActivity = {
|
|||||||
workspaceSlug: string;
|
workspaceSlug: string;
|
||||||
projectId: string;
|
projectId: string;
|
||||||
issueId: string;
|
issueId: string;
|
||||||
disabled: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type TActivityTabs = "all" | "activity" | "comments";
|
type TActivityTabs = "all" | "activity" | "comments";
|
||||||
@ -43,7 +42,7 @@ export type TActivityOperations = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const IssueActivity: FC<TIssueActivity> = observer((props) => {
|
export const IssueActivity: FC<TIssueActivity> = observer((props) => {
|
||||||
const { workspaceSlug, projectId, issueId, disabled } = props;
|
const { workspaceSlug, projectId, issueId } = props;
|
||||||
// hooks
|
// hooks
|
||||||
const { createComment, updateComment, removeComment } = useIssueDetail();
|
const { createComment, updateComment, removeComment } = useIssueDetail();
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
@ -147,14 +146,11 @@ export const IssueActivity: FC<TIssueActivity> = observer((props) => {
|
|||||||
activityOperations={activityOperations}
|
activityOperations={activityOperations}
|
||||||
showAccessSpecifier={project.is_deployed}
|
showAccessSpecifier={project.is_deployed}
|
||||||
/>
|
/>
|
||||||
{!disabled && (
|
|
||||||
<IssueCommentCreate
|
<IssueCommentCreate
|
||||||
workspaceSlug={workspaceSlug}
|
workspaceSlug={workspaceSlug}
|
||||||
activityOperations={activityOperations}
|
activityOperations={activityOperations}
|
||||||
disabled={disabled}
|
|
||||||
showAccessSpecifier={project.is_deployed}
|
showAccessSpecifier={project.is_deployed}
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
) : activityTab === "activity" ? (
|
) : activityTab === "activity" ? (
|
||||||
<IssueActivityRoot issueId={issueId} />
|
<IssueActivityRoot issueId={issueId} />
|
||||||
@ -166,14 +162,11 @@ export const IssueActivity: FC<TIssueActivity> = observer((props) => {
|
|||||||
activityOperations={activityOperations}
|
activityOperations={activityOperations}
|
||||||
showAccessSpecifier={project.is_deployed}
|
showAccessSpecifier={project.is_deployed}
|
||||||
/>
|
/>
|
||||||
{!disabled && (
|
|
||||||
<IssueCommentCreate
|
<IssueCommentCreate
|
||||||
workspaceSlug={workspaceSlug}
|
workspaceSlug={workspaceSlug}
|
||||||
activityOperations={activityOperations}
|
activityOperations={activityOperations}
|
||||||
disabled={disabled}
|
|
||||||
showAccessSpecifier={project.is_deployed}
|
showAccessSpecifier={project.is_deployed}
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -99,7 +99,7 @@ export const IssueMainContent: React.FC<Props> = observer((props) => {
|
|||||||
disabled={!is_editable}
|
disabled={!is_editable}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<IssueActivity workspaceSlug={workspaceSlug} projectId={projectId} issueId={issueId} disabled={!is_editable} />
|
<IssueActivity workspaceSlug={workspaceSlug} projectId={projectId} issueId={issueId} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -234,7 +234,6 @@ export const IssueView: FC<IIssueView> = observer((props) => {
|
|||||||
workspaceSlug={workspaceSlug}
|
workspaceSlug={workspaceSlug}
|
||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
issueId={issueId}
|
issueId={issueId}
|
||||||
disabled={disabled}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
@ -255,7 +254,6 @@ export const IssueView: FC<IIssueView> = observer((props) => {
|
|||||||
workspaceSlug={workspaceSlug}
|
workspaceSlug={workspaceSlug}
|
||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
issueId={issueId}
|
issueId={issueId}
|
||||||
disabled={disabled}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user