update libs (#365)

* update libs

* update libs

* upgrade to latest search components
This commit is contained in:
Denys Vuika
2018-05-24 12:45:18 +01:00
committed by Cilibiu Bogdan
parent b78f97c79d
commit 2176d1eab7
7 changed files with 87 additions and 790 deletions

View File

@@ -1,5 +0,0 @@
{
"$schema": "https://on.cypress.io/cypress.schema.json",
"baseUrl": "http://localhost:4200",
"videoRecording": false
}

784
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -21,16 +21,12 @@
"start:docker": "docker-compose up -d --build && wait-on http://localhost:8080 && wait-on http://localhost:3000",
"stop:docker": "docker-compose stop",
"e2e:docker": "npm run start:docker && npm run e2e && npm run stop:docker",
"e2e:all": "npm run start:docker && npm run cypress:ci && npm run e2e && npm run stop:docker",
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"cypress:ci": "cypress run --browser chrome --config baseUrl=http://localhost:3000",
"spellcheck": "cspell 'src/**/*.ts' 'e2e/**/*.ts'"
},
"private": true,
"dependencies": {
"@alfresco/adf-content-services": "2.4.0-b599e3a41a62540e5337b97d4806efd2da41ef44",
"@alfresco/adf-core": "2.4.0-b599e3a41a62540e5337b97d4806efd2da41ef44",
"@alfresco/adf-content-services": "2.4.0-c5936e7db09d85eb50b06eacdc3a5f105aa9b7f9",
"@alfresco/adf-core": "2.4.0-c5936e7db09d85eb50b06eacdc3a5f105aa9b7f9",
"@angular/animations": "5.1.1",
"@angular/cdk": "5.0.1",
"@angular/common": "5.1.1",
@@ -48,7 +44,7 @@
"@mat-datetimepicker/moment": "1.0.1",
"@ngstack/electron": "0.1.0",
"@ngx-translate/core": "9.1.1",
"alfresco-js-api": "2.4.0-cbe2d189fafa5fc2c6e9f1b6d370faad9f6dd000",
"alfresco-js-api": "2.4.0-2dbba5b40321688b340f51a376e9a1114864e658",
"core-js": "2.5.3",
"cspell": "^2.1.12",
"hammerjs": "2.0.8",
@@ -68,7 +64,6 @@
"@types/selenium-webdriver": "^3.0.8",
"codacy-coverage": "^2.0.3",
"codelyzer": "^4.0.1",
"cypress": "^2.1.0",
"jasmine-core": "~2.8.0",
"jasmine-reporters": "^2.2.1",
"jasmine-spec-reporter": "~4.2.1",

View File

@@ -3,7 +3,8 @@
"application": {
"name": "Alfresco Example Content Application",
"logo": "assets/images/alfresco-logo-white.svg",
"copyright": "© 2017 - 2018 Alfresco Software, Inc. All rights reserved."
"copyright":
"© 2017 - 2018 Alfresco Software, Inc. All rights reserved."
},
"headerColor": "#2196F3",
"languagePicker": false,
@@ -19,8 +20,8 @@
"allowDownload": true,
"allowDelete": true
},
"sideNav" : {
"preserveState" : true,
"sideNav": {
"preserveState": true,
"expandedSidenav": true
},
"navigation": {
@@ -159,6 +160,39 @@
},
"search": {
"include": ["path", "allowableOperations"],
"sorting": {
"options": [
{
"key": "name",
"label": "Name",
"type": "FIELD",
"field": "cm:name",
"ascending": true
},
{
"key": "content.sizeInBytes",
"label": "Size",
"type": "FIELD",
"field": "content.size",
"ascending": true
},
{
"key": "description",
"label": "Description",
"type": "FIELD",
"field": "cm:description",
"ascending": true
}
],
"defaults": [
{
"key": "name",
"type": "FIELD",
"field": "cm:name",
"ascending": true
}
]
},
"filterQueries": [
{ "query": "TYPE:'cm:folder' OR TYPE:'cm:content'" },
{ "query": "NOT cm:creator:System" }

View File

@@ -14,8 +14,14 @@
<adf-search-filter #searchFilter></adf-search-filter>
<div class="adf-search-results__content">
<div class="adf-search-results__sorting">
<adf-search-sorting-picker></adf-search-sorting-picker>
</div>
<adf-document-list
#documentList
[showHeader]="false"
[sortingMode]="'server'"
[sorting]="sorting"
[attr.class]="documentList.isEmpty() ? 'adf-document-list--empty' : ''"
[node]="data">
</adf-document-list>

View File

@@ -17,6 +17,10 @@
border-left: 1px solid #eee;
}
&__sorting {
text-align: right;
}
.adf-search-filter {
min-width: 260px;
padding: 5px;

View File

@@ -27,6 +27,7 @@ import { Component, OnInit, Optional, ViewChild } from '@angular/core';
import { NodePaging, Pagination } from 'alfresco-js-api';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { SearchQueryBuilderService, SearchComponent as AdfSearchComponent } from '@alfresco/adf-content-services';
import { SearchConfigurationService } from '@alfresco/adf-core';
@Component({
selector: 'app-search',
@@ -43,10 +44,12 @@ export class SearchComponent implements OnInit {
data: NodePaging;
maxItems = 5;
skipCount = 0;
sorting = ['name', 'asc'];
constructor(
public router: Router,
private queryBuilder: SearchQueryBuilderService,
private searchConfiguration: SearchConfigurationService,
@Optional() private route: ActivatedRoute) {
queryBuilder.paging = {
skipCount: 0,
@@ -55,11 +58,21 @@ export class SearchComponent implements OnInit {
}
ngOnInit() {
this.sorting = this.getSorting();
this.queryBuilder.updated.subscribe(() => {
this.sorting = this.getSorting();
});
if (this.route) {
this.route.params.forEach((params: Params) => {
this.searchedWord = params.hasOwnProperty(this.queryParamName) ? params[this.queryParamName] : null;
this.queryBuilder.queryFragments['queryName'] = `cm:name:'${this.searchedWord}'`;
this.queryBuilder.update();
if (this.searchedWord) {
const queryBody = this.searchConfiguration.generateQueryBody(this.searchedWord, 0, 100);
this.queryBuilder.userQuery = queryBody.query.query;
this.queryBuilder.update();
}
});
}
}
@@ -78,4 +91,14 @@ export class SearchComponent implements OnInit {
};
this.queryBuilder.update();
}
private getSorting(): string[] {
const primary = this.queryBuilder.getPrimarySorting();
if (primary) {
return [primary.key, primary.ascending ? 'asc' : 'desc'];
}
return ['name', 'asc'];
}
}