mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +00:00
UBERF-8889: Fix test suite selection (#7454)
Some checks are pending
CI / test (push) Blocked by required conditions
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Some checks are pending
CI / test (push) Blocked by required conditions
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
parent
c9bf99e07f
commit
5b1f0a6c35
@ -104,6 +104,7 @@
|
||||
on:valid
|
||||
on:validate
|
||||
on:submit
|
||||
on:select
|
||||
>
|
||||
<slot />
|
||||
</svelte:component>
|
||||
@ -123,6 +124,7 @@
|
||||
on:valid
|
||||
on:validate
|
||||
on:submit
|
||||
on:select
|
||||
/>
|
||||
{/if}
|
||||
</ErrorBoundary>
|
||||
|
@ -77,12 +77,12 @@
|
||||
titleKey: 'name',
|
||||
parentKey: 'parent',
|
||||
noParentId: testManagement.ids.NoParent,
|
||||
getFolderLink: testManagement.function.GetTestSuiteLink,
|
||||
allObjectsLabel: testManagement.string.AllTestSuites,
|
||||
allObjectsIcon: testManagement.icon.TestSuites,
|
||||
space
|
||||
}}
|
||||
mainComponentProps={{ space }}
|
||||
syncWithLocationQuery={false}
|
||||
{space}
|
||||
/>
|
||||
<svelte:fragment slot="footerRight">
|
||||
|
@ -21,13 +21,18 @@
|
||||
|
||||
import testManagement from '../../plugin'
|
||||
|
||||
export let baseQuery: DocumentQuery<Doc> = {}
|
||||
export let query: DocumentQuery<Doc> = {}
|
||||
let testCases: number
|
||||
|
||||
const query = createQuery()
|
||||
$: query.query(testManagement.class.TestCase, baseQuery, (res) => {
|
||||
testCases = res.length
|
||||
})
|
||||
const docQuery = createQuery()
|
||||
$: docQuery.query(
|
||||
testManagement.class.TestCase,
|
||||
query,
|
||||
(res) => {
|
||||
testCases = res.length
|
||||
},
|
||||
{ total: true, limit: 1 }
|
||||
)
|
||||
|
||||
let viewlet: Viewlet | undefined
|
||||
let preference: ViewletPreference | undefined
|
||||
@ -59,7 +64,7 @@
|
||||
<TableBrowser
|
||||
_class={testManagement.class.TestCase}
|
||||
config={preference?.config ?? viewlet.config}
|
||||
query={baseQuery}
|
||||
{query}
|
||||
loadingProps={{ length: testCases }}
|
||||
enableChecking={true}
|
||||
readonly={true}
|
||||
|
@ -14,6 +14,8 @@
|
||||
-->
|
||||
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
|
||||
import { Class, Doc, DocumentQuery, Ref, SortingOrder } from '@hcengineering/core'
|
||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||
import { Action, IconEdit, navigate, type Location, Scroller, location, getLocation } from '@hcengineering/ui'
|
||||
@ -29,11 +31,13 @@
|
||||
export let titleKey: string = 'title'
|
||||
export let parentKey: string = 'parent'
|
||||
export let noParentId: Ref<Doc>
|
||||
export let getFolderLink: Resource<(doc: Ref<Doc> | undefined) => Location>
|
||||
export let getFolderLink: Resource<(doc: Ref<Doc> | undefined) => Location> | undefined
|
||||
export let allObjectsIcon: Asset
|
||||
export let allObjectsLabel: IntlString
|
||||
export let plainList: boolean = false
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
const getFolderId = (): Ref<Doc> => {
|
||||
return (getLocation()?.query?.attachedTo as Ref<Doc>) ?? noParentId
|
||||
}
|
||||
@ -77,8 +81,13 @@
|
||||
)
|
||||
|
||||
async function handleFolderSelected (_id: Ref<Doc>): Promise<void> {
|
||||
const getFolderLinkFunction = await getResource(getFolderLink)
|
||||
navigate(getFolderLinkFunction(_id))
|
||||
if (getFolderLink !== undefined) {
|
||||
const getFolderLinkFunction = await getResource(getFolderLink)
|
||||
navigate(getFolderLinkFunction(_id))
|
||||
} else {
|
||||
selected = _id
|
||||
}
|
||||
dispatch('select', _id)
|
||||
}
|
||||
|
||||
async function handleAllItemsSelected (): Promise<void> {
|
||||
|
@ -53,25 +53,31 @@
|
||||
export let mainComponent: AnyComponent | AnySvelteComponent
|
||||
export let mainComponentProps = {}
|
||||
export let showNavigator: boolean = false
|
||||
export let parentKey: string = 'attachedTo'
|
||||
|
||||
const FLOAT_LIMIT = 760
|
||||
let container: HTMLDivElement
|
||||
|
||||
let locationQuery: DocumentQuery<Doc> = {}
|
||||
let parentQuery: DocumentQuery<Doc> = {}
|
||||
let resultQuery: DocumentQuery<Doc> = {}
|
||||
let spaceQuery: DocumentQuery<Doc> = {}
|
||||
$: spaceQuery = space !== undefined ? { space } : {}
|
||||
$: resultQuery = mergeQueries(query, mergeQueries(spaceQuery, locationQuery)) ?? {}
|
||||
$: resultQuery = mergeQueries(query, mergeQueries(spaceQuery, parentQuery)) ?? {}
|
||||
|
||||
if (syncWithLocationQuery) {
|
||||
locationQuery = getLocation()?.query as any
|
||||
parentQuery = getLocation()?.query as any
|
||||
onDestroy(
|
||||
resolvedLocationStore.subscribe((newLocation) => {
|
||||
locationQuery = newLocation?.query ?? {}
|
||||
parentQuery = newLocation?.query ?? {}
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
function onSelected (e: CustomEvent<any>): void {
|
||||
if (syncWithLocationQuery) return
|
||||
parentQuery = { [parentKey]: e.detail }
|
||||
}
|
||||
|
||||
function showCreateDialog (): void {
|
||||
if (createComponent === undefined) return
|
||||
showPopup(createComponent, { ...createComponentProps, space }, 'top')
|
||||
@ -147,6 +153,7 @@
|
||||
...navigationComponentProps,
|
||||
query: spaceQuery
|
||||
}}
|
||||
on:select={onSelected}
|
||||
/>
|
||||
</div>
|
||||
<Separator
|
||||
|
Loading…
Reference in New Issue
Block a user