diff --git a/web/src/components/AboutPage.vue b/web/src/components/AboutPage.vue index e366ffef2362e4b62ba8375f5a40b3b57a8739e7..0d885616f48f80895bbf5a7e30abd76d46856d58 100644 --- a/web/src/components/AboutPage.vue +++ b/web/src/components/AboutPage.vue @@ -262,7 +262,7 @@ export default { computed: {}, methods: { convertItalic(val) { - console.log(val.italics()); + return val.italics(); }, }, diff --git a/web/src/components/AddNovelCondensate.vue b/web/src/components/AddNovelCondensate.vue index 2c1fc8bf89bee562ac127c51c65d1fc3ae4116ea..96fa2f272287805e4dc26f7873f3d0fa7269222f 100644 --- a/web/src/components/AddNovelCondensate.vue +++ b/web/src/components/AddNovelCondensate.vue @@ -739,7 +739,7 @@ export default { }, getUserData() { const userRole = this.$store.getters["User/userRole"]; - // console.log('role is', userRole); + return userRole; }, proteinNameList: { @@ -754,7 +754,7 @@ export default { ); this.$store.dispatch("Param/removeProtein", idx); obj.deleteTag(); - // console.log(this.$store.getters['Param/proteinList']) + }, }, }, @@ -810,11 +810,11 @@ export default { }, async addUniprot() { const vm = this; - console.log("adding uniprot"); + Object.keys(vm.newProtein.errors).forEach( (v) => (vm.newProtein.errors[v] = false) ); - console.log("uniprot is", this.newProtein.uniprot_id); + const validUniprot = await this.uniprotIdValidation( this.newProtein.uniprot_id ); @@ -877,7 +877,7 @@ export default { vm.showAddNewProtein = false; }, async uniprotIdValidation(id) { - console.log("validation hitting"); + try { const res = await fetch(`https://rest.uniprot.org/uniprotkb/${id}`, { method: "HEAD", @@ -900,7 +900,7 @@ export default { return { valid: true, msg: "Valid Uniprot ID." }; } } catch (err) { - console.log("error", err); + return { valid: false, msg: @@ -1074,7 +1074,7 @@ export default { vm.$emit("hideToaster"); }, 2000); } catch (e) { - console.error(e); + vm.isLoading = false; vm.fetchError = e.message || "Something went wrong, please try again later!"; diff --git a/web/src/components/BarcodePlot.vue b/web/src/components/BarcodePlot.vue index 449a8485c732416f17b7350d23ebf7f5194a0fee..3c63b811d3bd4f844602c5c60bd7e1000c8d3f90 100644 --- a/web/src/components/BarcodePlot.vue +++ b/web/src/components/BarcodePlot.vue @@ -55,7 +55,7 @@ export default { } }, mounted() { - // console.log(this.x.split('')) + } } </script> diff --git a/web/src/components/CMS/DriverCriterion.vue b/web/src/components/CMS/DriverCriterion.vue index 1e56012075cdd8b0820882ff8c4328294efe8f33..bccb779765303a46f9a1e539a02017bc410951d2 100644 --- a/web/src/components/CMS/DriverCriterion.vue +++ b/web/src/components/CMS/DriverCriterion.vue @@ -418,7 +418,7 @@ export default { this.toasterIsOpen = false; }, 2000); } catch (e) { - console.error(e); + this.isLoading = false; this.serverError = true; this.errMessage = diff --git a/web/src/components/CMS/ExperimentalEvidence.vue b/web/src/components/CMS/ExperimentalEvidence.vue index bfc7697543f8abd72f274920079df9bcd35da4a1..da0c17379dd7ae7032a3cb82aeced3a0fd297544 100644 --- a/web/src/components/CMS/ExperimentalEvidence.vue +++ b/web/src/components/CMS/ExperimentalEvidence.vue @@ -438,7 +438,7 @@ export default { this.toasterIsOpen = false; }, 2000); } catch (e) { - console.error(e); + this.isLoading = false; this.serverError = true; this.errMessage = diff --git a/web/src/components/CMS/ProteinFunctionalType.vue b/web/src/components/CMS/ProteinFunctionalType.vue index 994901bd296ec94d0806bc00fd4fd24d2e09aa06..0fc71553278c3d769d0d54692ed70c8f34d81aa8 100644 --- a/web/src/components/CMS/ProteinFunctionalType.vue +++ b/web/src/components/CMS/ProteinFunctionalType.vue @@ -319,7 +319,7 @@ export default { this.toasterIsOpen = false; }, 2000); } catch (e) { - console.error(e); + this.isLoading = false; this.serverError = true; this.errMessage = diff --git a/web/src/components/CMS/addDeleteMarker.vue b/web/src/components/CMS/addDeleteMarker.vue index 76910fcdcdaef60d6ef8a94e96f6371094335413..305719297a848a1d0e9256f8791bc59c6115ef69 100644 --- a/web/src/components/CMS/addDeleteMarker.vue +++ b/web/src/components/CMS/addDeleteMarker.vue @@ -567,7 +567,7 @@ export default { this.toasterIsOpen = false; }, 2000); } catch (e) { - console.error(e); + this.isLoading = false; this.error = true; this.message = diff --git a/web/src/components/CMS/addDeletePubmed.vue b/web/src/components/CMS/addDeletePubmed.vue index ad48135db730c8d59b6078154a16b33aae12db98..325f024f1bfc630bd9c11a6f6004ce328d9ea14f 100644 --- a/web/src/components/CMS/addDeletePubmed.vue +++ b/web/src/components/CMS/addDeletePubmed.vue @@ -637,7 +637,7 @@ export default { let pubmedData; for (let key in data) { if (key === this.uniprot) { - console.log('working in add', data[key]); + pubmedData = data[key]; } } @@ -693,7 +693,7 @@ export default { if (this.mode === 'condensate' && this.type === 'Add') { //const foundPubId = this.pubmed.find((p) => p === this.pubmedId); - console.log('return val', this.inputValidation(this.pubmed)); + let valid = this.inputValidation(this.pubmed); @@ -882,7 +882,7 @@ export default { this.toasterIsOpen = false; }, 2000); } catch (e) { - console.error(e); + this.isLoading = false; this.serverError = true; this.message = diff --git a/web/src/components/CMS/evidenceStarRating.vue b/web/src/components/CMS/evidenceStarRating.vue index 177598c2f7918a753807d4f48ced33d5f86d3a71..4818ddb65f373778779056c4b903e566fda02acc 100644 --- a/web/src/components/CMS/evidenceStarRating.vue +++ b/web/src/components/CMS/evidenceStarRating.vue @@ -237,7 +237,7 @@ export default { this.toasterIsOpen = false; }, 2000); } catch (e) { - console.error(e); + this.isLoading = false; this.error = true; this.message = diff --git a/web/src/components/CMS/fetchProfile.vue b/web/src/components/CMS/fetchProfile.vue index cbdae9cc19e2b115a9a3ec9da53ea180e4eed58b..df97932fd4e7c8ae4bcc539e2d58f2ccbd692578 100644 --- a/web/src/components/CMS/fetchProfile.vue +++ b/web/src/components/CMS/fetchProfile.vue @@ -31,22 +31,21 @@ export default { mounted() { const vm = this; // /* eslint-disable no-console */ - // console.log(vm.locus); + vm.getItems(); }, methods: { async getItems() { const vm = this; - // console.log(host) - // console.log('is dev?',vm.isDev); + if (vm.isDev) { host = require('../js/const').devApiHost; } - // console.log(vm.isExperimental) + let url = `${host}/api/users/me`; - // console.log('url is',url); + const jwt = vm.jwt; if (jwt === null) { @@ -82,23 +81,14 @@ export default { vm.error = false; const responseData = await res.json(); - // console.log('user data', responseData); + setTimeout(() => { vm.loading = false; vm.response = responseData; }, 10); - // .then(response => response.json()) - // .then((response) => { - // // /* eslint-disable no-console */ - // console.log(response); - - // setTimeout(() => { - // vm.loading = false; - // vm.response = response - // }, 10); - // }) + }, }, }; diff --git a/web/src/components/CMS/fetchUpdateItems.vue b/web/src/components/CMS/fetchUpdateItems.vue index 6daef83e5e4e7cd8b05364e5d7506aa8f6f64958..aa27798c74e25792eb0dc99d4f8e962a65558398 100644 --- a/web/src/components/CMS/fetchUpdateItems.vue +++ b/web/src/components/CMS/fetchUpdateItems.vue @@ -29,20 +29,20 @@ export default { mounted() { const vm = this // /* eslint-disable no-console */ - // console.log(vm.locus); + vm.getItems(); }, methods: { getItems() { const vm = this; - // console.log(host) + if(vm.isDev) { host = require('../js/const').devApiHost; } - // console.log(vm.isExperimental) + const qs = require('qs'); const query = qs.stringify({ sort: ['id:asc'], @@ -74,7 +74,7 @@ export default { .then(response => response.json()) .then((response) => { // /* eslint-disable no-console */ - // console.log(response); + setTimeout(() => { vm.loading = false; diff --git a/web/src/components/CMS/fetchUserSpecificUpdateItems.vue b/web/src/components/CMS/fetchUserSpecificUpdateItems.vue index 78092e6d7135abb3ed186a378942e23f972cc697..a31e09ad1c2ed9d68fb7c3a902936165d51bab2f 100644 --- a/web/src/components/CMS/fetchUserSpecificUpdateItems.vue +++ b/web/src/components/CMS/fetchUserSpecificUpdateItems.vue @@ -29,21 +29,21 @@ props:['id'], mounted() { const vm = this // /* eslint-disable no-console */ - // console.log(vm.locus); + vm.getItems(); - console.log(vm.canonicalId); + }, methods: { getItems() { const vm = this; - // console.log(host) + if(vm.isDev) { host = require('../js/const').devApiHost; } - // console.log(vm.isExperimental) + const qs = require('qs'); const query = qs.stringify({ sort: ['id:asc'], @@ -56,7 +56,7 @@ props:['id'], }); let url = `${host}/api/update-item/filterProteinOrCondensateRequest/${vm.id}`; - console.log('url is', url); + const jwt = vm.jwt; if(jwt === null) { @@ -76,7 +76,7 @@ props:['id'], .then(response => response.json()) .then((response) => { // /* eslint-disable no-console */ - console.log('data is', response.data) + setTimeout(() => { vm.loading = false; diff --git a/web/src/components/CMS/fetchUsers.vue b/web/src/components/CMS/fetchUsers.vue index fda867c9c35a04de0b00f211e456a1422858dc43..c3e24dc027d415ed7d2a1d84daa785d748b37a77 100644 --- a/web/src/components/CMS/fetchUsers.vue +++ b/web/src/components/CMS/fetchUsers.vue @@ -30,20 +30,20 @@ export default { mounted() { const vm = this // /* eslint-disable no-console */ - // console.log(vm.locus); + vm.getItems(); }, methods: { async getItems() { const vm = this; - // console.log(host) + if(vm.isDev) { host = require('../js/const').devApiHost; } - // console.log(vm.isExperimental) + let url = `${host}/api/users`; diff --git a/web/src/components/CMS/updateFunctionalType.vue b/web/src/components/CMS/updateFunctionalType.vue index f4a178fd7701dee1085d96a9d408129abfdb0733..d22d09db684a8e47b64950f63343c3c8bc4b975d 100644 --- a/web/src/components/CMS/updateFunctionalType.vue +++ b/web/src/components/CMS/updateFunctionalType.vue @@ -213,7 +213,7 @@ export default { async updateFuctionalType() { const vm = this; - // console.log(host) + if (vm.isDev) { host = require('../js/const').devApiHost; @@ -289,7 +289,7 @@ export default { this.toasterIsOpen = false; }, 2000); } catch (e) { - console.error(e); + this.isLoading = false; this.serverError = true; this.message = diff --git a/web/src/components/CondensateDetailPage.vue b/web/src/components/CondensateDetailPage.vue index dc63ec6da8f7934dcbd915a3dab9c59e58bb14bf..d532c8a89b3024d0b0a4d9963a7f434d7393015c 100644 --- a/web/src/components/CondensateDetailPage.vue +++ b/web/src/components/CondensateDetailPage.vue @@ -1064,7 +1064,7 @@ export default { this.toasterIsOpen = false; }, 2000); } catch (e) { - console.error(e); + this.isLoading = false; this.nameCommentErr = true; this.condensateNameCommentErrMsg = @@ -1145,7 +1145,7 @@ export default { this.toasterIsOpen = false; }, 2000); } catch (e) { - console.error(e); + this.descriptionMsg = ""; this.descriptionErrorMsg = e.message || "Something went wrong, please try again later!"; @@ -1175,7 +1175,7 @@ export default { return { valid: true, msg: "Valid Uniprot ID." }; } } catch (err) { - console.log("error", err); + return { valid: false, msg: @@ -1289,62 +1289,17 @@ export default { this.toasterIsOpen = false; }, 2000); } catch (e) { - console.error(e); + this.message = e.message || "Something went wrong, please try again later!"; this.isSubmitted = true; this.error = true; } - // try { - // const res=await this.axios.get( - // `${host} - // /api/update-item/findCondensate/${response.data.canonical_id}`, - - // { - // headers: { - // Authorization: `Bearer ${this.jwt}`, - // }, - // } - // ); - - // console.log(await res) - - // } catch (e) { - // console.error(e); - - // } + }, - // async getRequest() { - // if (this.isDev) { - // host = require("./js/const").devApiHost; - // } - // let url = `${host}/api/update-items`; - // try { - // const response = await this.axios.get( - // url, - - // { - // headers: { - // Authorization: `Bearer ${this.jwt}`, - // }, - // } - // ); - // return response.data.data; - // } catch (e) { - // console.error(e); - // this.message = - // e.message || "Something went wrong, please try again later!"; - // this.isSubmitted = true; - // this.error = true; - // } - // }, - - // async getSumittedRequest() { - // const requestData = await this.getRequest(); - // console.log("get req", requestData); - // }, + getProteinLinks(uniprots) { if (uniprots) diff --git a/web/src/components/CondensateExample.vue b/web/src/components/CondensateExample.vue index 630e6a1645689ca269e8f26d100636f6534549e0..2a6312e64bf2f0d08b56b0c4b8bfaf778bc73b3d 100644 --- a/web/src/components/CondensateExample.vue +++ b/web/src/components/CondensateExample.vue @@ -11,7 +11,7 @@ export default { CondensateDetailPage }, mounted: function () { - // console.log(this.$route.name) + } } </script> \ No newline at end of file diff --git a/web/src/components/CondensateUpdateItemsTable.vue b/web/src/components/CondensateUpdateItemsTable.vue index dcff327b35f035be9f587e1489aaae74e1cc8871..81761df4358a4e5533922177de632b9eeddb050f 100644 --- a/web/src/components/CondensateUpdateItemsTable.vue +++ b/web/src/components/CondensateUpdateItemsTable.vue @@ -120,18 +120,7 @@ export default { } else { return data; } - // console.log(_.flatMap(row.condensates, c => c.data_sources)) - // if (!vm.proteinDriverCriterion) { - // return; - // } - // let dat = vm.proteinDriverCriterion[row.uniprot_id]; - // if (dat) { - - // const val= dat.map(i=> i==='self_ps'? dat[i]='Self-PS': _.startCase(i)) - - // return val.join(', '); - // } - // return ''; + }, }, { @@ -141,14 +130,7 @@ export default { { title: 'Status', data: 'attributes.Status', - // render: function(row, data, index){ - // console.log("in color new", data); - // if(data.attributes.Status === 'rejected'){ - // console.log("working in rejected"); - // $(row).find('td:eq(3)').css('color', 'red'); - // } - - // } + fnCreatedCell: (nTd, sData, oData) => { if (sData === 'synced') { $(nTd).html( @@ -199,48 +181,9 @@ export default { text-center view-link"> View </button>`, - // render: function (data, type, row, meta) { - - // if(vm.getRole === "Maintainer"){ - // console.log(" yea true", data.data.attributes); - // console.log(data.data.attributes); - // if(data.data.attributes.Status==="requested"){ - // console.log(data.data.attributes.Status); - // return `<button class="btn btn-primary edit-link btn-outline font-bold" style="font-weight:bold"> - // Accept<i class="fa fa-edit" style="font-weight:bold"></i> - // </button>` - // } - // else{ - // return `<button class="btn btn-primary edit-link btn-outline font-bold" style="font-weight:bold"> - // Synced<i class="fa fa-edit" style="font-weight:bold"></i> - // </button>` - // } - // } - - // }, - // fnCreatedCell: (nTd, sData, oData) => { - // $(nTd).html( - // `<button class="btn btn-primary edit-link btn-outline font-bold" style="font-weight:bold"> - // <i class="fa fa-edit" style="font-weight:bold"></i> - // </button> - // <button class="btn btn-danger delete-link btn-outline font-bold" style="font-weight:bold"> - // <i class="fa fa-trash" style="font-weight:bold"></i> - // </button> - // ` - // ); - // }, + }, - // { - // title: "Reviewer", - // data: "attributes.reviewedBy", - // render: function (data, type, row, meta) { - // if (data.data) { - // return data.data.attributes.username; - // } else { - // return ""; - // } - // }, - // }, + ]; vm.headers = columns; @@ -304,13 +247,12 @@ export default { async fetchCallback(data, aoData, fnCallback) { let vm = this; - // console.log(aoData) + let orderItem = aoData.find((x) => x.name === 'order'); let startItem = aoData.find((x) => x.name === 'start'); let lengthItem = aoData.find((x) => x.name === 'length'); let searchItem = aoData.find((x) => x.name === 'search'); - // console.log(`length = ${lengthItem.value}, offset = ${startItem.value}`) - // console.log(`orderItem = ${orderItem.value}, searchItem = ${searchItem.value.value}`) + const page = startItem.value / lengthItem.value + 1; @@ -342,10 +284,10 @@ export default { let order = ['SubmittedAt:desc']; if (orderItem.value.length > 0) { orderItem.value.forEach(function (data) { - // console.log(data) + order = `${columns[data.column]}:${data.dir}`; }); - // console.log(order) + } query['sort'] = order; diff --git a/web/src/components/ContributorListTable.vue b/web/src/components/ContributorListTable.vue index b7497ec43da2d2cb30a5f24978112e40549617cd..73fdba0ec526c42225e932071e7d71f83b83b7b9 100644 --- a/web/src/components/ContributorListTable.vue +++ b/web/src/components/ContributorListTable.vue @@ -173,7 +173,7 @@ export default { } catch (err) { this.error = true; this.errorMsg = `${err.message} Internal Error, please write a mail to DDCode Admin`; - console.log(err); + } }, }, diff --git a/web/src/components/DDCODE/fetchCondensate.vue b/web/src/components/DDCODE/fetchCondensate.vue index c424f866c64f35d7469a09041f18bd0968b30445..b8357c071e54daaeb583fa58e04bb21b8cc45229 100644 --- a/web/src/components/DDCODE/fetchCondensate.vue +++ b/web/src/components/DDCODE/fetchCondensate.vue @@ -30,7 +30,7 @@ export default { mounted() { const vm = this; // /* eslint-disable no-console */ - // console.log(vm.locus); + vm.getItems(); }, methods: { @@ -38,7 +38,7 @@ export default { const vm = this; // /* eslint-disable no-console */ - // console.log(vm.incDesc); + vm.loading = true; @@ -48,10 +48,10 @@ export default { let url = `${host}/condensates/${vm.condensate}`; - console.log('url is', url); + if (vm.condensate && !_.isEmpty(vm.condensate)) { - // console.log('True'); + try { const res = await fetch(url, { method: 'GET', @@ -74,29 +74,12 @@ export default { vm.loading = false; vm.response = response; - // console.log(response); - // if (response && !_.isEmpty(response)) { - // this.response = _.flatMap(response, (n) => [{ text: n.name, style: 'background-color: ' + n.color }]); - // } + }, 10); - // .then(response => response.json()) - // .then((response) => { - // /* eslint-disable no-console */ - // console.log(response); - - // setTimeout(() => { - // vm.loading = false; - // vm.response = response - - // // console.log(response); - // // if (response && !_.isEmpty(response)) { - // // this.response = _.flatMap(response, (n) => [{ text: n.name, style: 'background-color: ' + n.color }]); - // // } - // }, 10); - // }); + } catch (err) { - console.log('in catch', err.message); + vm.loading = false; vm.response = ''; vm.fetchError = `${err.message} Internal Error, please write a mail to CDCode Admin.`; diff --git a/web/src/components/DDCODE/fetchProtein.vue b/web/src/components/DDCODE/fetchProtein.vue index 813415f4cdc940fd9269cce02b8b350547705cca..b722c7384c7ea0c5b8f5633b46054d323c33a93e 100644 --- a/web/src/components/DDCODE/fetchProtein.vue +++ b/web/src/components/DDCODE/fetchProtein.vue @@ -34,7 +34,7 @@ export default { mounted() { const vm = this; // /* eslint-disable no-console */ - // console.log(vm.locus); + vm.getItems(); }, methods: { @@ -42,7 +42,7 @@ export default { const vm = this // /* eslint-disable no-console */ - // console.log(vm.incDesc); + vm.loading = true @@ -62,7 +62,7 @@ export default { Authorization: `Bearer ${apikey}` } }) - // console.log('protein res', res); + if(!res.ok){ vm.loading = false; vm.response = '' @@ -74,26 +74,9 @@ export default { setTimeout(() => { vm.loading = false; vm.response = response; - // console.log(response); - // if (response && !_.isEmpty(response)) { - // this.response = _.flatMap(response, (n) => [{ text: n.name, style: 'background-color: ' + n.color }]); - // } + }, 10); - // .then(response => response.json()) - // .then((response) => { - // // /* eslint-disable no-console */ - // // console.log(response); - - // setTimeout(() => { - // vm.loading = false; - // vm.response = response; - - // // console.log(response); - // // if (response && !_.isEmpty(response)) { - // // this.response = _.flatMap(response, (n) => [{ text: n.name, style: 'background-color: ' + n.color }]); - // // } - // }, 10); - // }); + }catch(err){ vm.loading = false; vm.response = '' diff --git a/web/src/components/DDCODE/fetchPubMed.vue b/web/src/components/DDCODE/fetchPubMed.vue index 2ea54d31617be66eade38400d97591232a6b1d86..c92ce641323cc070ebe4e52f85ddff1d47db686a 100644 --- a/web/src/components/DDCODE/fetchPubMed.vue +++ b/web/src/components/DDCODE/fetchPubMed.vue @@ -25,7 +25,7 @@ export default { mounted() { const vm = this // /* eslint-disable no-console */ - // console.log(vm.locus); + vm.getItems(); }, methods: { @@ -33,7 +33,7 @@ export default { const vm = this; const pubMedId = vm.link.substring(vm.link.lastIndexOf('/') + 1); - // console.log(pubMedId); + const request = url + pubMedId; diff --git a/web/src/components/DDCODE/fetchSpecies.vue b/web/src/components/DDCODE/fetchSpecies.vue index f7f3ecfa0cc6abd36d907918354e8bbb37fb8c15..a8a2b084212fafe296f0448f3132c94b12af26aa 100644 --- a/web/src/components/DDCODE/fetchSpecies.vue +++ b/web/src/components/DDCODE/fetchSpecies.vue @@ -25,14 +25,14 @@ mounted() { const vm = this // /* eslint-disable no-console */ - // console.log(vm.locus); + vm.getItems(); }, methods: { getItems() { const vm = this; - // console.log(host) + if(vm.isDev) { host = require('../js/const').devHost; diff --git a/web/src/components/DDCODE/fetchStats.vue b/web/src/components/DDCODE/fetchStats.vue index 3c16250fadcf534ea8cd046aa24645c04c88574a..af9206e40f65be8032966c7378b2965284956f56 100644 --- a/web/src/components/DDCODE/fetchStats.vue +++ b/web/src/components/DDCODE/fetchStats.vue @@ -27,14 +27,14 @@ export default { mounted() { const vm = this // /* eslint-disable no-console */ - // console.log(vm.locus); + vm.getItems(); }, methods: { async getItems() { const vm = this; - // console.log(host) + if(vm.isDev) { host = require('../js/const').devHost; @@ -72,7 +72,7 @@ export default { // }); }catch(error){ - console.log('true'); + vm.loading = false; vm.response = '' vm.fetchError = `${error.message} Internal Error, please write a mail to CDCode Admin.` diff --git a/web/src/components/DDCODE/fetchWikiMainPage.vue b/web/src/components/DDCODE/fetchWikiMainPage.vue index f700796b9006ccc88631297f8ab17585a05b7871..dd8d2a203525740db52cf6b8230c5029dc147657 100644 --- a/web/src/components/DDCODE/fetchWikiMainPage.vue +++ b/web/src/components/DDCODE/fetchWikiMainPage.vue @@ -25,14 +25,14 @@ export default { mounted() { const vm = this // /* eslint-disable no-console */ - // console.log(vm.locus); + vm.getItems(); }, methods: { getItems() { const vm = this; - // console.log(host) + if(vm.isDev) { host = require('../js/const').devHost; diff --git a/web/src/components/DataTable.vue b/web/src/components/DataTable.vue index 6372fe271bc78cc48f125c411ca009485759a891..909855b73d9780209d93869c2fc8e4dcd9dbfc91 100644 --- a/web/src/components/DataTable.vue +++ b/web/src/components/DataTable.vue @@ -45,7 +45,7 @@ mounted() { const vm = this; vm.createTable(vm.id, vm.data); - // console.log('in data table condensate data', vm.data); + }, // watch: { // selectedItem: function update(newValue) { @@ -65,7 +65,7 @@ const url = vm.category === 'protein' ? `/protein/${id}` : `/condensate/${id}` // eslint-disable-next-line - // console.log(url) + vm.$router.push(url) // window.location = url // window.open(url) @@ -164,16 +164,7 @@ } }, }, - // { - // title: 'Proteins', - // data: 'proteins', - // fnCreatedCell: (nTd, sData, oData) => { - // // console.log(sData) - // if(sData) { - // $(nTd).html(sData.length > 4 ? sData.splice(0, 4).join(', ') + ' ...' : sData.join(', ')); - // } - // } - // }, + { title: 'No. Proteins', render: function ( data, type, row, meta ) { @@ -195,7 +186,7 @@ return data; }, fnCreatedCell: (nTd, sData, oData) => { - // console.log(sData) + if(sData) { $(nTd).html(getRating(sData).join('\n')); } else { @@ -220,7 +211,7 @@ const columns = vm.category === 'protein' ? proteinColumns : condensateColumns; - // console.log(columns) + const doms = vm.category === 'protein' ? '<"row"<"col-sm-3"f><"#function_filter.col-sm-3"><"col-sm-6"p>><"row"t><"row"<"col-sm-4"i><"col-sm-8"p>>' : '<"row"<"col-sm-3"f><"col-sm-9"p>><"row"t><"row"<"col-sm-4"i><"col-sm-8"p>>'; @@ -241,7 +232,7 @@ initComplete: function () { if(vm.category === 'protein') { this.api().columns([3]).every( function () { - // console.log(this); + let column = this; let select = $('<select class="form-control input-sm"><option value=""></option></select>') .appendTo( $('#function_filter').empty() ) @@ -294,7 +285,7 @@ e.preventDefault() const tr = $(e.target).parent().parent(); const row = table.row(tr); - // console.log(row.data().proteinName) + if (vm.category === 'protein') { vm.moveDetailPage(row.data().uniprot_id); } else { diff --git a/web/src/components/Datatable/CondensateDataTable.vue b/web/src/components/Datatable/CondensateDataTable.vue index c3e0398e44c327eadcd5ef96f0f1f8ceacd1631d..c5d2cbc11273ae81675231dc7484f6b3dabf4cf6 100644 --- a/web/src/components/Datatable/CondensateDataTable.vue +++ b/web/src/components/Datatable/CondensateDataTable.vue @@ -98,7 +98,7 @@ export default { // title: 'Proteins', // data: 'proteins', // fnCreatedCell: (nTd, sData, oData) => { - // // console.log(sData) + // // if (sData) { // $(nTd).html( // sData.length > 4 @@ -133,7 +133,7 @@ export default { return data; }, fnCreatedCell: (nTd, sData, oData) => { - // console.log(sData) + if (sData) { $(nTd).html(getRating(sData).join('\n')); } else { @@ -191,16 +191,13 @@ export default { async fetchCallback(data, aoData, fnCallback) { let vm = this; - // console.log(aoData) + let orderItem = aoData.find((x) => x.name === 'order'); let startItem = aoData.find((x) => x.name === 'start'); let lengthItem = aoData.find((x) => x.name === 'length'); let searchItem = aoData.find((x) => x.name === 'search'); let functionalType = aoData.find((x) => x.name === 'columns').value[3]; - // console.log(functionalType.search.value) - - // console.log(`length = ${lengthItem.value}, offset = ${startItem.value}`) - // console.log(`orderItem = ${orderItem.value}, searchItem = ${searchItem.value.value}`) + const page = startItem.value / lengthItem.value + 1; @@ -216,14 +213,14 @@ export default { let order = []; if (orderItem.value.length > 0) { orderItem.value.forEach(function (data) { - // console.log(data) + if (data.dir === 'desc') { order.push(`-${columns[data.column]}`); } else { order.push(`${columns[data.column]}`); } }); - // console.log(order) + } if (vm.isDev) { @@ -277,7 +274,7 @@ export default { fnCallback(dat); } } catch (error) { - // console.log('error', error); + this.error = true; this.errorMsg = error.response.data.error.message + @@ -340,7 +337,7 @@ export default { link.click(); } } catch (error) { - // console.error(error) + this.error = true; this.errorMsg = 'You are not authorized to access this item.'; } diff --git a/web/src/components/Datatable/ProteinDataTable.vue b/web/src/components/Datatable/ProteinDataTable.vue index c000335c45005ee2b5b95b0fd1d93975cf6c7e4d..978bb7745f558280055651b35411f0c8299e2dc0 100644 --- a/web/src/components/Datatable/ProteinDataTable.vue +++ b/web/src/components/Datatable/ProteinDataTable.vue @@ -43,7 +43,7 @@ export default { mounted() { const vm = this; vm.createTable(vm.id); - // console.log('in data table condensate data', vm.data); + }, methods: { @@ -133,7 +133,7 @@ export default { this.api() .columns([3]) .every(function () { - // console.log(this); + let column = this; let select = $( '<select class="form-control input-sm"><option value=""></option>' + @@ -147,7 +147,7 @@ export default { .on('change', function () { var val = $.fn.dataTable.util.escapeRegex($(this).val()); - // console.log(val) + // column // .search( val ? val === 'null' ? '^\\s*$' : '^'+val+'$' : '', true, false ) @@ -186,16 +186,13 @@ export default { async fetchCallback(data, aoData, fnCallback) { let vm = this; - // console.log(aoData) + let orderItem = aoData.find((x) => x.name === 'order'); let startItem = aoData.find((x) => x.name === 'start'); let lengthItem = aoData.find((x) => x.name === 'length'); let searchItem = aoData.find((x) => x.name === 'search'); let functionalType = aoData.find((x) => x.name === 'columns').value[3]; - // console.log(functionalType.search.value) - // console.log(`length = ${lengthItem.value}, offset = ${startItem.value}`) - // console.log(`orderItem = ${orderItem.value}, searchItem = ${searchItem.value.value}`) const page = startItem.value / lengthItem.value + 1; @@ -212,14 +209,14 @@ export default { let order = []; if (orderItem.value.length > 0) { orderItem.value.forEach(function (data) { - // console.log(data) + if (data.dir === 'desc') { order.push(`-${columns[data.column]}`); } else { order.push(`${columns[data.column]}`); } }); - // console.log(order) + } if (vm.isDev) { @@ -268,7 +265,7 @@ export default { fnCallback(dat); } } catch (error) { - // console.error(error) + this.error = true; this.errorMsg = error.response.data.error.message + @@ -323,7 +320,7 @@ export default { link.click(); } } catch (error) { - // console.error(error) + this.error = true; this.errorMsg = 'You are not authorized to access this item.'; } diff --git a/web/src/components/EditProteinDetails.vue b/web/src/components/EditProteinDetails.vue index f51028daf3661605c02d880303feaf2a51b08636..08e123ba61a88d84459d4dec1949c59cfc308e22 100644 --- a/web/src/components/EditProteinDetails.vue +++ b/web/src/components/EditProteinDetails.vue @@ -275,7 +275,7 @@ export default { let url = `${host}/api/update-items`; let canonicalId = responceData.condensates[0].canonical_id; - console.log(canonicalId); + let data = { Entity: 'condensate', EntityId: canonicalId, @@ -285,7 +285,7 @@ export default { Status: 'requested', }; - console.log(data); + try { await this.axios.post( @@ -299,7 +299,7 @@ export default { ); this.message = 'Request submitted successfully!'; } catch (e) { - console.error(e); + this.serverError = true; this.message = e.message || 'Something went wrong, please try again later!'; @@ -307,7 +307,7 @@ export default { }, fetchPubMedId(item) { const vm = this; - // console.log(item) + const url = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&retmode=json&id='; const request = url + item; diff --git a/web/src/components/Footers.vue b/web/src/components/Footers.vue index 6d8d672ddb678f7c4fe719bb97df15c3425074be..7ae1c417607bd7a761e273f990b6f8b2fc981c44 100644 --- a/web/src/components/Footers.vue +++ b/web/src/components/Footers.vue @@ -190,7 +190,7 @@ export default { name: 'Footer', mounted: function () { - // console.log(this.$route.name) + }, }; </script> diff --git a/web/src/components/LandingPage.vue b/web/src/components/LandingPage.vue index bf6fce9e926ec734e19c43da3d58c6fa08b0d70b..5921c3cce0ecd1b31ea31e173d508b266cebd091 100644 --- a/web/src/components/LandingPage.vue +++ b/web/src/components/LandingPage.vue @@ -408,7 +408,7 @@ export default { ); this.$store.dispatch('Param/removeProtein', idx); obj.deleteTag(); - // console.log(this.$store.getters['Param/proteinList']) + }, }, }, @@ -416,8 +416,7 @@ export default { selected: { handler: function (key) { this.keyword = key; - // console.log(key); - // this.searchWithKeyword(); + }, deep: true, }, @@ -432,16 +431,13 @@ export default { }, suggestion: { handler: function (val) { - console.log(val); + // this.searchWithKeyword(); }, }, }, mounted() { - // console.log(this.keyword) - // console.log(this.$route) - // console.log(this.$route.query) - // console.log(this.$route.query.q) + this.search(this.$route.query.q, this.$route.query.t, this.$route.query.s); window.twttr = (function (d, s, id) { @@ -519,8 +515,7 @@ export default { ? `${host}/${vm.pick}s?fields=gene_name,name,uniprot_id,species_name&query=${query}&size=20000` : `${host}/${vm.pick}s?fields=gene_name,name,uniprot_id,species_name&query=${query}&species_tax_id=${taxId}&size=10000`; - // console.log(process.env.VUE_APP_TITLE) - // console.log(process.env.VUE_APP_API_KEY) + return fetch(url, { method: 'GET', @@ -532,7 +527,7 @@ export default { }) .then((response) => response.json()) .then((json) => { - // console.log(json.data); + const ret = _.uniqBy( _.map(json.data, (c) => { if (c.gene_name) { @@ -561,15 +556,14 @@ export default { ret.push({ id: '#' + query, type: 'search' }); } - // console.log(ret); + return ret; }); }, searchWithKeyword() { const vm = this; - // console.log(/\((\d+)\)$/gm.exec(vm.species)) - // console.log(vm.species); + const taxId = vm.species === 'All' ? 'all' @@ -577,10 +571,7 @@ export default { ? 'null' : /\((\d+)\)$/gm.exec(vm.species)[1]; const page = 1; - // console.log(`http://${host}/proteins?query=${vm.keyword}&species_tax_id=${taxId}&page=${page}`) - // vm.searchKeyword = vm.keyword; - // console.log(vm.pick) - // vm.searchPick = vm.pick; + vm.$router.replace({ name: 'home', @@ -600,14 +591,11 @@ export default { }, }); - // vm.search(this.$route.query.q, this.$route.query.t, this.$route.query.s) - // /* eslint-disable no-console */ - // console.log(this.searchKeyword) + }, search(q, t, s) { const vm = this; - // const page = 1; - // console.log(`http://${host}/proteins?query=${vm.keyword}&species_tax_id=${taxId}&page=${page}`) + if (q) { vm.keyword = q; vm.searchKeyword = vm.keyword; @@ -617,19 +605,13 @@ export default { vm.speciesOption = s; } - // console.log(vm.pick) + if (t) { vm.searchPick = t; vm.pick = t; } - // if (t === 'protein') { - // vm.$refs.search.fetchProteinList(q, s); - // } else if (t === 'condensate') { - // vm.$refs.search.fetchCondensateList(q, s); - // } - // /* eslint-disable no-console */ - // console.log(this.searchKeyword) + }, }, }; diff --git a/web/src/components/Links.vue b/web/src/components/Links.vue index 23f8e89730411a9ae3fe714112aeb7d10930f191..85cd48ca4dce6d927fbc87ea6c5db5cfe6e68783 100644 --- a/web/src/components/Links.vue +++ b/web/src/components/Links.vue @@ -215,11 +215,7 @@ export default { mounted: function () { const vm = this; - // console.log(vm.userData) - // console.log(this.$route.name) - // if(vm.userData !== null) { - // vm.$router.push('/profile') - // } + }, methods: { openCondensateMenu() { diff --git a/web/src/components/LlpsTable.vue b/web/src/components/LlpsTable.vue index bae38aba2c47395c344355d7490ce0ec0afff567..bdc97a2818b149de53e4fa4445acf03104ef7145 100644 --- a/web/src/components/LlpsTable.vue +++ b/web/src/components/LlpsTable.vue @@ -134,7 +134,7 @@ export default { // eslint-disable-next-line const url = `/protein/${uniprot_id}`; // // eslint-disable-next-line - // console.log(url) + // this.$router.push(url) // window.open(url); vm.$router.push(url); @@ -144,7 +144,7 @@ export default { // eslint-disable-next-line const url = `https://www.uniprot.org/uniprot/${uniprot_id}`; // // eslint-disable-next-line - // console.log(url) + // window.open(url); vm.$router.push(url); }, @@ -161,7 +161,7 @@ export default { </a>`; }, fetchPubMedId(item) { - // console.log(item) + if (item) { const url = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&retmode=json&id='; @@ -257,7 +257,7 @@ export default { // data: 'species_name', // className: "text-nowrap", // fnCreatedCell: (nTd, sData, oData) => { - // // console.log(sData) + // // let data = vm.map[oData.uniprot_id]; // if(data) { // // $(nTd).html(data.filter(a => a.startsWith('http')).join('\n')); @@ -284,7 +284,7 @@ export default { } }, fnCreatedCell: (nTd, sData, oData) => { - // console.log(sData) + if (vm.pubmed) { let data = vm.pubmed[oData.uniprot_id]; @@ -308,7 +308,7 @@ export default { // className: 'whitespace-normal', // defaultContent: '<i>No data</i>', // render: function (data, type, row, meta) { - // // console.log(_.flatMap(row.condensates, c => c.data_sources)) + // // if(!vm.proteinFunctionalType){ // return; // } @@ -327,7 +327,7 @@ export default { // className: 'whitespace-normal', // defaultContent: '<i>No data</i>', // render: function (data, type, row, meta) { - // // console.log(_.flatMap(row.condensates, c => c.data_sources)) + // // if(!vm.proteinExperimentalEvidence){ // return; // } @@ -345,7 +345,7 @@ export default { // className: 'whitespace-normal', // defaultContent: '<i>No data</i>', // render: function (data, type, row, meta) { - // // console.log(_.flatMap(row.condensates, c => c.data_sources)) + // // if(!vm.proteinDriverCriterion){ // return // } @@ -362,7 +362,7 @@ export default { // data: 'uniprot_id', // className: 'text-nowrap', // render: function (data, type, row, meta) { - // // console.log(_.flatMap(row.condensates, c => c.data_sources)) + // // let dat = vm.dbTags[row.uniprot_id]; // if (dat) { // return dat.join(', '); @@ -392,7 +392,7 @@ export default { className: 'text-nowrap', data: 'uniprot_id', render: function (data, type, row, meta) { - // console.log(_.flatMap(row.condensates, c => c.data_sources)) + let dat = vm.map[row.uniprot_id]; if (dat) { return dat; @@ -400,7 +400,7 @@ export default { return ''; }, fnCreatedCell: (nTd, sData, oData) => { - // console.log(sData) + let data = vm.map[oData.uniprot_id]; if (data) { $(nTd).html(getRating(data).join('\n')); @@ -477,7 +477,7 @@ export default { // data: 'uniprot_id', // className: "text-nowrap", // fnCreatedCell: (nTd, sData, oData) => { - // // console.log(sData) + // // let data = vm.map[oData.uniprot_id]; // // if(data) { @@ -510,7 +510,7 @@ export default { } }, fnCreatedCell: (nTd, sData, oData) => { - // console.log(sData) + if (vm.pubmed) { let data = vm.pubmed[oData.uniprot_id]; if (data) { @@ -533,7 +533,7 @@ export default { className: 'whitespace-normal break-words', render: function (data, type, row, meta) { - // console.log(_.flatMap(row.condensates, c => c.data_sources)) + if (!vm.proteinFunctionalType) { return; } @@ -552,7 +552,7 @@ export default { className: 'whitespace-normal break-words', render: function (data, type, row, meta) { - // console.log(_.flatMap(row.condensates, c => c.data_sources)) + if (!vm.proteinExperimentalEvidence) { return; } @@ -574,7 +574,7 @@ export default { className: 'whitespace-normal break-words', render: function (data, type, row, meta) { - // console.log(_.flatMap(row.condensates, c => c.data_sources)) + if (!vm.proteinDriverCriterion) { return; } @@ -594,7 +594,7 @@ export default { // data: 'uniprot_id', // className: 'whitespace-normal', // render: function (data, type, row, meta) { - // // console.log(_.flatMap(row.condensates, c => c.data_sources)) + // // let dat = vm.dbTags[row.uniprot_id]; // if (dat) { // return dat.join(', '); @@ -625,10 +625,10 @@ export default { data: 'uniprot_id', name: 'confidenceScore', render: function (data, type, row, meta) { - // console.log(_.flatMap(row.condensates, c => c.data_sources)) + let dat = vm.map[row.uniprot_id]; if (dat) { - // console.log(getRatingValue(vm.map[row.uniprot_id])) + return dat; } return ''; @@ -829,7 +829,7 @@ export default { }); $(tableBody).on('mouseover', 'tr td a.pubmed-link', (e) => { e.preventDefault(); - // console.log(e.target.id) + vm.fetchPubMedId(e.target.id); }); $('#download').on('click', (e) => { diff --git a/web/src/components/Navigation/TheNavBar.vue b/web/src/components/Navigation/TheNavBar.vue index f151ccd2b95e09e2a7ca22001334caebd9b15f83..65ae94aa327ad8576d911bd105c129148b81f0bf 100644 --- a/web/src/components/Navigation/TheNavBar.vue +++ b/web/src/components/Navigation/TheNavBar.vue @@ -550,6 +550,8 @@ export default { let url = `${host}/api/novel-condensate/synced`; + + vm.axios.get( url, ).then((dat) => { diff --git a/web/src/components/NovelCondensateRequests.vue b/web/src/components/NovelCondensateRequests.vue index cf7be23c1b53b2743f19dce8d185f39189afb0f8..01783ed67df7ec2bdcd6b98230bf15ff8ddc1271 100644 --- a/web/src/components/NovelCondensateRequests.vue +++ b/web/src/components/NovelCondensateRequests.vue @@ -114,7 +114,7 @@ export default { }, fnCreatedCell: (nTd, sData, oData) => { if(sData) { - // console.log(oData) + // $(nTd).html(`${oData.attributes.submittedBy.data.id}`); $(nTd).html(`<a class='resource-link' href="/updateuser/${oData.attributes.submittedBy.data.id}">${sData.data.attributes.username}</a>`); } @@ -207,13 +207,12 @@ export default { async fetchCallback(data, aoData, fnCallback) { let vm = this; - // console.log(aoData) + let orderItem = aoData.find((x) => x.name === 'order'); let startItem = aoData.find((x) => x.name === 'start'); let lengthItem = aoData.find((x) => x.name === 'length'); let searchItem = aoData.find((x) => x.name === 'search'); - // console.log(`length = ${lengthItem.value}, offset = ${startItem.value}`) - // console.log(`orderItem = ${orderItem.value}, searchItem = ${searchItem.value.value}`) + const page = startItem.value / lengthItem.value + 1; @@ -245,10 +244,10 @@ export default { let order = ['SubmittedAt:desc']; if (orderItem.value.length > 0) { orderItem.value.forEach(function (data) { - // console.log(data) + order = `${columns[data.column]}:${data.dir}`; }); - // console.log(order) + } query['sort'] = order; diff --git a/web/src/components/ProteinDetailPage.vue b/web/src/components/ProteinDetailPage.vue index 0082d706c22ec3a85701a8ab795c904c2f516781..9e384fda8bcb5c5c77ea26cca7ef737a2f16417d 100644 --- a/web/src/components/ProteinDetailPage.vue +++ b/web/src/components/ProteinDetailPage.vue @@ -556,7 +556,7 @@ export default { computed: { getUserData() { const userRole = this.$store.getters['User/userRole']; - // console.log('role is', userRole); + return userRole; }, }, @@ -611,7 +611,7 @@ export default { }, fetchPubMedId(item) { const vm = this; - // console.log(item) + const url = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&retmode=json&id='; const request = url + item; @@ -727,31 +727,14 @@ export default { this.toasterIsOpen = false; }, 2000); } catch (e) { - console.error(e); + this.message = e.message || 'Something went wrong, please try again later!'; this.isSubmitted = true; this.error = true; } - // try { - // const res=await this.axios.get( - // `${host} - // /api/update-item/findCondensate/${response.data.canonical_id}`, - // { - // headers: { - // Authorization: `Bearer ${this.jwt}`, - // }, - // } - // ); - - // console.log(await res) - - // } catch (e) { - // console.error(e); - - // } }, }, }; diff --git a/web/src/components/ProteinExample.vue b/web/src/components/ProteinExample.vue index 4940eca81937bed6dad98fb5b0453aabffc9b394..3137b63b1d2376f01bd1723cfeef7c21308e9169 100644 --- a/web/src/components/ProteinExample.vue +++ b/web/src/components/ProteinExample.vue @@ -11,7 +11,7 @@ export default { ProteinDetailPage }, mounted: function () { - // console.log(this.$route.name) + } } </script> \ No newline at end of file diff --git a/web/src/components/ProteinUpdateItemTable.vue b/web/src/components/ProteinUpdateItemTable.vue index f2a802c62fe8e7d79bdc1776085c09eab674c490..b05998e1dfe0a8f1dc237453478382a9d89459db 100644 --- a/web/src/components/ProteinUpdateItemTable.vue +++ b/web/src/components/ProteinUpdateItemTable.vue @@ -214,13 +214,12 @@ export default { async fetchCallback(data, aoData, fnCallback) { let vm = this; - // console.log(aoData) + let orderItem = aoData.find((x) => x.name === 'order'); let startItem = aoData.find((x) => x.name === 'start'); let lengthItem = aoData.find((x) => x.name === 'length'); let searchItem = aoData.find((x) => x.name === 'search'); - // console.log(`length = ${lengthItem.value}, offset = ${startItem.value}`) - // console.log(`orderItem = ${orderItem.value}, searchItem = ${searchItem.value.value}`) + const page = startItem.value / lengthItem.value + 1; @@ -254,10 +253,10 @@ export default { let order = ['SubmittedAt:desc']; if (orderItem.value.length > 0) { orderItem.value.forEach(function (data) { - // console.log(data) + order = `${columns[data.column]}:${data.dir}`; }); - // console.log(order) + } query['sort'] = order; @@ -299,19 +298,13 @@ export default { }); let url = `${host}/api/update-item/filterProteinRequest/${vm.data}?${queryString}`; - // console.log('protein udate', url); + const jwt = vm.jwt; if (jwt === null) { return; } - // let dat = { - // draw: aoData.draw, - - // data: vm.data - // } - - // fnCallback(dat) + try { const res = await this.axios.get(url, { diff --git a/web/src/components/Search.vue b/web/src/components/Search.vue index 3a48bf0ffb72f9204d38d8ade7b24a6e71a2005f..b2fdb66ed53b3b3d33ac2e787d51c50dfc488cea 100644 --- a/web/src/components/Search.vue +++ b/web/src/components/Search.vue @@ -28,7 +28,7 @@ const vm = this // /* eslint-disable no-console */ - // console.log(vm.incDesc); + vm.loading = true @@ -52,16 +52,13 @@ .then(response => response.json()) .then((response) => { // /* eslint-disable no-console */ - // console.log(response); + setTimeout(() => { vm.loading = false; vm.response = response - // console.log(response); - // if (response && !_.isEmpty(response)) { - // this.response = _.flatMap(response, (n) => [{ text: n.name, style: 'background-color: ' + n.color }]); - // } + }, 10); }); } else { @@ -79,16 +76,13 @@ .then(response => response.json()) .then((response) => { // /* eslint-disable no-console */ - // console.log(response); + setTimeout(() => { vm.loading = false; vm.response = response - // console.log(response); - // if (response && !_.isEmpty(response)) { - // this.response = _.flatMap(response, (n) => [{ text: n.name, style: 'background-color: ' + n.color }]); - // } + }, 10); }); } @@ -97,7 +91,7 @@ const vm = this // /* eslint-disable no-console */ - // console.log(vm.incDesc); + vm.loading = true @@ -126,16 +120,13 @@ .then(response => response.json()) .then((response) => { // /* eslint-disable no-console */ - // console.log(response); + setTimeout(() => { vm.loading = false; vm.response = response - // console.log(response); - // if (response && !_.isEmpty(response)) { - // this.response = _.flatMap(response, (n) => [{ text: n.name, style: 'background-color: ' + n.color }]); - // } + }, 10); }); } else { @@ -152,13 +143,13 @@ .then(response => response.json()) .then((response) => { // /* eslint-disable no-console */ - // console.log(response); + setTimeout(() => { vm.loading = false; vm.response = response - // console.log(response); + // if (response && !_.isEmpty(response)) { // this.response = _.flatMap(response, (n) => [{ text: n.name, style: 'background-color: ' + n.color }]); // } diff --git a/web/src/components/SearchPage.vue b/web/src/components/SearchPage.vue index 581c0abfe4ff344b2df072c2029fa8e6a0c2b185..140041f91b132ba6768e388405c46138b829341f 100644 --- a/web/src/components/SearchPage.vue +++ b/web/src/components/SearchPage.vue @@ -73,10 +73,7 @@ export default { }; }, mounted() { - // console.log(this.keyword) - // console.log(this.$route) - // console.log(this.$route.query) - // console.log(this.$route.query.q) + this.searchWithKeyword( this.$route.query.q, this.$route.query.t, @@ -102,8 +99,7 @@ export default { ? `${host}/${vm.pick}s?query=${query}&size=10000` : `${host}/${vm.pick}s?query=${query}&species_tax_id=${taxId}&size=10000`; - // console.log(process.env.VUE_APP_TITLE) - // console.log(process.env.VUE_APP_API_KEY) + return fetch(url, { method: 'GET', @@ -119,9 +115,9 @@ export default { searchWithKeyword(q, t, s) { const vm = this; // const page = 1; - // console.log(`http://${host}/proteins?query=${vm.keyword}&species_tax_id=${taxId}&page=${page}`) + vm.keyword = q; - // console.log(vm.pick) + vm.searchPick = t; if (t === 'protein') { @@ -164,7 +160,7 @@ export default { } } // /* eslint-disable no-console */ - // console.log(this.searchKeyword) + }, }, }; diff --git a/web/src/components/SpeciesChart.vue b/web/src/components/SpeciesChart.vue index 80cc981533b03056bf96031ad156622caa13fd88..110e8d77ce4e7ba816b188510aabd89f26de9901 100644 --- a/web/src/components/SpeciesChart.vue +++ b/web/src/components/SpeciesChart.vue @@ -56,7 +56,7 @@ export default { const chart = am4core.create(chartRef, am4charts.PieChart3D); chart.hiddenState.properties.opacity = 0; // this creates initial fade-in - // console.log(series); + const filter = 10; let d = _.filter(data, c => c.count > filter) diff --git a/web/src/components/TagsInput.vue b/web/src/components/TagsInput.vue index 37849c83d5366727ca498c2fceabf7669519a97c..bcfd241e9ef2a67e5fc04d331c32cc4e3a953149 100644 --- a/web/src/components/TagsInput.vue +++ b/web/src/components/TagsInput.vue @@ -588,7 +588,7 @@ export default { return { valid: true, msg: "Valid Uniprot ID." }; } } catch (err) { - console.log("error", err); + return { valid: false, msg: diff --git a/web/src/components/UI/TheDeleteModal.vue b/web/src/components/UI/TheDeleteModal.vue index 29e6033f321be1c66f13528ff9b749c6f60ed832..4f0fb9408ec5e9067652fab6fcd3dc767ff09a9b 100644 --- a/web/src/components/UI/TheDeleteModal.vue +++ b/web/src/components/UI/TheDeleteModal.vue @@ -236,7 +236,7 @@ export default { async deleteUniprotIdReq() { const vm = this; - // console.log(host) + if (vm.isDev) { host = require('../js/const').devApiHost; @@ -295,7 +295,7 @@ export default { this.comment = ''; } catch (e) { - console.error(e); + this.isLoading = false; this.error = true; this.message = diff --git a/web/src/components/UpdateItemTable.vue b/web/src/components/UpdateItemTable.vue index e4b946eafd2f81ddf26c95264c6c50313aa0d823..0612f2e86f3fde38aa460996d2434bae29359fbe 100644 --- a/web/src/components/UpdateItemTable.vue +++ b/web/src/components/UpdateItemTable.vue @@ -163,7 +163,7 @@ export default { }, fnCreatedCell: (nTd, sData, oData) => { if(sData) { - // console.log(oData) + // $(nTd).html(`${oData.attributes.submittedBy.data.id}`); $(nTd).html(`<a class='resource-link' href="/updateuser/${oData.attributes.submittedBy.data.id}">${sData.data.attributes.username}</a>`); } @@ -236,14 +236,13 @@ export default { async fetchCallback(data, aoData, fnCallback) { let vm = this; - // console.log(aoData) + let orderItem = aoData.find((x) => x.name === 'order'); let startItem = aoData.find((x) => x.name === 'start'); let lengthItem = aoData.find((x) => x.name === 'length'); let searchItem = aoData.find((x) => x.name === 'search'); - // console.log(`length = ${lengthItem.value}, offset = ${startItem.value}`) - // console.log(`orderItem = ${orderItem.value}, searchItem = ${searchItem.value.value}`) + const page = startItem.value / lengthItem.value + 1; @@ -277,10 +276,10 @@ export default { let order = ['SubmittedAt:desc']; if (orderItem.value.length > 0) { orderItem.value.forEach(function (data) { - // console.log(data) + order = `${columns[data.column]}:${data.dir}`; }); - // console.log(order) + } query['sort'] = order; @@ -350,7 +349,7 @@ export default { fnCallback(dat); } } catch (error) { - // console.error(error) + this.error = true; this.errorMsg = 'You are not authorized to access this item.'; // setTimeout(() => vm.$router.go(-1), 2000); diff --git a/web/src/views/AddNewCondensate.vue b/web/src/views/AddNewCondensate.vue index b08c4afe01ca25f3af7e87e537999ec8fda4e4f7..f3cfa761ff025def9dc96b73022d14d674ed9654 100644 --- a/web/src/views/AddNewCondensate.vue +++ b/web/src/views/AddNewCondensate.vue @@ -169,7 +169,7 @@ export default { this.toasterIsOpen = false; }, 2000); } catch (e) { - console.error(e); + this.message = e.message || 'Something went wrong, please try again later!'; this.isSubmitted = true; diff --git a/web/src/views/ForgotPassword.vue b/web/src/views/ForgotPassword.vue index cb470967087317266116373465ba2226ebf34bd1..db79cd4fe2626c6aac77945ef2415e3500796151 100644 --- a/web/src/views/ForgotPassword.vue +++ b/web/src/views/ForgotPassword.vue @@ -213,7 +213,7 @@ export default { this.error = false; this.toasterIsOpen = true; } catch (err) { - console.log(err); + this.isLoading = false; this.error = true; this.errorMsg = `Internal Error, please write a mail to CDCode Admin`; diff --git a/web/src/views/Login.vue b/web/src/views/Login.vue index 99b8bf99a97260421937c08c22454f59ddca6764..94159919cd595e94df216c0948f41315e469ccfe 100644 --- a/web/src/views/Login.vue +++ b/web/src/views/Login.vue @@ -199,7 +199,7 @@ export default { if (vm.isDev) { host = require("@/components/js/const").devApiHost; } - console.log("url is", host); + this.isLoading = true; try { const res = await fetch(`${host}/api/auth/local`, { @@ -250,34 +250,13 @@ export default { this.error = false; this.$router.push("/profile"); } catch (err) { - console.log("catch error", err); + this.isLoading = false; this.error = true; this.errorMsg = `${err.message} Internal Error, please write a mail to CDCode Admin`; } - // const res = await this.axios.post(`${host}/api/auth/local`, { - // identifier: this.email.val, - // password: this.password.val - // }); - // console.log("error is ", res); - // const { jwt, user } = res.data - // console.log(user) - // window.localStorage.setItem('jwt', jwt) - // window.localStorage.setItem('userData', JSON.stringify(user)) - - // this.$store.dispatch('User/setJwt', jwt) - // this.$store.dispatch('User/setUserData', user) - // this.isLoading= false; - // this.error= false; - // this.$router.push('/profile') - - // console.log(error.response.data.error.message) - // console.log("error",e.data); - // this.isLoading= false; - // this.error = true - // this.password.val = '' - // this.isLoading= false + }, }, }; diff --git a/web/src/views/NotFound.vue b/web/src/views/NotFound.vue index 97ffd891cd3fd8d31581acd93eedc58656764113..c05bbc9c1e7fb811162edc6770bf7841c32772f9 100644 --- a/web/src/views/NotFound.vue +++ b/web/src/views/NotFound.vue @@ -1,7 +1,7 @@ <template> <div class="flex flex-wrap justify-center"> <div class="w-5/6"> - <h3>Page Not Found</h3> + <h3>404 Page Not Found!</h3><router-link class="text-blue-500 text-3xl hover:text-blue-700" to="/">Click here to go back.</router-link> </div> </div> </template> diff --git a/web/src/views/NovelCondensate.vue b/web/src/views/NovelCondensate.vue index 5cef85250bb1f9cc61d87ce45599491c8cf72e48..acf59571b2b1686898ed3a672034000641085d8c 100644 --- a/web/src/views/NovelCondensate.vue +++ b/web/src/views/NovelCondensate.vue @@ -391,14 +391,16 @@ export default { return this.$store.getters['User/userRole']; }, colorChange() { - if (this.status === 'rejected') { + if (this.status === 'rejected') { return `bg-red-500`; } else if (this.status === 'requested') { - return `bg-yellow-500`; + return `bg-pink-500`; } else if (this.status === 'synced') { - return `bg-gray-500`; + return `bg-blue-500`; } else if (this.status === 'accepted') { return `bg-green-500`; + } else if (this.status === 'failed') { + return `bg-gray-500`; } return ''; }, @@ -475,7 +477,7 @@ export default { return; } - // console.log(vm.userData) + vm.isLoading = true; try { const res = await this.axios.get( @@ -513,7 +515,7 @@ export default { vm.isLoading = false; // vm.loaded = true; } catch (error) { - // console.error(error) + this.error = true; this.errorMsg = 'You are not authorized to access this item.'; vm.isLoading = false; @@ -522,10 +524,10 @@ export default { }, async updateReview() { const vm = this; - // console.log('triggered'); + vm.validation(); if (!this.formIsValid) { - // console.log('true'); + return; } @@ -539,12 +541,12 @@ export default { return; } - // console.log(vm.userData) + let dat = { Status: this.reviewerStatus.val, ReviewComments: this.reviewerComments.val, }; - // console.log('data is', dat); + this.isLoading = true; try { await this.axios @@ -560,7 +562,7 @@ export default { } ) .then((res) => { - // console.log(res); + this.error = false; this.reviewComments = ''; this.isLoading = false; @@ -571,7 +573,7 @@ export default { }, 2000); }) .catch((err) => { - // console.log(err); + this.error = true; this.errorMsg = err.response.data.error.message + @@ -579,10 +581,9 @@ export default { vm.isLoading = false; }); - // console.log(res) + } catch (error) { - // console.log(error.response.data.error.message) - // console.log(error.response) + this.error = true; this.errorMsg = error; vm.isLoading = false; diff --git a/web/src/views/Profile.vue b/web/src/views/Profile.vue index 138fed2101cd3ea047ba67f2bc8d12c13227fd1b..34e46ed35ef7ee41949c0ee69afeff21116a4a68 100644 --- a/web/src/views/Profile.vue +++ b/web/src/views/Profile.vue @@ -596,7 +596,7 @@ export default { this.editMode = true; }, setRole(roleName) { - //console.log("role name is,", roleName); + const vm = this; window.localStorage.setItem('roleName', roleName); vm.$store.dispatch('User/setUserRole', roleName); @@ -608,7 +608,7 @@ export default { return ret; }, async update(e) { - // console.log("user data", e); + const vm = this; if (vm.isDev) { @@ -670,13 +670,7 @@ export default { this.scientificErrMsg = ''; this.profileLinkErrMsg = ''; this.passwordErrMsg = ''; - // let dat = { - // id: vm.user, - // profile_link: vm.profile_link, - // scientific_discipline: vm.selected, - // password: vm.password, - // }; - // console.log(dat); + try { let res; @@ -686,7 +680,7 @@ export default { Authorization: `Bearer ${jwt}`, }, }); - // console.log(res.data); + const newJwt = res.data.jwt; window.localStorage.setItem('jwt', newJwt); this.$store.dispatch('User/setJwt', newJwt); @@ -698,7 +692,7 @@ export default { }); } - // console.log(res.data); + this.error = false; this.toasterMessage = 'Profile update successful!'; this.toasterIsOpen = true; @@ -712,8 +706,7 @@ export default { this.password = ''; this.updatedKey += 1; } catch (error) { - // console.log(error.response.data.error.message) - // console.log(error.response) + this.error = true; this.errorMsg = error; } diff --git a/web/src/views/SignUp.vue b/web/src/views/SignUp.vue index 4e607fa15a8ff3ffeb0c1adfc5782398b7f42cfe..57ded675791621617c1e963165fe8c7d2995fb5d 100644 --- a/web/src/views/SignUp.vue +++ b/web/src/views/SignUp.vue @@ -683,34 +683,14 @@ export default { ); // fragment locator let isValid; if (this.profileLink.val === '') { - console.log('profile link empty'); + return true; } else { isValid = pattern.test(this.profileLink.val); - console.log('lint is there', isValid); + } return isValid; - // if(!isValid){ - // console.log("triggered"); - // this.profileLinkError= true; - // this.profileLinkErrMsg="The url entered is invalid. Please check it again!" - // } else{ - // this.profileLinkError=false; - // this.profileLinkErrMsg="" - // } - // clearTimeout(timer); - // timer= setTimeout(()=>{ - // let isValid= pattern.test(this.profileLink.val); - // if(!isValid){ - // console.log("triggered"); - // this.profileLinkError= true; - // this.profileLinkErrMsg="The url entered is invalid. Please check it again!" - // } else{ - // this.profileLinkError=false; - // this.profileLinkErrMsg="" - // } - - // }, 1000) + }, showDialog() { this.toasterIsOpen = true; @@ -782,37 +762,7 @@ export default { vm.toasterIsOpen = true; this.error = false; this.errorMsg = ''; - // try { - // await vm.axios.post(`${host}/api/auth/local/register`, { - // full_name: vm.name.val, - // password: vm.password.val, - // email: vm.email.val, - // username: vm.username.val, - // motivation_text: vm.motivation.val, - // current_role: vm.current_role.val, - // scientific_discipline: vm.scientific_discipline.val, - // current_affiliation: vm.affiliation.val, - // profile_link: vm.profileLink.val, - // }); - - // this.isLoading = false; - // vm.toasterIsOpen = true; - // this.error = false; - // this.errorMsg = ""; - // //vm.$router.push('login') - // } catch (e) { - // console.error(e); - // this.isLoading = false; - // if (e.message === "Request failed with status code 405") { - // console.log(e.message); - // } - // if (e.message === "Request failed with status code 400") { - // vm.error = true; - // vm.errorMsg = - // "Email Address already registered with an existing account. You can reset your password by clicking forget password from sign up page."; - // } - - // } + }, }, }; diff --git a/web/src/views/UpdateItem.vue b/web/src/views/UpdateItem.vue index bb4eadfd2ae867438d308aec021fb505bbfbcb05..9eb37cd12aad42b4b46bf356ad11929580270fe2 100644 --- a/web/src/views/UpdateItem.vue +++ b/web/src/views/UpdateItem.vue @@ -671,10 +671,7 @@ export default { ) { return true; } - // else if (this.userRole === "Maintainer" && this.status !== "failed") { - // console.log("in failed check"); - // return true; - // } + return false; }, @@ -721,7 +718,7 @@ export default { return; } - // console.log(vm.userData) + let dat = { Entity: this.entity, EntityId: this.entityId, @@ -764,12 +761,11 @@ export default { ); } - // console.log(res) + vm.$router.push('/profile'); } catch (error) { - // console.log(error.response.data.error.message) - // console.log(error.response) + this.error = true; this.errorMsg = error; } @@ -787,7 +783,7 @@ export default { return; } - // console.log(vm.userData) + vm.isLoading = true; try { const res = await this.axios.get(`${host}/api/update-items/` + id, { @@ -796,7 +792,7 @@ export default { }, }); - console.log(res.data.data); + if (res.data.data) { const d = res.data.data.attributes; @@ -821,7 +817,7 @@ export default { vm.isLoading = false; vm.loaded = true; } catch (error) { - // console.error(error) + this.error = true; this.errorMsg = 'You are not authorized to access this item.'; vm.isLoading = false; @@ -841,7 +837,7 @@ export default { return; } if (!this.reviewerStatus || this.reviewerStatus === 'Choose an action') { - console.log('in update review true'); + this.error = true; this.statusErrMsg = 'Please select an action.'; @@ -856,7 +852,7 @@ export default { this.reviewerCmtErrMsg = 'Comment should not be empty!'; return; } - // console.log(vm.userData) + let dat = { Status: this.reviewerStatus, ReviewComments: this.reviewComments, @@ -876,7 +872,7 @@ export default { } ); - // console.log(res) + this.reviewComments = ''; this.isLoading = false; this.toasterIsOpen = true; @@ -885,8 +881,7 @@ export default { this.load(this.item); }, 2000); } catch (error) { - // console.log(error.response.data.error.message) - // console.log(error.response) + this.error = true; this.errorMsg = error; vm.isLoading = false; diff --git a/web/src/views/UpdateUser.vue b/web/src/views/UpdateUser.vue index e5468de3a94dac496eac23fd23d69436dccacc4d..3053587b84bfd17aa77bd684e2e056c1a3586c17 100644 --- a/web/src/views/UpdateUser.vue +++ b/web/src/views/UpdateUser.vue @@ -304,7 +304,7 @@ export default { return } - // console.log(vm.role) + let dat = { id: vm.user, @@ -319,12 +319,11 @@ export default { } }); - // console.log(res.data) + vm.$router.push('/profile') } catch(error) { - // console.log(error.response.data.error.message) - // console.log(error.response) + this.error = true this.errorMsg = error } @@ -342,7 +341,7 @@ export default { return } - // console.log(vm.userData) + try { const res = await this.axios.get(`${host}/api/users-permissions/roles`, { @@ -355,7 +354,7 @@ export default { vm.roles = _.sortBy(_.filter(res.data.roles, o => o.name !== 'Public'), ['name']); } } catch(error) { - // console.error(error) + this.error = true this.errorMsg = 'You are not authorized to access this item.' setTimeout(() => vm.$router.go(-1), 2000); @@ -374,7 +373,7 @@ export default { return } - // console.log(vm.userData) + try { const res = await this.axios.get(`${host}/api/users/` + id, { @@ -383,7 +382,7 @@ export default { } }); - // console.log(res) + if(res.data) { const d = res.data; @@ -406,7 +405,7 @@ export default { vm.loaded = true; } catch(error) { - // console.error(error) + this.error = true this.errorMsg = 'You are not authorized to access this item.' setTimeout(() => vm.$router.go(-1), 2000);