-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MACF-7: Add generic action so that custom flows can be seen and edited #142
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@azefiel Ok, I fixed the first issue and I'm working on a fix for the second one. |
-adding validateSubSchema property to to check if schemas has ref on the specified path, if so return a list of refs otherwise return false -adding getSubSchema property to return a promise that resolves after all the refs have been fetched and return an object with the {shcema_key: schema} structure -making success function async on miscSetSchema in order to wait for the sub schemas while they are being fetched if the validateSubSchema function returned an array of ref values otherwise assign an empty object to the Refs var that is passed as the second jsoneditor.setSchema parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! sorry about that @azefiel, did not noticed the changes done by Prettier. I'll revert back and apply again the changes following the specifications. |
This reverts commit 3b7cb37. Revert the spacing issues
-fixing spacing issues -using monster.series on miscGetSubSchema function to fetch all schema references and set them to the json editor -passing data schema and jsoneditor tom miscGetSubSchema function to set them on the monster.series callback when after all subschemas had been fetched -if schema has references call miscGetSubSchema otherwise set the schema direclty to jsoneditor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you have not been properly introduced to MUI's coding standards. In this particular case, I'm talking about running a linter to adhere to a common coding format. Currently, if I run the linter on one of the updated files, here is what I end up with:
More info on how to setup the linter for your environment here, as well as if you want to run it directly in command line.
sorry my bad, I will review and fix the linting errors, using the the eslintcr guidelines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-bug found: JSON editor does not reopen after saving JSON with subschemas -cause:sub schemas are not saved on local sotorages as the main schema -solution: save the sub schemas on local sotorage so they can be avaliable when JSON editor is opened again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't look like schema validation works, here's an example:
Screen.Recording.2022-09-21.at.5.38.43.PM.mov
submodules/jsoneditor/jsoneditor.js
Outdated
jsonEditorSaveSchemaLocally: function(data, selectedSchema, isSubSchema) { | ||
var self = this; | ||
if (isSubSchema) { | ||
self.appFlags.callflowsListSubSchema[selectedSchema] = data; | ||
} else { | ||
self.appFlags.callflowsListSchema[selectedSchema] = data; | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering why is there a distinction between where sub schema's are stored?
Schema identifiers should be unique, unless I'm missing something here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I sotred them now on same object with its id as the property name
//api call to get subschema | ||
return function(callback) { | ||
self.jsonEditorGetSchema({ | ||
data: { | ||
schemaId: ref | ||
}, | ||
success: function(data) { | ||
callback(null, data); | ||
} | ||
}); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since nested schemas could reference ones that were already pulled and saved locally, we could check our cache here first, to avoid performing unnecessary API requests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that schemas are not stored separated it can check if it is already stored and avpid calling api again
-removing callflowsSubSchemaList from appFlags -removing jsonEditorSaveSchemaLocally function -now saving schema and subschemas on callflowsListSchema as one object
-using callflowsListSchema as store for all fetched schemas -validate if schema is aready store to set it with its subschemas -validate if schema's sub schemas are already store and only fetch the ones that are still not stored on the chache
About the shema validation, the editor did not validate that the property beacuase it was not present since in the schema it is not defined as required, but if the 'macros' property is defined it validates that it should contain at least one item. So I'm not really sure how to handle the validation 🤔 like this case |
No description provided.