Skip to content

Commit e067196

Browse files
authored
Preprod to main for feature release v1.6.3 (#537)
1 parent 839a02f commit e067196

26 files changed

+512
-152
lines changed

Diff for: .circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 2.1
44
parameters:
55
golang-tag:
66
type: string
7-
default: "1.21"
7+
default: "1.22"
88
nodejs-ver:
99
type: integer
1010
default: 16

Diff for: Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SHELL:= /bin/bash
22
DEBUG_FLAG?=false
3-
GO_VERSION=1.21
3+
GO_VERSION=1.22
44

55
ifeq ($(DEBUG), "true")
66
BINDATA_OPTS="-debug"
@@ -159,7 +159,8 @@ fmt:
159159

160160
.PHONY: test
161161
test: generate
162-
go test $(COVERAGE_OPTS) ./main/... ./sys/... ./storage/... ./service/...
162+
go test $(COVERAGE_OPTS) ./main/... ./sys/... ./storage/... ./service/...; ret=$$?; \
163+
echo $$ret
163164

164165
.PHONY: test-integration
165166
test-integration:

Diff for: demo/restore_db/i18n

0 Bytes
Binary file not shown.

Diff for: go.mod

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/ProxeusApp/proxeus-core
22

3-
go 1.20
3+
go 1.21
4+
5+
toolchain go1.22.0
46

57
require (
68
github.com/SparkPost/gosparkpost v0.2.0
@@ -30,8 +32,8 @@ require (
3032
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
3133
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
3234
go.etcd.io/bbolt v1.3.8 // indirect
33-
golang.org/x/crypto v0.21.0
34-
golang.org/x/net v0.22.0
35+
golang.org/x/crypto v0.22.0
36+
golang.org/x/net v0.24.0
3537
gopkg.in/gavv/httpexpect.v2 v2.16.0
3638
)
3739

@@ -43,7 +45,7 @@ require (
4345
github.com/gorilla/context v1.1.2 // indirect
4446
github.com/gorilla/websocket v1.5.1 // indirect
4547
github.com/klauspost/compress v1.17.3 // indirect
46-
github.com/labstack/echo-contrib v0.15.0
48+
github.com/labstack/echo-contrib v0.17.0
4749
github.com/mattn/go-colorable v0.1.13 // indirect
4850
github.com/sergi/go-diff v1.3.1 // indirect
4951
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
@@ -59,7 +61,7 @@ require (
5961

6062
require (
6163
github.com/labstack/echo/v4 v4.11.4
62-
go.mongodb.org/mongo-driver v1.14.0
64+
go.mongodb.org/mongo-driver v1.15.0
6365
)
6466

6567
require (
@@ -78,7 +80,7 @@ require (
7880
github.com/go-ole/go-ole v1.3.0 // indirect
7981
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
8082
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
81-
github.com/golang/protobuf v1.5.3 // indirect
83+
github.com/golang/protobuf v1.5.4 // indirect
8284
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
8385
github.com/google/go-cmp v0.6.0 // indirect
8486
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a // indirect
@@ -102,7 +104,7 @@ require (
102104
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
103105
golang.org/x/mod v0.14.0 // indirect
104106
golang.org/x/sync v0.5.0 // indirect
105-
golang.org/x/sys v0.18.0 // indirect
107+
golang.org/x/sys v0.19.0 // indirect
106108
golang.org/x/text v0.14.0 // indirect
107109
golang.org/x/time v0.5.0 // indirect
108110
golang.org/x/tools v0.16.1 // indirect

Diff for: go.sum

+64-20
Large diffs are not rendered by default.

Diff for: main/www/security.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func redirectToLogin(c echo.Context) error {
5454
if isAjax {
5555
return echo.ErrUnauthorized
5656
}
57-
return c.Redirect(http.StatusTemporaryRedirect, "/login")
57+
return c.Redirect(http.StatusTemporaryRedirect, "/login?redirect="+req.URL.Path)
5858
}
5959

6060
func getURI(host, url string) string {

Diff for: service/document.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (me *DefaultDocumentService) Edit(auth model.Auth, userId string, formInput
8787
if !ok {
8888
return ErrUnableToEdit
8989
}
90-
if len(fName) >= 80 || !filenameRegex.MatchString(fName) {
90+
if len(fName) > 80 || !filenameRegex.MatchString(fName) {
9191
return ErrUnableToEdit
9292
}
9393
usrDataItem, err := userDataDB().Get(auth, userId)

Diff for: sys/workflow/engine.go

+58-1
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ func (me *Engine) setupNodes(ctx *context) error {
304304
if len(me.nodeImpls) == 0 {
305305
return ErrNodeImplementationNotProvided
306306
}
307+
307308
for _, item := range ctx.flow.Nodes {
308-
item.internalNode = item.isCondition() || item.isWorkflow()
309+
item.internalNode = item.isCondition() || item.isWorkflow() || item.isPlaceholder()
309310
if !item.internalNode {
310311
if s, ok := me.nodeImpls[item.Type]; ok && s.InitImplFunc != nil {
311312
item.new = s.InitImplFunc
@@ -319,6 +320,62 @@ func (me *Engine) setupNodes(ctx *context) error {
319320
return nil
320321
}
321322

323+
func (me *Engine) removeUselessNodes(ctx *context) error {
324+
uselessConnections := make(map[string]*Connection, 0)
325+
326+
for name, item := range ctx.flow.Nodes {
327+
if !item.isPlaceholder() {
328+
continue
329+
}
330+
331+
for _, conn := range item.Connections {
332+
correctConnection := conn
333+
currentNode := ctx.flow.Nodes[correctConnection.NodeID]
334+
335+
for currentNode.isPlaceholder() {
336+
if len(currentNode.Connections) > 0 {
337+
correctConnection = currentNode.Connections[0]
338+
currentNode = ctx.flow.Nodes[correctConnection.NodeID]
339+
} else {
340+
break
341+
}
342+
}
343+
344+
uselessConnections[name] = correctConnection
345+
}
346+
}
347+
348+
for _, item := range ctx.flow.Nodes {
349+
if item.isPlaceholder() {
350+
continue
351+
}
352+
353+
for i := 0; i < len(item.Connections); i++ {
354+
conn := item.Connections[i]
355+
356+
if val, ok := uselessConnections[conn.NodeID]; ok {
357+
item.Connections[i] = val
358+
}
359+
}
360+
}
361+
362+
if val, ok := uselessConnections[ctx.flow.Start.NodeID]; ok {
363+
ctx.flow.Start.NodeID = val.NodeID
364+
}
365+
366+
filteredNodes := make(map[string]*Node, 0)
367+
368+
for name, item := range ctx.flow.Nodes {
369+
if !item.isPlaceholder() {
370+
filteredNodes[name] = item
371+
}
372+
}
373+
374+
ctx.flow.Nodes = filteredNodes
375+
376+
return nil
377+
}
378+
322379
func (me *Engine) execute(nn *Node, considerSteps bool) (proceed bool, err error) {
323380
nn.focus()
324381
if nn.internalNode {

Diff for: sys/workflow/node.go

+4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ func (n *Node) isWorkflow() bool {
7171
return n.Type == "workflow"
7272
}
7373

74+
func (n *Node) isPlaceholder() bool {
75+
return n.Type == "placeholder"
76+
}
77+
7478
func (me *Node) getImpl() (NodeIF, error) {
7579
//instance is still valid for reuse
7680
if me.impl != nil {

Diff for: sys/workflow/workflow.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ func newWorkflow(wf *Workflow, engine *Engine, parent *context) (*context, error
7373
if wf == nil {
7474
return nil, ErrWorkflowMissing
7575
}
76+
7677
if wf.Flow == nil || wf.Flow.Start == nil || wf.Flow.Start.NodeID == "" {
7778
return nil, ErrStartNodeMissing
7879
}
80+
7981
me := context{
8082
id: "root",
8183
flow: wf.Flow,
@@ -84,11 +86,18 @@ func newWorkflow(wf *Workflow, engine *Engine, parent *context) (*context, error
8486
engine: engine,
8587
}
8688

87-
err := engine.setupNodes(&me)
89+
err := engine.removeUselessNodes(&me)
8890
if err != nil {
8991
return nil, err
9092
}
93+
94+
err = engine.setupNodes(&me)
95+
if err != nil {
96+
return nil, err
97+
}
98+
9199
me.start()
100+
92101
return &me, nil
93102
}
94103

@@ -122,6 +131,8 @@ func (me *context) resolve(n *Node) error {
122131
return err
123132
}
124133
return me.resolve(nn)
134+
} else if n.isPlaceholder() {
135+
return nil
125136
} else if n.isWorkflow() {
126137
return me.stepIntoWorkflow(n)
127138
}

Diff for: test/e2e/cypress/integration/0_powerup.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ describe(`Power up on ${url}`, () => {
1717

1818
it('should bring to home page after saving with default values', () => {
1919
cy.get('button.btn-primary').eq(2).click()
20+
21+
cy.location('pathname', {
22+
timeout: 60000
23+
}).should('eq', '/');
2024
})
2125

22-
})
26+
})

Diff for: test/e2e/cypress/integration/1_user.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ describe(`User signup & login at ${url}`, () => {
177177

178178
it('should remove account and logout when clicking again', () => {
179179
cy.get('.btn-danger').click()
180-
cy.url().should('eq', `${url}/login`)
180+
cy.url().should('eq', `${url}/login?redirect=%2Fadmin%2Fworkflow`)
181181
})
182182
})
183183
})

Diff for: ui/core/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"bootstrap-vue": "2.0.0-rc.12",
2525
"brace": "^0.11.1",
2626
"codemirror": "^5.39.2",
27-
"core-js": "^3.36.0",
27+
"core-js": "^3.36.1",
2828
"ethereumjs-util": "^7.1.5",
2929
"flatpickr": "^4.5.1",
3030
"font-awesome": "^4.7.0",
@@ -38,7 +38,7 @@
3838
"js-sha3": "^0.9.3",
3939
"moment": "^2.30.1",
4040
"popper.js": "^1.14.4",
41-
"sass": "^1.72.0",
41+
"sass": "^1.75.0",
4242
"sortablejs": "^1.15.2",
4343
"tippy.js": "^6.3.7",
4444
"underscore": "^1.8.3",
@@ -67,7 +67,7 @@
6767
"vue-range-slider": "^0.6.0",
6868
"vue-router": "^3.0.1",
6969
"vue-scrollto": "^2.11.0",
70-
"vue-select": "^2.4.0",
70+
"vue-select": "^3.20.3",
7171
"vue-tour": "^2.0.0",
7272
"vuedraggable": "^2.16.0",
7373
"vuep": "^0.8.1",

Diff for: ui/core/src/App.vue

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export default {
5050
window.$root = this.$root
5151
this.$root.$on('service-on', this.onServiceOn)
5252
this.$root.$on('service-off', this.onServiceOff)
53+
54+
if (!this.app.checkUserHasSession()) {
55+
this.app.redirectToLogin(window.location.pathname)
56+
}
5357
},
5458
beforeDestroy () {
5559
this.$root.$off('service-on', this.onServiceOn)

Diff for: ui/core/src/DocumentApp.vue

+12-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export default {
2424
created () {
2525
this.$root.$on('service-on', this.onServiceOn)
2626
this.$root.$on('service-off', this.onServiceOff)
27+
28+
if (!this.app.checkUserHasSession()) {
29+
this.app.redirectToLogin(window.location.pathname)
30+
}
2731
},
2832
beforeDestroy () {
2933
this.$root.$off('service-on', this.onServiceOn)
@@ -107,13 +111,19 @@ export default {
107111
color: $primary;
108112
}
109113
114+
body {
115+
overflow: hidden;
116+
}
117+
110118
.navbar h1 {
111119
margin-bottom: 0;
112120
}
113121
114122
.app-main {
115-
@media (max-width: 767px) {
116-
max-width: 100% !important;
123+
max-width: calc(100% - 265px);
124+
125+
@media (max-width: 979px) {
126+
max-width: calc(100% - 80px);
117127
}
118128
}
119129

0 commit comments

Comments
 (0)