Prechádzať zdrojové kódy

[search] Fix range select color

Enrico Berti 11 rokov pred
rodič
commit
899b800

+ 3 - 0
apps/search/src/search/templates/search.mako

@@ -698,6 +698,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
     </span>
 
     <div data-bind="timelineChart: {datum: {counts: counts, extraSeries: extraSeries, widget_id: $parent.id(), label: label}, stacked: $root.collection.getFacetById($parent.id()).properties.stacked(), field: field, label: label, transformer: timelineChartDataTransformer,
+      fqs: $root.query.fqs,
       onSelectRange: function(from, to){ viewModel.collection.selectTimelineFacet({from: from, to: to, cat: field, widget_id: $parent.id()}) },
       onStateChange: function(state){ $root.collection.getFacetById($parent.id()).properties.stacked(state.stacked); },
       onClick: function(d){ viewModel.query.selectRangeFacet({count: d.obj.value, widget_id: $parent.id(), from: d.obj.from, to: d.obj.to, cat: d.obj.field}) },
@@ -726,6 +727,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
     </div>
 
     <div data-bind="barChart: {datum: {counts: counts, widget_id: $parent.id(), label: label}, stacked: false, field: field, label: label,
+      fqs: $root.query.fqs,
       transformer: barChartDataTransformer,
       onStateChange: function(state){ console.log(state); },
       onClick: function(d) {
@@ -947,6 +949,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
 <link rel="stylesheet" href="/static/css/bootstrap-spinedit.css">
 <link rel="stylesheet" href="/static/css/bootstrap-slider.css">
 <link rel="stylesheet" href="/static/ext/css/nv.d3.min.css">
+<link rel="stylesheet" href="/search/static/css/nv.d3.css">
 <link rel="stylesheet" href="/static/ext/chosen/chosen.min.css">
 
 <script src="/search/static/js/search.utils.js" type="text/javascript" charset="utf-8"></script>

+ 29 - 0
apps/search/static/css/nv.d3.css

@@ -0,0 +1,29 @@
+/*
+ Licensed to Cloudera, Inc. under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  Cloudera, Inc. licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+/*
+Overrides nvd3 classes
+*/
+
+.nvd3 .nv-brush .extent {
+  fill-opacity: .225 !important;
+}
+
+.nvd3 .nv-legend .disabled rect {
+  fill-opacity: 0;
+}

+ 2 - 8
apps/search/static/css/search.css

@@ -222,6 +222,8 @@
   font-size: 12px !important;
   font-weight: bold !important;
   line-height: 24px !important;
+  padding-left: 3px !important;
+  padding-right: 3px !important;
 }
 
 .card-widget .card-body {
@@ -365,14 +367,6 @@ em {
   background-color: yellow;
 }
 
-.nvd3 .nv-brush .extent {
-  fill-opacity: .225 !important;
-}
-
-.nvd3 .nv-legend .disabled rect {
-  fill-opacity: 0;
-}
-
 .fields-chooser li {
   cursor: pointer;
   margin-bottom: 10px;