Skip to content

Commit

Permalink
Fix auto test scene filetree edit scene (#3199) (#3200)
Browse files Browse the repository at this point in the history
Co-authored-by: shuofan <fanshuo2015@gmail.com>
  • Loading branch information
erda-bot and shuofan authored Nov 26, 2021
1 parent d2a63b3 commit 44ef461
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/erda-project/erda-infra/providers/component-protocol/cptype"
"github.com/erda-project/erda/apistructs"
"github.com/erda-project/erda/bundle"
"github.com/erda-project/erda/modules/dop/component-protocol/components/auto-test-scenes/common/gshelper"
autotestv2 "github.com/erda-project/erda/modules/dop/services/autotest_v2"
"github.com/erda-project/erda/modules/openapi/component-protocol/components/base"
)
Expand All @@ -30,6 +31,7 @@ type ComponentFileFormModal struct {
Props Props `json:"props"`
State State `json:"state"`
Operations map[string]interface{} `json:"operations"`
gsHelper *gshelper.GSHelper
}

type State struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/erda-project/erda-infra/providers/component-protocol/utils/cputil"
"github.com/erda-project/erda/apistructs"
"github.com/erda-project/erda/bundle"
"github.com/erda-project/erda/modules/dop/component-protocol/components/auto-test-scenes/common/gshelper"
"github.com/erda-project/erda/modules/dop/component-protocol/components/auto-test-scenes/leftPage/fileTree"
"github.com/erda-project/erda/modules/dop/component-protocol/types"
autotestv2 "github.com/erda-project/erda/modules/dop/services/autotest_v2"
Expand All @@ -40,6 +41,7 @@ func (a *ComponentFileFormModal) Render(ctx context.Context, c *cptype.Component
a.bdl = ctx.Value(types.GlobalCtxKeyBundle).(*bundle.Bundle)
a.sdk = cputil.SDK(ctx)
a.atTestPlan = ctx.Value(types.AutoTestPlanService).(*autotestv2.Service)
a.gsHelper = gshelper.NewGSHelper(gs)
err = a.unmarshal(c)
if err != nil {
return err
Expand Down Expand Up @@ -357,7 +359,7 @@ func (a *ComponentFileFormModal) GetSceneSet() error {
}

func (a *ComponentFileFormModal) GetScene(inParams fileTree.InParams) error {
id := a.State.SceneId
id := a.gsHelper.GetFileTreeSceneID()
req := apistructs.AutotestSceneRequest{
SceneID: id,
}
Expand Down Expand Up @@ -502,7 +504,7 @@ func (a *ComponentFileFormModal) UpdateSceneSet(inParams fileTree.InParams) erro

func (a *ComponentFileFormModal) UpdateScene(inParams fileTree.InParams) error {
formData := a.State.FormData
id := a.State.SceneId
id := a.gsHelper.GetFileTreeSceneID()
req := apistructs.AutotestSceneSceneUpdateRequest{
Name: formData.Name,
Description: formData.Description,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ func (s *SceneStage) initFromProtocol(ctx context.Context, c *cptype.Component,
s.State.Visible = false
s.State.ActionType = ""
s.State.IsAddParallel = false
s.State.IsClickFolderTableRow = false
return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ func RenderEdit(s *SceneStage) error {
s.State.Visible = true
s.State.SceneID = meta.ID
s.State.SceneSetKey = s.gsHelper.GetGlobalSelectedSetID()
s.gsHelper.SetFileTreeSceneID(s.State.SceneID)
return nil
}

Expand Down

0 comments on commit 44ef461

Please sign in to comment.