[
https://issues.apache.org/jira/browse/METRON-1724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16588930#comment-16588930
]
ASF GitHub Bot commented on METRON-1724:
----------------------------------------
Github user tiborm commented on a diff in the pull request:
https://github.com/apache/metron/pull/1172#discussion_r211979831
--- Diff:
metron-interface/metron-alerts/src/app/pcap/pcap-filters/pcap-filters.component.ts
---
@@ -15,63 +15,116 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import {Component, Input, Output, EventEmitter, OnInit, OnChanges,
SimpleChanges} from '@angular/core';
+import {Component, Input, Output, EventEmitter, OnChanges, SimpleChanges}
from '@angular/core';
+import { FormGroup, FormControl, Validators, ValidationErrors } from
'@angular/forms';
+
import * as moment from 'moment/moment';
import { DEFAULT_TIMESTAMP_FORMAT } from '../../utils/constants';
import { PcapRequest } from '../model/pcap.request';
+const DEFAULT_END_TIME = new Date();
--- End diff --
I think the DEFAULT_START_TIME and DEFAULT_END_TIME as all uppercase
variables are a bit miss leading. These are not static finals like in java.
These are actually private constants. I suggest to rename them to normal
camelCase. DEFAULT_END_TIME might be reusable somewhere else but
DEFAULT_START_TIME in its current form really belongs to the filtering. I think
the same true to the validator and the transform functions too. Validator might
be reusable if we turn our other forms reactive too in the future. For me, the
question is how much we like to prepare our current code to an imagined future.
And how much it supports the understanding of the existing functionality. I
would leave it as it is right now but opened to refactor it if we see value in
it.
> Date/time validation missing in PCAP query
> ------------------------------------------
>
> Key: METRON-1724
> URL: https://issues.apache.org/jira/browse/METRON-1724
> Project: Metron
> Issue Type: Bug
> Reporter: Tibor Meller
> Priority: Major
>
> Validation formula should be the following:
> From < To < current date/time
>
> Validation messages:
> Selected date range is invalid. The "To" date must be later than the "From"
> date and the "To" date cannot be in the future.
> Source IP address format is invalid. Use valid v4IP format, for example,
> [192.168.0.1|http://192.168.0.1/].
> Source port is invalid. Port number must be within the range of 0-65535.
> Destination IP address format is invalid. Use valid v4IP format, for example,
> [192.168.0.1|http://192.168.0.1/].
> Destination port is invalid. Port number must be within the range of 0-65535.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)