Commit 522f093f06f304ec486b5d482f51a471b159e001
1 parent
7f7014a84d
Exists in
admin
outro module added
Showing
3 changed files
with
115 additions
and
7 deletions
Show diff stats
config/index.js
1 | 'use strict' | 1 | 'use strict' |
2 | // Template version: 1.3.1 | 2 | // Template version: 1.3.1 |
3 | // see http://vuejs-templates.github.io/webpack for documentation. | 3 | // see http://vuejs-templates.github.io/webpack for documentation. |
4 | 4 | ||
5 | const path = require('path') | 5 | const path = require('path') |
6 | 6 | ||
7 | module.exports = { | 7 | module.exports = { |
8 | dev: { | 8 | dev: { |
9 | 9 | ||
10 | // Paths | 10 | // Paths |
11 | assetsSubDirectory: 'static', | 11 | assetsSubDirectory: 'static', |
12 | assetsPublicPath: '/', | 12 | assetsPublicPath: '/', |
13 | proxyTable: {}, | 13 | proxyTable: {}, |
14 | 14 | ||
15 | // Various Dev Server settings | 15 | // Various Dev Server settings |
16 | host: 'localhost', // can be overwritten by process.env.HOST | 16 | host: 'localhost', // can be overwritten by process.env.HOST |
17 | port: 1500, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined | 17 | port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined |
18 | autoOpenBrowser: false, | 18 | autoOpenBrowser: false, |
19 | errorOverlay: true, | 19 | errorOverlay: true, |
20 | notifyOnErrors: true, | 20 | notifyOnErrors: true, |
21 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- | 21 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- |
22 | 22 | ||
23 | // Use Eslint Loader? | 23 | // Use Eslint Loader? |
24 | // If true, your code will be linted during bundling and | 24 | // If true, your code will be linted during bundling and |
25 | // linting errors and warnings will be shown in the console. | 25 | // linting errors and warnings will be shown in the console. |
26 | useEslint: false, | 26 | useEslint: false, |
27 | // If true, eslint errors and warnings will also be shown in the error overlay | 27 | // If true, eslint errors and warnings will also be shown in the error overlay |
28 | // in the browser. | 28 | // in the browser. |
29 | showEslintErrorsInOverlay: false, | 29 | showEslintErrorsInOverlay: false, |
30 | 30 | ||
31 | /** | 31 | /** |
32 | * Source Maps | 32 | * Source Maps |
33 | */ | 33 | */ |
34 | 34 | ||
35 | // https://webpack.js.org/configuration/devtool/#development | 35 | // https://webpack.js.org/configuration/devtool/#development |
36 | devtool: 'cheap-module-eval-source-map', | 36 | devtool: 'cheap-module-eval-source-map', |
37 | 37 | ||
38 | // If you have problems debugging vue-files in devtools, | 38 | // If you have problems debugging vue-files in devtools, |
39 | // set this to false - it *may* help | 39 | // set this to false - it *may* help |
40 | // https://vue-loader.vuejs.org/en/options.html#cachebusting | 40 | // https://vue-loader.vuejs.org/en/options.html#cachebusting |
41 | cacheBusting: true, | 41 | cacheBusting: true, |
42 | 42 | ||
43 | cssSourceMap: true | 43 | cssSourceMap: true |
44 | }, | 44 | }, |
45 | 45 | ||
46 | build: { | 46 | build: { |
47 | // Template for index.html | 47 | // Template for index.html |
48 | index: path.resolve(__dirname, '../dist/index.html'), | 48 | index: path.resolve(__dirname, '../dist/index.html'), |
49 | 49 | ||
50 | // Paths | 50 | // Paths |
51 | assetsRoot: path.resolve(__dirname, '../dist'), | 51 | assetsRoot: path.resolve(__dirname, '../dist'), |
52 | assetsSubDirectory: 'static', | 52 | assetsSubDirectory: 'static', |
53 | assetsPublicPath: '/', | 53 | assetsPublicPath: '/', |
54 | 54 | ||
55 | /** | 55 | /** |
56 | * Source Maps | 56 | * Source Maps |
57 | */ | 57 | */ |
58 | 58 | ||
59 | productionSourceMap: true, | 59 | productionSourceMap: true, |
60 | // https://webpack.js.org/configuration/devtool/#production | 60 | // https://webpack.js.org/configuration/devtool/#production |
61 | devtool: '#source-map', | 61 | devtool: '#source-map', |
62 | 62 | ||
63 | // Gzip off by default as many popular static hosts such as | 63 | // Gzip off by default as many popular static hosts such as |
64 | // Surge or Netlify already gzip all static assets for you. | 64 | // Surge or Netlify already gzip all static assets for you. |
65 | // Before setting to `true`, make sure to: | 65 | // Before setting to `true`, make sure to: |
66 | // npm install --save-dev compression-webpack-plugin | 66 | // npm install --save-dev compression-webpack-plugin |
67 | productionGzip: false, | 67 | productionGzip: false, |
68 | productionGzipExtensions: ['js', 'css'], | 68 | productionGzipExtensions: ['js', 'css'], |
69 | 69 | ||
70 | // Run the build command with an extra argument to | 70 | // Run the build command with an extra argument to |
71 | // View the bundle analyzer report after build finishes: | 71 | // View the bundle analyzer report after build finishes: |
72 | // `npm run build --report` | 72 | // `npm run build --report` |
73 | // Set to `true` or `false` to always turn it on or off | 73 | // Set to `true` or `false` to always turn it on or off |
74 | bundleAnalyzerReport: process.env.npm_config_report | 74 | bundleAnalyzerReport: process.env.npm_config_report |
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 |
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 | |||
116 | <div class="row"> | ||
117 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | ||
118 | <div class="form-group floating-label"> | ||
119 | <label for="lname" class="lname">Select Intro Screen</label> | ||
120 | <select | ||
121 | class="form-control" | ||
122 | v-model="caseStudy.caseStudyDetails.intro.templateId" | ||
123 | @change="changeIntroScreen()" | ||
124 | > | ||
125 | <option value="intro-1">Intro Screen 1</option> | ||
126 | <option value="intro-2">Intro Screen 2</option> | ||
127 | </select> | ||
128 | </div> | ||
129 | </div> | ||
130 | </div> | ||
115 | <!-- 1st row --> | 131 | <!-- 1st row --> |
116 | <div class="row"> | 132 | <div class="row"> |
117 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 133 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
118 | <div class="form-group floating-label"> | 134 | <div class="form-group floating-label"> |
119 | <label for="lname" class="lname">Case Study Name</label> | 135 | <label for="lname" class="lname">Case Study Name</label> |
120 | <input | 136 | <input |
121 | type="text" | 137 | type="text" |
122 | class="form-control" | 138 | class="form-control" |
123 | value="" | 139 | value="" |
124 | placeholder=" " | 140 | placeholder=" " |
125 | v-model="caseStudy.caseStudyDetails.intro.name" | 141 | v-model="caseStudy.caseStudyDetails.intro.name" |
126 | /> | 142 | /> |
127 | </div> | 143 | </div> |
128 | </div> | 144 | </div> |
129 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 145 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
130 | <div class="form-group floating-label"> | 146 | <div class="form-group floating-label"> |
131 | <label for="lname" class="lname">App Name</label> | 147 | <label for="lname" class="lname">App Name</label> |
132 | <input | 148 | <input |
133 | type="text" | 149 | type="text" |
134 | class="form-control" | 150 | class="form-control" |
135 | value="" | 151 | value="" |
136 | placeholder=" " | 152 | placeholder=" " |
137 | v-model="caseStudy.caseStudyDetails.intro.app" | 153 | v-model="caseStudy.caseStudyDetails.intro.app" |
138 | /> | 154 | /> |
139 | </div> | 155 | </div> |
140 | </div> | 156 | </div> |
141 | <!-- <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 157 | <!-- <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
142 | <div class="form-group floating-label"> | 158 | <div class="form-group floating-label"> |
143 | <label for="lname" class="lname">Focus</label> | 159 | <label for="lname" class="lname">Focus</label> |
144 | <input | 160 | <input |
145 | type="text" | 161 | type="text" |
146 | class="form-control" | 162 | class="form-control" |
147 | value="" | 163 | value="" |
148 | placeholder=" " | 164 | placeholder=" " |
149 | v-model="caseStudy.caseStudyDetails.intro.focus" | 165 | v-model="caseStudy.caseStudyDetails.intro.focus" |
150 | /> | 166 | /> |
151 | </div> | 167 | </div> |
152 | </div> --> | 168 | </div> --> |
153 | 169 | ||
154 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 170 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
155 | <div class="form-group floating-label"> | 171 | <div class="form-group floating-label"> |
156 | <label for="lname" class="lname"> App logo</label> | 172 | <label for="lname" class="lname"> App logo</label> |
157 | <img | 173 | <img |
158 | v-if="caseStudy.caseStudyDetails.intro.logoURL" | 174 | v-if="caseStudy.caseStudyDetails.intro.logoURL" |
159 | style="width: 40px; height: 40px" | 175 | style="width: 40px; height: 40px" |
160 | :src="caseStudy.caseStudyDetails.intro.logoURL" | 176 | :src="caseStudy.caseStudyDetails.intro.logoURL" |
161 | /> | 177 | /> |
162 | <input | 178 | <input |
163 | @change="createImage('logo')" | 179 | @change="createImage('logo')" |
164 | type="file" | 180 | type="file" |
165 | name="photso" | 181 | name="photso" |
166 | id="logo" | 182 | id="logo" |
167 | accept="image/*" | 183 | accept="image/*" |
168 | /> | 184 | /> |
169 | </div> | 185 | </div> |
170 | </div> | 186 | </div> |
171 | </div> | 187 | </div> |
172 | <!-- 1st row end --> | 188 | <!-- 1st row end --> |
173 | 189 | ||
174 | <!-- 2nd row --> | 190 | <!-- 2nd row --> |
175 | <div class="row"> | 191 | <div class="row"> |
176 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 192 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
177 | <div class="form-group floating-label"> | 193 | <div class="form-group floating-label"> |
178 | <label for="lname" class="lname">Case Study Type</label> | 194 | <label for="lname" class="lname">Case Study Type</label> |
179 | <select | 195 | <select |
180 | class="form-control" | 196 | class="form-control" |
181 | v-model="caseStudy.caseStudyDetails.intro.type" | 197 | v-model="caseStudy.caseStudyDetails.intro.type" |
182 | > | 198 | > |
183 | <option value="null">Select Case Type</option> | 199 | <option value="null">Select Case Type</option> |
184 | <option value="Retake">Retake</option> | 200 | <option value="Retake">Retake</option> |
185 | <option value="Behind-the-scenes">Behind-the-scenes</option> | 201 | <option value="Behind-the-scenes">Behind-the-scenes</option> |
186 | <option value="Critique">Critique</option> | 202 | <option value="Critique">Critique</option> |
187 | <option value="Juxtapose">Juxtapose</option> | 203 | <option value="Juxtapose">Juxtapose</option> |
188 | </select> | 204 | </select> |
189 | </div> | 205 | </div> |
190 | </div> | 206 | </div> |
191 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 207 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
192 | <div class="form-group floating-label"> | 208 | <div class="form-group floating-label"> |
193 | <label for="lname" class="lname">Platform</label> | 209 | <label for="lname" class="lname">Platform</label> |
194 | <!-- <input | 210 | <!-- <input |
195 | type="text" | 211 | type="text" |
196 | class="form-control" | 212 | class="form-control" |
197 | value="" | 213 | value="" |
198 | placeholder=" " | 214 | placeholder=" " |
199 | v-model="caseStudy.caseStudyDetails.intro.platForm" | 215 | v-model="caseStudy.caseStudyDetails.intro.platForm" |
200 | /> --> | 216 | /> --> |
201 | <select | 217 | <select |
202 | class="form-control" | 218 | class="form-control" |
203 | v-model="selectPlatform" | 219 | v-model="selectPlatform" |
204 | @change="addInsight('platform')" | 220 | @change="addInsight('platform')" |
205 | > | 221 | > |
206 | <option value="null">Select Insight Tag</option> | 222 | <option value="null">Select Insight Tag</option> |
207 | <option value="Ios">Ios</option> | 223 | <option value="Ios">Ios</option> |
208 | <option value="Web">Web</option> | 224 | <option value="Web">Web</option> |
209 | <option value="Android">Android</option> | 225 | <option value="Android">Android</option> |
210 | </select> | 226 | </select> |
211 | </div> | 227 | </div> |
212 | </div> | 228 | </div> |
213 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 229 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
214 | <div class="form-group floating-label"> | 230 | <div class="form-group floating-label"> |
215 | <label for="lname" class="lname"></label> | 231 | <label for="lname" class="lname"></label> |
216 | <label for="lname" class="lname"></label> | 232 | <label for="lname" class="lname"></label> |
217 | <ul class="interests"> | 233 | <ul class="interests"> |
218 | <!-- v-for="(interest, i) in caseStudy.caseStudyDetails | 234 | <!-- v-for="(interest, i) in caseStudy.caseStudyDetails |
219 | .insightTags" | 235 | .insightTags" |
220 | :key="i" --> | 236 | :key="i" --> |
221 | 237 | ||
222 | <li v-if="caseStudy.caseStudyDetails.intro.platForm"> | 238 | <li v-if="caseStudy.caseStudyDetails.intro.platForm"> |
223 | <span>{{ caseStudy.caseStudyDetails.intro.platForm }}</span> | 239 | <span>{{ caseStudy.caseStudyDetails.intro.platForm }}</span> |
224 | <a | 240 | <a |
225 | href="javascript:void(0);" | 241 | href="javascript:void(0);" |
226 | @click="removeInsight(0, 'platform')" | 242 | @click="removeInsight(0, 'platform')" |
227 | class="cat-minus" | 243 | class="cat-minus" |
228 | ><img src="../assets/images/minus.svg" | 244 | ><img src="../assets/images/minus.svg" |
229 | /></a> | 245 | /></a> |
230 | </li> | 246 | </li> |
231 | </ul> | 247 | </ul> |
232 | </div> | 248 | </div> |
233 | </div> | 249 | </div> |
234 | </div> | 250 | </div> |
235 | <!-- 2nd row --> | 251 | <!-- 2nd row --> |
236 | <!-- 3rd row -->` | 252 | <!-- 3rd row -->` |
237 | <div class="row"> | 253 | <div class="row"> |
238 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 254 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
239 | <div class="form-group floating-label"> | 255 | <div class="form-group floating-label"> |
240 | <label for="lname" class="lname"></label> | 256 | <label for="lname" class="lname"></label> |
241 | <ul class="interests"> | 257 | <ul class="interests"> |
242 | <li> | 258 | <li> |
243 | <input | 259 | <input |
244 | class="" | 260 | class="" |
245 | placeholder="Add Focus Areas" | 261 | placeholder="Add Focus Areas" |
246 | v-model="focusName" | 262 | v-model="focusName" |
247 | v-on:keyup.enter="addInsight('focus')" | 263 | v-on:keyup.enter="addInsight('focus')" |
248 | /> | 264 | /> |
249 | <a href="javascript:void(0);" @click="addInsight('focus')" | 265 | <a href="javascript:void(0);" @click="addInsight('focus')" |
250 | ><img src="../assets/images/plus-circle.svg" | 266 | ><img src="../assets/images/plus-circle.svg" |
251 | /></a> | 267 | /></a> |
252 | </li> | 268 | </li> |
253 | 269 | ||
254 | <li | 270 | <li |
255 | v-for="(interest, i) in caseStudy.caseStudyDetails.focusAreas" | 271 | v-for="(interest, i) in caseStudy.caseStudyDetails.focusAreas" |
256 | :key="i" | 272 | :key="i" |
257 | > | 273 | > |
258 | <span>{{ interest }}</span> | 274 | <span>{{ interest }}</span> |
259 | <a | 275 | <a |
260 | href="javascript:void(0);" | 276 | href="javascript:void(0);" |
261 | @click="removeInsight(i, 'focus')" | 277 | @click="removeInsight(i, 'focus')" |
262 | class="cat-minus" | 278 | class="cat-minus" |
263 | ><img src="../assets/images/minus.svg" | 279 | ><img src="../assets/images/minus.svg" |
264 | /></a> | 280 | /></a> |
265 | </li> | 281 | </li> |
266 | </ul> | 282 | </ul> |
267 | </div> | 283 | </div> |
268 | </div> | 284 | </div> |
269 | 285 | ||
270 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 286 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
271 | <div class="form-group floating-label"> | 287 | <div class="form-group floating-label"> |
272 | <label for="lname" class="lname">Select Insight Tags</label> | 288 | <label for="lname" class="lname">Select Insight Tags</label> |
273 | <select | 289 | <select |
274 | class="form-control" | 290 | class="form-control" |
275 | v-model="insightName" | 291 | v-model="insightName" |
276 | @change="addInsight('insight')" | 292 | @change="addInsight('insight')" |
277 | > | 293 | > |
278 | <option value="null">Select Insight Tag</option> | 294 | <option value="null">Select Insight Tag</option> |
279 | <option value="Design">Design</option> | 295 | <option value="Design">Design</option> |
280 | <option value="Product">Product</option> | 296 | <option value="Product">Product</option> |
281 | <option value="Marketing">Marketing</option> | 297 | <option value="Marketing">Marketing</option> |
282 | <option value="Pricing">Pricing</option> | 298 | <option value="Pricing">Pricing</option> |
283 | <option value="Psychology">Psychology</option> | 299 | <option value="Psychology">Psychology</option> |
284 | </select> | 300 | </select> |
285 | </div> | 301 | </div> |
286 | </div> | 302 | </div> |
287 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 303 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
288 | <div class="form-group floating-label"> | 304 | <div class="form-group floating-label"> |
289 | <label for="lname" class="lname"></label> | 305 | <label for="lname" class="lname"></label> |
290 | <ul class="interests"> | 306 | <ul class="interests"> |
291 | <li | 307 | <li |
292 | v-for="(interest, i) in caseStudy.caseStudyDetails.insightTags" | 308 | v-for="(interest, i) in caseStudy.caseStudyDetails.insightTags" |
293 | :key="i" | 309 | :key="i" |
294 | > | 310 | > |
295 | <span>{{ interest }}</span> | 311 | <span>{{ interest }}</span> |
296 | <a | 312 | <a |
297 | href="javascript:void(0);" | 313 | href="javascript:void(0);" |
298 | @click="removeInsight(i, 'insight')" | 314 | @click="removeInsight(i, 'insight')" |
299 | class="cat-minus" | 315 | class="cat-minus" |
300 | ><img src="../assets/images/minus.svg" | 316 | ><img src="../assets/images/minus.svg" |
301 | /></a> | 317 | /></a> |
302 | </li> | 318 | </li> |
303 | </ul> | 319 | </ul> |
304 | </div> | 320 | </div> |
305 | </div> | 321 | </div> |
306 | </div> | 322 | </div> |
307 | <!-- 3rd row end --> | 323 | <!-- 3rd row end --> |
308 | 324 | ||
309 | <!-- outdor --> | 325 | <!-- outdor --> |
310 | <div class="row profile-tab-spc-top"> | 326 | <div class="row profile-tab-spc-top"> |
311 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 327 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
312 | <ul class="navbar-nav mr-auto"> | 328 | <ul class="navbar-nav mr-auto"> |
313 | <li class="nav-item active"> | 329 | <li class="nav-item active"> |
314 | <h5 class="nav-link">Outro Screen Record</h5> | 330 | <h5 class="nav-link">Outro Screen Record</h5> |
315 | </li> | 331 | </li> |
316 | </ul> | 332 | </ul> |
317 | </div> | 333 | </div> |
318 | </div> | 334 | </div> |
319 | 335 | ||
336 | <div class="row"> | ||
337 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | ||
338 | <div class="form-group floating-label"> | ||
339 | <label for="lname" class="lname">Select Outro Screen</label> | ||
340 | <select | ||
341 | class="form-control" | ||
342 | v-model="caseStudy.caseStudyDetails.outro.templateId" | ||
343 | |||
344 | > | ||
345 | <option value="outro-1">Outro Screen 1</option> | ||
346 | <option value="outro-2">Outro Screen 2</option> | ||
347 | </select> | ||
348 | </div> | ||
349 | </div> | ||
350 | </div> | ||
351 | |||
320 | <!-- 1st row --> | 352 | <!-- 1st row --> |
321 | <div class="row"> | 353 | <div class="row"> |
322 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 354 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
323 | <div class="form-group floating-label"> | 355 | <div class="form-group floating-label"> |
324 | <label for="lname" class="lname">Designer Name</label> | 356 | <label for="lname" class="lname">Designer Name</label> |
325 | <input | 357 | <input |
326 | type="text" | 358 | type="text" |
327 | class="form-control" | 359 | class="form-control" |
328 | value="" | 360 | value="" |
329 | placeholder=" " | 361 | placeholder=" " |
330 | v-model="caseStudy.caseStudyDetails.outro.designer" | 362 | v-model="caseStudy.caseStudyDetails.outro.designer" |
331 | /> | 363 | /> |
332 | </div> | 364 | </div> |
333 | </div> | 365 | </div> |
334 | 366 | ||
335 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 367 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
336 | <div class="form-group floating-label"> | 368 | <div class="form-group floating-label"> |
337 | <label for="lname" class="lname">Illustrations Name</label> | 369 | <label for="lname" class="lname">Illustrations Name</label> |
338 | <input | 370 | <input |
339 | type="text" | 371 | type="text" |
340 | class="form-control" | 372 | class="form-control" |
341 | value="" | 373 | value="" |
342 | placeholder=" " | 374 | placeholder=" " |
343 | v-model="caseStudy.caseStudyDetails.outro.illustrations" | 375 | v-model="caseStudy.caseStudyDetails.outro.illustrations" |
344 | /> | 376 | /> |
345 | </div> | 377 | </div> |
346 | </div> | 378 | </div> |
347 | 379 | ||
348 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 380 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
349 | <div class="form-group floating-label"> | 381 | <div class="form-group floating-label"> |
350 | <label for="lname" class="lname"> Author Image</label> | 382 | <label for="lname" class="lname"> Author Image</label> |
351 | <img | 383 | <img |
352 | v-if="caseStudy.caseStudyDetails.outro.authorImage[0]" | 384 | v-if="caseStudy.caseStudyDetails.outro.authorImage[0]" |
353 | style="width: 40px; height: 40px" | 385 | style="width: 40px; height: 40px" |
354 | :src="caseStudy.caseStudyDetails.outro.authorImage[0]" | 386 | :src="caseStudy.caseStudyDetails.outro.authorImage[0]" |
355 | /> | 387 | /> |
356 | <input | 388 | <input |
357 | @change="createImage('outdor')" | 389 | @change="createImage('outdor')" |
358 | type="file" | 390 | type="file" |
359 | name="photos" | 391 | name="photos" |
360 | id="outdor" | 392 | id="outdor" |
361 | accept="image/*" | 393 | accept="image/*" |
362 | /> | 394 | /> |
363 | </div> | 395 | </div> |
364 | </div> | 396 | </div> |
365 | </div> | 397 | </div> |
366 | <!-- 1st row --> | 398 | <!-- 1st row --> |
367 | <!-- outdoor ends --> | 399 | <!-- outdoor ends --> |
368 | 400 | ||
369 | <!-- outdor --> | 401 | <!-- outdor --> |
370 | <div class="row profile-tab-spc-top"> | 402 | <div class="row profile-tab-spc-top"> |
371 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 403 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
372 | <ul class="navbar-nav mr-auto"> | 404 | <ul class="navbar-nav mr-auto"> |
373 | <li class="nav-item active"> | 405 | <li class="nav-item active"> |
374 | <h5 class="nav-link">Add SLides</h5> | 406 | <h5 class="nav-link">Add SLides</h5> |
375 | </li> | 407 | </li> |
376 | </ul> | 408 | </ul> |
377 | </div> | 409 | </div> |
378 | </div> | 410 | </div> |
379 | 411 | ||
380 | <!-- case study slides--> | 412 | <!-- case study slides--> |
381 | <div | 413 | <div |
382 | class="row profile-tab-spc-top" | 414 | class="row profile-tab-spc-top" |
383 | v-for="(slide, i) in caseStudy.slides" | 415 | v-for="(slide, i) in caseStudy.slides" |
384 | :key="i" | 416 | :key="i" |
385 | > | 417 | > |
386 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 418 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
387 | <ul class="navbar-nav mr-auto"> | 419 | <ul class="navbar-nav mr-auto"> |
388 | <li class="nav-item active"> | 420 | <li class="nav-item active"> |
389 | <p class="nav-link"> | 421 | <p class="nav-link"> |
390 | <b>Screen {{ i + 1 }}</b> | 422 | <b>Screen {{ i + 1 }}</b> |
391 | <a | 423 | <a |
392 | style="cursor: pointer; color: red; font-size: 0.8rem" | 424 | style="cursor: pointer; color: red; font-size: 0.8rem" |
393 | @click="removeSlide(i)" | 425 | @click="removeSlide(i)" |
394 | > | 426 | > |
395 | Remove</a | 427 | Remove</a |
396 | > | 428 | > |
397 | <a | 429 | <a |
398 | style="cursor: pointer; color: blue; font-size: 0.8rem" | 430 | style="cursor: pointer; color: blue; font-size: 0.8rem" |
399 | @click="addProfileDialog(slide)" | 431 | @click="addProfileDialog(slide)" |
400 | > | 432 | > |
401 | View</a | 433 | View</a |
402 | > | 434 | > |
403 | </p> | 435 | </p> |
404 | </li> | 436 | </li> |
405 | <li class="nav-item active" v-if="slide.insight"> | 437 | <li class="nav-item active" v-if="slide.insight"> |
406 | <div class="form-group floating-label"> | 438 | <div class="form-group floating-label"> |
407 | <label for="lname" class="lname">Insight</label> | 439 | <label for="lname" class="lname">Insight</label> |
408 | <select | 440 | <select |
409 | class="form-control" | 441 | class="form-control" |
410 | v-model="insightId" | 442 | v-model="insightId" |
411 | v-on:change="insightSelected(slide)" | 443 | v-on:change="insightSelected(slide)" |
412 | > | 444 | > |
413 | <option value="null">Select Insight</option> | 445 | <option value="null">Select Insight</option> |
414 | <option | 446 | <option |
415 | v-for="(insight, i) in insightList" | 447 | v-for="(insight, i) in insightList" |
416 | :key="i" | 448 | :key="i" |
417 | :value="insight._id" | 449 | :value="insight._id" |
418 | > | 450 | > |
419 | {{ insight.title }} | 451 | {{ insight.title }} |
420 | </option> | 452 | </option> |
421 | </select> | 453 | </select> |
422 | </div> | 454 | </div> |
423 | </li> | 455 | </li> |
424 | </ul> | 456 | </ul> |
425 | </div> | 457 | </div> |
426 | 458 | ||
427 | <div class="row"> | 459 | <div class="row"> |
428 | <div | 460 | <div |
429 | class="col-sm-4 col-md-4 col-lg-4 col-xl-4" | 461 | class="col-sm-4 col-md-4 col-lg-4 col-xl-4" |
430 | v-for="(field, j) in slide.metaData.fields" | 462 | v-for="(field, j) in slide.metaData.fields" |
431 | :key="j" | 463 | :key="j" |
432 | > | 464 | > |
433 | <div | 465 | <div |
434 | class="form-group floating-label" | 466 | class="form-group floating-label" |
435 | v-if="field.fieldType == 'text'" | 467 | v-if="field.fieldType == 'text'" |
436 | > | 468 | > |
437 | <label for="lname" class="lname">{{ field.displayName }}</label> | 469 | <label for="lname" class="lname">{{ field.displayName }}</label> |
438 | <input | 470 | <input |
439 | type="text" | 471 | type="text" |
440 | class="form-control" | 472 | class="form-control" |
441 | value="" | 473 | value="" |
442 | placeholder=" " | 474 | placeholder=" " |
443 | v-model="field.fieldValue" | 475 | v-model="field.fieldValue" |
444 | /> | 476 | /> |
445 | </div> | 477 | </div> |
446 | <div | 478 | <div |
447 | class="form-group floating-label" | 479 | class="form-group floating-label" |
448 | v-if="field.fieldType == 'Number'" | 480 | v-if="field.fieldType == 'Number'" |
449 | > | 481 | > |
450 | <label for="lname" class="lname">{{ field.displayName }}</label> | 482 | <label for="lname" class="lname">{{ field.displayName }}</label> |
451 | <input | 483 | <input |
452 | type="text" | 484 | type="text" |
453 | class="form-control" | 485 | class="form-control" |
454 | value="" | 486 | value="" |
455 | placeholder=" " | 487 | placeholder=" " |
456 | v-model="field.fieldValue" | 488 | v-model="field.fieldValue" |
457 | /> | 489 | /> |
458 | </div> | 490 | </div> |
459 | 491 | ||
460 | <div | 492 | <div |
461 | class="form-group floating-label" | 493 | class="form-group floating-label" |
462 | v-if="field.fieldType == 'image'" | 494 | v-if="field.fieldType == 'image'" |
463 | > | 495 | > |
464 | <label for="lname" class="lname"> {{ field.displayName }}</label> | 496 | <label for="lname" class="lname"> {{ field.displayName }}</label> |
465 | <img | 497 | <img |
466 | v-if="field.fieldValue" | 498 | v-if="field.fieldValue" |
467 | style="width: 40px; height: 40px" | 499 | style="width: 40px; height: 40px" |
468 | :src="field.fieldValue" | 500 | :src="field.fieldValue" |
469 | /> | 501 | /> |
470 | <input | 502 | <input |
471 | @change="fieldcreateImage(i, j)" | 503 | @change="fieldcreateImage(i, j)" |
472 | type="file" | 504 | type="file" |
473 | name="photo" | 505 | name="photo" |
474 | :id="i + '' + j" | 506 | :id="i + '' + j" |
475 | accept="image/*" | 507 | accept="image/*" |
476 | /> | 508 | /> |
477 | </div> | 509 | </div> |
478 | </div> | 510 | </div> |
479 | </div> | 511 | </div> |
480 | 512 | ||
481 | <div class="row"> | 513 | <div class="row"> |
482 | <div | 514 | <div |
483 | class="col-sm-4 col-md-4 col-lg-4 col-xl-4" | 515 | |
484 | v-for="(cum, j) in slide.metaData.comments" | 516 | v-for="(cum, j) in slide.metaData.comments" |
485 | :key="j" | 517 | :key="j" |
486 | > | 518 | > |
487 | <div class="form-group floating-label"> | 519 | <div class="form-group floating-label"> |
488 | <label for="lname" class="lname">Comment Box {{ j + 1 }}</label> | 520 | <label for="lname" class="lname">Comment Box {{ j + 1 }}</label> |
489 | <input | 521 | <input |
490 | type="text" | 522 | type="text" |
491 | class="form-control" | 523 | class="form-control" |
492 | value="" | 524 | value="" |
493 | placeholder=" " | 525 | placeholder=" " |
494 | v-model="cum.comment" | 526 | v-model="cum.comment" |
495 | v-on:blur="updateComment(cum)" | 527 | v-on:blur="updateComment(cum)" |
496 | /> | 528 | /> |
497 | </div> | 529 | </div> |
498 | </div> | 530 | </div> |
499 | </div> | 531 | </div> |
500 | </div> | 532 | </div> |
501 | 533 | ||
502 | <!-- 1st row --> | 534 | <!-- 1st row --> |
503 | <div class="row"> | 535 | <div class="row"> |
504 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 536 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
505 | <div class="form-group floating-label"> | 537 | <div class="form-group floating-label"> |
506 | <label for="lname" class="lname">Slides Name</label> | 538 | <label for="lname" class="lname">Slides Name</label> |
507 | <select | 539 | <select |
508 | class="form-control" | 540 | class="form-control" |
509 | v-model="slideId" | 541 | v-model="slideId" |
510 | v-on:change="slideSelected(slideId)" | 542 | v-on:change="slideSelected(slideId)" |
511 | > | 543 | > |
512 | <option value="null">Select Slide</option> | 544 | <option value="null">Select Slide</option> |
513 | <option v-for="(template, i) in templateList" :key="i" :value="i"> | 545 | <option v-for="(template, i) in templateList" :key="i" :value="i"> |
514 | {{ template.name }} | 546 | {{ template.name }} |
515 | </option> | 547 | </option> |
516 | </select> | 548 | </select> |
517 | </div> | 549 | </div> |
518 | </div> | 550 | </div> |
519 | </div> | 551 | </div> |
520 | <!-- 1st row --> | 552 | <!-- 1st row --> |
521 | 553 | ||
522 | <!-- 1st row end --> | 554 | <!-- 1st row end --> |
523 | <!-- case study ends --> | 555 | <!-- case study ends --> |
524 | <div class="clearfix"></div> | 556 | <div class="clearfix"></div> |
525 | 557 | ||
526 | <!-- users land image --> | 558 | <!-- users land image --> |
527 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> | 559 | <div class="col-sm-4 col-md-4 col-lg-4 col-xl-4"> |
528 | <div class="form-layout signup-frm-spc"> | 560 | <div class="form-layout signup-frm-spc"> |
529 | <form> | 561 | <form> |
530 | <a | 562 | <a |
531 | href="javascript:void(0);" | 563 | href="javascript:void(0);" |
532 | class="btn btn-lg sb-button" | 564 | class="btn btn-lg sb-button" |
533 | type="submit" | 565 | type="submit" |
534 | @click="submit" | 566 | @click="submit" |
535 | > | 567 | > |
536 | <img src="../assets/images/key.svg" /> submit | 568 | <img src="../assets/images/key.svg" /> submit |
537 | </a> | 569 | </a> |
538 | </form> | 570 | </form> |
539 | </div> | 571 | </div> |
540 | </div> | 572 | </div> |
541 | 573 | ||
542 | <!-- data wrp --> | 574 | <!-- data wrp --> |
543 | <!-- body wrapper --> | 575 | <!-- body wrapper --> |
544 | </div> | 576 | </div> |
545 | </main> | 577 | </main> |
546 | </template> | 578 | </template> |
547 | 579 | ||
548 | <script> | 580 | <script> |
549 | import Vue from "vue"; | 581 | import Vue from "vue"; |
550 | import router from "../router"; | 582 | import router from "../router"; |
551 | import $ from "jquery"; | 583 | import $ from "jquery"; |
552 | import axios from "axios"; | 584 | import axios from "axios"; |
553 | 585 | ||
554 | export default { | 586 | export default { |
555 | name: "Profile", | 587 | name: "Profile", |
556 | 588 | ||
557 | data() { | 589 | data() { |
558 | return { | 590 | return { |
559 | object: null, | 591 | object: null, |
560 | loggedinFlag: false, | 592 | loggedinFlag: false, |
561 | templateImage: null, | 593 | templateImage: null, |
562 | caseId: null, | 594 | caseId: null, |
563 | editMode: false, | 595 | editMode: false, |
564 | userData: null, | 596 | userData: null, |
565 | usertoken: null, | 597 | usertoken: null, |
566 | insightName: null, | 598 | insightName: null, |
567 | focusName: null, | 599 | focusName: null, |
568 | slideId: null, | 600 | slideId: null, |
569 | userList: [], | 601 | userList: [], |
570 | templateList: [], | 602 | templateList: [], |
571 | insightList: [], | 603 | insightList: [], |
572 | insightId: null, | 604 | insightId: null, |
573 | caseStudy: { | 605 | caseStudy: { |
574 | caseStudyDetails: { | 606 | caseStudyDetails: { |
575 | userId: [], | 607 | userId: [], |
576 | intro: { | 608 | intro: { |
577 | name: null, | 609 | name: null, |
578 | logoURL: null, | 610 | logoURL: null, |
579 | app: null, | 611 | app: null, |
580 | type: null, | 612 | type: null, |
581 | readTime: null, | 613 | readTime: null, |
582 | platForm: null, | 614 | platForm: null, |
615 | templateId: "intro-1", | ||
583 | authors: [], | 616 | authors: [], |
584 | }, | 617 | }, |
585 | outro: { | 618 | outro: { |
586 | authorImage: [], | 619 | authorImage: [], |
587 | authors: [], | 620 | authors: [], |
588 | designer: null, | 621 | designer: null, |
622 | templateId: "outro-1", | ||
589 | illustrations: null, | 623 | illustrations: null, |
590 | }, | 624 | }, |
591 | insightTags: [], | 625 | insightTags: [], |
592 | focusAreas: [], | 626 | focusAreas: [], |
593 | }, | 627 | }, |
594 | slides: [], | 628 | slides: [], |
595 | }, | 629 | }, |
596 | selectPlatform: "", | 630 | selectPlatform: "", |
597 | }; | 631 | }; |
598 | }, | 632 | }, |
599 | mounted() { | 633 | mounted() { |
600 | if (this.$route.fullPath.split("?").length == 2) { | 634 | if (this.$route.fullPath.split("?").length == 2) { |
601 | this.editMode = true; | 635 | this.editMode = true; |
602 | this.caseId = this.$route.fullPath.split("?")[1]; | 636 | this.caseId = this.$route.fullPath.split("?")[1]; |
603 | var introData = localStorage.getItem("spotlight_caseStudy" + this.caseId); | 637 | var introData = localStorage.getItem("spotlight_caseStudy" + this.caseId); |
604 | if (introData) { | 638 | if (introData) { |
605 | introData = JSON.parse(introData); | 639 | introData = JSON.parse(introData); |
606 | console.log("introData", introData); | 640 | console.log("introData", introData); |
607 | if (introData.intro.focus) { | 641 | if (introData.intro.focus) { |
608 | delete introData.intro.focus; | 642 | delete introData.intro.focus; |
609 | } | 643 | } |
610 | this.caseStudy.caseStudyDetails.intro = introData.intro; | 644 | this.caseStudy.caseStudyDetails.intro = introData.intro; |
611 | this.caseStudy.caseStudyDetails.userId = introData.userId; | 645 | this.caseStudy.caseStudyDetails.userId = introData.userId; |
612 | this.caseStudy.caseStudyDetails.outro = introData.outro; | 646 | this.caseStudy.caseStudyDetails.outro = introData.outro; |
613 | this.caseStudy.caseStudyDetails.insightTags = introData.insightTags; | 647 | this.caseStudy.caseStudyDetails.insightTags = introData.insightTags; |
614 | this.caseStudy.caseStudyDetails.focusAreas = introData.focusAreas; | 648 | this.caseStudy.caseStudyDetails.focusAreas = introData.focusAreas; |
615 | this.selectPlatform = introData.intro.platForm; | 649 | this.selectPlatform = introData.intro.platForm; |
616 | console.log("this.selectPlatform", this.selectPlatform); | 650 | console.log("this.selectPlatform", this.selectPlatform); |
617 | } | 651 | } |
618 | } | 652 | } |
619 | var userdata = localStorage.getItem("spotlight_usertoken"); | 653 | var userdata = localStorage.getItem("spotlight_usertoken"); |
620 | if (userdata) { | 654 | if (userdata) { |
621 | userdata = JSON.parse(userdata); | 655 | userdata = JSON.parse(userdata); |
622 | this.usertoken = userdata.token; | 656 | this.usertoken = userdata.token; |
623 | this.getUserList(); | 657 | this.getUserList(); |
624 | this.getTemplateList(); | 658 | this.getTemplateList(); |
625 | this.getInsightList(); | 659 | this.getInsightList(); |
660 | // this.demo(); | ||
626 | } | 661 | } |
627 | }, | 662 | }, |
628 | methods: { | 663 | methods: { |
664 | demo() { | ||
665 | var obj = { | ||
666 | responseMessage: "success", | ||
667 | callflowsDetails: { | ||
668 | metadata: { | ||
669 | "6f4f3ec8d8bd0d169a33cdeb49c005d4": { | ||
670 | name: "neeraj.sharma@viithiisys.com", | ||
671 | pvt_type: "faxbox", | ||
672 | }, | ||
673 | "1968018a933a6ce069b583f2dfe0d91b": { | ||
674 | name: "Rohit Saini", | ||
675 | pvt_type: "user", | ||
676 | }, | ||
677 | "48f409d64c69b52dbe114b86ee4579ea": { | ||
678 | name: "hello", | ||
679 | pvt_type: "device", | ||
680 | }, | ||
681 | }, | ||
682 | patterns: [], | ||
683 | numbers: ["+9876541023"], | ||
684 | id: "2360eb2f7dc04994382ab58fe48da46c", | ||
685 | ui_metadata: { | ||
686 | ui: "monster-ui", | ||
687 | origin: "callflows", | ||
688 | version: "4.3-139", | ||
689 | }, | ||
690 | flow: { | ||
691 | data: { | ||
692 | dial_strategy: "simultaneous", | ||
693 | delay: 0, | ||
694 | can_call_self: false, | ||
695 | id: "48f409d64c69b52dbe114b86ee4579ea", | ||
696 | timeout: 20, | ||
697 | }, | ||
698 | children: { | ||
699 | _: { | ||
700 | data: { id: "6f4f3ec8d8bd0d169a33cdeb49c005d4" }, | ||
701 | children: { | ||
702 | _: { | ||
703 | data: { | ||
704 | owner_id: "1968018a933a6ce069b583f2dfe0d91b", | ||
705 | media: { fax_option: false }, | ||
706 | }, | ||
707 | children: {}, | ||
708 | module: "receive_fax", | ||
709 | }, | ||
710 | }, | ||
711 | module: "faxbox", | ||
712 | }, | ||
713 | }, | ||
714 | module: "device", | ||
715 | }, | ||
716 | }, | ||
717 | }; | ||
718 | var string = JSON.stringify(obj); | ||
719 | var count = string.match(/children/gi).length; | ||
720 | var array = []; | ||
721 | var name = []; | ||
722 | for (var i = 0; i < count - 1; i++) { | ||
723 | name = name + "children"; | ||
724 | var value = JSON.parse(string); | ||
725 | // console.log("-1-",name); | ||
726 | console.log("-1-", value.callflowsDetails.flow[name]); | ||
727 | console.log("-2-", value.callflowsDetails.flow[name]["_"][name]); | ||
728 | console.log( | ||
729 | "-3-", | ||
730 | value.callflowsDetails.flow[name]["_"][name]["_"][name] | ||
731 | ); | ||
732 | } | ||
733 | }, | ||
734 | changeIntroScreen(){ | ||
735 | |||
736 | }, | ||
629 | selectUser(i) { | 737 | selectUser(i) { |
630 | this.userList[i]; | 738 | this.userList[i]; |
631 | this.caseStudy.caseStudyDetails.intro.authors.push(this.userList[i].name); | 739 | this.caseStudy.caseStudyDetails.intro.authors.push(this.userList[i].name); |
632 | this.caseStudy.caseStudyDetails.outro.authors.push(this.userList[i].name); | 740 | this.caseStudy.caseStudyDetails.outro.authors.push(this.userList[i].name); |
633 | this.caseStudy.caseStudyDetails.userId.push(this.userList[i]._id); | 741 | this.caseStudy.caseStudyDetails.userId.push(this.userList[i]._id); |
634 | console.log("-", this.caseStudy); | 742 | console.log("-", this.caseStudy); |
635 | }, | 743 | }, |
636 | 744 | ||
637 | logout() { | 745 | logout() { |
638 | this.$router.push("/"); | 746 | this.$router.push("/"); |
639 | }, | 747 | }, |
640 | addInsight(type) { | 748 | addInsight(type) { |
641 | if (type == "focus") { | 749 | if (type == "focus") { |
642 | this.caseStudy.caseStudyDetails.focusAreas.push(this.focusName); | 750 | this.caseStudy.caseStudyDetails.focusAreas.push(this.focusName); |
643 | this.focusName = null; | 751 | this.focusName = null; |
644 | } else if (type == "insight") { | 752 | } else if (type == "insight") { |
645 | this.caseStudy.caseStudyDetails.insightTags.push(this.insightName); | 753 | this.caseStudy.caseStudyDetails.insightTags.push(this.insightName); |
646 | this.insightName = null; | 754 | this.insightName = null; |
647 | } else if (type == "platform") { | 755 | } else if (type == "platform") { |
648 | this.caseStudy.caseStudyDetails.intro.platForm = this.selectPlatform; | 756 | this.caseStudy.caseStudyDetails.intro.platForm = this.selectPlatform; |
649 | // this.selectPlatform = null; | 757 | // this.selectPlatform = null; |
650 | } | 758 | } |
651 | }, | 759 | }, |
652 | removeInsight(i, type) { | 760 | removeInsight(i, type) { |
653 | if (type == "focus") { | 761 | if (type == "focus") { |
654 | this.caseStudy.caseStudyDetails.focusAreas.splice(i, 1); | 762 | this.caseStudy.caseStudyDetails.focusAreas.splice(i, 1); |
655 | } else if (type == "insight") { | 763 | } else if (type == "insight") { |
656 | this.caseStudy.caseStudyDetails.insightTags.splice(i, 1); | 764 | this.caseStudy.caseStudyDetails.insightTags.splice(i, 1); |
657 | } else if (type == "platform") { | 765 | } else if (type == "platform") { |
658 | this.caseStudy.caseStudyDetails.intro.platForm = ""; | 766 | this.caseStudy.caseStudyDetails.intro.platForm = ""; |
659 | this.selectPlatform = null; | 767 | this.selectPlatform = null; |
660 | } | 768 | } |
661 | }, | 769 | }, |
662 | 770 | ||
663 | async slideSelected(i) { | 771 | async slideSelected(i) { |
664 | console.log("id is", this.templateList[i]); | 772 | console.log("id is", this.templateList[i]); |
665 | this.object = JSON.parse(JSON.stringify(this.templateList[i])); | 773 | this.object = JSON.parse(JSON.stringify(this.templateList[i])); |
666 | 774 | ||
667 | // var keys = Object.keys(this.templateList[i]); | 775 | // var keys = Object.keys(this.templateList[i]); |
668 | // keys.forEach(element => { | 776 | // keys.forEach(element => { |
669 | // obj[element] = this.templateList[i][element]; | 777 | // obj[element] = this.templateList[i][element]; |
670 | // }); | 778 | // }); |
671 | 779 | ||
672 | console.log("obj", this.object); | 780 | console.log("obj", this.object); |
673 | // slideMetadata = await this.getMeatda(this.templateList[i]._id); | 781 | // slideMetadata = await this.getMeatda(this.templateList[i]._id); |
674 | this.slideId = null; | 782 | this.slideId = null; |
675 | // this.templateList[i].metaData = slideMetadata.metaData; | 783 | // this.templateList[i].metaData = slideMetadata.metaData; |
676 | this.caseStudy.slides.push(this.object); | 784 | this.caseStudy.slides.push(this.object); |
677 | this.templateList[i].metaData.fields.forEach((fields_) => { | 785 | this.templateList[i].metaData.fields.forEach((fields_) => { |
678 | fields_.fieldValue == null; | 786 | fields_.fieldValue == null; |
679 | }); | 787 | }); |
680 | if (this.templateList[i].metaData.comments) { | 788 | if (this.templateList[i].metaData.comments) { |
681 | this.templateList[i].metaData.comments.forEach((coments_) => { | 789 | this.templateList[i].metaData.comments.forEach((coments_) => { |
682 | coments_.comment == null; | 790 | coments_.comment == null; |
683 | }); | 791 | }); |
684 | } | 792 | } |
685 | console.log("this.caseStudy.slides", this.caseStudy.slides); | 793 | console.log("this.caseStudy.slides", this.caseStudy.slides); |
686 | }, | 794 | }, |
687 | async insightSelected(data) { | 795 | async insightSelected(data) { |
688 | // this.caseStudy.slides.push(this.templateList[i]); | 796 | // this.caseStudy.slides.push(this.templateList[i]); |
689 | 797 | ||
690 | console.log("data", data); | 798 | console.log("data", data); |
691 | data.insightId = this.insightId; | 799 | data.insightId = this.insightId; |
692 | // this.insightId = null; | 800 | // this.insightId = null; |
693 | }, | 801 | }, |
694 | 802 | ||
695 | removeSlide(i) { | 803 | removeSlide(i) { |
696 | this.caseStudy.slides.splice(i, 1); | 804 | this.caseStudy.slides.splice(i, 1); |
697 | }, | 805 | }, |
698 | 806 | ||
699 | createImage(type) { | 807 | createImage(type) { |
700 | var that = this; | 808 | var that = this; |
701 | console.log(document.getElementById(type)); | 809 | console.log(document.getElementById(type)); |
702 | var file = document.getElementById(type).files[0]; | 810 | var file = document.getElementById(type).files[0]; |
703 | console.log("file", file); | 811 | console.log("file", file); |
704 | var reader = new FileReader(); | 812 | var reader = new FileReader(); |
705 | reader.onload = function (e) { | 813 | reader.onload = function (e) { |
706 | console.log("e.target.result ", e.target.result); | 814 | console.log("e.target.result ", e.target.result); |
707 | that.uploadImage(type, e.target.result); | 815 | that.uploadImage(type, e.target.result); |
708 | }; | 816 | }; |
709 | reader.onerror = function (error) { | 817 | reader.onerror = function (error) { |
710 | alert(error); | 818 | alert(error); |
711 | }; | 819 | }; |
712 | if (file) { | 820 | if (file) { |
713 | reader.readAsDataURL(file); | 821 | reader.readAsDataURL(file); |
714 | } | 822 | } |
715 | }, | 823 | }, |
716 | uploadImage(type, base64) { | 824 | uploadImage(type, base64) { |
717 | console.log("type", type); | 825 | console.log("type", type); |
718 | var obj = { | 826 | var obj = { |
719 | image: base64, | 827 | image: base64, |
720 | }; | 828 | }; |
721 | axios | 829 | axios |
722 | .post("/superAdmin/uploadImage", obj, { | 830 | .post("/superAdmin/uploadImage", obj, { |
723 | headers: { | 831 | headers: { |
724 | Authorization: "Bearer " + this.usertoken, | 832 | Authorization: "Bearer " + this.usertoken, |
725 | }, | 833 | }, |
726 | }) | 834 | }) |
727 | .then((response) => { | 835 | .then((response) => { |
728 | if (type == "logo") { | 836 | if (type == "logo") { |
729 | setTimeout( | 837 | setTimeout( |
730 | () => | 838 | () => |
731 | (this.caseStudy.caseStudyDetails.intro.logoURL = | 839 | (this.caseStudy.caseStudyDetails.intro.logoURL = |
732 | response.data.data), | 840 | response.data.data), |
733 | 99 | 841 | 99 |
734 | ); | 842 | ); |
735 | } else if (type == "outdor") { | 843 | } else if (type == "outdor") { |
736 | this.caseStudy.caseStudyDetails.outro.authorImage = []; | 844 | this.caseStudy.caseStudyDetails.outro.authorImage = []; |
737 | setTimeout( | 845 | setTimeout( |
738 | () => | 846 | () => |
739 | this.caseStudy.caseStudyDetails.outro.authorImage.push( | 847 | this.caseStudy.caseStudyDetails.outro.authorImage.push( |
740 | response.data.data | 848 | response.data.data |
741 | ), | 849 | ), |
742 | 99 | 850 | 99 |
743 | ); | 851 | ); |
744 | } | 852 | } |
745 | 853 | ||
746 | console.log(response.data.data); | 854 | console.log(response.data.data); |
747 | console.log(this.caseStudy); | 855 | console.log(this.caseStudy); |
748 | }) | 856 | }) |
749 | .catch((error) => { | 857 | .catch((error) => { |
750 | if (error.response) { | 858 | if (error.response) { |
751 | this.$toaster.error(error.response.data.message); | 859 | this.$toaster.error(error.response.data.message); |
752 | } | 860 | } |
753 | }); | 861 | }); |
754 | }, | 862 | }, |
755 | 863 | ||
756 | fieldcreateImage(i, j) { | 864 | fieldcreateImage(i, j) { |
757 | console.log("i", i); | 865 | console.log("i", i); |
758 | console.log("j", j); | 866 | console.log("j", j); |
759 | var that = this; | 867 | var that = this; |
760 | var id = i + "" + j; | 868 | var id = i + "" + j; |
761 | console.log(document.getElementById(id)); | 869 | console.log(document.getElementById(id)); |
762 | var file = document.getElementById(id).files[0]; | 870 | var file = document.getElementById(id).files[0]; |
763 | // var file = document.querySelector("input[type=file]").files[0]; | 871 | // var file = document.querySelector("input[type=file]").files[0]; |
764 | console.log("file", file); | 872 | console.log("file", file); |
765 | var reader = new FileReader(); | 873 | var reader = new FileReader(); |
766 | reader.onload = function (e) { | 874 | reader.onload = function (e) { |
767 | // console.log("e.target.result ",e.target.result ) | 875 | // console.log("e.target.result ",e.target.result ) |
768 | that.fielduploadImage(i, j, e.target.result); | 876 | that.fielduploadImage(i, j, e.target.result); |
769 | }; | 877 | }; |
770 | reader.onerror = function (error) { | 878 | reader.onerror = function (error) { |
771 | alert(error); | 879 | alert(error); |
772 | }; | 880 | }; |
773 | if (file) { | 881 | if (file) { |
774 | reader.readAsDataURL(file); | 882 | reader.readAsDataURL(file); |
775 | } | 883 | } |
776 | }, | 884 | }, |
777 | fielduploadImage(i, j, base64) { | 885 | fielduploadImage(i, j, base64) { |
778 | var obj = { | 886 | var obj = { |
779 | image: base64, | 887 | image: base64, |
780 | }; | 888 | }; |
781 | axios | 889 | axios |
782 | .post("/superAdmin/uploadImage", obj, { | 890 | .post("/superAdmin/uploadImage", obj, { |
783 | headers: { | 891 | headers: { |
784 | Authorization: "Bearer " + this.usertoken, | 892 | Authorization: "Bearer " + this.usertoken, |
785 | }, | 893 | }, |
786 | }) | 894 | }) |
787 | .then((response) => { | 895 | .then((response) => { |
788 | setTimeout( | 896 | setTimeout( |
789 | () => | 897 | () => |
790 | (this.caseStudy.slides[i].metaData.fields[j].fieldValue = | 898 | (this.caseStudy.slides[i].metaData.fields[j].fieldValue = |
791 | response.data.data), | 899 | response.data.data), |
792 | 10 | 900 | 10 |
793 | ); | 901 | ); |
794 | 902 | ||
795 | console.log(response.data.data); | 903 | console.log(response.data.data); |
796 | console.log(this.caseStudy); | 904 | console.log(this.caseStudy); |
797 | }) | 905 | }) |
798 | .catch((error) => { | 906 | .catch((error) => { |
799 | if (error.response) { | 907 | if (error.response) { |
800 | this.$toaster.error(error.response.data.message); | 908 | this.$toaster.error(error.response.data.message); |
801 | } | 909 | } |
802 | }); | 910 | }); |
803 | }, | 911 | }, |
804 | 912 | ||
805 | getUserList() { | 913 | getUserList() { |
806 | axios | 914 | axios |
807 | .get("/superAdmin/users", { | 915 | .get("/superAdmin/users", { |
808 | headers: { | 916 | headers: { |
809 | Authorization: "Bearer " + this.usertoken, | 917 | Authorization: "Bearer " + this.usertoken, |
810 | }, | 918 | }, |
811 | }) | 919 | }) |
812 | .then((response) => { | 920 | .then((response) => { |
813 | response.data.data.forEach((element) => { | 921 | response.data.data.forEach((element) => { |
814 | if (element.name) { | 922 | if (element.name) { |
815 | this.userList.push(element); | 923 | this.userList.push(element); |
816 | } | 924 | } |
817 | }); | 925 | }); |
818 | console.log("response", this.userList); | 926 | console.log("response", this.userList); |
819 | }) | 927 | }) |
820 | .catch((error) => console.log(error)); | 928 | .catch((error) => console.log(error)); |
821 | }, | 929 | }, |
822 | 930 | ||
823 | getTemplateList() { | 931 | getTemplateList() { |
824 | axios | 932 | axios |
825 | .get("/superAdmin/templates", { | 933 | .get("/superAdmin/templates", { |
826 | headers: { | 934 | headers: { |
827 | Authorization: "Bearer " + this.usertoken, | 935 | Authorization: "Bearer " + this.usertoken, |
828 | }, | 936 | }, |
829 | }) | 937 | }) |
830 | .then((response) => { | 938 | .then((response) => { |
831 | response.data.data.forEach((temp) => { | 939 | response.data.data.forEach((temp) => { |
832 | if ( | 940 | if ( |
833 | temp._id != "INTRO_oqkdMOVDrwRptsdWJ6Ye" && | 941 | temp._id != "INTRO_oqkdMOVDrwRptsdWJ6Ye" && |
834 | temp._id != "OUTRO_oqkdMOVDrwRptsdWJ6Ye" | 942 | temp._id != "OUTRO_oqkdMOVDrwRptsdWJ6Ye" |
835 | ) { | 943 | ) { |
836 | if (temp.bounceBoard) { | 944 | if (temp.bounceBoard) { |
837 | for (var i = 0; i < temp.commentBox; i++) { | 945 | for (var i = 0; i < temp.commentBox; i++) { |
838 | temp.metaData.comments.push({ | 946 | temp.metaData.comments.push({ |
839 | userId: null, | 947 | userId: null, |
840 | slideId: null, | 948 | slideId: null, |
841 | caseStudyId: null, | 949 | caseStudyId: null, |
842 | comment: null, | 950 | comment: null, |
843 | }); | 951 | }); |
844 | } | 952 | } |
845 | } | 953 | } |
846 | this.templateList.push(temp); | 954 | this.templateList.push(temp); |
847 | } | 955 | } |
848 | }); | 956 | }); |
849 | if (this.editMode) { | 957 | if (this.editMode) { |
850 | this.getSLideData(); | 958 | this.getSLideData(); |
851 | } | 959 | } |
852 | console.log("templates", this.templateList); | 960 | console.log("templates", this.templateList); |
853 | }) | 961 | }) |
854 | .catch((error) => console.log(error)); | 962 | .catch((error) => console.log(error)); |
855 | }, | 963 | }, |
856 | getInsightList() { | 964 | getInsightList() { |
857 | axios | 965 | axios |
858 | .get("/superAdmin/insight", { | 966 | .get("/superAdmin/insight", { |
859 | headers: { | 967 | headers: { |
860 | Authorization: "Bearer " + this.usertoken, | 968 | Authorization: "Bearer " + this.usertoken, |
861 | }, | 969 | }, |
862 | }) | 970 | }) |
863 | .then((response) => { | 971 | .then((response) => { |
864 | this.insightList = response.data.data; | 972 | this.insightList = response.data.data; |
865 | 973 | ||
866 | console.log("insight", response.data.data); | 974 | console.log("insight", response.data.data); |
867 | }) | 975 | }) |
868 | .catch((error) => console.log(error)); | 976 | .catch((error) => console.log(error)); |
869 | }, | 977 | }, |
870 | 978 | ||
871 | getSLideData() { | 979 | getSLideData() { |
872 | axios | 980 | axios |
873 | .get("/superAdmin/caseStudySlides?caseStudyId=" + this.caseId, { | 981 | .get("/superAdmin/caseStudySlides?caseStudyId=" + this.caseId, { |
874 | headers: { | 982 | headers: { |
875 | Authorization: "Bearer " + this.usertoken, | 983 | Authorization: "Bearer " + this.usertoken, |
876 | }, | 984 | }, |
877 | }) | 985 | }) |
878 | .then((response) => { | 986 | .then((response) => { |
879 | var finalArray = []; | 987 | var finalArray = []; |
880 | console.log("1"); | 988 | console.log("1"); |
881 | response.data.data.forEach((template_) => { | 989 | response.data.data.forEach((template_) => { |
882 | console.log("template_", template_); | 990 | console.log("template_", template_); |
883 | var keys = []; | 991 | var keys = []; |
884 | var i = this.templateList.findIndex( | 992 | var i = this.templateList.findIndex( |
885 | (temp_) => temp_._id == template_.templateId | 993 | (temp_) => temp_._id == template_.templateId |
886 | ); | 994 | ); |
887 | var obj = { | 995 | var obj = { |
888 | _id: this.templateList[i]._id, | 996 | _id: this.templateList[i]._id, |
889 | bounceBoard: this.templateList[i].bounceBoard, | 997 | bounceBoard: this.templateList[i].bounceBoard, |
890 | insight: this.templateList[i].insight, | 998 | insight: this.templateList[i].insight, |
891 | slideId: template_._id, | 999 | slideId: template_._id, |
892 | // commentBox: this.templateList[i].commentBox, | 1000 | // commentBox: this.templateList[i].commentBox, |
893 | metaData: { | 1001 | metaData: { |
894 | fields: [], | 1002 | fields: [], |
895 | comments: [], | 1003 | comments: [], |
896 | }, | 1004 | }, |
897 | }; | 1005 | }; |
898 | console.log("2"); | 1006 | console.log("2"); |
899 | 1007 | ||
900 | if (this.templateList[i].bounceBoard) { | 1008 | if (this.templateList[i].bounceBoard) { |
901 | obj.commentBox = this.templateList[i].commentBox; | 1009 | obj.commentBox = this.templateList[i].commentBox; |
902 | obj.metaData.comments = template_.comments; | 1010 | obj.metaData.comments = template_.comments; |
903 | } | 1011 | } |
904 | if (this.templateList[i].insight) { | 1012 | if (this.templateList[i].insight) { |
905 | obj.insightId = template_.insightId; | 1013 | obj.insightId = template_.insightId; |
906 | } | 1014 | } |
907 | var fieldArray = []; | 1015 | var fieldArray = []; |
908 | console.log("3"); | 1016 | console.log("3"); |
909 | 1017 | ||
910 | this.templateList[i].metaData.fields.forEach((element) => { | 1018 | this.templateList[i].metaData.fields.forEach((element) => { |
911 | var fieldobj = { | 1019 | var fieldobj = { |
912 | fieldName: element.fieldName, | 1020 | fieldName: element.fieldName, |
913 | displayName: element.displayName, | 1021 | displayName: element.displayName, |
914 | fieldValue: template_.metaData[element.fieldName], | 1022 | fieldValue: template_.metaData[element.fieldName], |
915 | fieldType: element.fieldType, | 1023 | fieldType: element.fieldType, |
916 | }; | 1024 | }; |
917 | obj.metaData.fields.push(fieldobj); | 1025 | obj.metaData.fields.push(fieldobj); |
918 | }); | 1026 | }); |
919 | console.log("4"); | 1027 | console.log("4"); |
920 | 1028 | ||
921 | finalArray.push(obj); | 1029 | finalArray.push(obj); |
922 | if(template_.insight){ | 1030 | if (template_.insight) { |
923 | this.insightId = template_.insight._id; | 1031 | this.insightId = template_.insight._id; |
924 | } | 1032 | } |
925 | }); | 1033 | }); |
926 | console.log("5"); | 1034 | console.log("5"); |
927 | 1035 | ||
928 | this.caseStudy.slides = finalArray; | 1036 | this.caseStudy.slides = finalArray; |
929 | console.log("----", finalArray); | 1037 | console.log("----", finalArray); |
930 | console.log(this.templateList, "getSLideData==>"); | 1038 | console.log(this.templateList, "getSLideData==>"); |
931 | }) | 1039 | }) |
932 | .catch((error) => console.log(error)); | 1040 | .catch((error) => console.log(error)); |
933 | }, | 1041 | }, |
934 | 1042 | ||
935 | submit() { | 1043 | submit() { |
936 | const latest = Object.create(this.caseStudy); | 1044 | const latest = Object.create(this.caseStudy); |
937 | 1045 | ||
938 | var slidArray = []; | 1046 | var slidArray = []; |
939 | latest.slides.forEach((slides) => { | 1047 | latest.slides.forEach((slides) => { |
940 | console.log("slides", slides); | 1048 | console.log("slides", slides); |
941 | var slideData = {}; | 1049 | var slideData = {}; |
942 | slideData.templateId = slides._id; | 1050 | slideData.templateId = slides._id; |
943 | slideData.bounceBoard = slides.bounceBoard; | 1051 | slideData.bounceBoard = slides.bounceBoard; |
944 | slideData.insight = slides.insight; | 1052 | slideData.insight = slides.insight; |
945 | if (slides.slideId) { | 1053 | if (slides.slideId) { |
946 | slideData.slideId = slides.slideId; | 1054 | slideData.slideId = slides.slideId; |
947 | } | 1055 | } |
948 | if (slides.insightId) { | 1056 | if (slides.insightId) { |
949 | slideData.insightId = slides.insightId; | 1057 | slideData.insightId = slides.insightId; |
950 | } | 1058 | } |
951 | if (slides.metaData.comments && slides.metaData.comments.length > 0) { | 1059 | if (slides.metaData.comments && slides.metaData.comments.length > 0) { |
952 | slideData.comments = slides.metaData.comments; | 1060 | slideData.comments = slides.metaData.comments; |
953 | // this.getSLideData(); | 1061 | // this.getSLideData(); |
954 | } | 1062 | } |
955 | // var comments = []; | 1063 | // var comments = []; |
956 | // if (slides.bounceBoard) { | 1064 | // if (slides.bounceBoard) { |
957 | // slides.metaData.comments.forEach((element) => { | 1065 | // slides.metaData.comments.forEach((element) => { |
958 | // comments.push(element.comment); | 1066 | // comments.push(element.comment); |
959 | // }); | 1067 | // }); |
960 | // slideData.comments = comments; | 1068 | // slideData.comments = comments; |
961 | // } | 1069 | // } |
962 | 1070 | ||
963 | slides.metaData.fields.forEach((fields_) => { | 1071 | slides.metaData.fields.forEach((fields_) => { |
964 | slideData[fields_.fieldName] = fields_.fieldValue; | 1072 | slideData[fields_.fieldName] = fields_.fieldValue; |
965 | }); | 1073 | }); |
966 | slidArray.push(slideData); | 1074 | slidArray.push(slideData); |
967 | // delete slides.metaData.fields; | 1075 | // delete slides.metaData.fields; |
968 | }); | 1076 | }); |
969 | 1077 | ||
970 | console.log("slideData", slidArray); | 1078 | console.log("slideData", slidArray); |
971 | if (this.editMode) { | 1079 | if (this.editMode) { |
972 | this.updateProfile(slidArray); | 1080 | this.updateProfile(slidArray); |
973 | } else { | 1081 | } else { |
974 | this.saveProfile(slidArray); | 1082 | this.saveProfile(slidArray); |
975 | } | 1083 | } |
976 | }, | 1084 | }, |
977 | updateComment(cmnt) { | 1085 | updateComment(cmnt) { |
978 | if (!cmnt._id) { | 1086 | if (!cmnt._id) { |
979 | return; | 1087 | return; |
980 | } | 1088 | } |
981 | console.log("cmnts", cmnt); | 1089 | console.log("cmnts", cmnt); |
982 | var obj = { | 1090 | var obj = { |
983 | slideId: cmnt.slideId, | 1091 | slideId: cmnt.slideId, |
984 | commentId: cmnt._id, | 1092 | commentId: cmnt._id, |
985 | comment: cmnt.comment, | 1093 | comment: cmnt.comment, |
986 | }; | 1094 | }; |
987 | axios | 1095 | axios |
988 | .put("/superAdmin/comment", obj, { | 1096 | .put("/superAdmin/comment", obj, { |
989 | headers: { | 1097 | headers: { |
990 | Authorization: "Bearer " + this.usertoken, | 1098 | Authorization: "Bearer " + this.usertoken, |
991 | }, | 1099 | }, |
992 | }) | 1100 | }) |
993 | .then((response) => { | 1101 | .then((response) => { |
994 | console.log(response); | 1102 | console.log(response); |
995 | }) | 1103 | }) |
996 | .catch((error) => {}); | 1104 | .catch((error) => {}); |
997 | }, | 1105 | }, |
998 | 1106 | ||
999 | saveProfile(slides) { | 1107 | saveProfile(slides) { |
1000 | var obj = {}; | 1108 | var obj = {}; |
1001 | obj.caseStudyDetails = this.caseStudy.caseStudyDetails; | 1109 | obj.caseStudyDetails = this.caseStudy.caseStudyDetails; |
1002 | obj.caseStudyDetails.intro.readTime = Math.round( | 1110 | obj.caseStudyDetails.intro.readTime = Math.round( |
1003 | slides.length / 3 | 1111 | slides.length / 3 |
1004 | ).toString(); | 1112 | ).toString(); |
1005 | obj.slides = slides; | 1113 | obj.slides = slides; |
1006 | axios | 1114 | axios |
1007 | .post("/superAdmin/caseStudy", obj, { | 1115 | .post("/superAdmin/caseStudy", obj, { |
1008 | headers: { | 1116 | headers: { |
1009 | Authorization: "Bearer " + this.usertoken, | 1117 | Authorization: "Bearer " + this.usertoken, |
1010 | }, | 1118 | }, |
1011 | }) | 1119 | }) |
1012 | .then((response) => { | 1120 | .then((response) => { |
1013 | // this.userData = response.data.data; | 1121 | // this.userData = response.data.data; |
1014 | this.$toaster.success("Case Study Created"); | 1122 | this.$toaster.success("Case Study Created"); |
1015 | this.$router.go(this.$router.currentRoute); | 1123 | this.$router.go(this.$router.currentRoute); |
1016 | 1124 | ||
1017 | console.log(response); | 1125 | console.log(response); |
1018 | }) | 1126 | }) |
1019 | .catch((error) => { | 1127 | .catch((error) => { |
1020 | if (error.response) { | 1128 | if (error.response) { |
1021 | this.$toaster.error(error.response.data.message); | 1129 | this.$toaster.error(error.response.data.message); |
1022 | } | 1130 | } |
1023 | }); | 1131 | }); |
1024 | }, | 1132 | }, |
1025 | 1133 | ||
1026 | updateProfile(slides) { | 1134 | updateProfile(slides) { |
1027 | var obj = {}; | 1135 | var obj = {}; |
1028 | (obj.caseStudyId = this.caseId), | 1136 | (obj.caseStudyId = this.caseId), |
1029 | (obj.caseStudyDetails = this.caseStudy.caseStudyDetails); | 1137 | (obj.caseStudyDetails = this.caseStudy.caseStudyDetails); |
1030 | obj.caseStudyDetails.intro.readTime = Math.round( | 1138 | obj.caseStudyDetails.intro.readTime = Math.round( |
1031 | slides.length / 3 | 1139 | slides.length / 3 |
1032 | ).toString(); | 1140 | ).toString(); |
1033 | obj.slides = slides; | 1141 | obj.slides = slides; |
1034 | delete obj.caseStudyDetails.intro.focus; | 1142 | delete obj.caseStudyDetails.intro.focus; |
1035 | axios | 1143 | axios |
1036 | .put("/superAdmin/caseStudy", obj, { | 1144 | .put("/superAdmin/caseStudy", obj, { |
1037 | headers: { | 1145 | headers: { |
1038 | Authorization: "Bearer " + this.usertoken, | 1146 | Authorization: "Bearer " + this.usertoken, |
1039 | }, | 1147 | }, |
1040 | }) | 1148 | }) |
1041 | .then((response) => { | 1149 | .then((response) => { |
1042 | // this.userData = response.data.data; | 1150 | // this.userData = response.data.data; |
1043 | this.$toaster.success("Case Study Updated"); | 1151 | this.$toaster.success("Case Study Updated"); |
1044 | this.$router.go(this.$router.currentRoute); | 1152 | this.$router.go(this.$router.currentRoute); |
1045 | 1153 | ||
1046 | console.log(response); | 1154 | console.log(response); |
1047 | }) | 1155 | }) |
1048 | .catch((error) => { | 1156 | .catch((error) => { |
1049 | if (error.response) { | 1157 | if (error.response) { |
1050 | this.$toaster.error(error.response.data.message); | 1158 | this.$toaster.error(error.response.data.message); |
1051 | } | 1159 | } |
1052 | }); | 1160 | }); |
1053 | }, | 1161 | }, |
1054 | listPage(url) { | 1162 | listPage(url) { |
1055 | this.$router.push(url); | 1163 | this.$router.push(url); |
1056 | }, | 1164 | }, |
1057 | 1165 | ||
1058 | addProfileDialog(slide) { | 1166 | addProfileDialog(slide) { |
1059 | console.log("slide", slide); | 1167 | console.log("slide", slide); |
1060 | this.templateImage = slide.templateImage; | 1168 | this.templateImage = slide.templateImage; |
1061 | $(".inner-wrp").addClass("body-blur"); | 1169 | $(".inner-wrp").addClass("body-blur"); |
1062 | $("#add-social-links").hide(); | 1170 | $("#add-social-links").hide(); |
1063 | $(".popup-wrp, #add-profile").show(); | 1171 | $(".popup-wrp, #add-profile").show(); |
1064 | }, | 1172 | }, |
1065 | 1173 | ||
1066 | closeDialog() { | 1174 | closeDialog() { |
1067 | this.templateImage = null; | 1175 | this.templateImage = null; |
1068 | $(".popup-wrp").hide(); | 1176 | $(".popup-wrp").hide(); |
1069 | $(".inner-wrp").removeClass("body-blur"); | 1177 | $(".inner-wrp").removeClass("body-blur"); |
1070 | // this.saveProfile(); | 1178 | // this.saveProfile(); |
1071 | }, | 1179 | }, |
1072 | hideDialog() { | 1180 | hideDialog() { |
1073 | this.templateImage = null; | 1181 | this.templateImage = null; |
1074 | $(".popup-wrp").hide(); | 1182 | $(".popup-wrp").hide(); |
1075 | $(".inner-wrp").removeClass("body-blur"); | 1183 | $(".inner-wrp").removeClass("body-blur"); |
1076 | }, | 1184 | }, |
1077 | 1185 | ||
1078 | async getMeatda(tempId) { | 1186 | async getMeatda(tempId) { |
1079 | var obj = [ | 1187 | var obj = [ |
1080 | { | 1188 | { |
1081 | tempId: "T1_RoeMG8130Xko1DvhC3Ou", | 1189 | tempId: "T1_RoeMG8130Xko1DvhC3Ou", |
1082 | metaData: { | 1190 | metaData: { |
1083 | fields: [ | 1191 | fields: [ |
1084 | { | 1192 | { |
1085 | fieldName: "authorImage", | 1193 | fieldName: "authorImage", |
1086 | displayName: "Author Image", | 1194 | displayName: "Author Image", |
1087 | fieldValue: null, | 1195 | fieldValue: null, |
1088 | fieldType: "image", | 1196 | fieldType: "image", |
1089 | }, | 1197 | }, |
1090 | { | 1198 | { |
1091 | fieldName: "mobileImage", | 1199 | fieldName: "mobileImage", |
1092 | displayName: "Mobile Image", | 1200 | displayName: "Mobile Image", |
1093 | fieldValue: null, | 1201 | fieldValue: null, |
1094 | fieldType: "image", | 1202 | fieldType: "image", |
1095 | }, | 1203 | }, |
1096 | { | 1204 | { |
1097 | fieldName: "textBox", | 1205 | fieldName: "textBox", |
1098 | displayName: "Text Box", | 1206 | displayName: "Text Box", |
1099 | fieldValue: null, | 1207 | fieldValue: null, |
1100 | fieldType: "text", | 1208 | fieldType: "text", |
1101 | }, | 1209 | }, |
1102 | ], | 1210 | ], |
1103 | }, | 1211 | }, |
1104 | }, | 1212 | }, |
1105 | { | 1213 | { |
1106 | tempId: "T2_ROsUOEy3vxsRAiQ72XdI", | 1214 | tempId: "T2_ROsUOEy3vxsRAiQ72XdI", |
1107 | metaData: { | 1215 | metaData: { |
1108 | fields: [ | 1216 | fields: [ |
1109 | { | 1217 | { |
1110 | fieldName: "authorImage", | 1218 | fieldName: "authorImage", |
1111 | displayName: "Author Image", | 1219 | displayName: "Author Image", |
1112 | fieldValue: null, | 1220 | fieldValue: null, |
1113 | fieldType: "image", | 1221 | fieldType: "image", |
1114 | }, | 1222 | }, |
1115 | ], | 1223 | ], |
1116 | comments: [{ comment: null }, { comment: null }, { comment: null }], | 1224 | comments: [{ comment: null }, { comment: null }, { comment: null }], |
1117 | }, | 1225 | }, |
1118 | }, | 1226 | }, |
1119 | { | 1227 | { |
1120 | tempId: "T3_cqNIf7tuqL4jyON63dA7", | 1228 | tempId: "T3_cqNIf7tuqL4jyON63dA7", |
1121 | metaData: { | 1229 | metaData: { |
1122 | fields: [ | 1230 | fields: [ |
1123 | { | 1231 | { |
1124 | fieldName: "authorImage", | 1232 | fieldName: "authorImage", |
1125 | displayName: "Author Image", | 1233 | displayName: "Author Image", |
1126 | fieldValue: null, | 1234 | fieldValue: null, |
1127 | fieldType: "image", | 1235 | fieldType: "image", |
1128 | }, | 1236 | }, |
1129 | { | 1237 | { |
1130 | fieldName: "mobileImage", | 1238 | fieldName: "mobileImage", |
1131 | displayName: "Mobile Image", | 1239 | displayName: "Mobile Image", |
1132 | fieldValue: null, | 1240 | fieldValue: null, |
1133 | fieldType: "image", | 1241 | fieldType: "image", |
1134 | }, | 1242 | }, |
1135 | ], | 1243 | ], |
1136 | comments: [ | 1244 | comments: [ |
1137 | { comment: null }, | 1245 | { comment: null }, |
1138 | { comment: null }, | 1246 | { comment: null }, |
1139 | { comment: null }, | 1247 | { comment: null }, |
1140 | { comment: null }, | 1248 | { comment: null }, |
1141 | ], | 1249 | ], |
1142 | }, | 1250 | }, |
1143 | }, | 1251 | }, |
1144 | ]; | 1252 | ]; |
1145 | var i = obj.findIndex((obj_) => obj_.tempId == tempId); | 1253 | var i = obj.findIndex((obj_) => obj_.tempId == tempId); |
1146 | return obj[i]; | 1254 | return obj[i]; |
1147 | }, | 1255 | }, |
1148 | }, | 1256 | }, |
1149 | }; | 1257 | }; |
1150 | </script> | 1258 | </script> |
1151 | 1259 |
src/main.js
1 | // The Vue build version to load with the `import` command | 1 | // The Vue build version to load with the `import` command |
2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. | 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. |
3 | import Vue from 'vue' | 3 | import Vue from 'vue' |
4 | // Add this line | 4 | // Add this line |
5 | import App from './App' | 5 | import App from './App' |
6 | import router from './router' | 6 | import router from './router' |
7 | import axios from 'axios' | 7 | import axios from 'axios' |
8 | 8 | ||
9 | // Import the Auth0 configuration | 9 | // Import the Auth0 configuration |
10 | import { domain, clientId } from "../auth_config.json" | 10 | import { domain, clientId } from "../auth_config.json" |
11 | 11 | ||
12 | // Import the plugin here | 12 | // Import the plugin here |
13 | import { Auth0Plugin } from "./auth" | 13 | import { Auth0Plugin } from "./auth" |
14 | import Vuelidate from 'vuelidate' | 14 | import Vuelidate from 'vuelidate' |
15 | import moment from 'moment' | 15 | import moment from 'moment' |
16 | import Toaster from 'v-toaster' | 16 | import Toaster from 'v-toaster' |
17 | import 'v-toaster/dist/v-toaster.css' | 17 | import 'v-toaster/dist/v-toaster.css' |
18 | 18 | ||
19 | // You need a specific loader for CSS files like https://github.com/webpack/css-loader | 19 | // You need a specific loader for CSS files like https://github.com/webpack/css-loader |
20 | 20 | ||
21 | // optional set default imeout, the default is 10000 (10 seconds). | 21 | // optional set default imeout, the default is 10000 (10 seconds). |
22 | Vue.use(Toaster, {timeout: 5000}) | 22 | Vue.use(Toaster, {timeout: 5000}) |
23 | Vue.use(Vuelidate) | 23 | Vue.use(Vuelidate) |
24 | // Install the authentication plugin here | 24 | // Install the authentication plugin here |
25 | Vue.use(Auth0Plugin, { | 25 | Vue.use(Auth0Plugin, { |
26 | domain, | 26 | domain, |
27 | clientId, | 27 | clientId, |
28 | redirect: false, | 28 | redirect: false, |
29 | onRedirectCallback: appState => { | 29 | onRedirectCallback: appState => { |
30 | router.push( | 30 | router.push( |
31 | appState && appState.targetUrl ? | 31 | appState && appState.targetUrl ? |
32 | appState.targetUrl : | 32 | appState.targetUrl : |
33 | window.location.pathname | 33 | window.location.pathname |
34 | ); | 34 | ); |
35 | } | 35 | } |
36 | }); | 36 | }); |
37 | 37 | ||
38 | Vue.config.productionTip = false | 38 | Vue.config.productionTip = false |
39 | // https://api.productgrowth.org/pg | 39 | // https://api.productgrowth.org/pg |
40 | // http://174.138.121.70:3006/pg | 40 | // http://174.138.121.70:3006/pg |
41 | // http://174.138.121.70:3006/pd | 41 | // http://174.138.121.70:3006/pd |
42 | 42 | ||
43 | Vue.prototype.moment = moment | 43 | Vue.prototype.moment = moment |
44 | axios.defaults.baseURL = 'http://174.138.121.70:3007/pg' | 44 | axios.defaults.baseURL = 'http://0.0.0.0:3000/pg' |
45 | 45 | ||
46 | /* eslint-disable no-new */ | 46 | /* eslint-disable no-new */ |
47 | new Vue({ | 47 | new Vue({ |
48 | el: '#app', | 48 | el: '#app', |
49 | router, | 49 | router, |
50 | components: { App }, | 50 | components: { App }, |
51 | template: '<App/>' | 51 | template: '<App/>' |
52 | }) | 52 | }) |