From a314ce445a615deb0072e18949e284b6929e84d2 Mon Sep 17 00:00:00 2001 From: rladines Date: Thu, 8 Sep 2016 13:29:51 -0500 Subject: [PATCH] Applied changes for Milestone 1.2.0 Applied changes for Milestone 1.2.0 --- lib/jquery-1.11.2/opengrid-query-builder.js | 49 ++++++++++---- src/css/ogrid-theme-blue.css | 71 +++++++++++++++++++-- src/css/ogrid.css | 45 +++++++++++++ src/index.html | 23 ++++--- src/js/custom/Config.js | 64 +++++++++++++++++-- src/js/custom/qsearch/FlexData.js | 34 +++++++++- src/js/custom/qsearch/FlexSearchBuilder.js | 3 +- src/js/ux/AdvancedSearch.js | 53 ++++++++++++--- src/js/ux/CommandBar.js | 13 +++- src/js/ux/Map.js | 52 ++++++++++++++- src/js/ux/QSearch.js | 64 ++++++++++++++++--- src/js/ux/TableView.js | 35 ++++++++-- src/js/ux/geofilter/GeoFilter.js | 2 +- 13 files changed, 445 insertions(+), 63 deletions(-) diff --git a/lib/jquery-1.11.2/opengrid-query-builder.js b/lib/jquery-1.11.2/opengrid-query-builder.js index 28fee73..25c8cdf 100644 --- a/lib/jquery-1.11.2/opengrid-query-builder.js +++ b/lib/jquery-1.11.2/opengrid-query-builder.js @@ -238,7 +238,8 @@ add_group: 'glyphicon glyphicon-plus-sign', add_rule: 'glyphicon glyphicon-plus', remove_group: 'glyphicon glyphicon-remove', - remove_rule: 'glyphicon glyphicon-remove', + //OpenGrid customization + remove_rule: 'glyphicon glyphicon-remove-circle', error: 'glyphicon glyphicon-warning-sign' } }; @@ -1355,6 +1356,20 @@ return false; }; + QueryBuilder.prototype.isNaturalLangChronoTimeValue = function(value) { + var o = chrono.parse(value); + if (o.length > 0) { + var v = o[0]; + if (v.tags) { + if (v.tags.ENTimeAgoFormatParser) + return true; + else + return false; + } + } + return false; + }; + /** * Returns an incremented group ID @@ -2726,20 +2741,23 @@ _getRuleValue: function(rule) { + //OpenGrid extension, translate system rule value if (rule.type === 'date') { //OpenGrid extension, translate system rule value if (this.isNaturalLangChronoValue(rule.value) ) { - //map to Mongo's current date time token - //this does not work for datetime values stored as numeric - //rule.value = '$currentDate'; - //assume: datetime on target is stored in Mongo as a numeric value representing Unix epoch in ms - return moment(chrono.parseDate(rule.value)).startOf('day').valueOf(); + if (this.isNaturalLangChronoTimeValue(rule.value)) + //include time value + return moment(chrono.parseDate(rule.value)).valueOf(); + else + //start of day (assume > to be only operator) + return moment(chrono.parseDate(rule.value)).startOf('day').valueOf(); } else return moment(rule.value, "MM/DD/YYYY hh:mm:ss a").valueOf(); } else return rule.value; + }, //assume only 'between' operator can be applied @@ -2748,10 +2766,18 @@ //map to Mongo's current date time token //assume: datetime on target is stored in Mongo as a numeric value representing Unix epoch in ms - if (i==1) - value = moment(chrono.parseDate(value)).endOf('day').valueOf(); - else - value = moment(chrono.parseDate(value)).startOf('day').valueOf(); + if (this.isNaturalLangChronoTimeValue(value)) { + //include time value, e.g. 5 hours ago, 30 minutes ago, etc + value = moment(chrono.parseDate(value)).valueOf(); + } else { + //between operation + if (i==1) + //2nd argument, use end of day time + value = moment(chrono.parseDate(value)).startOf('day').add(1, 'day').valueOf(); + else + //1st argument, use start of day time + value = moment(chrono.parseDate(value)).startOf('day').valueOf(); + } return value; } else { //assume: datetime on target is stored in Mongo as a numeric value representing Unix epoch in ms @@ -3527,7 +3553,8 @@ "__author": "Damien \"Mistic\" Sorel, http://www.strangeplanet.fr", "add_rule": "Add rule", "add_group": "Add group", - "delete_rule": "Delete", + //OpenGrid customization: removed Delete text + "delete_rule": "", "delete_group": "Delete", "conditions": { "AND": "AND", diff --git a/src/css/ogrid-theme-blue.css b/src/css/ogrid-theme-blue.css index 88f524f..13ede6a 100644 --- a/src/css/ogrid-theme-blue.css +++ b/src/css/ogrid-theme-blue.css @@ -65,14 +65,17 @@ html, body { .query-builder .rules-group-container { - padding: 10px 10px 6px; + padding: 5px 5px 0px 0px; + border:none !important; background: none !important; } .query-builder .rules-group-container .btn-success {background-color: #28303D !important; border-color:#73C4E1 !important;} #ogrid-ds-tabs .regtab a {background-color:transparent !important; border:1px #FFFFFF solid !important; border-radius: 10px; } -.query-builder .rules-group-container .btn-danger {color: #28303D; background-color:transparent !important; border-color: #28303D;} +.query-builder .rules-group-container .btn-danger {color: #28303D; background-color:transparent !important; border: none; + font-size: 1.5em;} #advSearchSave {color:#fff !important; background-color:#28303D !important; border-color:#2E6DA4 !important;} +.query-builder .rules-group-container .btn-danger:hover {opacity: 0.6; } ::-webkit-scrollbar-button:start:decrement, ::-webkit-scrollbar-button:end:increment { height: 0px; display: block; background-color: black;} @@ -181,13 +184,25 @@ html, body { } #advSearchSubmit, #advSearchReset, #advSearchSave { - width: 100px; + width: 120px; } + #advSearchSubmit { - margin-left: 10px; + margin-left: 35px; + position: fixed; + bottom: 35px; +} + + #advSearchReset { + position: fixed; + bottom: 35px; + margin-left: 165px; } +.ogrid-color-panel { + padding: 0px 10px 0px 10px !important; +} #autorefresh-panel .control-label { @@ -258,7 +273,10 @@ html, body { .ogrid-task-pane .rule-value-container .form-control { font-weight: 300; } - +.ogrid-color-options { + font-size: 12px !important; + text-decoration: underline; +} div#ogrid-dataset-filters.panel-body, div#ogrid-geo-filters.panel-body { padding-left: 0px; @@ -276,6 +294,17 @@ div#ogrid-dataset-filters.panel-body, div#ogrid-geo-filters.panel-body { font-size: 152%; } +.adv-bottom-commandbar { + background-color: #2480a0; + margin-left: -25px; + position: fixed; + bottom: 0px; + height: 80px; + width: 100%; + opacity: 1.0; + z-index: 8000; +} + /* Size when the advanced tabs header breaks */ @media (max-width: 342px) { #ogrid-adv-tabs a { @@ -315,4 +344,36 @@ div#ogrid-dataset-filters.panel-body, div#ogrid-geo-filters.panel-body { padding-left: 10px; font-size: 1.5em; } +} + +.header-center { + display: flex; + justify-content: center; + align-items: center; + height: 25px; + margin-right: 0 !important; + margin-top: 0 !important; +} + +#ogrid-footer .panel-title a { + padding-top: 0; + padding-bottom: 0; +} + +.ogrid-footer-panel { + border-width: 0; +} + +.ogrid-footer-panel-heading, .ogrid-footer-panel-heading .panel-title { + color: #fff !important; + background-color: #292e35 !important; + border-width: 0 !important; +} +.ogrid-nav-btn .active { + background-color: rgba(129, 131, 132, 0.97) !important; +} + +.leaflet-control-attribution { + /* adjusted due to increase in search results panel height */ + margin-bottom: 4px !important; } \ No newline at end of file diff --git a/src/css/ogrid.css b/src/css/ogrid.css index 1a0e410..be06dc8 100644 --- a/src/css/ogrid.css +++ b/src/css/ogrid.css @@ -430,6 +430,39 @@ h6 > a { .bootstrap-table .fixed-table-toolbar .columns div[title='Heat Map'] .dropdown-menu { width: 165px; } +.map-info { + padding: 6px 8px; + font: 14px/16px Arial, Helvetica, sans-serif; + background: white; + background: rgba(255,255,255,0.8); + box-shadow: 0 0 15px rgba(0,0,0,0.2); + border-radius: 5px; +} +.map-info h4 { + margin: 0 0 5px; + color: #777; +} + +.legend { + text-align: left; + line-height: 18px; + color: #555; +} + +.legend i { + width: 18px; + height: 18px; + float: left; + margin-right: 8px; + opacity: 0.7; +} + +.legend .ogrid-legend-circle { + border-radius: 50%; + width: 10px; + height: 10px; + margin-top: 4px; +} .ogrid-logo-small { width: 32px; @@ -437,4 +470,16 @@ h6 > a { /*padding-top: 9px;*/ margin-top: 10px; margin-left: 10px; +} + +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: 400; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } \ No newline at end of file diff --git a/src/index.html b/src/index.html index f58b016..edf9b9e 100644 --- a/src/index.html +++ b/src/index.html @@ -54,7 +54,7 @@
-
Datasets and Standard Filters
+
Select Data
-
Additional/Geo-spatial Filters
+
Select Location
@@ -266,9 +269,9 @@
-
- - +
+ +
@@ -279,9 +282,9 @@