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