From 99804b5e8f692e9bb6733f3a90a0c5808d8ef42b Mon Sep 17 00:00:00 2001 From: David Tsay <3614296+davetsay@users.noreply.github.com> Date: Mon, 15 May 2023 16:41:04 -0700 Subject: [PATCH 1/6] add example test_data for local development (#26) --- .gitignore | 2 - test_data/ChannelDictionary.json | 30 ++++ test_data/ChannelEnumerationDictionary.json | 30 ++++ test_data/EVRDictionary.json | 22 +++ test_data/Session.json | 170 ++++++++++++++++++++ 5 files changed, 252 insertions(+), 2 deletions(-) create mode 100644 test_data/ChannelDictionary.json create mode 100644 test_data/ChannelEnumerationDictionary.json create mode 100644 test_data/EVRDictionary.json create mode 100644 test_data/Session.json diff --git a/.gitignore b/.gitignore index b2b642d..862807e 100644 --- a/.gitignore +++ b/.gitignore @@ -32,8 +32,6 @@ protractor/logs # npm-debug log npm-debug.log -test_data/ - # auto-env files for those that use them. .env dist diff --git a/test_data/ChannelDictionary.json b/test_data/ChannelDictionary.json new file mode 100644 index 0000000..78bd672 --- /dev/null +++ b/test_data/ChannelDictionary.json @@ -0,0 +1,30 @@ +[ + { + "channel_id": "CPU-0001", + "channel_name": "CPU_UTIL", + "data_type": "FLOAT", + "something": "whatever", + "dn_units": "percentage", + "dn_to_eu": "OFF", + "eu_units": "none", + "channel_format": "F32" + }, + { + "channel_id": "ENG-0001", + "channel_name": "main_engine_turn_on", + "data_type": "ENUM", + "dn_units": "none", + "dn_to_eu": "OFF", + "eu_units": "none", + "channel_format": "I8" + }, + { + "channel_id": "ENG-0002", + "channel_name": "someone_set_us_up", + "data_type": "ENUM", + "dn_units": "none", + "dn_to_eu": "OFF", + "eu_units": "none", + "channel_format": "I8" + } +] diff --git a/test_data/ChannelEnumerationDictionary.json b/test_data/ChannelEnumerationDictionary.json new file mode 100644 index 0000000..214b24c --- /dev/null +++ b/test_data/ChannelEnumerationDictionary.json @@ -0,0 +1,30 @@ +[ + { + "channel_id": "ENG-0002", + "channel_type": "ENUM", + "channel_format": "I8", + "enum_value": "0", + "enum_string": "UNINITIALIZED" + }, + { + "channel_id": "ENG-0002", + "channel_type": "ENUM", + "channel_format": "I8", + "enum_value": "1", + "enum_string": "RECV_ONLY_STATE" + }, + { + "channel_id": "ENG-0002", + "channel_type": "ENUM", + "channel_format": "I8", + "enum_value": "2", + "enum_string": "ACTIVE_WINDOW" + }, + { + "channel_id": "ENG-0002", + "channel_type": "ENUM", + "channel_format": "I8", + "enum_value": "3", + "enum_string": "CONTINGENCY_STATE" + } +] diff --git a/test_data/EVRDictionary.json b/test_data/EVRDictionary.json new file mode 100644 index 0000000..4951934 --- /dev/null +++ b/test_data/EVRDictionary.json @@ -0,0 +1,22 @@ +[ + { + "record_type": "evr_dictionary", + "evr_id": "1", + "evr_name": "TEST_CBM_EVR_BKGD_DONE", + "level": "ACTIVITY_HI", + "module": "TEST_CBM", + "ops_cat": "", + "nargs": "5", + "format": "Established background state for mode %d with bkgd row %d, x-band id %d, uhf id %d, eha row %d" + }, + { + "record_type": "evr_dictionary", + "evr_id": "2", + "evr_name": "TEST_CBM_EVR_BKGD_START", + "level": "ACTIVITY_LO", + "module": "TEST_CBM", + "ops_cat": "", + "nargs": "5", + "format": "Start background state for mode %d with bkgd row %d, x-band id %d, uhf id %d, eha row %d" + } +] diff --git a/test_data/Session.json b/test_data/Session.json new file mode 100644 index 0000000..58f120f --- /dev/null +++ b/test_data/Session.json @@ -0,0 +1,170 @@ +[ + { + "record_type": "session", + "number": 1220, + "name": "someSessionName", + "type": "someSessionType", + "description": "Testing session for datas", + "user": "vista_test", + "host": "testbed1", + "downlink_connection_type": "", + "uplink_connection_type": "", + "start_time": "2016-01-01T12:14:33", + "end_time": "2016-01-01T12:14:33", + "output_directory": "/some/dir", + "output_dir_overridden": true, + "fsw_version": "1.3.0235", + "sse_version": "4.2.371", + "fsw_dictionary_directory": "/some/dir", + "sse_dictionary_directory": "/some/dir", + "input_format": "UNKNOWN", + "testbed_name": "zed", + "downlink_stream_id": "zorb", + "spacecraft_id": 127, + "ampcs_version": "R7.3", + "full_name": "session name full", + "fsw_downlink_host": "some host", + "fsw_uplink_host": "other host", + "fsw_downlink_port": 1234, + "fsw_uplink_port": 5678, + "sse_host": "someHost", + "sse_downlink_port": 1235, + "sse_uplink_port": 5679, + "input_file": "", + "topic": "ampcs.vista.testbed.peterr", + "jms_subtopic": "abcd", + "session_dss_id": 0, + "session_vcid": "", + "run_fsw_downlink": false, + "run_sse_downlink": false, + "run_uplink": false, + "database_session_key": "", + "database_session_host": "" + }, + { + "record_type": "session", + "number": 1244, + "name": "someSessionName", + "type": "someSessionType", + "description": "Testing session for datas", + "user": "vista_test", + "host": "testbed1", + "downlink_connection_type": "", + "uplink_connection_type": "", + "start_time": "2016-01-01T12:14:33", + "end_time": "2016-01-01T12:14:33", + "output_directory": "/some/dir", + "output_dir_overridden": true, + "fsw_version": "1.3.0235", + "sse_version": "4.2.371", + "fsw_dictionary_directory": "/some/dir", + "sse_dictionary_directory": "/some/dir", + "input_format": "UNKNOWN", + "testbed_name": "zed", + "downlink_stream_id": "zorb", + "spacecraft_id": 127, + "ampcs_version": "R7.3", + "full_name": "session name full", + "fsw_downlink_host": "some host", + "fsw_uplink_host": "other host", + "fsw_downlink_port": 1234, + "fsw_uplink_port": 5678, + "sse_host": "someHost", + "sse_downlink_port": 1235, + "sse_uplink_port": 5679, + "input_file": "", + "topic": "ampcs.vista.testbed.peterr", + "jms_subtopic": "abcd", + "session_dss_id": 0, + "session_vcid": "", + "run_fsw_downlink": false, + "run_sse_downlink": false, + "run_uplink": false, + "database_session_key": "", + "database_session_host": "" + }, + { + "record_type": "session", + "number": 1382, + "name": "someSessionName", + "type": "someSessionType", + "description": "Testing session for datas", + "user": "vista_test", + "host": "testbed1", + "downlink_connection_type": "", + "uplink_connection_type": "", + "start_time": "2016-01-01T12:14:33", + "end_time": "2016-01-01T12:14:33", + "output_directory": "/some/dir", + "output_dir_overridden": true, + "fsw_version": "1.3.0235", + "sse_version": "4.2.371", + "fsw_dictionary_directory": "/some/dir", + "sse_dictionary_directory": "/some/dir", + "input_format": "UNKNOWN", + "testbed_name": "zed", + "downlink_stream_id": "zorb", + "spacecraft_id": 127, + "ampcs_version": "R7.3", + "full_name": "session name full", + "fsw_downlink_host": "some host", + "fsw_uplink_host": "other host", + "fsw_downlink_port": 1234, + "fsw_uplink_port": 5678, + "sse_host": "someHost", + "sse_downlink_port": 1235, + "sse_uplink_port": 5679, + "input_file": "", + "topic": "ampcs.vista.testbed.dsanto", + "jms_subtopic": "abcd", + "session_dss_id": 0, + "session_vcid": "", + "run_fsw_downlink": false, + "run_sse_downlink": false, + "run_uplink": false, + "database_session_key": "", + "database_session_host": "" + }, + { + "record_type": "session", + "number": 1393, + "name": "someSessionName", + "type": "someSessionType", + "description": "Testing session for datas", + "user": "vista_test", + "host": "testbed1", + "downlink_connection_type": "", + "uplink_connection_type": "", + "start_time": "2016-01-01T12:14:33", + "end_time": "2016-01-01T12:14:33", + "output_directory": "/some/dir", + "output_dir_overridden": true, + "fsw_version": "1.3.0235", + "sse_version": "4.2.371", + "fsw_dictionary_directory": "/some/dir", + "sse_dictionary_directory": "/some/dir", + "input_format": "UNKNOWN", + "testbed_name": "zed", + "downlink_stream_id": "zorb", + "spacecraft_id": 127, + "ampcs_version": "R7.3", + "full_name": "session name full", + "fsw_downlink_host": "some host", + "fsw_uplink_host": "other host", + "fsw_downlink_port": 1234, + "fsw_uplink_port": 5678, + "sse_host": "someHost", + "sse_downlink_port": 1235, + "sse_uplink_port": 5679, + "input_file": "", + "topic": "ampcs.vista.testbed.dsanto", + "jms_subtopic": "abcd", + "session_dss_id": 0, + "session_vcid": "", + "run_fsw_downlink": false, + "run_sse_downlink": false, + "run_uplink": false, + "database_session_key": "", + "database_session_host": "" + } +] From bdf206a7a8341dfb34efe2a56fb908f101f10e2a Mon Sep 17 00:00:00 2001 From: Jamie V Date: Mon, 15 May 2023 16:52:38 -0700 Subject: [PATCH 2/6] modifying how we remove/replace rows in channel tables in order to keep original order --- .../channelTablePlugin/ChannelTable.js | 13 ++++--- .../ChannelTableRowCollection.js | 36 ++++++++++++++++--- src/services/mcws/MCWSClient.js | 18 ++++++++-- 3 files changed, 56 insertions(+), 11 deletions(-) diff --git a/src/channelTable/channelTablePlugin/ChannelTable.js b/src/channelTable/channelTablePlugin/ChannelTable.js index a334472..42f2008 100644 --- a/src/channelTable/channelTablePlugin/ChannelTable.js +++ b/src/channelTable/channelTablePlugin/ChannelTable.js @@ -37,12 +37,15 @@ define([ let sortOptions = this.configuration.getConfiguration().sortOptions; //If no persisted sort order, default to sorting by time system, ascending. - sortOptions = sortOptions || { - key: this.openmct.time.timeSystem().key, - direction: 'asc' - }; + // sortOptions = sortOptions || { + // key: this.openmct.time.timeSystem().key, + // direction: 'asc' + // }; - this.tableRows.sortBy(sortOptions); + if (sortOptions) { + this.tableRows.sortBy(sortOptions); + } + this.tableRows.on('resetRowsFromAllData', this.resetRowsFromAllData); } diff --git a/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js b/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js index f4c3539..a962a70 100644 --- a/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js +++ b/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js @@ -23,8 +23,8 @@ define( addOrUpdateRow(row) { if (this.isLADRow(row)) { - this.removeRowsByObject(row.objectKeyString); - super.addRows([row], 'add'); + this.removeExistingByKeystring(row.objectKeyString); + this.addRows([row]); } } @@ -38,7 +38,7 @@ define( return !isStaleData; } - addOne (item) { + addOne(item) { if (item.isDummyRow) { this.ladMap.set(item.objectKeyString, this.rows.length); this.rows.push(item); @@ -57,11 +57,39 @@ define( return false; } + addRows(rows) { + let rowsToAdd = this.filterRows(rows); + + rowsToAdd.forEach(this.addOne.bind(this)); + + // we emit filter no matter what to trigger + // an update of visible rows + if (rowsToAdd.length > 0) { + this.emit('add', rowsToAdd); + } + } + removeAllRowsForObject(objectKeyString) { super.removeAllRowsForObject(objectKeyString); this.rebuildLadMap(); } + removeExistingByKeystring(keyString) { + let removed = []; + + this.rows.forEach((row) => { + if (row.objectKeyString === keyString) { + removed.push(row); + + return false; + } else { + return true; + } + }); + + this.emit('remove', removed); + } + rebuildLadMap() { this.ladMap.clear(); this.rows.forEach((row, index) => { @@ -69,7 +97,7 @@ define( }); } - reorder (reorderPlan) { + reorder(reorderPlan) { let oldRows = this.rows.slice(); reorderPlan.forEach(reorderEvent => { let item = oldRows[reorderEvent.oldIndex]; diff --git a/src/services/mcws/MCWSClient.js b/src/services/mcws/MCWSClient.js index ca4df7a..d419214 100644 --- a/src/services/mcws/MCWSClient.js +++ b/src/services/mcws/MCWSClient.js @@ -52,9 +52,23 @@ class MCWSClient { isJsonResponse = true; } - const params = new URLSearchParams(options.params); + const urlObject = new URL(url); + const urlParam = decodeURIComponent(urlObject.searchParams.get('url')); + + // if it's a proxy request, need to dedupe possible output=json params + if (urlParam) { + const urlParamUrl = new URL(urlParam); + const outputParam = urlParamUrl.searchParams.get('output'); + + if (isJsonResponse && outputParam === 'json') { + delete options.params.output; + } + } + + if (Object.keys(options.params).length > 0) { + url += `?${new URLSearchParams(options.params)}`; + } - url += `?${params}`; delete options.params; } From 10af0a9c7e23efab18e9fa6835b6f6486a0571a7 Mon Sep 17 00:00:00 2001 From: Jamie V Date: Mon, 15 May 2023 16:58:51 -0700 Subject: [PATCH 3/6] Revert "modifying how we remove/replace rows in channel tables in order to keep original order" This reverts commit bdf206a7a8341dfb34efe2a56fb908f101f10e2a. --- .../channelTablePlugin/ChannelTable.js | 13 +++---- .../ChannelTableRowCollection.js | 36 +++---------------- src/services/mcws/MCWSClient.js | 18 ++-------- 3 files changed, 11 insertions(+), 56 deletions(-) diff --git a/src/channelTable/channelTablePlugin/ChannelTable.js b/src/channelTable/channelTablePlugin/ChannelTable.js index 42f2008..a334472 100644 --- a/src/channelTable/channelTablePlugin/ChannelTable.js +++ b/src/channelTable/channelTablePlugin/ChannelTable.js @@ -37,15 +37,12 @@ define([ let sortOptions = this.configuration.getConfiguration().sortOptions; //If no persisted sort order, default to sorting by time system, ascending. - // sortOptions = sortOptions || { - // key: this.openmct.time.timeSystem().key, - // direction: 'asc' - // }; + sortOptions = sortOptions || { + key: this.openmct.time.timeSystem().key, + direction: 'asc' + }; - if (sortOptions) { - this.tableRows.sortBy(sortOptions); - } - + this.tableRows.sortBy(sortOptions); this.tableRows.on('resetRowsFromAllData', this.resetRowsFromAllData); } diff --git a/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js b/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js index a962a70..f4c3539 100644 --- a/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js +++ b/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js @@ -23,8 +23,8 @@ define( addOrUpdateRow(row) { if (this.isLADRow(row)) { - this.removeExistingByKeystring(row.objectKeyString); - this.addRows([row]); + this.removeRowsByObject(row.objectKeyString); + super.addRows([row], 'add'); } } @@ -38,7 +38,7 @@ define( return !isStaleData; } - addOne(item) { + addOne (item) { if (item.isDummyRow) { this.ladMap.set(item.objectKeyString, this.rows.length); this.rows.push(item); @@ -57,39 +57,11 @@ define( return false; } - addRows(rows) { - let rowsToAdd = this.filterRows(rows); - - rowsToAdd.forEach(this.addOne.bind(this)); - - // we emit filter no matter what to trigger - // an update of visible rows - if (rowsToAdd.length > 0) { - this.emit('add', rowsToAdd); - } - } - removeAllRowsForObject(objectKeyString) { super.removeAllRowsForObject(objectKeyString); this.rebuildLadMap(); } - removeExistingByKeystring(keyString) { - let removed = []; - - this.rows.forEach((row) => { - if (row.objectKeyString === keyString) { - removed.push(row); - - return false; - } else { - return true; - } - }); - - this.emit('remove', removed); - } - rebuildLadMap() { this.ladMap.clear(); this.rows.forEach((row, index) => { @@ -97,7 +69,7 @@ define( }); } - reorder(reorderPlan) { + reorder (reorderPlan) { let oldRows = this.rows.slice(); reorderPlan.forEach(reorderEvent => { let item = oldRows[reorderEvent.oldIndex]; diff --git a/src/services/mcws/MCWSClient.js b/src/services/mcws/MCWSClient.js index d419214..ca4df7a 100644 --- a/src/services/mcws/MCWSClient.js +++ b/src/services/mcws/MCWSClient.js @@ -52,23 +52,9 @@ class MCWSClient { isJsonResponse = true; } - const urlObject = new URL(url); - const urlParam = decodeURIComponent(urlObject.searchParams.get('url')); - - // if it's a proxy request, need to dedupe possible output=json params - if (urlParam) { - const urlParamUrl = new URL(urlParam); - const outputParam = urlParamUrl.searchParams.get('output'); - - if (isJsonResponse && outputParam === 'json') { - delete options.params.output; - } - } - - if (Object.keys(options.params).length > 0) { - url += `?${new URLSearchParams(options.params)}`; - } + const params = new URLSearchParams(options.params); + url += `?${params}`; delete options.params; } From d72231d8a09d30824b419b26fe397e6e8b007bb3 Mon Sep 17 00:00:00 2001 From: David Tsay <3614296+davetsay@users.noreply.github.com> Date: Tue, 16 May 2023 09:10:10 -0700 Subject: [PATCH 4/6] Clear Historical Session table filters on close (#28) --- .../sessionSelector/historicalSessionSelector.vue | 1 + src/multipleHistoricalSessions/sessionTable/SessionTable.js | 5 +++++ test_data/Session.json | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/multipleHistoricalSessions/sessionSelector/historicalSessionSelector.vue b/src/multipleHistoricalSessions/sessionSelector/historicalSessionSelector.vue index 747d5f9..e8ea483 100644 --- a/src/multipleHistoricalSessions/sessionSelector/historicalSessionSelector.vue +++ b/src/multipleHistoricalSessions/sessionSelector/historicalSessionSelector.vue @@ -256,6 +256,7 @@ export default { this.closeOverlay(); }, closeOverlay() { + this.table.clearColumnFilters(); if (this.overlay) { this.overlay.dismiss(); delete this.overlay; diff --git a/src/multipleHistoricalSessions/sessionTable/SessionTable.js b/src/multipleHistoricalSessions/sessionTable/SessionTable.js index d32e39b..597cc73 100644 --- a/src/multipleHistoricalSessions/sessionTable/SessionTable.js +++ b/src/multipleHistoricalSessions/sessionTable/SessionTable.js @@ -95,6 +95,11 @@ export default class SessionTable extends TelemetryTable { this.tableRows.clearRowsFromTableAndFilter(rows); } + clearColumnFilters() { + Object.keys(this.tableRows.columnFilters) + .forEach(filter => this.tableRows.setColumnFilter(filter, '')); + } + clearAndUpdateData(data) { this.data = data; this.clearData(); diff --git a/test_data/Session.json b/test_data/Session.json index 58f120f..3489e6a 100644 --- a/test_data/Session.json +++ b/test_data/Session.json @@ -132,7 +132,7 @@ "type": "someSessionType", "description": "Testing session for datas", "user": "vista_test", - "host": "testbed1", + "host": "testbed2", "downlink_connection_type": "", "uplink_connection_type": "", "start_time": "2016-01-01T12:14:33", From 96690f46a4ce7c2854312b45544b0d1a742ba7bb Mon Sep 17 00:00:00 2001 From: David Tsay <3614296+davetsay@users.noreply.github.com> Date: Tue, 16 May 2023 17:10:24 -0700 Subject: [PATCH 5/6] fix packet view form due to core changes (#30) --- src/packetQuery/components/PacketQueryView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packetQuery/components/PacketQueryView.vue b/src/packetQuery/components/PacketQueryView.vue index 9495b2a..16e2d66 100644 --- a/src/packetQuery/components/PacketQueryView.vue +++ b/src/packetQuery/components/PacketQueryView.vue @@ -195,7 +195,7 @@ export default { this.initializeQueryModel(); - this.openmct.forms.showForm(formStructure, options) + this.openmct.forms.showCustomForm(formStructure, options) .then(this.resolveFormPromise.bind(this)); this.runQueryButton = this.formElement.querySelector('.c-button.c-button--major'); From e8846d325cc3f659d8ad58d1d24efaafbe2b6bb7 Mon Sep 17 00:00:00 2001 From: Jamie V Date: Tue, 16 May 2023 21:21:44 -0700 Subject: [PATCH 6/6] [Channel Tables] Preserve order of channels (#27) --- loader.js | 4 +++ .../channelTablePlugin/ChannelTable.js | 11 +++--- .../ChannelTableRowCollection.js | 35 +++++++++++++++---- src/services/mcws/MIO.js | 3 +- 4 files changed, 38 insertions(+), 15 deletions(-) diff --git a/loader.js b/loader.js index d0c0bf7..3d96142 100644 --- a/loader.js +++ b/loader.js @@ -127,6 +127,10 @@ define([ aboutHtml: insertBuildInfo(AboutTemplate), }); + // do not show telemetry if it falls out of bounds + // even if there is no new telemetry + openmct.telemetry.greedyLAD(false); + persistenceLoadedPromise.then(() => { openmct.start(); window.openmct = openmct; diff --git a/src/channelTable/channelTablePlugin/ChannelTable.js b/src/channelTable/channelTablePlugin/ChannelTable.js index a334472..cb2cf86 100644 --- a/src/channelTable/channelTablePlugin/ChannelTable.js +++ b/src/channelTable/channelTablePlugin/ChannelTable.js @@ -35,14 +35,11 @@ define([ this.tableRows = new ChannelTableRowCollection(this.openmct); let sortOptions = this.configuration.getConfiguration().sortOptions; - - //If no persisted sort order, default to sorting by time system, ascending. - sortOptions = sortOptions || { - key: this.openmct.time.timeSystem().key, - direction: 'asc' - }; - this.tableRows.sortBy(sortOptions); + if (sortOptions) { + this.tableRows.sortBy(sortOptions); + } + this.tableRows.on('resetRowsFromAllData', this.resetRowsFromAllData); } diff --git a/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js b/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js index f4c3539..cd28bc3 100644 --- a/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js +++ b/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js @@ -23,8 +23,7 @@ define( addOrUpdateRow(row) { if (this.isLADRow(row)) { - this.removeRowsByObject(row.objectKeyString); - super.addRows([row], 'add'); + this.addRows([row]); } } @@ -38,7 +37,7 @@ define( return !isStaleData; } - addOne (item) { + addOne(item) { if (item.isDummyRow) { this.ladMap.set(item.objectKeyString, this.rows.length); this.rows.push(item); @@ -48,20 +47,44 @@ define( if (this.isNewerThanLAD(item)) { let rowIndex = this.ladMap.get(item.objectKeyString); - let itemToReplace = this.rows[rowIndex]; this.rows[rowIndex] = item; - this.emit('remove', [itemToReplace]); + this.removeExistingByKeystring(item.objectKeyString); this.emit('add', [item]); return true; } return false; } + addRows(rows) { + let rowsToAdd = this.filterRows(rows); + + if (rowsToAdd.length > 0) { + rowsToAdd.forEach(this.addOne.bind(this)); + this.emit('add', rowsToAdd); + } + } + removeAllRowsForObject(objectKeyString) { super.removeAllRowsForObject(objectKeyString); this.rebuildLadMap(); } + removeExistingByKeystring(keyString) { + let removed = []; + + this.rows.forEach((row) => { + if (row.objectKeyString === keyString) { + removed.push(row); + + return false; + } else { + return true; + } + }); + + this.emit('remove', removed); + } + rebuildLadMap() { this.ladMap.clear(); this.rows.forEach((row, index) => { @@ -69,7 +92,7 @@ define( }); } - reorder (reorderPlan) { + reorder(reorderPlan) { let oldRows = this.rows.slice(); reorderPlan.forEach(reorderEvent => { let item = oldRows[reorderEvent.oldIndex]; diff --git a/src/services/mcws/MIO.js b/src/services/mcws/MIO.js index 329d1ea..984ad48 100644 --- a/src/services/mcws/MIO.js +++ b/src/services/mcws/MIO.js @@ -78,8 +78,7 @@ export default class MIO { } async getMetadata() { - const response = await this.request(this.metadataUrl, 'GET', { output: 'json' }); - const metadataResponse = await response.json(); + const metadataResponse = await this.request(this.metadataUrl, 'GET', { output: 'json' }); return { get(subject, predicate) {