Commit 430e81b4 authored by Valentin's avatar Valentin
Browse files

feat: add the slider in simulation/order

parent f47b0973
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -88,17 +88,7 @@

		<div class="row">
			<div class="col-12 no-padding">
				<!-- TODO un-comment when the following is fixed https://github.com/dockleryxk/ng-simple-slideshow/issues/105 -->
				<!-- <slideshow
					*ngIf="order.products.length"
					[height]="'355px'"
					[autoPlay]="true"
					[autoPlayInterval]="5000"
					[imageUrls]="getSlideImage(order)"
					[lazyLoad]="order.products.length"
					[autoPlayWaitForLazyLoad]="true"
					>></slideshow
				> -->
				<image-slider [slideImages]="slideImages"></image-slider>
			</div>
		</div>
	</div>
+7 −3
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ export class SimulationOrderComponent implements OnDestroy, OnInit {
	public delivered: boolean;

	private _ngDestroy$ = new Subject<void>();
	slideImages: any;

	constructor(
		private readonly _translateService: TranslateService,
@@ -40,6 +41,7 @@ export class SimulationOrderComponent implements OnDestroy, OnInit {
		if (!this._getStartDate) {
			this._setStartDate = new Date();
		}
		this.getSlideImage(this.order);
	}

	getSlideImage(order: Order) {
@@ -50,12 +52,14 @@ export class SimulationOrderComponent implements OnDestroy, OnInit {
				title: this._localeTranslate.getTranslate(
					p.product.description
				),
				backgroundSize: 'contain',
				backgroundPosition: 'center',
				style: {
					maxWidth: '100%',
					maxHeight: '100%',
				},
			};
		});

		return images;
		this.slideImages = images;
	}

	private get _getStartDate() {
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ import { ToasterModule } from 'angular2-toaster';
import { TranslateModule } from '@ngx-translate/core';
import { SimulationOrderComponent } from './order.component';
import { ElapsedTimeModule } from '@app/@shared/elapsed-time/elapsed-time.module';
import { SlideshowModule } from 'ng-simple-slideshow';
import { ImageSliderModule } from '../../../@shared/render-component/image-slider/image-slider.module';
import { OrderMapModule } from '@app/@shared/order/order-map/order-map.module';

const SIMULATION_ORDER_COMPONENTS = [SimulationOrderComponent];
@@ -17,8 +17,8 @@ const SIMULATION_ORDER_COMPONENTS = [SimulationOrderComponent];
		ToasterModule.forRoot(),
		TranslateModule.forChild(),
		ElapsedTimeModule,
		SlideshowModule,
		OrderMapModule,
		ImageSliderModule,
	],

	declarations: [...SIMULATION_ORDER_COMPONENTS],