@abi-software/map-side-bar 2.12.0-acupoints.1 → 2.12.0-acupoints.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-side-bar",
3
- "version": "2.12.0-acupoints.1",
3
+ "version": "2.12.0-acupoints.2",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
package/src/acupoints.js CHANGED
@@ -14,6 +14,7 @@ export const acupointEntries = {
14
14
  "Vasculature": "Test data",
15
15
  "Innervation": "Test data",
16
16
  "Curated": false,
17
+ "onMRI": true
17
18
  },
18
19
  "LU 2": {
19
20
  "Acupoint": "LU 2",
@@ -30,6 +31,7 @@ export const acupointEntries = {
30
31
  "Vasculature": "Test data",
31
32
  "Innervation": "Test data",
32
33
  "Curated": true,
34
+ "onMRI": true
33
35
  },
34
36
  "ST 3": {
35
37
  "Acupoint": "ST 3",
@@ -44,6 +46,25 @@ export const acupointEntries = {
44
46
  "Indications": "Test data",
45
47
  "Acupuncture Method": "Test data",
46
48
  "Vasculature": "Test data",
47
- "Innervation": "Test data"
49
+ "Innervation": "Test data",
50
+ "Curated": true,
51
+ "onMRI": false
52
+ },
53
+ "LR 4": {
54
+ "Acupoint": "LR 4",
55
+ "Label": "LR 4",
56
+ "Synonym": "Test data",
57
+ "UMLS CUI": "",
58
+ "Meridian": "STest data",
59
+ "Chinese Name": "Zhongfeng",
60
+ "English Name": "Not Available",
61
+ "Location": " z zxcxadadadzc.",
62
+ "Reference": "Test data",
63
+ "Indications": "Test data",
64
+ "Acupuncture Method": "Test data",
65
+ "Vasculature": "Test data",
66
+ "Innervation": "Test data",
67
+ "Curated": false,
68
+ "onMRI": false
48
69
  }
49
70
  }
@@ -22,11 +22,24 @@
22
22
  </el-row>
23
23
  <el-row>
24
24
  <span class="filterText">
25
- Display:&nbsp;&nbsp;
25
+ Curated:&nbsp;&nbsp;
26
26
  </span>
27
- <el-radio-group v-model="currentFilter" size="small" class="acuRadioGroup">
27
+ <el-radio-group v-model="currentFilters['curated']" size="small" class="acuRadioGroup">
28
28
  <el-radio-button
29
- v-for="(value, key) in filters"
29
+ v-for="(value, key) in curatedFilters"
30
+ :key="key"
31
+ :label="key"
32
+ :value="value"
33
+ />
34
+ </el-radio-group>
35
+ </el-row>
36
+ <el-row>
37
+ <span class="filterText">
38
+ On MRI:&nbsp;&nbsp;
39
+ </span>
40
+ <el-radio-group v-model="currentFilters['mri']" size="small" class="acuRadioGroup">
41
+ <el-radio-button
42
+ v-for="(value, key) in mriFilters"
30
43
  :key="key"
31
44
  :label="key"
32
45
  :value="value"
@@ -97,13 +110,24 @@ export default {
97
110
  },
98
111
  data: function () {
99
112
  return {
100
- filters: {
101
- "Curated Only": "Curated",
102
- "Uncurated Only": "Uncurated",
113
+ curatedFilters: {
114
+ "Yes": "Curated",
115
+ "No": "Uncurated",
116
+ "Both": "Both"
117
+ },
118
+ mriFilters: {
119
+ "Yes": "On",
120
+ "No": "Off",
103
121
  "Both": "Both"
104
122
  },
105
- currentFilter: "Both",
106
- previousFilter: undefined,
123
+ currentFilters: {
124
+ curated: "Both",
125
+ mri: "Both",
126
+ },
127
+ previousFilters: {
128
+ curated: "Both",
129
+ mri: "Both",
130
+ },
107
131
  previousInput: undefined,
108
132
  results: [],
109
133
  paginatedResults: [],
@@ -115,7 +139,16 @@ export default {
115
139
  }
116
140
  },
117
141
  watch: {
118
- currentFilter: {
142
+ "currentFilters.curated": {
143
+ handler: function () {
144
+ this.search(
145
+ this.searchInput,
146
+ this.numberPerPage,
147
+ this.page
148
+ )
149
+ },
150
+ },
151
+ "currentFilters.mri": {
119
152
  handler: function () {
120
153
  this.search(
121
154
  this.searchInput,
@@ -151,15 +184,23 @@ export default {
151
184
  search: function(input) {
152
185
  this.results = []
153
186
  if ((input !== this.previousInput) ||
154
- (this.currentFilter !== this.previousFilter)) {
155
- this.previousFilter = this.currentFilter
187
+ (this.currentFilters['curated'] !== this.previousFilters['curated']) ||
188
+ (this.currentFilters['mri'] !== this.previousFilters['mri'])
189
+ ) {
190
+ this.previousFilters['curated'] = this.currentFilters['curated'];
191
+ this.previousFilters['mri'] = this.currentFilters['mri'];
156
192
  this.previousInput = this.input
157
193
  let filteredList = Object.values(this.entry)
158
- if (this.currentFilter !== "Both") {
159
- const curated = this.currentFilter === "Curated" ? true : false
194
+ if (this.currentFilters['curated'] !== "Both") {
195
+ const curated = this.currentFilters['curated'] === "Curated" ? true : false
160
196
  filteredList = filteredList.filter(
161
197
  item => (item.Curated ? true : false) === curated)
162
198
  }
199
+ if (this.currentFilters['mri'] !== "Both") {
200
+ const curated = this.currentFilters['mri'] === "On" ? true : false
201
+ filteredList = filteredList.filter(
202
+ item => (item.onMRI ? true : false) === curated)
203
+ }
163
204
  if (input === "") {
164
205
  this.results = filteredList
165
206
  } else {