[WEB-2907] chore: issue store updated and code refactor (#6279)
* chore: issue and epic store updated and code refactor * chore: layout ux copy updated
This commit is contained in:
parent
36b3328c5e
commit
756a71ca78
18 changed files with 71 additions and 50 deletions
|
|
@ -30,10 +30,11 @@ export type TQuickAddIssueFormRoot = {
|
|||
register: UseFormRegister<TIssue>;
|
||||
onSubmit: () => void;
|
||||
onClose: () => void;
|
||||
isEpic: boolean;
|
||||
};
|
||||
|
||||
export const QuickAddIssueFormRoot: FC<TQuickAddIssueFormRoot> = observer((props) => {
|
||||
const { isOpen, layout, projectId, hasError = false, setFocus, register, onSubmit, onClose } = props;
|
||||
const { isOpen, layout, projectId, hasError = false, setFocus, register, onSubmit, onClose, isEpic } = props;
|
||||
// store hooks
|
||||
const { getProjectById } = useProject();
|
||||
// derived values
|
||||
|
|
@ -70,6 +71,7 @@ export const QuickAddIssueFormRoot: FC<TQuickAddIssueFormRoot> = observer((props
|
|||
hasError={hasError}
|
||||
register={register}
|
||||
onSubmit={onSubmit}
|
||||
isEpic={isEpic}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -93,10 +93,11 @@ export class IssueActivityStore implements IIssueActivityStore {
|
|||
|
||||
let activityComments: TIssueActivityComment[] = [];
|
||||
|
||||
const currentStore = this.serviceType === EIssueServiceType.EPICS ? this.store.epic : this.store.issue;
|
||||
const currentStore =
|
||||
this.serviceType === EIssueServiceType.EPICS ? this.store.issue.epicDetail : this.store.issue.issueDetail;
|
||||
|
||||
const activities = this.getActivitiesByIssueId(issueId) || [];
|
||||
const comments = currentStore.issueDetail.comment.getCommentsByIssueId(issueId) || [];
|
||||
const comments = currentStore.comment.getCommentsByIssueId(issueId) || [];
|
||||
|
||||
activities.forEach((activityId) => {
|
||||
const activity = this.getActivityById(activityId);
|
||||
|
|
@ -109,7 +110,7 @@ export class IssueActivityStore implements IIssueActivityStore {
|
|||
});
|
||||
|
||||
comments.forEach((commentId) => {
|
||||
const comment = currentStore.issueDetail.comment.getCommentById(commentId);
|
||||
const comment = currentStore.comment.getCommentById(commentId);
|
||||
if (!comment) return;
|
||||
activityComments.push({
|
||||
id: comment.id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue