mirror of https://github.com/MISP/MISP
fix: [eventTimeline] Refrsh attribute index when dragging. Fix #6958
parent
5f30ecf322
commit
43db6029db
|
@ -25,7 +25,7 @@ class AppController extends Controller
|
||||||
|
|
||||||
public $helpers = array('OrgImg', 'FontAwesome', 'UserName', 'DataPathCollector');
|
public $helpers = array('OrgImg', 'FontAwesome', 'UserName', 'DataPathCollector');
|
||||||
|
|
||||||
private $__queryVersion = '123';
|
private $__queryVersion = '124';
|
||||||
public $pyMispVersion = '2.4.138';
|
public $pyMispVersion = '2.4.138';
|
||||||
public $phpmin = '7.2';
|
public $phpmin = '7.2';
|
||||||
public $phprec = '7.4';
|
public $phprec = '7.4';
|
||||||
|
|
|
@ -66,11 +66,11 @@ var options = {
|
||||||
onMove: function(item, callback) {
|
onMove: function(item, callback) {
|
||||||
var newStart = moment(item.start.toISOString());
|
var newStart = moment(item.start.toISOString());
|
||||||
var newEnd = (item.end !== undefined && item.end !== null) ? moment(item.end.toISOString()) : null;
|
var newEnd = (item.end !== undefined && item.end !== null) ? moment(item.end.toISOString()) : null;
|
||||||
var c1 = item.first_seen !== null ? !item.first_seen.isSame(newStart) : true;
|
var fsChanged = item.first_seen !== null ? !item.first_seen.isSame(newStart) : true;
|
||||||
var c2 = item.last_seen !== null ? !item.last_seen.isSame(newEnd) && item.seen_enabled : true;
|
var lsChanged = item.last_seen !== null ? !item.last_seen.isSame(newEnd) && item.seen_enabled : false;
|
||||||
if (c1) {
|
if (fsChanged) {
|
||||||
if (item.first_seen === null) {
|
if (item.first_seen === null) {
|
||||||
if (!c2) {
|
if (!lsChanged) {
|
||||||
update_seen(item, 'first', newStart, true, undefined);
|
update_seen(item, 'first', newStart, true, undefined);
|
||||||
} else {
|
} else {
|
||||||
update_seen(
|
update_seen(
|
||||||
|
@ -92,14 +92,14 @@ var options = {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
update_seen(item, 'first', newStart, false, function() {
|
update_seen(item, 'first', newStart, !lsChanged, function() {
|
||||||
if (c2) {
|
if (lsChanged) {
|
||||||
update_seen(item, 'last', newEnd, true, undefined);
|
update_seen(item, 'last', newEnd, true, undefined);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (c2 && !c1) {
|
if (lsChanged && !fsChanged) {
|
||||||
update_seen(item, 'last', newEnd, true, undefined);
|
update_seen(item, 'last', newEnd, true, undefined);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -304,7 +304,7 @@ function fetch_form_and_submit(itemType, item, seenType, value, reflect, callbac
|
||||||
if (contain_seen_attribute(item)) {
|
if (contain_seen_attribute(item)) {
|
||||||
reflect_change(true, itemType, item.id, item);
|
reflect_change(true, itemType, item.id, item);
|
||||||
} else {
|
} else {
|
||||||
reflect_change(false, itemType, item.id, item);
|
reflect_change(true, itemType, item.id, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
form.remove()
|
form.remove()
|
||||||
|
|
Loading…
Reference in New Issue