Skip to content

Commit f0e3945

Browse files
authored
Merge pull request #235 from NASA-IMPACT/205-when-changing-the-curation-status-the-frontend-dropdown-does-not-change
Make curation status update when changed
2 parents b0c2014 + 9156379 commit f0e3945

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

sde_indexing_helper/static/js/collection_list.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
let table = $('#collection_table').DataTable({
22
"order": [[0, 'asc']],
33
"paging": false,
4+
"stateSave": true,
45
"dom": 'BPfritip',
56
"select": true,
67
"buttons": [
@@ -122,9 +123,18 @@ function handleCurationStatusSelect() {
122123
7: "btn-info",
123124
8: "btn-secondary",
124125
}
125-
$(`#curation-status-button-${collection_id}`).text(curation_status_text);
126-
$(`#curation-status-button-${collection_id}`).removeClass('btn-light btn-danger btn-warning btn-info btn-success btn-primary');
127-
$(`#curation-status-button-${collection_id}`).addClass(color_choices[curation_status]);
126+
127+
$possible_buttons = $('body').find(`[id="curation-status-button-${collection_id}"]`);
128+
if ($possible_buttons.length > 1) {
129+
$button = $possible_buttons[1];
130+
$button = $($button);
131+
} else {
132+
$button = $(`#curation-status-button-${collection_id}`);
133+
}
134+
$button.text(curation_status_text);
135+
$button.removeClass('btn-light btn-danger btn-warning btn-info btn-success btn-primary btn-secondary');
136+
$button.addClass(color_choices[parseInt(curation_status)]);
137+
$('#collection_table').DataTable().searchPanes.rebuildPane(6);
128138

129139
postCurationStatus(collection_id, curation_status);
130140
});

0 commit comments

Comments
 (0)