Browse Source

Update Profile, User and Agent Mangement

master
Lene Scholtz 5 years ago
parent
commit
57983b1eab

+ 132
- 0
src/components/admin/status/agentsUserManagementPage.vue View File

@@ -0,0 +1,132 @@
1
+<template>
2
+  <!-- eslint-disable max-len -->
3
+  <div class="container">
4
+    <br />
5
+    <br />
6
+    <div class="row">
7
+      <div class="col-md-12 col-lg-8">
8
+        <div class="title-box-d">
9
+          <h1 class="title-d" style="text-align:left; font-size: 250%">Agent Management</h1>
10
+        </div>
11
+      </div>
12
+    </div>
13
+    <div class="row">
14
+      <div class="col-md-2 offset-1">
15
+        <button
16
+          @click="routerGoTo('/status/userManagementPage')"
17
+          type="button"
18
+          class="btn btn-b-n"
19
+        >Private Users</button>
20
+      </div>
21
+      <div class="col-md-2 offset-2">
22
+        <button type="button" class="btn btn-b-n">Agents</button>
23
+      </div>
24
+      <div class="col-md-2 offset-2">
25
+        <button type="button" class="btn btn-b-n">New Agent</button>
26
+      </div>
27
+    </div>
28
+    <br />
29
+    <br />
30
+    <div class="container">
31
+      <table class="table table-bordered">
32
+        <thead>
33
+          <tr>
34
+            <th>
35
+              <b>ID</b>
36
+            </th>
37
+            <th>
38
+              <b>Name</b>
39
+            </th>
40
+            <th>
41
+              <b>Surname</b>
42
+            </th>
43
+            <th>
44
+              <b>Cell Number</b>
45
+            </th>
46
+            <th>
47
+              <b>Telephone Number</b>
48
+            </th>
49
+            <th>
50
+              <b>Email</b>
51
+            </th>
52
+            <th>
53
+              <b>Role</b>
54
+            </th>
55
+            <th>
56
+              <b>Reset Password</b>
57
+            </th>
58
+            <th></th>
59
+            <th></th>
60
+          </tr>
61
+        </thead>
62
+        <tbody>
63
+          <tr>
64
+            <td colspan="10">
65
+              <h5>Agents</h5>
66
+            </td>
67
+          </tr>
68
+          <tr v-for="(item, i) in agents" :key="i">
69
+            <td>{{ item.id }}</td>
70
+            <td>{{ item.name }}</td>
71
+            <td>{{ item.surname }}</td>
72
+            <td>{{ item.cellNumber }}</td>
73
+            <td>{{ item.telephone }}</td>
74
+            <td>{{ item.email }}</td>
75
+            <td v-if="item.user">{{ item.user.role }}</td>
76
+            <td v-else></td>
77
+            <td></td>
78
+            <td>
79
+              <button
80
+                type="button"
81
+                @click="Edit(item)"
82
+                class="btn"
83
+                style="margin:2px; color: #60CBEB"
84
+              >Edit</button>
85
+            </td>
86
+            <td>
87
+              <button
88
+                type="button"
89
+                class="btn"
90
+                style="width: 85px; height:40px; color:#60CBEB"
91
+              >Delete</button>
92
+            </td>
93
+          </tr>
94
+        </tbody>
95
+      </table>
96
+    </div>
97
+    <br />
98
+  </div>
99
+</template>
100
+<script>
101
+import { mapState, mapActions } from 'vuex';
102
+import axios from 'axios';
103
+
104
+export default {
105
+  name: 'agentManagementPage',
106
+  data() {
107
+    return {};
108
+  },
109
+  methods: {
110
+    ...mapActions('registerIndividual', ['getAgents']),
111
+    addNewAgent({ commit }) {
112
+      axios
113
+        .post('/api/agent')
114
+        .then(result => commit('saveAgent', result.data))
115
+        .catch(console.error);
116
+    },
117
+    routerGoTo(goTo) {
118
+      this.$router.push(goTo);
119
+    },
120
+  },
121
+  mounted() {
122
+    this.getAgents();
123
+  },
124
+  computed: {
125
+    ...mapState('registerIndividual', ['agents']),
126
+  },
127
+};
128
+</script>
129
+
130
+
131
+<style>
132
+</style>

+ 40
- 52
src/components/admin/status/userManagementPage.vue View File

@@ -1,8 +1,6 @@
1 1
 <template>
2 2
   <!-- eslint-disable max-len -->
3 3
   <div class="container">
4
-    <br />
5
-    <br />
6 4
     <br />
7 5
     <br />
8 6
     <div class="row">
@@ -10,24 +8,50 @@
10 8
         <div class="title-box-d">
11 9
           <h1 class="title-d" style="text-align:left; font-size: 250%">User Management</h1>
12 10
         </div>
13
-        <br />
14 11
       </div>
15 12
     </div>
16
-    <button @click="addNewAgent" type="button" class="btn btn-b-n">Add New Agent</button>
13
+    <div class="row">
14
+      <div class="col-md-2 offset-1">
15
+        <button type="button" class="btn btn-b-n">Private Users</button>
16
+      </div>
17
+      <div class="col-md-2 offset-2">
18
+        <button
19
+          @click="routerGoTo('/status/agentUserManagementPage')"
20
+          type="button"
21
+          class="btn btn-b-n"
22
+        >Agents</button>
23
+      </div>
24
+    </div>
17 25
     <br />
18 26
     <br />
19 27
     <div class="container">
20 28
       <table class="table table-bordered">
21 29
         <thead>
22 30
           <tr>
23
-            <th>ID</th>
24
-            <th>Name</th>
25
-            <th>Surname</th>
26
-            <th>Cell Number</th>
27
-            <th>Telephone Number</th>
28
-            <th>Email</th>
29
-            <th>Role</th>
30
-            <th>Reset Password</th>
31
+            <th>
32
+              <b>ID</b>
33
+            </th>
34
+            <th>
35
+              <b>Name</b>
36
+            </th>
37
+            <th>
38
+              <b>Surname</b>
39
+            </th>
40
+            <th>
41
+              <b>Cell Number</b>
42
+            </th>
43
+            <th>
44
+              <b>Telephone Number</b>
45
+            </th>
46
+            <th>
47
+              <b>Email</b>
48
+            </th>
49
+            <th>
50
+              <b>Role</b>
51
+            </th>
52
+            <th>
53
+              <b>Reset Password</b>
54
+            </th>
31 55
             <th></th>
32 56
             <th></th>
33 57
           </tr>
@@ -60,37 +84,6 @@
60 84
               <button type="button" class="btn" style="margin:2px; color: #60CBEB">Delete</button>
61 85
             </td>
62 86
           </tr>
63
-          <tr>
64
-            <td colspan="10">
65
-              <h5>Agents</h5>
66
-            </td>
67
-          </tr>
68
-          <tr v-for="(item, i) in agents" :key="i">
69
-            <td>{{ item.id }}</td>
70
-            <td>{{ item.name }}</td>
71
-            <td>{{ item.surname }}</td>
72
-            <td>{{ item.cellNumber }}</td>
73
-            <td>{{ item.telephone }}</td>
74
-            <td>{{ item.email }}</td>
75
-            <td v-if="item.user">{{ item.user.role }}</td>
76
-            <td v-else></td>
77
-            <td></td>
78
-            <td>
79
-              <button
80
-                type="button"
81
-                @click="Edit(item)"
82
-                class="btn"
83
-                style="margin:2px; color: #60CBEB"
84
-              >Edit</button>
85
-            </td>
86
-            <td>
87
-              <button
88
-                type="button"
89
-                class="btn"
90
-                style="width: 85px; height:40px; color:#60CBEB"
91
-              >Delete</button>
92
-            </td>
93
-          </tr>
94 87
         </tbody>
95 88
       </table>
96 89
     </div>
@@ -99,7 +92,6 @@
99 92
 </template>
100 93
 <script>
101 94
 import { mapState, mapActions } from 'vuex';
102
-import axios from 'axios';
103 95
 
104 96
 export default {
105 97
   name: 'userManagementPage',
@@ -107,20 +99,16 @@ export default {
107 99
     return {};
108 100
   },
109 101
   methods: {
110
-    ...mapActions('registerIndividual', ['getIndividuals', 'getAgents']),
111
-    addNewAgent({ commit }) {
112
-      axios
113
-        .post('/api/agent')
114
-        .then(result => commit('saveAgent', result.data))
115
-        .catch(console.error);
102
+    ...mapActions('registerIndividual', ['getIndividuals']),
103
+    routerGoTo(goTo) {
104
+      this.$router.push(goTo);
116 105
     },
117 106
   },
118 107
   mounted() {
119 108
     this.getIndividuals();
120
-    this.getAgents();
121 109
   },
122 110
   computed: {
123
-    ...mapState('registerIndividual', ['individuals', 'agents']),
111
+    ...mapState('registerIndividual', ['individuals']),
124 112
   },
125 113
 };
126 114
 </script>

+ 12
- 13
src/components/shared/navBar.vue View File

@@ -166,17 +166,6 @@
166 166
                 <a class="dropdown-item cursor-pointer" @click="routerGoTo('/Offers')">Offers</a>
167 167
               </div>
168 168
             </li>
169
-            <li v-if="isLoggedIn">
170
-              <a
171
-                class="nav-link"
172
-                @click="routerGoTo('/user/updateProfileInfo')"
173
-                id="navbarDropdown"
174
-                role="button"
175
-                data-toggle="dropdown"
176
-                aria-haspopup="true"
177
-                aria-expanded="false"
178
-              >Update Profile</a>
179
-            </li>
180 169
             <li class="nav-item dropdown" v-if="!isLoggedIn">
181 170
               <a
182 171
                 class="nav-link"
@@ -192,11 +181,10 @@
192 181
               <span>
193 182
                 <a class="nav-link" @click="logout(routerGoTo('/user/login'))">Logout</a>
194 183
               </span>
195
-              <!-- <span v-else></span> -->
196 184
             </li>
197 185
             <li>
198 186
               <span v-if="isLoggedIn">
199
-                <a>
187
+                <a @click="routerGoTo('/user/updateProfileInfo')">
200 188
                   Welcome!
201 189
                   <br />
202 190
                   {{ NAME }}
@@ -204,6 +192,17 @@
204 192
               </span>
205 193
               <span v-else></span>
206 194
             </li>
195
+            <li class="nav-item dropdown" v-if="!isLoggedIn">
196
+              <a
197
+                class="nav-link"
198
+                @click="routerGoTo('/status/agentUserManagementPage')"
199
+                id="navbarDropdown"
200
+                role="button"
201
+                data-toggle="dropdown"
202
+                aria-haspopup="true"
203
+                aria-expanded="false"
204
+              >Test</a>
205
+            </li>
207 206
           </ul>
208 207
         </div>
209 208
       </div>

+ 204
- 192
src/router/index.js View File

@@ -33,6 +33,7 @@ import tenderWeekAdminPage from '../components/admin/status/tenderWeekAdminPage.
33 33
 import userManagementPage from '../components/admin/status/userManagementPage.vue';
34 34
 import changeLogPage from '../components/admin/status/changeLogPage.vue';
35 35
 import UnitConfiguration from '../components/admin/unitConfiguration/unitConfigurationPage.vue';
36
+import agentManagementPage from '../components/admin/status/agentsUserManagementPage.vue';
36 37
 
37 38
 import ResortPage from '../components/timeshare/resort/resortPage.vue';
38 39
 import UnitPage from '../components/timeshare/resort/unitPage.vue';
@@ -57,197 +58,208 @@ export default new Router({
57 58
       y: 0,
58 59
     };
59 60
   },
60
-  routes: [{
61
-    path: '/',
62
-    name: 'Home',
63
-    component: HomePage,
64
-  },
65
-  {
66
-    path: '/about/us',
67
-    name: 'aboutus',
68
-    component: AboutUs,
69
-  },
70
-  {
71
-    path: '/about/timeshare',
72
-    name: 'abouttimeshare',
73
-    component: AboutTimeshare,
74
-  },
75
-  {
76
-    path: '/communication/template',
77
-    name: 'template',
78
-    component: TemplatePage,
79
-  },
80
-  {
81
-    path: '/timeshare/sell',
82
-    name: 'TimeshareSell',
83
-    component: TimeshareSell,
84
-  },
85
-  {
86
-    path: '/timeshare/buy',
87
-    name: 'TimeshareBuy',
88
-    component: TimeshareBuy,
89
-  },
90
-  {
91
-    path: '/timeshare/faq',
92
-    name: 'TimeshareFAQ',
93
-    component: TimeshareFAQ,
94
-  },
95
-  {
96
-    path: '/timeshare/myWeeks',
97
-    name: 'MyWeeks',
98
-    component: MyWeeksPage,
99
-  },
100
-  {
101
-    path: '/user/login',
102
-    name: 'Login',
103
-    component: Login,
104
-  },
105
-  {
106
-    path: '/user/register',
107
-    name: 'PrivateIndividual',
108
-    component: PrivateIndividual,
109
-  },
110
-  {
111
-    path: '/user/registeragency',
112
-    name: 'Agency',
113
-    component: Agency,
114
-  },
115
-  {
116
-    path: '/property/property/:id',
117
-    name: 'PropertyPage',
118
-    component: PropertyPage,
119
-  },
120
-  {
121
-    path: '/property/:propertyUsageType/search',
122
-    name: 'PropertySearch',
123
-    component: PropertySearch,
124
-  },
125
-  {
126
-    path: '/property/search',
127
-    name: 'PropertySearchTab',
128
-    component: PropertySearch,
129
-  },
130
-  {
131
-    path: '/property/new/:saleType',
132
-    name: 'PropertyNew',
133
-    component: PropertyEdit,
134
-  },
135
-  {
136
-    path: '/property/new/:propertyUsageType/:saleType',
137
-    name: 'PropertyNewFromSearch',
138
-    component: PropertyEdit,
139
-  },
140
-  {
141
-    path: '/property/edit/:id/:propType/:saleType',
142
-    name: 'PropertyEdit',
143
-    component: PropertyEdit,
144
-  },
145
-  {
146
-    path: '/property/admin/list/:by',
147
-    name: 'PropertyListAdmin',
148
-    component: PropertyList,
149
-  },
150
-  {
151
-    path: '/propertyTypes/list',
152
-    name: 'PropertyTypeList',
153
-    component: PropertyTypeList,
154
-  },
155
-  {
156
-    path: '/propertyType/new',
157
-    name: 'PropertyTypeNew',
158
-    component: PropertyType,
159
-  },
160
-  {
161
-    path: '/propertyType/:id',
162
-    name: 'PropertyTypeEdit',
163
-    component: PropertyType,
164
-  },
165
-  {
166
-    path: '/userDefinedGroups/list',
167
-    name: 'UserDefinedGroupsList',
168
-    component: UserDefinedGroups,
169
-  },
170
-  {
171
-    path: '/userDefinedGroups/userDefinedGroup/:id',
172
-    name: 'UserDefinedGroupEdit',
173
-    component: UserDefinedGroup,
174
-  },
175
-  {
176
-    path: '/userDefinedGroups/userDefinedGroup',
177
-    name: 'UserDefinedGroupNew',
178
-    component: UserDefinedGroup,
179
-  },
180
-  {
181
-    path: '/status/list',
182
-    name: 'StatusList',
183
-    component: Status,
184
-  },
185
-  {
186
-    path: '/status/timeshareAdmin',
187
-    name: 'TimeshareAdmin',
188
-    component: timeshareAdminPage,
189
-  },
190
-  {
191
-    path: '/status/tenderWeekAdmin',
192
-    name: 'TenderWeekAdmin',
193
-    component: tenderWeekAdminPage,
194
-  },
195
-  {
196
-    path: '/status/userManagementPage',
197
-    name: 'userManagementPage',
198
-    component: userManagementPage,
199
-  },
200
-  {
201
-    path: '/status/changeLogPage',
202
-    name: 'changeLogPage',
203
-    component: changeLogPage,
204
-  },
205
-  {
206
-    path: '/unitConfiguration/list',
207
-    name: 'UnitConfiguration',
208
-    component: UnitConfiguration,
209
-  },
210
-  {
211
-    path: '/contactus',
212
-    name: 'ContactUs',
213
-    component: ContactUs,
214
-  },
215
-  {
216
-    path: '/privacypolicy',
217
-    name: 'PrivacyPolicy',
218
-    component: PrivacyPolicy,
219
-  },
220
-  {
221
-    path: '/resort/:resortCode',
222
-    name: 'ResortPage',
223
-    component: ResortPage,
224
-    props: true,
225
-  },
226
-  {
227
-    path: '/resort/:resortCode/:weekId',
228
-    name: 'UnitPage',
229
-    component: UnitPage,
230
-    props: true,
231
-  },
232
-  {
233
-    path: '/MakeOffer',
234
-    name: 'MakeOffer',
235
-    component: MakeOffer,
236
-  },
237
-  {
238
-    path: '/Offers',
239
-    name: 'Offers',
240
-    component: Offer,
241
-  },
242
-  {
243
-    path: '/timeshare/search',
244
-    name: 'TimeshareSearch',
245
-    component: TimeshareSearch,
246
-  },
247
-  {
248
-    path: '/searchLog',
249
-    name: 'SearchLog',
250
-    component: searchLog,
251
-  },
61
+  routes: [
62
+    {
63
+      path: '/',
64
+      name: 'Home',
65
+      component: HomePage,
66
+    },
67
+    {
68
+      path: '/about/us',
69
+      name: 'aboutus',
70
+      component: AboutUs,
71
+    },
72
+    {
73
+      path: '/about/timeshare',
74
+      name: 'abouttimeshare',
75
+      component: AboutTimeshare,
76
+    },
77
+    {
78
+      path: '/communication/template',
79
+      name: 'template',
80
+      component: TemplatePage,
81
+    },
82
+    {
83
+      path: '/timeshare/sell',
84
+      name: 'TimeshareSell',
85
+      component: TimeshareSell,
86
+    },
87
+    {
88
+      path: '/timeshare/buy',
89
+      name: 'TimeshareBuy',
90
+      component: TimeshareBuy,
91
+    },
92
+    {
93
+      path: '/timeshare/faq',
94
+      name: 'TimeshareFAQ',
95
+      component: TimeshareFAQ,
96
+    },
97
+    {
98
+      path: '/timeshare/myWeeks',
99
+      name: 'MyWeeks',
100
+      component: MyWeeksPage,
101
+    },
102
+    {
103
+      path: '/user/login',
104
+      name: 'Login',
105
+      component: Login,
106
+    },
107
+    {
108
+      path: '/user/updateProfileInfo',
109
+      name: 'UpdateInfo',
110
+      component: UpdateInfo,
111
+    },
112
+    {
113
+      path: '/user/register',
114
+      name: 'PrivateIndividual',
115
+      component: PrivateIndividual,
116
+    },
117
+    {
118
+      path: '/user/registeragency',
119
+      name: 'Agency',
120
+      component: Agency,
121
+    },
122
+    {
123
+      path: '/property/property/:id',
124
+      name: 'PropertyPage',
125
+      component: PropertyPage,
126
+    },
127
+    {
128
+      path: '/property/:propertyUsageType/search',
129
+      name: 'PropertySearch',
130
+      component: PropertySearch,
131
+    },
132
+    {
133
+      path: '/property/search',
134
+      name: 'PropertySearchTab',
135
+      component: PropertySearch,
136
+    },
137
+    {
138
+      path: '/property/new/:saleType',
139
+      name: 'PropertyNew',
140
+      component: PropertyEdit,
141
+    },
142
+    {
143
+      path: '/property/new/:propertyUsageType/:saleType',
144
+      name: 'PropertyNewFromSearch',
145
+      component: PropertyEdit,
146
+    },
147
+    {
148
+      path: '/property/edit/:id/:propType/:saleType',
149
+      name: 'PropertyEdit',
150
+      component: PropertyEdit,
151
+    },
152
+    {
153
+      path: '/property/admin/list/:by',
154
+      name: 'PropertyListAdmin',
155
+      component: PropertyList,
156
+    },
157
+    {
158
+      path: '/propertyTypes/list',
159
+      name: 'PropertyTypeList',
160
+      component: PropertyTypeList,
161
+    },
162
+    {
163
+      path: '/propertyType/new',
164
+      name: 'PropertyTypeNew',
165
+      component: PropertyType,
166
+    },
167
+    {
168
+      path: '/propertyType/:id',
169
+      name: 'PropertyTypeEdit',
170
+      component: PropertyType,
171
+    },
172
+    {
173
+      path: '/userDefinedGroups/list',
174
+      name: 'UserDefinedGroupsList',
175
+      component: UserDefinedGroups,
176
+    },
177
+    {
178
+      path: '/userDefinedGroups/userDefinedGroup/:id',
179
+      name: 'UserDefinedGroupEdit',
180
+      component: UserDefinedGroup,
181
+    },
182
+    {
183
+      path: '/userDefinedGroups/userDefinedGroup',
184
+      name: 'UserDefinedGroupNew',
185
+      component: UserDefinedGroup,
186
+    },
187
+    {
188
+      path: '/status/list',
189
+      name: 'StatusList',
190
+      component: Status,
191
+    },
192
+    {
193
+      path: '/status/timeshareAdmin',
194
+      name: 'TimeshareAdmin',
195
+      component: timeshareAdminPage,
196
+    },
197
+    {
198
+      path: '/status/tenderWeekAdmin',
199
+      name: 'TenderWeekAdmin',
200
+      component: tenderWeekAdminPage,
201
+    },
202
+    {
203
+      path: '/status/userManagementPage',
204
+      name: 'userManagementPage',
205
+      component: userManagementPage,
206
+    },
207
+    {
208
+      path: '/status/agentUserManagementPage',
209
+      name: 'agentManagementPage',
210
+      component: agentManagementPage,
211
+    },
212
+    {
213
+      path: '/status/changeLogPage',
214
+      name: 'changeLogPage',
215
+      component: changeLogPage,
216
+    },
217
+    {
218
+      path: '/unitConfiguration/list',
219
+      name: 'UnitConfiguration',
220
+      component: UnitConfiguration,
221
+    },
222
+    {
223
+      path: '/contactus',
224
+      name: 'ContactUs',
225
+      component: ContactUs,
226
+    },
227
+    {
228
+      path: '/privacypolicy',
229
+      name: 'PrivacyPolicy',
230
+      component: PrivacyPolicy,
231
+    },
232
+    {
233
+      path: '/resort/:resortCode',
234
+      name: 'ResortPage',
235
+      component: ResortPage,
236
+      props: true,
237
+    },
238
+    {
239
+      path: '/resort/:resortCode/:weekId',
240
+      name: 'UnitPage',
241
+      component: UnitPage,
242
+      props: true,
243
+    },
244
+    {
245
+      path: '/MakeOffer',
246
+      name: 'MakeOffer',
247
+      component: MakeOffer,
248
+    },
249
+    {
250
+      path: '/Offers',
251
+      name: 'Offers',
252
+      component: Offer,
253
+    },
254
+    {
255
+      path: '/timeshare/search',
256
+      name: 'TimeshareSearch',
257
+      component: TimeshareSearch,
258
+    },
259
+    {
260
+      path: '/searchLog',
261
+      name: 'SearchLog',
262
+      component: searchLog,
263
+    },
252 264
   ],
253 265
 });

Loading…
Cancel
Save