Skip to content
This repository was archived by the owner on Aug 31, 2019. It is now read-only.

Lm/toasted errors #100

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
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
73 changes: 29 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"vue-responsive-components": "^0.2.3",
"vue-router": "^3.0.7",
"vue-select": "^3.1.0",
"vue-toasted": "^1.1.27",
"vue2-hammer": "^2.1.2",
"vuedraggable": "^2.23.0",
"vuesax": "^3.9.0",
Expand Down
16 changes: 15 additions & 1 deletion src/components/FileReader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,21 @@ export default {
let file = ev.target.files[0];
// Submit it to be loaded
let unique_id = this.$store.getters["data/nextFreeFileID"];
this.$store.dispatch("intake/loadFile", {file, unique_id});
let self = this;
this.$store.dispatch("intake/loadFile", {
file,
unique_id,
parse_error_callback: function(err) {
if(err instanceof SyntaxError)
{
let toast = self.$toasted.show("Failed to parse uploaded file, please verify that file is properly formatted json", {
theme: "bubble",
position: "top-center",
duration : 5000
});
}
}
});
// Go to that directory
this.$router.push("/results/" + unique_id)
},
Expand Down
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ require("@/assets/styles/jquery.dataTables.min.css");
require("@/assets/styles/prism.css");
require("@/assets/styles/prism-line-numbers.min.css");

// Vue toasted
import Toasted from "vue-toasted";
Vue.use(Toasted);

dom.watch();

library.add(fas, far);
Expand Down
Loading