Skip to content

Commit

Permalink
[WEB-1028] fix: enable comments and issue reactions for guest/ viewer. (
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekshourya29 authored Apr 18, 2024
1 parent cb9fda8 commit 086d146
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions web/components/issues/issue-detail/main-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -105,6 +106,7 @@ export const IssueMainContent: React.FC<Props> = observer((props) => {
projectId={projectId}
issueId={issueId}
currentUser={currentUser}
disabled={isArchived}
/>
)}

Expand All @@ -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} />
</>
);
});
1 change: 1 addition & 0 deletions web/components/issues/issue-detail/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
issueId={issueId}
issueOperations={issueOperations}
isEditable={!is_archived && isEditable}
isArchived={is_archived}
/>
</div>
<div
Expand Down
5 changes: 3 additions & 2 deletions web/components/issues/peek-overview/issue-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -88,7 +89,7 @@ export const PeekOverviewIssueDetails: FC<IPeekOverviewIssueDetails> = observer(
projectId={issue.project_id}
issueId={issueId}
currentUser={currentUser}
disabled={disabled}
disabled={isArchived}
/>
)}
</div>
Expand Down
6 changes: 4 additions & 2 deletions web/components/issues/peek-overview/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
/>
Expand Down Expand Up @@ -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>
) : (
Expand All @@ -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)}
/>
Expand All @@ -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>
Expand Down

0 comments on commit 086d146

Please sign in to comment.