Skip to content

Commit 5a91d37

Browse files
author
Milan Novacek
committed
Fix stop button, and add suppport for dots in ncn_id.
1 parent 2eecacc commit 5a91d37

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

app/scripts/views/IngestionAdminT5View.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,17 @@
161161
for (var i=0; i<scenarios.length; i++)
162162
{
163163
var ncn_id = scenarios[i].ncn_id;
164+
var enc_id = ncn_id.replace(".","\\.");
164165
var sc_id = scenarios[i].id;
165166

166-
that.$('#btn-ingest-scenario-' + ncn_id).on
167+
that.$('#btn-ingest-scenario-' + enc_id).on
167168
("click", _.bind(that.run_iet5_ajax, that, "ingestScenario", "Ingest", sc_id, ncn_id));
168-
that.$('#btn-delete-scenario-' + ncn_id).on
169+
that.$('#btn-delete-scenario-' + enc_id).on
169170
("click", _.bind(that.run_iet5_ajax, that, "deleteScenario", "Delete", sc_id, ncn_id));
170-
that.$('#btn-stop-scenario-' + ncn_id).on
171+
that.$('#btn-stop-scenario-' + enc_id).on
171172
("click", _.bind(that.run_iet5_ajax, that, "stopScenario", "Stop", sc_id, ncn_id));
172-
that.$('#btn-add-product-' + ncn_id).on("click", _.bind(that.onAddLocalProduct, that, sc_id, ncn_id));
173-
that.$('#btn-edit-scenario-' + ncn_id).on("click", _.bind(that.onEditScenario, that, ncn_id));
173+
that.$('#btn-add-product-' + enc_id).on("click", _.bind(that.onAddLocalProduct, that, sc_id, ncn_id));
174+
that.$('#btn-edit-scenario-' + enc_id).on("click", _.bind(that.onEditScenario, that, ncn_id));
174175

175176
}
176177
}
@@ -186,7 +187,7 @@
186187
return;
187188
}
188189

189-
if (ss.st_isav==0) {
190+
if (op != 'Stop' && ss.st_isav==0) {
190191
alert('Scenario '+ncn_id+'is locked - operation in progress');
191192
return;
192193
}
@@ -196,6 +197,8 @@
196197
var req = $.get(url);
197198

198199
this.change_pending = true;
200+
if (op == 'Stop') { this.change_pending = false; }
201+
199202
req.success(_.bind(function(result) {
200203
var st = JSON.parse(result).status;
201204
console.log("IngAdmT5: Axax status: " + st);

0 commit comments

Comments
 (0)