From 259b1d08d28e4ad5d049b440243702120fe6f475 Mon Sep 17 00:00:00 2001 From: raghosh <raghosh@loaner-laptop-13.local> Date: Wed, 6 Jul 2022 13:23:54 +0200 Subject: [PATCH] #63: removed the console logs from all components. --- web/src/components/AboutPage.vue | 2 +- web/src/components/AddNovelCondensate.vue | 14 ++-- web/src/components/BarcodePlot.vue | 2 +- web/src/components/CMS/DriverCriterion.vue | 2 +- .../components/CMS/ExperimentalEvidence.vue | 2 +- .../components/CMS/ProteinFunctionalType.vue | 2 +- web/src/components/CMS/addDeleteMarker.vue | 2 +- web/src/components/CMS/addDeletePubmed.vue | 6 +- web/src/components/CMS/evidenceStarRating.vue | 2 +- web/src/components/CMS/fetchProfile.vue | 22 ++---- web/src/components/CMS/fetchUpdateItems.vue | 8 +- .../CMS/fetchUserSpecificUpdateItems.vue | 12 +-- web/src/components/CMS/fetchUsers.vue | 6 +- .../components/CMS/updateFunctionalType.vue | 4 +- web/src/components/CondensateDetailPage.vue | 57 ++------------ web/src/components/CondensateExample.vue | 2 +- .../components/CondensateUpdateItemsTable.vue | 74 ++----------------- web/src/components/ContributorListTable.vue | 2 +- web/src/components/DDCODE/fetchCondensate.vue | 31 ++------ web/src/components/DDCODE/fetchProtein.vue | 27 ++----- web/src/components/DDCODE/fetchPubMed.vue | 4 +- web/src/components/DDCODE/fetchSpecies.vue | 4 +- web/src/components/DDCODE/fetchStats.vue | 6 +- .../components/DDCODE/fetchWikiMainPage.vue | 4 +- web/src/components/DataTable.vue | 23 ++---- .../Datatable/CondensateDataTable.vue | 19 ++--- .../components/Datatable/ProteinDataTable.vue | 19 ++--- web/src/components/EditProteinDetails.vue | 8 +- web/src/components/Footers.vue | 2 +- web/src/components/LandingPage.vue | 44 ++++------- web/src/components/Links.vue | 6 +- web/src/components/LlpsTable.vue | 40 +++++----- web/src/components/Navigation/TheNavBar.vue | 2 + .../components/NovelCondensateRequests.vue | 11 ++- web/src/components/ProteinDetailPage.vue | 23 +----- web/src/components/ProteinExample.vue | 2 +- web/src/components/ProteinUpdateItemTable.vue | 19 ++--- web/src/components/Search.vue | 29 +++----- web/src/components/SearchPage.vue | 14 ++-- web/src/components/SpeciesChart.vue | 2 +- web/src/components/TagsInput.vue | 2 +- web/src/components/UI/TheDeleteModal.vue | 4 +- web/src/components/UpdateItemTable.vue | 13 ++-- web/src/views/AddNewCondensate.vue | 2 +- web/src/views/ForgotPassword.vue | 2 +- web/src/views/Login.vue | 27 +------ web/src/views/NotFound.vue | 2 +- web/src/views/NovelCondensate.vue | 29 ++++---- web/src/views/Profile.vue | 19 ++--- web/src/views/SignUp.vue | 58 +-------------- web/src/views/UpdateItem.vue | 27 +++---- web/src/views/UpdateUser.vue | 17 ++--- 52 files changed, 229 insertions(+), 533 deletions(-) diff --git a/web/src/components/AboutPage.vue b/web/src/components/AboutPage.vue index e366ffe..0d88561 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 2c1fc8b..96fa2f2 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 449a848..3c63b81 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 1e56012..bccb779 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 bfc7697..da0c173 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 994901b..0fc7155 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 76910fc..3057192 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 ad48135..325f024 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 177598c..4818ddb 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 cbdae9c..df97932 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 6daef83..aa27798 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 78092e6..a31e09a 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 fda867c..c3e24dc 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 f4a178f..d22d09d 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 dc63ec6..d532c8a 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 630e6a1..2a6312e 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 dcff327..81761df 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 b7497ec..73fdba0 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 c424f86..b8357c0 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 813415f..b722c73 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 2ea54d3..c92ce64 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 f7f3ecf..a8a2b08 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 3c16250..af9206e 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 f700796..dd8d2a2 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 6372fe2..909855b 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 c3e0398..c5d2cbc 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 c000335..978bb77 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 f51028d..08e123b 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 6d8d672..7ae1c41 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 bf6fce9..5921c3c 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 23f8e89..85cd48c 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 bae38ab..bdc97a2 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 f151ccd..65ae94a 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 cf7be23..01783ed 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 0082d70..9e384fd 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 4940eca..3137b63 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 f2a802c..b05998e 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 3a48bf0..b2fdb66 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 581c0ab..140041f 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 80cc981..110e8d7 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 37849c8..bcfd241 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 29e6033..4f0fb94 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 e4b946e..0612f2e 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 b08c4af..f3cfa76 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 cb47096..db79cd4 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 99b8bf9..9415991 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 97ffd89..c05bbc9 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 5cef852..acf5957 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 138fed2..34e46ed 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 4e607fa..57ded67 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 bb4eadf..9eb37cd 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 e5468de..3053587 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); -- GitLab