added help content configuration, fixed facets option height bug

This commit is contained in:
Diamantis Tziotzios 2018-10-08 17:58:52 +03:00
parent af99c1f418
commit 1661286f85
13 changed files with 63 additions and 41 deletions

View File

@ -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": {

View File

@ -1,22 +1,22 @@
<app-navigation class="fixed"></app-navigation>
<div class="container-fluid main-container">
<div class="row">
<div class="row" *ngIf="helpContentEnabled">
<app-help-content position="top"></app-help-content>
</div>
<div class="row">
<div class="col-md-2">
<app-help-content position="left"></app-help-content>
<app-help-content position="left" *ngIf="helpContentEnabled"></app-help-content>
</div>
<div class="col-md-8">
<app-breadcrumb *ngIf="this.isAuthenticated() && (hasBreadCrumb | async)"></app-breadcrumb>
<router-outlet (activate)='onActivate($event)' (deactivate)='onDeactivate($event)'></router-outlet>
</div>
<div class="col-md-2">
<app-help-content position="right"></app-help-content>
<app-help-content position="right" *ngIf="helpContentEnabled"></app-help-content>
</div>
</div>
<div class="row">
<div class="row" *ngIf="helpContentEnabled">
<app-help-content position="bottom"></app-help-content>
</div>
</div>

View File

@ -23,6 +23,7 @@ export class AppComponent implements OnInit {
hasBreadCrumb = Observable.of(false);
sideNavOpen = false;
helpContentEnabled = environment.HelpService.Enabled;
constructor(
private router: Router,

View File

@ -3,5 +3,5 @@ export const HostConfiguration = {
Server: environment.Server,
App: environment.App,
CacheLifeTimeMillis: 30000,
HelpServiceUrl: environment.HelpServiceUrl
HelpServiceUrl: environment.HelpService.Url
};

View File

@ -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']);

View File

@ -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;

View File

@ -10,7 +10,7 @@
</mat-chip>
</mat-chip-list>
<mat-selection-list #optionsList (selectionChange)="selectionChanged($event)">
<mat-list-option *ngFor="let option of (options | async) | slice:0:10" [value]="option" [selected]="isOptionSelected(option)">
<mat-list-option class="facet-option-item" *ngFor="let option of (options | async) | slice:0:10" [value]="option" [selected]="isOptionSelected(option)">
<p>{{ displayLabel(option) }}</p>
</mat-list-option>
</mat-selection-list>

View File

@ -0,0 +1,5 @@
.facet-option-item {
height: auto !important;
min-height: 48px;
padding: 0.5em;
}

View File

@ -45,7 +45,7 @@ export class FacetSearchSectionComponent implements OnInit {
ngOnInit(): void {
if (!this.multipleSelect) { this.selectionList.selectedOptions = new SelectionModel<MatListOption>(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) {

View File

@ -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);

View File

@ -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'
};

View File

@ -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'
};

View File

@ -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'
};