Parcourir la source

Contact Source added and general Validation

master
Brian Conway il y a 2 ans
Parent
révision
6fd7f13027

+ 12
- 12
src/App.vue Voir le fichier

@@ -1,27 +1,27 @@
1 1
 <template>
2
-  <div id="app" style="overflow-x: hidden">
2
+  <div id="app" style="overflow-x: hidden;">
3 3
     <a v-if="!isLandingPage" href="#" class="back-to-top">
4 4
       <i class="fa fa-chevron-up"></i>
5 5
     </a>
6 6
     <div v-if="!isLandingPage" class="click-closed"></div>
7 7
     <NavBar v-if="!isLandingPage" @routerGoTo="routerGoTo" />
8 8
     <div v-if="!isLandingPage"></div>
9
-    <router-view @setLandingPage="setLandingPage" style="margin-top:140px" />
9
+    <router-view @setLandingPage="setLandingPage" style="margin-top: 140px;" />
10 10
     <FooterSection v-if="!isLandingPage" />
11 11
   </div>
12 12
 </template>
13 13
 
14 14
 <script>
15 15
 /* eslint-disable */
16
-import NavBar from "./components/shared/navBar.vue";
17
-import FooterSection from "./components/shared/footerSection.vue";
16
+import NavBar from './components/shared/navBar.vue'
17
+import FooterSection from './components/shared/footerSection.vue'
18 18
 
19 19
 export default {
20
-  name: "app",
20
+  name: 'app',
21 21
   data() {
22 22
     return {
23 23
       isLandingPage: false,
24
-    };
24
+    }
25 25
   },
26 26
   components: {
27 27
     NavBar,
@@ -30,17 +30,17 @@ export default {
30 30
 
31 31
   methods: {
32 32
     routerGoTo(goTo) {
33
-      this.$router.push(goTo);
33
+      this.$router.push(goTo)
34 34
     },
35 35
     setLandingPage(item) {
36
-      this.isLandingPage = item;
36
+      this.isLandingPage = item
37 37
     },
38 38
   },
39
-};
39
+}
40 40
 </script>
41 41
 
42 42
 <style>
43
-@import "../public/css/newStyle.css";
43
+@import '../public/css/newStyle.css';
44 44
 button:hover {
45 45
   cursor: pointer;
46 46
 }
@@ -92,7 +92,7 @@ a:hover {
92 92
   color: #60cbeb;
93 93
 }
94 94
 #app {
95
-  font-family: "Avenir", Helvetica, Arial, sans-serif;
95
+  font-family: 'Avenir', Helvetica, Arial, sans-serif;
96 96
   -webkit-font-smoothing: antialiased;
97 97
   -moz-osx-font-smoothing: grayscale;
98 98
   text-align: center;
@@ -105,7 +105,7 @@ body,
105 105
 html {
106 106
   font-size: 13.7px !important;
107 107
   color: #666;
108
-  font-family: "Roboto", sans-serif;
108
+  font-family: 'Roboto', sans-serif;
109 109
   height: 100%;
110 110
   margin: 0;
111 111
 }

+ 89
- 65
src/components/admin/misc/termsConditions.vue Voir le fichier

@@ -1,39 +1,57 @@
1 1
 <template>
2
-  <main id="main" style="padding-bottom:50px">
2
+  <main id="main" style="padding-bottom: 50px;">
3 3
     <div class="container">
4
-      <div class="row">
5
-        <div class="col">
6
-          <div class="section-header">
7
-            <h2>Terms And Conditions</h2>
8
-          </div>
9
-        </div>
10
-      </div>
11
-      <div v-if="checkAccess">
12
-        <div class="row">
13
-          <div class="col-md-6">
14
-            <label for="version" class="uniSelectLabel">Version:</label>
15
-            <input name="version" type="text" v-model="version" class="mt-5 mb-3 ml-2" />
16
-          </div>
17
-          <div class="col-md-6 mt-5">
18
-            <p style="float:right">Last Modified: {{ getModiefiedDate }}</p>
19
-          </div>
20
-        </div>
4
+      <div class="form">
21 5
         <div class="row">
22 6
           <div class="col">
23
-            <vue-editor v-model="termsInput" :editor-toolbar="customToolbar" />
7
+            <div class="section-header">
8
+              <h2>Terms And Conditions</h2>
9
+            </div>
24 10
           </div>
25 11
         </div>
26
-        <div class="row">
27
-          <div class="col-md-2 mt-3">
28
-            <button @click="saveTerms()" class="btn-solid-blue">Save</button>
12
+        <div v-if="checkAccess">
13
+          <div class="row">
14
+            <div class="col-md-6">
15
+              <label for="version" class="uniSelectLabel">Version:</label>
16
+              <input
17
+                name="version"
18
+                type="text"
19
+                v-model="version"
20
+                class="mt-5 mb-3 ml-2"
21
+              />
22
+            </div>
23
+            <div class="col-md-6 mt-5">
24
+              <p style="float: right;">Last Modified: {{ getModiefiedDate }}</p>
25
+            </div>
29 26
           </div>
30
-          <div v-if="updated" class="col mt-3">
31
-            <alert :text="'Terms and Contidtions Updated!!'" :type="'SUCCESS'" />
27
+          <div class="row">
28
+            <div class="col">
29
+              <vue-editor
30
+                v-model="termsInput"
31
+                :editor-toolbar="customToolbar"
32
+              />
33
+            </div>
34
+          </div>
35
+          <div class="row">
36
+            <div class="col-md-2 mt-3">
37
+              <button @click="saveTerms()" class="btn-white-border">
38
+                Save
39
+              </button>
40
+            </div>
41
+            <div v-if="updated" class="col mt-3">
42
+              <alert
43
+                :text="'Terms and Contidtions Updated!!'"
44
+                :type="'SUCCESS'"
45
+              />
46
+            </div>
32 47
           </div>
33 48
         </div>
34
-      </div>
35
-      <div v-else>
36
-        <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
49
+        <div v-else>
50
+          <alert
51
+            :text="'You don\'t have permission to view this page'"
52
+            :type="'ERROR'"
53
+          />
54
+        </div>
37 55
       </div>
38 56
     </div>
39 57
     <div v-if="wait" id="preloader"></div>
@@ -42,77 +60,83 @@
42 60
 
43 61
 <script>
44 62
 /* eslint-disable */
45
-import { VueEditor } from "vue2-editor";
46
-import { mapActions, mapGetters, mapState } from "vuex";
63
+import { VueEditor } from 'vue2-editor'
64
+import { mapActions, mapGetters, mapState } from 'vuex'
47 65
 
48
-import Log from "../../../assets/Log";
49
-import alert from "../../shared/alert";
66
+import Log from '../../../assets/Log'
67
+import alert from '../../shared/alert'
50 68
 
51 69
 export default {
52 70
   components: {
53 71
     VueEditor,
54
-    alert
72
+    alert,
55 73
   },
56 74
   data() {
57 75
     return {
58
-      termsInput: "",
59
-      version: "",
76
+      termsInput: '',
77
+      version: '',
60 78
       updated: false,
61 79
       wait: true,
62 80
       customToolbar: [
63 81
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
64
-        ["bold", "italic", "underline", "strike"],
82
+        ['bold', 'italic', 'underline', 'strike'],
65 83
 
66
-        [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
67
-        [{ script: "sub" }, { script: "super" }],
68
-        [{ indent: "-1" }, { indent: "+1" }]
69
-      ]
70
-    };
84
+        [{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }],
85
+        [{ script: 'sub' }, { script: 'super' }],
86
+        [{ indent: '-1' }, { indent: '+1' }],
87
+      ],
88
+    }
71 89
   },
72 90
   mounted() {
73
-    this.populateTerms();
91
+    this.populateTerms()
74 92
   },
75 93
   methods: {
76
-    ...mapActions("termsConditions", ["setTerms", "retrieveTerms"]),
94
+    ...mapActions('termsConditions', ['setTerms', 'retrieveTerms']),
77 95
     saveTerms() {
78 96
       var termsObj = {
79 97
         termsConditions: this.termsInput,
80
-        version: this.version
81
-      };
98
+        version: this.version,
99
+      }
82 100
       this.setTerms(termsObj)
83 101
         .then(() => {
84
-          this.updated = true;
85
-          this.$router.go();
102
+          this.updated = true
103
+          this.$router.go()
104
+        })
105
+        .catch((ex) => {
106
+          console.log(ex)
86 107
         })
87
-        .catch(ex => {
88
-          console.log(ex);
89
-        });
90 108
     },
91 109
     async populateTerms() {
92
-      await this.retrieveTerms();
93
-      this.version = this.terms.version;
94
-      this.termsInput = this.terms.termsConditions;
110
+      await this.retrieveTerms()
111
+      this.version = this.terms.version
112
+      this.termsInput = this.terms.termsConditions
95 113
       setTimeout(() => {
96
-        this.wait = false;
97
-      }, 500);
98
-    }
114
+        this.wait = false
115
+      }, 500)
116
+    },
99 117
   },
100 118
   computed: {
101
-    ...mapGetters("termsConditions", ["getTermsAndConditions"]),
102
-    ...mapState("termsConditions", ["terms"]),
119
+    ...mapGetters('termsConditions', ['getTermsAndConditions']),
120
+    ...mapState('termsConditions', ['terms']),
103 121
     getModiefiedDate() {
104
-      var date = new Date(this.terms.modified);
105
-      return date.getDate() + " / " + (date.getMonth() + 1) + " / " + date.getFullYear();
122
+      var date = new Date(this.terms.modified)
123
+      return (
124
+        date.getDate() +
125
+        ' / ' +
126
+        (date.getMonth() + 1) +
127
+        ' / ' +
128
+        date.getFullYear()
129
+      )
106 130
     },
107 131
     checkAccess() {
108
-      if (Log.getUser().role === "Super Admin") {
109
-        return true;
132
+      if (Log.getUser().role === 'Super Admin') {
133
+        return true
110 134
       } else {
111
-        return false;
135
+        return false
112 136
       }
113
-    }
114
-  }
115
-};
137
+    },
138
+  },
139
+}
116 140
 </script>
117 141
 
118 142
 <style lang="scss" scoped></style>

+ 29
- 26
src/components/admin/property/propertyTypeEdit.vue Voir le fichier

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <main id="main" style="margin-top:200px; padding-bottom:50px">
2
+  <main id="main" style="margin-top: 200px; padding-bottom: 50px;">
3 3
     <div class="container">
4 4
       <div class="row">
5 5
         <div class="col">
@@ -48,7 +48,10 @@
48 48
       </div>
49 49
       <div v-else class="row">
50 50
         <div class="col">
51
-          <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
51
+          <alert
52
+            :text="'You don\'t have permission to view this page'"
53
+            :type="'ERROR'"
54
+          />
52 55
         </div>
53 56
       </div>
54 57
     </div>
@@ -57,50 +60,50 @@
57 60
 
58 61
 <script>
59 62
 /* eslint-disable */
60
-import { mapState, mapActions } from "vuex";
63
+import { mapState, mapActions } from 'vuex'
61 64
 
62
-import Log from "../../../assets/Log";
63
-import alert from "../../shared/alert";
65
+import Log from '../../../assets/Log'
66
+import alert from '../../shared/alert'
64 67
 
65 68
 export default {
66
-  name: "PropertyType",
69
+  name: 'PropertyType',
67 70
   components: {
68
-    alert
71
+    alert,
69 72
   },
70 73
   mounted() {
71
-    this.clearPropertyType();
74
+    this.clearPropertyType()
72 75
     if (this.$route.params.id > 0) {
73
-      this.getPropertyType(this.$route.params.id);
76
+      this.getPropertyType(this.$route.params.id)
74 77
     }
75 78
   },
76 79
   computed: {
77
-    ...mapState("propertyTypes", ["propertyType"]),
80
+    ...mapState('propertyTypes', ['propertyType']),
78 81
     checkAccess() {
79
-      if (Log.getUser().role === "Super Admin") {
80
-        return true;
82
+      if (Log.getUser().role === 'Super Admin') {
83
+        return true
81 84
       } else {
82
-        return false;
85
+        return false
83 86
       }
84
-    }
87
+    },
85 88
   },
86 89
   methods: {
87
-    ...mapActions("propertyTypes", [
88
-      "getPropertyType",
89
-      "savePropertyType",
90
-      "updatePropertyType",
91
-      "clearPropertyType"
90
+    ...mapActions('propertyTypes', [
91
+      'getPropertyType',
92
+      'savePropertyType',
93
+      'updatePropertyType',
94
+      'clearPropertyType',
92 95
     ]),
93 96
     SubmitData() {
94 97
       if (this.propertyType.id > 0) {
95
-        this.updatePropertyType(this.propertyType);
98
+        this.updatePropertyType(this.propertyType)
96 99
       } else {
97
-        this.savePropertyType(this.propertyType);
100
+        this.savePropertyType(this.propertyType)
98 101
       }
99
-      this.$router.push("/propertyTypes/list");
102
+      this.$router.push('/propertyTypes/list')
100 103
     },
101 104
     Close() {
102
-      this.$router.push("/propertyTypes/list");
103
-    }
104
-  }
105
-};
105
+      this.$router.push('/propertyTypes/list')
106
+    },
107
+  },
108
+}
106 109
 </script>

+ 27
- 24
src/components/admin/property/propertyTypeList.vue Voir le fichier

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <!-- eslint-disable max-len -->
3
-  <main id="main" style="margin-top:-20px; padding-bottom: 50px">
3
+  <main id="main" style="margin-top: -20px; padding-bottom: 50px;">
4 4
     <div class="container">
5 5
       <div class="row">
6 6
         <div class="col-md-12 col-lg-8">
@@ -26,7 +26,10 @@
26 26
       </div>
27 27
       <div v-else class="row">
28 28
         <div class="col">
29
-          <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
29
+          <alert
30
+            :text="'You don\'t have permission to view this page'"
31
+            :type="'ERROR'"
32
+          />
30 33
         </div>
31 34
       </div>
32 35
     </div>
@@ -35,49 +38,49 @@
35 38
 
36 39
 <script>
37 40
 /* eslint-disable */
38
-import { mapState, mapActions } from "vuex";
41
+import { mapState, mapActions } from 'vuex'
39 42
 
40
-import Log from "../../../assets/Log";
41
-import alert from "../../shared/alert";
42
-import listView from "../../shared/listView.vue";
43
+import Log from '../../../assets/Log'
44
+import alert from '../../shared/alert'
45
+import listView from '../../shared/listView.vue'
43 46
 
44 47
 export default {
45
-  name: "PropertyTypeList",
48
+  name: 'PropertyTypeList',
46 49
   components: {
47 50
     listView,
48
-    alert
51
+    alert,
49 52
   },
50 53
   data() {
51 54
     return {
52
-      columns: ["propertyUsageType", "description"]
53
-    };
55
+      columns: ['propertyUsageType', 'description'],
56
+    }
54 57
   },
55 58
   methods: {
56
-    ...mapActions("propertyTypes", ["getPropertyTypes", "deletePropertyType"]),
59
+    ...mapActions('propertyTypes', ['getPropertyTypes', 'deletePropertyType']),
57 60
     New() {
58
-      this.$router.push("/propertyType/new");
61
+      this.$router.push('/propertyType/new')
59 62
     },
60 63
     Edit(item) {
61 64
       this.$router.push({
62
-        path: `/propertyType/${item.id}`
63
-      });
65
+        path: `/propertyType/${item.id}`,
66
+      })
64 67
     },
65 68
     Delete(item) {
66
-      this.deletePropertyType(item.id);
67
-    }
69
+      this.deletePropertyType(item.id)
70
+    },
68 71
   },
69 72
   mounted() {
70
-    this.getPropertyTypes();
73
+    this.getPropertyTypes()
71 74
   },
72 75
   computed: {
73
-    ...mapState("propertyTypes", ["propertyTypes"]),
76
+    ...mapState('propertyTypes', ['propertyTypes']),
74 77
     checkAccess() {
75
-      if (Log.getUser().role === "Super Admin") {
76
-        return true;
78
+      if (Log.getUser().role === 'Super Admin') {
79
+        return true
77 80
       } else {
78
-        return false;
81
+        return false
79 82
       }
80
-    }
81
-  }
82
-};
83
+    },
84
+  },
85
+}
83 86
 </script>

+ 57
- 43
src/components/communication/contactUsLog.vue Voir le fichier

@@ -1,34 +1,39 @@
1 1
 <template>
2 2
   <div v-if="!boolLoaded" id="preloader"></div>
3
-  <main v-else id="main" style="margin-top:-20px; padding-bottom:50px">
3
+  <main v-else id="main" style="margin-top: -20px; padding-bottom: 50px;">
4 4
     <div class="container">
5
-      <div class="row">
6
-        <div class="col">
7
-          <div class="section-header">
8
-            <h2>Contact Us Log</h2>
5
+      <div class="form">
6
+        <div class="row">
7
+          <div class="col">
8
+            <div class="section-header">
9
+              <h2>Contact Us Log</h2>
10
+            </div>
9 11
           </div>
10 12
         </div>
11
-      </div>
12
-      <div v-if="checkAccess">
13
-        <div class="container">
14
-          <div class="row">
15
-            <div class="col-md-12">
16
-              <ListView
17
-                :items="contactUsLog"
18
-                :showColumnChooser="false"
19
-                :hideSearch="false"
20
-                :compact="false"
21
-                :showNew="false"
22
-                :editable="false"
23
-                :deleteable="false"
24
-                :displayColumns="columns"
25
-              />
13
+        <div v-if="checkAccess">
14
+          <div class="container">
15
+            <div class="row">
16
+              <div class="col-md-12">
17
+                <ListView
18
+                  :items="contactUsLog"
19
+                  :showColumnChooser="false"
20
+                  :hideSearch="false"
21
+                  :compact="false"
22
+                  :showNew="false"
23
+                  :editable="false"
24
+                  :deleteable="false"
25
+                  :displayColumns="columns"
26
+                />
27
+              </div>
26 28
             </div>
27 29
           </div>
28 30
         </div>
29
-      </div>
30
-      <div v-else>
31
-        <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
31
+        <div v-else>
32
+          <alert
33
+            :text="'You don\'t have permission to view this page'"
34
+            :type="'ERROR'"
35
+          />
36
+        </div>
32 37
       </div>
33 38
     </div>
34 39
   </main>
@@ -36,46 +41,55 @@
36 41
 
37 42
 <script>
38 43
 /* eslint-disable */
39
-import { mapActions, mapState } from "vuex";
40
-import Log from "../../assets/Log";
41
-import alert from "../shared/alert.vue";
42
-import ListView from "../shared/listView";
44
+import { mapActions, mapState } from 'vuex'
45
+import Log from '../../assets/Log'
46
+import alert from '../shared/alert.vue'
47
+import ListView from '../shared/listView'
43 48
 
44 49
 export default {
45 50
   components: {
46 51
     ListView,
47
-    alert
52
+    alert,
48 53
   },
49 54
   data() {
50 55
     return {
51 56
       boolLoaded: false,
52
-      columns: ["id", "created", "name", "email", "phone", "message", "heardFrom", "error"]
53
-    };
57
+      columns: [
58
+        'id',
59
+        'created',
60
+        'name',
61
+        'email',
62
+        'phone',
63
+        'message',
64
+        'mailSource',
65
+        'error',
66
+      ],
67
+    }
54 68
   },
55 69
   methods: {
56
-    ...mapActions("template", ["getContactUsLog"]),
70
+    ...mapActions('template', ['getContactUsLog']),
57 71
     async loadData() {
58
-      await this.getContactUsLog();
59
-    }
72
+      await this.getContactUsLog()
73
+    },
60 74
   },
61 75
   mounted() {
62 76
     this.loadData().then(() => {
63 77
       setTimeout(() => {
64
-        this.boolLoaded = true;
65
-      }, 100);
66
-    });
78
+        this.boolLoaded = true
79
+      }, 100)
80
+    })
67 81
   },
68 82
   computed: {
69
-    ...mapState("template", ["contactUsLog"]),
83
+    ...mapState('template', ['contactUsLog']),
70 84
     checkAccess() {
71
-      if (Log.getUser().role === "Super Admin") {
72
-        return true;
85
+      if (Log.getUser().role === 'Super Admin') {
86
+        return true
73 87
       } else {
74
-        return false;
88
+        return false
75 89
       }
76
-    }
77
-  }
78
-};
90
+    },
91
+  },
92
+}
79 93
 </script>
80 94
 
81 95
 <style lang="scss" scoped></style>

+ 150
- 0
src/components/communication/contactUsSource.vue Voir le fichier

@@ -0,0 +1,150 @@
1
+<template>
2
+  <main id="main" style="margin-top: 200px; padding-bottom: 50px;">
3
+    <div class="container">
4
+      <div class="form">
5
+        <div class="row">
6
+          <div class="col">
7
+            <div class="section-header">
8
+              <h2>Contact Us Source</h2>
9
+            </div>
10
+          </div>
11
+        </div>
12
+        <div v-if="checkAccess" class="row mb-3">
13
+          <div class="col-md-12">
14
+            <form id="mainForm">
15
+              <div class="form-group row">
16
+                <div class="col-md-4">
17
+                  <float-label fixed label="Description">
18
+                    <input
19
+                      class="form-control"
20
+                      type="text"
21
+                      name="description"
22
+                      id="description"
23
+                      v-model="contactUsSource.description"
24
+                      v-bind:class="{
25
+                        'is-valid': contactUsSource.description,
26
+                        'is-invalid':
27
+                          !requiredField(contactUsSource.description) &&
28
+                          descriptionLoad,
29
+                      }"
30
+                      v-on:keyup="descriptionLoad = true"
31
+                      v-on:blur="descriptionLoad = true"
32
+                    />
33
+                    <div class="invalid-feedback">Description is Required!</div>
34
+                  </float-label>
35
+                </div>
36
+              </div>
37
+            </form>
38
+          </div>
39
+          <div class="col-md-12">
40
+            <button
41
+              type="button"
42
+              @click="SubmitData()"
43
+              class="btn-white-border"
44
+            >
45
+              Save
46
+            </button>
47
+            <button type="button" @click="Close()" class="btn-white-border">
48
+              Close
49
+            </button>
50
+          </div>
51
+        </div>
52
+        <div v-else class="row">
53
+          <div class="col">
54
+            <alert
55
+              :text="'You don\'t have permission to view this page'"
56
+              :type="'ERROR'"
57
+            />
58
+          </div>
59
+        </div>
60
+      </div>
61
+    </div>
62
+  </main>
63
+</template>
64
+
65
+<script>
66
+/* eslint-disable */
67
+import { mapState, mapActions } from 'vuex'
68
+
69
+import Log from '../../assets/Log'
70
+import alert from '../shared/alert'
71
+
72
+export default {
73
+  name: 'ContactUsSource',
74
+  data() {
75
+    return {
76
+      errorOccurred: '',
77
+      errorMessage: '',
78
+      boolMessage: false,
79
+      boolValidationError: false,
80
+      descriptionLoad: false,
81
+    }
82
+  },
83
+  components: {
84
+    alert,
85
+  },
86
+  mounted() {
87
+    this.clearContactUsSource()
88
+    if (this.$route.params.id > 0) {
89
+      console.log(this.$route.params.id)
90
+      this.getContactUsSource(this.$route.params.id)
91
+      console.log(this.contactUsSource.description)
92
+    }
93
+  },
94
+  computed: {
95
+    ...mapState('contactUsSources', ['contactUsSource']),
96
+    checkAccess() {
97
+      if (Log.getUser().role === 'Super Admin') {
98
+        return true
99
+      } else {
100
+        return false
101
+      }
102
+    },
103
+  },
104
+  methods: {
105
+    ...mapActions('contactUsSources', [
106
+      'getContactUsSource',
107
+      'saveContactUsSource',
108
+      'updateContactUsSource',
109
+      'clearContactUsSource',
110
+    ]),
111
+    SubmitData() {
112
+      console.log('SubmitData')
113
+      if (this.contactUsSource.id > 0) {
114
+        this.updateContactUsSource(this.contactUsSource)
115
+      } else {
116
+        this.saveContactUsSource(this.contactUsSource)
117
+      }
118
+      this.$router.push('/contactUsSource/list')
119
+    },
120
+    Close() {
121
+      this.$router.push('/contactUsSource/list')
122
+    },
123
+    requiredField: function (tfield) {
124
+      if (tfield) {
125
+        return true
126
+      } else {
127
+        return false
128
+      }
129
+    },
130
+    validatePage: function () {
131
+      console.log('validatePage')
132
+      if (this.contactUsSource.description) {
133
+        console.log('passed')
134
+        this.errorOccurred = ''
135
+        this.errorMessage = ''
136
+        this.boolValidationError = false
137
+        return true
138
+      } else {
139
+        console.log('failed')
140
+        this.descriptionLoad = true
141
+        this.surnameLoad = true
142
+        this.boolValidationError = true
143
+        this.errorOccurred = 'ERROR'
144
+        this.errorMessage = 'Please check form and correct all input fields!'
145
+        return false
146
+      }
147
+    },
148
+  },
149
+}
150
+</script>

+ 93
- 0
src/components/communication/contactUsSourceList.vue Voir le fichier

@@ -0,0 +1,93 @@
1
+<template>
2
+  <!-- eslint-disable max-len -->
3
+  <main id="main" style="margin-top: -20px; padding-bottom: 50px;">
4
+    <div class="container">
5
+      <div class="form">
6
+        <div class="row">
7
+          <div class="col-md-12 col-lg-8">
8
+            <div class="section-header">
9
+              <h2>Contact Us Sources</h2>
10
+            </div>
11
+          </div>
12
+        </div>
13
+        <div v-if="checkAccess" class="row">
14
+          <div class="col">
15
+            <listView
16
+              :items="contactUsSources"
17
+              :showNew="true"
18
+              :editable="true"
19
+              :deleteable="true"
20
+              :displayColumns="columns"
21
+              :sortKey="'description'"
22
+              @onEdit="Edit"
23
+              @onDelete="Delete"
24
+              @onNew="New"
25
+            />
26
+          </div>
27
+        </div>
28
+        <div v-else class="row">
29
+          <div class="col">
30
+            <alert
31
+              :text="'You don\'t have permission to view this page'"
32
+              :type="'ERROR'"
33
+            />
34
+          </div>
35
+        </div>
36
+      </div>
37
+    </div>
38
+  </main>
39
+</template>
40
+
41
+<script>
42
+/* eslint-disable */
43
+import { mapState, mapActions } from 'vuex'
44
+
45
+import Log from '../../assets/Log'
46
+import alert from '../shared/alert'
47
+import listView from '../shared/listView.vue'
48
+
49
+export default {
50
+  name: 'ContactUsSourceList',
51
+  components: {
52
+    listView,
53
+    alert,
54
+  },
55
+  data() {
56
+    return {
57
+      columns: ['description'],
58
+    }
59
+  },
60
+  methods: {
61
+    ...mapActions('contactUsSources', [
62
+      'getContactUsSources',
63
+      'deleteContactUsSource',
64
+    ]),
65
+    selectSource() {},
66
+    New() {
67
+      this.$router.push('/contactUsSource/new')
68
+    },
69
+    Edit(item) {
70
+      this.$router.push({
71
+        path: `/contactUsSource/${item.id}`,
72
+      })
73
+    },
74
+    Delete(item) {
75
+      console.log('Delete')
76
+      this.deleteContactUsSource(item.id)
77
+    },
78
+  },
79
+  mounted() {
80
+    this.getContactUsSources()
81
+  },
82
+  computed: {
83
+    ...mapState('contactUsSources', ['contactUsSources']),
84
+    checkAccess() {
85
+      if (Log.getUser().role === 'Super Admin') {
86
+        return true
87
+      } else {
88
+        return false
89
+      }
90
+    },
91
+  },
92
+}
93
+</script>

+ 179
- 142
src/components/communication/editEmailTemplate.vue Voir le fichier

@@ -1,138 +1,175 @@
1 1
 <template>
2
-  <main id="main" style="margin-top:200px; padding-bottom:50px">
2
+  <main id="main" style="margin-top: 200px; padding-bottom: 50px;">
3 3
     <div class="container">
4
-      <div class="row">
5
-        <div class="col">
6
-          <div class="section-header">
7
-            <h2>Edit Template</h2>
4
+      <div class="form">
5
+        <div class="row">
6
+          <div class="col">
7
+            <div class="section-header">
8
+              <h2>Edit Template</h2>
9
+            </div>
8 10
           </div>
9 11
         </div>
10
-      </div>
11
-      <div class="row">
12
-        <div class="col">
13
-          <float-label fixed label="USAGE">
14
-            <select v-model="singleTemp.name" class="form-control uniSelect" name="" id="">
15
-              <option value="WeekOfferMade-User">Timeshare Week Offer Made (User)</option>
16
-              <option value="WeekOfferMade-Owner">Timeshare Week Offer Made (Admin)</option>
17
-              <option value="WeekLoaded-Agent">Timeshare Week Listed (Agent)</option>
18
-              <option value="WeekLoaded-Owner">Timeshare Week Listed (Owner)</option>
19
-              <option value="ContactUs">Contact Us (Admin)</option>
20
-              <option value="EnquireNow">Enquire Now (Admin)</option>
21
-            </select>
22
-          </float-label>
23
-        </div>
24
-        <div class="col">
25
-          <float-label fixed label="SUBJECT">
26
-            <input type="text" class="form-control uniInput" v-model="singleTemp.subject" />
27
-          </float-label>
28
-        </div>
29
-      </div>
30
-      <div class="row mt-5">
31
-        <div class="col-md-12">
32
-          <ul class="nav nav-tabs nav-justified" id="myTab" role="tablist">
33
-            <li class="nav-item">
34
-              <a
35
-                class="nav-link active"
36
-                id="html-tab"
37
-                data-toggle="tab"
38
-                href="#html"
39
-                role="tab"
40
-                aria-controls="html"
41
-                aria-selected="false"
42
-                ><h2>
43
-                  html
44
-                </h2></a
45
-              >
46
-            </li>
47
-            <li class="nav-item">
48
-              <a
49
-                class="nav-link"
50
-                id="preview-tab"
51
-                data-toggle="tab"
52
-                href="#preview"
53
-                role="tab"
54
-                aria-controls="preview"
55
-                aria-selected="true"
56
-                ><h2>
57
-                  Preview
58
-                </h2></a
12
+        <div class="row">
13
+          <div class="col">
14
+            <float-label fixed label="USAGE">
15
+              <select
16
+                v-model="singleTemp.name"
17
+                class="form-control uniSelect"
18
+                name=""
19
+                id=""
59 20
               >
60
-            </li>
61
-          </ul>
62
-          <div class="tab-content" id="myTabContent">
63
-            <div class="row mt-5">
64
-              <div class="col-md-10 mt-3">
65
-                <float-label fixed label="DYNAMIC FIELD">
66
-                  <select v-model="selectedProperty" class="form-control uniSelect" name="" id="">
67
-                    <optgroup label="Resort Fields">
68
-                      <option value="[RESORTNAME]">Resort Name</option>
69
-                      <option value="[UNITNUMBER]">Unit Number</option>
70
-                      <option value="[MODULE]">Module</option>
71
-                      <option value="[RESORTPRICE]">Resort Price</option>
72
-                      <option value="[RESORTSEASON]">Resort Season</option>
73
-                      <option value="[RESORTLEVY]">Resort Levy</option>
74
-                      <option value="[OFFERMADE]">Offer Made</option>
75
-                      <option value="[OWNER]">OWNER</option>
76
-                    </optgroup>
77
-                    <optgroup label="Property Fields">
78
-                      <option value="[PROPERTYREF]">Property Ref</option>
79
-                      <option value="[PROPERTYNAME]">Property Name</option>
80
-                      <option value="[PROPERTYPRICE]">Property Price</option>
81
-                      <option value="[PROPERTYID]">Property ID</option>
82
-                    </optgroup>
83
-                    <optgroup label="User Fields">
84
-                      <option value="[FULLNAME]">Fullname</option>
85
-                      <option value="[USEREMAIL]">User Email</option>
86
-                      <option value="[USERCELLPHONE]">User Cellphone Number</option>
87
-                      <option value="[USERTELEPHONE]">User Telephone Number</option>
88
-                      <option value="[USERCOMMENT]">User Comment</option>
89
-                      <option value="[USERMESSAGE]">User Message</option>
90
-                    </optgroup>
91
-                  </select>
92
-                </float-label>
93
-              </div>
94
-              <div class="col">
95
-                <button class="btn-solid-blue" @click="onItemAdd">INSERT</button>
21
+                <option value="WeekOfferMade-User">
22
+                  Timeshare Week Offer Made (User)
23
+                </option>
24
+                <option value="WeekOfferMade-Owner">
25
+                  Timeshare Week Offer Made (Admin)
26
+                </option>
27
+                <option value="WeekLoaded-Agent">
28
+                  Timeshare Week Listed (Agent)
29
+                </option>
30
+                <option value="WeekLoaded-Owner">
31
+                  Timeshare Week Listed (Owner)
32
+                </option>
33
+                <option value="ContactUs">Contact Us (Admin)</option>
34
+                <option value="EnquireNow">Enquire Now (Admin)</option>
35
+              </select>
36
+            </float-label>
37
+          </div>
38
+          <div class="col">
39
+            <float-label fixed label="SUBJECT">
40
+              <input
41
+                type="text"
42
+                class="form-control uniInput"
43
+                v-model="singleTemp.subject"
44
+              />
45
+            </float-label>
46
+          </div>
47
+        </div>
48
+        <div class="row mt-5">
49
+          <div class="col-md-12">
50
+            <ul class="nav nav-tabs nav-justified" id="myTab" role="tablist">
51
+              <li class="nav-item">
52
+                <a
53
+                  class="nav-link active"
54
+                  id="html-tab"
55
+                  data-toggle="tab"
56
+                  href="#html"
57
+                  role="tab"
58
+                  aria-controls="html"
59
+                  aria-selected="false"
60
+                >
61
+                  <h2>
62
+                    html
63
+                  </h2>
64
+                </a>
65
+              </li>
66
+              <li class="nav-item">
67
+                <a
68
+                  class="nav-link"
69
+                  id="preview-tab"
70
+                  data-toggle="tab"
71
+                  href="#preview"
72
+                  role="tab"
73
+                  aria-controls="preview"
74
+                  aria-selected="true"
75
+                >
76
+                  <h2>
77
+                    Preview
78
+                  </h2>
79
+                </a>
80
+              </li>
81
+            </ul>
82
+            <div class="tab-content" id="myTabContent">
83
+              <div class="row mt-5">
84
+                <div class="col-md-10 mt-3">
85
+                  <float-label fixed label="DYNAMIC FIELD">
86
+                    <select
87
+                      v-model="selectedProperty"
88
+                      class="form-control uniSelect"
89
+                      name=""
90
+                      id=""
91
+                    >
92
+                      <optgroup label="Resort Fields">
93
+                        <option value="[RESORTNAME]">Resort Name</option>
94
+                        <option value="[UNITNUMBER]">Unit Number</option>
95
+                        <option value="[MODULE]">Module</option>
96
+                        <option value="[RESORTPRICE]">Resort Price</option>
97
+                        <option value="[RESORTSEASON]">Resort Season</option>
98
+                        <option value="[RESORTLEVY]">Resort Levy</option>
99
+                        <option value="[OFFERMADE]">Offer Made</option>
100
+                        <option value="[OWNER]">OWNER</option>
101
+                      </optgroup>
102
+                      <optgroup label="Property Fields">
103
+                        <option value="[PROPERTYREF]">Property Ref</option>
104
+                        <option value="[PROPERTYNAME]">Property Name</option>
105
+                        <option value="[PROPERTYPRICE]">Property Price</option>
106
+                        <option value="[PROPERTYID]">Property ID</option>
107
+                      </optgroup>
108
+                      <optgroup label="User Fields">
109
+                        <option value="[FULLNAME]">Fullname</option>
110
+                        <option value="[USEREMAIL]">User Email</option>
111
+                        <option value="[USERCELLPHONE]">
112
+                          User Cellphone Number
113
+                        </option>
114
+                        <option value="[USERTELEPHONE]">
115
+                          User Telephone Number
116
+                        </option>
117
+                        <option value="[USERCOMMENT]">User Comment</option>
118
+                        <option value="[USERMESSAGE]">User Message</option>
119
+                      </optgroup>
120
+                    </select>
121
+                  </float-label>
122
+                </div>
123
+                <div class="col">
124
+                  <button class="btn-solid-blue" @click="onItemAdd">
125
+                    INSERT
126
+                  </button>
127
+                </div>
96 128
               </div>
97
-            </div>
98
-            <div
99
-              class="tab-pane fade show active mt-4"
100
-              style="background-color:rgba(255,255,255,0.75);padding:10px;"
101
-              id="html"
102
-              role="tabpanel"
103
-              aria-labelledby="directions-tab"
104
-            >
105
-              <div class="text-left">
106
-                <div class="input-group mb-3">
107
-                  <textarea
108
-                    id="bodyInput"
109
-                    class="form-control"
110
-                    type="text"
111
-                    rows="40"
112
-                    step="any"
113
-                    name="levy"
114
-                    v-model="singleTemp.body"
115
-                  />
129
+              <div
130
+                class="tab-pane fade show active mt-4"
131
+                style="
132
+                  background-color: rgba(255, 255, 255, 0.75);
133
+                  padding: 10px;
134
+                "
135
+                id="html"
136
+                role="tabpanel"
137
+                aria-labelledby="directions-tab"
138
+              >
139
+                <div class="text-left">
140
+                  <div class="input-group mb-3">
141
+                    <textarea
142
+                      id="bodyInput"
143
+                      class="form-control"
144
+                      type="text"
145
+                      rows="40"
146
+                      step="any"
147
+                      name="levy"
148
+                      v-model="singleTemp.body"
149
+                    />
150
+                  </div>
116 151
                 </div>
117 152
               </div>
118
-            </div>
119
-            <div
120
-              class="tab-pane fade mt-4"
121
-              id="preview"
122
-              role="tabpanel"
123
-              aria-labelledby="resort-layout-tab"
124
-            >
125
-              <div class="no-style" v-html="singleTemp.body"></div>
153
+              <div
154
+                class="tab-pane fade mt-4"
155
+                id="preview"
156
+                role="tabpanel"
157
+                aria-labelledby="resort-layout-tab"
158
+              >
159
+                <div class="no-style" v-html="singleTemp.body"></div>
160
+              </div>
126 161
             </div>
127 162
           </div>
128 163
         </div>
129
-      </div>
130
-      <div class="row mt-4">
131
-        <div class="col">
132
-          <button class="btn-solid-blue" @click="sendToApi()">UPDATE</button>
133
-        </div>
134
-        <div class="col">
135
-          <button class="btn-solid-blue" @click="$router.go(-1)">CANCEL</button>
164
+        <div class="row mt-4">
165
+          <div class="col">
166
+            <button class="btn-solid-blue" @click="sendToApi()">UPDATE</button>
167
+          </div>
168
+          <div class="col">
169
+            <button class="btn-solid-blue" @click="$router.go(-1)">
170
+              CANCEL
171
+            </button>
172
+          </div>
136 173
         </div>
137 174
       </div>
138 175
     </div>
@@ -141,49 +178,49 @@
141 178
 
142 179
 <script>
143 180
 /* eslint-disable */
144
-import { mapActions, mapState } from "vuex";
181
+import { mapActions, mapState } from 'vuex'
145 182
 
146
-import alert from "../shared/alert";
183
+import alert from '../shared/alert'
147 184
 export default {
148 185
   data() {
149 186
     return {
150
-      selectedProperty: ""
151
-    };
187
+      selectedProperty: '',
188
+    }
152 189
   },
153 190
   components: {
154
-    alert
191
+    alert,
155 192
   },
156 193
   created() {
157 194
     this.getSingleTemplate(this.$route.params.id).then(() => {
158
-      console.log(this.recipient);
159
-    });
195
+      console.log(this.recipient)
196
+    })
160 197
   },
161 198
   computed: {
162
-    ...mapState("template", ["singleTemp"])
199
+    ...mapState('template', ['singleTemp']),
163 200
   },
164 201
   methods: {
165
-    ...mapActions("template", ["getSingleTemplate", "editItem"]),
202
+    ...mapActions('template', ['getSingleTemplate', 'editItem']),
166 203
     sendToApi() {
167 204
       this.editItem(this.singleTemp)
168 205
         .then(() => this.$router.go(-1))
169
-        .catch(ex => console.log(ex));
206
+        .catch((ex) => console.log(ex))
170 207
     },
171 208
     onItemAdd() {
172
-      var placeHolder = this.selectedProperty;
209
+      var placeHolder = this.selectedProperty
173 210
       // will give the current postion of the cursor
174
-      var curPos = document.getElementById("bodyInput").selectionStart;
211
+      var curPos = document.getElementById('bodyInput').selectionStart
175 212
 
176 213
       // will get the value of the text area
177
-      let x = $("#bodyInput").val();
214
+      let x = $('#bodyInput').val()
178 215
 
179 216
       // will get the value of the input box
180
-      let text_to_insert = placeHolder;
217
+      let text_to_insert = placeHolder
181 218
 
182 219
       // setting the updated value in the text area
183
-      $("#bodyInput").val(x.slice(0, curPos) + text_to_insert + x.slice(curPos));
184
-    }
185
-  }
186
-};
220
+      $('#bodyInput').val(x.slice(0, curPos) + text_to_insert + x.slice(curPos))
221
+    },
222
+  },
223
+}
187 224
 </script>
188 225
 
189 226
 <style lang="scss" scoped>

+ 86
- 71
src/components/communication/emailRecipientNew.vue Voir le fichier

@@ -1,58 +1,73 @@
1 1
 <template>
2
-  <main id="main" style="margin-top:200px; padding-bottom:50px">
2
+  <main id="main" style="margin-top: 200px; padding-bottom: 50px;">
3 3
     <div class="container">
4
-      <div class="row">
5
-        <div class="col">
6
-          <div class="section-header">
7
-            <h2>New Email Recipient</h2>
4
+      <div class="form">
5
+        <div class="row">
6
+          <div class="col">
7
+            <div class="section-header">
8
+              <h2>New Email Recipient</h2>
9
+            </div>
8 10
           </div>
9 11
         </div>
10
-      </div>
11
-      <div class="row mb-5">
12
-        <div class="col">
13
-          <alert :text="alertMessage" :type="alertState" />
14
-        </div>
15
-      </div>
16
-      <div class="row">
17
-        <div class="col">
18
-          <float-label>
19
-            <input
20
-              v-model="recipient.recipientName"
21
-              type="text"
22
-              class="form-control uniInput"
23
-              placeholder="RECIPIENT NAME"
24
-            />
25
-          </float-label>
26
-        </div>
27
-        <div class="col">
28
-          <float-label>
29
-            <input
30
-              v-model="recipient.recipientMail"
31
-              type="text"
32
-              class="form-control uniInput"
33
-              placeholder="RECIPIENT EMAIL"
34
-            />
35
-          </float-label>
36
-        </div>
37
-        <div class="col">
38
-          <float-label fixed label="USAGE">
39
-            <select v-model="recipient.recipientUsage" class="form-control uniSelect">
40
-              <option value="ContactUs">Contact Us</option>
41
-              <option value="EnquireNow">Enquire Now</option>
42
-              <option value="WeekOfferMade-User">Timeshare Week Offer Made (User)</option>
43
-              <option value="WeekOfferMade-Owner">Timeshare Week Offer Made (Admin)</option>
44
-              <option value="WeekLoaded-Agent">Timeshare Week Listed (Agent)</option>
45
-              <option value="WeekLoaded-Owner">Timeshare Week Listed (Owner)</option>
46
-            </select>
47
-          </float-label>
12
+        <div class="row mb-5">
13
+          <div class="col">
14
+            <alert :text="alertMessage" :type="alertState" />
15
+          </div>
48 16
         </div>
49
-      </div>
50
-      <div class="row mt-4">
51
-        <div class="col">
52
-          <button class="btn-solid-blue" @click="sendToApi()">SAVE</button>
17
+        <div class="row">
18
+          <div class="col">
19
+            <float-label>
20
+              <input
21
+                v-model="recipient.recipientName"
22
+                type="text"
23
+                class="form-control uniInput"
24
+                placeholder="RECIPIENT NAME"
25
+              />
26
+            </float-label>
27
+          </div>
28
+          <div class="col">
29
+            <float-label>
30
+              <input
31
+                v-model="recipient.recipientMail"
32
+                type="text"
33
+                class="form-control uniInput"
34
+                placeholder="RECIPIENT EMAIL"
35
+              />
36
+            </float-label>
37
+          </div>
38
+          <div class="col">
39
+            <float-label fixed label="USAGE">
40
+              <select
41
+                v-model="recipient.recipientUsage"
42
+                class="form-control uniSelect"
43
+              >
44
+                <option value="ContactUs">Contact Us</option>
45
+                <option value="EnquireNow">Enquire Now</option>
46
+                <option value="WeekOfferMade-User">
47
+                  Timeshare Week Offer Made (User)
48
+                </option>
49
+                <option value="WeekOfferMade-Owner">
50
+                  Timeshare Week Offer Made (Admin)
51
+                </option>
52
+                <option value="WeekLoaded-Agent">
53
+                  Timeshare Week Listed (Agent)
54
+                </option>
55
+                <option value="WeekLoaded-Owner">
56
+                  Timeshare Week Listed (Owner)
57
+                </option>
58
+              </select>
59
+            </float-label>
60
+          </div>
53 61
         </div>
54
-        <div class="col">
55
-          <router-link class="btn-solid-blue" to="/emailRecipient">CANCEL</router-link>
62
+        <div class="row mt-4">
63
+          <div class="col">
64
+            <button class="btn-solid-blue" @click="sendToApi()">SAVE</button>
65
+          </div>
66
+          <div class="col">
67
+            <router-link class="btn-solid-blue" to="/emailRecipient">
68
+              CANCEL
69
+            </router-link>
70
+          </div>
56 71
         </div>
57 72
       </div>
58 73
     </div>
@@ -61,47 +76,47 @@
61 76
 
62 77
 <script>
63 78
 /* eslint-disable */
64
-import { mapActions } from "vuex";
65
-import alert from "../shared/alert";
79
+import { mapActions } from 'vuex'
80
+import alert from '../shared/alert'
66 81
 
67 82
 export default {
68 83
   components: {
69
-    alert
84
+    alert,
70 85
   },
71 86
   data() {
72 87
     return {
73 88
       recipient: {
74
-        recipientName: "",
75
-        recipientMail: "",
76
-        recipientUsage: ""
89
+        recipientName: '',
90
+        recipientMail: '',
91
+        recipientUsage: '',
77 92
       },
78
-      alertMessage: "",
79
-      alertState: ""
80
-    };
93
+      alertMessage: '',
94
+      alertState: '',
95
+    }
81 96
   },
82 97
   methods: {
83
-    ...mapActions("template", ["addMailRecipient"]),
98
+    ...mapActions('template', ['addMailRecipient']),
84 99
     sendToApi() {
85 100
       if (this.checkEmail(this.recipient.recipientMail)) {
86
-        if (this.recipient.recipientUsage != "") {
101
+        if (this.recipient.recipientUsage != '') {
87 102
           this.addMailRecipient(this.recipient).then(() => {
88
-            this.$router.push("/emailRecipient");
89
-          });
103
+            this.$router.push('/emailRecipient')
104
+          })
90 105
         } else {
91
-          this.alertMessage = "Please select a usage type";
92
-          this.alertState = "ERROR";
106
+          this.alertMessage = 'Please select a usage type'
107
+          this.alertState = 'ERROR'
93 108
         }
94 109
       } else {
95
-        this.alertMessage = "Invalid Email";
96
-        this.alertState = "ERROR";
110
+        this.alertMessage = 'Invalid Email'
111
+        this.alertState = 'ERROR'
97 112
       }
98 113
     },
99 114
     checkEmail(email) {
100
-      const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
101
-      return re.test(String(email).toLowerCase());
102
-    }
103
-  }
104
-};
115
+      const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
116
+      return re.test(String(email).toLowerCase())
117
+    },
118
+  },
119
+}
105 120
 </script>
106 121
 
107 122
 <style lang="scss" scoped></style>

+ 39
- 37
src/components/communication/emailRecipients.vue Voir le fichier

@@ -1,28 +1,30 @@
1 1
 <template>
2
-  <main id="main" style="margin-top:200px; padding-bottom:50px">
2
+  <main id="main" style="margin-top: 200px; padding-bottom: 50px;">
3 3
     <div class="container">
4
-      <div class="row">
5
-        <div class="col">
6
-          <div class="section-header">
7
-            <h2>Email Recipients</h2>
4
+      <div class="form">
5
+        <div class="row">
6
+          <div class="col">
7
+            <div class="section-header">
8
+              <h2>Email Recipients</h2>
9
+            </div>
8 10
           </div>
9 11
         </div>
10
-      </div>
11
-      <div class="row">
12
-        <div class="col">
13
-          <listView
14
-            :items="recipients"
15
-            :showNew="true"
16
-            :editable="true"
17
-            :deleteable="true"
18
-            :hideSearch="true"
19
-            :showColumnChooser="false"
20
-            :displayColumns="columns"
21
-            :sortKey="'description'"
22
-            @onEdit="Edit"
23
-            @onDelete="Delete"
24
-            @onNew="New"
25
-          />
12
+        <div class="row">
13
+          <div class="col">
14
+            <listView
15
+              :items="recipients"
16
+              :showNew="true"
17
+              :editable="true"
18
+              :deleteable="true"
19
+              :hideSearch="true"
20
+              :showColumnChooser="false"
21
+              :displayColumns="columns"
22
+              :sortKey="'description'"
23
+              @onEdit="Edit"
24
+              @onDelete="Delete"
25
+              @onNew="New"
26
+            />
27
+          </div>
26 28
         </div>
27 29
       </div>
28 30
     </div>
@@ -31,40 +33,40 @@
31 33
 
32 34
 <script>
33 35
 /* eslint-disable */
34
-import { mapActions, mapState } from "vuex";
35
-import listView from "../shared/listView";
36
+import { mapActions, mapState } from 'vuex'
37
+import listView from '../shared/listView'
36 38
 
37 39
 export default {
38
-  name: "MailRecipients",
40
+  name: 'MailRecipients',
39 41
   components: {
40
-    listView
42
+    listView,
41 43
   },
42 44
   data() {
43 45
     return {
44
-      columns: ["recipientName", "recipientMail", "recipientUsage"]
45
-    };
46
+      columns: ['recipientName', 'recipientMail', 'recipientUsage'],
47
+    }
46 48
   },
47 49
   created() {
48
-    this.getMailRecipients();
50
+    this.getMailRecipients()
49 51
   },
50 52
   computed: {
51
-    ...mapState("template", ["recipients"])
53
+    ...mapState('template', ['recipients']),
52 54
   },
53 55
   methods: {
54
-    ...mapActions("template", ["getMailRecipients", "deleteMailRecipient"]),
56
+    ...mapActions('template', ['getMailRecipients', 'deleteMailRecipient']),
55 57
     New() {
56
-      this.$router.push("/emailRecipient/new");
58
+      this.$router.push('/emailRecipient/new')
57 59
     },
58 60
     Edit(item) {
59 61
       this.$router.push({
60
-        path: `/emailRecipient/Edit/${item.id}`
61
-      });
62
+        path: `/emailRecipient/Edit/${item.id}`,
63
+      })
62 64
     },
63 65
     Delete(item) {
64
-      this.deleteMailRecipient(item.id);
65
-    }
66
-  }
67
-};
66
+      this.deleteMailRecipient(item.id)
67
+    },
68
+  },
69
+}
68 70
 </script>
69 71
 
70 72
 <style lang="scss" scoped></style>

+ 38
- 36
src/components/communication/emailTemplatesNew.vue Voir le fichier

@@ -1,28 +1,30 @@
1 1
 <template>
2
-  <main id="main" style="margin-top:200px; padding-bottom:50px">
2
+  <main id="main" style="margin-top: 200px; padding-bottom: 50px;">
3 3
     <div class="container">
4
-      <div class="row">
5
-        <div class="col">
6
-          <div class="section-header">
7
-            <h2>Email Tempaltes</h2>
4
+      <div class="form">
5
+        <div class="row">
6
+          <div class="col">
7
+            <div class="section-header">
8
+              <h2>Email Tempaltes</h2>
9
+            </div>
8 10
           </div>
9 11
         </div>
10
-      </div>
11
-      <div class="row">
12
-        <div class="col">
13
-          <listView
14
-            :items="list"
15
-            :showNew="true"
16
-            :editable="true"
17
-            :deleteable="true"
18
-            :hideSearch="true"
19
-            :showColumnChooser="false"
20
-            :displayColumns="columns"
21
-            :sortKey="'description'"
22
-            @onEdit="Edit"
23
-            @onDelete="Delete"
24
-            @onNew="New"
25
-          />
12
+        <div class="row">
13
+          <div class="col">
14
+            <listView
15
+              :items="list"
16
+              :showNew="true"
17
+              :editable="true"
18
+              :deleteable="true"
19
+              :hideSearch="true"
20
+              :showColumnChooser="false"
21
+              :displayColumns="columns"
22
+              :sortKey="'description'"
23
+              @onEdit="Edit"
24
+              @onDelete="Delete"
25
+              @onNew="New"
26
+            />
27
+          </div>
26 28
         </div>
27 29
       </div>
28 30
     </div>
@@ -31,37 +33,37 @@
31 33
 
32 34
 <script>
33 35
 /* eslint-disable */
34
-import { mapActions, mapState } from "vuex";
35
-import listView from "../shared/listView";
36
+import { mapActions, mapState } from 'vuex'
37
+import listView from '../shared/listView'
36 38
 export default {
37
-  name: "MailTempaltes",
39
+  name: 'MailTempaltes',
38 40
   components: {
39
-    listView
41
+    listView,
40 42
   },
41 43
   data() {
42
-    return {};
44
+    return {}
43 45
   },
44 46
   created() {
45
-    this.getList();
47
+    this.getList()
46 48
   },
47 49
   computed: {
48
-    ...mapState("template", ["list", "item"])
50
+    ...mapState('template', ['list', 'item']),
49 51
   },
50 52
   methods: {
51
-    ...mapActions("template", ["getList", "deleteMailTemplate"]),
53
+    ...mapActions('template', ['getList', 'deleteMailTemplate']),
52 54
     New() {
53
-      this.$router.push("/emailTemplates/New/");
55
+      this.$router.push('/emailTemplates/New/')
54 56
     },
55 57
     Edit(item) {
56 58
       this.$router.push({
57
-        path: `/emailTemplates/Edit/${item.id}`
58
-      });
59
+        path: `/emailTemplates/Edit/${item.id}`,
60
+      })
59 61
     },
60 62
     Delete(item) {
61
-      this.deleteMailTemplate(item.id);
62
-    }
63
-  }
64
-};
63
+      this.deleteMailTemplate(item.id)
64
+    },
65
+  },
66
+}
65 67
 </script>
66 68
 
67 69
 <style lang="scss" scoped></style>

+ 53
- 1
src/components/shared/contactUsSection.vue Voir le fichier

@@ -69,6 +69,37 @@
69 69
           </float-label>
70 70
         </div>
71 71
       </div>
72
+      <div class="form-group">
73
+        <label v-if="!mailSource" class="uniSelectLabel" for="SourceSelect">
74
+          Heard About
75
+        </label>
76
+        <float-label label="Heard About" style="width: 100%;">
77
+          <select
78
+            id="SourceSelect"
79
+            class="form-control uniSelect"
80
+            v-model="mailSource"
81
+            @change="sourceSelect()"
82
+            v-bind:class="{
83
+              'is-valid': mailSource,
84
+              'is-invalid': !requiredField(mailSource) && mailSourceLoad,
85
+            }"
86
+            v-on:keyup="mailSourceLoad = true"
87
+            v-on:blur="mailSourceLoad = true"
88
+          >
89
+            <option
90
+              v-for="(source, s) in contactUsSources"
91
+              :key="s"
92
+              :value="source"
93
+            >
94
+              {{ source.description }}
95
+            </option>
96
+          </select>
97
+          <div class="invalid-feedback">
98
+            Please select a source!
99
+          </div>
100
+        </float-label>
101
+      </div>
102
+
72 103
       <div class="form-group">
73 104
         <float-label label="Message" style="width: 100%;">
74 105
           <textarea
@@ -100,6 +131,7 @@
100 131
 
101 132
 <script>
102 133
 /* eslint-disable */
134
+import { mapState, mapActions } from 'vuex'
103 135
 import axios from 'axios'
104 136
 import alert from '../shared/alert'
105 137
 
@@ -109,6 +141,10 @@ export default {
109 141
   },
110 142
   data() {
111 143
     return {
144
+      sourceObj: {},
145
+      source: '',
146
+      mailSource: '',
147
+      mailSourceId: '',
112 148
       alertMsg: 'Sent! You can expect a reply soon!',
113 149
       name: '',
114 150
       contactemail: '',
@@ -122,14 +158,26 @@ export default {
122 158
       nameLoad: false,
123 159
       contactemailLoad: false,
124 160
       messageLoad: false,
161
+      mailSourceLoad: false,
125 162
     }
126 163
   },
127 164
   mounted() {
128 165
     this.boolSent = false
129 166
     console.log('Email')
130 167
     console.log(this.contactemail)
168
+    this.getContactUsSources()
169
+  },
170
+  computed: {
171
+    ...mapState('contactUsSources', ['contactUsSources']),
131 172
   },
132 173
   methods: {
174
+    ...mapActions('contactUsSources', ['getContactUsSources']),
175
+    sourceSelect() {
176
+      console.log('sourceSelect')
177
+      console.log(this.mailSource.id)
178
+      console.log(this.mailSource)
179
+      this.mailSourceId = this.mailSource ? this.mailSource.id : 1
180
+    },
133 181
     async sendMail() {
134 182
       if (this.validatePage()) {
135 183
         var mailObj = {
@@ -138,6 +186,7 @@ export default {
138 186
           phone: this.phone,
139 187
           property: this.property,
140 188
           message: this.message,
189
+          mailSourceId: this.mailSourceId,
141 190
         }
142 191
         await axios
143 192
           .post('/api/mail/0', mailObj)
@@ -169,9 +218,11 @@ export default {
169 218
         this.phone = ''
170 219
         this.property = ''
171 220
         this.message = ''
221
+        this.mailSource = ''
172 222
         this.nameLoad = false
173 223
         this.contactemailLoad = false
174 224
         this.messageLoad = false
225
+        this.mailSourceLoad = false
175 226
       }
176 227
     },
177 228
     countDownChanged(dismissCountDown) {
@@ -179,7 +230,7 @@ export default {
179 230
     },
180 231
     validatePage: function () {
181 232
       //console.log('validatePage')
182
-      if (this.name && this.contactemail) {
233
+      if (this.name && this.contactemail && this.mailSource) {
183 234
         this.errorOccurred = ''
184 235
         this.errorMessage = ''
185 236
         this.boolValidationError = false
@@ -188,6 +239,7 @@ export default {
188 239
         this.boolValidationError = true
189 240
         this.nameLoad = true
190 241
         this.contactemailLoad = true
242
+        this.mailSourceLoad = true
191 243
         this.messageLoad = true
192 244
         this.errorOccurred = 'ERROR'
193 245
         this.errorMessage = 'Please check form and correct all input fields!'

+ 234
- 149
src/components/shared/listView.vue Voir le fichier

@@ -3,8 +3,16 @@
3 3
   <div>
4 4
     <div class="row">
5 5
       <div align="center" class="col">
6
-        <float-label class="mb-3" label="SEARCH" style="width:50%; float:center">
7
-          <input v-model="searchItem" class="form-control uniInput mt-3" placeholder="SEARCH" />
6
+        <float-label
7
+          class="mb-3"
8
+          label="Search"
9
+          style="width: 50%; float: center;"
10
+        >
11
+          <input
12
+            v-model="searchItem"
13
+            class="form-control uniInput mt-3"
14
+            placeholder="Search"
15
+          />
8 16
         </float-label>
9 17
       </div>
10 18
     </div>
@@ -17,20 +25,29 @@
17 25
       <div class="p-2">
18 26
         <div class="d-flex flex-row">
19 27
           <div class="p2" v-if="showColumnChooser">
20
-            <div class="btn-solid-blue cursor-pointer" data-toggle="modal" data-target="#myModal">
28
+            <div
29
+              class="btn-white-border cursor-pointer"
30
+              data-toggle="modal"
31
+              data-target="#myModal"
32
+            >
21 33
               Column Chooser
22 34
             </div>
23 35
             <div class="col-md-12">
24 36
               <div id="myModal" class="modal fade" role="dialog">
25
-                <div class="modal-dialog modal-lg" style="width:500px">
37
+                <div class="modal-dialog modal-lg" style="width: 500px;">
26 38
                   <!-- Modal content-->
27 39
                   <div class="modal-content">
28 40
                     <div class="modal-header">
29 41
                       <h5>Column Chooser</h5>
30
-                      <button type="button" class="close" data-dismiss="modal">&times;</button>
42
+                      <button type="button" class="close" data-dismiss="modal">
43
+                        &times;
44
+                      </button>
31 45
                     </div>
32
-                    <div style="margin-bottom:50px;">
33
-                      <ListViewControl :items="allColumn" @checkItem="checkItem" />
46
+                    <div style="margin-bottom: 50px;">
47
+                      <ListViewControl
48
+                        :items="allColumn"
49
+                        @checkItem="checkItem"
50
+                      />
34 51
                     </div>
35 52
                   </div>
36 53
                 </div>
@@ -38,22 +55,31 @@
38 55
             </div>
39 56
           </div>
40 57
           <div class="p2" v-if="selectedItems.length > 0">
41
-            <div class="btn-solid-blue cursor-pointer" @click="onClearSelected()">
58
+            <div
59
+              class="btn-white-border cursor-pointer"
60
+              @click="onClearSelected()"
61
+            >
42 62
               Clear Selected
43 63
             </div>
44 64
           </div>
45 65
           <div class="p2" v-if="showNew">
46
-            <div class="btn-solid-blue cursor-pointer" @click="onNew()">New</div>
66
+            <div class="btn-white-border cursor-pointer" @click="onNew()">
67
+              New
68
+            </div>
47 69
           </div>
48 70
         </div>
49 71
       </div>
50 72
     </div>
51
-    <div style="height:5px"></div>
73
+    <div style="height: 5px;"></div>
52 74
     <div v-if="items && items.length > 0" class="table-responsive">
53 75
       <table
54 76
         id="table"
55 77
         class="table table-striped"
56
-        :class="{ 'table table-hover': 1 === 1, 'table-sm': compact, 'table-bordered': bordered }"
78
+        :class="{
79
+          'table table-hover': 1 === 1,
80
+          'table-sm': compact,
81
+          'table-bordered': bordered,
82
+        }"
57 83
       >
58 84
         <thead>
59 85
           <tr class="dnd-moved">
@@ -65,11 +91,18 @@
65 91
                 :class="{ active: hover === c }"
66 92
               >
67 93
                 <div class="d-flex bd-highlight">
68
-                  <div v-if="displayHeaders.length === 0" class="p-2 w-100 bd-highlight">
94
+                  <div
95
+                    v-if="displayHeaders.length === 0"
96
+                    class="p-2 w-100 bd-highlight"
97
+                  >
69 98
                     {{ column | toProper }}
70 99
                   </div>
71 100
                   <div v-else class="p-2 w-100 bd-highlight">
72
-                    {{ displayHeaders[c] !== "" ? displayHeaders[c] : column | toProper }}
101
+                    {{
102
+                      displayHeaders[c] !== ''
103
+                        ? displayHeaders[c]
104
+                        : column | toProper
105
+                    }}
73 106
                   </div>
74 107
                   <div class="p-2 flex-shrink-1 bd-highlight">
75 108
                     <img
@@ -101,40 +134,86 @@
101 134
           >
102 135
             <td v-for="(column, c) in Columns" :key="c">
103 136
               <div v-if="displayFormats.length === 0">
104
-                {{ isObject(item[column]) ? item[column].display : item[column] }}
137
+                {{
138
+                  isObject(item[column]) ? item[column].display : item[column]
139
+                }}
105 140
               </div>
106
-              <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'date'">
141
+              <div
142
+                v-else-if="
143
+                  displayFormats.length > 0 && displayFormats[c] === 'date'
144
+                "
145
+              >
107 146
                 <div v-if="item[column] !== '0001-01-01T00:00:00'">
108
-                  {{ isObject(item[column]) ? item[column].display : item[column] | toDate }}
147
+                  {{
148
+                    isObject(item[column])
149
+                      ? item[column].display
150
+                      : item[column] | toDate
151
+                  }}
109 152
                 </div>
110 153
               </div>
111 154
               <div
112
-                style="padding-left:10px;white-space: nowrap;"
113
-                v-else-if="displayFormats.length > 0 && displayFormats[c] === 'money'"
155
+                style="padding-left: 10px; white-space: nowrap;"
156
+                v-else-if="
157
+                  displayFormats.length > 0 && displayFormats[c] === 'money'
158
+                "
114 159
               >
115
-                {{ isObject(item[column]) ? item[column].display : item[column] | toCurrency }}
160
+                {{
161
+                  isObject(item[column])
162
+                    ? item[column].display
163
+                    : item[column] | toCurrency
164
+                }}
116 165
               </div>
117
-              <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'image'">
118
-                <img :src="item[column]" style="height:100px; width:100px; object-fit: cover;" />
166
+              <div
167
+                v-else-if="
168
+                  displayFormats.length > 0 && displayFormats[c] === 'image'
169
+                "
170
+              >
171
+                <img
172
+                  :src="item[column]"
173
+                  style="height: 100px; width: 100px; object-fit: cover;"
174
+                />
175
+              </div>
176
+              <div v-else>
177
+                {{
178
+                  isObject(item[column]) ? item[column].display : item[column]
179
+                }}
119 180
               </div>
120
-              <div v-else>{{ isObject(item[column]) ? item[column].display : item[column] }}</div>
121 181
             </td>
122 182
             <td v-if="showCustomAction" class="my-width">
123
-              <button type="button" class="btn my-btn" @click="onCustomClick(item)">
124
-                <p v-if="CustomActionHeading !== 'Publish'">{{ CustomActionHeading }}</p>
125
-                <img v-else src="../../../public/img/icons/Upload.png" height="25" width="25" />
183
+              <button
184
+                type="button"
185
+                class="btn my-btn"
186
+                @click="onCustomClick(item)"
187
+              >
188
+                <p v-if="CustomActionHeading !== 'Publish'">
189
+                  {{ CustomActionHeading }}
190
+                </p>
191
+                <img
192
+                  v-else
193
+                  src="../../../public/img/icons/Upload.png"
194
+                  height="25"
195
+                  width="25"
196
+                />
126 197
               </button>
127 198
             </td>
128 199
 
129 200
             <td v-if="editable" class="my-width">
130 201
               <a @click="onEdit(item)" class="p-3">
131
-                <img src="../../../public/img/icons/Edit.png" height="25" width="25" />
202
+                <img
203
+                  src="../../../public/img/icons/Edit.png"
204
+                  height="25"
205
+                  width="25"
206
+                />
132 207
               </a>
133 208
               <!-- <button type="button" class="btn my-btn" @click="onEdit(item)">Edit</button> -->
134 209
             </td>
135 210
             <td v-if="deleteable" class="my-width">
136 211
               <a @click="onDelete(item)" class="p-3">
137
-                <img src="../../../public/img/icons/delete.png" height="25" width="25" />
212
+                <img
213
+                  src="../../../public/img/icons/delete.png"
214
+                  height="25"
215
+                  width="25"
216
+                />
138 217
               </a>
139 218
               <!-- <button type="button" class="btn my-btn"
140 219
                 @click="onDelete(item)">Delete</button> -->
@@ -146,9 +225,9 @@
146 225
         <div class="p-1">
147 226
           {{
148 227
             currentPage +
149
-              " / " +
150
-              PageCount +
151
-              (!hideItemCount ? " - (" + FilteredItems.length + " items)" : "")
228
+            ' / ' +
229
+            PageCount +
230
+            (!hideItemCount ? ' - (' + FilteredItems.length + ' items)' : '')
152 231
           }}
153 232
         </div>
154 233
         <div class="p-1">
@@ -168,7 +247,9 @@
168 247
                 v-model="visibleItemsPerPageCount"
169 248
                 @change="onChangeItemsPerPage()"
170 249
               >
171
-                <option v-for="(item, i) in itemsPerPageList" :key="i">{{ item }}</option>
250
+                <option v-for="(item, i) in itemsPerPageList" :key="i">
251
+                  {{ item }}
252
+                </option>
172 253
               </select>
173 254
             </div>
174 255
           </div>
@@ -183,309 +264,313 @@
183 264
 
184 265
 <script>
185 266
 /* eslint-disable */
186
-import _ from "lodash";
187
-import ItemsPerPageList from "../../assets/staticData/itemsPerPage";
188
-import BasePagination from "./basePagination.vue";
189
-import Alert from "./alert.vue";
190
-import ListViewControl from "./listViewControl.vue";
267
+import _ from 'lodash'
268
+import ItemsPerPageList from '../../assets/staticData/itemsPerPage'
269
+import BasePagination from './basePagination.vue'
270
+import Alert from './alert.vue'
271
+import ListViewControl from './listViewControl.vue'
191 272
 
192 273
 export default {
193 274
   components: {
194 275
     BasePagination,
195 276
     Alert,
196
-    ListViewControl
277
+    ListViewControl,
197 278
   },
198 279
   mounted() {
199 280
     try {
200 281
       // to assign initial value to itemsPerPage
201 282
       if (this.itemsPerPageList && this.itemsPerPageList.length > 0) {
202
-        const [startItem] = this.itemsPerPageList;
203
-        this.visibleItemsPerPageCount = startItem;
283
+        const [startItem] = this.itemsPerPageList
284
+        this.visibleItemsPerPageCount = startItem
204 285
       }
205 286
     } catch (error) {
206
-      throw error;
287
+      throw error
207 288
     }
208
-    this.getInitColumn();
289
+    this.getInitColumn()
209 290
   },
210 291
   props: {
211 292
     compact: {
212
-      default: false
293
+      default: false,
213 294
     },
214 295
     allowSelect: {
215
-      default: true
296
+      default: true,
216 297
     },
217 298
     allowMultipleSelect: {
218
-      default: false
299
+      default: false,
219 300
     },
220 301
     hideSearch: {
221
-      default: false
302
+      default: false,
222 303
     },
223 304
     showNew: {
224
-      default: true
305
+      default: true,
225 306
     },
226 307
     items: undefined,
227 308
     editable: {
228
-      default: false
309
+      default: false,
229 310
     },
230 311
     deleteable: {
231
-      default: false
312
+      default: false,
232 313
     },
233 314
     columnCount: {
234
-      default: 6
315
+      default: 6,
235 316
     },
236 317
     showPager: {
237
-      default: true
318
+      default: true,
238 319
     },
239 320
     title: {
240
-      default: undefined
321
+      default: undefined,
241 322
     },
242 323
     hideItemCount: {
243
-      default: false
324
+      default: false,
244 325
     },
245 326
     currentPage: {
246
-      default: 1
327
+      default: 1,
247 328
     },
248 329
     bordered: {
249
-      default: false
330
+      default: false,
250 331
     },
251 332
     striped: {
252
-      default: true
333
+      default: true,
253 334
     },
254 335
     showColumnChooser: {
255
-      default: true
336
+      default: true,
256 337
     },
257 338
     displayColumns: {
258 339
       type: Array,
259
-      default: () => []
340
+      default: () => [],
260 341
     },
261 342
     displayFormats: {
262 343
       type: Array,
263
-      default: () => []
344
+      default: () => [],
264 345
     },
265 346
     displayHeaders: {
266 347
       type: Array,
267
-      default: () => []
348
+      default: () => [],
268 349
     },
269 350
     showCustomAction: {
270
-      default: false
351
+      default: false,
271 352
     },
272 353
     CustomActionHeading: {
273
-      default: ""
354
+      default: '',
274 355
     },
275 356
     CustomActionCondition: {
276
-      default: ""
277
-    }
357
+      default: '',
358
+    },
278 359
   },
279 360
   data() {
280 361
     return {
281 362
       hover: -1,
282 363
       selectedItems: [],
283 364
       showControl: false,
284
-      sortKey: "id",
365
+      sortKey: 'id',
285 366
       reverse: false,
286
-      searchItem: "",
367
+      searchItem: '',
287 368
       visibleItemsPerPageCount: 20,
288 369
       itemsPerPageList: ItemsPerPageList,
289 370
       visibleColumn: [],
290
-      allColumn: []
291
-    };
371
+      allColumn: [],
372
+    }
292 373
   },
293 374
   methods: {
294 375
     checkItem(column, show) {
295
-      const list = [];
376
+      const list = []
296 377
       for (const i in this.allColumn) {
297
-        const item = this.allColumn[i];
378
+        const item = this.allColumn[i]
298 379
         if (item && item.column === column) {
299
-          item.show = show;
380
+          item.show = show
300 381
         }
301
-        list.push(item);
382
+        list.push(item)
302 383
       }
303
-      this.allColumn = list;
384
+      this.allColumn = list
304 385
     },
305 386
     getInitColumn() {
306
-      const list = [];
307
-      const listAll = [];
387
+      const list = []
388
+      const listAll = []
308 389
       if (this.items) {
309 390
         for (const i in Object.keys(this.items)) {
310
-          const item = this.items[i];
391
+          const item = this.items[i]
311 392
           for (const o in Object.keys(item)) {
312
-            if (!listAll.includes(Object.keys(item)[o]) && !Array.isArray(Object.values(item)[o])) {
313
-              const columnName = Object.keys(item)[o];
314
-              if (!listAll.some(x => x.column === columnName)) {
393
+            if (
394
+              !listAll.includes(Object.keys(item)[o]) &&
395
+              !Array.isArray(Object.values(item)[o])
396
+            ) {
397
+              const columnName = Object.keys(item)[o]
398
+              if (!listAll.some((x) => x.column === columnName)) {
315 399
                 listAll.push({
316 400
                   column: columnName,
317
-                  show: _.filter(listAll, x => x.show).length < this.columnCount
318
-                });
401
+                  show:
402
+                    _.filter(listAll, (x) => x.show).length < this.columnCount,
403
+                })
319 404
               }
320 405
             }
321 406
           }
322 407
         }
323 408
       }
324
-      this.allColumn = listAll;
409
+      this.allColumn = listAll
325 410
     },
326 411
     onClearSelected() {
327
-      this.selectedItems = [];
328
-      this.$emit("onClearSelected");
412
+      this.selectedItems = []
413
+      this.$emit('onClearSelected')
329 414
     },
330 415
     isSelected(i) {
331
-      const ind = this.getActualIndex(i);
332
-      return _.some(this.selectedItems, x => x === ind);
416
+      const ind = this.getActualIndex(i)
417
+      return _.some(this.selectedItems, (x) => x === ind)
333 418
     },
334 419
     onNew() {
335
-      this.$emit("onNew");
420
+      this.$emit('onNew')
336 421
     },
337 422
     isObject(item) {
338
-      return !!item && item.constructor === Object;
423
+      return !!item && item.constructor === Object
339 424
     },
340 425
     isDate(item) {
341
-      return !!item && item.constructor === Date;
426
+      return !!item && item.constructor === Date
342 427
     },
343 428
     isDecimal(item) {
344
-      if (!!item && item.constructor === Number && item.indexOf(".") > 0) {
345
-        return true;
429
+      if (!!item && item.constructor === Number && item.indexOf('.') > 0) {
430
+        return true
346 431
       }
347
-      return false;
432
+      return false
348 433
     },
349 434
     isImage(item) {
350 435
       return (
351 436
         !!item &&
352 437
         item.constructor === String &&
353 438
         item.length > 9 &&
354
-        item.substring(0, 9) === "data:image"
355
-      );
439
+        item.substring(0, 9) === 'data:image'
440
+      )
356 441
     },
357 442
     onEdit(item) {
358
-      this.$emit("onEdit", item);
443
+      this.$emit('onEdit', item)
359 444
     },
360 445
     onDelete(item) {
361
-      this.$emit("onDelete", item);
446
+      this.$emit('onDelete', item)
362 447
     },
363 448
     onCustomClick(item) {
364
-      this.$emit("onCustomClick", item);
449
+      this.$emit('onCustomClick', item)
365 450
     },
366 451
     onRowClick(item, i) {
367
-      const ind = this.getActualIndex(i);
368
-      if (_.some(this.selectedItems, x => x === ind)) {
369
-        this.selectedItems = this.selectedItems.filter(x => x !== ind);
452
+      const ind = this.getActualIndex(i)
453
+      if (_.some(this.selectedItems, (x) => x === ind)) {
454
+        this.selectedItems = this.selectedItems.filter((x) => x !== ind)
370 455
       } else {
371 456
         if (!this.allowMultipleSelect) {
372
-          this.selectedItems = [];
457
+          this.selectedItems = []
373 458
         }
374
-        this.selectedItems.push(item);
459
+        this.selectedItems.push(item)
375 460
       }
376
-      this.$emit("onRowClick", this.selectedItems);
461
+      this.$emit('onRowClick', this.selectedItems)
377 462
     },
378 463
     getActualIndex(index) {
379
-      return (this.currentPage - 1) * this.visibleItemsPerPageCount + index;
464
+      return (this.currentPage - 1) * this.visibleItemsPerPageCount + index
380 465
     },
381 466
     changeColumn(title, checked) {
382 467
       if (checked) {
383
-        this.myColumns.push(title);
468
+        this.myColumns.push(title)
384 469
       } else {
385
-        const ind = this.myColumns.indexOf(title);
470
+        const ind = this.myColumns.indexOf(title)
386 471
         if (ind > -1) {
387
-          this.myColumns.splice(ind, 1);
472
+          this.myColumns.splice(ind, 1)
388 473
         }
389 474
       }
390 475
     },
391 476
     onControlVisibilityChange() {
392
-      this.showControl = !this.showControl;
477
+      this.showControl = !this.showControl
393 478
     },
394 479
     sortBy(sortKey) {
395
-      this.reverse = this.sortKey === sortKey ? !this.reverse : false;
396
-      this.sortKey = sortKey;
480
+      this.reverse = this.sortKey === sortKey ? !this.reverse : false
481
+      this.sortKey = sortKey
397 482
     },
398 483
     async pageChangeHandle(value) {
399
-      console.log(value);
484
+      console.log(value)
400 485
       switch (value) {
401
-        case "next":
402
-          this.currentPage += 1;
403
-          break;
404
-        case "previous":
405
-          this.currentPage -= 1;
406
-          break;
486
+        case 'next':
487
+          this.currentPage += 1
488
+          break
489
+        case 'previous':
490
+          this.currentPage -= 1
491
+          break
407 492
         default:
408
-          this.currentPage = value;
493
+          this.currentPage = value
409 494
       }
410 495
     },
411 496
     onChangeItemsPerPage() {
412 497
       if (this.currentPage !== 1) {
413
-        this.currentPage = 1;
498
+        this.currentPage = 1
414 499
       }
415 500
     },
416 501
     inArray(array, value) {
417
-      const lenght = array.length;
502
+      const lenght = array.length
418 503
       for (let i = 0; i < lenght; i++) {
419
-        if (array[i] === value) return true;
504
+        if (array[i] === value) return true
420 505
       }
421
-      return false;
422
-    }
506
+      return false
507
+    },
423 508
   },
424 509
   computed: {
425 510
     ListWidth() {
426 511
       if (this.showControl) {
427
-        return "col-md-9";
512
+        return 'col-md-9'
428 513
       }
429
-      return "col-md-12";
514
+      return 'col-md-12'
430 515
     },
431 516
     SortDirection() {
432
-      return this.reverse ? "desc" : "asc";
517
+      return this.reverse ? 'desc' : 'asc'
433 518
     },
434 519
     PageCount() {
435 520
       return this.visibleItemsPerPageCount !== 0
436 521
         ? Math.ceil(this.FilteredItems.length / this.visibleItemsPerPageCount)
437
-        : 1;
522
+        : 1
438 523
     },
439 524
     Columns() {
440
-      const listColumns = [];
525
+      const listColumns = []
441 526
       if (!this.allColumn || this.allColumn.length === 0) {
442
-        this.getInitColumn();
527
+        this.getInitColumn()
443 528
       }
444 529
       if (this.displayColumns.length > 0) {
445 530
         for (let i = 0; i < this.displayColumns.length; i++) {
446
-          listColumns.push(this.displayColumns[i]);
531
+          listColumns.push(this.displayColumns[i])
447 532
         }
448 533
       } else {
449
-        const list = _.filter(this.allColumn, x => x.show);
534
+        const list = _.filter(this.allColumn, (x) => x.show)
450 535
         for (const i in list) {
451
-          const item = list[i];
536
+          const item = list[i]
452 537
           if (item) {
453
-            listColumns.push(item.column);
538
+            listColumns.push(item.column)
454 539
           }
455 540
         }
456 541
       }
457
-      return listColumns;
542
+      return listColumns
458 543
     },
459 544
     AllColumns() {
460
-      const list = [];
545
+      const list = []
461 546
       if (this.items) {
462 547
       }
463
-      return list;
548
+      return list
464 549
     },
465 550
     FilteredItems() {
466
-      const list = _.filter(this.items, item =>
551
+      const list = _.filter(this.items, (item) =>
467 552
         Object.values(item).some(
468
-          i =>
553
+          (i) =>
469 554
             JSON.stringify(i)
470 555
               .toLowerCase()
471
-              .indexOf(this.searchItem.toLowerCase()) > -1
472
-        )
473
-      );
474
-      return _.orderBy(list, this.sortKey, this.SortDirection);
556
+              .indexOf(this.searchItem.toLowerCase()) > -1,
557
+        ),
558
+      )
559
+      return _.orderBy(list, this.sortKey, this.SortDirection)
475 560
     },
476 561
     DisplayItems() {
477
-      const list = this.FilteredItems;
478
-      const startSlice = (this.currentPage - 1) * this.visibleItemsPerPageCount;
479
-      let endSlice = this.currentPage * this.visibleItemsPerPageCount;
562
+      const list = this.FilteredItems
563
+      const startSlice = (this.currentPage - 1) * this.visibleItemsPerPageCount
564
+      let endSlice = this.currentPage * this.visibleItemsPerPageCount
480 565
       if (endSlice > list.length) {
481
-        endSlice = list.length;
566
+        endSlice = list.length
482 567
       }
483
-      return list.slice(startSlice, endSlice);
568
+      return list.slice(startSlice, endSlice)
484 569
     },
485 570
 
486
-    GetAllColumn() {}
487
-  }
488
-};
571
+    GetAllColumn() {},
572
+  },
573
+}
489 574
 </script>
490 575
 <style scoped>
491 576
 th[draggable] a,

+ 190
- 97
src/components/shared/navBar.vue Voir le fichier

@@ -4,7 +4,10 @@
4 4
       <i class="fa fa-bars"></i>
5 5
     </button>-->
6 6
     <div>
7
-      <header id="header" style="width: 100%; position: fixed; top:0px; z-index: 50;">
7
+      <header
8
+        id="header"
9
+        style="width: 100%; position: fixed; top: 0px; z-index: 50;"
10
+      >
8 11
         <div class="container">
9 12
           <div class="row justify-content-center">
10 13
             <div id="logo" class="col-md-3 col-xs-4 pull-left">
@@ -13,7 +16,7 @@
13 16
                   class="img-fluid"
14 17
                   src="/img/logos/UVProp.png"
15 18
                   alt="UVProp logo"
16
-                  style="height:100px;"
19
+                  style="height: 100px;"
17 20
                 />
18 21
               </a>
19 22
             </div>
@@ -23,7 +26,10 @@
23 26
                   <a href="mailto:info@univateproperties.co.za">
24 27
                     <i class="fa fa-envelope"></i>
25 28
                   </a>
26
-                  <a href="https://www.facebook.com/univateproperties/" target="_blank">
29
+                  <a
30
+                    href="https://www.facebook.com/univateproperties/"
31
+                    target="_blank"
32
+                  >
27 33
                     <i class="fa fa-facebook"></i>
28 34
                   </a>
29 35
                   <a href="#">
@@ -46,8 +52,10 @@
46 52
 
47 53
               <nav id="nav-menu-container" class="mt-2">
48 54
                 <ul class="nav-menu sf-js-enabled sf-arrows">
49
-                  <li style="margin-left:-20px">
50
-                    <router-link to="/property/commercial">Commercial</router-link>
55
+                  <li style="margin-left: -20px;">
56
+                    <router-link to="/property/commercial">
57
+                      Commercial
58
+                    </router-link>
51 59
                     <!-- <div
52 60
                       @mouseover="commercialClass = 'ts-display'"
53 61
                       @mouseleave="commercialClass = 'no-display'"
@@ -70,7 +78,9 @@
70 78
                     </ul>-->
71 79
                   </li>
72 80
                   <li class="mx-1">
73
-                    <router-link to="/property/residential">Residential</router-link>
81
+                    <router-link to="/property/residential">
82
+                      Residential
83
+                    </router-link>
74 84
                     <!-- <div
75 85
                       @mouseover="residentialClass = 'ts-display'"
76 86
                       @mouseleave="residentialClass = 'no-display'"
@@ -101,7 +111,10 @@
101 111
                       @mouseleave="timeShareClass = 'no-display'"
102 112
                     ></div>
103 113
                     <a href="#" class="sf-with-ul">Timeshare</a>
104
-                    <ul style="margin-top:-10px;text-align:left" :class="timeShareClass">
114
+                    <ul
115
+                      style="margin-top: -10px; text-align: left;"
116
+                      :class="timeShareClass"
117
+                    >
105 118
                       <li>
106 119
                         <router-link to="/timeshare/buy">To Buy</router-link>
107 120
                       </li>
@@ -113,7 +126,9 @@
113 126
                       </li>
114 127
                       <li>
115 128
                         <hr />
116
-                        <router-link to="/timeshare/myWeeks">My Timeshare Weeks</router-link>
129
+                        <router-link to="/timeshare/myWeeks">
130
+                          My Timeshare Weeks
131
+                        </router-link>
117 132
                       </li>
118 133
                     </ul>
119 134
                   </li>
@@ -147,16 +162,19 @@
147 162
                       @mouseleave="propManClass = 'no-display'"
148 163
                     ></div>
149 164
                     <a href="#" class="sf-with-ul">Property Management</a>
150
-                    <ul style="margin-top:-10px; text-align:left" :class="propManClass">
165
+                    <ul
166
+                      style="margin-top: -10px; text-align: left;"
167
+                      :class="propManClass"
168
+                    >
151 169
                       <li>
152
-                        <router-link to="/propertyManagement"
153
-                          >Sectional Title and HOA Management</router-link
154
-                        >
170
+                        <router-link to="/propertyManagement">
171
+                          Sectional Title and HOA Management
172
+                        </router-link>
155 173
                       </li>
156 174
                       <li>
157
-                        <router-link to="/rentalPropertyManagement"
158
-                          >Rental Property Portfolio Management</router-link
159
-                        >
175
+                        <router-link to="/rentalPropertyManagement">
176
+                          Rental Property Portfolio Management
177
+                        </router-link>
160 178
                       </li>
161 179
                     </ul>
162 180
                   </li>
@@ -166,12 +184,17 @@
166 184
                       @mouseleave="aboutClass = 'no-display'"
167 185
                     ></div>
168 186
                     <a href="#" class="sf-with-ul">About</a>
169
-                    <ul style="margin-top:-10px; text-align:left" :class="aboutClass">
187
+                    <ul
188
+                      style="margin-top: -10px; text-align: left;"
189
+                      :class="aboutClass"
190
+                    >
170 191
                       <li>
171 192
                         <router-link to="/about/us">About Us</router-link>
172 193
                       </li>
173 194
                       <li>
174
-                        <router-link to="/about/timeshare">About Timeshare Resales</router-link>
195
+                        <router-link to="/about/timeshare">
196
+                          About Timeshare Resales
197
+                        </router-link>
175 198
                       </li>
176 199
                     </ul>
177 200
                   </li>
@@ -185,7 +208,10 @@
185 208
                     ></div>
186 209
 
187 210
                     <a href="#" class="sf-with-ul">{{ NAME }}</a>
188
-                    <ul style="margin-top:-10px;text-align:left" :class="userClass">
211
+                    <ul
212
+                      style="margin-top: -10px; text-align: left;"
213
+                      :class="userClass"
214
+                    >
189 215
                       <!-- <li v-if="ROLE === 'Super Admin'">
190 216
                         <router-link to="/property/list">List Property</router-link>
191 217
                       </li>
@@ -199,90 +225,129 @@
199 225
                         ></div>
200 226
                         <a href="#" class="sf-with-ul">Property</a>
201 227
                         <ul
202
-                          style="margin-top:-10px;text-align:left;width:250px"
228
+                          style="
229
+                            margin-top: -10px;
230
+                            text-align: left;
231
+                            width: 250px;
232
+                          "
203 233
                           :class="submenu1Class"
204 234
                         >
205 235
                           <li>
206
-                            <router-link to="/property/list">List My Property</router-link>
236
+                            <router-link to="/property/list">
237
+                              List My Property
238
+                            </router-link>
207 239
                           </li>
208 240
                           <li>
209
-                            <router-link to="/PropertyAdmin">Property Admin</router-link>
241
+                            <router-link to="/PropertyAdmin">
242
+                              Property Admin
243
+                            </router-link>
210 244
                           </li>
211 245
                         </ul>
212 246
                       </li>
213
-                      <li v-if="ROLE === 'Super Admin'" class="menu-has-children">
247
+                      <li
248
+                        v-if="ROLE === 'Super Admin'"
249
+                        class="menu-has-children"
250
+                      >
214 251
                         <div
215 252
                           @mouseover="submenu1Class = 'ts-display'"
216 253
                           @mouseleave="submenu1Class = 'no-display'"
217 254
                         ></div>
218 255
                         <a href="#" class="sf-with-ul">TimeShare</a>
219 256
                         <ul
220
-                          style="margin-top:-10px;text-align:left;width:250px"
257
+                          style="
258
+                            margin-top: -10px;
259
+                            text-align: left;
260
+                            width: 250px;
261
+                          "
221 262
                           :class="submenu1Class"
222 263
                         >
223 264
                           <li v-if="ROLE === 'Super Admin'">
224
-                            <router-link to="/status/timeshareAdmin"
225
-                              >Timeshare Week Admin</router-link
226
-                            >
265
+                            <router-link to="/status/timeshareAdmin">
266
+                              Timeshare Week Admin
267
+                            </router-link>
227 268
                           </li>
228 269
                           <li v-if="ROLE === 'Super Admin'">
229
-                            <router-link to="/status/tenderWeekAdmin"
230
-                              >Tender Week Management</router-link
231
-                            >
270
+                            <router-link to="/status/tenderWeekAdmin">
271
+                              Tender Week Management
272
+                            </router-link>
232 273
                           </li>
233 274
                         </ul>
234 275
                       </li>
235 276
 
236 277
                       <hr v-if="ROLE === 'Super Admin'" />
237
-                      <li v-if="ROLE === 'Super Admin'" class="menu-has-children">
278
+                      <li
279
+                        v-if="ROLE === 'Super Admin'"
280
+                        class="menu-has-children"
281
+                      >
238 282
                         <div
239 283
                           @mouseover="submenu1Class = 'ts-display'"
240 284
                           @mouseleave="submenu1Class = 'no-display'"
241 285
                         ></div>
242 286
                         <a href="#" class="sf-with-ul">Website Setup</a>
243 287
                         <ul
244
-                          style="margin-top:-10px;text-align:left;width:250px"
288
+                          style="
289
+                            margin-top: -10px;
290
+                            text-align: left;
291
+                            width: 250px;
292
+                          "
245 293
                           :class="submenu1Class"
246 294
                         >
247 295
                           <li>
248
-                            <router-link to="/contactUsLog">Contact Us Log</router-link>
296
+                            <router-link to="/contactUsLog">
297
+                              Contact Us Log
298
+                            </router-link>
249 299
                           </li>
250 300
                           <li>
251
-                            <router-link to="/termsConditions">Edit Terms & Conditions</router-link>
301
+                            <router-link to="/contactUsSource/list">
302
+                              Contact Us Source
303
+                            </router-link>
252 304
                           </li>
253 305
                           <li>
254
-                            <router-link to="/emailTemplates">Email Templates</router-link>
306
+                            <router-link to="/termsConditions">
307
+                              Edit Terms & Conditions
308
+                            </router-link>
255 309
                           </li>
256 310
                           <li>
257
-                            <router-link to="/emailRecipient">Email Recipients</router-link>
311
+                            <router-link to="/emailTemplates">
312
+                              Email Templates
313
+                            </router-link>
258 314
                           </li>
259 315
                           <li>
260
-                            <router-link to="/enquireNowLog">Enquire Now Log</router-link>
316
+                            <router-link to="/emailRecipient">
317
+                              Email Recipients
318
+                            </router-link>
319
+                          </li>
320
+                          <li>
321
+                            <router-link to="/enquireNowLog">
322
+                              Enquire Now Log
323
+                            </router-link>
261 324
                           </li>
262 325
                           <li>
263 326
                             <router-link to="/fees">Fees</router-link>
264 327
                           </li>
265 328
                           <li>
266
-                            <router-link to="/propertyTypes/list">Property Types</router-link>
329
+                            <router-link to="/propertyTypes/list">
330
+                              Property Types
331
+                            </router-link>
267 332
                           </li>
268 333
                           <li>
269
-                            <router-link to="/userDefinedGroups/list"
270
-                              >Property User Defined Groups</router-link
271
-                            >
334
+                            <router-link to="/userDefinedGroups/list">
335
+                              Property User Defined Groups
336
+                            </router-link>
272 337
                           </li>
273 338
                           <li>
274 339
                             <router-link to="/status/list">Status</router-link>
275 340
                           </li>
276 341
                           <li>
277
-                            <router-link to="/unitConfiguration/list"
278
-                              >Unit Configuration</router-link
279
-                            >
342
+                            <router-link to="/unitConfiguration/list">
343
+                              Unit Configuration
344
+                            </router-link>
280 345
                           </li>
281 346
 
282 347
                           <li>
283
-                            <router-link to="/status/userManagementPage"
284
-                              >User Management & Access</router-link
285
-                            >
348
+                            <router-link to="/status/userManagementPage">
349
+                              User Management & Access
350
+                            </router-link>
286 351
                           </li>
287 352
                         </ul>
288 353
                       </li>
@@ -312,38 +377,55 @@
312 377
                         <router-link to="/Carousel">Carousel</router-link>
313 378
                       </li>-->
314 379
                       <li>
315
-                        <router-link to="/user/updateProfileInfo">Update Info</router-link>
380
+                        <router-link to="/user/updateProfileInfo">
381
+                          Update Info
382
+                        </router-link>
316 383
                       </li>
317 384
                       <li v-if="ROLE === 'Super Admin'">
318 385
                         <router-link to="/payments">Payments</router-link>
319 386
                       </li>
320 387
                       <li v-if="ROLE === 'Super Admin'">
321
-                        <router-link to="/campaignUpload">Landing Pages / Campaignes</router-link>
388
+                        <router-link to="/campaignUpload">
389
+                          Landing Pages / Campaignes
390
+                        </router-link>
322 391
                       </li>
323 392
                       <li v-if="ROLE === 'Super Admin'">
324
-                        <router-link to="/landingPages">Landing Pages * / Campaignes</router-link>
393
+                        <router-link to="/landingPages">
394
+                          Landing Pages * / Campaignes
395
+                        </router-link>
325 396
                       </li>
326 397
                       <li v-if="ROLE === 'Designer'">
327
-                        <router-link to="/campaignUpload">Landing Pages / Campaignes</router-link>
398
+                        <router-link to="/campaignUpload">
399
+                          Landing Pages / Campaignes
400
+                        </router-link>
328 401
                       </li>
329 402
                       <li>
330
-                        <router-link class="btn-white-border p-2" to="/user/login"
331
-                          >Logout</router-link
403
+                        <router-link
404
+                          class="btn-white-border p-2"
405
+                          to="/user/login"
332 406
                         >
407
+                          Logout
408
+                        </router-link>
333 409
                       </li>
334 410
                     </ul>
335 411
                   </li>
336 412
 
337 413
                   <li v-if="!USER">
338
-                    <router-link class="btn-white-border p-2 ml-1 mr-1" to="/user/login"
339
-                      >Login</router-link
414
+                    <router-link
415
+                      class="btn-white-border p-2 ml-1 mr-1"
416
+                      to="/user/login"
340 417
                     >
418
+                      Login
419
+                    </router-link>
341 420
                   </li>
342 421
 
343 422
                   <li v-if="!USER">
344
-                    <router-link class="btn-white-border p-2 ml-1 mr-1" to="/user/register"
345
-                      >Register</router-link
423
+                    <router-link
424
+                      class="btn-white-border p-2 ml-1 mr-1"
425
+                      to="/user/register"
346 426
                     >
427
+                      Register
428
+                    </router-link>
347 429
                   </li>
348 430
                   <!-- <li v-if="!isLoggedIn" class="menu-has-children">
349 431
                     <div
@@ -379,7 +461,12 @@
379 461
       <div class="modal-dialog" role="document">
380 462
         <div class="modal-content pt-4">
381 463
           <div class="modal-header">
382
-            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
464
+            <button
465
+              type="button"
466
+              class="close"
467
+              data-dismiss="modal"
468
+              aria-label="Close"
469
+            >
383 470
               <span aria-hidden="true">&times;</span>
384 471
             </button>
385 472
           </div>
@@ -398,80 +485,86 @@
398 485
 
399 486
 <script>
400 487
 /* eslint-disable */
401
-import { mapState, mapActions } from "vuex";
402
-import Log from "../../assets/Log";
403
-import bondCalculator from "../misc/bondCaclculator";
488
+import { mapState, mapActions } from 'vuex'
489
+import Log from '../../assets/Log'
490
+import bondCalculator from '../misc/bondCaclculator'
404 491
 
405 492
 export default {
406 493
   components: {
407
-    bondCalculator
494
+    bondCalculator,
408 495
   },
409 496
   data() {
410 497
     return {
411 498
       hover: false,
412
-      timeShareClass: "no-display",
413
-      propertiesClass: "no-display",
414
-      aboutClass: "no-display",
415
-      userClass: "no-display",
416
-      registerClass: "no-display",
417
-      commercialClass: "no-display",
418
-      residentialClass: "no-display",
419
-      propManClass: "no-display",
420
-      submenu1Class: "no-display"
421
-    };
499
+      timeShareClass: 'no-display',
500
+      propertiesClass: 'no-display',
501
+      aboutClass: 'no-display',
502
+      userClass: 'no-display',
503
+      registerClass: 'no-display',
504
+      commercialClass: 'no-display',
505
+      residentialClass: 'no-display',
506
+      propManClass: 'no-display',
507
+      submenu1Class: 'no-display',
508
+    }
422 509
   },
423 510
   methods: {
424
-    ...mapActions("authentication", ["logout"]),
425
-    ...mapActions("fees", ["retrieveListingFee"]),
426
-    ...mapActions("myWeeks", ["getWeekCount"]),
511
+    ...mapActions('authentication', ['logout']),
512
+    ...mapActions('fees', ['retrieveListingFee']),
513
+    ...mapActions('myWeeks', ['getWeekCount']),
427 514
     showDropDown() {
428 515
       if (!this.hover) {
429
-        this.timeShareClass = "ts-display";
516
+        this.timeShareClass = 'ts-display'
430 517
       }
431 518
     },
432 519
     routerGoTo(goTo) {
433
-      this.$emit("routerGoTo", goTo);
434
-    }
520
+      this.$emit('routerGoTo', goTo)
521
+    },
435 522
   },
436 523
   mounted() {
437
-    this.retrieveListingFee();
438
-    console.log(localStorage.getItem("user"));
439
-    if (localStorage.getItem("user") !== null) {
440
-      this.getWeekCount(JSON.parse(localStorage.getItem("user")).id);
524
+    this.retrieveListingFee()
525
+    console.log(localStorage.getItem('user'))
526
+    if (localStorage.getItem('user') !== null) {
527
+      this.getWeekCount(JSON.parse(localStorage.getItem('user')).id)
441 528
     }
442 529
   },
443 530
   computed: {
444
-    ...mapState("authentication", ["user", "flag", "status", "person", "token"]),
445
-    ...mapState("myWeeks", ["weekCount"]),
531
+    ...mapState('authentication', [
532
+      'user',
533
+      'flag',
534
+      'status',
535
+      'person',
536
+      'token',
537
+    ]),
538
+    ...mapState('myWeeks', ['weekCount']),
446 539
     isLoggedIn() {
447
-      return Log.isLoggedIn();
540
+      return Log.isLoggedIn()
448 541
     },
449 542
     NAME() {
450
-      return Log.getPerson().name;
543
+      return Log.getPerson().name
451 544
     },
452 545
     USER() {
453
-      var userObj = {};
546
+      var userObj = {}
454 547
       if (!this.user) {
455
-        userObj = JSON.parse(localStorage.getItem("user"));
548
+        userObj = JSON.parse(localStorage.getItem('user'))
456 549
       } else {
457
-        userObj = this.user;
550
+        userObj = this.user
458 551
       }
459 552
 
460
-      return userObj;
553
+      return userObj
461 554
     },
462 555
     ROLE() {
463
-      var userObj = JSON.parse(localStorage.getItem("user"));
464
-      return userObj.role;
556
+      var userObj = JSON.parse(localStorage.getItem('user'))
557
+      return userObj.role
465 558
     },
466 559
     // eslint-disable-next-line vue/return-in-computed-property
467 560
     Logout() {
468
-      this.logout().then(res => {
469
-        console.log("something");
470
-      });
561
+      this.logout().then((res) => {
562
+        console.log('something')
563
+      })
471 564
       //return this.logout();
472
-    }
473
-  }
474
-};
565
+    },
566
+  },
567
+}
475 568
 </script>
476 569
 
477 570
 <style lang="scss" scoped>

+ 44
- 29
src/components/timeshare/resort/resortPageNew.vue Voir le fichier

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div>
3 3
     <!-- <carouselSection v-if="!wait" :resortImages="resort.images" /> -->
4
-    <main id="main" style="margin-top:20px;">
4
+    <main id="main" style="margin-top: 20px;">
5 5
       <section>
6 6
         <div class="container">
7 7
           <div class="row" id="resort-profile">
@@ -9,11 +9,16 @@
9 9
               <gallerySection :images="resort.images" />
10 10
               <FilterComponent :hideTop="true" />
11 11
             </div>
12
-            <div class="col-md-9 resort-profile" style="margin-top:15px; margin-bottom:15px;">
12
+            <div
13
+              class="col-md-9 resort-profile"
14
+              style="margin-top: 15px; margin-bottom: 15px;"
15
+            >
13 16
               <h2>{{ resort.prName }}</h2>
14 17
               <WeekList :resortCode="resortCode" />
15
-              <p v-if="resort.description && resort.description !== ''">{{ resort.description }}</p>
16
-              <br v-if="resort.description && resort.description !== ''" />
18
+              <p v-if="description && description !== ''">
19
+                {{ description }}
20
+              </p>
21
+              <br v-if="description && description !== ''" />
17 22
               <div class="d-flex mt-3">
18 23
                 <iframe
19 24
                   width="100%"
@@ -21,10 +26,10 @@
21 26
                   id="gmap_canvas"
22 27
                   :src="
23 28
                     'https://maps.google.com/maps?q=' +
24
-                      resort.prLatitude +
25
-                      ',' +
26
-                      resort.prLongitude +
27
-                      '&hl=en&z=14&amp;output=embed'
29
+                    resort.prLatitude +
30
+                    ',' +
31
+                    resort.prLongitude +
32
+                    '&hl=en&z=14&amp;output=embed'
28 33
                   "
29 34
                   frameborder="0"
30 35
                   scrolling="no"
@@ -36,9 +41,13 @@
36 41
           </div>
37 42
           <div class="row">
38 43
             <div class="col">
39
-              <router-link style="float:right" class="btn-solid-blue mb-4" to="/timeshare/buy"
40
-                >BACK</router-link
44
+              <router-link
45
+                style="float: right;"
46
+                class="btn-solid-blue mb-4"
47
+                to="/timeshare/buy"
41 48
               >
49
+                BACK
50
+              </router-link>
42 51
             </div>
43 52
           </div>
44 53
         </div>
@@ -50,45 +59,51 @@
50 59
 
51 60
 <script>
52 61
 /* eslint-disable */
53
-import { mapState, mapActions } from "vuex";
54
-import WeekList from "../buy/weekListComponent.vue";
55
-import FilterComponent from "../searchTimeshare.vue";
56
-import ResortImages from "./resortImage.vue";
57
-import gallerySection from "./gallerySection";
58
-import carouselSection from "./carouselSection";
62
+import { mapState, mapActions } from 'vuex'
63
+import WeekList from '../buy/weekListComponent.vue'
64
+import FilterComponent from '../searchTimeshare.vue'
65
+import ResortImages from './resortImage.vue'
66
+import gallerySection from './gallerySection'
67
+import carouselSection from './carouselSection'
59 68
 
60 69
 export default {
70
+  name: 'ResortPageNew',
61 71
   components: {
62 72
     carouselSection,
63 73
     WeekList,
64 74
     FilterComponent,
65 75
     ResortImages,
66
-    gallerySection
76
+    gallerySection,
67 77
   },
68 78
   data() {
69 79
     return {
70 80
       wait: true,
71
-      rCode: ""
72
-    };
81
+      rCode: '',
82
+    }
73 83
   },
74 84
   props: {
75
-    resortCode: {}
85
+    resortCode: {},
76 86
   },
77 87
   methods: {
78
-    ...mapActions("resort", ["getResortData"]),
88
+    ...mapActions('resort', ['getResortData', 'getDescription']),
79 89
     routerGoTo(goto) {
80
-      this.$router.push(goto);
81
-    }
90
+      this.$router.push(goto)
91
+    },
82 92
   },
83 93
   computed: {
84
-    ...mapState("resort", ["resort", "images"])
94
+    ...mapState('resort', ['resort', 'images', 'description']),
85 95
   },
86 96
   created() {
87
-    this.getResortData(this.resortCode.includes("SILV") ? "SILV1" : this.resortCode).then(
88
-      () => (this.wait = false)
89
-    );
90
-  }
91
-};
97
+    console.log('Resort Description')
98
+    console.log(this.resortCode)
99
+    this.getDescription(this.resortCode)
100
+
101
+    console.log(this.resort.description)
102
+    this.getResortData(
103
+      this.resortCode.includes('SILV') ? 'SILV1' : this.resortCode,
104
+    ).then(() => (this.wait = false))
105
+  },
106
+}
92 107
 </script>
93 108
 
94 109
 <style lang="scss" scoped>

+ 24
- 72
src/components/timeshare/sell/contentSectionNew.vue Voir le fichier

@@ -726,8 +726,9 @@
726 726
                         v-bind:class="{
727 727
                           'is-valid': indiv.cellNumber,
728 728
                           'is-invalid':
729
-                            !validPhoneNumber(indiv.cellNumber) &&
730
-                            cellNumberLoad,
729
+                            !requiredField(
730
+                              validPhoneNumber(indiv.cellNumber),
731
+                            ) && cellNumberLoad,
731 732
                         }"
732 733
                         v-on:keyup="cellNumberLoad = true"
733 734
                         v-on:blur="cellNumberLoad = true"
@@ -749,14 +750,19 @@
749 750
                         data-msg="Please enter your landline number"
750 751
                         v-model="indiv.landlineNumber"
751 752
                         v-bind:class="{
752
-                          'is-valid': indiv.landlineNumber,
753
+                          'is-valid':
754
+                            indiv.landlineNumber &&
755
+                            validPhoneNumber(indiv.landlineNumber),
753 756
                           'is-invalid':
754
-                            !validPhoneNumber(indiv.landlineNumber) &&
755
-                            landlineNumberLoad,
757
+                            indiv.landlineNumber &&
758
+                            !validPhoneNumber(indiv.landlineNumber),
756 759
                         }"
757 760
                         v-on:keyup="landlineNumberLoad = true"
758 761
                         v-on:blur="landlineNumberLoad = true"
759 762
                       />
763
+                      <div class="invalid-feedback">
764
+                        Valid landline number is required!
765
+                      </div>
760 766
                     </float-label>
761 767
                   </div>
762 768
                 </div>
@@ -1420,11 +1426,6 @@ export default {
1420 1426
       this.indiv.surname =
1421 1427
         this.indiv.surname.charAt(0).toUpperCase() + this.indiv.surname.slice(1)
1422 1428
     },
1423
-    validPhoneNumber(number) {
1424
-      const rx = /^\(?\d{3}\)?[-\s]?\d{3}[-\s]?\d{4}$/
1425
-      // const rx = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im
1426
-      return rx.test(String(number))
1427
-    },
1428 1429
     getPubDate() {
1429 1430
       var today = new Date()
1430 1431
       var dd = String(today.getDate()).padStart(2, '0')
@@ -1518,65 +1519,8 @@ export default {
1518 1519
             this.sellItem.customOwner = true
1519 1520
           }
1520 1521
 
1521
-          //Check if the landline number is valid or empty
1522
-          //if (this.indiv.landlineNumber !== '') {
1523
-          //  if (this.indiv.landlineNumber !== null) {
1524
-          //    if (!this.validPhoneNumber(this.indiv.landlineNumber)) {
1525
-          //      this.boolError = true
1526
-          //      this.errorOccurred = 'ERROR'
1527
-          //      this.errorMessage =
1528
-          //        'The landline number is not in the correct format.'
1529
-          //    }
1530
-          ///  }
1531
-          //} else {
1532
-          //  this.indiv.telephone = null
1533
-          //}
1534
-
1535
-          //check if the cellphone number is valid or empty
1536
-          //if (this.indiv.cellNumber !== '') {
1537
-          //  if (this.indiv.cellNumber !== null) {
1538
-          //    if (!this.validPhoneNumber(this.indiv.cellNumber)) {
1539
-          //      this.boolError = true
1540
-          //      this.errorOccurred = 'ERROR'
1541
-          //      this.errorMessage =
1542
-          //        'The cellphone number is not in the correct format.'
1543
-          //    }
1544
-          //  }
1545
-          //} else {
1546
-          //  this.indiv.cellNumber = null
1547
-          //}
1548
-
1549
-          //check if spouse telephone is valid or empty
1550
-          //if (this.indiv.spouseTelephone !== '') {
1551
-          //  if (this.indiv.spouseTelephone !== null) {
1552
-          //    if (!this.validPhoneNumber(this.indiv.spouseTelephone)) {
1553
-          //      this.boolError = true
1554
-          //      this.errorOccurred = 'ERROR'
1555
-          //      this.errorMessage =
1556
-          //        'Spouse Telephone number is not in the correct format.'
1557
-          //    }
1558
-          //  }
1559
-          //} else {
1560
-          //  this.indiv.spouseTelephone = null
1561
-          //}
1562
-
1563
-          //check if spouse cell number is valid or empty
1564
-          //if (this.indiv.spouseCellnumber !== '') {
1565
-          //  if (this.indiv.spouseCellnumber !== null) {
1566
-          //    if (!this.validPhoneNumber(this.indiv.spouseCellnumber)) {
1567
-          //      this.boolError = true
1568
-          //      this.errorOccurred = 'ERROR'
1569
-          //      this.errorMessage =
1570
-          //        'Spouse Cellphone number is not in the correct format.'
1571
-          //    }
1572
-          //  }
1573
-          //} else {
1574
-          //  this.indiv.spouseCellnumber = null
1575
-          //}
1576
-
1577 1522
           //set the owner of the week to the indiv
1578 1523
           this.sellItem.ownerObject = this.indiv
1579
-
1580 1524
           //set the publish date equal to today's date
1581 1525
           this.sellItem.pulbishedDate = this.getPubDate()
1582 1526
 
@@ -1727,6 +1671,15 @@ export default {
1727 1671
         return re.test(email)
1728 1672
       }
1729 1673
     },
1674
+    validPhoneNumber(number) {
1675
+      if (number) {
1676
+        const rx = /^\(?\d{3}\)?[-\s]?\d{3}[-\s]?\d{4}$/
1677
+        // const rx = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im
1678
+        return rx.test(String(number))
1679
+      } else {
1680
+        return true
1681
+      }
1682
+    },
1730 1683
     validatePage: function () {
1731 1684
       console.log('validatePage')
1732 1685
       if (
@@ -1741,10 +1694,11 @@ export default {
1741 1694
         this.sellItem.levyAmount &&
1742 1695
         this.sellItem.arrivalDate &&
1743 1696
         this.sellItem.departureDate &&
1744
-        this.sellItem.sellPrice
1697
+        this.sellItem.sellPrice &&
1698
+        this.validEmail(individual.emailAddress) &&
1699
+        this.validPhoneNumber(this.sellItem.cellNumber) &&
1700
+        this.validPhoneNumber(this.sellItem.landlineNumber)
1745 1701
       ) {
1746
-        console.log('User check')
1747
-        console.log(this.selectedUserType)
1748 1702
         if (this.selectedUserType === 'custom') {
1749 1703
           if (
1750 1704
             this.nameLoad &&
@@ -1772,14 +1726,12 @@ export default {
1772 1726
             return false
1773 1727
           }
1774 1728
         } else {
1775
-          console.log('passed')
1776 1729
           this.errorOccurred = ''
1777 1730
           this.errorMessage = ''
1778 1731
           this.boolValidationError = true
1779 1732
           return true
1780 1733
         }
1781 1734
       } else {
1782
-        console.log('failed')
1783 1735
         this.regionLoad = true
1784 1736
         this.resortLoad = true
1785 1737
         this.otherResortLoad = true

+ 25
- 4
src/components/user/registerAgencySection.vue Voir le fichier

@@ -165,8 +165,9 @@
165 165
                 v-bind:class="{
166 166
                   'is-valid': registerAgency.user.cellNumber,
167 167
                   'is-invalid':
168
-                    !requiredField(registerAgency.user.cellNumber) &&
169
-                    agencyCellNumberLoad,
168
+                    !requiredField(
169
+                      validPhoneNumber(registerAgency.user.cellNumber),
170
+                    ) && cellNumberLoad,
170 171
                 }"
171 172
                 v-on:keyup="agencyCellNumberLoad = true"
172 173
                 v-on:blur="agencyCellNumberLoad = true"
@@ -182,7 +183,14 @@
182 183
                 id="inputAgencyLandLine"
183 184
                 v-model="registerAgency.user.telephone"
184 185
                 class="form-control uniInput"
185
-                v-bind:class="{ 'is-valid': registerAgency.user.telephone }"
186
+                v-bind:class="{
187
+                  'is-valid':
188
+                    registerAgency.user.telephone &&
189
+                    validPhoneNumber(registerAgency.user.telephone),
190
+                  'is-invalid':
191
+                    registerAgency.user.telephone &&
192
+                    !validPhoneNumber(registerAgency.user.telephone),
193
+                }"
186 194
                 placeholder="Landline Number"
187 195
               />
188 196
             </float-label>
@@ -417,7 +425,11 @@ export default {
417 425
         this.registerAgency.user.cellNumber &&
418 426
         this.registerAgency.user.username &&
419 427
         this.registerAgency.user.password &&
420
-        this.registerAgency.user.password === this.registerAgency.user.confirm
428
+        this.registerAgency.user.password ===
429
+          this.registerAgency.user.confirm &&
430
+        this.validEmail(this.registerAgency.user.email) &&
431
+        this.validPhoneNumber(this.registerAgency.user.cellNumber) &&
432
+        this.validPhoneNumber(this.registerAgency.user.telephone)
421 433
       ) {
422 434
         console.log('passed')
423 435
         this.errorOccurred = ''
@@ -449,6 +461,15 @@ export default {
449 461
         return false
450 462
       }
451 463
     },
464
+    validPhoneNumber(number) {
465
+      if (number) {
466
+        const rx = /^\(?\d{3}\)?[-\s]?\d{3}[-\s]?\d{4}$/
467
+        // const rx = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im
468
+        return rx.test(String(number))
469
+      } else {
470
+        return true
471
+      }
472
+    },
452 473
     validEmail: function (email) {
453 474
       var re = /(.+)@(.+){2,}\.(.+){2,}/
454 475
       if (email) {

+ 25
- 4
src/components/user/registerAgentSection.vue Voir le fichier

@@ -90,8 +90,9 @@
90 90
                 v-bind:class="{
91 91
                   'is-valid': registerAgency.user.cellNumber,
92 92
                   'is-invalid':
93
-                    !requiredField(registerAgency.user.cellNumber) &&
94
-                    agencyCellNumberLoad,
93
+                    !requiredField(
94
+                      validPhoneNumber(registerAgency.user.cellNumber),
95
+                    ) && cellNumberLoad,
95 96
                 }"
96 97
                 v-on:keyup="agencyCellNumberLoad = true"
97 98
                 v-on:blur="agencyCellNumberLoad = true"
@@ -107,7 +108,14 @@
107 108
                 id="inputAgencyLandLine"
108 109
                 v-model="registerAgency.user.telephone"
109 110
                 class="form-control uniInput"
110
-                v-bind:class="{ 'is-valid': registerAgency.user.telephone }"
111
+                v-bind:class="{
112
+                  'is-valid':
113
+                    registerAgency.user.telephone &&
114
+                    validPhoneNumber(registerAgency.user.telephone),
115
+                  'is-invalid':
116
+                    registerAgency.user.telephone &&
117
+                    !validPhoneNumber(registerAgency.user.telephone),
118
+                }"
111 119
                 placeholder="Landline Number"
112 120
               />
113 121
             </float-label>
@@ -376,7 +384,11 @@ export default {
376 384
         this.registerAgency.user.cellNumber &&
377 385
         this.registerAgency.user.username &&
378 386
         this.registerAgency.user.password &&
379
-        this.registerAgency.user.password === this.registerAgency.user.confirm
387
+        this.registerAgency.user.password ===
388
+          this.registerAgency.user.confirm &&
389
+        this.validEmail(this.registerAgency.user.email) &&
390
+        this.validPhoneNumber(this.registerAgency.user.cellNumber) &&
391
+        this.validPhoneNumber(this.registerAgency.user.telephone)
380 392
       ) {
381 393
         console.log('passed')
382 394
         this.errorOccurred = ''
@@ -409,6 +421,15 @@ export default {
409 421
         return false
410 422
       }
411 423
     },
424
+    validPhoneNumber(number) {
425
+      if (number) {
426
+        const rx = /^\(?\d{3}\)?[-\s]?\d{3}[-\s]?\d{4}$/
427
+        // const rx = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im
428
+        return rx.test(String(number))
429
+      } else {
430
+        return true
431
+      }
432
+    },
412 433
     validEmail: function (email) {
413 434
       var re = /(.+)@(.+){2,}\.(.+){2,}/
414 435
       if (email) {

+ 23
- 3
src/components/user/registerIndividual.vue Voir le fichier

@@ -88,7 +88,8 @@
88 88
                 v-bind:class="{
89 89
                   'is-valid': indivUser.cellNumber,
90 90
                   'is-invalid':
91
-                    !requiredField(indivUser.cellNumber) && cellNumberLoad,
91
+                    !requiredField(validPhoneNumber(indivUser.cellNumber)) &&
92
+                    cellNumberLoad,
92 93
                 }"
93 94
                 v-on:keyup="cellNumberLoad = true"
94 95
                 v-on:blur="cellNumberLoad = true"
@@ -104,7 +105,14 @@
104 105
                 id="inputTelephone"
105 106
                 v-model="indivUser.telephone"
106 107
                 class="form-control uniInput my-2"
107
-                v-bind:class="{ 'is-valid': indivUser.telephone }"
108
+                v-bind:class="{
109
+                  'is-valid':
110
+                    indivUser.telephone &&
111
+                    validPhoneNumber(indivUser.telephone),
112
+                  'is-invalid':
113
+                    indivUser.telephone &&
114
+                    !validPhoneNumber(indivUser.telephone),
115
+                }"
108 116
                 placeholder="Landline Number"
109 117
               />
110 118
             </float-label>
@@ -329,7 +337,10 @@ export default {
329 337
         this.indivUser.cellNumber &&
330 338
         this.indivUser.username &&
331 339
         this.indivUser.password &&
332
-        this.indivUser.password === this.indivUser.confirmPassword
340
+        this.indivUser.password === this.indivUser.confirmPassword &&
341
+        this.validEmail(this.indiviUser.email) &&
342
+        this.validPhoneNumber(this.indivUser.cellNumber) &&
343
+        this.validPhoneNumber(this.indivUser.telephone)
333 344
       ) {
334 345
         this.errorOccurred = ''
335 346
         this.errorMessage = ''
@@ -357,6 +368,15 @@ export default {
357 368
         return false
358 369
       }
359 370
     },
371
+    validPhoneNumber(number) {
372
+      if (number) {
373
+        const rx = /^\(?\d{3}\)?[-\s]?\d{3}[-\s]?\d{4}$/
374
+        // const rx = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im
375
+        return rx.test(String(number))
376
+      } else {
377
+        return true
378
+      }
379
+    },
360 380
     validEmail: function (email) {
361 381
       var re = /(.+)@(.+){2,}\.(.+){2,}/
362 382
       if (email) {

+ 208
- 185
src/components/user/updateAgentProfile.vue Voir le fichier

@@ -2,69 +2,70 @@
2 2
   <main id="main">
3 3
     <section id="contact2">
4 4
       <div class="container">
5
-        <div class="row">
6
-          <div class="section-header">
7
-            <h2>Update Agent Info</h2>
8
-          </div>
9
-        </div>
10
-        <div class="row">
11
-          <div class="col">
12
-            <float-label>
13
-              <input
14
-                type="text"
15
-                name="name"
16
-                class="form-control uniInput"
17
-                id="name"
18
-                placeholder="USERNAME"
19
-                data-rule="minlen:4"
20
-                data-msg="Please enter your name"
21
-                v-model="agent.user.username"
22
-              />
23
-            </float-label>
24
-          </div>
25
-          <div class="col">
26
-            <float-label>
27
-              <input
28
-                type="text"
29
-                name="name"
30
-                class="form-control uniInput"
31
-                id="name"
32
-                placeholder="NAME"
33
-                data-rule="minlen:4"
34
-                data-msg="Please enter your name"
35
-                v-model="agent.name"
36
-              />
37
-            </float-label>
38
-          </div>
39
-        </div>
40
-        <div class="row mt-4">
41
-          <div class="col-md-6">
42
-            <float-label>
43
-              <input
44
-                type="text"
45
-                class="form-control uniInput"
46
-                name="surname"
47
-                id="surname"
48
-                placeholder="SURNAME"
49
-                data-msg="Please enter your surname"
50
-                v-model="agent.surname"
51
-              />
52
-            </float-label>
5
+        <div class="form">
6
+          <div class="row">
7
+            <div class="section-header">
8
+              <h2>Update Agent Info</h2>
9
+            </div>
53 10
           </div>
54
-          <div class="col">
55
-            <float-label>
56
-              <input
57
-                type="text"
58
-                class="form-control uniInput"
59
-                name="email"
60
-                id="email"
61
-                placeholder="EMAIL ADDRESS"
62
-                data-msg="Please enter your email address"
63
-                v-model="agent.email"
64
-              />
65
-            </float-label>
11
+          <div class="row">
12
+            <div class="col">
13
+              <float-label>
14
+                <input
15
+                  type="text"
16
+                  name="name"
17
+                  class="form-control uniInput"
18
+                  id="name"
19
+                  placeholder="USERNAME"
20
+                  data-rule="minlen:4"
21
+                  data-msg="Please enter your name"
22
+                  v-model="agent.user.username"
23
+                />
24
+              </float-label>
25
+            </div>
26
+            <div class="col">
27
+              <float-label>
28
+                <input
29
+                  type="text"
30
+                  name="name"
31
+                  class="form-control uniInput"
32
+                  id="name"
33
+                  placeholder="NAME"
34
+                  data-rule="minlen:4"
35
+                  data-msg="Please enter your name"
36
+                  v-model="agent.name"
37
+                />
38
+              </float-label>
39
+            </div>
66 40
           </div>
67
-          <!-- <div class="col">
41
+          <div class="row mt-4">
42
+            <div class="col-md-6">
43
+              <float-label>
44
+                <input
45
+                  type="text"
46
+                  class="form-control uniInput"
47
+                  name="surname"
48
+                  id="surname"
49
+                  placeholder="SURNAME"
50
+                  data-msg="Please enter your surname"
51
+                  v-model="agent.surname"
52
+                />
53
+              </float-label>
54
+            </div>
55
+            <div class="col">
56
+              <float-label>
57
+                <input
58
+                  type="text"
59
+                  class="form-control uniInput"
60
+                  name="email"
61
+                  id="email"
62
+                  placeholder="EMAIL ADDRESS"
63
+                  data-msg="Please enter your email address"
64
+                  v-model="agent.email"
65
+                />
66
+              </float-label>
67
+            </div>
68
+            <!-- <div class="col">
68 69
             <float-label>
69 70
               <input
70 71
                 type="text"
@@ -77,8 +78,8 @@
77 78
               />
78 79
             </float-label>
79 80
           </div> -->
80
-        </div>
81
-        <!-- <div class="row mt-4">
81
+          </div>
82
+          <!-- <div class="row mt-4">
82 83
           <div class="col-md-6">
83 84
             <float-label>
84 85
               <input
@@ -93,86 +94,106 @@
93 94
             </float-label>
94 95
           </div>
95 96
         </div> -->
96
-        <div class="row mt-4">
97
-          <div class="col">
98
-            <float-label>
99
-              <input
100
-                type="text"
101
-                name="cell"
102
-                class="form-control uniInput"
103
-                id="cell"
104
-                placeholder="CELL NUMBER"
105
-                data-rule="minlen:4"
106
-                data-msg="Please enter your cell number"
107
-                v-model="agent.cellNumber"
108
-              />
109
-            </float-label>
110
-          </div>
111
-          <div class="col">
112
-            <float-label>
113
-              <input
114
-                type="text"
115
-                class="form-control uniInput"
116
-                name="landline"
117
-                id="landline"
118
-                placeholder="TELEPHONE NUMBER"
119
-                data-msg="Please enter your Telephone number"
120
-                v-model="agent.telephone"
121
-              />
122
-            </float-label>
123
-          </div>
124
-        </div>
125
-        <div class="row mt-4">
126
-          <div class="col">
127
-            <float-label fixed label="AGENCY">
128
-              <select v-model="agent.agencyId" class="form-control uniSelect" name="" id="">
129
-                <option v-for="agency in agencies" :key="agency.id" :value="agency.id">{{
130
-                  agency.agencyName
131
-                }}</option>
132
-              </select>
133
-            </float-label>
134
-          </div>
135
-        </div>
136
-        <div v-if="pullUserRole === 'Super Admin'">
137
-          <div class="row">
97
+          <div class="row mt-4">
138 98
             <div class="col">
139
-              <div class="section-header">
140
-                <h2>Access Control</h2>
141
-              </div>
99
+              <float-label>
100
+                <input
101
+                  type="text"
102
+                  name="cell"
103
+                  class="form-control uniInput"
104
+                  id="cell"
105
+                  placeholder="CELL NUMBER"
106
+                  data-rule="minlen:4"
107
+                  data-msg="Please enter your cell number"
108
+                  v-model="agent.cellNumber"
109
+                />
110
+              </float-label>
111
+            </div>
112
+            <div class="col">
113
+              <float-label>
114
+                <input
115
+                  type="text"
116
+                  class="form-control uniInput"
117
+                  name="landline"
118
+                  id="landline"
119
+                  placeholder="TELEPHONE NUMBER"
120
+                  data-msg="Please enter your Telephone number"
121
+                  v-model="agent.telephone"
122
+                />
123
+              </float-label>
142 124
             </div>
143 125
           </div>
144
-          <div class="row">
145
-            <div class="col-md-6">
146
-              <float-label label="User Role" style="width:100%">
147
-                <select class="form-control uniSelect" id="howMarried" v-model="agent.user.role">
148
-                  <option v-for="role in getRoles" :key="role.id" :value="role.roleName">
149
-                    {{ role.roleName }}
126
+          <div class="row mt-4">
127
+            <div class="col">
128
+              <float-label fixed label="AGENCY">
129
+                <select
130
+                  v-model="agent.agencyId"
131
+                  class="form-control uniSelect"
132
+                  name=""
133
+                  id=""
134
+                >
135
+                  <option
136
+                    v-for="agency in agencies"
137
+                    :key="agency.id"
138
+                    :value="agency.id"
139
+                  >
140
+                    {{ agency.agencyName }}
150 141
                   </option>
151 142
                 </select>
152 143
               </float-label>
153 144
             </div>
154
-            <div class="col-md-6">
155
-              <input
156
-                class="mr-2 mt-3"
157
-                name="changePass"
158
-                type="checkbox"
159
-                v-model="agent.user.loginPasswordChange"
160
-              />
161
-              <label for="changePass">Change Password on Next Login</label>
162
-            </div>
163 145
           </div>
164
-        </div>
165
-        <div class="row">
166
-          <div class="col">
167
-            <Alert :text="errorMessage" :type="errorOccurred" />
146
+          <div v-if="pullUserRole === 'Super Admin'">
147
+            <div class="row">
148
+              <div class="col">
149
+                <div class="section-header">
150
+                  <h2>Access Control</h2>
151
+                </div>
152
+              </div>
153
+            </div>
154
+            <div class="row">
155
+              <div class="col-md-6">
156
+                <float-label label="User Role" style="width: 100%;">
157
+                  <select
158
+                    class="form-control uniSelect"
159
+                    id="howMarried"
160
+                    v-model="agent.user.role"
161
+                  >
162
+                    <option
163
+                      v-for="role in getRoles"
164
+                      :key="role.id"
165
+                      :value="role.roleName"
166
+                    >
167
+                      {{ role.roleName }}
168
+                    </option>
169
+                  </select>
170
+                </float-label>
171
+              </div>
172
+              <div class="col-md-6">
173
+                <input
174
+                  class="mr-2 mt-3"
175
+                  name="changePass"
176
+                  type="checkbox"
177
+                  v-model="agent.user.loginPasswordChange"
178
+                />
179
+                <label for="changePass">Change Password on Next Login</label>
180
+              </div>
181
+            </div>
168 182
           </div>
169
-        </div>
170
-        <div class="row mt-5 mb-5">
171
-          <div class="col">
172
-            <button class="btn-solid-blue" @click="sendToApi()">SAVE</button>
183
+          <div class="row">
184
+            <div class="col">
185
+              <Alert :text="errorMessage" :type="errorOccurred" />
186
+            </div>
173 187
           </div>
174
-          <div class="col">
175
-            <button class="btn-solid-blue" @click="$router.go(-1)">CLOSE</button>
188
+          <div class="row mt-5 mb-5">
189
+            <div class="col">
190
+              <button class="btn-solid-blue" @click="sendToApi()">SAVE</button>
191
+            </div>
192
+            <div class="col">
193
+              <button class="btn-solid-blue" @click="$router.go(-1)">
194
+                CLOSE
195
+              </button>
196
+            </div>
176 197
           </div>
177 198
         </div>
178 199
       </div>
@@ -182,104 +203,106 @@
182 203
 
183 204
 <script>
184 205
 /* eslint-disable */
185
-import { mapState, mapActions, mapGetters } from "vuex";
186
-import Log from "../../assets/Log";
187
-import Alert from "../shared/alert";
206
+import { mapState, mapActions, mapGetters } from 'vuex'
207
+import Log from '../../assets/Log'
208
+import Alert from '../shared/alert'
188 209
 
189 210
 export default {
190 211
   props: {
191
-    agent: {}
212
+    agent: {},
192 213
   },
193 214
   components: {
194
-    Alert
215
+    Alert,
195 216
   },
196 217
   data() {
197 218
     return {
198
-      errorOccurred: "",
199
-      errorMessage: "",
200
-      boolError: false
201
-    };
219
+      errorOccurred: '',
220
+      errorMessage: '',
221
+      boolError: false,
222
+    }
202 223
   },
203 224
   created() {
204
-    this.retrieveUserRoles();
205
-    this.getAgencies();
225
+    this.retrieveUserRoles()
226
+    this.getAgencies()
206 227
   },
207 228
   computed: {
208
-    ...mapGetters("role", ["getRoles"]),
209
-    ...mapState("timeshare", ["agencies"]),
229
+    ...mapGetters('role', ['getRoles']),
230
+    ...mapState('timeshare', ['agencies']),
210 231
     pullUserRole() {
211
-      return Log.getUser().role;
212
-    }
232
+      return Log.getUser().role
233
+    },
213 234
   },
214 235
   methods: {
215
-    ...mapActions("role", ["retrieveUserRoles"]),
216
-    ...mapActions("timeshare", ["getAgencies", "updateAgent"]),
217
-    ...mapActions("register", ["saveAgent"]),
236
+    ...mapActions('role', ['retrieveUserRoles']),
237
+    ...mapActions('timeshare', ['getAgencies', 'updateAgent']),
238
+    ...mapActions('register', ['saveAgent']),
218 239
     validPhoneNumber(number) {
219
-      const rx = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im;
220
-      return rx.test(String(number));
240
+      const rx = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im
241
+      return rx.test(String(number))
221 242
     },
222 243
     sendToApi() {
223
-      this.boolError = false;
224
-      this.agent.fullName = this.agent.name + " " + this.agent.surname;
225
-      if (this.agent.telephone !== "") {
244
+      this.boolError = false
245
+      this.agent.fullName = this.agent.name + ' ' + this.agent.surname
246
+      if (this.agent.telephone !== '') {
226 247
         if (this.agent.telephone !== null) {
227 248
           if (!this.validPhoneNumber(this.agent.telephone)) {
228
-            this.boolError = true;
229
-            this.errorOccurred = "ERROR";
230
-            this.errorMessage = "The telephone number is not in the correct format.";
249
+            this.boolError = true
250
+            this.errorOccurred = 'ERROR'
251
+            this.errorMessage =
252
+              'The telephone number is not in the correct format.'
231 253
           }
232 254
         }
233 255
       } else {
234
-        this.agent.telephone = null;
256
+        this.agent.telephone = null
235 257
       }
236
-      if (this.agent.cellNumber !== "") {
258
+      if (this.agent.cellNumber !== '') {
237 259
         if (this.agent.cellNumber !== null) {
238 260
           if (!this.validPhoneNumber(this.agent.cellNumber)) {
239
-            this.boolError = true;
240
-            this.errorOccurred = "ERROR";
241
-            this.errorMessage = "The cellphone number is not in the correct format.";
261
+            this.boolError = true
262
+            this.errorOccurred = 'ERROR'
263
+            this.errorMessage =
264
+              'The cellphone number is not in the correct format.'
242 265
           }
243 266
         }
244 267
       } else {
245
-        this.agent.cellNumber = null;
268
+        this.agent.cellNumber = null
246 269
       }
247 270
 
248 271
       if (!this.boolError) {
249 272
         if (
250
-          this.agent.user.role === "Agent" ||
251
-          this.agent.user.role === "Agency" ||
252
-          this.agent.user.role === "Managing Agent"
273
+          this.agent.user.role === 'Agent' ||
274
+          this.agent.user.role === 'Agency' ||
275
+          this.agent.user.role === 'Managing Agent'
253 276
         ) {
254 277
           this.updateAgent(this.agent).then(() => {
255 278
             var newPerson = {
256
-              id: JSON.parse(localStorage.getItem("person")).id,
279
+              id: JSON.parse(localStorage.getItem('person')).id,
257 280
               email: this.agent.email,
258
-              fullname: this.agent.name + " " + this.agent.surname,
281
+              fullname: this.agent.name + ' ' + this.agent.surname,
259 282
               name: this.agent.name,
260
-              surname: this.agent.surnmame
261
-            };
262
-            localStorage.setItem("person", JSON.stringify(newPerson));
263
-            console.log(newPerson);
264
-            this.$router.push("/");
265
-          });
283
+              surname: this.agent.surnmame,
284
+            }
285
+            localStorage.setItem('person', JSON.stringify(newPerson))
286
+            console.log(newPerson)
287
+            this.$router.push('/')
288
+          })
266 289
         } else {
267 290
           this.saveAgent(this.agent)
268 291
             .then(() => {
269
-              if (Log.getUser().role === "Super Admin") {
270
-                this.$router.push("/status/userManagementPage");
292
+              if (Log.getUser().role === 'Super Admin') {
293
+                this.$router.push('/status/userManagementPage')
271 294
               } else {
272
-                this.$router.push("/");
295
+                this.$router.push('/')
273 296
               }
274 297
             })
275
-            .catch(ex => {
276
-              console.log(ex);
277
-            });
298
+            .catch((ex) => {
299
+              console.log(ex)
300
+            })
278 301
         }
279 302
       }
280
-    }
281
-  }
282
-};
303
+    },
304
+  },
305
+}
283 306
 </script>
284 307
 
285 308
 <style lang="scss" scoped></style>

+ 656
- 517
src/components/user/updateProfileInfo.vue
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 1
- 1
src/main.js Voir le fichier

@@ -58,7 +58,7 @@ Vue.use(VueAnalytics, {
58 58
 Vue.config.productionTip = false
59 59
 axios.defaults.baseURL = 'http://localhost:57260'
60 60
     //axios.defaults.baseURL = "https://www.pvsl.co.za:86/";
61
-    //axios.defaults.baseURL = "http://training.provision-sa.com:120/"
61
+    //axios.defaults.baseURL = 'http://training.provision-sa.com:120/'
62 62
 
63 63
 Vue.prototype.$axios = axios
64 64
 const pluginOptions = {

+ 15
- 3
src/router/index.js Voir le fichier

@@ -69,6 +69,8 @@ import WebsiteDisclaimer from '../components/misc/Disclaimer/WebsiteDisclaimer.v
69 69
 import TermsConditions from '../components/admin/misc/termsConditions.vue'
70 70
 import TermsConditionsView from '../components/misc/TermsConditions/termsConditions.vue'
71 71
 import ContactUsLog from '../components/communication/contactUsLog.vue'
72
+import ContactUsSourceList from '../components/communication/contactUsSourceList.vue'
73
+import ContactUsSource from '../components/communication/contactUsSource.vue'
72 74
 import EnquireNowLog from '../components/communication/enquireNowLog.vue'
73 75
 
74 76
 import MakeOffer from '../components/processFlow/makeOffer.vue'
@@ -367,9 +369,19 @@ export default new Router({
367 369
             component: UnitConfiguration,
368 370
         },
369 371
         {
370
-            path: '/contactus',
371
-            name: 'ContactUs',
372
-            component: ContactUs,
372
+            path: '/contactUsSource/list',
373
+            name: 'ContactUsSourceList',
374
+            component: ContactUsSourceList,
375
+        },
376
+        {
377
+            path: '/contactUsSource/new',
378
+            name: 'ContactUsSourceNew',
379
+            component: ContactUsSource,
380
+        },
381
+        {
382
+            path: '/contactUsSource/:id',
383
+            name: 'ContactUsSourceEdit',
384
+            component: ContactUsSource,
373 385
         },
374 386
         {
375 387
             path: '/privacypolicy',

+ 78
- 76
src/store/index.js Voir le fichier

@@ -1,81 +1,83 @@
1
-import Vue from "vue";
2
-import Vuex from "vuex";
1
+import Vue from 'vue'
2
+import Vuex from 'vuex'
3 3
 
4
-import TimeshareModule from "./modules/timeshare/timeshare";
5
-import UsersModule from "./modules/users";
6
-import StatusModule from "./modules/timeshare/status";
7
-import UnitConfigurationModule from "./modules/timeshare/unitConfiguration";
8
-import RegionModule from "./modules/timeshare/region";
9
-import SearchTabModule from "./modules/searchTab";
10
-import ResortModule from "./modules/timeshare/resort";
11
-import PropertyModule from "./modules/property/property";
12
-import WeekModule from "./modules/timeshare/week";
13
-import PropertyAdminModule from "./modules/property/propertyAdmin";
14
-import PropertyList from "./modules/property/propertyLists";
15
-import PropertyTypes from "./modules/property/propertyTypes";
16
-import Register from "./modules/user/register";
17
-import WeekList from "./modules/timeshare/weekList";
18
-import MyWeeks from "./modules/timeshare/myWeeks";
19
-import Bid from "./modules/processFlow/bid";
20
-import Authentication from "./modules/user/authentication";
21
-import PropertySearch from "./modules/property/propertySearch";
22
-import SearchLog from "./modules/logs/searchLog";
23
-import Template from "./modules/communication/template";
24
-import Info from "./modules/communication/info";
25
-import PropertyEdit from "./modules/property/propertyEdit";
26
-import Carousel from "./modules/misc/carousel";
27
-import Individual from "./modules/user/individual";
28
-import Alert from "./modules/misc/alert";
29
-import TenderWeek from "./modules/timeshare/tenderWeeks";
30
-import PaymentModule from "./modules/financial/payment";
31
-import CampaignModule from "./modules/marketing/campaigns";
32
-import CampaignItemModule from "./modules/marketing/campaignItems";
33
-import PlaceHolderFormat from "./modules/misc/placeHolderFormat";
34
-import Bank from "./modules/user/bank";
35
-import bank from "./modules/user/bank";
36
-import Fees from "./modules/financial/fees";
37
-import TermsConditions from "./modules/misc/termsConditions";
4
+import TimeshareModule from './modules/timeshare/timeshare'
5
+import UsersModule from './modules/users'
6
+import StatusModule from './modules/timeshare/status'
7
+import UnitConfigurationModule from './modules/timeshare/unitConfiguration'
8
+import RegionModule from './modules/timeshare/region'
9
+import SearchTabModule from './modules/searchTab'
10
+import ResortModule from './modules/timeshare/resort'
11
+import PropertyModule from './modules/property/property'
12
+import WeekModule from './modules/timeshare/week'
13
+import PropertyAdminModule from './modules/property/propertyAdmin'
14
+import PropertyList from './modules/property/propertyLists'
15
+import PropertyTypes from './modules/property/propertyTypes'
16
+import ContactUsSources from './modules/communication/contactUsSources'
17
+import Register from './modules/user/register'
18
+import WeekList from './modules/timeshare/weekList'
19
+import MyWeeks from './modules/timeshare/myWeeks'
20
+import Bid from './modules/processFlow/bid'
21
+import Authentication from './modules/user/authentication'
22
+import PropertySearch from './modules/property/propertySearch'
23
+import SearchLog from './modules/logs/searchLog'
24
+import Template from './modules/communication/template'
25
+import Info from './modules/communication/info'
26
+import PropertyEdit from './modules/property/propertyEdit'
27
+import Carousel from './modules/misc/carousel'
28
+import Individual from './modules/user/individual'
29
+import Alert from './modules/misc/alert'
30
+import TenderWeek from './modules/timeshare/tenderWeeks'
31
+import PaymentModule from './modules/financial/payment'
32
+import CampaignModule from './modules/marketing/campaigns'
33
+import CampaignItemModule from './modules/marketing/campaignItems'
34
+import PlaceHolderFormat from './modules/misc/placeHolderFormat'
35
+import Bank from './modules/user/bank'
36
+import bank from './modules/user/bank'
37
+import Fees from './modules/financial/fees'
38
+import TermsConditions from './modules/misc/termsConditions'
38 39
 import Roles from './modules/user/role'
39 40
 import NonRegIndividuals from './modules/user/nonRegIndividual'
40 41
 
41
-Vue.use(Vuex);
42
-/* eslint no-param-reassign: ["error", { "props": false }] */
42
+Vue.use(Vuex)
43
+    /* eslint no-param-reassign: ["error", { "props": false }] */
43 44
 export default new Vuex.Store({
44
-  modules: {
45
-    myWeeks: MyWeeks,
46
-    timeshare: TimeshareModule,
47
-    users: UsersModule,
48
-    status: StatusModule,
49
-    unitConfiguration: UnitConfigurationModule,
50
-    region: RegionModule,
51
-    searchTab: SearchTabModule,
52
-    resort: ResortModule,
53
-    property: PropertyModule,
54
-    week: WeekModule,
55
-    propertyAdmin: PropertyAdminModule,
56
-    propertyList: PropertyList,
57
-    propertyTypes: PropertyTypes,
58
-    register: Register,
59
-    weekList: WeekList,
60
-    bid: Bid,
61
-    authentication: Authentication,
62
-    propertySearch: PropertySearch,
63
-    searchLog: SearchLog,
64
-    template: Template,
65
-    info: Info,
66
-    propertyEdit: PropertyEdit,
67
-    carousel: Carousel,
68
-    individual: Individual,
69
-    alert: Alert,
70
-    tenderWeek: TenderWeek,
71
-    payment: PaymentModule,
72
-    campaign: CampaignModule,
73
-    campaignItem: CampaignItemModule,
74
-    placeHolderFormat: PlaceHolderFormat,
75
-    fees: Fees,
76
-    termsConditions: TermsConditions,
77
-    bank: bank,
78
-    role: Roles,
79
-    nonRegIndividual: NonRegIndividuals
80
-  }
81
-});
45
+    modules: {
46
+        myWeeks: MyWeeks,
47
+        timeshare: TimeshareModule,
48
+        users: UsersModule,
49
+        status: StatusModule,
50
+        unitConfiguration: UnitConfigurationModule,
51
+        region: RegionModule,
52
+        searchTab: SearchTabModule,
53
+        resort: ResortModule,
54
+        property: PropertyModule,
55
+        week: WeekModule,
56
+        propertyAdmin: PropertyAdminModule,
57
+        propertyList: PropertyList,
58
+        propertyTypes: PropertyTypes,
59
+        contactUsSources: ContactUsSources,
60
+        register: Register,
61
+        weekList: WeekList,
62
+        bid: Bid,
63
+        authentication: Authentication,
64
+        propertySearch: PropertySearch,
65
+        searchLog: SearchLog,
66
+        template: Template,
67
+        info: Info,
68
+        propertyEdit: PropertyEdit,
69
+        carousel: Carousel,
70
+        individual: Individual,
71
+        alert: Alert,
72
+        tenderWeek: TenderWeek,
73
+        payment: PaymentModule,
74
+        campaign: CampaignModule,
75
+        campaignItem: CampaignItemModule,
76
+        placeHolderFormat: PlaceHolderFormat,
77
+        fees: Fees,
78
+        termsConditions: TermsConditions,
79
+        bank: bank,
80
+        role: Roles,
81
+        nonRegIndividual: NonRegIndividuals,
82
+    },
83
+})

+ 78
- 0
src/store/modules/communication/contactUsSources.js Voir le fichier

@@ -0,0 +1,78 @@
1
+import axios from 'axios'
2
+
3
+export default {
4
+    namespaced: true,
5
+    state: {
6
+        contactUsSources: [],
7
+        contactUsSource: {
8
+            description: '',
9
+        },
10
+    },
11
+    mutations: {
12
+        setContactUsSources(state, sources) {
13
+            state.contactUsSources = sources
14
+        },
15
+        setContactUsSource(state, source) {
16
+            state.contactUsSource = source
17
+            console.log('here')
18
+            console.log(this.contactUsSource)
19
+        },
20
+        addToContactUsSources(state, source) {
21
+            state.contactUsSources.push(source)
22
+        },
23
+        updateContactUsSources(state, source) {
24
+            state.contactUsSources.find((item) => item.id === source.id).description =
25
+                source.description
26
+        },
27
+        clearContactUsSource(state) {
28
+            state.contactUsSource = {
29
+                description: '',
30
+            }
31
+        },
32
+        removeContactUsSource(state, id) {
33
+            state.contactUsSources.pop(
34
+                state.contactUsSources.find((p) => p.id === id),
35
+            )
36
+        },
37
+    },
38
+    getters: {},
39
+    actions: {
40
+        getContactUsSources({ commit }) {
41
+            axios
42
+                .get('/api/MailSource')
43
+                .then((result) => {
44
+                    commit('setContactUsSources', result.data)
45
+                })
46
+                .catch(console.error)
47
+        },
48
+        getContactUsSource({ commit }, id) {
49
+            axios
50
+                .get(`/api/MailSource/${id}`)
51
+                .then((result) => {
52
+                    commit('setContactUsSource', result.data)
53
+                })
54
+                .catch(console.error)
55
+        },
56
+        saveContactUsSource({ commit }, item) {
57
+            axios
58
+                .post('/api/MailSource', item)
59
+                .then((result) => commit('addToContactUsSources', result.data))
60
+                .catch(console.error)
61
+        },
62
+        updateContactUsSource({ commit }, item) {
63
+            axios
64
+                .put('/api/MailSource', item)
65
+                .then((result) => commit('updateContactUsSources', item))
66
+                .catch(console.error)
67
+        },
68
+        clearContactUsSource({ commit }) {
69
+            commit('clearContactUsSource')
70
+        },
71
+        deleteContactUsSource({ commit }, id) {
72
+            axios
73
+                .delete(`/api/MailSource/${id}`)
74
+                .then((result) => commit('removeContactUsSource', id))
75
+                .catch(console.error)
76
+        },
77
+    },
78
+}

+ 1
- 1
vue.config.js Voir le fichier

@@ -3,7 +3,7 @@ module.exports = {
3 3
         proxy: {
4 4
             '/api': {
5 5
                 target: 'http://localhost:57260/',
6
-                //target: "http://training.provision-sa.com:120/",
6
+                //target: 'http://training.provision-sa.com:120/',
7 7
                 //target: "https://www.pvsl.co.za:86/",
8 8
                 changeOrigin: true,
9 9
             },

Chargement…
Annuler
Enregistrer