You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ar...@apache.org on 2016/08/13 22:04:57 UTC
lucene-solr:master: SOLR-9002: Fix type mapping for JSON and text
This is for the Admin UI's collection/File screen
Repository: lucene-solr
Updated Branches:
refs/heads/master c9faa102f -> 97dc5a2a0
SOLR-9002: Fix type mapping for JSON and text
This is for the Admin UI's collection/File screen
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/97dc5a2a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/97dc5a2a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/97dc5a2a
Branch: refs/heads/master
Commit: 97dc5a2a0bd2a00e227cb7b6621f827f64b01457
Parents: c9faa10
Author: Alexandre Rafalovitch <ar...@apache.org>
Authored: Sun Aug 14 08:03:43 2016 +1000
Committer: Alexandre Rafalovitch <ar...@apache.org>
Committed: Sun Aug 14 08:03:43 2016 +1000
----------------------------------------------------------------------
solr/CHANGES.txt | 3 +++
solr/webapp/web/js/angular/controllers/files.js | 6 +++---
solr/webapp/web/js/angular/services.js | 2 ++
3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/97dc5a2a/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index cf93448..3c54bad 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -211,6 +211,9 @@ Bug Fixes
* SOLR-8715: Admin UI's Schema screen now works for fields with stored=false and some content indexed (Alexandre Rafalovitch)
* SOLR-8911: In Admin UI, enable scrolling for overflowing Versions and JVM property values
+
+* SOLR-9002: Admin UI now correctly displays json and text files in the collection/Files screen
+
Optimizations
----------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/97dc5a2a/solr/webapp/web/js/angular/controllers/files.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/angular/controllers/files.js b/solr/webapp/web/js/angular/controllers/files.js
index 1cb9e5c..00ea4b1 100644
--- a/solr/webapp/web/js/angular/controllers/files.js
+++ b/solr/webapp/web/js/angular/controllers/files.js
@@ -16,7 +16,7 @@
*/
var contentTypeMap = { xml : 'text/xml', html : 'text/html', js : 'text/javascript', json : 'application/json', 'css' : 'text/css' };
-var languages = {js: "javascript", xml:"xml", xsl:"xml", vm: "xml", html: "xml", json: "text", css: "css"};
+var languages = {js: "javascript", xml:"xml", xsl:"xml", vm: "xml", html: "xml", json: "json", css: "css"};
solrAdminApp.controller('FilesController',
function($scope, $rootScope, $routeParams, $location, Files, Constants) {
@@ -82,10 +82,10 @@ solrAdminApp.controller('FilesController',
Files.get({core: $routeParams.core, file: $scope.file, contentType: contentType}, function(data) {
$scope.content = data.data;
$scope.url = $scope.baseurl + data.config.url + "?" + $.param(data.config.params);
- if (contentType.indexOf("text/plain") && data.data.indexOf("<?xml") || data.data.indexOf("<!--")) {
+ if (contentType.indexOf("text/plain") && (data.data.indexOf("<?xml")>=0) || data.data.indexOf("<!--")>=0) {
$scope.lang = "xml";
} else {
- $scope.lang = languages[extension] || "text";
+ $scope.lang = languages[extension] || "txt";
}
});
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/97dc5a2a/solr/webapp/web/js/angular/services.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/angular/services.js b/solr/webapp/web/js/angular/services.js
index f050c9b..2413f94 100644
--- a/solr/webapp/web/js/angular/services.js
+++ b/solr/webapp/web/js/angular/services.js
@@ -207,6 +207,8 @@ solrAdminServices.factory('System',
"list": {},
"get": {method: "GET", interceptor: {
response: function(config) {return config;}
+ }, transformResponse: function(data) {
+ return data;
}}
});
}])