|
|
@ -21,7 +21,7 @@ import { AppState } from '@core/core.state'; |
|
|
import { WidgetConfigComponent } from '@home/components/widget/widget-config.component'; |
|
|
import { WidgetConfigComponent } from '@home/components/widget/widget-config.component'; |
|
|
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; |
|
|
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; |
|
|
import { WidgetConfigComponentData } from '@home/models/widget-component.models'; |
|
|
import { WidgetConfigComponentData } from '@home/models/widget-component.models'; |
|
|
import { isDefinedAndNotNull, isUndefined, mergeDeep, mergeDeepIgnoreArray } from '@core/utils'; |
|
|
import { isDefinedAndNotNull, isUndefined, mergeDeepIgnoreArray } from '@core/utils'; |
|
|
import { mapWidgetDefaultSettings, MapWidgetSettings } from '@home/components/widget/lib/maps/map-widget.models'; |
|
|
import { mapWidgetDefaultSettings, MapWidgetSettings } from '@home/components/widget/lib/maps/map-widget.models'; |
|
|
import { cssSizeToStrSize, resolveCssSize } from '@shared/models/widget-settings.models'; |
|
|
import { cssSizeToStrSize, resolveCssSize } from '@shared/models/widget-settings.models'; |
|
|
import { WidgetConfig, widgetTitleAutocompleteValues } from '@shared/models/widget.models'; |
|
|
import { WidgetConfig, widgetTitleAutocompleteValues } from '@shared/models/widget.models'; |
|
|
@ -29,6 +29,7 @@ import { |
|
|
getTimewindowConfig, |
|
|
getTimewindowConfig, |
|
|
setTimewindowConfig |
|
|
setTimewindowConfig |
|
|
} from '@home/components/widget/config/timewindow-config-panel.component'; |
|
|
} from '@home/components/widget/config/timewindow-config-panel.component'; |
|
|
|
|
|
import { findWidgetModelDefinition } from '@shared/models/widget/widget-model.definition'; |
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
selector: 'tb-map-basic-config', |
|
|
selector: 'tb-map-basic-config', |
|
|
@ -42,7 +43,7 @@ export class MapBasicConfigComponent extends BasicWidgetConfigComponent { |
|
|
trip = false; |
|
|
trip = false; |
|
|
|
|
|
|
|
|
predefinedValues = widgetTitleAutocompleteValues; |
|
|
predefinedValues = widgetTitleAutocompleteValues; |
|
|
|
|
|
|
|
|
constructor(protected store: Store<AppState>, |
|
|
constructor(protected store: Store<AppState>, |
|
|
protected widgetConfigComponent: WidgetConfigComponent, |
|
|
protected widgetConfigComponent: WidgetConfigComponent, |
|
|
private $injector: Injector, |
|
|
private $injector: Injector, |
|
|
@ -106,15 +107,11 @@ export class MapBasicConfigComponent extends BasicWidgetConfigComponent { |
|
|
|
|
|
|
|
|
actions: [configData.config.actions || {}, []] |
|
|
actions: [configData.config.actions || {}, []] |
|
|
}); |
|
|
}); |
|
|
if (this.trip) { |
|
|
this.mapWidgetConfigForm.addControl('timewindowConfig', this.fb.control(getTimewindowConfig(configData.config))); |
|
|
this.mapWidgetConfigForm.addControl('timewindowConfig', this.fb.control(getTimewindowConfig(configData.config))) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected prepareOutputConfig(config: any): WidgetConfigComponentData { |
|
|
protected prepareOutputConfig(config: any): WidgetConfigComponentData { |
|
|
if (this.trip) { |
|
|
setTimewindowConfig(this.widgetConfig.config, config.timewindowConfig); |
|
|
setTimewindowConfig(this.widgetConfig.config, config.timewindowConfig); |
|
|
|
|
|
} |
|
|
|
|
|
this.widgetConfig.config.settings = config.mapSettings || {}; |
|
|
this.widgetConfig.config.settings = config.mapSettings || {}; |
|
|
|
|
|
|
|
|
this.widgetConfig.config.showTitle = config.showTitle; |
|
|
this.widgetConfig.config.showTitle = config.showTitle; |
|
|
@ -186,4 +183,17 @@ export class MapBasicConfigComponent extends BasicWidgetConfigComponent { |
|
|
config.enableFullscreen = buttons.includes('fullscreen'); |
|
|
config.enableFullscreen = buttons.includes('fullscreen'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public get displayTimewindowConfig(): boolean { |
|
|
|
|
|
if (this.trip) { |
|
|
|
|
|
return true; |
|
|
|
|
|
} else { |
|
|
|
|
|
const widgetDefinition = findWidgetModelDefinition(this.widget); |
|
|
|
|
|
if (widgetDefinition) { |
|
|
|
|
|
return widgetDefinition.hasTimewindow(this.widget); |
|
|
|
|
|
} else { |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|