From e6837e56725003d956dc9b6f626c6e90d4d71221 Mon Sep 17 00:00:00 2001 From: Alexei Peters Date: Wed, 28 Aug 2019 13:18:09 -0700 Subject: [PATCH 1/2] remove the provisional-filter and resource-type-filter from the search-results-filter and place in the base search.htm template, re #4771 --- arches/app/media/css/arches.css | 10 +- .../views/components/search/search-results.js | 4 - arches/app/media/js/views/search.js | 4 + .../components/search/search-results.htm | 114 +++++++----------- arches/app/templates/views/search.htm | 29 ++++- 5 files changed, 80 insertions(+), 81 deletions(-) diff --git a/arches/app/media/css/arches.css b/arches/app/media/css/arches.css index 2c54c51961d..90f3feec175 100644 --- a/arches/app/media/css/arches.css +++ b/arches/app/media/css/arches.css @@ -10975,26 +10975,26 @@ a.search-query-link-captions:focus { .search-control-container { -ms-flex: 0 0 400px; -webkit-flex: 0 0 400px; - flex: 0 0 400px; + flex: 1 0 400px; margin-bottom: 0px; background-color: #fafafa; - padding: 10px 20px 80px 20px; + /* padding: 10px 20px 80px 20px; */ border-right: solid 1px #dddddd; border-top: 1px solid #ddd; overflow-y: scroll; overflow-x: hidden; transition: all .5s; margin-top: inherit; - min-width: 400px; + /* min-width: 400px; */ z-index: 5; } .search-count-container { - height: 40px; + /* height: 40px; */ padding: 10px 20px 0px 20px; background: #f4f4f4; border-bottom: 1px solid #ddd; - margin: -10px -20px 10px -20px; + /* margin: -10px -20px 10px -20px; */ } .search-title { diff --git a/arches/app/media/js/views/components/search/search-results.js b/arches/app/media/js/views/components/search/search-results.js index 72802bf8240..70fba8953e9 100644 --- a/arches/app/media/js/views/components/search/search-results.js +++ b/arches/app/media/js/views/components/search/search-results.js @@ -25,13 +25,11 @@ function($, _, BaseFilter, bootstrap, arches, select2, ko, koMapping, viewdata) options.name = 'Search Results'; BaseFilter.prototype.initialize.call(this, options); - this.total = ko.observable(); this.results = ko.observableArray(); this.showRelationships = ko.observable(); this.mouseoverInstanceId = ko.observable(); this.relationshipCandidates = ko.observableArray(); this.selectedResourceId = ko.observable(null); - this.userIsReviewer = ko.observable(false); this.showRelationships.subscribe(function(res) { this.selectedResourceId(res.resourceinstanceid); @@ -77,10 +75,8 @@ function($, _, BaseFilter, bootstrap, arches, select2, ko, koMapping, viewdata) var data = $('div[name="search-result-data"]').data(); if (!!this.searchResults.results){ - this.total(this.searchResults.results.hits.total); this.results.removeAll(); this.selectedResourceId(null); - this.userIsReviewer(this.searchResults.reviewer); this.searchResults.results.hits.hits.forEach(function(result){ var graphdata = _.find(viewdata.graphs, function(graphdata){ return result._source.graph_id === graphdata.graphid; diff --git a/arches/app/media/js/views/search.js b/arches/app/media/js/views/search.js index 43fed14d051..ecddcb4ecb1 100644 --- a/arches/app/media/js/views/search.js +++ b/arches/app/media/js/views/search.js @@ -60,6 +60,7 @@ define([ this.query = ko.observable(getQueryObject()); this.mouseoverInstanceId = ko.observable(); this.mapLinkData = ko.observable(null); + this.userIsReviewer = ko.observable(false); this.searchResults = {'timestamp': ko.observable()}; this.selectPopup = function(componentname) { if(this.selectedPopup() !== '' && componentname === this.selectedPopup()) { @@ -91,6 +92,7 @@ define([ var SearchView = BaseManagerView.extend({ initialize: function(options) { this.viewModel.sharedStateObject = new CommonSearchViewModel(); + this.viewModel.total = ko.observable(); _.extend(this, this.viewModel.sharedStateObject); this.queryString = ko.computed(function() { @@ -126,6 +128,8 @@ define([ } }, this); this.viewModel.sharedStateObject.searchResults.timestamp(response.timestamp); + this.viewModel.sharedStateObject.userIsReviewer(response.reviewer); + this.viewModel.total(response.results.hits.total); this.viewModel.alert(false); }, error: function(response, status, error) { diff --git a/arches/app/templates/views/components/search/search-results.htm b/arches/app/templates/views/components/search/search-results.htm index 1664374c00d..2657c5cb636 100644 --- a/arches/app/templates/views/components/search/search-results.htm +++ b/arches/app/templates/views/components/search/search-results.htm @@ -2,95 +2,73 @@ {% load template_tags %} {% load i18n %} - -
- -
-

-
-
- -
- -
-
-
-
-
-
- From b7c85aa508ce0e54e953fe8951bfe8d584440bc3 Mon Sep 17 00:00:00 2001 From: Alexei Peters Date: Wed, 28 Aug 2019 13:47:00 -0700 Subject: [PATCH 2/2] remove paging-filter from search-results-filter and put in search.htm template, re #4771 --- arches/app/media/css/arches.css | 8 +- .../components/search/search-results.htm | 93 +++++++------------ arches/app/templates/views/search.htm | 43 +++++---- 3 files changed, 63 insertions(+), 81 deletions(-) diff --git a/arches/app/media/css/arches.css b/arches/app/media/css/arches.css index 90f3feec175..f434a337efc 100644 --- a/arches/app/media/css/arches.css +++ b/arches/app/media/css/arches.css @@ -10978,23 +10978,19 @@ a.search-query-link-captions:focus { flex: 1 0 400px; margin-bottom: 0px; background-color: #fafafa; - /* padding: 10px 20px 80px 20px; */ border-right: solid 1px #dddddd; border-top: 1px solid #ddd; overflow-y: scroll; overflow-x: hidden; transition: all .5s; margin-top: inherit; - /* min-width: 400px; */ z-index: 5; } .search-count-container { - /* height: 40px; */ padding: 10px 20px 0px 20px; background: #f4f4f4; border-bottom: 1px solid #ddd; - /* margin: -10px -20px 10px -20px; */ } .search-title { @@ -11124,7 +11120,9 @@ ul.pagination { padding-bottom: 0px; } -.search-results-container {} +.search-results-container { + padding: 19px; +} .calendar { display: table-cell; diff --git a/arches/app/templates/views/components/search/search-results.htm b/arches/app/templates/views/components/search/search-results.htm index 2657c5cb636..7bc93480198 100644 --- a/arches/app/templates/views/components/search/search-results.htm +++ b/arches/app/templates/views/components/search/search-results.htm @@ -2,73 +2,48 @@ {% load template_tags %} {% load i18n %} -
-
-