forked from github/plane
[WEB-1028] fix: enable comments and issue reactions for guest/ viewer. (#4231)
This commit is contained in:
parent
cb9fda8557
commit
086d14609c
@ -24,11 +24,12 @@ type Props = {
|
||||
issueId: string;
|
||||
issueOperations: TIssueOperations;
|
||||
isEditable: boolean;
|
||||
isArchived: boolean;
|
||||
swrIssueDetails: TIssue | null | undefined;
|
||||
};
|
||||
|
||||
export const IssueMainContent: React.FC<Props> = observer((props) => {
|
||||
const { workspaceSlug, projectId, issueId, issueOperations, isEditable, swrIssueDetails } = props;
|
||||
const { workspaceSlug, projectId, issueId, issueOperations, isEditable, isArchived, swrIssueDetails } = props;
|
||||
// states
|
||||
const [isSubmitting, setIsSubmitting] = useState<"submitting" | "submitted" | "saved">("saved");
|
||||
// hooks
|
||||
@ -105,6 +106,7 @@ export const IssueMainContent: React.FC<Props> = observer((props) => {
|
||||
projectId={projectId}
|
||||
issueId={issueId}
|
||||
currentUser={currentUser}
|
||||
disabled={isArchived}
|
||||
/>
|
||||
)}
|
||||
|
||||
@ -126,7 +128,7 @@ export const IssueMainContent: React.FC<Props> = observer((props) => {
|
||||
disabled={!isEditable}
|
||||
/>
|
||||
|
||||
<IssueActivity workspaceSlug={workspaceSlug} projectId={projectId} issueId={issueId} disabled={!isEditable} />
|
||||
<IssueActivity workspaceSlug={workspaceSlug} projectId={projectId} issueId={issueId} disabled={isArchived} />
|
||||
</>
|
||||
);
|
||||
});
|
||||
|
@ -365,6 +365,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
|
||||
issueId={issueId}
|
||||
issueOperations={issueOperations}
|
||||
isEditable={!is_archived && isEditable}
|
||||
isArchived={is_archived}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
|
@ -16,12 +16,13 @@ interface IPeekOverviewIssueDetails {
|
||||
issueId: string;
|
||||
issueOperations: TIssueOperations;
|
||||
disabled: boolean;
|
||||
isArchived: boolean;
|
||||
isSubmitting: "submitting" | "submitted" | "saved";
|
||||
setIsSubmitting: (value: "submitting" | "submitted" | "saved") => void;
|
||||
}
|
||||
|
||||
export const PeekOverviewIssueDetails: FC<IPeekOverviewIssueDetails> = observer((props) => {
|
||||
const { workspaceSlug, issueId, issueOperations, disabled, isSubmitting, setIsSubmitting } = props;
|
||||
const { workspaceSlug, issueId, issueOperations, disabled, isArchived, isSubmitting, setIsSubmitting } = props;
|
||||
// store hooks
|
||||
const { getProjectById } = useProject();
|
||||
const { currentUser } = useUser();
|
||||
@ -88,7 +89,7 @@ export const PeekOverviewIssueDetails: FC<IPeekOverviewIssueDetails> = observer(
|
||||
projectId={issue.project_id}
|
||||
issueId={issueId}
|
||||
currentUser={currentUser}
|
||||
disabled={disabled}
|
||||
disabled={isArchived}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
@ -157,6 +157,7 @@ export const IssueView: FC<IIssueView> = observer((props) => {
|
||||
issueId={issueId}
|
||||
issueOperations={issueOperations}
|
||||
disabled={disabled || is_archived}
|
||||
isArchived={is_archived}
|
||||
isSubmitting={isSubmitting}
|
||||
setIsSubmitting={(value) => setIsSubmitting(value)}
|
||||
/>
|
||||
@ -190,7 +191,7 @@ export const IssueView: FC<IIssueView> = observer((props) => {
|
||||
workspaceSlug={workspaceSlug}
|
||||
projectId={projectId}
|
||||
issueId={issueId}
|
||||
disabled={disabled || is_archived}
|
||||
disabled={is_archived}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
@ -203,6 +204,7 @@ export const IssueView: FC<IIssueView> = observer((props) => {
|
||||
issueId={issueId}
|
||||
issueOperations={issueOperations}
|
||||
disabled={disabled || is_archived}
|
||||
isArchived={is_archived}
|
||||
isSubmitting={isSubmitting}
|
||||
setIsSubmitting={(value) => setIsSubmitting(value)}
|
||||
/>
|
||||
@ -228,7 +230,7 @@ export const IssueView: FC<IIssueView> = observer((props) => {
|
||||
workspaceSlug={workspaceSlug}
|
||||
projectId={projectId}
|
||||
issueId={issueId}
|
||||
disabled={disabled || is_archived}
|
||||
disabled={is_archived}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user