Commit 7fd971e4 authored by RAHUL RATHORE's avatar RAHUL RATHORE
Browse files

fix: url package wrong import path

parent 2861ccc4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ import {
import { ICarrierCreateObject } from '@modules/server.common/interfaces/ICarrier';
import * as _ from 'lodash';
import { FormHelpers } from '../../../forms/helpers';
import isUrl from 'is-url';
import * as isUrl from 'is-url';
import { TranslateService } from '@ngx-translate/core';
import { first } from 'rxjs/operators';

+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@

		<div class="col-sm-9">
			<e-cu-file-uploader
				[placeholder]="uploaderPlaceholder"
				[placeholder]="'CATEGORY_VIEW.CREATE.PHOTO_OPTIONAL' | translate"
				[name]="name?.value"
				[fileUrl]="image?.value"
				(uploadedImgUrl)="image.setValue($event)"
+2 −15
Original line number Diff line number Diff line
@@ -12,10 +12,9 @@ import {
	AbstractControl,
	FormBuilder,
} from '@angular/forms';
import isUrl from 'is-url';
import * as _ from 'lodash';
import * as isUrl from 'is-url';
import * as _ from 'underscore';
import { TranslateService } from '@ngx-translate/core';
import { first } from 'rxjs/operators';
import { IProductsCategoryCreateObject } from '@modules/server.common/interfaces/IProductsCategory';

@Component({
@@ -30,8 +29,6 @@ export class BasicInfoFormComponent implements OnInit, AfterViewInit {
	@Input()
	category: { title: string; image: string };

	uploaderPlaceholder: string;

	readonly form: FormGroup = this.fb.group({
		name: ['', Validators.required],
		image: [
@@ -39,7 +36,6 @@ export class BasicInfoFormComponent implements OnInit, AfterViewInit {
			[
				(control: AbstractControl) => {
					const imageUrl = control.value;

					if (!isUrl(imageUrl) && !_.isEmpty(imageUrl)) {
						return { invalidUrl: true };
					}
@@ -139,8 +135,6 @@ export class BasicInfoFormComponent implements OnInit, AfterViewInit {
			this.name.setValue(this.category.title);
			this.image.setValue(this.category.image);
		}

		this.getUploaderPlaceholderText();
	}

	deleteImg() {
@@ -151,13 +145,6 @@ export class BasicInfoFormComponent implements OnInit, AfterViewInit {
		this._setupLogoUrlValidation();
	}

	private async getUploaderPlaceholderText() {
		this.uploaderPlaceholder = await this._langTranslateService
			.get('CATEGORY_VIEW.CREATE.PHOTO_OPTIONAL')
			.pipe(first())
			.toPromise();
	}

	private _setupLogoUrlValidation() {
		this.imagePreviewElement.nativeElement.onload = () => {
			this.image.setErrors(null);
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ import { ProductLocalesService } from '@modules/client.common.angular2/locale/pr
import { IMultiSelectOption } from 'angular-2-dropdown-multiselect';
import { FormHelpers } from '../../../forms/helpers';
import * as _ from 'lodash';
import isUrl from 'is-url';
import * as isUrl from 'is-url';
import { takeUntil, first } from 'rxjs/operators';
import { TranslateService } from '@ngx-translate/core';
import {
+2 −2
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@ import { first } from 'rxjs/operators';
import { CarrierRouter } from '@modules/client.common.angular2/routers/carrier-router.service';
import { IMultiSelectOption } from 'angular-2-dropdown-multiselect';
import { FormHelpers } from '../../../../forms/helpers';
import * as _ from 'lodash';
import isUrl from 'is-url';
import * as _ from 'underscore';
import * as isUrl from 'is-url';
import { TranslateService } from '@ngx-translate/core';

export type WarehouseManageTabsDetails = Pick<
Loading