mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 00:57:45 +00:00
refactor(tasks): colocate GitLab task-page loading (#31907)
This commit is contained in:
@@ -13,7 +13,7 @@ import { useTaskPageLinearViewState } from '../use-task-page-linear-view-state'
|
||||
import { useTaskPageJiraListState } from '../use-task-page-jira-list-state'
|
||||
import { useTaskPageResumeRestoration } from '../use-task-page-resume-restoration'
|
||||
import { useTaskPageProviderMetadata } from '../use-task-page-provider-metadata'
|
||||
import { useTaskPageGitLabLoading } from '../use-task-page-gitlab-loading'
|
||||
import { useTaskPageGitLabLoading } from './gitlab/use-task-page-gitlab-loading'
|
||||
import { useTaskPageLinearListSelection } from '../use-task-page-linear-list-selection'
|
||||
import { useTaskPageLinearListProjection } from '../use-task-page-linear-list-projection'
|
||||
import { useTaskPageLinearBoard } from '../use-task-page-linear-board'
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it, afterEach, vi } from 'vitest'
|
||||
import { isGitLabIssueFilter, isGitLabMRFilter } from './task-page-source-context'
|
||||
import { isGitLabIssueFilter, isGitLabMRFilter } from '../../task-page-source-context'
|
||||
|
||||
describe('isGitLabMRFilter', () => {
|
||||
it('accepts MR statuses including all', () => {
|
||||
@@ -33,7 +33,7 @@ const { rejectAppStoreAccess } = vi.hoisted(() => ({
|
||||
})
|
||||
}))
|
||||
|
||||
vi.mock('@/store', () => ({
|
||||
vi.mock('@/store/index', () => ({
|
||||
useAppStore: Object.assign(rejectAppStoreAccess, {
|
||||
getState: rejectAppStoreAccess,
|
||||
getInitialState: rejectAppStoreAccess,
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
import { cleanup, renderHook, waitFor } from '@testing-library/react'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { Repo } from '../../../shared/repo-types'
|
||||
import type { Repo } from '../../../../../shared/repo-types'
|
||||
|
||||
const rpc = vi.hoisted(() => ({ call: vi.fn() }))
|
||||
|
||||
+7
-8
@@ -1,16 +1,16 @@
|
||||
import type { TaskPageProviderMetadataModel } from './use-task-page-provider-metadata'
|
||||
import type { TaskPageProviderMetadataModel } from '../../use-task-page-provider-metadata'
|
||||
import { useEffect } from 'react'
|
||||
import { gitLabApiFor } from '@/runtime/gitlab-owner-api'
|
||||
import { mapSettledWithConcurrency } from '../../../shared/map-with-concurrency'
|
||||
import type { Repo } from '../../../shared/repo-types'
|
||||
import { getRepoExecutionHostId } from '../../../shared/execution-host'
|
||||
import type { GitLabDialogRepoSelector } from './gitlab-item-dialog/gitlab-item-dialog-types'
|
||||
import type { GitLabWorkItem, GitLabTodo } from '../../../shared/gitlab-types'
|
||||
import { mapSettledWithConcurrency } from '../../../../../shared/map-with-concurrency'
|
||||
import type { Repo } from '../../../../../shared/repo-types'
|
||||
import { getRepoExecutionHostId } from '../../../../../shared/execution-host'
|
||||
import type { GitLabDialogRepoSelector } from '../../gitlab-item-dialog/gitlab-item-dialog-types'
|
||||
import type { GitLabWorkItem, GitLabTodo } from '../../../../../shared/gitlab-types'
|
||||
import {
|
||||
getTaskPageRepoSourceContext,
|
||||
isGitLabIssueFilter,
|
||||
isGitLabMRFilter
|
||||
} from './task-page-source-context'
|
||||
} from '../../task-page-source-context'
|
||||
|
||||
// Why: "All projects" fans out one list call per repo; staying below the runtime RPC queue's
|
||||
// foreground concurrency (8) leaves headroom for other callers on the same selector, such as the sidebar.
|
||||
@@ -228,4 +228,3 @@ export function useTaskPageGitLabLoading<Model extends GitLabLoadingInput>(model
|
||||
])
|
||||
return model
|
||||
}
|
||||
export type TaskPageGitLabLoadingModel = TaskPageProviderMetadataModel
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { TaskPageGitLabLoadingModel } from './use-task-page-gitlab-loading'
|
||||
import type { TaskPageProviderMetadataModel } from './use-task-page-provider-metadata'
|
||||
import { useState, useMemo, useEffect } from 'react'
|
||||
import { LINEAR_ISSUE_LIST_MAX } from '../../../shared/linear/issue-read-limits'
|
||||
import { findTaskPageLinearIssue } from '@/components/task-page-cache-selectors'
|
||||
@@ -15,7 +15,7 @@ import { useTaskPageLinearFilterSelection } from './use-task-page-linear-filter-
|
||||
export type TaskPageLinearListSelectionPreludeModel = ReturnType<
|
||||
typeof useTaskPageLinearListSelectionPrelude
|
||||
>
|
||||
export function useTaskPageLinearListSelectionPrelude(model: TaskPageGitLabLoadingModel) {
|
||||
export function useTaskPageLinearListSelectionPrelude(model: TaskPageProviderMetadataModel) {
|
||||
const {
|
||||
settings,
|
||||
linearStatus,
|
||||
@@ -241,7 +241,7 @@ export function useTaskPageLinearListSelectionPrelude(model: TaskPageGitLabLoadi
|
||||
nextModel.linearTeamOptions = linearTeamOptions
|
||||
return nextModel
|
||||
}
|
||||
export function useTaskPageLinearListSelection(model: TaskPageGitLabLoadingModel) {
|
||||
export function useTaskPageLinearListSelection(model: TaskPageProviderMetadataModel) {
|
||||
const preludeModel = useTaskPageLinearListSelectionPrelude(model)
|
||||
return useTaskPageLinearFilterSelection(preludeModel)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user