From 1661286f85ca7ee1df8d2e7b8bf77f537bfe60ca Mon Sep 17 00:00:00 2001 From: "CITE\\dtziotzios" Date: Mon, 8 Oct 2018 17:58:52 +0300 Subject: [PATCH] added help content configuration, fixed facets option height bug --- dmp-frontend/package-lock.json | 36 +++++++++---------- dmp-frontend/src/app/app.component.html | 8 ++--- dmp-frontend/src/app/app.component.ts | 1 + dmp-frontend/src/app/app.constants.ts | 2 +- .../src/app/services/auth/auth.service.ts | 2 +- .../auto-complete/auto-complete.component.ts | 2 +- .../facet-search-section.component.html | 2 +- .../facet-search-section.component.scss | 5 +++ .../facet-search-section.component.ts | 2 +- .../app/utilities/culture/culture-service.ts | 8 ++--- .../src/environments/environment.prod.ts | 13 ++++--- .../src/environments/environment.staging.ts | 10 ++++++ dmp-frontend/src/environments/environment.ts | 13 ++++--- 13 files changed, 63 insertions(+), 41 deletions(-) create mode 100644 dmp-frontend/src/environments/environment.staging.ts diff --git a/dmp-frontend/package-lock.json b/dmp-frontend/package-lock.json index d9a7cee3d..44b651d75 100644 --- a/dmp-frontend/package-lock.json +++ b/dmp-frontend/package-lock.json @@ -9226,11 +9226,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" } }, "del": { @@ -9239,13 +9239,13 @@ "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", "dev": true, "requires": { - "globby": "^5.0.0", - "is-path-cwd": "^1.0.0", - "is-path-in-cwd": "^1.0.0", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "rimraf": "^2.2.8" + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.1", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" } }, "extend": { @@ -9271,12 +9271,12 @@ "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "dev": true, "requires": { - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" } }, "har-schema": { diff --git a/dmp-frontend/src/app/app.component.html b/dmp-frontend/src/app/app.component.html index 662e2e50e..66556188c 100644 --- a/dmp-frontend/src/app/app.component.html +++ b/dmp-frontend/src/app/app.component.html @@ -1,22 +1,22 @@
-
+
- +
- +
-
+
diff --git a/dmp-frontend/src/app/app.component.ts b/dmp-frontend/src/app/app.component.ts index 79b220003..9b5adf5e5 100644 --- a/dmp-frontend/src/app/app.component.ts +++ b/dmp-frontend/src/app/app.component.ts @@ -23,6 +23,7 @@ export class AppComponent implements OnInit { hasBreadCrumb = Observable.of(false); sideNavOpen = false; + helpContentEnabled = environment.HelpService.Enabled; constructor( private router: Router, diff --git a/dmp-frontend/src/app/app.constants.ts b/dmp-frontend/src/app/app.constants.ts index 84b37f334..3e393895d 100644 --- a/dmp-frontend/src/app/app.constants.ts +++ b/dmp-frontend/src/app/app.constants.ts @@ -3,5 +3,5 @@ export const HostConfiguration = { Server: environment.Server, App: environment.App, CacheLifeTimeMillis: 30000, - HelpServiceUrl: environment.HelpServiceUrl + HelpServiceUrl: environment.HelpService.Url }; diff --git a/dmp-frontend/src/app/services/auth/auth.service.ts b/dmp-frontend/src/app/services/auth/auth.service.ts index 6793676c8..7c0a48ddf 100644 --- a/dmp-frontend/src/app/services/auth/auth.service.ts +++ b/dmp-frontend/src/app/services/auth/auth.service.ts @@ -121,7 +121,7 @@ export class AuthService { return princ; }) .catch((error: any) => { - console.warn('could not retrieve me info:\n', error); + //console.warn('could not retrieve me info:\n', error); this.clear(); const princ = this.current(); this.router.navigate(['/login']); diff --git a/dmp-frontend/src/app/shared/components/auto-complete/auto-complete.component.ts b/dmp-frontend/src/app/shared/components/auto-complete/auto-complete.component.ts index f414f9b00..682890cd9 100644 --- a/dmp-frontend/src/app/shared/components/auto-complete/auto-complete.component.ts +++ b/dmp-frontend/src/app/shared/components/auto-complete/auto-complete.component.ts @@ -13,7 +13,7 @@ export class AutoCompleteComponent implements OnInit, ErrorStateMatcher { @Input() placeholder: String; @Input() disabled: boolean; - @Input() typeaheadMS: number; + @Input() typeaheadMS = 300; @Input() formCtrl: FormControl; @Input() required = false; @Input() displayFunction: Function; diff --git a/dmp-frontend/src/app/shared/components/facets/facet-search-component/facet-search-section.component.html b/dmp-frontend/src/app/shared/components/facets/facet-search-component/facet-search-section.component.html index c99067eae..a50c5f35b 100644 --- a/dmp-frontend/src/app/shared/components/facets/facet-search-component/facet-search-section.component.html +++ b/dmp-frontend/src/app/shared/components/facets/facet-search-component/facet-search-section.component.html @@ -10,7 +10,7 @@ - +

{{ displayLabel(option) }}

diff --git a/dmp-frontend/src/app/shared/components/facets/facet-search-component/facet-search-section.component.scss b/dmp-frontend/src/app/shared/components/facets/facet-search-component/facet-search-section.component.scss index e69de29bb..292915923 100644 --- a/dmp-frontend/src/app/shared/components/facets/facet-search-component/facet-search-section.component.scss +++ b/dmp-frontend/src/app/shared/components/facets/facet-search-component/facet-search-section.component.scss @@ -0,0 +1,5 @@ +.facet-option-item { + height: auto !important; + min-height: 48px; + padding: 0.5em; +} diff --git a/dmp-frontend/src/app/shared/components/facets/facet-search-component/facet-search-section.component.ts b/dmp-frontend/src/app/shared/components/facets/facet-search-component/facet-search-section.component.ts index ad64fc4c6..2eb920792 100644 --- a/dmp-frontend/src/app/shared/components/facets/facet-search-component/facet-search-section.component.ts +++ b/dmp-frontend/src/app/shared/components/facets/facet-search-component/facet-search-section.component.ts @@ -45,7 +45,7 @@ export class FacetSearchSectionComponent implements OnInit { ngOnInit(): void { if (!this.multipleSelect) { this.selectionList.selectedOptions = new SelectionModel(this.multipleSelect); } - this.optionSearchControl.valueChanges.subscribe(x => { if (this.filterOptions) { this.options = this.filterOptions(x); } }); + this.optionSearchControl.valueChanges.debounceTime(300).subscribe(x => { if (this.filterOptions) { this.options = this.filterOptions(x); } }); } public selectionChanged(event: any) { diff --git a/dmp-frontend/src/app/utilities/culture/culture-service.ts b/dmp-frontend/src/app/utilities/culture/culture-service.ts index 46b49ec47..72267fcf6 100644 --- a/dmp-frontend/src/app/utilities/culture/culture-service.ts +++ b/dmp-frontend/src/app/utilities/culture/culture-service.ts @@ -46,7 +46,7 @@ export class CultureService { const newCulture = this.cultureValues.get(newCultureName); if (!newCulture) { - console.error(`unsupported culture given: ${newCultureName}`); //TODO: throw error? + //console.error(`unsupported culture given: ${newCultureName}`); //TODO: throw error? return; } this.currentCulture = newCulture; @@ -55,11 +55,11 @@ export class CultureService { // Set angular locale based on user selection. let locale = newCulture.name; import(`@angular/common/locales/${locale}.js`).catch(reason => { - console.warn('Could not load locale: ' + locale); + //console.warn('Could not load locale: ' + locale); locale = newCulture.name.split('-')[0]; - console.warn('Will try ' + locale); + //console.warn('Will try ' + locale); return import(`@angular/common/locales/${locale}.js`).catch(resutl => { - console.error('Could not load locale: ' + locale); + //console.error('Could not load locale: ' + locale); }); }).then(selectedLocale => { registerLocaleData(selectedLocale.default); diff --git a/dmp-frontend/src/environments/environment.prod.ts b/dmp-frontend/src/environments/environment.prod.ts index f66e12ff2..a39650c63 100644 --- a/dmp-frontend/src/environments/environment.prod.ts +++ b/dmp-frontend/src/environments/environment.prod.ts @@ -1,7 +1,10 @@ export const environment = { - production: true, - Server: 'https://devel.opendmp.eu/srv/api/', - App: 'https://devel.opendmp.eu/', - HelpServiceUrl: 'https://devel.opendmp.eu/content-service/', - defaultCulture: 'en-US' + production: true, + Server: 'https://opendmp.eu/srv/api/', + App: 'https://opendmp.eu/', + HelpService: { + Enabled: false, + Url: 'https://opendmp.eu/content-service/', + }, + defaultCulture: 'en-US' }; diff --git a/dmp-frontend/src/environments/environment.staging.ts b/dmp-frontend/src/environments/environment.staging.ts new file mode 100644 index 000000000..a721bdd78 --- /dev/null +++ b/dmp-frontend/src/environments/environment.staging.ts @@ -0,0 +1,10 @@ +export const environment = { + production: true, + Server: 'https://devel.opendmp.eu/srv/api/', + App: 'https://devel.opendmp.eu/', + HelpService: { + Enabled: false, + Url: 'https://devel.opendmp.eu/content-service/', + }, + defaultCulture: 'en-US' +}; diff --git a/dmp-frontend/src/environments/environment.ts b/dmp-frontend/src/environments/environment.ts index b828a9d37..3f4dfba52 100644 --- a/dmp-frontend/src/environments/environment.ts +++ b/dmp-frontend/src/environments/environment.ts @@ -4,9 +4,12 @@ // The list of which env maps to which file can be found in `.angular-cli.json`. export const environment = { - production: false, - Server: 'http://devel-21.local.cite.gr:8080/api/', - App: 'http://localhost:4200/', - HelpServiceUrl: 'localhost:5000/', - defaultCulture: 'en-US' + production: false, + Server: 'http://devel-21.local.cite.gr:5000/api/', + App: 'http://localhost:4200/', + HelpService: { + Enabled: false, + Url: 'localhost:5000/', + }, + defaultCulture: 'en-US' };