Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 1 | <template> |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 2 | <page-section :section-title="$t('pageInventory.powerSupplies')"> |
SurenNeware | 787635a | 2020-11-24 22:42:42 +0530 | [diff] [blame] | 3 | <b-row class="align-items-end"> |
Yoshie Muranaka | 130b1b6 | 2020-06-18 14:29:57 -0700 | [diff] [blame] | 4 | <b-col sm="6" md="5" xl="4"> |
Dixsie Wolmers | 9b22b49 | 2020-09-07 21:26:06 -0500 | [diff] [blame] | 5 | <search |
Sukanya Pandey | edb8a77 | 2020-10-29 11:33:42 +0530 | [diff] [blame] | 6 | @change-search="onChangeSearchInput" |
| 7 | @clear-search="onClearSearchInput" |
Dixsie Wolmers | 9b22b49 | 2020-09-07 21:26:06 -0500 | [diff] [blame] | 8 | /> |
Yoshie Muranaka | 130b1b6 | 2020-06-18 14:29:57 -0700 | [diff] [blame] | 9 | </b-col> |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 10 | <b-col sm="6" md="3" xl="2"> |
| 11 | <table-cell-count |
| 12 | :filtered-items-count="filteredRows" |
| 13 | :total-number-of-cells="powerSupplies.length" |
| 14 | ></table-cell-count> |
| 15 | </b-col> |
Yoshie Muranaka | 130b1b6 | 2020-06-18 14:29:57 -0700 | [diff] [blame] | 16 | </b-row> |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 17 | <b-table |
| 18 | sort-icon-left |
| 19 | no-sort-reset |
Sukanya Pandey | fde429e | 2020-09-14 20:48:39 +0530 | [diff] [blame] | 20 | hover |
SurenNeware | 5e25e28 | 2020-07-08 15:57:23 +0530 | [diff] [blame] | 21 | responsive="md" |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 22 | sort-by="health" |
SurenNeware | 307382e | 2020-07-27 20:45:14 +0530 | [diff] [blame] | 23 | show-empty |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 24 | :items="powerSupplies" |
| 25 | :fields="fields" |
| 26 | :sort-desc="true" |
| 27 | :sort-compare="sortCompare" |
Yoshie Muranaka | 130b1b6 | 2020-06-18 14:29:57 -0700 | [diff] [blame] | 28 | :filter="searchFilter" |
SurenNeware | 307382e | 2020-07-27 20:45:14 +0530 | [diff] [blame] | 29 | :empty-text="$t('global.table.emptyMessage')" |
SurenNeware | 156a0e6 | 2020-08-28 19:20:03 +0530 | [diff] [blame] | 30 | :empty-filtered-text="$t('global.table.emptySearchMessage')" |
Kenneth Fullbright | 4105785 | 2021-12-27 16:19:37 -0600 | [diff] [blame] | 31 | :busy="isBusy" |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 32 | @filtered="onFiltered" |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 33 | > |
| 34 | <!-- Expand chevron icon --> |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 35 | <template #cell(expandRow)="row"> |
Dixsie Wolmers | 8313376 | 2020-07-15 08:45:19 -0500 | [diff] [blame] | 36 | <b-button |
| 37 | variant="link" |
| 38 | data-test-id="hardwareStatus-button-expandPowerSupplies" |
Dixsie Wolmers | 30f11f8 | 2020-11-10 16:07:56 -0600 | [diff] [blame] | 39 | :title="expandRowLabel" |
| 40 | class="btn-icon-only" |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 41 | @click="toggleRowDetails(row)" |
Dixsie Wolmers | 8313376 | 2020-07-15 08:45:19 -0500 | [diff] [blame] | 42 | > |
Dixsie Wolmers | 30f11f8 | 2020-11-10 16:07:56 -0600 | [diff] [blame] | 43 | <icon-chevron /> |
SurenNeware | 6e2cb97 | 2020-12-24 20:58:16 +0530 | [diff] [blame] | 44 | <span class="sr-only">{{ expandRowLabel }}</span> |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 45 | </b-button> |
| 46 | </template> |
| 47 | |
| 48 | <!-- Health --> |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 49 | <template #cell(health)="{ value }"> |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 50 | <status-icon :status="statusIcon(value)" /> |
| 51 | {{ value }} |
| 52 | </template> |
| 53 | |
Farah Rasheed | db2940a | 2024-07-25 14:04:18 -0500 | [diff] [blame] | 54 | <!-- StatusState --> |
| 55 | <template #cell(statusState)="{ value }"> |
| 56 | <status-icon :status="statusStateIcon(value)" /> |
| 57 | {{ value }} |
| 58 | </template> |
| 59 | |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 60 | <template #row-details="{ item }"> |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 61 | <b-container fluid> |
| 62 | <b-row> |
| 63 | <b-col sm="6" xl="4"> |
| 64 | <dl> |
Dixsie Wolmers | 6b8aee9 | 2021-05-14 11:14:33 -0500 | [diff] [blame] | 65 | <!-- Name --> |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 66 | <dt>{{ $t('pageInventory.table.name') }}:</dt> |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 67 | <dd>{{ dataFormatter(item.name) }}</dd> |
Dixsie Wolmers | 6b8aee9 | 2021-05-14 11:14:33 -0500 | [diff] [blame] | 68 | <!-- Part number --> |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 69 | <dt>{{ $t('pageInventory.table.partNumber') }}:</dt> |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 70 | <dd>{{ dataFormatter(item.partNumber) }}</dd> |
Dixsie Wolmers | 6b8aee9 | 2021-05-14 11:14:33 -0500 | [diff] [blame] | 71 | <!-- Serial number --> |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 72 | <dt>{{ $t('pageInventory.table.serialNumber') }}:</dt> |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 73 | <dd>{{ dataFormatter(item.serialNumber) }}</dd> |
Dixsie Wolmers | 6b8aee9 | 2021-05-14 11:14:33 -0500 | [diff] [blame] | 74 | <!-- Spare part number --> |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 75 | <dt>{{ $t('pageInventory.table.sparePartNumber') }}:</dt> |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 76 | <dd>{{ dataFormatter(item.sparePartNumber) }}</dd> |
Dixsie Wolmers | 6b8aee9 | 2021-05-14 11:14:33 -0500 | [diff] [blame] | 77 | <!-- Model --> |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 78 | <dt>{{ $t('pageInventory.table.model') }}:</dt> |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 79 | <dd>{{ dataFormatter(item.model) }}</dd> |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 80 | </dl> |
| 81 | </b-col> |
| 82 | <b-col sm="6" xl="4"> |
| 83 | <dl> |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 84 | <!-- Status state --> |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 85 | <dt>{{ $t('pageInventory.table.statusState') }}:</dt> |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 86 | <dd>{{ dataFormatter(item.statusState) }}</dd> |
Dixsie Wolmers | 6b8aee9 | 2021-05-14 11:14:33 -0500 | [diff] [blame] | 87 | <!-- Status Health rollup state --> |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 88 | <dt>{{ $t('pageInventory.table.statusHealthRollup') }}:</dt> |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 89 | <dd>{{ dataFormatter(item.statusHealth) }}</dd> |
Dixsie Wolmers | 6b8aee9 | 2021-05-14 11:14:33 -0500 | [diff] [blame] | 90 | <!-- Efficiency percent --> |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 91 | <dt>{{ $t('pageInventory.table.efficiencyPercent') }}:</dt> |
Glukhov Mikhail | d0b078f | 2022-12-24 12:16:53 +0300 | [diff] [blame] | 92 | <dd> |
| 93 | {{ dataFormatter(item.efficiencyPercent) }} |
| 94 | {{ $t('unit.Percent') }} |
| 95 | </dd> |
Dixsie Wolmers | 6b8aee9 | 2021-05-14 11:14:33 -0500 | [diff] [blame] | 96 | <!-- Power input watts --> |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 97 | <dt>{{ $t('pageInventory.table.powerInputWatts') }}:</dt> |
Glukhov Mikhail | d0b078f | 2022-12-24 12:16:53 +0300 | [diff] [blame] | 98 | <dd> |
| 99 | {{ dataFormatter(item.powerInputWatts) }} |
| 100 | {{ $t('unit.W') }} |
| 101 | </dd> |
Dixsie Wolmers | 6b8aee9 | 2021-05-14 11:14:33 -0500 | [diff] [blame] | 102 | </dl> |
| 103 | </b-col> |
| 104 | </b-row> |
| 105 | <div class="section-divider mb-3 mt-3"></div> |
| 106 | <b-row> |
| 107 | <b-col sm="6" xl="4"> |
| 108 | <dl> |
| 109 | <!-- Manufacturer --> |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 110 | <dt>{{ $t('pageInventory.table.manufacturer') }}:</dt> |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 111 | <dd>{{ dataFormatter(item.manufacturer) }}</dd> |
Dixsie Wolmers | 6b8aee9 | 2021-05-14 11:14:33 -0500 | [diff] [blame] | 112 | </dl> |
| 113 | </b-col> |
| 114 | <b-col sm="6" xl="4"> |
| 115 | <dl> |
| 116 | <!-- Firmware version --> |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 117 | <dt>{{ $t('pageInventory.table.firmwareVersion') }}:</dt> |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 118 | <dd>{{ dataFormatter(item.firmwareVersion) }}</dd> |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 119 | </dl> |
| 120 | </b-col> |
| 121 | </b-row> |
| 122 | </b-container> |
| 123 | </template> |
| 124 | </b-table> |
| 125 | </page-section> |
| 126 | </template> |
| 127 | |
| 128 | <script> |
| 129 | import PageSection from '@/components/Global/PageSection'; |
| 130 | import IconChevron from '@carbon/icons-vue/es/chevron--down/20'; |
| 131 | |
| 132 | import StatusIcon from '@/components/Global/StatusIcon'; |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 133 | import TableCellCount from '@/components/Global/TableCellCount'; |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 134 | import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin'; |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 135 | import TableSortMixin from '@/components/Mixins/TableSortMixin'; |
Yoshie Muranaka | 130b1b6 | 2020-06-18 14:29:57 -0700 | [diff] [blame] | 136 | import Search from '@/components/Global/Search'; |
SurenNeware | ba91c49 | 2020-10-27 14:18:54 +0530 | [diff] [blame] | 137 | import SearchFilterMixin, { |
| 138 | searchFilter, |
| 139 | } from '@/components/Mixins/SearchFilterMixin'; |
| 140 | import TableRowExpandMixin, { |
| 141 | expandRowLabel, |
| 142 | } from '@/components/Mixins/TableRowExpandMixin'; |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame] | 143 | import { useI18n } from 'vue-i18n'; |
| 144 | import i18n from '@/i18n'; |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 145 | |
| 146 | export default { |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 147 | components: { IconChevron, PageSection, StatusIcon, Search, TableCellCount }, |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 148 | mixins: [ |
| 149 | TableRowExpandMixin, |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 150 | DataFormatterMixin, |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 151 | TableSortMixin, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 152 | SearchFilterMixin, |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 153 | ], |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 154 | data() { |
| 155 | return { |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame] | 156 | $t: useI18n().t, |
Kenneth Fullbright | 4105785 | 2021-12-27 16:19:37 -0600 | [diff] [blame] | 157 | isBusy: true, |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 158 | fields: [ |
| 159 | { |
| 160 | key: 'expandRow', |
| 161 | label: '', |
| 162 | tdClass: 'table-row-expand', |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 163 | sortable: false, |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 164 | }, |
| 165 | { |
| 166 | key: 'id', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame] | 167 | label: i18n.global.t('pageInventory.table.id'), |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 168 | formatter: this.dataFormatter, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 169 | sortable: true, |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 170 | }, |
| 171 | { |
| 172 | key: 'health', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame] | 173 | label: i18n.global.t('pageInventory.table.health'), |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 174 | formatter: this.dataFormatter, |
Dixsie Wolmers | a04d46f | 2020-10-22 06:34:56 -0500 | [diff] [blame] | 175 | sortable: true, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 176 | tdClass: 'text-nowrap', |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 177 | }, |
| 178 | { |
Farah Rasheed | db2940a | 2024-07-25 14:04:18 -0500 | [diff] [blame] | 179 | key: 'statusState', |
Surya Venkatesan | 825059a | 2024-10-04 19:40:42 +0530 | [diff] [blame^] | 180 | label: i18n.global.t('pageInventory.table.state'), |
Farah Rasheed | db2940a | 2024-07-25 14:04:18 -0500 | [diff] [blame] | 181 | formatter: this.dataFormatter, |
| 182 | tdClass: 'text-nowrap', |
| 183 | }, |
| 184 | { |
Dixsie Wolmers | 6b8aee9 | 2021-05-14 11:14:33 -0500 | [diff] [blame] | 185 | key: 'locationNumber', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame] | 186 | label: i18n.global.t('pageInventory.table.locationNumber'), |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 187 | formatter: this.dataFormatter, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 188 | sortable: true, |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 189 | }, |
| 190 | { |
Dixsie Wolmers | 6b8aee9 | 2021-05-14 11:14:33 -0500 | [diff] [blame] | 191 | key: 'identifyLed', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame] | 192 | label: i18n.global.t('pageInventory.table.identifyLed'), |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 193 | formatter: this.dataFormatter, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 194 | }, |
Yoshie Muranaka | 130b1b6 | 2020-06-18 14:29:57 -0700 | [diff] [blame] | 195 | ], |
SurenNeware | ba91c49 | 2020-10-27 14:18:54 +0530 | [diff] [blame] | 196 | searchFilter: searchFilter, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 197 | searchTotalFilteredRows: 0, |
SurenNeware | ba91c49 | 2020-10-27 14:18:54 +0530 | [diff] [blame] | 198 | expandRowLabel: expandRowLabel, |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 199 | }; |
| 200 | }, |
| 201 | computed: { |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 202 | filteredRows() { |
| 203 | return this.searchFilter |
| 204 | ? this.searchTotalFilteredRows |
| 205 | : this.powerSupplies.length; |
| 206 | }, |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 207 | powerSupplies() { |
| 208 | return this.$store.getters['powerSupply/powerSupplies']; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 209 | }, |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 210 | }, |
| 211 | created() { |
MichalX Szopinski | dca9b0a | 2021-05-07 13:14:50 +0200 | [diff] [blame] | 212 | this.$store.dispatch('powerSupply/getAllPowerSupplies').finally(() => { |
Gunnar Mills | defc9e2 | 2020-07-07 20:29:03 -0500 | [diff] [blame] | 213 | // Emit initial data fetch complete to parent component |
Sukanya Pandey | edb8a77 | 2020-10-29 11:33:42 +0530 | [diff] [blame] | 214 | this.$root.$emit('hardware-status-power-supplies-complete'); |
Kenneth Fullbright | 4105785 | 2021-12-27 16:19:37 -0600 | [diff] [blame] | 215 | this.isBusy = false; |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 216 | }); |
| 217 | }, |
| 218 | methods: { |
| 219 | sortCompare(a, b, key) { |
| 220 | if (key === 'health') { |
| 221 | return this.sortStatus(a, b, key); |
Farah Rasheed | db2940a | 2024-07-25 14:04:18 -0500 | [diff] [blame] | 222 | } else if (key === 'statusState') { |
| 223 | return this.sortStatusState(a, b, key); |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 224 | } |
Yoshie Muranaka | 130b1b6 | 2020-06-18 14:29:57 -0700 | [diff] [blame] | 225 | }, |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 226 | onFiltered(filteredItems) { |
| 227 | this.searchTotalFilteredRows = filteredItems.length; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 228 | }, |
Farah Rasheed | db2940a | 2024-07-25 14:04:18 -0500 | [diff] [blame] | 229 | /** |
| 230 | * Returns the icon to use for status state based on the given status. |
| 231 | * @param {string} status The status to determine the icon for. |
| 232 | * @return {string} The icon for the given status. |
| 233 | */ |
| 234 | statusStateIcon(status) { |
| 235 | switch (status) { |
| 236 | case 'Enabled': |
| 237 | return 'success'; |
| 238 | case 'Absent': |
| 239 | return 'warning'; |
| 240 | default: |
| 241 | return ''; |
| 242 | } |
| 243 | }, |
| 244 | /** |
| 245 | * Sorts the status state of two objects based on the provided key. |
| 246 | * @param {Object} a The first object to compare. |
| 247 | * @param {Object} b The second object to compare. |
| 248 | * @param {string} key The key to use for comparison. |
| 249 | */ |
| 250 | sortStatusState(a, b, key) { |
| 251 | const statusState = ['Enabled', 'Absent']; |
| 252 | return statusState.indexOf(a[key]) - statusState.indexOf(b[key]); |
| 253 | }, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 254 | }, |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 255 | }; |
| 256 | </script> |