Commit 74dbc1d9ff5d9944bd1ecf60eefaac17701fcf19

Authored by Digvijay Singh
1 parent 640c123208
Exists in admin

image added

Showing 2 changed files with 16 additions and 8 deletions   Show diff stats
config/dev.env.js
1 'use strict' 1 'use strict'
2 const merge = require('webpack-merge') 2 const merge = require('webpack-merge')
3 const prodEnv = require('./prod.env') 3 const prodEnv = require('./prod.env')
4 4
5 module.exports = merge(prodEnv, { 5 module.exports = merge(prodEnv, {
6 NODE_ENV: '"development"', 6 NODE_ENV: '"development"',
7 // APIurl: '"https://cors-anywhere.herokuapp.com/https://www.gigsfor.me/_functions"', 7 // APIurl: '"https://cors-anywhere.herokuapp.com/https://www.gigsfor.me/_functions"',
8 // APIurl: '"https://stg-api.gigsfor.me/api"', 8 // APIurl: '"https://stg-api.gigsfor.me/api"',
9 APIurl: '"https://stg-api.gigsfor.me/api"', 9 APIurl: '"https://stg-api.gigsfor.me/api"',
10 siteUrl: '"http://134.209.156.59:8081"', 10 siteUrl: '"http://134.209.156.59:8081"',
11 imageUrl: '"https://stg-api.gigsfor.me/"', 11 imageUrl: '"https://stg-api.gigsfor.me/"',
12 fileUploadKey: '"AYqgvDoo4RyBC0STV6og2z"', 12 fileUploadKey: '"AYqgvDoo4RyBC0STV6og2z"',
13 landbotUrl: '"https://landbot.io/u/H-347617-SIJESECF8DSSQ06L/index.html"', 13 landbotUrl: '"https://landbot.io/u/H-347617-SIJESECF8DSSQ06L/index.html"',
14 courseId1: '"5e4b77e8f77376502a616cd2"', 14 courseId1: '"5e4b77e8f77376502a616cd2"',
15 courseId2: '"5e4b77f5f77376502a616cd9"', 15 courseId2: '"5e4b77f5f77376502a616cd9"',
16 courseId3: '"5e4b76155d6509dfec06e109"' 16 courseId3: '"5e4b76155d6509dfec06e109"'
17 }) 17 })
18
19
20
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="container-fluid inner-wrp" style="background: transparent"> 4 <div class="container-fluid inner-wrp" style="background: transparent">
5 <nav class="navbar navbar-expand-sm spotLight-nav"> 5 <nav class="navbar navbar-expand-sm spotLight-nav">
6 <a class="navbar-brand" href="#" 6 <a class="navbar-brand" href="#"
7 ><img src="../assets/images/logo.png" 7 ><img src="../assets/images/logo.png"
8 /></a> 8 /></a>
9 <button 9 <button
10 class="navbar-toggler" 10 class="navbar-toggler"
11 type="button" 11 type="button"
12 data-toggle="collapse" 12 data-toggle="collapse"
13 data-target="#navbarsExample03" 13 data-target="#navbarsExample03"
14 aria-controls="navbarsExample03" 14 aria-controls="navbarsExample03"
15 aria-expanded="false" 15 aria-expanded="false"
16 aria-label="Toggle navigation" 16 aria-label="Toggle navigation"
17 > 17 >
18 <span class="navbar-toggler-icon"></span> 18 <span class="navbar-toggler-icon"></span>
19 <span class="navbar-toggler-icon"></span> 19 <span class="navbar-toggler-icon"></span>
20 <span class="navbar-toggler-icon"></span> 20 <span class="navbar-toggler-icon"></span>
21 </button> 21 </button>
22 22
23 <div class="collapse navbar-collapse" id="navbarsExample03"> 23 <div class="collapse navbar-collapse" id="navbarsExample03">
24 <ul class="navbar-nav mr-auto"> 24 <ul class="navbar-nav mr-auto">
25 <li class="nav-item active"> 25 <li class="nav-item active">
26 <a class="nav-link" style="cursor:pointer" @click="listPage">Case Study List</a> 26 <a class="nav-link" style="cursor:pointer" @click="listPage">Case Study List</a>
27 </li> 27 </li>
28 <li class="nav-item active"> 28 <li class="nav-item active">
29 <a class="nav-link" style="cursor:pointer">Create Insight</a> 29 <a class="nav-link" style="cursor:pointer">Create Insight</a>
30 </li> 30 </li>
31 </ul> 31 </ul>
32 </div> 32 </div>
33 <div class=""> 33 <div class="">
34 <a href="javascript:void(0);" @click="logout">Log Out </a> 34 <a href="javascript:void(0);" @click="logout">Log Out </a>
35 </div> 35 </div>
36 </nav> 36 </nav>
37 <!-- menu wrapper --> 37 <!-- menu wrapper -->
38 <div class="row profile-tab-spc-top"> 38 <div class="row profile-tab-spc-top">
39 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 39 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
40 <div class="user-profile"> 40 <div class="user-profile">
41 <div class="form-group floating-label"> 41 <div class="form-group floating-label">
42 <select 42 <select
43 class="form-control" 43 class="form-control"
44 v-model="userData" 44 v-model="userData"
45 v-on:change="selectUser(userData)" 45 v-on:change="selectUser(userData)"
46 :disabled="editMode" 46 :disabled="editMode"
47 > 47 >
48 <option value="null">Select User</option> 48 <option value="null">Select User</option>
49 <option v-for="(user, i) in userList" :key="i" :value="i"> 49 <option v-for="(user, i) in userList" :key="i" :value="i">
50 {{ user.name }} ({{ user.email }}) 50 {{ user.name }} ({{ user.email }})
51 </option> 51 </option>
52 </select> 52 </select>
53 </div> 53 </div>
54 </div> 54 </div>
55 </div> 55 </div>
56 </div> 56 </div>
57 57
58 <div class="row"> 58 <div class="row">
59 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 59 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
60 <ul class="navbar-nav mr-auto"> 60 <ul class="navbar-nav mr-auto">
61 <li class="nav-item active"> 61 <li class="nav-item active">
62 <h5 class="nav-link">Intro Screen Record</h5> 62 <h5 class="nav-link">Intro Screen Record</h5>
63 </li> 63 </li>
64 </ul> 64 </ul>
65 </div> 65 </div>
66 </div> 66 </div>
67 <!-- 1st row --> 67 <!-- 1st row -->
68 <div class="row"> 68 <div class="row">
69 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 69 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
70 <div class="form-group floating-label"> 70 <div class="form-group floating-label">
71 <label for="lname" class="lname">Case Study Name</label> 71 <label for="lname" class="lname">Case Study Name</label>
72 <input 72 <input
73 type="text" 73 type="text"
74 class="form-control" 74 class="form-control"
75 value="" 75 value=""
76 placeholder=" " 76 placeholder=" "
77 v-model="caseStudy.caseStudyDetails.intro.name" 77 v-model="caseStudy.caseStudyDetails.intro.name"
78 /> 78 />
79 </div> 79 </div>
80 </div> 80 </div>
81 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 81 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
82 <div class="form-group floating-label"> 82 <div class="form-group floating-label">
83 <label for="lname" class="lname">App Name</label> 83 <label for="lname" class="lname">App Name</label>
84 <input 84 <input
85 type="text" 85 type="text"
86 class="form-control" 86 class="form-control"
87 value="" 87 value=""
88 placeholder=" " 88 placeholder=" "
89 v-model="caseStudy.caseStudyDetails.intro.app" 89 v-model="caseStudy.caseStudyDetails.intro.app"
90 /> 90 />
91 </div> 91 </div>
92 </div> 92 </div>
93 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 93 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
94 <div class="form-group floating-label"> 94 <div class="form-group floating-label">
95 <label for="lname" class="lname">Focus</label> 95 <label for="lname" class="lname">Focus</label>
96 <input 96 <input
97 type="text" 97 type="text"
98 class="form-control" 98 class="form-control"
99 value="" 99 value=""
100 placeholder=" " 100 placeholder=" "
101 v-model="caseStudy.caseStudyDetails.intro.focus" 101 v-model="caseStudy.caseStudyDetails.intro.focus"
102 /> 102 />
103 </div> 103 </div>
104 </div> 104 </div>
105 </div> 105 </div>
106 <!-- 1st row end --> 106 <!-- 1st row end -->
107 107
108 <!-- 2nd row --> 108 <!-- 2nd row -->
109 <div class="row"> 109 <div class="row">
110 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 110 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
111 <div class="form-group floating-label"> 111 <div class="form-group floating-label">
112 <label for="lname" class="lname">Case Study Type</label> 112 <label for="lname" class="lname">Case Study Type</label>
113 <select 113 <select
114 class="form-control" 114 class="form-control"
115 v-model="caseStudy.caseStudyDetails.intro.type" 115 v-model="caseStudy.caseStudyDetails.intro.type"
116 > 116 >
117 <option value="null">Select Case Type</option> 117 <option value="null">Select Case Type</option>
118 <option value="Retake">Retake</option> 118 <option value="Retake">Retake</option>
119 <option value="Behind-the-scenes">Behind-the-scenes</option> 119 <option value="Behind-the-scenes">Behind-the-scenes</option>
120 <option value="Critique">Critique</option> 120 <option value="Critique">Critique</option>
121 <option value="Juxtapose">Juxtapose</option> 121 <option value="Juxtapose">Juxtapose</option>
122 </select> 122 </select>
123 </div> 123 </div>
124 </div> 124 </div>
125 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 125 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
126 <div class="form-group floating-label"> 126 <div class="form-group floating-label">
127 <label for="lname" class="lname">Platform</label> 127 <label for="lname" class="lname">Platform</label>
128 <input 128 <input
129 type="text" 129 type="text"
130 class="form-control" 130 class="form-control"
131 value="" 131 value=""
132 placeholder=" " 132 placeholder=" "
133 v-model="caseStudy.caseStudyDetails.intro.platForm" 133 v-model="caseStudy.caseStudyDetails.intro.platForm"
134 /> 134 />
135 </div> 135 </div>
136 </div> 136 </div>
137 137
138 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 138 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
139 <div class="form-group floating-label"> 139 <div class="form-group floating-label">
140 <label for="lname" class="lname"> Insight Logo</label> 140 <label for="lname" class="lname"> Insight Logo</label>
141 <img v-if="caseStudy.caseStudyDetails.intro.logoURL" style="width:40px;height: 40px;" :src="caseStudy.caseStudyDetails.intro.logoURL"
142 />
141 <input 143 <input
142 @change="createImage('logo')" 144 @change="createImage('logo')"
143 type="file" 145 type="file"
144 name="photso" 146 name="photso"
145 id="logo" 147 id="logo"
146 accept="image/*" 148 accept="image/*"
147 /> 149 />
148 </div> 150 </div>
149 </div> 151 </div>
150 </div> 152 </div>
151 <!-- 2nd row --> 153 <!-- 2nd row -->
152 <!-- 3rd row --> 154 <!-- 3rd row -->
153 <div class="row"> 155 <div class="row">
154 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 156 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
155 <div class="form-group floating-label"> 157 <div class="form-group floating-label">
156 <label for="lname" class="lname"></label> 158 <label for="lname" class="lname"></label>
157 <ul class="interests"> 159 <ul class="interests">
158 <li> 160 <li>
159 <input 161 <input
160 class="" 162 class=""
161 placeholder="Add Focus Areas" 163 placeholder="Add Focus Areas"
162 v-model="focusName" 164 v-model="focusName"
163 /> 165 />
164 <a href="javascript:void(0);" @click="addInsight('focus')" 166 <a href="javascript:void(0);" @click="addInsight('focus')"
165 ><img src="../assets/images/plus-circle.svg" 167 ><img src="../assets/images/plus-circle.svg"
166 /></a> 168 /></a>
167 </li> 169 </li>
168 170
169 <li 171 <li
170 v-for="(interest, i) in caseStudy.caseStudyDetails.focusAreas" 172 v-for="(interest, i) in caseStudy.caseStudyDetails.focusAreas"
171 :key="i" 173 :key="i"
172 > 174 >
173 <span>{{ interest }}</span> 175 <span>{{ interest }}</span>
174 <a 176 <a
175 href="javascript:void(0);" 177 href="javascript:void(0);"
176 @click="removeInsight(i, 'focus')" 178 @click="removeInsight(i, 'focus')"
177 class="cat-minus" 179 class="cat-minus"
178 ><img src="../assets/images/minus.svg" 180 ><img src="../assets/images/minus.svg"
179 /></a> 181 /></a>
180 </li> 182 </li>
181 </ul> 183 </ul>
182 </div> 184 </div>
183 </div> 185 </div>
184 186
185 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 187 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
186 <div class="form-group floating-label"> 188 <div class="form-group floating-label">
187 <label for="lname" class="lname">Select Insight Tags</label> 189 <label for="lname" class="lname">Select Insight Tags</label>
188 <select 190 <select
189 class="form-control" 191 class="form-control"
190 v-model="insightName" 192 v-model="insightName"
191 @change="addInsight('insight')" 193 @change="addInsight('insight')"
192 > 194 >
193 <option value="null">Select Insight Tag</option> 195 <option value="null">Select Insight Tag</option>
194 <option value="Design">Design</option> 196 <option value="Design">Design</option>
195 <option value="Product">Product</option> 197 <option value="Product">Product</option>
196 <option value="Marketing">Marketing</option> 198 <option value="Marketing">Marketing</option>
197 <option value="Pricing">Pricing</option> 199 <option value="Pricing">Pricing</option>
198 <option value="Psychology">Psychology</option> 200 <option value="Psychology">Psychology</option>
199 </select> 201 </select>
200 </div> 202 </div>
201 </div> 203 </div>
202 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 204 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
203 <div class="form-group floating-label"> 205 <div class="form-group floating-label">
204 <label for="lname" class="lname"></label> 206 <label for="lname" class="lname"></label>
205 <ul class="interests"> 207 <ul class="interests">
206 <li 208 <li
207 v-for="(interest, i) in caseStudy.caseStudyDetails.insightTags" 209 v-for="(interest, i) in caseStudy.caseStudyDetails.insightTags"
208 :key="i" 210 :key="i"
209 > 211 >
210 <span>{{ interest }}</span> 212 <span>{{ interest }}</span>
211 <a 213 <a
212 href="javascript:void(0);" 214 href="javascript:void(0);"
213 @click="removeInsight(i, 'insight')" 215 @click="removeInsight(i, 'insight')"
214 class="cat-minus" 216 class="cat-minus"
215 ><img src="../assets/images/minus.svg" 217 ><img src="../assets/images/minus.svg"
216 /></a> 218 /></a>
217 </li> 219 </li>
218 </ul> 220 </ul>
219 </div> 221 </div>
220 </div> 222 </div>
221 </div> 223 </div>
222 <!-- 3rd row end --> 224 <!-- 3rd row end -->
223 225
224 <!-- outdor --> 226 <!-- outdor -->
225 <div class="row profile-tab-spc-top"> 227 <div class="row profile-tab-spc-top">
226 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 228 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
227 <ul class="navbar-nav mr-auto"> 229 <ul class="navbar-nav mr-auto">
228 <li class="nav-item active"> 230 <li class="nav-item active">
229 <h5 class="nav-link">Outro Screen Record</h5> 231 <h5 class="nav-link">Outro Screen Record</h5>
230 </li> 232 </li>
231 </ul> 233 </ul>
232 </div> 234 </div>
233 </div> 235 </div>
234 236
235 <!-- 1st row --> 237 <!-- 1st row -->
236 <div class="row"> 238 <div class="row">
237 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 239 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
238 <div class="form-group floating-label"> 240 <div class="form-group floating-label">
239 <label for="lname" class="lname">Designer Name</label> 241 <label for="lname" class="lname">Designer Name</label>
240 <input 242 <input
241 type="text" 243 type="text"
242 class="form-control" 244 class="form-control"
243 value="" 245 value=""
244 placeholder=" " 246 placeholder=" "
245 v-model="caseStudy.caseStudyDetails.outro.designer" 247 v-model="caseStudy.caseStudyDetails.outro.designer"
246 /> 248 />
247 </div> 249 </div>
248 </div> 250 </div>
249 251
250 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 252 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
251 <div class="form-group floating-label"> 253 <div class="form-group floating-label">
252 <label for="lname" class="lname">Illustrations Name</label> 254 <label for="lname" class="lname">Illustrations Name</label>
253 <input 255 <input
254 type="text" 256 type="text"
255 class="form-control" 257 class="form-control"
256 value="" 258 value=""
257 placeholder=" " 259 placeholder=" "
258 v-model="caseStudy.caseStudyDetails.outro.illustrations" 260 v-model="caseStudy.caseStudyDetails.outro.illustrations"
259 /> 261 />
260 </div> 262 </div>
261 </div> 263 </div>
262 264
263 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 265 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
264 <div class="form-group floating-label"> 266 <div class="form-group floating-label">
265 <label for="lname" class="lname"> Author Image</label> 267 <label for="lname" class="lname"> Author Image</label>
268 <img v-if="caseStudy.caseStudyDetails.outro.authorImage[0]" style="width:40px;height: 40px;" :src="caseStudy.caseStudyDetails.outro.authorImage[0]"
269 />
266 <input 270 <input
267 @change="createImage('outdor')" 271 @change="createImage('outdor')"
268 type="file" 272 type="file"
269 name="photos" 273 name="photos"
270 id="outdor" 274 id="outdor"
271 accept="image/*" 275 accept="image/*"
272 /> 276 />
273 </div> 277 </div>
274 </div> 278 </div>
275 </div> 279 </div>
276 <!-- 1st row --> 280 <!-- 1st row -->
277 <!-- outdoor ends --> 281 <!-- outdoor ends -->
278 282
279 <!-- outdor --> 283 <!-- outdor -->
280 <div class="row profile-tab-spc-top"> 284 <div class="row profile-tab-spc-top">
281 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 285 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
282 <ul class="navbar-nav mr-auto"> 286 <ul class="navbar-nav mr-auto">
283 <li class="nav-item active"> 287 <li class="nav-item active">
284 <h5 class="nav-link">Add SLides</h5> 288 <h5 class="nav-link">Add SLides</h5>
285 </li> 289 </li>
286 </ul> 290 </ul>
287 </div> 291 </div>
288 </div> 292 </div>
289 293
290 <!-- 1st row --> 294 <!-- 1st row -->
291 <div class="row"> 295 <div class="row">
292 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 296 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
293 <div class="form-group floating-label"> 297 <div class="form-group floating-label">
294 <label for="lname" class="lname">Slides Name</label> 298 <label for="lname" class="lname">Slides Name</label>
295 <select 299 <select
296 class="form-control" 300 class="form-control"
297 v-model="slideId" 301 v-model="slideId"
298 v-on:change="slideSelected(slideId)" 302 v-on:change="slideSelected(slideId)"
299 > 303 >
300 <option value="null">Select Slide</option> 304 <option value="null">Select Slide</option>
301 <option v-for="(template, i) in templateList" :key="i" :value="i"> 305 <option v-for="(template, i) in templateList" :key="i" :value="i">
302 {{ template._id }} 306 {{ template._id }}
303 </option> 307 </option>
304 </select> 308 </select>
305 </div> 309 </div>
306 </div> 310 </div>
307 </div> 311 </div>
308 <!-- 1st row --> 312 <!-- 1st row -->
309 313
310 <!-- case study slides--> 314 <!-- case study slides-->
311 <div 315 <div
312 class="row profile-tab-spc-top" 316 class="row profile-tab-spc-top"
313 v-for="(slide, i) in caseStudy.slides" 317 v-for="(slide, i) in caseStudy.slides"
314 :key="i" 318 :key="i"
315 > 319 >
316 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 320 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
317 <ul class="navbar-nav mr-auto"> 321 <ul class="navbar-nav mr-auto">
318 <li class="nav-item active"> 322 <li class="nav-item active">
319 <p class="nav-link"> 323 <p class="nav-link">
320 <b>Screen {{ i + 1 }}</b> 324 <b>Screen {{ i + 1 }}</b>
321 <a 325 <a
322 style="cursor: pointer; color: red; font-size: 0.8rem" 326 style="cursor: pointer; color: red; font-size: 0.8rem"
323 @click="removeSlide(i)" 327 @click="removeSlide(i)"
324 > 328 >
325 Remove</a 329 Remove</a
326 > 330 >
327 </p> 331 </p>
328 </li> 332 </li>
329 </ul> 333 </ul>
330 </div> 334 </div>
331 335
332 <div class="row"> 336 <div class="row">
333 <div 337 <div
334 class="col-sm-4 col-md-4 col-lg-4 col-xl-4" 338 class="col-sm-4 col-md-4 col-lg-4 col-xl-4"
335 v-for="(field, j) in slide.metaData.fields" 339 v-for="(field, j) in slide.metaData.fields"
336 :key="j" 340 :key="j"
337 > 341 >
338 <div 342 <div
339 class="form-group floating-label" 343 class="form-group floating-label"
340 v-if="field.fieldType == 'text'" 344 v-if="field.fieldType == 'text'"
341 > 345 >
342 <label for="lname" class="lname">{{ field.displayName }}</label> 346 <label for="lname" class="lname">{{ field.displayName }}</label>
343 <input 347 <input
344 type="text" 348 type="text"
345 class="form-control" 349 class="form-control"
346 value="" 350 value=""
347 placeholder=" " 351 placeholder=" "
348 v-model="field.fieldValue" 352 v-model="field.fieldValue"
349 /> 353 />
350 </div> 354 </div>
351 355
352 <div 356 <div
353 class="form-group floating-label" 357 class="form-group floating-label"
354 v-if="field.fieldType == 'image'" 358 v-if="field.fieldType == 'image'"
355 > 359 >
356 <label for="lname" class="lname"> {{ field.displayName }}</label> 360 <label for="lname" class="lname"> {{ field.displayName }}</label>
361 <img v-if="field.fieldValue" style="width:40px;height: 40px;" :src="field.fieldValue"
362 />
357 <input 363 <input
358 @change="fieldcreateImage(i, j)" 364 @change="fieldcreateImage(i, j)"
359 type="file" 365 type="file"
360 name="photo" 366 name="photo"
361 :id="i + '' + j" 367 :id="i + '' + j"
362 accept="image/*" 368 accept="image/*"
363 /> 369 />
364 </div> 370 </div>
365 </div> 371 </div>
366 </div> 372 </div>
367 373
368 <div class="row"> 374 <div class="row">
369 <div 375 <div
370 class="col-sm-4 col-md-4 col-lg-4 col-xl-4" 376 class="col-sm-4 col-md-4 col-lg-4 col-xl-4"
371 v-for="(cum, j) in slide.metaData.comments" 377 v-for="(cum, j) in slide.metaData.comments"
372 :key="j" 378 :key="j"
373 > 379 >
374 <div class="form-group floating-label"> 380 <div class="form-group floating-label">
375 <label for="lname" class="lname">Comment Box {{ j + 1 }}</label> 381 <label for="lname" class="lname">Comment Box {{ j + 1 }}</label>
376 <input 382 <input
377 type="text" 383 type="text"
378 class="form-control" 384 class="form-control"
379 value="" 385 value=""
380 placeholder=" " 386 placeholder=" "
381 v-model="cum.comment" 387 v-model="cum.comment"
382 /> 388 />
383 </div> 389 </div>
384 </div> 390 </div>
385 </div> 391 </div>
386 </div> 392 </div>
387 393
388 <!-- 1st row end --> 394 <!-- 1st row end -->
389 <!-- case study ends --> 395 <!-- case study ends -->
390 <div class="clearfix"></div> 396 <div class="clearfix"></div>
391 397
392 <!-- users land image --> 398 <!-- users land image -->
393 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> 399 <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
394 <div class="form-layout signup-frm-spc"> 400 <div class="form-layout signup-frm-spc">
395 <form> 401 <form>
396 <a 402 <a
397 href="javascript:void(0);" 403 href="javascript:void(0);"
398 class="btn btn-lg sb-button" 404 class="btn btn-lg sb-button"
399 type="submit" 405 type="submit"
400 @click="submit" 406 @click="submit"
401 > 407 >
402 <img src="../assets/images/key.svg" /> submit 408 <img src="../assets/images/key.svg" /> submit
403 </a> 409 </a>
404 </form> 410 </form>
405 </div> 411 </div>
406 </div> 412 </div>
407 413
408 <!-- data wrp --> 414 <!-- data wrp -->
409 <!-- body wrapper --> 415 <!-- body wrapper -->
410 </div> 416 </div>
411 </main> 417 </main>
412 </template> 418 </template>
413 419
414 <script> 420 <script>
415 import Vue from "vue"; 421 import Vue from "vue";
416 import router from "../router"; 422 import router from "../router";
417 import $ from "jquery"; 423 import $ from "jquery";
418 import axios from "axios"; 424 import axios from "axios";
419 425
420 export default { 426 export default {
421 name: "Profile", 427 name: "Profile",
422 428
423 data() { 429 data() {
424 return { 430 return {
425 loggedinFlag: false, 431 loggedinFlag: false,
426 caseId: null, 432 caseId: null,
427 editMode: false, 433 editMode: false,
428 userData: null, 434 userData: null,
429 usertoken: null, 435 usertoken: null,
430 insightName: null, 436 insightName: null,
431 focusName: null, 437 focusName: null,
432 slideId: null, 438 slideId: null,
433 userList: [], 439 userList: [],
434 templateList: [], 440 templateList: [],
435 caseStudy: { 441 caseStudy: {
436 caseStudyDetails: { 442 caseStudyDetails: {
437 userId: [], 443 userId: [],
438 intro: { 444 intro: {
439 name: null, 445 name: null,
440 logoURL: null, 446 logoURL: null,
441 app: null, 447 app: null,
442 type: null, 448 type: null,
443 focus: null, 449 focus: null,
444 readTime: null, 450 readTime: null,
445 platForm: null, 451 platForm: null,
446 authors: [], 452 authors: [],
447 }, 453 },
448 outro: { 454 outro: {
449 authorImage: [], 455 authorImage: [],
450 authors: [], 456 authors: [],
451 designer: null, 457 designer: null,
452 illustrations: null, 458 illustrations: null,
453 }, 459 },
454 insightTags: [], 460 insightTags: [],
455 focusAreas: [], 461 focusAreas: [],
456 }, 462 },
457 slides: [], 463 slides: [],
458 }, 464 },
459 }; 465 };
460 }, 466 },
461 mounted() { 467 mounted() {
462 if (this.$route.fullPath.split("?").length == 2) { 468 if (this.$route.fullPath.split("?").length == 2) {
463 this.editMode = true; 469 this.editMode = true;
464 this.caseId = this.$route.fullPath.split("?")[1]; 470 this.caseId = this.$route.fullPath.split("?")[1];
465 var introData = localStorage.getItem("spotlight_caseStudy" + this.caseId); 471 var introData = localStorage.getItem("spotlight_caseStudy" + this.caseId);
466 if (introData) { 472 if (introData) {
467 introData = JSON.parse(introData); 473 introData = JSON.parse(introData);
468 console.log("introData", introData); 474 console.log("introData", introData);
469 this.caseStudy.caseStudyDetails.intro = introData.intro; 475 this.caseStudy.caseStudyDetails.intro = introData.intro;
470 this.caseStudy.caseStudyDetails.userId = introData.userId; 476 this.caseStudy.caseStudyDetails.userId = introData.userId;
471 this.caseStudy.caseStudyDetails.outro = introData.outro; 477 this.caseStudy.caseStudyDetails.outro = introData.outro;
472 this.caseStudy.caseStudyDetails.insightTags = introData.insightTags; 478 this.caseStudy.caseStudyDetails.insightTags = introData.insightTags;
473 this.caseStudy.caseStudyDetails.focusAreas = introData.focusAreas; 479 this.caseStudy.caseStudyDetails.focusAreas = introData.focusAreas;
474 } 480 }
475 } 481 }
476 var userdata = localStorage.getItem("spotlight_usertoken"); 482 var userdata = localStorage.getItem("spotlight_usertoken");
477 if (userdata) { 483 if (userdata) {
478 userdata = JSON.parse(userdata); 484 userdata = JSON.parse(userdata);
479 this.usertoken = userdata.token; 485 this.usertoken = userdata.token;
480 this.getUserList(); 486 this.getUserList();
481 this.getTemplateList(); 487 this.getTemplateList();
482 } 488 }
483 }, 489 },
484 methods: { 490 methods: {
485 selectUser(i) { 491 selectUser(i) {
486 this.userList[i]; 492 this.userList[i];
487 this.caseStudy.caseStudyDetails.intro.authors.push(this.userList[i].name); 493 this.caseStudy.caseStudyDetails.intro.authors.push(this.userList[i].name);
488 this.caseStudy.caseStudyDetails.outro.authors.push(this.userList[i].name); 494 this.caseStudy.caseStudyDetails.outro.authors.push(this.userList[i].name);
489 this.caseStudy.caseStudyDetails.userId.push(this.userList[i]._id); 495 this.caseStudy.caseStudyDetails.userId.push(this.userList[i]._id);
490 console.log("-", this.caseStudy); 496 console.log("-", this.caseStudy);
491 }, 497 },
492 498
493 logout() { 499 logout() {
494 this.$router.push("/"); 500 this.$router.push("/");
495 }, 501 },
496 addInsight(type) { 502 addInsight(type) {
497 if (type == "focus") { 503 if (type == "focus") {
498 this.caseStudy.caseStudyDetails.focusAreas.push(this.focusName); 504 this.caseStudy.caseStudyDetails.focusAreas.push(this.focusName);
499 this.focusName = null; 505 this.focusName = null;
500 } else if (type == "insight") { 506 } else if (type == "insight") {
501 this.caseStudy.caseStudyDetails.insightTags.push(this.insightName); 507 this.caseStudy.caseStudyDetails.insightTags.push(this.insightName);
502 this.insightName = null; 508 this.insightName = null;
503 } 509 }
504 }, 510 },
505 removeInsight(i, type) { 511 removeInsight(i, type) {
506 if (type == "focus") { 512 if (type == "focus") {
507 this.caseStudy.caseStudyDetails.focusAreas.splice(i, 1); 513 this.caseStudy.caseStudyDetails.focusAreas.splice(i, 1);
508 } else if (type == "insight") { 514 } else if (type == "insight") {
509 this.caseStudy.caseStudyDetails.insightTags.splice(i, 1); 515 this.caseStudy.caseStudyDetails.insightTags.splice(i, 1);
510 } 516 }
511 }, 517 },
512 518
513 async slideSelected(i) { 519 async slideSelected(i) {
514 console.log("id is", this.templateList[i]); 520 console.log("id is", this.templateList[i]);
515 var slideMetadata = {}; 521 var slideMetadata = {};
516 // slideMetadata = await this.getMeatda(this.templateList[i]._id); 522 // slideMetadata = await this.getMeatda(this.templateList[i]._id);
517 this.slideId = null; 523 this.slideId = null;
518 // this.templateList[i].metaData = slideMetadata.metaData; 524 // this.templateList[i].metaData = slideMetadata.metaData;
519 this.caseStudy.slides.push(this.templateList[i]); 525 this.caseStudy.slides.push(this.templateList[i]);
520 console.log("this.caseStudy.slides", this.caseStudy.slides); 526 console.log("this.caseStudy.slides", this.caseStudy.slides);
521 }, 527 },
522 528
523 removeSlide(i) { 529 removeSlide(i) {
524 this.caseStudy.slides.splice(i, 1); 530 this.caseStudy.slides.splice(i, 1);
525 }, 531 },
526 532
527 createImage(type) { 533 createImage(type) {
528 var that = this; 534 var that = this;
529 console.log(document.getElementById(type)); 535 console.log(document.getElementById(type));
530 var file = document.getElementById(type).files[0]; 536 var file = document.getElementById(type).files[0];
531 console.log("file", file); 537 console.log("file", file);
532 var reader = new FileReader(); 538 var reader = new FileReader();
533 reader.onload = function (e) { 539 reader.onload = function (e) {
534 console.log("e.target.result ", e.target.result); 540 console.log("e.target.result ", e.target.result);
535 that.uploadImage(type, e.target.result); 541 that.uploadImage(type, e.target.result);
536 }; 542 };
537 reader.onerror = function (error) { 543 reader.onerror = function (error) {
538 alert(error); 544 alert(error);
539 }; 545 };
540 if (file) { 546 if (file) {
541 reader.readAsDataURL(file); 547 reader.readAsDataURL(file);
542 } 548 }
543 }, 549 },
544 uploadImage(type, base64) { 550 uploadImage(type, base64) {
545 console.log("type", type); 551 console.log("type", type);
546 var obj = { 552 var obj = {
547 image: base64, 553 image: base64,
548 }; 554 };
549 axios 555 axios
550 .post("/superAdmin/uploadImage", obj, { 556 .post("/superAdmin/uploadImage", obj, {
551 headers: { 557 headers: {
552 Authorization: "Bearer " + this.usertoken, 558 Authorization: "Bearer " + this.usertoken,
553 }, 559 },
554 }) 560 })
555 .then((response) => { 561 .then((response) => {
556 if (type == "logo") { 562 if (type == "logo") {
557 this.caseStudy.caseStudyDetails.intro.logoURL = response.data.data; 563
564 setTimeout(() => this.caseStudy.caseStudyDetails.intro.logoURL = response.data.data, 10);
558 } else if (type == "outdor") { 565 } else if (type == "outdor") {
559 this.caseStudy.caseStudyDetails.outro.authorImage = []; 566 this.caseStudy.caseStudyDetails.outro.authorImage = [];
560 this.caseStudy.caseStudyDetails.outro.authorImage.push( 567 setTimeout(() => this.caseStudy.caseStudyDetails.outro.authorImage.push(
561 response.data.data 568 response.data.data
562 ); 569 ), 10);
570
563 } 571 }
564 572
565 console.log(response.data.data); 573 console.log(response.data.data);
566 console.log(this.caseStudy); 574 console.log(this.caseStudy);
567 }) 575 })
568 .catch((error) => { 576 .catch((error) => {
569 if (error.response) { 577 if (error.response) {
570 this.$toaster.error(error.response.data.message); 578 this.$toaster.error(error.response.data.message);
571 } 579 }
572 }); 580 });
573 }, 581 },
574 582
575 fieldcreateImage(i, j) { 583 fieldcreateImage(i, j) {
576 console.log("i", i); 584 console.log("i", i);
577 console.log("j", j); 585 console.log("j", j);
578 var that = this; 586 var that = this;
579 var id = i + "" + j; 587 var id = i + "" + j;
580 console.log(document.getElementById(id)); 588 console.log(document.getElementById(id));
581 var file = document.getElementById(id).files[0]; 589 var file = document.getElementById(id).files[0];
582 // var file = document.querySelector("input[type=file]").files[0]; 590 // var file = document.querySelector("input[type=file]").files[0];
583 console.log("file", file); 591 console.log("file", file);
584 var reader = new FileReader(); 592 var reader = new FileReader();
585 reader.onload = function (e) { 593 reader.onload = function (e) {
586 // console.log("e.target.result ",e.target.result ) 594 // console.log("e.target.result ",e.target.result )
587 that.fielduploadImage(i, j, e.target.result); 595 that.fielduploadImage(i, j, e.target.result);
588 }; 596 };
589 reader.onerror = function (error) { 597 reader.onerror = function (error) {
590 alert(error); 598 alert(error);
591 }; 599 };
592 if (file) { 600 if (file) {
593 reader.readAsDataURL(file); 601 reader.readAsDataURL(file);
594 } 602 }
595 }, 603 },
596 fielduploadImage(i, j, base64) { 604 fielduploadImage(i, j, base64) {
597 var obj = { 605 var obj = {
598 image: base64, 606 image: base64,
599 }; 607 };
600 axios 608 axios
601 .post("/superAdmin/uploadImage", obj, { 609 .post("/superAdmin/uploadImage", obj, {
602 headers: { 610 headers: {
603 Authorization: "Bearer " + this.usertoken, 611 Authorization: "Bearer " + this.usertoken,
604 }, 612 },
605 }) 613 })
606 .then((response) => { 614 .then((response) => {
607 this.caseStudy.slides[i].metaData.fields[j].fieldValue = 615 setTimeout(() => this.caseStudy.slides[i].metaData.fields[j].fieldValue =
608 response.data.data; 616 response.data.data, 10);
617
618
609 console.log(response.data.data); 619 console.log(response.data.data);
610 console.log(this.caseStudy); 620 console.log(this.caseStudy);
611 }) 621 })
612 .catch((error) => { 622 .catch((error) => {
613 if (error.response) { 623 if (error.response) {
614 this.$toaster.error(error.response.data.message); 624 this.$toaster.error(error.response.data.message);
615 } 625 }
616 }); 626 });
617 }, 627 },
618 628
619 getUserList() { 629 getUserList() {
620 axios 630 axios
621 .get("/superAdmin/users", { 631 .get("/superAdmin/users", {
622 headers: { 632 headers: {
623 Authorization: "Bearer " + this.usertoken, 633 Authorization: "Bearer " + this.usertoken,
624 }, 634 },
625 }) 635 })
626 .then((response) => { 636 .then((response) => {
627 response.data.data.forEach((element) => { 637 response.data.data.forEach((element) => {
628 if (element.name) { 638 if (element.name) {
629 this.userList.push(element); 639 this.userList.push(element);
630 } 640 }
631 }); 641 });
632 console.log("response", this.userList); 642 console.log("response", this.userList);
633 }) 643 })
634 .catch((error) => console.log(error)); 644 .catch((error) => console.log(error));
635 }, 645 },
636 646
637 getTemplateList() { 647 getTemplateList() {
638 axios 648 axios
639 .get("/superAdmin/templates", { 649 .get("/superAdmin/templates", {
640 headers: { 650 headers: {
641 Authorization: "Bearer " + this.usertoken, 651 Authorization: "Bearer " + this.usertoken,
642 }, 652 },
643 }) 653 })
644 .then((response) => { 654 .then((response) => {
645 response.data.data.forEach((temp) => { 655 response.data.data.forEach((temp) => {
646 if ( 656 if (
647 temp._id != "INTRO_oqkdMOVDrwRptsdWJ6Ye" && 657 temp._id != "INTRO_oqkdMOVDrwRptsdWJ6Ye" &&
648 temp._id != "OUTRO_oqkdMOVDrwRptsdWJ6Ye" 658 temp._id != "OUTRO_oqkdMOVDrwRptsdWJ6Ye"
649 ) { 659 ) {
650 if (temp.bounceBoard) { 660 if (temp.bounceBoard) {
651 for (var i = 0; i < temp.commentBox; i++) { 661 for (var i = 0; i < temp.commentBox; i++) {
652 temp.metaData.comments.push({ 662 temp.metaData.comments.push({
653 userId: null, 663 userId: null,
654 slideId: null, 664 slideId: null,
655 caseStudyId: null, 665 caseStudyId: null,
656 comment: null, 666 comment: null,
657 }); 667 });
658 } 668 }
659 } 669 }
660 this.templateList.push(temp); 670 this.templateList.push(temp);
661 } 671 }
662 }); 672 });
663 if (this.editMode) { 673 if (this.editMode) {
664 this.getSLideData(); 674 this.getSLideData();
665 } 675 }
666 console.log("templates", this.templateList); 676 console.log("templates", this.templateList);
667 }) 677 })
668 .catch((error) => console.log(error)); 678 .catch((error) => console.log(error));
669 }, 679 },
670 680
671 getSLideData() { 681 getSLideData() {
672 axios 682 axios
673 .get("/superAdmin/caseStudySlides?caseStudyId=" + this.caseId, { 683 .get("/superAdmin/caseStudySlides?caseStudyId=" + this.caseId, {
674 headers: { 684 headers: {
675 Authorization: "Bearer " + this.usertoken, 685 Authorization: "Bearer " + this.usertoken,
676 }, 686 },
677 }) 687 })
678 .then((response) => { 688 .then((response) => {
679 var finalArray = []; 689 var finalArray = [];
680 response.data.data.forEach((template_) => { 690 response.data.data.forEach((template_) => {
681 var keys = []; 691 var keys = [];
682 var i = this.templateList.findIndex( 692 var i = this.templateList.findIndex(
683 (temp_) => temp_._id == template_.templateId 693 (temp_) => temp_._id == template_.templateId
684 ); 694 );
685 var obj = { 695 var obj = {
686 _id: this.templateList[i]._id, 696 _id: this.templateList[i]._id,
687 bounceBoard: this.templateList[i].bounceBoard, 697 bounceBoard: this.templateList[i].bounceBoard,
688 insight: this.templateList[i].insight, 698 insight: this.templateList[i].insight,
689 // commentBox: this.templateList[i].commentBox, 699 // commentBox: this.templateList[i].commentBox,
690 metaData: { 700 metaData: {
691 fields: [], 701 fields: [],
692 comments: [], 702 comments: [],
693 }, 703 },
694 }; 704 };
695 if (this.templateList[i].bounceBoard) { 705 if (this.templateList[i].bounceBoard) {
696 obj.commentBox = this.templateList[i].commentBox; 706 obj.commentBox = this.templateList[i].commentBox;
697 } 707 }
698 var fieldArray = []; 708 var fieldArray = [];
699 this.templateList[i].metaData.fields.forEach((element) => { 709 this.templateList[i].metaData.fields.forEach((element) => {
700 var fieldobj = { 710 var fieldobj = {
701 fieldName: element.fieldName, 711 fieldName: element.fieldName,
702 displayName: element.displayName, 712 displayName: element.displayName,
703 fieldValue: template_.metaData[element.fieldName], 713 fieldValue: template_.metaData[element.fieldName],
704 fieldType: element.fieldType, 714 fieldType: element.fieldType,
705 }; 715 };
706 obj.metaData.fields.push(fieldobj); 716 obj.metaData.fields.push(fieldobj);
707 }); 717 });
708 finalArray.push(obj); 718 finalArray.push(obj);
709 }); 719 });
710 this.caseStudy.slides = finalArray; 720 this.caseStudy.slides = finalArray;
711 console.log("----", finalArray); 721 console.log("----", finalArray);
712 console.log(this.templateList, "getSLideData==>"); 722 console.log(this.templateList, "getSLideData==>");
713 }) 723 })
714 .catch((error) => console.log(error)); 724 .catch((error) => console.log(error));
715 }, 725 },
716 726
717 submit() { 727 submit() {
718 const latest = Object.create(this.caseStudy); 728 const latest = Object.create(this.caseStudy);
719 729
720 var slidArray = []; 730 var slidArray = [];
721 latest.slides.forEach((slides) => { 731 latest.slides.forEach((slides) => {
722 console.log("slides", slides); 732 console.log("slides", slides);
723 var slideData = {}; 733 var slideData = {};
724 slideData.templateId = slides._id; 734 slideData.templateId = slides._id;
725 slideData.bounceBoard = slides.bounceBoard; 735 slideData.bounceBoard = slides.bounceBoard;
726 slideData.insight = slides.insight; 736 slideData.insight = slides.insight;
727 if (slides.metaData.comments && slides.metaData.comments.length > 0) { 737 if (slides.metaData.comments && slides.metaData.comments.length > 0) {
728 slideData.comments = slides.metaData.comments; 738 slideData.comments = slides.metaData.comments;
729 // this.getSLideData(); 739 // this.getSLideData();
730 } 740 }
731 // var comments = []; 741 // var comments = [];
732 // if (slides.bounceBoard) { 742 // if (slides.bounceBoard) {
733 // slides.metaData.comments.forEach((element) => { 743 // slides.metaData.comments.forEach((element) => {
734 // comments.push(element.comment); 744 // comments.push(element.comment);
735 // }); 745 // });
736 // slideData.comments = comments; 746 // slideData.comments = comments;
737 // } 747 // }
738 748
739 slides.metaData.fields.forEach((fields_) => { 749 slides.metaData.fields.forEach((fields_) => {
740 slideData[fields_.fieldName] = fields_.fieldValue; 750 slideData[fields_.fieldName] = fields_.fieldValue;
741 }); 751 });
742 slidArray.push(slideData); 752 slidArray.push(slideData);
743 // delete slides.metaData.fields; 753 // delete slides.metaData.fields;
744 }); 754 });
745 755
746 console.log("slideData", slidArray); 756 console.log("slideData", slidArray);
747 if (this.editMode) { 757 if (this.editMode) {
748 this.updateProfile(slidArray); 758 this.updateProfile(slidArray);
749 }else{ 759 }else{
750 this.saveProfile(slidArray); 760 this.saveProfile(slidArray);
751 } 761 }
752 }, 762 },
753 763
754 saveProfile(slides) { 764 saveProfile(slides) {
755 var obj = {}; 765 var obj = {};
756 obj.caseStudyDetails = this.caseStudy.caseStudyDetails; 766 obj.caseStudyDetails = this.caseStudy.caseStudyDetails;
757 obj.caseStudyDetails.intro.readTime = Math.round( 767 obj.caseStudyDetails.intro.readTime = Math.round(
758 slides.length / 3 768 slides.length / 3
759 ).toString(); 769 ).toString();
760 obj.slides = slides; 770 obj.slides = slides;
761 axios 771 axios
762 .post("/superAdmin/caseStudy", obj, { 772 .post("/superAdmin/caseStudy", obj, {
763 headers: { 773 headers: {
764 Authorization: "Bearer " + this.usertoken, 774 Authorization: "Bearer " + this.usertoken,
765 }, 775 },
766 }) 776 })
767 .then((response) => { 777 .then((response) => {
768 // this.userData = response.data.data; 778 // this.userData = response.data.data;
769 this.$toaster.success("Case Study Created"); 779 this.$toaster.success("Case Study Created");
770 780
771 console.log(response); 781 console.log(response);
772 }) 782 })
773 .catch((error) => { 783 .catch((error) => {
774 if (error.response) { 784 if (error.response) {
775 this.$toaster.error(error.response.data.message); 785 this.$toaster.error(error.response.data.message);
776 } 786 }
777 }); 787 });
778 }, 788 },
779 updateProfile(slides) { 789 updateProfile(slides) {
780 var obj = {}; 790 var obj = {};
781 obj.caseStudyId = this.caseId, 791 obj.caseStudyId = this.caseId,
782 obj.caseStudyDetails = this.caseStudy.caseStudyDetails; 792 obj.caseStudyDetails = this.caseStudy.caseStudyDetails;
783 obj.caseStudyDetails.intro.readTime = Math.round( 793 obj.caseStudyDetails.intro.readTime = Math.round(
784 slides.length / 3 794 slides.length / 3
785 ).toString(); 795 ).toString();
786 obj.slides = slides; 796 obj.slides = slides;
787 axios 797 axios
788 .put("/superAdmin/caseStudy", obj, { 798 .put("/superAdmin/caseStudy", obj, {
789 headers: { 799 headers: {
790 Authorization: "Bearer " + this.usertoken, 800 Authorization: "Bearer " + this.usertoken,
791 }, 801 },
792 }) 802 })
793 .then((response) => { 803 .then((response) => {
794 // this.userData = response.data.data; 804 // this.userData = response.data.data;
795 this.$toaster.success("Case Study Updated"); 805 this.$toaster.success("Case Study Updated");
796 this.$router.go(this.$router.currentRoute) 806 this.$router.go(this.$router.currentRoute)
797 807
798 808
799 console.log(response); 809 console.log(response);
800 }) 810 })
801 .catch((error) => { 811 .catch((error) => {
802 if (error.response) { 812 if (error.response) {
803 this.$toaster.error(error.response.data.message); 813 this.$toaster.error(error.response.data.message);
804 } 814 }
805 }); 815 });
806 }, 816 },
807 listPage(){ 817 listPage(){
808 this.$router.push("/casestudy"); 818 this.$router.push("/casestudy");
809 }, 819 },
810 820
811 async getMeatda(tempId) { 821 async getMeatda(tempId) {
812 var obj = [ 822 var obj = [
813 { 823 {
814 tempId: "T1_RoeMG8130Xko1DvhC3Ou", 824 tempId: "T1_RoeMG8130Xko1DvhC3Ou",
815 metaData: { 825 metaData: {
816 fields: [ 826 fields: [
817 { 827 {
818 fieldName: "authorImage", 828 fieldName: "authorImage",
819 displayName: "Author Image", 829 displayName: "Author Image",
820 fieldValue: null, 830 fieldValue: null,
821 fieldType: "image", 831 fieldType: "image",
822 }, 832 },
823 { 833 {
824 fieldName: "mobileImage", 834 fieldName: "mobileImage",
825 displayName: "Mobile Image", 835 displayName: "Mobile Image",
826 fieldValue: null, 836 fieldValue: null,
827 fieldType: "image", 837 fieldType: "image",
828 }, 838 },
829 { 839 {
830 fieldName: "textBox", 840 fieldName: "textBox",
831 displayName: "Text Box", 841 displayName: "Text Box",
832 fieldValue: null, 842 fieldValue: null,
833 fieldType: "text", 843 fieldType: "text",
834 }, 844 },
835 ], 845 ],
836 }, 846 },
837 }, 847 },
838 { 848 {
839 tempId: "T2_ROsUOEy3vxsRAiQ72XdI", 849 tempId: "T2_ROsUOEy3vxsRAiQ72XdI",
840 metaData: { 850 metaData: {
841 fields: [ 851 fields: [
842 { 852 {
843 fieldName: "authorImage", 853 fieldName: "authorImage",
844 displayName: "Author Image", 854 displayName: "Author Image",
845 fieldValue: null, 855 fieldValue: null,
846 fieldType: "image", 856 fieldType: "image",
847 }, 857 },
848 ], 858 ],
849 comments: [{ comment: null }, { comment: null }, { comment: null }], 859 comments: [{ comment: null }, { comment: null }, { comment: null }],
850 }, 860 },
851 }, 861 },
852 { 862 {
853 tempId: "T3_cqNIf7tuqL4jyON63dA7", 863 tempId: "T3_cqNIf7tuqL4jyON63dA7",
854 metaData: { 864 metaData: {
855 fields: [ 865 fields: [
856 { 866 {
857 fieldName: "authorImage", 867 fieldName: "authorImage",
858 displayName: "Author Image", 868 displayName: "Author Image",
859 fieldValue: null, 869 fieldValue: null,
860 fieldType: "image", 870 fieldType: "image",
861 }, 871 },
862 { 872 {
863 fieldName: "mobileImage", 873 fieldName: "mobileImage",
864 displayName: "Mobile Image", 874 displayName: "Mobile Image",
865 fieldValue: null, 875 fieldValue: null,
866 fieldType: "image", 876 fieldType: "image",
867 }, 877 },
868 ], 878 ],
869 comments: [ 879 comments: [
870 { comment: null }, 880 { comment: null },
871 { comment: null }, 881 { comment: null },
872 { comment: null }, 882 { comment: null },
873 { comment: null }, 883 { comment: null },
874 ], 884 ],
875 }, 885 },
876 }, 886 },
877 ]; 887 ];
878 var i = obj.findIndex((obj_) => obj_.tempId == tempId); 888 var i = obj.findIndex((obj_) => obj_.tempId == tempId);
879 return obj[i]; 889 return obj[i];
880 }, 890 },
881 }, 891 },
882 }; 892 };
883 </script> 893 </script>
884 894