From 3986e5ad71cacf1e96eba1acc1f33a8a22060ee7 Mon Sep 17 00:00:00 2001 From: digvijay26 Date: Tue, 29 Dec 2020 12:29:17 +0530 Subject: [PATCH] new changes in admin panel --- src/components/CaseStudy.vue | 8 +- src/components/Insight.vue | 264 +++++++++++++++++++++++++++++++++++++++++++ src/components/Profile.vue | 67 ++++++++++- src/router/index.js | 6 + 4 files changed, 337 insertions(+), 8 deletions(-) create mode 100644 src/components/Insight.vue diff --git a/src/components/CaseStudy.vue b/src/components/CaseStudy.vue index 4055349..b4e2b76 100644 --- a/src/components/CaseStudy.vue +++ b/src/components/CaseStudy.vue @@ -23,10 +23,10 @@ @@ -131,8 +131,8 @@ export default { localStorage.setItem('spotlight_caseStudy'+payload._id, JSON.stringify(payload)) this.$router.push("/profile?"+payload._id); }, - create(){ - this.$router.push("/profile"); + create(url){ + this.$router.push(url); }, logout(){ this.$router.push("/"); diff --git a/src/components/Insight.vue b/src/components/Insight.vue new file mode 100644 index 0000000..e7ef67e --- /dev/null +++ b/src/components/Insight.vue @@ -0,0 +1,264 @@ + + + + diff --git a/src/components/Profile.vue b/src/components/Profile.vue index 4b595fc..34c2c69 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -23,10 +23,10 @@ @@ -330,8 +330,28 @@ >

+ + + + + +
+ @@ -438,6 +459,8 @@ export default { slideId: null, userList: [], templateList: [], + insightList: [], + insightId:null, caseStudy: { caseStudyDetails: { userId: [], @@ -485,6 +508,7 @@ export default { this.usertoken = userdata.token; this.getUserList(); this.getTemplateList(); + this.getInsightList(); } }, methods: { @@ -525,6 +549,14 @@ export default { this.caseStudy.slides.push(this.templateList[i]); console.log("this.caseStudy.slides", this.caseStudy.slides); }, + async insightSelected(data) { + + // this.caseStudy.slides.push(this.templateList[i]); + + console.log("data",data); + data.insightId = this.insightId; + this.insightId = null; + }, removeSlide(i) { this.caseStudy.slides.splice(i, 1); @@ -677,6 +709,20 @@ export default { }) .catch((error) => console.log(error)); }, + getInsightList() { + axios + .get("/superAdmin/insight", { + headers: { + Authorization: "Bearer " + this.usertoken, + }, + }) + .then((response) => { + this.insightList = response.data.data; + + console.log("insight", response.data.data); + }) + .catch((error) => console.log(error)); + }, getSLideData() { axios @@ -696,6 +742,7 @@ export default { _id: this.templateList[i]._id, bounceBoard: this.templateList[i].bounceBoard, insight: this.templateList[i].insight, + slideId:template_._id, // commentBox: this.templateList[i].commentBox, metaData: { fields: [], @@ -705,6 +752,9 @@ export default { if (this.templateList[i].bounceBoard) { obj.commentBox = this.templateList[i].commentBox; } + if (this.templateList[i].insight) { + obj.insightId = template_.insightId; + } var fieldArray = []; this.templateList[i].metaData.fields.forEach((element) => { var fieldobj = { @@ -734,6 +784,14 @@ export default { slideData.templateId = slides._id; slideData.bounceBoard = slides.bounceBoard; slideData.insight = slides.insight; + if(slides.slideId){ + slideData.slideId = slides.slideId; + + } + if(slides.insightId){ + slideData.insightId = slides.insightId; + + } if (slides.metaData.comments && slides.metaData.comments.length > 0) { slideData.comments = slides.metaData.comments; // this.getSLideData(); @@ -777,6 +835,7 @@ export default { .then((response) => { // this.userData = response.data.data; this.$toaster.success("Case Study Created"); + this.$router.go(this.$router.currentRoute) console.log(response); }) @@ -814,8 +873,8 @@ export default { } }); }, - listPage(){ - this.$router.push("/casestudy"); + listPage(url){ + this.$router.push(url); }, async getMeatda(tempId) { diff --git a/src/router/index.js b/src/router/index.js index 6ff5bf9..0c8edcc 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -4,6 +4,7 @@ import { authGuard } from "../auth/authGuard" import LandingPage from '@/components/LandingPage' import Profile from '@/components/Profile' import CaseStudy from '@/components/CaseStudy' +import Insight from '@/components/Insight' import router from '../router' @@ -32,6 +33,11 @@ export default new Router({ path: '/casestudy', name: 'CaseStudy', component: CaseStudy, + }, + { + path: '/insight', + name: 'Insight', + component: Insight, } -- 2.0.0