Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions resources/js/processes/import/components/ImportPIModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,32 @@ export default {
}
this.$root.file = this.file;

let formData = new FormData();
formData.append('file', this.file);

this.fileIsValid = true;
},
removeFile() {
this.file = '';
this.fileIsValid = false;
},
importNewPI() {}
importNewPI() {
if (!this.file) {
return;
}

let formData = new FormData();
formData.append('file', this.file);

ProcessMaker.apiClient
.post(`/package-ai/pi_process/import`, formData)
.then((response) => {
// TODO: Make import and redirect to Modeler
})
.catch((error) => {
window.ProcessMaker.alert(
this.$t("An error ocurred while importing the current PI Process."),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add to en.json file

"danger",
);
});
}
},
computed: {
title() {
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"Alpha-Numeric": "Alpha-Numeric",
"Alpha": "Alpha",
"An error occurred. Check the form for errors in red text.": "An error occurred. Check the form for errors in red text.",
"An error ocurred while importing the current PI Process.": "An error ocurred while importing the current PI Process.",
"An existing user has been found with the email {{ email }} would you like to save and reactivate their account?": "An existing user has been found with the email {{ email }} would you like to save and reactivate their account?",
"An existing user has been found with the email {{ username }} would you like to save and reactivate their account?": "An existing user has been found with the username {{ username }} would you like to save and reactivate their account?",
"Analytics Chart": "Analytics Chart",
Expand Down