Refactor editor content handling and introduce EditorContent type in IssueModal components #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type
enhancement, bug_fix
Description
EditorContent
type to standardize the state shape of editor content across various components.IssueComment
,IssueComments
, andIssueDescription
components to use the newEditorContent
type for state management.IssueComment
andIssueComments
to be asynchronous and return aPromise<FetchResult>
.selectedIssueId
oreditorContent
is undefined).PR changes walkthrough
4 files
IssueComment.tsx
frontend/components/IssueModal/IssueComment.tsx
- Introduced state typing for
- Added
**- Added imports for
FetchResult
andEditorContent
.Updated the
handleDeleteIssueComment
andhandleUpdateIssueComment
functions to return aPromise<FetchResult<any>>
.editorContent
using theEditorContent
type.checks to prevent function execution when
selectedCommentId
orcomment
is undefined.**IssueComments.tsx
frontend/components/IssueModal/IssueComments.tsx
- Added checks to prevent function
- Introduced state typing for
**- Added import for
FetchResult
andEditorContent
.Updated
handleCreateIssueComment
,handleDeleteIssueComment
, andhandleUpdateIssueComment
functions to be asynchronous and return a
Promise<FetchResult>
.execution when
selectedIssueId
oreditorContent
isundefined.
editorContent
using the
EditorContent
type.**IssueDescription.tsx
frontend/components/IssueModal/IssueDescription.tsx
- Introduced state
**- Added import for
EditorContent
.typing for
editorContent
using theEditorContent
type.Added a check to prevent function execution when
selectedIssueId
oreditorContent
is undefined.**types.ts
frontend/constants/types.ts
- Added
**- Removed
IssueItems
andComment
types.EditorContent
type to standardize the state shape ofeditor content.**