Loading packages/admin-web-angular/src/app/@shared/product/forms/basic-info/basic-info-form.component.html +5 −5 Original line number Diff line number Diff line Loading @@ -182,11 +182,11 @@ }}</label> <div class="col-sm-9"> <select class="form-control" formControlName="locale"> <option value="en-US">{{ 'ENGLISH' | translate }}</option> <option value="he-IL">{{ 'HEBREW' | translate }}</option> <option value="ru-RU">{{ 'RUSSIAN' | translate }}</option> <option value="bg-BG">{{ 'BULGARIAN' | translate }}</option> <option value="es-ES">{{ 'SPANISH' | translate }}</option> <option [value]="getLanguageCode(lang)" *ngFor="let lang of languages" >{{ lang | translate }}</option > </select> </div> </div> Loading packages/admin-web-angular/src/app/@shared/product/forms/basic-info/basic-info-form.component.ts +10 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,10 @@ import _ from 'lodash'; import isUrl from 'is-url'; import { takeUntil, first } from 'rxjs/operators'; import { TranslateService } from '@ngx-translate/core'; import { LanguageCodesEnum, LanguagesEnum, } from '@modules/server.common/interfaces/ILanguage'; @Component({ selector: 'ea-product-basic-info-form', Loading Loading @@ -73,6 +77,8 @@ export class BasicInfoFormComponent implements OnDestroy, OnInit { private onLocaleChanges: any; private images: IProductImage[] = []; public languages = Object.keys(LanguageCodesEnum); static hasValidImage(images) { if (images) { let imageUrls = images.toString().split(/\s+/); Loading Loading @@ -177,6 +183,10 @@ export class BasicInfoFormComponent implements OnDestroy, OnInit { this._ngDestroy$.complete(); } getLanguageCode(language: LanguagesEnum) { return LanguageCodesEnum[language]; } deleteImg(image) { this.images = this.images.filter((i) => i.url !== image); Loading packages/common/src/interfaces/ILanguage.ts +16 −0 Original line number Diff line number Diff line Loading @@ -2,3 +2,19 @@ type ILanguage = 'he-IL' | 'en-US' | 'ru-RU' | 'bg-BG' | 'es-ES'; export default ILanguage; export enum LanguageCodesEnum { ENGLISH = 'en-US', HEBREW = 'he-IL', RUSSIAN = 'ru-RU', BULGARIAN = 'bg-BG', SPANISH = 'es-ES', } export enum LanguagesEnum { ENGLISH = 'ENGLISH', HEBREW = 'HEBREW', RUSSIAN = 'RUSSIAN', BULGARIAN = 'BULGARIAN', SPANISH = 'SPANISH', } packages/merchant-tablet-ionic/src/pages/+promotions/promotion-forms/basic-info/basic-info-form.component.html +5 −15 Original line number Diff line number Diff line Loading @@ -12,21 +12,11 @@ <ion-item> <ion-label>Language</ion-label> <ion-select formControlName="locale" okText="Okay"> <ion-select-option value="en-US">{{ 'ENGLISH' | translate }}</ion-select-option> <ion-select-option value="he-IL">{{ 'HEBREW' | translate }}</ion-select-option> <ion-select-option value="ru-RU">{{ 'RUSSIAN' | translate }}</ion-select-option> <ion-select-option value="bg-BG">{{ 'BULGARIAN' | translate }}</ion-select-option> <ion-select-option value="es-ES">{{ 'SPANISH' | translate }}</ion-select-option> <ion-select-option *ngFor="let lang of languages" [value]="getLanguageCode(lang)" >{{ lang | translate }}</ion-select-option > </ion-select> </ion-item> </ion-col> Loading packages/merchant-tablet-ionic/src/pages/+promotions/promotion-forms/basic-info/basic-info-form.component.ts +10 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,10 @@ import { takeUntil } from 'rxjs/operators'; import { WarehouseProductsRouter } from '@modules/client.common.angular2/routers/warehouse-products-router.service'; import IProduct from '@modules/server.common/interfaces/IProduct'; import { ProductLocalesService } from '@modules/client.common.angular2/locale/product-locales.service'; import { LanguageCodesEnum, LanguagesEnum, } from '@modules/server.common/interfaces/ILanguage'; @Component({ selector: 'basic-info-form', Loading @@ -23,6 +27,8 @@ export class BasicInfoFormComponent implements OnInit, OnDestroy { @Input() promotionData: IPromotion; public languages = Object.keys(LanguageCodesEnum); availableProducts: Partial<IProduct>[] = []; displayProducts: { id: string; title: string; image: string }[]; Loading Loading @@ -90,6 +96,10 @@ export class BasicInfoFormComponent implements OnInit, OnDestroy { return basicInfoValue as IPromotionCreateObject; } getLanguageCode(language: LanguagesEnum) { return LanguageCodesEnum[language]; } private _setValue() { if (!this.promotion) return; Loading Loading
packages/admin-web-angular/src/app/@shared/product/forms/basic-info/basic-info-form.component.html +5 −5 Original line number Diff line number Diff line Loading @@ -182,11 +182,11 @@ }}</label> <div class="col-sm-9"> <select class="form-control" formControlName="locale"> <option value="en-US">{{ 'ENGLISH' | translate }}</option> <option value="he-IL">{{ 'HEBREW' | translate }}</option> <option value="ru-RU">{{ 'RUSSIAN' | translate }}</option> <option value="bg-BG">{{ 'BULGARIAN' | translate }}</option> <option value="es-ES">{{ 'SPANISH' | translate }}</option> <option [value]="getLanguageCode(lang)" *ngFor="let lang of languages" >{{ lang | translate }}</option > </select> </div> </div> Loading
packages/admin-web-angular/src/app/@shared/product/forms/basic-info/basic-info-form.component.ts +10 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,10 @@ import _ from 'lodash'; import isUrl from 'is-url'; import { takeUntil, first } from 'rxjs/operators'; import { TranslateService } from '@ngx-translate/core'; import { LanguageCodesEnum, LanguagesEnum, } from '@modules/server.common/interfaces/ILanguage'; @Component({ selector: 'ea-product-basic-info-form', Loading Loading @@ -73,6 +77,8 @@ export class BasicInfoFormComponent implements OnDestroy, OnInit { private onLocaleChanges: any; private images: IProductImage[] = []; public languages = Object.keys(LanguageCodesEnum); static hasValidImage(images) { if (images) { let imageUrls = images.toString().split(/\s+/); Loading Loading @@ -177,6 +183,10 @@ export class BasicInfoFormComponent implements OnDestroy, OnInit { this._ngDestroy$.complete(); } getLanguageCode(language: LanguagesEnum) { return LanguageCodesEnum[language]; } deleteImg(image) { this.images = this.images.filter((i) => i.url !== image); Loading
packages/common/src/interfaces/ILanguage.ts +16 −0 Original line number Diff line number Diff line Loading @@ -2,3 +2,19 @@ type ILanguage = 'he-IL' | 'en-US' | 'ru-RU' | 'bg-BG' | 'es-ES'; export default ILanguage; export enum LanguageCodesEnum { ENGLISH = 'en-US', HEBREW = 'he-IL', RUSSIAN = 'ru-RU', BULGARIAN = 'bg-BG', SPANISH = 'es-ES', } export enum LanguagesEnum { ENGLISH = 'ENGLISH', HEBREW = 'HEBREW', RUSSIAN = 'RUSSIAN', BULGARIAN = 'BULGARIAN', SPANISH = 'SPANISH', }
packages/merchant-tablet-ionic/src/pages/+promotions/promotion-forms/basic-info/basic-info-form.component.html +5 −15 Original line number Diff line number Diff line Loading @@ -12,21 +12,11 @@ <ion-item> <ion-label>Language</ion-label> <ion-select formControlName="locale" okText="Okay"> <ion-select-option value="en-US">{{ 'ENGLISH' | translate }}</ion-select-option> <ion-select-option value="he-IL">{{ 'HEBREW' | translate }}</ion-select-option> <ion-select-option value="ru-RU">{{ 'RUSSIAN' | translate }}</ion-select-option> <ion-select-option value="bg-BG">{{ 'BULGARIAN' | translate }}</ion-select-option> <ion-select-option value="es-ES">{{ 'SPANISH' | translate }}</ion-select-option> <ion-select-option *ngFor="let lang of languages" [value]="getLanguageCode(lang)" >{{ lang | translate }}</ion-select-option > </ion-select> </ion-item> </ion-col> Loading
packages/merchant-tablet-ionic/src/pages/+promotions/promotion-forms/basic-info/basic-info-form.component.ts +10 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,10 @@ import { takeUntil } from 'rxjs/operators'; import { WarehouseProductsRouter } from '@modules/client.common.angular2/routers/warehouse-products-router.service'; import IProduct from '@modules/server.common/interfaces/IProduct'; import { ProductLocalesService } from '@modules/client.common.angular2/locale/product-locales.service'; import { LanguageCodesEnum, LanguagesEnum, } from '@modules/server.common/interfaces/ILanguage'; @Component({ selector: 'basic-info-form', Loading @@ -23,6 +27,8 @@ export class BasicInfoFormComponent implements OnInit, OnDestroy { @Input() promotionData: IPromotion; public languages = Object.keys(LanguageCodesEnum); availableProducts: Partial<IProduct>[] = []; displayProducts: { id: string; title: string; image: string }[]; Loading Loading @@ -90,6 +96,10 @@ export class BasicInfoFormComponent implements OnInit, OnDestroy { return basicInfoValue as IPromotionCreateObject; } getLanguageCode(language: LanguagesEnum) { return LanguageCodesEnum[language]; } private _setValue() { if (!this.promotion) return; Loading