Commit 51ce61cc2058d441d821a00e6262927dd18c8044

Authored by Digvijay Singh
1 parent 0e3c6b8283
Exists in admin

insight issue

Showing 1 changed file with 12 additions and 1 deletions   Show diff stats
src/components/Profile.vue
1 <template> 1 <template>
2 <main class="landing-page"> 2 <main class="landing-page">
3 <!-- profile --> 3 <!-- profile -->
4 <div class="popup-wrp" style="display: none"> 4 <div class="popup-wrp" style="display: none">
5 <div class="overlay" @click="hideDialog"></div> 5 <div class="overlay" @click="hideDialog"></div>
6 <div 6 <div
7 class="popup-set" 7 class="popup-set"
8 id="add-profile" 8 id="add-profile"
9 style="display: none; width: 700px" 9 style="display: none; width: 700px"
10 > 10 >
11 <!-- header --> 11 <!-- header -->
12 <div class="popup-body"> 12 <div class="popup-body">
13 <form class="popup-forms"> 13 <form class="popup-forms">
14 <div class="row"> 14 <div class="row">
15 <!-- input --> 15 <!-- input -->
16 <img :src="templateImage" /> 16 <img :src="templateImage" />
17 <!-- input --> 17 <!-- input -->
18 18
19 <!-- input --> 19 <!-- input -->
20 20
21 <!-- input --> 21 <!-- input -->
22 <!-- <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 22 <!-- <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
23 <div class="form-group floating-label"> 23 <div class="form-group floating-label">
24 <select class="form-group"> 24 <select class="form-group">
25 <option @click="addSocialLink">Add another</option> 25 <option @click="addSocialLink">Add another</option>
26 </select> 26 </select>
27 <span class="select-arrow" 27 <span class="select-arrow"
28 ><img src="../assets/images/chevron-down.svg" 28 ><img src="../assets/images/chevron-down.svg"
29 /></span> 29 /></span>
30 </div> 30 </div>
31 </div> --> 31 </div> -->
32 <!-- input --> 32 <!-- input -->
33 </div> 33 </div>
34 </form> 34 </form>
35 </div> 35 </div>
36 <div class="clearfix"></div> 36 <div class="clearfix"></div>
37 </div> 37 </div>
38 <!-- add profile --> 38 <!-- add profile -->
39 </div> 39 </div>
40 <!-- profile --> 40 <!-- profile -->
41 <!-- profile --> 41 <!-- profile -->
42 <div class="container-fluid inner-wrp" style="background: transparent"> 42 <div class="container-fluid inner-wrp" style="background: transparent">
43 <nav class="navbar navbar-expand-sm spotLight-nav"> 43 <nav class="navbar navbar-expand-sm spotLight-nav">
44 <a class="navbar-brand" href="#" 44 <a class="navbar-brand" href="#"
45 ><img src="../assets/images/logo.png" 45 ><img src="../assets/images/logo.png"
46 /></a> 46 /></a>
47 <button 47 <button
48 class="navbar-toggler" 48 class="navbar-toggler"
49 type="button" 49 type="button"
50 data-toggle="collapse" 50 data-toggle="collapse"
51 data-target="#navbarsExample03" 51 data-target="#navbarsExample03"
52 aria-controls="navbarsExample03" 52 aria-controls="navbarsExample03"
53 aria-expanded="false" 53 aria-expanded="false"
54 aria-label="Toggle navigation" 54 aria-label="Toggle navigation"
55 > 55 >
56 <span class="navbar-toggler-icon"></span> 56 <span class="navbar-toggler-icon"></span>
57 <span class="navbar-toggler-icon"></span> 57 <span class="navbar-toggler-icon"></span>
58 <span class="navbar-toggler-icon"></span> 58 <span class="navbar-toggler-icon"></span>
59 </button> 59 </button>
60 60
61 <div class="collapse navbar-collapse" id="navbarsExample03"> 61 <div class="collapse navbar-collapse" id="navbarsExample03">
62 <ul class="navbar-nav mr-auto"> 62 <ul class="navbar-nav mr-auto">
63 <li class="nav-item active"> 63 <li class="nav-item active">
64 <a 64 <a
65 class="nav-link" 65 class="nav-link"
66 style="cursor: pointer" 66 style="cursor: pointer"
67 @click="listPage('/casestudy')" 67 @click="listPage('/casestudy')"
68 >Case Study List</a 68 >Case Study List</a
69 > 69 >
70 </li> 70 </li>
71 <li class="nav-item active"> 71 <li class="nav-item active">
72 <a 72 <a
73 class="nav-link" 73 class="nav-link"
74 style="cursor: pointer" 74 style="cursor: pointer"
75 @click="listPage('/insight')" 75 @click="listPage('/insight')"
76 >Create Insight</a 76 >Create Insight</a
77 > 77 >
78 </li> 78 </li>
79 </ul> 79 </ul>
80 </div> 80 </div>
81 <div class=""> 81 <div class="">
82 <a href="javascript:void(0);" @click="logout">Log Out </a> 82 <a href="javascript:void(0);" @click="logout">Log Out </a>
83 </div> 83 </div>
84 </nav> 84 </nav>
85 <!-- menu wrapper --> 85 <!-- menu wrapper -->
86 <div class="row profile-tab-spc-top"> 86 <div class="row profile-tab-spc-top">
87 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 87 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
88 <div class="user-profile"> 88 <div class="user-profile">
89 <div class="form-group floating-label"> 89 <div class="form-group floating-label">
90 <select 90 <select
91 class="form-control" 91 class="form-control"
92 v-model="userData" 92 v-model="userData"
93 v-on:change="selectUser(userData)" 93 v-on:change="selectUser(userData)"
94 :disabled="editMode" 94 :disabled="editMode"
95 > 95 >
96 <option value="null">Select User</option> 96 <option value="null">Select User</option>
97 <option v-for="(user, i) in userList" :key="i" :value="i"> 97 <option v-for="(user, i) in userList" :key="i" :value="i">
98 {{ user.name }} ({{ user.email }}) 98 {{ user.name }} ({{ user.email }})
99 </option> 99 </option>
100 </select> 100 </select>
101 </div> 101 </div>
102 </div> 102 </div>
103 </div> 103 </div>
104 </div> 104 </div>
105 105
106 <div class="row"> 106 <div class="row">
107 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 107 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
108 <ul class="navbar-nav mr-auto"> 108 <ul class="navbar-nav mr-auto">
109 <li class="nav-item active"> 109 <li class="nav-item active">
110 <h5 class="nav-link">Intro Screen Record</h5> 110 <h5 class="nav-link">Intro Screen Record</h5>
111 </li> 111 </li>
112 </ul> 112 </ul>
113 </div> 113 </div>
114 </div> 114 </div>
115 <!-- 1st row --> 115 <!-- 1st row -->
116 <div class="row"> 116 <div class="row">
117 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 117 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
118 <div class="form-group floating-label"> 118 <div class="form-group floating-label">
119 <label for="lname" class="lname">Case Study Name</label> 119 <label for="lname" class="lname">Case Study Name</label>
120 <input 120 <input
121 type="text" 121 type="text"
122 class="form-control" 122 class="form-control"
123 value="" 123 value=""
124 placeholder=" " 124 placeholder=" "
125 v-model="caseStudy.caseStudyDetails.intro.name" 125 v-model="caseStudy.caseStudyDetails.intro.name"
126 /> 126 />
127 </div> 127 </div>
128 </div> 128 </div>
129 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 129 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
130 <div class="form-group floating-label"> 130 <div class="form-group floating-label">
131 <label for="lname" class="lname">App Name</label> 131 <label for="lname" class="lname">App Name</label>
132 <input 132 <input
133 type="text" 133 type="text"
134 class="form-control" 134 class="form-control"
135 value="" 135 value=""
136 placeholder=" " 136 placeholder=" "
137 v-model="caseStudy.caseStudyDetails.intro.app" 137 v-model="caseStudy.caseStudyDetails.intro.app"
138 /> 138 />
139 </div> 139 </div>
140 </div> 140 </div>
141 <!-- <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 141 <!-- <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
142 <div class="form-group floating-label"> 142 <div class="form-group floating-label">
143 <label for="lname" class="lname">Focus</label> 143 <label for="lname" class="lname">Focus</label>
144 <input 144 <input
145 type="text" 145 type="text"
146 class="form-control" 146 class="form-control"
147 value="" 147 value=""
148 placeholder=" " 148 placeholder=" "
149 v-model="caseStudy.caseStudyDetails.intro.focus" 149 v-model="caseStudy.caseStudyDetails.intro.focus"
150 /> 150 />
151 </div> 151 </div>
152 </div> --> 152 </div> -->
153 153
154 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 154 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
155 <div class="form-group floating-label"> 155 <div class="form-group floating-label">
156 <label for="lname" class="lname"> App logo</label> 156 <label for="lname" class="lname"> App logo</label>
157 <img 157 <img
158 v-if="caseStudy.caseStudyDetails.intro.logoURL" 158 v-if="caseStudy.caseStudyDetails.intro.logoURL"
159 style="width: 40px; height: 40px" 159 style="width: 40px; height: 40px"
160 :src="caseStudy.caseStudyDetails.intro.logoURL" 160 :src="caseStudy.caseStudyDetails.intro.logoURL"
161 /> 161 />
162 <input 162 <input
163 @change="createImage('logo')" 163 @change="createImage('logo')"
164 type="file" 164 type="file"
165 name="photso" 165 name="photso"
166 id="logo" 166 id="logo"
167 accept="image/*" 167 accept="image/*"
168 /> 168 />
169 </div> 169 </div>
170 </div> 170 </div>
171 </div> 171 </div>
172 <!-- 1st row end --> 172 <!-- 1st row end -->
173 173
174 <!-- 2nd row --> 174 <!-- 2nd row -->
175 <div class="row"> 175 <div class="row">
176 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 176 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
177 <div class="form-group floating-label"> 177 <div class="form-group floating-label">
178 <label for="lname" class="lname">Case Study Type</label> 178 <label for="lname" class="lname">Case Study Type</label>
179 <select 179 <select
180 class="form-control" 180 class="form-control"
181 v-model="caseStudy.caseStudyDetails.intro.type" 181 v-model="caseStudy.caseStudyDetails.intro.type"
182 > 182 >
183 <option value="null">Select Case Type</option> 183 <option value="null">Select Case Type</option>
184 <option value="Retake">Retake</option> 184 <option value="Retake">Retake</option>
185 <option value="Behind-the-scenes">Behind-the-scenes</option> 185 <option value="Behind-the-scenes">Behind-the-scenes</option>
186 <option value="Critique">Critique</option> 186 <option value="Critique">Critique</option>
187 <option value="Juxtapose">Juxtapose</option> 187 <option value="Juxtapose">Juxtapose</option>
188 </select> 188 </select>
189 </div> 189 </div>
190 </div> 190 </div>
191 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 191 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
192 <div class="form-group floating-label"> 192 <div class="form-group floating-label">
193 <label for="lname" class="lname">Platform</label> 193 <label for="lname" class="lname">Platform</label>
194 <!-- <input 194 <!-- <input
195 type="text" 195 type="text"
196 class="form-control" 196 class="form-control"
197 value="" 197 value=""
198 placeholder=" " 198 placeholder=" "
199 v-model="caseStudy.caseStudyDetails.intro.platForm" 199 v-model="caseStudy.caseStudyDetails.intro.platForm"
200 /> --> 200 /> -->
201 <select 201 <select
202 class="form-control" 202 class="form-control"
203 v-model="selectPlatform" 203 v-model="selectPlatform"
204 @change="addInsight('platform')" 204 @change="addInsight('platform')"
205 > 205 >
206 <option value="null">Select Insight Tag</option> 206 <option value="null">Select Insight Tag</option>
207 <option value="Ios">Ios</option> 207 <option value="Ios">Ios</option>
208 <option value="Web">Web</option> 208 <option value="Web">Web</option>
209 <option value="Android">Android</option> 209 <option value="Android">Android</option>
210 </select> 210 </select>
211 </div> 211 </div>
212 </div> 212 </div>
213 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 213 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
214 <div class="form-group floating-label"> 214 <div class="form-group floating-label">
215 <label for="lname" class="lname"></label> 215 <label for="lname" class="lname"></label>
216 <label for="lname" class="lname"></label> 216 <label for="lname" class="lname"></label>
217 <ul class="interests"> 217 <ul class="interests">
218 <!-- v-for="(interest, i) in caseStudy.caseStudyDetails 218 <!-- v-for="(interest, i) in caseStudy.caseStudyDetails
219 .insightTags" 219 .insightTags"
220 :key="i" --> 220 :key="i" -->
221 221
222 <li v-if="caseStudy.caseStudyDetails.intro.platForm"> 222 <li v-if="caseStudy.caseStudyDetails.intro.platForm">
223 <span>{{ caseStudy.caseStudyDetails.intro.platForm }}</span> 223 <span>{{ caseStudy.caseStudyDetails.intro.platForm }}</span>
224 <a 224 <a
225 href="javascript:void(0);" 225 href="javascript:void(0);"
226 @click="removeInsight(0, 'platform')" 226 @click="removeInsight(0, 'platform')"
227 class="cat-minus" 227 class="cat-minus"
228 ><img src="../assets/images/minus.svg" 228 ><img src="../assets/images/minus.svg"
229 /></a> 229 /></a>
230 </li> 230 </li>
231 </ul> 231 </ul>
232 </div> 232 </div>
233 </div> 233 </div>
234 </div> 234 </div>
235 <!-- 2nd row --> 235 <!-- 2nd row -->
236 <!-- 3rd row -->` 236 <!-- 3rd row -->`
237 <div class="row"> 237 <div class="row">
238 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 238 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
239 <div class="form-group floating-label"> 239 <div class="form-group floating-label">
240 <label for="lname" class="lname"></label> 240 <label for="lname" class="lname"></label>
241 <ul class="interests"> 241 <ul class="interests">
242 <li> 242 <li>
243 <input 243 <input
244 class="" 244 class=""
245 placeholder="Add Focus Areas" 245 placeholder="Add Focus Areas"
246 v-model="focusName" 246 v-model="focusName"
247 v-on:keyup.enter="addInsight('focus')" 247 v-on:keyup.enter="addInsight('focus')"
248 /> 248 />
249 <a href="javascript:void(0);" @click="addInsight('focus')" 249 <a href="javascript:void(0);" @click="addInsight('focus')"
250 ><img src="../assets/images/plus-circle.svg" 250 ><img src="../assets/images/plus-circle.svg"
251 /></a> 251 /></a>
252 </li> 252 </li>
253 253
254 <li 254 <li
255 v-for="(interest, i) in caseStudy.caseStudyDetails.focusAreas" 255 v-for="(interest, i) in caseStudy.caseStudyDetails.focusAreas"
256 :key="i" 256 :key="i"
257 > 257 >
258 <span>{{ interest }}</span> 258 <span>{{ interest }}</span>
259 <a 259 <a
260 href="javascript:void(0);" 260 href="javascript:void(0);"
261 @click="removeInsight(i, 'focus')" 261 @click="removeInsight(i, 'focus')"
262 class="cat-minus" 262 class="cat-minus"
263 ><img src="../assets/images/minus.svg" 263 ><img src="../assets/images/minus.svg"
264 /></a> 264 /></a>
265 </li> 265 </li>
266 </ul> 266 </ul>
267 </div> 267 </div>
268 </div> 268 </div>
269 269
270 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 270 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
271 <div class="form-group floating-label"> 271 <div class="form-group floating-label">
272 <label for="lname" class="lname">Select Insight Tags</label> 272 <label for="lname" class="lname">Select Insight Tags</label>
273 <select 273 <select
274 class="form-control" 274 class="form-control"
275 v-model="insightName" 275 v-model="insightName"
276 @change="addInsight('insight')" 276 @change="addInsight('insight')"
277 > 277 >
278 <option value="null">Select Insight Tag</option> 278 <option value="null">Select Insight Tag</option>
279 <option value="Design">Design</option> 279 <option value="Design">Design</option>
280 <option value="Product">Product</option> 280 <option value="Product">Product</option>
281 <option value="Marketing">Marketing</option> 281 <option value="Marketing">Marketing</option>
282 <option value="Pricing">Pricing</option> 282 <option value="Pricing">Pricing</option>
283 <option value="Psychology">Psychology</option> 283 <option value="Psychology">Psychology</option>
284 </select> 284 </select>
285 </div> 285 </div>
286 </div> 286 </div>
287 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 287 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
288 <div class="form-group floating-label"> 288 <div class="form-group floating-label">
289 <label for="lname" class="lname"></label> 289 <label for="lname" class="lname"></label>
290 <ul class="interests"> 290 <ul class="interests">
291 <li 291 <li
292 v-for="(interest, i) in caseStudy.caseStudyDetails.insightTags" 292 v-for="(interest, i) in caseStudy.caseStudyDetails.insightTags"
293 :key="i" 293 :key="i"
294 > 294 >
295 <span>{{ interest }}</span> 295 <span>{{ interest }}</span>
296 <a 296 <a
297 href="javascript:void(0);" 297 href="javascript:void(0);"
298 @click="removeInsight(i, 'insight')" 298 @click="removeInsight(i, 'insight')"
299 class="cat-minus" 299 class="cat-minus"
300 ><img src="../assets/images/minus.svg" 300 ><img src="../assets/images/minus.svg"
301 /></a> 301 /></a>
302 </li> 302 </li>
303 </ul> 303 </ul>
304 </div> 304 </div>
305 </div> 305 </div>
306 </div> 306 </div>
307 <!-- 3rd row end --> 307 <!-- 3rd row end -->
308 308
309 <!-- outdor --> 309 <!-- outdor -->
310 <div class="row profile-tab-spc-top"> 310 <div class="row profile-tab-spc-top">
311 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 311 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
312 <ul class="navbar-nav mr-auto"> 312 <ul class="navbar-nav mr-auto">
313 <li class="nav-item active"> 313 <li class="nav-item active">
314 <h5 class="nav-link">Outro Screen Record</h5> 314 <h5 class="nav-link">Outro Screen Record</h5>
315 </li> 315 </li>
316 </ul> 316 </ul>
317 </div> 317 </div>
318 </div> 318 </div>
319 319
320 <!-- 1st row --> 320 <!-- 1st row -->
321 <div class="row"> 321 <div class="row">
322 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 322 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
323 <div class="form-group floating-label"> 323 <div class="form-group floating-label">
324 <label for="lname" class="lname">Designer Name</label> 324 <label for="lname" class="lname">Designer Name</label>
325 <input 325 <input
326 type="text" 326 type="text"
327 class="form-control" 327 class="form-control"
328 value="" 328 value=""
329 placeholder=" " 329 placeholder=" "
330 v-model="caseStudy.caseStudyDetails.outro.designer" 330 v-model="caseStudy.caseStudyDetails.outro.designer"
331 /> 331 />
332 </div> 332 </div>
333 </div> 333 </div>
334 334
335 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 335 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
336 <div class="form-group floating-label"> 336 <div class="form-group floating-label">
337 <label for="lname" class="lname">Illustrations Name</label> 337 <label for="lname" class="lname">Illustrations Name</label>
338 <input 338 <input
339 type="text" 339 type="text"
340 class="form-control" 340 class="form-control"
341 value="" 341 value=""
342 placeholder=" " 342 placeholder=" "
343 v-model="caseStudy.caseStudyDetails.outro.illustrations" 343 v-model="caseStudy.caseStudyDetails.outro.illustrations"
344 /> 344 />
345 </div> 345 </div>
346 </div> 346 </div>
347 347
348 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 348 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
349 <div class="form-group floating-label"> 349 <div class="form-group floating-label">
350 <label for="lname" class="lname"> Author Image</label> 350 <label for="lname" class="lname"> Author Image</label>
351 <img 351 <img
352 v-if="caseStudy.caseStudyDetails.outro.authorImage[0]" 352 v-if="caseStudy.caseStudyDetails.outro.authorImage[0]"
353 style="width: 40px; height: 40px" 353 style="width: 40px; height: 40px"
354 :src="caseStudy.caseStudyDetails.outro.authorImage[0]" 354 :src="caseStudy.caseStudyDetails.outro.authorImage[0]"
355 /> 355 />
356 <input 356 <input
357 @change="createImage('outdor')" 357 @change="createImage('outdor')"
358 type="file" 358 type="file"
359 name="photos" 359 name="photos"
360 id="outdor" 360 id="outdor"
361 accept="image/*" 361 accept="image/*"
362 /> 362 />
363 </div> 363 </div>
364 </div> 364 </div>
365 </div> 365 </div>
366 <!-- 1st row --> 366 <!-- 1st row -->
367 <!-- outdoor ends --> 367 <!-- outdoor ends -->
368 368
369 <!-- outdor --> 369 <!-- outdor -->
370 <div class="row profile-tab-spc-top"> 370 <div class="row profile-tab-spc-top">
371 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 371 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
372 <ul class="navbar-nav mr-auto"> 372 <ul class="navbar-nav mr-auto">
373 <li class="nav-item active"> 373 <li class="nav-item active">
374 <h5 class="nav-link">Add SLides</h5> 374 <h5 class="nav-link">Add SLides</h5>
375 </li> 375 </li>
376 </ul> 376 </ul>
377 </div> 377 </div>
378 </div> 378 </div>
379 379
380 <!-- case study slides--> 380 <!-- case study slides-->
381 <div 381 <div
382 class="row profile-tab-spc-top" 382 class="row profile-tab-spc-top"
383 v-for="(slide, i) in caseStudy.slides" 383 v-for="(slide, i) in caseStudy.slides"
384 :key="i" 384 :key="i"
385 > 385 >
386 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 386 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
387 <ul class="navbar-nav mr-auto"> 387 <ul class="navbar-nav mr-auto">
388 <li class="nav-item active"> 388 <li class="nav-item active">
389 <p class="nav-link"> 389 <p class="nav-link">
390 <b>Screen {{ i + 1 }}</b> 390 <b>Screen {{ i + 1 }}</b>
391 <a 391 <a
392 style="cursor: pointer; color: red; font-size: 0.8rem" 392 style="cursor: pointer; color: red; font-size: 0.8rem"
393 @click="removeSlide(i)" 393 @click="removeSlide(i)"
394 > 394 >
395 Remove</a 395 Remove</a
396 > 396 >
397 <a 397 <a
398 style="cursor: pointer; color: blue; font-size: 0.8rem" 398 style="cursor: pointer; color: blue; font-size: 0.8rem"
399 @click="addProfileDialog(slide)" 399 @click="addProfileDialog(slide)"
400 > 400 >
401 View</a 401 View</a
402 > 402 >
403 </p> 403 </p>
404 </li> 404 </li>
405 <li class="nav-item active" v-if="slide.insight"> 405 <li class="nav-item active" v-if="slide.insight">
406 <div class="form-group floating-label"> 406 <div class="form-group floating-label">
407 <label for="lname" class="lname">Insight</label> 407 <label for="lname" class="lname">Insight</label>
408 <select 408 <select
409 class="form-control" 409 class="form-control"
410 v-model="insightId" 410 v-model="insightId"
411 v-on:change="insightSelected(slide)" 411 v-on:change="insightSelected(slide)"
412 > 412 >
413 <option value="null">Select Insight</option> 413 <option value="null">Select Insight</option>
414 <option 414 <option
415 v-for="(insight, i) in insightList" 415 v-for="(insight, i) in insightList"
416 :key="i" 416 :key="i"
417 :value="insight._id" 417 :value="insight._id"
418 > 418 >
419 {{ insight.title }} 419 {{ insight.title }}
420 </option> 420 </option>
421 </select> 421 </select>
422 </div> 422 </div>
423 </li> 423 </li>
424 </ul> 424 </ul>
425 </div> 425 </div>
426 426
427 <div class="row"> 427 <div class="row">
428 <div 428 <div
429 class="col-sm-4 col-md-4 col-lg-4 col-xl-4" 429 class="col-sm-4 col-md-4 col-lg-4 col-xl-4"
430 v-for="(field, j) in slide.metaData.fields" 430 v-for="(field, j) in slide.metaData.fields"
431 :key="j" 431 :key="j"
432 > 432 >
433 <div 433 <div
434 class="form-group floating-label" 434 class="form-group floating-label"
435 v-if="field.fieldType == 'text'" 435 v-if="field.fieldType == 'text'"
436 > 436 >
437 <label for="lname" class="lname">{{ field.displayName }}</label> 437 <label for="lname" class="lname">{{ field.displayName }}</label>
438 <input 438 <input
439 type="text" 439 type="text"
440 class="form-control" 440 class="form-control"
441 value="" 441 value=""
442 placeholder=" " 442 placeholder=" "
443 v-model="field.fieldValue" 443 v-model="field.fieldValue"
444 /> 444 />
445 </div> 445 </div>
446 446
447 <div 447 <div
448 class="form-group floating-label" 448 class="form-group floating-label"
449 v-if="field.fieldType == 'image'" 449 v-if="field.fieldType == 'image'"
450 > 450 >
451 <label for="lname" class="lname"> {{ field.displayName }}</label> 451 <label for="lname" class="lname"> {{ field.displayName }}</label>
452 <img 452 <img
453 v-if="field.fieldValue" 453 v-if="field.fieldValue"
454 style="width: 40px; height: 40px" 454 style="width: 40px; height: 40px"
455 :src="field.fieldValue" 455 :src="field.fieldValue"
456 /> 456 />
457 <input 457 <input
458 @change="fieldcreateImage(i, j)" 458 @change="fieldcreateImage(i, j)"
459 type="file" 459 type="file"
460 name="photo" 460 name="photo"
461 :id="i + '' + j" 461 :id="i + '' + j"
462 accept="image/*" 462 accept="image/*"
463 /> 463 />
464 </div> 464 </div>
465 </div> 465 </div>
466 </div> 466 </div>
467 467
468 <div class="row"> 468 <div class="row">
469 <div 469 <div
470 class="col-sm-4 col-md-4 col-lg-4 col-xl-4" 470 class="col-sm-4 col-md-4 col-lg-4 col-xl-4"
471 v-for="(cum, j) in slide.metaData.comments" 471 v-for="(cum, j) in slide.metaData.comments"
472 :key="j" 472 :key="j"
473 > 473 >
474 <div class="form-group floating-label"> 474 <div class="form-group floating-label">
475 <label for="lname" class="lname">Comment Box {{ j + 1 }}</label> 475 <label for="lname" class="lname">Comment Box {{ j + 1 }}</label>
476 <input 476 <input
477 type="text" 477 type="text"
478 class="form-control" 478 class="form-control"
479 value="" 479 value=""
480 placeholder=" " 480 placeholder=" "
481 v-model="cum.comment" 481 v-model="cum.comment"
482 v-on:blur="updateComment(cum)" 482 v-on:blur="updateComment(cum)"
483 /> 483 />
484 </div> 484 </div>
485 </div> 485 </div>
486 </div> 486 </div>
487 </div> 487 </div>
488 488
489 <!-- 1st row --> 489 <!-- 1st row -->
490 <div class="row"> 490 <div class="row">
491 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 491 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
492 <div class="form-group floating-label"> 492 <div class="form-group floating-label">
493 <label for="lname" class="lname">Slides Name</label> 493 <label for="lname" class="lname">Slides Name</label>
494 <select 494 <select
495 class="form-control" 495 class="form-control"
496 v-model="slideId" 496 v-model="slideId"
497 v-on:change="slideSelected(slideId)" 497 v-on:change="slideSelected(slideId)"
498 > 498 >
499 <option value="null">Select Slide</option> 499 <option value="null">Select Slide</option>
500 <option v-for="(template, i) in templateList" :key="i" :value="i"> 500 <option v-for="(template, i) in templateList" :key="i" :value="i">
501 {{ template.name }} 501 {{ template.name }}
502 </option> 502 </option>
503 </select> 503 </select>
504 </div> 504 </div>
505 </div> 505 </div>
506 </div> 506 </div>
507 <!-- 1st row --> 507 <!-- 1st row -->
508 508
509 <!-- 1st row end --> 509 <!-- 1st row end -->
510 <!-- case study ends --> 510 <!-- case study ends -->
511 <div class="clearfix"></div> 511 <div class="clearfix"></div>
512 512
513 <!-- users land image --> 513 <!-- users land image -->
514 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 514 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
515 <div class="form-layout signup-frm-spc"> 515 <div class="form-layout signup-frm-spc">
516 <form> 516 <form>
517 <a 517 <a
518 href="javascript:void(0);" 518 href="javascript:void(0);"
519 class="btn btn-lg sb-button" 519 class="btn btn-lg sb-button"
520 type="submit" 520 type="submit"
521 @click="submit" 521 @click="submit"
522 > 522 >
523 <img src="../assets/images/key.svg" /> submit 523 <img src="../assets/images/key.svg" /> submit
524 </a> 524 </a>
525 </form> 525 </form>
526 </div> 526 </div>
527 </div> 527 </div>
528 528
529 <!-- data wrp --> 529 <!-- data wrp -->
530 <!-- body wrapper --> 530 <!-- body wrapper -->
531 </div> 531 </div>
532 </main> 532 </main>
533 </template> 533 </template>
534 534
535 <script> 535 <script>
536 import Vue from "vue"; 536 import Vue from "vue";
537 import router from "../router"; 537 import router from "../router";
538 import $ from "jquery"; 538 import $ from "jquery";
539 import axios from "axios"; 539 import axios from "axios";
540 540
541 export default { 541 export default {
542 name: "Profile", 542 name: "Profile",
543 543
544 data() { 544 data() {
545 return { 545 return {
546 object: null, 546 object: null,
547 loggedinFlag: false, 547 loggedinFlag: false,
548 templateImage: null, 548 templateImage: null,
549 caseId: null, 549 caseId: null,
550 editMode: false, 550 editMode: false,
551 userData: null, 551 userData: null,
552 usertoken: null, 552 usertoken: null,
553 insightName: null, 553 insightName: null,
554 focusName: null, 554 focusName: null,
555 slideId: null, 555 slideId: null,
556 userList: [], 556 userList: [],
557 templateList: [], 557 templateList: [],
558 insightList: [], 558 insightList: [],
559 insightId: null, 559 insightId: null,
560 caseStudy: { 560 caseStudy: {
561 caseStudyDetails: { 561 caseStudyDetails: {
562 userId: [], 562 userId: [],
563 intro: { 563 intro: {
564 name: null, 564 name: null,
565 logoURL: null, 565 logoURL: null,
566 app: null, 566 app: null,
567 type: null, 567 type: null,
568 readTime: null, 568 readTime: null,
569 platForm: null, 569 platForm: null,
570 authors: [], 570 authors: [],
571 }, 571 },
572 outro: { 572 outro: {
573 authorImage: [], 573 authorImage: [],
574 authors: [], 574 authors: [],
575 designer: null, 575 designer: null,
576 illustrations: null, 576 illustrations: null,
577 }, 577 },
578 insightTags: [], 578 insightTags: [],
579 focusAreas: [], 579 focusAreas: [],
580 }, 580 },
581 slides: [], 581 slides: [],
582 }, 582 },
583 selectPlatform: "", 583 selectPlatform: "",
584 }; 584 };
585 }, 585 },
586 mounted() { 586 mounted() {
587 if (this.$route.fullPath.split("?").length == 2) { 587 if (this.$route.fullPath.split("?").length == 2) {
588 this.editMode = true; 588 this.editMode = true;
589 this.caseId = this.$route.fullPath.split("?")[1]; 589 this.caseId = this.$route.fullPath.split("?")[1];
590 var introData = localStorage.getItem("spotlight_caseStudy" + this.caseId); 590 var introData = localStorage.getItem("spotlight_caseStudy" + this.caseId);
591 if (introData) { 591 if (introData) {
592 introData = JSON.parse(introData); 592 introData = JSON.parse(introData);
593 console.log("introData", introData); 593 console.log("introData", introData);
594 if (introData.intro.focus) { 594 if (introData.intro.focus) {
595 delete introData.intro.focus; 595 delete introData.intro.focus;
596 } 596 }
597 this.caseStudy.caseStudyDetails.intro = introData.intro; 597 this.caseStudy.caseStudyDetails.intro = introData.intro;
598 this.caseStudy.caseStudyDetails.userId = introData.userId; 598 this.caseStudy.caseStudyDetails.userId = introData.userId;
599 this.caseStudy.caseStudyDetails.outro = introData.outro; 599 this.caseStudy.caseStudyDetails.outro = introData.outro;
600 this.caseStudy.caseStudyDetails.insightTags = introData.insightTags; 600 this.caseStudy.caseStudyDetails.insightTags = introData.insightTags;
601 this.caseStudy.caseStudyDetails.focusAreas = introData.focusAreas; 601 this.caseStudy.caseStudyDetails.focusAreas = introData.focusAreas;
602 this.selectPlatform = introData.intro.platForm; 602 this.selectPlatform = introData.intro.platForm;
603 console.log("this.selectPlatform", this.selectPlatform); 603 console.log("this.selectPlatform", this.selectPlatform);
604 } 604 }
605 } 605 }
606 var userdata = localStorage.getItem("spotlight_usertoken"); 606 var userdata = localStorage.getItem("spotlight_usertoken");
607 if (userdata) { 607 if (userdata) {
608 userdata = JSON.parse(userdata); 608 userdata = JSON.parse(userdata);
609 this.usertoken = userdata.token; 609 this.usertoken = userdata.token;
610 this.getUserList(); 610 this.getUserList();
611 this.getTemplateList(); 611 this.getTemplateList();
612 this.getInsightList(); 612 this.getInsightList();
613 } 613 }
614 }, 614 },
615 methods: { 615 methods: {
616 selectUser(i) { 616 selectUser(i) {
617 this.userList[i]; 617 this.userList[i];
618 this.caseStudy.caseStudyDetails.intro.authors.push(this.userList[i].name); 618 this.caseStudy.caseStudyDetails.intro.authors.push(this.userList[i].name);
619 this.caseStudy.caseStudyDetails.outro.authors.push(this.userList[i].name); 619 this.caseStudy.caseStudyDetails.outro.authors.push(this.userList[i].name);
620 this.caseStudy.caseStudyDetails.userId.push(this.userList[i]._id); 620 this.caseStudy.caseStudyDetails.userId.push(this.userList[i]._id);
621 console.log("-", this.caseStudy); 621 console.log("-", this.caseStudy);
622 }, 622 },
623 623
624 logout() { 624 logout() {
625 this.$router.push("/"); 625 this.$router.push("/");
626 }, 626 },
627 addInsight(type) { 627 addInsight(type) {
628 if (type == "focus") { 628 if (type == "focus") {
629 this.caseStudy.caseStudyDetails.focusAreas.push(this.focusName); 629 this.caseStudy.caseStudyDetails.focusAreas.push(this.focusName);
630 this.focusName = null; 630 this.focusName = null;
631 } else if (type == "insight") { 631 } else if (type == "insight") {
632 this.caseStudy.caseStudyDetails.insightTags.push(this.insightName); 632 this.caseStudy.caseStudyDetails.insightTags.push(this.insightName);
633 this.insightName = null; 633 this.insightName = null;
634 } else if (type == "platform") { 634 } else if (type == "platform") {
635 this.caseStudy.caseStudyDetails.intro.platForm = this.selectPlatform; 635 this.caseStudy.caseStudyDetails.intro.platForm = this.selectPlatform;
636 // this.selectPlatform = null; 636 // this.selectPlatform = null;
637 } 637 }
638 }, 638 },
639 removeInsight(i, type) { 639 removeInsight(i, type) {
640 if (type == "focus") { 640 if (type == "focus") {
641 this.caseStudy.caseStudyDetails.focusAreas.splice(i, 1); 641 this.caseStudy.caseStudyDetails.focusAreas.splice(i, 1);
642 } else if (type == "insight") { 642 } else if (type == "insight") {
643 this.caseStudy.caseStudyDetails.insightTags.splice(i, 1); 643 this.caseStudy.caseStudyDetails.insightTags.splice(i, 1);
644 } else if (type == "platform") { 644 } else if (type == "platform") {
645 this.caseStudy.caseStudyDetails.intro.platForm = ""; 645 this.caseStudy.caseStudyDetails.intro.platForm = "";
646 this.selectPlatform = null; 646 this.selectPlatform = null;
647 } 647 }
648 }, 648 },
649 649
650 async slideSelected(i) { 650 async slideSelected(i) {
651 console.log("id is", this.templateList[i]); 651 console.log("id is", this.templateList[i]);
652 this.object = JSON.parse(JSON.stringify(this.templateList[i])); 652 this.object = JSON.parse(JSON.stringify(this.templateList[i]));
653 653
654 // var keys = Object.keys(this.templateList[i]); 654 // var keys = Object.keys(this.templateList[i]);
655 // keys.forEach(element => { 655 // keys.forEach(element => {
656 // obj[element] = this.templateList[i][element]; 656 // obj[element] = this.templateList[i][element];
657 // }); 657 // });
658 658
659 console.log("obj", this.object); 659 console.log("obj", this.object);
660 // slideMetadata = await this.getMeatda(this.templateList[i]._id); 660 // slideMetadata = await this.getMeatda(this.templateList[i]._id);
661 this.slideId = null; 661 this.slideId = null;
662 // this.templateList[i].metaData = slideMetadata.metaData; 662 // this.templateList[i].metaData = slideMetadata.metaData;
663 this.caseStudy.slides.push(this.object); 663 this.caseStudy.slides.push(this.object);
664 this.templateList[i].metaData.fields.forEach((fields_) => { 664 this.templateList[i].metaData.fields.forEach((fields_) => {
665 fields_.fieldValue == null; 665 fields_.fieldValue == null;
666 }); 666 });
667 if (this.templateList[i].metaData.comments) { 667 if (this.templateList[i].metaData.comments) {
668 this.templateList[i].metaData.comments.forEach((coments_) => { 668 this.templateList[i].metaData.comments.forEach((coments_) => {
669 coments_.comment == null; 669 coments_.comment == null;
670 }); 670 });
671 } 671 }
672 console.log("this.caseStudy.slides", this.caseStudy.slides); 672 console.log("this.caseStudy.slides", this.caseStudy.slides);
673 }, 673 },
674 async insightSelected(data) { 674 async insightSelected(data) {
675 // this.caseStudy.slides.push(this.templateList[i]); 675 // this.caseStudy.slides.push(this.templateList[i]);
676 676
677 console.log("data", data); 677 console.log("data", data);
678 data.insightId = this.insightId; 678 data.insightId = this.insightId;
679 // this.insightId = null; 679 // this.insightId = null;
680 }, 680 },
681 681
682 removeSlide(i) { 682 removeSlide(i) {
683 this.caseStudy.slides.splice(i, 1); 683 this.caseStudy.slides.splice(i, 1);
684 }, 684 },
685 685
686 createImage(type) { 686 createImage(type) {
687 var that = this; 687 var that = this;
688 console.log(document.getElementById(type)); 688 console.log(document.getElementById(type));
689 var file = document.getElementById(type).files[0]; 689 var file = document.getElementById(type).files[0];
690 console.log("file", file); 690 console.log("file", file);
691 var reader = new FileReader(); 691 var reader = new FileReader();
692 reader.onload = function (e) { 692 reader.onload = function (e) {
693 console.log("e.target.result ", e.target.result); 693 console.log("e.target.result ", e.target.result);
694 that.uploadImage(type, e.target.result); 694 that.uploadImage(type, e.target.result);
695 }; 695 };
696 reader.onerror = function (error) { 696 reader.onerror = function (error) {
697 alert(error); 697 alert(error);
698 }; 698 };
699 if (file) { 699 if (file) {
700 reader.readAsDataURL(file); 700 reader.readAsDataURL(file);
701 } 701 }
702 }, 702 },
703 uploadImage(type, base64) { 703 uploadImage(type, base64) {
704 console.log("type", type); 704 console.log("type", type);
705 var obj = { 705 var obj = {
706 image: base64, 706 image: base64,
707 }; 707 };
708 axios 708 axios
709 .post("/superAdmin/uploadImage", obj, { 709 .post("/superAdmin/uploadImage", obj, {
710 headers: { 710 headers: {
711 Authorization: "Bearer " + this.usertoken, 711 Authorization: "Bearer " + this.usertoken,
712 }, 712 },
713 }) 713 })
714 .then((response) => { 714 .then((response) => {
715 if (type == "logo") { 715 if (type == "logo") {
716 setTimeout( 716 setTimeout(
717 () => 717 () =>
718 (this.caseStudy.caseStudyDetails.intro.logoURL = 718 (this.caseStudy.caseStudyDetails.intro.logoURL =
719 response.data.data), 719 response.data.data),
720 99 720 99
721 ); 721 );
722 } else if (type == "outdor") { 722 } else if (type == "outdor") {
723 this.caseStudy.caseStudyDetails.outro.authorImage = []; 723 this.caseStudy.caseStudyDetails.outro.authorImage = [];
724 setTimeout( 724 setTimeout(
725 () => 725 () =>
726 this.caseStudy.caseStudyDetails.outro.authorImage.push( 726 this.caseStudy.caseStudyDetails.outro.authorImage.push(
727 response.data.data 727 response.data.data
728 ), 728 ),
729 99 729 99
730 ); 730 );
731 } 731 }
732 732
733 console.log(response.data.data); 733 console.log(response.data.data);
734 console.log(this.caseStudy); 734 console.log(this.caseStudy);
735 }) 735 })
736 .catch((error) => { 736 .catch((error) => {
737 if (error.response) { 737 if (error.response) {
738 this.$toaster.error(error.response.data.message); 738 this.$toaster.error(error.response.data.message);
739 } 739 }
740 }); 740 });
741 }, 741 },
742 742
743 fieldcreateImage(i, j) { 743 fieldcreateImage(i, j) {
744 console.log("i", i); 744 console.log("i", i);
745 console.log("j", j); 745 console.log("j", j);
746 var that = this; 746 var that = this;
747 var id = i + "" + j; 747 var id = i + "" + j;
748 console.log(document.getElementById(id)); 748 console.log(document.getElementById(id));
749 var file = document.getElementById(id).files[0]; 749 var file = document.getElementById(id).files[0];
750 // var file = document.querySelector("input[type=file]").files[0]; 750 // var file = document.querySelector("input[type=file]").files[0];
751 console.log("file", file); 751 console.log("file", file);
752 var reader = new FileReader(); 752 var reader = new FileReader();
753 reader.onload = function (e) { 753 reader.onload = function (e) {
754 // console.log("e.target.result ",e.target.result ) 754 // console.log("e.target.result ",e.target.result )
755 that.fielduploadImage(i, j, e.target.result); 755 that.fielduploadImage(i, j, e.target.result);
756 }; 756 };
757 reader.onerror = function (error) { 757 reader.onerror = function (error) {
758 alert(error); 758 alert(error);
759 }; 759 };
760 if (file) { 760 if (file) {
761 reader.readAsDataURL(file); 761 reader.readAsDataURL(file);
762 } 762 }
763 }, 763 },
764 fielduploadImage(i, j, base64) { 764 fielduploadImage(i, j, base64) {
765 var obj = { 765 var obj = {
766 image: base64, 766 image: base64,
767 }; 767 };
768 axios 768 axios
769 .post("/superAdmin/uploadImage", obj, { 769 .post("/superAdmin/uploadImage", obj, {
770 headers: { 770 headers: {
771 Authorization: "Bearer " + this.usertoken, 771 Authorization: "Bearer " + this.usertoken,
772 }, 772 },
773 }) 773 })
774 .then((response) => { 774 .then((response) => {
775 setTimeout( 775 setTimeout(
776 () => 776 () =>
777 (this.caseStudy.slides[i].metaData.fields[j].fieldValue = 777 (this.caseStudy.slides[i].metaData.fields[j].fieldValue =
778 response.data.data), 778 response.data.data),
779 10 779 10
780 ); 780 );
781 781
782 console.log(response.data.data); 782 console.log(response.data.data);
783 console.log(this.caseStudy); 783 console.log(this.caseStudy);
784 }) 784 })
785 .catch((error) => { 785 .catch((error) => {
786 if (error.response) { 786 if (error.response) {
787 this.$toaster.error(error.response.data.message); 787 this.$toaster.error(error.response.data.message);
788 } 788 }
789 }); 789 });
790 }, 790 },
791 791
792 getUserList() { 792 getUserList() {
793 axios 793 axios
794 .get("/superAdmin/users", { 794 .get("/superAdmin/users", {
795 headers: { 795 headers: {
796 Authorization: "Bearer " + this.usertoken, 796 Authorization: "Bearer " + this.usertoken,
797 }, 797 },
798 }) 798 })
799 .then((response) => { 799 .then((response) => {
800 response.data.data.forEach((element) => { 800 response.data.data.forEach((element) => {
801 if (element.name) { 801 if (element.name) {
802 this.userList.push(element); 802 this.userList.push(element);
803 } 803 }
804 }); 804 });
805 console.log("response", this.userList); 805 console.log("response", this.userList);
806 }) 806 })
807 .catch((error) => console.log(error)); 807 .catch((error) => console.log(error));
808 }, 808 },
809 809
810 getTemplateList() { 810 getTemplateList() {
811 axios 811 axios
812 .get("/superAdmin/templates", { 812 .get("/superAdmin/templates", {
813 headers: { 813 headers: {
814 Authorization: "Bearer " + this.usertoken, 814 Authorization: "Bearer " + this.usertoken,
815 }, 815 },
816 }) 816 })
817 .then((response) => { 817 .then((response) => {
818 response.data.data.forEach((temp) => { 818 response.data.data.forEach((temp) => {
819 if ( 819 if (
820 temp._id != "INTRO_oqkdMOVDrwRptsdWJ6Ye" && 820 temp._id != "INTRO_oqkdMOVDrwRptsdWJ6Ye" &&
821 temp._id != "OUTRO_oqkdMOVDrwRptsdWJ6Ye" 821 temp._id != "OUTRO_oqkdMOVDrwRptsdWJ6Ye"
822 ) { 822 ) {
823 if (temp.bounceBoard) { 823 if (temp.bounceBoard) {
824 for (var i = 0; i < temp.commentBox; i++) { 824 for (var i = 0; i < temp.commentBox; i++) {
825 temp.metaData.comments.push({ 825 temp.metaData.comments.push({
826 userId: null, 826 userId: null,
827 slideId: null, 827 slideId: null,
828 caseStudyId: null, 828 caseStudyId: null,
829 comment: null, 829 comment: null,
830 }); 830 });
831 } 831 }
832 } 832 }
833 this.templateList.push(temp); 833 this.templateList.push(temp);
834 } 834 }
835 }); 835 });
836 if (this.editMode) { 836 if (this.editMode) {
837 this.getSLideData(); 837 this.getSLideData();
838 } 838 }
839 console.log("templates", this.templateList); 839 console.log("templates", this.templateList);
840 }) 840 })
841 .catch((error) => console.log(error)); 841 .catch((error) => console.log(error));
842 }, 842 },
843 getInsightList() { 843 getInsightList() {
844 axios 844 axios
845 .get("/superAdmin/insight", { 845 .get("/superAdmin/insight", {
846 headers: { 846 headers: {
847 Authorization: "Bearer " + this.usertoken, 847 Authorization: "Bearer " + this.usertoken,
848 }, 848 },
849 }) 849 })
850 .then((response) => { 850 .then((response) => {
851 this.insightList = response.data.data; 851 this.insightList = response.data.data;
852 852
853 console.log("insight", response.data.data); 853 console.log("insight", response.data.data);
854 }) 854 })
855 .catch((error) => console.log(error)); 855 .catch((error) => console.log(error));
856 }, 856 },
857 857
858 getSLideData() { 858 getSLideData() {
859 axios 859 axios
860 .get("/superAdmin/caseStudySlides?caseStudyId=" + this.caseId, { 860 .get("/superAdmin/caseStudySlides?caseStudyId=" + this.caseId, {
861 headers: { 861 headers: {
862 Authorization: "Bearer " + this.usertoken, 862 Authorization: "Bearer " + this.usertoken,
863 }, 863 },
864 }) 864 })
865 .then((response) => { 865 .then((response) => {
866 var finalArray = []; 866 var finalArray = [];
867 console.log("1");
867 response.data.data.forEach((template_) => { 868 response.data.data.forEach((template_) => {
868 console.log("template_", template_); 869 console.log("template_", template_);
869 var keys = []; 870 var keys = [];
870 var i = this.templateList.findIndex( 871 var i = this.templateList.findIndex(
871 (temp_) => temp_._id == template_.templateId 872 (temp_) => temp_._id == template_.templateId
872 ); 873 );
873 var obj = { 874 var obj = {
874 _id: this.templateList[i]._id, 875 _id: this.templateList[i]._id,
875 bounceBoard: this.templateList[i].bounceBoard, 876 bounceBoard: this.templateList[i].bounceBoard,
876 insight: this.templateList[i].insight, 877 insight: this.templateList[i].insight,
877 slideId: template_._id, 878 slideId: template_._id,
878 // commentBox: this.templateList[i].commentBox, 879 // commentBox: this.templateList[i].commentBox,
879 metaData: { 880 metaData: {
880 fields: [], 881 fields: [],
881 comments: [], 882 comments: [],
882 }, 883 },
883 }; 884 };
885 console.log("2");
886
884 if (this.templateList[i].bounceBoard) { 887 if (this.templateList[i].bounceBoard) {
885 obj.commentBox = this.templateList[i].commentBox; 888 obj.commentBox = this.templateList[i].commentBox;
886 obj.metaData.comments = template_.comments; 889 obj.metaData.comments = template_.comments;
887 } 890 }
888 if (this.templateList[i].insight) { 891 if (this.templateList[i].insight) {
889 obj.insightId = template_.insightId; 892 obj.insightId = template_.insightId;
890 } 893 }
891 var fieldArray = []; 894 var fieldArray = [];
895 console.log("3");
896
892 this.templateList[i].metaData.fields.forEach((element) => { 897 this.templateList[i].metaData.fields.forEach((element) => {
893 var fieldobj = { 898 var fieldobj = {
894 fieldName: element.fieldName, 899 fieldName: element.fieldName,
895 displayName: element.displayName, 900 displayName: element.displayName,
896 fieldValue: template_.metaData[element.fieldName], 901 fieldValue: template_.metaData[element.fieldName],
897 fieldType: element.fieldType, 902 fieldType: element.fieldType,
898 }; 903 };
899 obj.metaData.fields.push(fieldobj); 904 obj.metaData.fields.push(fieldobj);
900 }); 905 });
906 console.log("4");
907
901 finalArray.push(obj); 908 finalArray.push(obj);
902 this.insightId = template_.insight._id; 909 if(template_.insight){
910 this.insightId = template_.insight._id;
911 }
903 }); 912 });
913 console.log("5");
914
904 this.caseStudy.slides = finalArray; 915 this.caseStudy.slides = finalArray;
905 console.log("----", finalArray); 916 console.log("----", finalArray);
906 console.log(this.templateList, "getSLideData==>"); 917 console.log(this.templateList, "getSLideData==>");
907 }) 918 })
908 .catch((error) => console.log(error)); 919 .catch((error) => console.log(error));
909 }, 920 },
910 921
911 submit() { 922 submit() {
912 const latest = Object.create(this.caseStudy); 923 const latest = Object.create(this.caseStudy);
913 924
914 var slidArray = []; 925 var slidArray = [];
915 latest.slides.forEach((slides) => { 926 latest.slides.forEach((slides) => {
916 console.log("slides", slides); 927 console.log("slides", slides);
917 var slideData = {}; 928 var slideData = {};
918 slideData.templateId = slides._id; 929 slideData.templateId = slides._id;
919 slideData.bounceBoard = slides.bounceBoard; 930 slideData.bounceBoard = slides.bounceBoard;
920 slideData.insight = slides.insight; 931 slideData.insight = slides.insight;
921 if (slides.slideId) { 932 if (slides.slideId) {
922 slideData.slideId = slides.slideId; 933 slideData.slideId = slides.slideId;
923 } 934 }
924 if (slides.insightId) { 935 if (slides.insightId) {
925 slideData.insightId = slides.insightId; 936 slideData.insightId = slides.insightId;
926 } 937 }
927 if (slides.metaData.comments && slides.metaData.comments.length > 0) { 938 if (slides.metaData.comments && slides.metaData.comments.length > 0) {
928 slideData.comments = slides.metaData.comments; 939 slideData.comments = slides.metaData.comments;
929 // this.getSLideData(); 940 // this.getSLideData();
930 } 941 }
931 // var comments = []; 942 // var comments = [];
932 // if (slides.bounceBoard) { 943 // if (slides.bounceBoard) {
933 // slides.metaData.comments.forEach((element) => { 944 // slides.metaData.comments.forEach((element) => {
934 // comments.push(element.comment); 945 // comments.push(element.comment);
935 // }); 946 // });
936 // slideData.comments = comments; 947 // slideData.comments = comments;
937 // } 948 // }
938 949
939 slides.metaData.fields.forEach((fields_) => { 950 slides.metaData.fields.forEach((fields_) => {
940 slideData[fields_.fieldName] = fields_.fieldValue; 951 slideData[fields_.fieldName] = fields_.fieldValue;
941 }); 952 });
942 slidArray.push(slideData); 953 slidArray.push(slideData);
943 // delete slides.metaData.fields; 954 // delete slides.metaData.fields;
944 }); 955 });
945 956
946 console.log("slideData", slidArray); 957 console.log("slideData", slidArray);
947 if (this.editMode) { 958 if (this.editMode) {
948 this.updateProfile(slidArray); 959 this.updateProfile(slidArray);
949 } else { 960 } else {
950 this.saveProfile(slidArray); 961 this.saveProfile(slidArray);
951 } 962 }
952 }, 963 },
953 updateComment(cmnt) { 964 updateComment(cmnt) {
954 if (!cmnt._id) { 965 if (!cmnt._id) {
955 return; 966 return;
956 } 967 }
957 console.log("cmnts", cmnt); 968 console.log("cmnts", cmnt);
958 var obj = { 969 var obj = {
959 slideId: cmnt.slideId, 970 slideId: cmnt.slideId,
960 commentId: cmnt._id, 971 commentId: cmnt._id,
961 comment: cmnt.comment, 972 comment: cmnt.comment,
962 }; 973 };
963 axios 974 axios
964 .put("/superAdmin/comment", obj, { 975 .put("/superAdmin/comment", obj, {
965 headers: { 976 headers: {
966 Authorization: "Bearer " + this.usertoken, 977 Authorization: "Bearer " + this.usertoken,
967 }, 978 },
968 }) 979 })
969 .then((response) => { 980 .then((response) => {
970 console.log(response); 981 console.log(response);
971 }) 982 })
972 .catch((error) => {}); 983 .catch((error) => {});
973 }, 984 },
974 985
975 saveProfile(slides) { 986 saveProfile(slides) {
976 var obj = {}; 987 var obj = {};
977 obj.caseStudyDetails = this.caseStudy.caseStudyDetails; 988 obj.caseStudyDetails = this.caseStudy.caseStudyDetails;
978 obj.caseStudyDetails.intro.readTime = Math.round( 989 obj.caseStudyDetails.intro.readTime = Math.round(
979 slides.length / 3 990 slides.length / 3
980 ).toString(); 991 ).toString();
981 obj.slides = slides; 992 obj.slides = slides;
982 axios 993 axios
983 .post("/superAdmin/caseStudy", obj, { 994 .post("/superAdmin/caseStudy", obj, {
984 headers: { 995 headers: {
985 Authorization: "Bearer " + this.usertoken, 996 Authorization: "Bearer " + this.usertoken,
986 }, 997 },
987 }) 998 })
988 .then((response) => { 999 .then((response) => {
989 // this.userData = response.data.data; 1000 // this.userData = response.data.data;
990 this.$toaster.success("Case Study Created"); 1001 this.$toaster.success("Case Study Created");
991 this.$router.go(this.$router.currentRoute); 1002 this.$router.go(this.$router.currentRoute);
992 1003
993 console.log(response); 1004 console.log(response);
994 }) 1005 })
995 .catch((error) => { 1006 .catch((error) => {
996 if (error.response) { 1007 if (error.response) {
997 this.$toaster.error(error.response.data.message); 1008 this.$toaster.error(error.response.data.message);
998 } 1009 }
999 }); 1010 });
1000 }, 1011 },
1001 1012
1002 updateProfile(slides) { 1013 updateProfile(slides) {
1003 var obj = {}; 1014 var obj = {};
1004 (obj.caseStudyId = this.caseId), 1015 (obj.caseStudyId = this.caseId),
1005 (obj.caseStudyDetails = this.caseStudy.caseStudyDetails); 1016 (obj.caseStudyDetails = this.caseStudy.caseStudyDetails);
1006 obj.caseStudyDetails.intro.readTime = Math.round( 1017 obj.caseStudyDetails.intro.readTime = Math.round(
1007 slides.length / 3 1018 slides.length / 3
1008 ).toString(); 1019 ).toString();
1009 obj.slides = slides; 1020 obj.slides = slides;
1010 delete obj.caseStudyDetails.intro.focus; 1021 delete obj.caseStudyDetails.intro.focus;
1011 axios 1022 axios
1012 .put("/superAdmin/caseStudy", obj, { 1023 .put("/superAdmin/caseStudy", obj, {
1013 headers: { 1024 headers: {
1014 Authorization: "Bearer " + this.usertoken, 1025 Authorization: "Bearer " + this.usertoken,
1015 }, 1026 },
1016 }) 1027 })
1017 .then((response) => { 1028 .then((response) => {
1018 // this.userData = response.data.data; 1029 // this.userData = response.data.data;
1019 this.$toaster.success("Case Study Updated"); 1030 this.$toaster.success("Case Study Updated");
1020 this.$router.go(this.$router.currentRoute); 1031 this.$router.go(this.$router.currentRoute);
1021 1032
1022 console.log(response); 1033 console.log(response);
1023 }) 1034 })
1024 .catch((error) => { 1035 .catch((error) => {
1025 if (error.response) { 1036 if (error.response) {
1026 this.$toaster.error(error.response.data.message); 1037 this.$toaster.error(error.response.data.message);
1027 } 1038 }
1028 }); 1039 });
1029 }, 1040 },
1030 listPage(url) { 1041 listPage(url) {
1031 this.$router.push(url); 1042 this.$router.push(url);
1032 }, 1043 },
1033 1044
1034 addProfileDialog(slide) { 1045 addProfileDialog(slide) {
1035 console.log("slide", slide); 1046 console.log("slide", slide);
1036 this.templateImage = slide.templateImage; 1047 this.templateImage = slide.templateImage;
1037 $(".inner-wrp").addClass("body-blur"); 1048 $(".inner-wrp").addClass("body-blur");
1038 $("#add-social-links").hide(); 1049 $("#add-social-links").hide();
1039 $(".popup-wrp, #add-profile").show(); 1050 $(".popup-wrp, #add-profile").show();
1040 }, 1051 },
1041 1052
1042 closeDialog() { 1053 closeDialog() {
1043 this.templateImage = null; 1054 this.templateImage = null;
1044 $(".popup-wrp").hide(); 1055 $(".popup-wrp").hide();
1045 $(".inner-wrp").removeClass("body-blur"); 1056 $(".inner-wrp").removeClass("body-blur");
1046 // this.saveProfile(); 1057 // this.saveProfile();
1047 }, 1058 },
1048 hideDialog() { 1059 hideDialog() {
1049 this.templateImage = null; 1060 this.templateImage = null;
1050 $(".popup-wrp").hide(); 1061 $(".popup-wrp").hide();
1051 $(".inner-wrp").removeClass("body-blur"); 1062 $(".inner-wrp").removeClass("body-blur");
1052 }, 1063 },
1053 1064
1054 async getMeatda(tempId) { 1065 async getMeatda(tempId) {
1055 var obj = [ 1066 var obj = [
1056 { 1067 {
1057 tempId: "T1_RoeMG8130Xko1DvhC3Ou", 1068 tempId: "T1_RoeMG8130Xko1DvhC3Ou",
1058 metaData: { 1069 metaData: {
1059 fields: [ 1070 fields: [
1060 { 1071 {
1061 fieldName: "authorImage", 1072 fieldName: "authorImage",
1062 displayName: "Author Image", 1073 displayName: "Author Image",
1063 fieldValue: null, 1074 fieldValue: null,
1064 fieldType: "image", 1075 fieldType: "image",
1065 }, 1076 },
1066 { 1077 {
1067 fieldName: "mobileImage", 1078 fieldName: "mobileImage",
1068 displayName: "Mobile Image", 1079 displayName: "Mobile Image",
1069 fieldValue: null, 1080 fieldValue: null,
1070 fieldType: "image", 1081 fieldType: "image",
1071 }, 1082 },
1072 { 1083 {
1073 fieldName: "textBox", 1084 fieldName: "textBox",
1074 displayName: "Text Box", 1085 displayName: "Text Box",
1075 fieldValue: null, 1086 fieldValue: null,
1076 fieldType: "text", 1087 fieldType: "text",
1077 }, 1088 },
1078 ], 1089 ],
1079 }, 1090 },
1080 }, 1091 },
1081 { 1092 {
1082 tempId: "T2_ROsUOEy3vxsRAiQ72XdI", 1093 tempId: "T2_ROsUOEy3vxsRAiQ72XdI",
1083 metaData: { 1094 metaData: {
1084 fields: [ 1095 fields: [
1085 { 1096 {
1086 fieldName: "authorImage", 1097 fieldName: "authorImage",
1087 displayName: "Author Image", 1098 displayName: "Author Image",
1088 fieldValue: null, 1099 fieldValue: null,
1089 fieldType: "image", 1100 fieldType: "image",
1090 }, 1101 },
1091 ], 1102 ],
1092 comments: [{ comment: null }, { comment: null }, { comment: null }], 1103 comments: [{ comment: null }, { comment: null }, { comment: null }],
1093 }, 1104 },
1094 }, 1105 },
1095 { 1106 {
1096 tempId: "T3_cqNIf7tuqL4jyON63dA7", 1107 tempId: "T3_cqNIf7tuqL4jyON63dA7",
1097 metaData: { 1108 metaData: {
1098 fields: [ 1109 fields: [
1099 { 1110 {
1100 fieldName: "authorImage", 1111 fieldName: "authorImage",
1101 displayName: "Author Image", 1112 displayName: "Author Image",
1102 fieldValue: null, 1113 fieldValue: null,
1103 fieldType: "image", 1114 fieldType: "image",
1104 }, 1115 },
1105 { 1116 {
1106 fieldName: "mobileImage", 1117 fieldName: "mobileImage",
1107 displayName: "Mobile Image", 1118 displayName: "Mobile Image",
1108 fieldValue: null, 1119 fieldValue: null,
1109 fieldType: "image", 1120 fieldType: "image",
1110 }, 1121 },
1111 ], 1122 ],
1112 comments: [ 1123 comments: [
1113 { comment: null }, 1124 { comment: null },
1114 { comment: null }, 1125 { comment: null },
1115 { comment: null }, 1126 { comment: null },
1116 { comment: null }, 1127 { comment: null },
1117 ], 1128 ],
1118 }, 1129 },
1119 }, 1130 },
1120 ]; 1131 ];
1121 var i = obj.findIndex((obj_) => obj_.tempId == tempId); 1132 var i = obj.findIndex((obj_) => obj_.tempId == tempId);
1122 return obj[i]; 1133 return obj[i];
1123 }, 1134 },
1124 }, 1135 },
1125 }; 1136 };
1126 </script> 1137 </script>
1127 1138