correct workflow problem
This commit is contained in:
parent
3c5c065b8d
commit
88d2819394
@ -3,7 +3,7 @@ package graph
|
|||||||
import "cloud.o-forge.io/core/oc-lib/models/resources"
|
import "cloud.o-forge.io/core/oc-lib/models/resources"
|
||||||
|
|
||||||
type Graph struct {
|
type Graph struct {
|
||||||
Zoom float64 `bson:"zoom" json:"zoom" validate:"required"`
|
Zoom float64 `bson:"zoom" json:"zoom" default:"1"`
|
||||||
Items map[string]GraphItem `bson:"items" json:"items" default:"{}" validate:"required"`
|
Items map[string]GraphItem `bson:"items" json:"items" default:"{}" validate:"required"`
|
||||||
Links []GraphLink `bson:"links" json:"links" default:"{}" validate:"required"`
|
Links []GraphLink `bson:"links" json:"links" default:"{}" validate:"required"`
|
||||||
}
|
}
|
||||||
@ -17,22 +17,22 @@ type GraphItem struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GraphLink struct {
|
type GraphLink struct {
|
||||||
Source Position `bson:"source" json:"source" validate:"required"`
|
Source Position `bson:"source" json:"source" validate:"required"`
|
||||||
Destination Position `bson:"destination" json:"destination" validate:"required"`
|
Destination Position `bson:"destination" json:"destination" validate:"required"`
|
||||||
Style GraphLinkStyle `bson:"style" json:"style" validate:"required"`
|
Style *GraphLinkStyle `bson:"style,omitempty" json:"style,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GraphLinkStyle struct {
|
type GraphLinkStyle struct {
|
||||||
Color int64 `bson:"color" json:"color" validate:"required"`
|
Color int64 `bson:"color" json:"color"`
|
||||||
Stroke float64 `bson:"stroke" json:"stroke" validate:"required"`
|
Stroke float64 `bson:"stroke" json:"stroke"`
|
||||||
Tension float64 `bson:"tension" json:"tension"`
|
Tension float64 `bson:"tension" json:"tension"`
|
||||||
HeadRadius float64 `bson:"head_radius" json:"head_radius"`
|
HeadRadius float64 `bson:"head_radius" json:"head_radius"`
|
||||||
DashWidth float64 `bson:"dash_width" json:"dash_width"`
|
DashWidth float64 `bson:"dash_width" json:"dash_width"`
|
||||||
DashSpace float64 `bson:"dash_space" json:"dash_space"`
|
DashSpace float64 `bson:"dash_space" json:"dash_space"`
|
||||||
EndArrow Position `bson:"end_arrow" json:"end_arrow"`
|
EndArrow Position `bson:"end_arrow" json:"end_arrow"`
|
||||||
StartArrow Position `bson:"start_arrow" json:"start_arrow"`
|
StartArrow Position `bson:"start_arrow" json:"start_arrow"`
|
||||||
ArrowStyle int64 `bson:"arrow_style" json:"arrow_style" validate:"required"`
|
ArrowStyle int64 `bson:"arrow_style" json:"arrow_style"`
|
||||||
ArrowDirection int64 `bson:"arrow_direction" json:"arrow_direction" validate:"required"`
|
ArrowDirection int64 `bson:"arrow_direction" json:"arrow_direction"`
|
||||||
StartArrowWidth float64 `bson:"start_arrow_width" json:"start_arrow_width"`
|
StartArrowWidth float64 `bson:"start_arrow_width" json:"start_arrow_width"`
|
||||||
EndArrowWidth float64 `bson:"end_arrow_width" json:"end_arrow_width"`
|
EndArrowWidth float64 `bson:"end_arrow_width" json:"end_arrow_width"`
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package workspace
|
package workspace
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
|
|
||||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||||
"cloud.o-forge.io/core/oc-lib/models/resources/data"
|
"cloud.o-forge.io/core/oc-lib/models/resources/data"
|
||||||
@ -41,6 +43,11 @@ func (wfa *workspaceMongoAccessor) UpdateOne(set utils.DBObject, id string) (uti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
res, _, err := wfa.Search(nil, set.GetName())
|
||||||
|
if err == nil && len(res) > 0 {
|
||||||
|
return nil, 409, errors.New("A workspace with the same name already exists")
|
||||||
|
}
|
||||||
return wfa.GenericUpdateOne(set, id, wfa, &Workspace{})
|
return wfa.GenericUpdateOne(set, id, wfa, &Workspace{})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user