geer-builder 1.2.937 → 1.2.938

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/GLeads.vue +39 -8
  2. package/package.json +1 -1
package/GLeads.vue CHANGED
@@ -16,6 +16,13 @@
16
16
  </q-btn>
17
17
  </q-bar> -->
18
18
 
19
+ <div class="q-pa-sm flex justify-center">
20
+ <q-btn-toggle v-model="lead_filter" no-caps rounded unelevated toggle-color="primary" :options="[
21
+ { label: 'All', value: 'all' },
22
+ { label: 'Activated', value: 'active' },
23
+ { label: 'Pending', value: 'inactive' }
24
+ ]" />
25
+ </div>
19
26
  <div class="list">
20
27
  <div @click="createSlot(lead)" v-for="lead in paginatedLeads" :key="lead.uid" class="item">
21
28
  <div class="name">{{ lead.full_name }}</div>
@@ -25,7 +32,7 @@
25
32
  <div class="location">{{ lead.location ? lead.location : "No Location Indicated" }}</div>
26
33
  </div>
27
34
  </div>
28
- <div class="q-pa-lg flex flex-center" v-if="lead_list.length > pagination.rowsPerPage">
35
+ <div class="q-pa-lg flex flex-center" v-if="filteredLeads.length > pagination.rowsPerPage">
29
36
  <q-pagination
30
37
  v-model="pagination.page"
31
38
  :max="totalPages"
@@ -70,7 +77,14 @@
70
77
  <q-space />
71
78
  </q-bar> -->
72
79
 
73
- <div v-if="lead_list.length > 0" class="list">
80
+ <div class="q-pa-sm flex justify-center">
81
+ <q-btn-toggle v-model="lead_filter" no-caps rounded unelevated toggle-color="primary" :options="[
82
+ { label: 'All', value: 'all' },
83
+ { label: 'Activated', value: 'active' },
84
+ { label: 'Pending', value: 'inactive' }
85
+ ]" />
86
+ </div>
87
+ <div v-if="filteredLeads.length > 0" class="list">
74
88
  <div @click="createSlot(lead)" v-for="lead in paginatedLeads" :key="lead.uid" class="item">
75
89
  <div class="name">{{ lead.full_name }}</div>
76
90
  <div class="email">{{ lead.email }}</div>
@@ -88,7 +102,7 @@
88
102
  </div>
89
103
  </div>
90
104
 
91
- <div class="q-pa-lg flex flex-center" v-if="lead_list.length > pagination.rowsPerPage">
105
+ <div class="q-pa-lg flex flex-center" v-if="filteredLeads.length > pagination.rowsPerPage">
92
106
  <q-pagination
93
107
  v-model="pagination.page"
94
108
  :max="totalPages"
@@ -128,6 +142,7 @@ export default
128
142
  is_profile_dialog_open: false,
129
143
  db_user: new DB_USER(),
130
144
  lead_list: [],
145
+ lead_filter: 'all',
131
146
  is_dialog_open : false,
132
147
  is_slot_create_dialog_open:false,
133
148
  lead_info:{},
@@ -154,14 +169,30 @@ export default
154
169
  this.is_dialog_open=true;
155
170
  }
156
171
  },
157
- computed: {
172
+ watch: {
173
+ lead_filter() {
174
+ this.pagination.page = 1;
175
+ }
176
+ },
177
+ computed: {
178
+ filteredLeads() {
179
+ if (this.lead_filter === 'active')
180
+ {
181
+ return this.lead_list.filter(function(lead) { return lead.slot_owned > 0; });
182
+ }
183
+ else if (this.lead_filter === 'inactive')
184
+ {
185
+ return this.lead_list.filter(function(lead) { return !lead.slot_owned || lead.slot_owned <= 0; });
186
+ }
187
+ return this.lead_list;
188
+ },
158
189
  paginatedLeads() {
159
- const start = (this.pagination.page - 1) * this.pagination.rowsPerPage;
160
- const end = start + this.pagination.rowsPerPage;
161
- return this.lead_list.slice(start, end);
190
+ var start = (this.pagination.page - 1) * this.pagination.rowsPerPage;
191
+ var end = start + this.pagination.rowsPerPage;
192
+ return this.filteredLeads.slice(start, end);
162
193
  },
163
194
  totalPages() {
164
- return Math.ceil(this.lead_list.length / this.pagination.rowsPerPage);
195
+ return Math.ceil(this.filteredLeads.length / this.pagination.rowsPerPage);
165
196
  }
166
197
  }
167
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geer-builder",
3
- "version": "1.2.937",
3
+ "version": "1.2.938",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {