2021-03-11 19:13:27 +05:30
|
|
|
import { ASC } from '../../constants';
|
2018-11-08 19:23:39 +05:30
|
|
|
import * as actions from '../actions';
|
|
|
|
import * as getters from '../getters';
|
|
|
|
import mutations from '../mutations';
|
|
|
|
|
2018-12-05 23:21:45 +05:30
|
|
|
export default () => ({
|
2018-11-08 19:23:39 +05:30
|
|
|
state: {
|
|
|
|
discussions: [],
|
2020-04-22 19:07:51 +05:30
|
|
|
discussionSortOrder: ASC,
|
2021-01-03 14:25:43 +05:30
|
|
|
persistSortOrder: true,
|
2019-07-07 11:18:12 +05:30
|
|
|
convertedDisscussionIds: [],
|
2018-11-08 19:23:39 +05:30
|
|
|
targetNoteHash: null,
|
|
|
|
lastFetchedAt: null,
|
2020-03-13 15:44:24 +05:30
|
|
|
currentDiscussionId: null,
|
2020-06-23 00:09:42 +05:30
|
|
|
batchSuggestionsInfo: [],
|
2020-11-24 15:15:51 +05:30
|
|
|
currentlyFetchingDiscussions: false,
|
2022-07-23 23:45:48 +05:30
|
|
|
doneFetchingBatchDiscussions: false,
|
2020-07-28 23:09:34 +05:30
|
|
|
/**
|
2021-03-08 18:12:59 +05:30
|
|
|
* selectedCommentPosition & selectedCommentPositionHover structures are the same as `position.line_range`:
|
2020-07-28 23:09:34 +05:30
|
|
|
* {
|
|
|
|
* start: { line_code: string, new_line: number, old_line:number, type: string },
|
|
|
|
* end: { line_code: string, new_line: number, old_line:number, type: string },
|
|
|
|
* }
|
|
|
|
*/
|
|
|
|
selectedCommentPosition: null,
|
|
|
|
selectedCommentPositionHover: null,
|
2018-11-08 19:23:39 +05:30
|
|
|
|
|
|
|
// View layer
|
|
|
|
isToggleStateButtonLoading: false,
|
|
|
|
isNotesFetched: false,
|
2018-12-13 13:39:08 +05:30
|
|
|
isLoading: true,
|
2020-03-13 15:44:24 +05:30
|
|
|
isLoadingDescriptionVersion: false,
|
2018-11-08 19:23:39 +05:30
|
|
|
|
|
|
|
// holds endpoints and permissions provided through haml
|
|
|
|
notesData: {
|
|
|
|
markdownDocsPath: '',
|
|
|
|
},
|
|
|
|
userData: {},
|
|
|
|
noteableData: {
|
2020-07-28 23:09:34 +05:30
|
|
|
discussion_locked: false,
|
2020-05-24 23:13:21 +05:30
|
|
|
confidential: false, // TODO: Move data like this to Issue Store, should not be apart of notes.
|
2018-11-08 19:23:39 +05:30
|
|
|
current_user: {},
|
2019-02-15 15:39:39 +05:30
|
|
|
preview_note_path: 'path/to/preview',
|
2018-11-08 19:23:39 +05:30
|
|
|
},
|
2021-02-22 17:27:13 +05:30
|
|
|
isResolvingDiscussion: false,
|
2018-12-13 13:39:08 +05:30
|
|
|
commentsDisabled: false,
|
2019-02-15 15:39:39 +05:30
|
|
|
resolvableDiscussionsCount: 0,
|
|
|
|
unresolvedDiscussionsCount: 0,
|
2020-04-08 14:13:33 +05:30
|
|
|
descriptionVersions: {},
|
2021-01-03 14:25:43 +05:30
|
|
|
isTimelineEnabled: false,
|
2021-03-11 19:13:27 +05:30
|
|
|
isFetching: false,
|
2018-11-08 19:23:39 +05:30
|
|
|
},
|
|
|
|
actions,
|
|
|
|
getters,
|
|
|
|
mutations,
|
2018-12-05 23:21:45 +05:30
|
|
|
});
|