github.com/erda-project/erda-infra@v1.0.9/providers/component-protocol/components/commodel/click.go (about)

     1  // Copyright (c) 2021 Terminus, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package commodel
    16  
    17  import (
    18  	"github.com/erda-project/erda-infra/providers/component-protocol/cptype"
    19  )
    20  
    21  // OpClick
    22  type (
    23  	// OpClick is a simple click op.
    24  	OpClick struct{}
    25  )
    26  
    27  // OpKey .
    28  func (o OpClick) OpKey() cptype.OperationKey { return "click" }
    29  
    30  // OpClickGoto
    31  type (
    32  	// OpClickGoto means click and goto target link.
    33  	OpClickGoto struct {
    34  	}
    35  	// OpClickGotoServerData .
    36  	OpClickGotoServerData struct {
    37  		// open a new fronted page
    38  		JumpOut bool `json:"jumpOut,omitempty"`
    39  		// the jump out target of the new opened fronted page, e.g: projectAllIssue page
    40  		Target string `json:"target,omitempty"`
    41  		// params needed for jumping to the new page, e.g: projectId
    42  		Params map[string]interface{} `json:"params,omitempty"`
    43  		// the query condition of the new page, e.g: issueFilter__urlQuery
    44  		Query map[string]interface{} `json:"query,omitempty"`
    45  	}
    46  )
    47  
    48  // OpKey .
    49  func (o OpClickGoto) OpKey() cptype.OperationKey { return "clickGoto" }