From cd46a589e182c85ee6361c2ff46bf9bd56a18b40 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Mon, 18 Sep 2017 11:06:45 +0100 Subject: [PATCH] [ADF-1555] add animation on show and hide of results (#2343) * add animation on show and hide of results make the style similar to the other material 2 menu fix issue popup always stays on the screen fix Search does not collapse if its input is focused * minor code style issues * minors fix and test fix * fix app.config.json error in test * update beta10 mat-menu-base method * karma configuration all --- .travis.yml | 4 +- ng2-components/config/app.config.json | 4 + ng2-components/config/karma.conf-all.js | 7 +- .../config/app.config.json | 4 + .../ng2-activiti-analytics/karma.conf.js | 8 +- .../config/app.config.json | 4 + .../ng2-activiti-diagrams/karma.conf.js | 7 +- .../ng2-activiti-form/config/app.config.json | 4 + .../ng2-activiti-form/karma.conf.js | 7 +- .../config/app.config.json | 4 + .../ng2-activiti-processlist/karma.conf.js | 7 +- .../ng2-activiti-tasklist/app.config.json | 4 + .../ng2-activiti-tasklist/karma.conf.js | 7 +- .../ng2-alfresco-core/config/app.config.json | 4 + .../ng2-alfresco-core/karma.conf.js | 7 +- .../config/app.config.json | 4 + .../ng2-alfresco-datatable/karma.conf.js | 7 +- .../config/app.config.json | 4 + .../ng2-alfresco-documentlist/karma.conf.js | 7 +- .../ng2-alfresco-login/config/app.config.json | 4 + .../ng2-alfresco-login/karma.conf.js | 7 +- .../config/app.config.json | 4 + .../ng2-alfresco-search/karma.conf.js | 7 +- .../search-autocomplete.component.html | 40 ++++---- .../search-autocomplete.component.scss | 26 ++--- .../search-autocomplete.component.spec.ts | 6 +- .../search-autocomplete.component.ts | 58 +++++++++-- .../components/search-control.component.html | 4 +- .../components/search-control.component.scss | 2 - .../search-control.component.spec.ts | 99 +++++++++---------- .../components/search-control.component.ts | 75 ++++++-------- .../src/components/search.component.html | 19 ++-- .../src/components/search.component.spec.ts | 6 +- .../src/components/search.component.ts | 5 +- .../config/app.config.json | 4 + .../ng2-alfresco-social/karma.conf.js | 7 +- .../ng2-alfresco-tag/config/app.config.json | 4 + ng2-components/ng2-alfresco-tag/karma.conf.js | 7 +- .../config/app.config.json | 4 + .../ng2-alfresco-upload/karma.conf.js | 7 +- .../config/app.config.json | 4 + .../ng2-alfresco-userinfo/karma.conf.js | 7 +- .../config/app.config.json | 4 + .../ng2-alfresco-viewer/karma.conf.js | 7 +- .../config/app.config.json | 4 + .../ng2-alfresco-webscript/karma.conf.js | 7 +- 46 files changed, 351 insertions(+), 181 deletions(-) create mode 100644 ng2-components/config/app.config.json create mode 100644 ng2-components/ng2-activiti-analytics/config/app.config.json create mode 100644 ng2-components/ng2-activiti-diagrams/config/app.config.json create mode 100644 ng2-components/ng2-activiti-form/config/app.config.json create mode 100644 ng2-components/ng2-activiti-processlist/config/app.config.json create mode 100644 ng2-components/ng2-activiti-tasklist/app.config.json create mode 100644 ng2-components/ng2-alfresco-core/config/app.config.json create mode 100644 ng2-components/ng2-alfresco-datatable/config/app.config.json create mode 100644 ng2-components/ng2-alfresco-documentlist/config/app.config.json create mode 100644 ng2-components/ng2-alfresco-login/config/app.config.json create mode 100644 ng2-components/ng2-alfresco-search/config/app.config.json create mode 100644 ng2-components/ng2-alfresco-social/config/app.config.json create mode 100644 ng2-components/ng2-alfresco-tag/config/app.config.json create mode 100644 ng2-components/ng2-alfresco-upload/config/app.config.json create mode 100644 ng2-components/ng2-alfresco-userinfo/config/app.config.json create mode 100644 ng2-components/ng2-alfresco-viewer/config/app.config.json create mode 100644 ng2-components/ng2-alfresco-webscript/config/app.config.json diff --git a/.travis.yml b/.travis.yml index fea7da6b57..0a8fb4f28f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ install: if ([ "$TRAVIS_BRANCH" = "master" ]); then (./scripts/npm-build-all.sh || exit 1;); else - (./scripts/npm-build-all.sh -gitjsapi development || exit 1;); + (./scripts/npm-build-all.sh -vjsapi alpha || exit 1;); fi fi @@ -34,7 +34,7 @@ script: if ([ "$TRAVIS_BRANCH" = "master" ]); then (./scripts/start.sh -t -ss || exit 1;); else - (./scripts/start.sh -dev -t -ss -gitjsapi development || exit 1;); + (./scripts/start.sh -dev -t -ss -vjsapi alpha || exit 1;); fi fi diff --git a/ng2-components/config/app.config.json b/ng2-components/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/config/karma.conf-all.js b/ng2-components/config/karma.conf-all.js index 7286000f24..d701bb2a50 100644 --- a/ng2-components/config/karma.conf-all.js +++ b/ng2-components/config/karma.conf-all.js @@ -36,7 +36,8 @@ module.exports = function (config) { {pattern: config.component + '/karma-test-shim.js', watched: false}, {pattern: './ng2-**/src/assets/**/*.*', included: false, served: true, watched: false}, - {pattern: './ng2-**/src/**/*.ts', included: false, served: true, watched: false} + {pattern: './ng2-**/src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: webpackCoverage(config), @@ -50,6 +51,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-activiti-analytics/config/app.config.json b/ng2-components/ng2-activiti-analytics/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-activiti-analytics/karma.conf.js b/ng2-components/ng2-activiti-analytics/karma.conf.js index 6ee544ea73..476819e0c1 100644 --- a/ng2-components/ng2-activiti-analytics/karma.conf.js +++ b/ng2-components/ng2-activiti-analytics/karma.conf.js @@ -23,7 +23,9 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/assets/**/*.*', included: false, served: true, watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} + ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -34,6 +36,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-activiti-diagrams/config/app.config.json b/ng2-components/ng2-activiti-diagrams/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-activiti-diagrams/karma.conf.js b/ng2-components/ng2-activiti-diagrams/karma.conf.js index 6ee544ea73..6a99bf4844 100644 --- a/ng2-components/ng2-activiti-diagrams/karma.conf.js +++ b/ng2-components/ng2-activiti-diagrams/karma.conf.js @@ -23,7 +23,8 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/assets/**/*.*', included: false, served: true, watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -34,6 +35,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-activiti-form/config/app.config.json b/ng2-components/ng2-activiti-form/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-activiti-form/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-activiti-form/karma.conf.js b/ng2-components/ng2-activiti-form/karma.conf.js index fbd2d6c49a..558a548594 100644 --- a/ng2-components/ng2-activiti-form/karma.conf.js +++ b/ng2-components/ng2-activiti-form/karma.conf.js @@ -20,7 +20,8 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/assets/**/*.*', included: false, served: true, watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -31,6 +32,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-activiti-processlist/config/app.config.json b/ng2-components/ng2-activiti-processlist/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-activiti-processlist/karma.conf.js b/ng2-components/ng2-activiti-processlist/karma.conf.js index fbd2d6c49a..558a548594 100644 --- a/ng2-components/ng2-activiti-processlist/karma.conf.js +++ b/ng2-components/ng2-activiti-processlist/karma.conf.js @@ -20,7 +20,8 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/assets/**/*.*', included: false, served: true, watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -31,6 +32,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-activiti-tasklist/app.config.json b/ng2-components/ng2-activiti-tasklist/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-activiti-tasklist/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-activiti-tasklist/karma.conf.js b/ng2-components/ng2-activiti-tasklist/karma.conf.js index 8cdb584484..84e2bd872d 100644 --- a/ng2-components/ng2-activiti-tasklist/karma.conf.js +++ b/ng2-components/ng2-activiti-tasklist/karma.conf.js @@ -18,7 +18,8 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/assets/**/*.*', included: false, served: true, watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -29,6 +30,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-alfresco-core/config/app.config.json b/ng2-components/ng2-alfresco-core/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-alfresco-core/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-alfresco-core/karma.conf.js b/ng2-components/ng2-alfresco-core/karma.conf.js index fbd2d6c49a..558a548594 100644 --- a/ng2-components/ng2-alfresco-core/karma.conf.js +++ b/ng2-components/ng2-alfresco-core/karma.conf.js @@ -20,7 +20,8 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/assets/**/*.*', included: false, served: true, watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -31,6 +32,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-alfresco-datatable/config/app.config.json b/ng2-components/ng2-alfresco-datatable/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-alfresco-datatable/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-alfresco-datatable/karma.conf.js b/ng2-components/ng2-alfresco-datatable/karma.conf.js index fbd2d6c49a..558a548594 100644 --- a/ng2-components/ng2-alfresco-datatable/karma.conf.js +++ b/ng2-components/ng2-alfresco-datatable/karma.conf.js @@ -20,7 +20,8 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/assets/**/*.*', included: false, served: true, watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -31,6 +32,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-alfresco-documentlist/config/app.config.json b/ng2-components/ng2-alfresco-documentlist/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-alfresco-documentlist/karma.conf.js b/ng2-components/ng2-alfresco-documentlist/karma.conf.js index ea9c421e8e..fb85ee7ab6 100644 --- a/ng2-components/ng2-alfresco-documentlist/karma.conf.js +++ b/ng2-components/ng2-alfresco-documentlist/karma.conf.js @@ -20,7 +20,8 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/assets/**/*.*', included: false, served: true, watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -31,6 +32,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-alfresco-login/config/app.config.json b/ng2-components/ng2-alfresco-login/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-alfresco-login/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-alfresco-login/karma.conf.js b/ng2-components/ng2-alfresco-login/karma.conf.js index fbd2d6c49a..558a548594 100644 --- a/ng2-components/ng2-alfresco-login/karma.conf.js +++ b/ng2-components/ng2-alfresco-login/karma.conf.js @@ -20,7 +20,8 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/assets/**/*.*', included: false, served: true, watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -31,6 +32,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-alfresco-search/config/app.config.json b/ng2-components/ng2-alfresco-search/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-alfresco-search/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-alfresco-search/karma.conf.js b/ng2-components/ng2-alfresco-search/karma.conf.js index fbd2d6c49a..558a548594 100644 --- a/ng2-components/ng2-alfresco-search/karma.conf.js +++ b/ng2-components/ng2-alfresco-search/karma.conf.js @@ -20,7 +20,8 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/assets/**/*.*', included: false, served: true, watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -31,6 +32,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.html b/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.html index f2acac5f16..57532e823f 100644 --- a/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.html +++ b/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.html @@ -1,42 +1,42 @@ - - +
+ + (blur)="onRowBlur($event)" (focus)="onRowFocus($event)" + (click)="onItemClick(result)" + (keyup.enter)="onRowEnter(result)" + (keyup.arrowdown)="onRowArrowDown($event)" + (keyup.arrowup)="onRowArrowUp($event)" + (keyup.escape)="onRowEscape($event)" + attr.data-automation-id="autocomplete_result_for_{{result.entry.name}}"> -
{{result.entry.name}} -
+
-
{{result.entry.createdByUser.displayName}}
+
{{result.entry.createdByUser.displayName}}
- - + -
{{ 'SEARCH.RESULTS.NONE' | translate:{searchTerm: searchTerm} }}
- - +
{{ 'SEARCH.RESULTS.ERROR' | translate:{errorMessage: errorMessage} }}
+ + diff --git a/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.scss b/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.scss index 059dde2f03..5f062ae530 100644 --- a/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.scss +++ b/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.scss @@ -1,20 +1,28 @@ +@import '~@angular/material/theming'; + @mixin mat-search-autocomplete-theme($theme) { $primary: map-get($theme, primary); $accent: map-get($theme, accent); $warn: map-get($theme, warn); $foreground: map-get($theme, foreground); $background: map-get($theme, background); + $mat-menu-border-radius: 2px !default; .adf { + &--search-result-container{ + z-index: 5; + } + &-search-result { + @include mat-menu-base(2); + transform-origin: top left; position: absolute; z-index: 5; - display: none; color: mat-color($foreground, text); background-color: mat-color($background, card); - margin: -21px 0px 0px 0px; - border: 1px solid mat-color($primary); + margin: -21px 0 0 0; + border-radius: $mat-menu-border-radius; border-collapse: collapse; white-space: nowrap; font-size: 14px; @@ -48,11 +56,11 @@ color: mat-color($primary, 900); } - .img-td{ + .img-td { width: 30px; } - .truncate{ + .truncate { width: 240px; white-space: nowrap; overflow: hidden; @@ -63,16 +71,10 @@ :host { right: 0; } - .truncate{ + .truncate { width: 200px; } } } - - &-valid-search { - .adf-search-result { - display: block; - } - } } } diff --git a/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.spec.ts b/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.spec.ts index afb341cac6..e298f516e9 100644 --- a/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.spec.ts +++ b/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.spec.ts @@ -84,7 +84,7 @@ describe('SearchAutocompleteComponent', () => { component.searchTerm = 'searchTerm2'; component.ngOnChanges({searchTerm: { currentValue: 'searchTerm2', previousValue: 'searchTerm'} }); fixture.detectChanges(); - expect(element.querySelectorAll('table[data-automation-id="autocomplete_results"] tbody tr').length).toBe(0); + expect(element.querySelectorAll('tbody[data-automation-id="autocomplete_results"] tr').length).toBe(0); }); })); @@ -110,7 +110,7 @@ describe('SearchAutocompleteComponent', () => { component.resultsLoad.subscribe(() => { fixture.detectChanges(); - let el: any = element.querySelectorAll('table[data-automation-id="autocomplete_results"] tbody tr')[1].children[1].children[0]; + let el: any = element.querySelectorAll('tbody[data-automation-id="autocomplete_results"] tr')[1].children[1].children[0]; expect(el.innerText).toEqual('MyDoc'); let spanHighlight = el.children[0]; expect(spanHighlight.classList[0]).toEqual('highlight'); @@ -129,7 +129,7 @@ describe('SearchAutocompleteComponent', () => { component.resultsLoad.subscribe(() => { fixture.detectChanges(); - expect(element.querySelectorAll('table[data-automation-id="autocomplete_results"] tbody tr').length).toBe(2); + expect(element.querySelectorAll('tbody[data-automation-id="autocomplete_results"] tr').length).toBe(2); done(); }); diff --git a/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.ts b/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.ts index e54a024ba9..c82dc1a058 100644 --- a/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.ts +++ b/ng2-components/ng2-alfresco-search/src/components/search-autocomplete.component.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { animate, AnimationEvent, state, style, transition, trigger } from '@angular/animations'; import { Component, ElementRef, EventEmitter, Input, OnChanges, Output, ViewChild, ViewEncapsulation } from '@angular/core'; import { MinimalNodeEntity } from 'alfresco-js-api'; import { SearchOptions, SearchService } from 'ng2-alfresco-core'; @@ -24,6 +25,24 @@ import { ThumbnailService } from 'ng2-alfresco-core'; selector: 'adf-search-autocomplete, alfresco-search-autocomplete', templateUrl: './search-autocomplete.component.html', styleUrls: ['./search-autocomplete.component.scss'], + animations: [ + trigger('transformAutocomplete', [ + state('void', style({ + opacity: 0, + transform: 'scale(0.01, 0.01)' + })), + state('enter-start', style({ + opacity: 1, + transform: 'scale(1, 0.5)' + })), + state('enter', style({ + transform: 'scale(1, 1)' + })), + transition('void => enter-start', animate('100ms linear')), + transition('enter-start => enter', animate('300ms cubic-bezier(0.25, 0.8, 0.25, 1)')), + transition('* => void', animate('150ms 50ms linear', style({opacity: 0}))) + ]) + ], encapsulation: ViewEncapsulation.None }) export class SearchAutocompleteComponent implements OnChanges { @@ -33,7 +52,7 @@ export class SearchAutocompleteComponent implements OnChanges { results: any = null; - errorMessage; + errorMessage: string = null; @Input() ngClass: any; @@ -70,6 +89,8 @@ export class SearchAutocompleteComponent implements OnChanges { @ViewChild('resultsTableBody', {}) resultsTableBody: ElementRef; + panelAnimationState: 'void' | 'enter-start' | 'enter' = 'void'; + constructor(private searchService: SearchService, private thumbnailService: ThumbnailService) { } @@ -101,6 +122,11 @@ export class SearchAutocompleteComponent implements OnChanges { .subscribe( results => { this.results = results.list.entries.slice(0, this.maxResults); + + if (results && results.list && results.list.entries.length > 0) { + this.startAnimation(); + } + this.errorMessage = null; this.resultsLoad.emit(this.results); }, @@ -136,6 +162,14 @@ export class SearchAutocompleteComponent implements OnChanges { firstResult.focus(); } + private getNextElementSibling(node: Element): Element { + return node.nextElementSibling; + } + + private getPreviousElementSibling(node: Element): Element { + return node.previousElementSibling; + } + onItemClick(node: MinimalNodeEntity): void { if (node && node.entry) { this.fileSelect.emit(node); @@ -158,14 +192,6 @@ export class SearchAutocompleteComponent implements OnChanges { } } - private getNextElementSibling(node: Element): Element { - return node.nextElementSibling; - } - - private getPreviousElementSibling(node: Element): Element { - return node.previousElementSibling; - } - onRowArrowDown($event: KeyboardEvent): void { let nextElement: any = this.getNextElementSibling( $event.target); if (nextElement) { @@ -186,4 +212,18 @@ export class SearchAutocompleteComponent implements OnChanges { this.cancel.emit($event); } + startAnimation() { + this.panelAnimationState = 'enter-start'; + } + + resetAnimation() { + this.panelAnimationState = 'void'; + } + + onAnimationDone(event: AnimationEvent) { + if (event.toState === 'enter-start') { + this.panelAnimationState = 'enter'; + } + } + } diff --git a/ng2-components/ng2-alfresco-search/src/components/search-control.component.html b/ng2-components/ng2-alfresco-search/src/components/search-control.component.html index 24ed7be8f3..a86bddddd8 100644 --- a/ng2-components/ng2-alfresco-search/src/components/search-control.component.html +++ b/ng2-components/ng2-alfresco-search/src/components/search-control.component.html @@ -1,6 +1,6 @@
+ [@transitionMessages]="subscriptAnimationState">
- - - - + + - - + - - + - - + + diff --git a/ng2-components/ng2-alfresco-search/src/components/search.component.spec.ts b/ng2-components/ng2-alfresco-search/src/components/search.component.spec.ts index 4e493520b0..bb66228031 100644 --- a/ng2-components/ng2-alfresco-search/src/components/search.component.spec.ts +++ b/ng2-components/ng2-alfresco-search/src/components/search.component.spec.ts @@ -116,10 +116,10 @@ describe('SearchComponent', () => { TestBed.configureTestingModule({ imports: [ - CoreModule.forRoot(), - DocumentListModule.forRoot() + CoreModule, + DocumentListModule ], - declarations: [SearchComponent], // declare the test component + declarations: [SearchComponent], providers: [ SearchService, {provide: AlfrescoTranslationService, useClass: TranslationMock}, diff --git a/ng2-components/ng2-alfresco-search/src/components/search.component.ts b/ng2-components/ng2-alfresco-search/src/components/search.component.ts index b50c3d45fc..beaa081232 100644 --- a/ng2-components/ng2-alfresco-search/src/components/search.component.ts +++ b/ng2-components/ng2-alfresco-search/src/components/search.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Component, EventEmitter, Input, OnChanges, OnInit, Optional, Output, SimpleChanges } from '@angular/core'; +import { Component, EventEmitter, Input, OnChanges, OnInit, Optional, Output, SimpleChanges, ViewEncapsulation } from '@angular/core'; import { ActivatedRoute, Params } from '@angular/router'; import { NodePaging, Pagination } from 'alfresco-js-api'; import { AlfrescoTranslationService, NotificationService, SearchOptions, SearchService } from 'ng2-alfresco-core'; @@ -26,7 +26,8 @@ declare var require: any; @Component({ selector: 'adf-search, alfresco-search', styleUrls: ['./search.component.scss'], - templateUrl: './search.component.html' + templateUrl: './search.component.html', + encapsulation: ViewEncapsulation.None }) export class SearchComponent implements OnChanges, OnInit { diff --git a/ng2-components/ng2-alfresco-social/config/app.config.json b/ng2-components/ng2-alfresco-social/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-alfresco-social/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-alfresco-social/karma.conf.js b/ng2-components/ng2-alfresco-social/karma.conf.js index 8aaab114ac..fdefe541cd 100644 --- a/ng2-components/ng2-alfresco-social/karma.conf.js +++ b/ng2-components/ng2-alfresco-social/karma.conf.js @@ -19,7 +19,8 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -30,6 +31,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-alfresco-tag/config/app.config.json b/ng2-components/ng2-alfresco-tag/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-alfresco-tag/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-alfresco-tag/karma.conf.js b/ng2-components/ng2-alfresco-tag/karma.conf.js index 21a865b95a..0e52d6e1b4 100644 --- a/ng2-components/ng2-alfresco-tag/karma.conf.js +++ b/ng2-components/ng2-alfresco-tag/karma.conf.js @@ -16,7 +16,8 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/assets/**/*.*', included: false, served: true, watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -27,6 +28,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-alfresco-upload/config/app.config.json b/ng2-components/ng2-alfresco-upload/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-alfresco-upload/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-alfresco-upload/karma.conf.js b/ng2-components/ng2-alfresco-upload/karma.conf.js index fbd2d6c49a..558a548594 100644 --- a/ng2-components/ng2-alfresco-upload/karma.conf.js +++ b/ng2-components/ng2-alfresco-upload/karma.conf.js @@ -20,7 +20,8 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/assets/**/*.*', included: false, served: true, watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -31,6 +32,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-alfresco-userinfo/config/app.config.json b/ng2-components/ng2-alfresco-userinfo/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-alfresco-userinfo/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-alfresco-userinfo/karma.conf.js b/ng2-components/ng2-alfresco-userinfo/karma.conf.js index fbd2d6c49a..558a548594 100644 --- a/ng2-components/ng2-alfresco-userinfo/karma.conf.js +++ b/ng2-components/ng2-alfresco-userinfo/karma.conf.js @@ -20,7 +20,8 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/assets/**/*.*', included: false, served: true, watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -31,6 +32,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-alfresco-viewer/config/app.config.json b/ng2-components/ng2-alfresco-viewer/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-alfresco-viewer/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-alfresco-viewer/karma.conf.js b/ng2-components/ng2-alfresco-viewer/karma.conf.js index 1a2fd64467..67e6b07488 100644 --- a/ng2-components/ng2-alfresco-viewer/karma.conf.js +++ b/ng2-components/ng2-alfresco-viewer/karma.conf.js @@ -21,7 +21,8 @@ module.exports = function (config) { {pattern: './node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false}, {pattern: 'karma-test-shim.js', watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], @@ -33,6 +34,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, diff --git a/ng2-components/ng2-alfresco-webscript/config/app.config.json b/ng2-components/ng2-alfresco-webscript/config/app.config.json new file mode 100644 index 0000000000..1d7f86842c --- /dev/null +++ b/ng2-components/ng2-alfresco-webscript/config/app.config.json @@ -0,0 +1,4 @@ +{ + "ecmHost": "http://{hostname}:{port}/ecm", + "bpmHost": "http://{hostname}:{port}/bpm" +} diff --git a/ng2-components/ng2-alfresco-webscript/karma.conf.js b/ng2-components/ng2-alfresco-webscript/karma.conf.js index 6ee544ea73..6a99bf4844 100644 --- a/ng2-components/ng2-alfresco-webscript/karma.conf.js +++ b/ng2-components/ng2-alfresco-webscript/karma.conf.js @@ -23,7 +23,8 @@ module.exports = function (config) { {pattern: 'karma-test-shim.js', watched: false}, {pattern: './src/assets/**/*.*', included: false, served: true, watched: false}, {pattern: './src/i18n/**/*.*', included: false, served: true, watched: false}, - {pattern: './src/**/*.ts', included: false, served: true, watched: false} + {pattern: './src/**/*.ts', included: false, served: true, watched: false}, + {pattern: './config/app.config.json', included: false, served: true, watched: false} ], webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'), @@ -34,6 +35,10 @@ module.exports = function (config) { port: 9876, + proxies: { + '/app.config.json': '/base/config/app.config.json' + }, + // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO,