Skip to content

Commit

Permalink
1.4.0 - Ra Ra Rasputin's Disco Tiara (#84)
Browse files Browse the repository at this point in the history
## 1.4.0 - Ra Ra Rasputin's Disco Tiara
**New Features**
* Now works out of the box with Fusion 3
* Added support for changing the default query via FUSION_CONFIG.js
* Added support for date range facets type
* Added support for simple grouped results
* New loading state for range facets to prevent multiple selections while page is loading

**Bug Fixes**
* When redirected through login, inital page query will no longer be cleared
* Linked URLS with parameters now click through correctly
* Only show pagination arrows when pagination is possible
* Fixed typeahead autocomplete user entry race condition

**Package Updates**
* Updated ESLint to version 3.3.1.
* Updated angular-ui-router to version 0.4.2

**Deprecated API functions**
* URLService.setQuery()

  Instead of using `URLService.setQuery()` use `QueryService.setQuery()`
  > `URLService.setQuery()` will be removed in View 1.5.0.
  • Loading branch information
JoshEllinger authored Feb 21, 2017
1 parent 4e29251 commit e8e1924
Show file tree
Hide file tree
Showing 65 changed files with 856 additions and 475 deletions.
20 changes: 7 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
/*eslint-disable */
module.exports = {
"rules": {
"indent": [
2,
2
],
"quotes": [
2,
"single"
],
"indent": ["error", 2, {"SwitchCase": 1 }],
"quotes": [ "error", "single"],
"linebreak-style": [
2,
"error",
"unix"
],
"semi": [
2,
"always"
"error",
"always"
],
"no-extra-semi": 1, // disallow unnecessary semicolons
"no-inner-declarations": 2, // disallow function or variable declarations in nested blocks
"no-extra-semi": "warn", // disallow unnecessary semicolons
"no-inner-declarations": "error", // disallow function or variable declarations in nested blocks
},
"extends": [
"eslint:recommended"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ FUSION_CONFIG.*.js
!FUSION_CONFIG.sample.js
.jira-prefix
.project
.vscode
installer/Output
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.2.0
30 changes: 27 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
# CHANGELOG

## 1.3.0 - Pikachu's Invisible Tiara
## 1.4.0 - Ra Ra Rasputin's Disco Tiara
**New Features**
* Now works out of the box with Fusion 3
* Added support for changing the default query via FUSION_CONFIG.js
* Added support for date range facets type
* Added support for simple grouped results
* New loading state for range facets to prevent multiple selections while page is loading

**Bug Fixes**
* When redirected through login, inital page query will no longer be cleared
* Linked URLS with parameters now click through correctly
* Only show pagination arrows when pagination is possible
* Fixed typeahead autocomplete user entry race condition

**Package Updates**
* Updated ESLint to version 3.3.1.
* Updated angular-ui-router to version 0.4.2

**Deprecated API functions**
* URLService.setQuery()

Instead of using `URLService.setQuery()` use `QueryService.setQuery()`
> `URLService.setQuery()` will be removed in View 1.5.0.
## 1.3.0 - Pikachu's Invisible Tiara - August 5, 2016
**New Features**
* Added a Windows packaged build, you can now run View on Windows
* Improved performance by minifying builds by default and turning off page change animations
Expand All @@ -13,8 +37,8 @@
## 1.2.0 - Cersei's Iron Tiara - June 30, 2016
**New Features**
* Now support range facet type
* Add multi select faceting, meaning you can facet on multiple items within a single query
* Add 'clear all' button to facet lists, clearing all selected facets
* Added multi select faceting, meaning you can facet on multiple items within a single query
* Added 'clear all' button to facet lists, clearing all selected facets
* Improved signals now pass in more information including position, language, and platform
* Enhanced signals service, adding additional functionality
* Improved field display in templates by setting set max-length
Expand Down
16 changes: 11 additions & 5 deletions FUSION_CONFIG.sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ appConfig = { //eslint-disable-line
// password: 'search-user-password-here'
},

// The name of your collection
collection: 'MyCollection',
// The name of your collection - defaults to Fusion 3.0 default collection
collection: 'default',

// Please specify a pipeline or profile that you want to leverage with this UI.
query_pipeline_id: 'default',
query_profile_id: 'default',
use_query_profile: true, // Force use of query-profile
use_query_profile: false, // Force use of query-profile

// Search UI Title
// This title appears in a number of places in the app, including page title.
Expand Down Expand Up @@ -191,7 +191,7 @@ appConfig = { //eslint-disable-line
* Typeahead or autocomplete shows you a number of suggested queries as you
* type in the search box.
*/
typeahead_use_query_profile: true,
typeahead_use_query_profile: false,
typeahead_query_pipeline_id: 'default',
typeahead_query_profile_id: 'default',
typeahead_fields: ['id'],
Expand All @@ -201,6 +201,12 @@ appConfig = { //eslint-disable-line
// @see https://lucidworks.com/blog/2016/02/04/fusion-plus-solr-suggesters-search-less-typing/

//typeahead_requesthandler: 'suggest', // recommended (requires configuration)
typeahead_requesthandler: 'select'
typeahead_requesthandler: 'select',

/**
* Default query
*
* If there is no query provided in the URL this query will be used. It is in object form.
*/
default_query: {q:'*'}
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Search results from different document types can use different templates. The `

## View on Windows

Download the latest view installer from <https://lucidworks.com/products/view> and run it **as an administrator**.
Download the latest view installer from <https://github.com/lucidworks/lucidworks-view/releases> and run it **as an administrator**.

## What's Next

Expand Down
10 changes: 6 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lucidworks-view",
"version": "1.3.0",
"version": "1.4.0",
"authors": [
"Lucidworks"
],
Expand All @@ -25,15 +25,17 @@
"foundation-apps": "~1.2.0",
"lodash": "https://github.com/lodash/lodash.git",
"ng-orwell": "~1.1.2",
"angucomplete-alt": "~2.2.0",
"angular-sanitize": "~1.4.10",
"angular-rison": "~0.0.13",
"angularjs-humanize": "master"
"angularjs-humanize": "master",
"angular-mass-autocomplete": "^0.5.0",
"angular-ui-router": "~0.4.2"
},
"devDependencies": {
"angular-mocks": "~1.4.10"
},
"resolutions": {
"angular": "1.3.x - 1.4.x"
"angular": "1.3.x - 1.4.x",
"angular-ui-router": "^0.4.2"
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<article class="grid-block document row">
<div class="detail vertical grid-content">
<h3 class="subheader">
<field value="vm.doc.id" maxlength="200"></field>
<field value="vm.doc._templateDisplayFields.id" maxlength="200"></field>
</h3>
<!-- Add your fields here. -->
</div>
<!-- Field with highlight. -->
<p class="large-8 xlarge-7 xx-large-6">
<field value="::vm.doc._templateDisplayFields.body" highlight="::vm.highlight[doc._templateDisplayFields.id]" hkey="{{::vm.getTemplateDisplayFieldName('body')}}"></field>
</p>
</div>
</article>
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,31 @@

}

function Controller(SignalsService) {
function Controller(DocumentService) {
'ngInject';
var vm = this;
var templateFields = Object.keys(vm.doc);
vm.getTemplateDisplayFieldName = getTemplateDisplayFieldName;

activate();

function activate() {
vm.postSignal = SignalsService.postClickSignal;
vm.doc = processDocument(vm.doc);
}

function processDocument(doc) {
//set properties needed for display
doc._templateDisplayFields = DocumentService.setTemplateDisplayFields(doc, templateFields);
doc._templateDisplayFields._lw_id_decoded = DocumentService.decodeFieldValue(doc._templateDisplayFields, 'id');

//set properties needed for signals
doc._signals = DocumentService.setSignalsProperties(doc, vm.position);

return doc;
}

function getTemplateDisplayFieldName(field){
return DocumentService.getTemplateDisplayFieldName(vm.doc, field);
}
}
})();
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,23 @@ <h5>categories:</h5>
every category in that result.
-->
<article class="grid-block document row">
<div class="image small-4 medium-2 grid-content" ng-class="::{hide:!vm.doc.lw_image}">
<div class="image small-4 medium-2 grid-content" ng-class="::{hide:!vm.doc.lw_image.value}">
<div zf-interchange="">
<img media="small" ng-src="{{::vm.doc.lw_image}}">
<img media="small" ng-src="{{::vm.doc.lw_image.value}}">
</div>
</div>
<div class="detail vertical grid-content" ng-class="::{'small-8':vm.doc.lw_image, 'medium-10': vm.doc.lw_image, 'small-12':!vm.doc.lw_image}">
<div class="detail vertical grid-content" ng-class="::{'small-8':vm.doc.lw_image.value, 'medium-10': vm.doc.lw_image.value, 'small-12':!vm.doc.lw_image.value}">
<!-- {{vm.doc}} -->
<!-- show head field linked with a url. -->
<h3 class="head-field" ng-if="::vm.doc.lw_url">
<a ng-href="{{::vm.doc.lw_url}}" ng-click="vm.postSignal({params: {lw_url: vm.doc.lw_url}})" rel="noopener" target="_blank">{{::vm.doc.lw_head}}</a>

<h3 class="head-field" ng-if="::vm.doc.lw_url.value">
<a ng-href="{{::vm.doc.lw_url.value}}" ng-click="vm.postSignal({params: {lw_url: vm.doc.lw_url.value}})" rel="noopener" target="_blank"><field value="::vm.doc.lw_head.value" hkey="{{::vm.doc.lw_head.key}}"></field></a>
</h3>
<!-- show head field without a url. -->
<h3 class="head-field" ng-if="::(!vm.doc.lw_url)">{{::vm.doc.lw_head}}</h3>
<h3 class="head-field" ng-if="::(!vm.doc.lw_url.value)"><field value="::vm.doc.lw_head.value" hkey="{{::vm.doc.lw_head.key}}"></field></h3>

<h4 class="subheader">{{::vm.doc.lw_subhead}}</h4>
<h4 class="subheader"><field value="::vm.doc.lw_subhead.value" hkey="{{::vm.doc.lw_subhead.key}}"></field></h4>
<p class="large-8 xlarge-7 xx-large-6">
{{::vm.doc.lw_description}}
<field value="::vm.doc.lw_description.value" highlight="::vm.highlight[doc.id]" maxlength="450" hkey="{{::vm.doc.lw_description.key}}"></field>
</p>
<!-- Output of CONFIG BASED FIELD DISPLAY -->
<p ng-repeat="(field, value) in vm.doc.fieldsToDisplay">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(function () {
angular.module('lucidworksView.components.document', ['lucidworksView.services.config',
'lucidworksView.utils.docs', 'lucidworksView.services.signals'
])
.directive('documentDefault', documentDefault);
'lucidworksView.utils.docs', 'lucidworksView.services.signals'
])
.directive('documentDefault', documentDefault);


function documentDefault() {
Expand All @@ -21,17 +21,22 @@
};
}

function Controller($log, $scope, DocsHelper, ConfigService, SignalsService, PaginateService) {
function Controller($log, $scope, DocsHelper, ConfigService, SignalsService, PaginateService, DocumentService) {
'ngInject';
var vm = this;
vm.postSignal = postSignal;
var templateFields = [];
var specialFields = ['head', 'subhead', 'description', 'image', 'head_url'];

activate();

///////////

function activate() {
vm.doc = processDocument(DocsHelper.concatMultivaluedFields(vm.doc));
_.forEach(specialFields, function(fieldType) {
templateFields.push(ConfigService.getFields.get(fieldType));
});
}

/**
Expand All @@ -53,20 +58,32 @@
ConfigService.getFieldLabels()
);

doc.lw_head = getField('head', doc) ?
getField('head', doc) : 'Title Field Not Found';
doc.lw_head = {
key: getTemplateDisplayFieldName(ConfigService.getFields.get('head')),
value: getField('head', doc) ? getField('head', doc) : 'Title Field Not Found'
};

doc.lw_subhead = getField('subhead', doc);
doc.lw_subhead = {
key: getTemplateDisplayFieldName(ConfigService.getFields.get('subhead')),
value: getField('subhead', doc)
};

doc.lw_description = getField('description', doc);
doc.lw_description = {
key: getTemplateDisplayFieldName(ConfigService.getFields.get('description')),
value: getField('description', doc)
};

doc.lw_image = getField('image', doc);
doc.lw_image = {
key: getTemplateDisplayFieldName(ConfigService.getFields.get('image')),
value: getField('image', doc) ? DocumentService.decodeFieldValue(doc, ConfigService.getFields.get('image')) : null
};

doc.lw_url = getField('head_url', doc);
doc.lw_url = {
key: getTemplateDisplayFieldName(ConfigService.getFields.get('head_url')),
value: getField('head_url', doc) ? DocumentService.decodeFieldValue(doc, ConfigService.getFields.get('head_url')) : null
};

doc.__signals_doc_id__ = SignalsService.getSignalsDocumentId(doc);
doc.position = vm.position;
doc.page = PaginateService.getNormalizedCurrentPage();
doc._signals = DocumentService.setSignalsProperties(doc, vm.position);

return doc;
}
Expand All @@ -86,15 +103,11 @@
}

function postSignal(options){
var paramsObj = {
params: {
position: vm.doc.position,
page: vm.doc.page
}
};
_.defaultsDeep(paramsObj, options);
SignalsService.postClickSignal(vm.doc.__signals_doc_id__, paramsObj);
DocumentService.postSignal(vm.doc._signals, options);
}

function getTemplateDisplayFieldName(field){
return DocumentService.getTemplateDisplayFieldName(vm.doc, field);
}
}
})();
22 changes: 11 additions & 11 deletions client/assets/components/document/document_file/document_file.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<article class="grid-block document document-file row">
<div class="detail vertical grid-content">
<field class="subheader" value="::vm.doc.id" maxlength="200"></field>
<field class="subheader" value="::vm.doc._templateDisplayFields.id" maxlength="200"></field>
<div class="large-8 xlarge-7 xx-large-6">
<div class="size" ng-if="::vm.doc.length_l">
<span class="doc-label">size:</span> <field value="::vm.doc.length_lFormatted"></field>
<div class="size" ng-if="::vm.doc._templateDisplayFields.length">
<span class="doc-label">size:</span> <field value="::vm.doc._templateDisplayFields.length | humanizeFilesize"></field>
</div>
<div class="mimetype" ng-if="::vm.doc.mimeType_s">
<span class="doc-label">mimetype:</span> <field value="::vm.doc.mimeType_s" highlight="::vm.highlight[doc.id]" maxlength="200"
hkey="mimeType_s"></field>
<div class="mimetype" ng-if="::vm.doc._templateDisplayFields.mimeType">
<span class="doc-label">mimetype:</span> <field value="::vm.doc._templateDisplayFields.mimeType" highlight="::vm.highlight[doc._templateDisplayFields.id]" maxlength="200"
hkey="{{::vm.getTemplateDisplayFieldName('mimeType')}}"></field>
</div>
<div class="owner" ng-if="::vm.doc.owner_s">
<span class="doc-label">owner:</span> <field value="::vm.doc.owner_s" highlight="::vm.highlight[doc.id]" maxlength="200"
hkey="owner_s"></field>
<div class="owner" ng-if="::vm.doc._templateDisplayFields.owner">
<span class="doc-label">owner:</span> <field value="::vm.doc._templateDisplayFields.owner" highlight="::vm.highlight[doc._templateDisplayFields.id]" maxlength="200"
hkey="{{::vm.getTemplateDisplayFieldName('owner')}}"></field>
</div>
<div class="last-modified" ng-if="::vm.doc.lastModified_dt">
<span class="doc-label">last modified:</span> <field value="::vm.doc.lastModified_dtFormatted"></field> UTC
<div class="last-modified" ng-if="::vm.doc._templateDisplayFields.lastModified">
<span class="doc-label">last modified:</span> <field value="::vm.doc._templateDisplayFields.lastModified | date"></field> UTC
</div>

</div>
Expand Down
Loading

0 comments on commit e8e1924

Please sign in to comment.