mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-16 12:32:19 +00:00
PLATF-8339: Allow test project editing (#8350)
* PLATF-8339: Support test project editing Signed-off-by: Artem Savchenko <armisav@gmail.com> --------- Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
parent
f6860b4323
commit
ad3db6a65b
@ -24,6 +24,7 @@ import workbench from '@hcengineering/model-workbench'
|
|||||||
import print from '@hcengineering/model-print'
|
import print from '@hcengineering/model-print'
|
||||||
import tracker from '@hcengineering/model-tracker'
|
import tracker from '@hcengineering/model-tracker'
|
||||||
import { type ViewOptionsModel } from '@hcengineering/view'
|
import { type ViewOptionsModel } from '@hcengineering/view'
|
||||||
|
import contact from '@hcengineering/contact'
|
||||||
|
|
||||||
import { testManagementId, type TestPlanItem, type TestResult } from '@hcengineering/test-management'
|
import { testManagementId, type TestPlanItem, type TestResult } from '@hcengineering/test-management'
|
||||||
|
|
||||||
@ -336,6 +337,25 @@ function defineTestSuite (builder: Builder): void {
|
|||||||
},
|
},
|
||||||
testManagement.action.RunSelectedTests
|
testManagement.action.RunSelectedTests
|
||||||
)
|
)
|
||||||
|
|
||||||
|
createAction(
|
||||||
|
builder,
|
||||||
|
{
|
||||||
|
action: testManagement.actionImpl.EditProject,
|
||||||
|
label: testManagement.string.EditProject,
|
||||||
|
icon: contact.icon.Edit,
|
||||||
|
input: 'focus',
|
||||||
|
category: testManagement.category.TestProject,
|
||||||
|
target: testManagement.class.TestProject,
|
||||||
|
visibilityTester: view.function.CanEditSpace,
|
||||||
|
query: {},
|
||||||
|
context: {
|
||||||
|
mode: ['context', 'browser'],
|
||||||
|
group: 'edit'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
testManagement.action.EditProject
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function defineTestCase (builder: Builder): void {
|
function defineTestCase (builder: Builder): void {
|
||||||
|
@ -24,7 +24,8 @@ export default mergeIds(testManagementId, testManganement, {
|
|||||||
category: {
|
category: {
|
||||||
TestSuite: '' as Ref<ActionCategory>,
|
TestSuite: '' as Ref<ActionCategory>,
|
||||||
TestCase: '' as Ref<ActionCategory>,
|
TestCase: '' as Ref<ActionCategory>,
|
||||||
TestResult: '' as Ref<ActionCategory>
|
TestResult: '' as Ref<ActionCategory>,
|
||||||
|
TestProject: '' as Ref<ActionCategory>
|
||||||
},
|
},
|
||||||
component: {
|
component: {
|
||||||
CreateTestCase: '' as AnyComponent,
|
CreateTestCase: '' as AnyComponent,
|
||||||
|
@ -114,6 +114,7 @@
|
|||||||
description,
|
description,
|
||||||
private: isPrivate,
|
private: isPrivate,
|
||||||
icon,
|
icon,
|
||||||
|
color,
|
||||||
members,
|
members,
|
||||||
owners,
|
owners,
|
||||||
archived: false
|
archived: false
|
||||||
@ -139,6 +140,9 @@
|
|||||||
if (data.icon !== project?.icon) {
|
if (data.icon !== project?.icon) {
|
||||||
update.icon = data.icon
|
update.icon = data.icon
|
||||||
}
|
}
|
||||||
|
if (data.color !== project?.color && isColorSelected) {
|
||||||
|
update.color = data.color
|
||||||
|
}
|
||||||
if (data.members.length !== project?.members.length) {
|
if (data.members.length !== project?.members.length) {
|
||||||
update.members = data.members
|
update.members = data.members
|
||||||
} else {
|
} else {
|
||||||
|
@ -45,7 +45,7 @@ import TestPlanItemPresenter from './components/test-plan/TestPlanItemPresenter.
|
|||||||
import CreateTestRunButton from './components/test-run/CreateTestRunButton.svelte'
|
import CreateTestRunButton from './components/test-run/CreateTestRunButton.svelte'
|
||||||
import RunTestPlanButton from './components/test-plan/RunTestPlanButton.svelte'
|
import RunTestPlanButton from './components/test-plan/RunTestPlanButton.svelte'
|
||||||
|
|
||||||
import { CreateChildTestSuiteAction, EditTestSuiteAction, RunSelectedTestsAction } from './utils'
|
import { CreateChildTestSuiteAction, EditTestSuiteAction, RunSelectedTestsAction, EditProjectAction } from './utils'
|
||||||
import { resolveLocation, getAttachedObjectLink } from './navigation'
|
import { resolveLocation, getAttachedObjectLink } from './navigation'
|
||||||
|
|
||||||
export default async (): Promise<Resources> => ({
|
export default async (): Promise<Resources> => ({
|
||||||
@ -92,6 +92,7 @@ export default async (): Promise<Resources> => ({
|
|||||||
actionImpl: {
|
actionImpl: {
|
||||||
CreateChildTestSuite: CreateChildTestSuiteAction,
|
CreateChildTestSuite: CreateChildTestSuiteAction,
|
||||||
EditTestSuite: EditTestSuiteAction,
|
EditTestSuite: EditTestSuiteAction,
|
||||||
RunSelectedTests: RunSelectedTestsAction
|
RunSelectedTests: RunSelectedTestsAction,
|
||||||
|
EditProject: EditProjectAction
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -128,3 +128,9 @@ export async function RunSelectedTestsAction (docs: TestCase[] | TestCase): Prom
|
|||||||
console.error('No test cases selected')
|
console.error('No test cases selected')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function EditProjectAction (project: TestProject | undefined): Promise<void> {
|
||||||
|
if (project !== undefined) {
|
||||||
|
showPopup(CreateProject, { project })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -55,12 +55,14 @@ export const testManagementPlugin = plugin(testManagementId, {
|
|||||||
DeleteTestCase: '' as Ref<Action<Doc, any>>,
|
DeleteTestCase: '' as Ref<Action<Doc, any>>,
|
||||||
CreateChildTestSuite: '' as Ref<Action>,
|
CreateChildTestSuite: '' as Ref<Action>,
|
||||||
EditTestSuite: '' as Ref<Action>,
|
EditTestSuite: '' as Ref<Action>,
|
||||||
RunSelectedTests: '' as Ref<Action>
|
RunSelectedTests: '' as Ref<Action>,
|
||||||
|
EditProject: '' as Ref<Action>
|
||||||
},
|
},
|
||||||
actionImpl: {
|
actionImpl: {
|
||||||
CreateChildTestSuite: '' as ViewAction,
|
CreateChildTestSuite: '' as ViewAction,
|
||||||
EditTestSuite: '' as ViewAction,
|
EditTestSuite: '' as ViewAction,
|
||||||
RunSelectedTests: '' as ViewAction
|
RunSelectedTests: '' as ViewAction,
|
||||||
|
EditProject: '' as ViewAction
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
TestManagement: '' as Asset,
|
TestManagement: '' as Asset,
|
||||||
|
Loading…
Reference in New Issue
Block a user