import {toByteArray, fromByteArray} from 'base64-js';import { TextDecoderLite, TextEncoderLite } from 'text-encoder-lite';
AP.require(['jira'], (jira) => { jira.WorkflowConfiguration.onSave((() => { console.log("Registering workflow config save handler"); return stringifyConfig; })());
jira.WorkflowConfiguration.onSaveValidation((() => { console.log("Registering workflow config validation handler"); return validateForm; })());});
function encodeForStorage(str) { return fromByteArray(new TextEncoderLite('utf-8').encode(str));}
function validateForm() { console.log("Validating form"); return true;}
function stringifyConfig() { const postFunctionConfig = { className: "hello world", uuid: 'abcd-edfgg-1234-asdad' }; const encoded = encodeForStorage(JSON.stringify(postFunctionConfig)); console.log("Saving form", postFunctionConfig, encoded); return encoded;}
// from all.js around line 3399 as formatted by Chrome dev tools
var i = {
onSaveValidation: function(k) {
e = k
},
onSave: function(k) {
h = k
},
trigger: function() {
var m = true;
if (b(e)) {
m = e.call()
}
var l;
if (h) {
l = h.call()
}
// On two of the executions of this function, e and h are undefined, so the value
// set on k is "undefined"
var k = {
valid: m,
value: m ? "" + l : undefined
};
AP.jira._submitWorkflowConfigurationResponse(k);
return k
}
};
--
You received this message because you are subscribed to the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connec...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connect-dev+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.