Skip to content

Commit 10af0a9

Browse files
committed
Revert "modifying how we remove/replace rows in channel tables in order to keep original order"
This reverts commit bdf206a.
1 parent ae79a90 commit 10af0a9

File tree

3 files changed

+11
-56
lines changed

3 files changed

+11
-56
lines changed

src/channelTable/channelTablePlugin/ChannelTable.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,12 @@ define([
3737
let sortOptions = this.configuration.getConfiguration().sortOptions;
3838

3939
//If no persisted sort order, default to sorting by time system, ascending.
40-
// sortOptions = sortOptions || {
41-
// key: this.openmct.time.timeSystem().key,
42-
// direction: 'asc'
43-
// };
40+
sortOptions = sortOptions || {
41+
key: this.openmct.time.timeSystem().key,
42+
direction: 'asc'
43+
};
4444

45-
if (sortOptions) {
46-
this.tableRows.sortBy(sortOptions);
47-
}
48-
45+
this.tableRows.sortBy(sortOptions);
4946
this.tableRows.on('resetRowsFromAllData', this.resetRowsFromAllData);
5047
}
5148

src/channelTable/channelTablePlugin/ChannelTableRowCollection.js

+4-32
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ define(
2323

2424
addOrUpdateRow(row) {
2525
if (this.isLADRow(row)) {
26-
this.removeExistingByKeystring(row.objectKeyString);
27-
this.addRows([row]);
26+
this.removeRowsByObject(row.objectKeyString);
27+
super.addRows([row], 'add');
2828
}
2929
}
3030

@@ -38,7 +38,7 @@ define(
3838
return !isStaleData;
3939
}
4040

41-
addOne(item) {
41+
addOne (item) {
4242
if (item.isDummyRow) {
4343
this.ladMap.set(item.objectKeyString, this.rows.length);
4444
this.rows.push(item);
@@ -57,47 +57,19 @@ define(
5757
return false;
5858
}
5959

60-
addRows(rows) {
61-
let rowsToAdd = this.filterRows(rows);
62-
63-
rowsToAdd.forEach(this.addOne.bind(this));
64-
65-
// we emit filter no matter what to trigger
66-
// an update of visible rows
67-
if (rowsToAdd.length > 0) {
68-
this.emit('add', rowsToAdd);
69-
}
70-
}
71-
7260
removeAllRowsForObject(objectKeyString) {
7361
super.removeAllRowsForObject(objectKeyString);
7462
this.rebuildLadMap();
7563
}
7664

77-
removeExistingByKeystring(keyString) {
78-
let removed = [];
79-
80-
this.rows.forEach((row) => {
81-
if (row.objectKeyString === keyString) {
82-
removed.push(row);
83-
84-
return false;
85-
} else {
86-
return true;
87-
}
88-
});
89-
90-
this.emit('remove', removed);
91-
}
92-
9365
rebuildLadMap() {
9466
this.ladMap.clear();
9567
this.rows.forEach((row, index) => {
9668
this.ladMap.set(row.objectKeyString, index);
9769
});
9870
}
9971

100-
reorder(reorderPlan) {
72+
reorder (reorderPlan) {
10173
let oldRows = this.rows.slice();
10274
reorderPlan.forEach(reorderEvent => {
10375
let item = oldRows[reorderEvent.oldIndex];

src/services/mcws/MCWSClient.js

+2-16
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,9 @@ class MCWSClient {
5252
isJsonResponse = true;
5353
}
5454

55-
const urlObject = new URL(url);
56-
const urlParam = decodeURIComponent(urlObject.searchParams.get('url'));
57-
58-
// if it's a proxy request, need to dedupe possible output=json params
59-
if (urlParam) {
60-
const urlParamUrl = new URL(urlParam);
61-
const outputParam = urlParamUrl.searchParams.get('output');
62-
63-
if (isJsonResponse && outputParam === 'json') {
64-
delete options.params.output;
65-
}
66-
}
67-
68-
if (Object.keys(options.params).length > 0) {
69-
url += `?${new URLSearchParams(options.params)}`;
70-
}
55+
const params = new URLSearchParams(options.params);
7156

57+
url += `?${params}`;
7258
delete options.params;
7359
}
7460

0 commit comments

Comments
 (0)