diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index c3bc15c4..7aecd2bf 100644 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -859,7 +859,6 @@ class AppBase: return parse_nested_param(string + ')', level) elif len(re.findall("\(", string)) < len(re.findall("\)", string)): return parse_nested_param('(' + string, level) - else: return 'Failed to parse params' @@ -950,17 +949,30 @@ class AppBase: print(f"JSON ERROR in join(): {e}") if "len" in thistype or "length" in thistype or "lenght" in thistype: + print(f"Trying to length-parse: {data}") + tmp = "" try: - tmp = json.loads(tmpdata) - except: + tmp = json.loads(data) + except (NameError, KeyError, TypeError, json.decoder.JSONDecodeError) as e: try: - tmpdata = data.replace("\'", "\"") - tmp = json.loads(tmpdata) - except: - print("[ERROR] Parsing bug for length in app sdk") + print(f"[WARNING] INITIAL Parsing bug for length in app sdk: {e}") + #data = data.replace("\'", "\"") + data = data.replace("True", "true") + data = data.replace("False", "false") + data = data.replace("None", "null") + data = data.replace("\"", "\\\"") + data = data.replace("'", "\"") + + tmp = json.loads(data) + except (NameError, KeyError, TypeError, json.decoder.JSONDecodeError) as e: + print(f"[ERROR] Parsing bug for length in app sdk: {e}") pass + if tmp == "": + print("[WARNING] Length parsing: item wasn't parsed") + tmp = data + if isinstance(tmp, list): return str(len(tmp)) elif isinstance(tmp, object): @@ -1028,20 +1040,29 @@ class AppBase: print("INNER: ", innervalue) print("OUTER: ", outervalue) + # FIXME: There is a known bug here with nested paranthesis + #if outervalue != innervalue: + # # FIXME: This line right here WILL break things when we + # # Do recursive paranthesis in the future + # innervalue = outervalue + + # #print("Outer: ", outervalue, " inner: ", innervalue) + # for key in range(len(innervalue)): + # # Replace OUTERVALUE[key] with INNERVALUE[key] in data. + # print("\nReplace %s\nwith\n%s\nin\n%s" % (outervalue[key], innervalue[key], data)) + # data = data.replace(outervalue[key], innervalue[key]) + #else: if outervalue != innervalue: - #print("Outer: ", outervalue, " inner: ", innervalue) - for key in range(len(innervalue)): - # Replace OUTERVALUE[key] with INNERVALUE[key] in data. - print("Replace %s with %s in %s" % (outervalue[key], innervalue[key], data)) - data = data.replace(outervalue[key], innervalue[key]) - else: - for thistype in wrappers: - if thistype.lower() not in data.lower(): - continue - - parsed_value = parse_type(innervalue[0], thistype.lower()) - print("Parsed value from %s: %s" % (thistype, parsed_value)) - return (parsed_value, True) + print("Setting inner to outer") + innervalue = outervalue + + for thistype in wrappers: + if thistype.lower() not in data.lower(): + continue + + parsed_value = parse_type(innervalue[0], thistype.lower()) + print("Parsed value from %s: %s" % (thistype, parsed_value)) + return (parsed_value, True) #print("DATA: %s\n" % data) return (parse_wrapper(data)[0], True) diff --git a/backend/app_sdk/build.sh b/backend/app_sdk/build.sh index eaee980c..695cacd6 100644 --- a/backend/app_sdk/build.sh +++ b/backend/app_sdk/build.sh @@ -1,6 +1,6 @@ #!/bin/bash NAME=shuffle-app_sdk -VERSION=0.8.64 +VERSION=0.8.71 docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force docker build . -t frikky/shuffle:app_sdk -t frikky/$NAME:$VERSION -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION diff --git a/backend/app_sdk/requirements.txt b/backend/app_sdk/requirements.txt index acde3f06..60b59271 100644 --- a/backend/app_sdk/requirements.txt +++ b/backend/app_sdk/requirements.txt @@ -1,2 +1,2 @@ -urllib3=1.25.9 -requests=2.25.1 +urllib3==1.25.9 +requests==2.25.1 diff --git a/backend/go-app/go.mod b/backend/go-app/go.mod index 4e64fc86..02af7a49 100644 --- a/backend/go-app/go.mod +++ b/backend/go-app/go.mod @@ -2,7 +2,7 @@ module shuffle go 1.13 -//replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared +replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared //replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi require ( diff --git a/backend/go-app/main.go b/backend/go-app/main.go index 097bc190..d2110f56 100644 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -5140,12 +5140,13 @@ func runInit(ctx context.Context) { // Gets environments and inits if it doesn't exist count, err := getEnvironmentCount() if count == 0 && err == nil && len(activeOrgs) == 1 { - log.Printf("Setting up environment with org %s", activeOrgs[0].Id) + log.Printf("[INFO] Setting up environment with org %s", activeOrgs[0].Id) item := shuffle.Environment{ Name: "Shuffle", Type: "onprem", OrgId: activeOrgs[0].Id, Default: true, + Id: uuid.NewV4().String(), } err = setEnvironment(ctx, &item) @@ -5889,6 +5890,7 @@ func handleCloudSetup(resp http.ResponseWriter, request *http.Request) { Registered: true, Default: false, OrgId: org.Id, + Id: uuid.NewV4().String(), } err = setEnvironment(ctx, &newEnv) diff --git a/backend/go-app/walkoff.go b/backend/go-app/walkoff.go index 86f27be7..c694fd82 100644 --- a/backend/go-app/walkoff.go +++ b/backend/go-app/walkoff.go @@ -1058,7 +1058,7 @@ func handleWorkflowQueue(resp http.ResponseWriter, request *http.Request) { } if workflowExecution.Status == "FINISHED" { - log.Printf("Workflowexecution is already FINISHED. No further action can be taken") + log.Printf("[INFO] Workflowexecution is already FINISHED. No further action can be taken.") resp.WriteHeader(401) resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Workflowexecution is already finished because of %s with status %s"}`, workflowExecution.LastNode, workflowExecution.Status))) return diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx index dfefcd5f..6201fdf8 100644 --- a/frontend/src/views/Admin.jsx +++ b/frontend/src/views/Admin.jsx @@ -474,6 +474,39 @@ const Admin = (props) => { }); } + const inviteUser = (data) => { + console.log("INPUT: ", data) + setLoginInfo("") + + // Just use this one? + var data = { "username": data.Username, "type": "invite", "org_id": selectedOrganization.id} + var baseurl = globalUrl + const url = baseurl + '/api/v1/users/register_org'; + + fetch(url, { + method: 'POST', + credentials: "include", + body: JSON.stringify(data), + headers: { + 'Content-Type': 'application/json', + }, + }) + .then(response => + response.json().then(responseJson => { + if (responseJson["success"] === false) { + setLoginInfo("Error: " + responseJson.reason) + } else { + setLoginInfo("") + setModalOpen(false) + getUsers() + } + }), + ) + .catch(error => { + console.log("Error in userdata: ", error) + }); + } + const submitUser = (data) => { console.log("INPUT: ", data) setLoginInfo("") @@ -1689,6 +1722,11 @@ const Admin = (props) => { {curTab === 1 ? "Add user" : "Add environment"} + {curTab === 1 && isCloud ? + + We'll send an email to invite them to your organization. + + : null} {curTab === 1 ?
Username @@ -1712,32 +1750,36 @@ const Admin = (props) => { variant="outlined" onChange={(event) => changeModalData("Username", event.target.value)} /> - Password - changeModalData("Password", event.target.value)} - /> + {isCloud ? null : + + Password + changeModalData("Password", event.target.value)} + /> + + }
- : curTab === 3 ? + : curTab === 5 ?
Environment Name - { + + + + + : null + const deleteModal = deleteModalOpen ? { >
- Are you sure?
Other workflows relying on this one may stop working + Are you sure you want to delete this workflow?
Other workflows relying on this one may stop working
@@ -888,7 +932,8 @@ const Workflows = (props) => { {"Change details"} { - publishWorkflow(data) + setSelectedWorkflow(data) + setPublishModalOpen(true) }} key={"publish"}> {"Publish Workflow"} @@ -1830,6 +1875,7 @@ const Workflows = (props) => { {modalView} {deleteModal} + {publishModal} {workflowDownloadModalOpen}
: diff --git a/functions/onprem/orborus/go.sum b/functions/onprem/orborus/go.sum index d3ea7e29..ada1bd1f 100644 --- a/functions/onprem/orborus/go.sum +++ b/functions/onprem/orborus/go.sum @@ -71,6 +71,8 @@ github.com/frikky/kin-openapi v0.38.0 h1:V7ttwIJS8Vks4KL+mZVj1ZSqhIcQtgaG8akeqXE github.com/frikky/kin-openapi v0.38.0/go.mod h1:Fr28TtCHL4K0kIqtqui8HWxN1LG5uAh3z/tDfFyiA1s= github.com/frikky/shuffle-shared v0.0.12 h1:+0EIfThmK47Po+LogPYZR4XjbS4Ds19WNMFu2YUSjhw= github.com/frikky/shuffle-shared v0.0.12/go.mod h1:SEY432/xs4oBkOUnGwxiYKCZWZLRaheGInhAoW7N8ww= +github.com/frikky/shuffle-shared v0.0.23 h1:Pnlc2M6fHnFRLFd5K1iLTVv4/t4P04Ri1GJ5CMxzq0U= +github.com/frikky/shuffle-shared v0.0.23/go.mod h1:H7SqOta/EAYnfYuWzwzYSh/oWfF0kgnuaJTQNKQBvoQ= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -162,6 +164,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= +github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -194,6 +198,7 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=