Skip to content

Commit

Permalink
fix(admin-ui): Require default currency and language for channels (#2722
Browse files Browse the repository at this point in the history
)
  • Loading branch information
oidt authored Apr 3, 2024
1 parent 3e08f7b commit 7859a15
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class CreateProductVariantDialogComponent implements Dialog<CreateProduct
form = this.formBuilder.group({
name: ['', Validators.required],
sku: ['', Validators.required],
price: ['', Validators.required],
price: [''],
options: this.formBuilder.record<string>({}),
});
existingVariant: NonNullable<GetProductVariantOptionsQuery['product']>['variants'][number] | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,31 @@
</vdr-card>
<vdr-card [title]="'settings.defaults' | translate">
<div class="form-grid">
<vdr-form-field [label]="'settings.default-currency' | translate" for="defaultTaxZoneId">
<vdr-form-field [label]="'common.default-language' | translate" for="defaultLanguage">
<select
name="defaultCurrencyCode"
formControlName="defaultCurrencyCode"
name="defaultLanguageCode"
formControlName="defaultLanguageCode"
[vdrDisabled]="!(updatePermission | hasPermission)"
>
<option
*ngFor="let code of detailForm.value.availableCurrencyCodes"
[value]="code"
*ngFor="let languageCode of detailForm.value.availableLanguageCodes"
[value]="languageCode"
>
{{ code | localeCurrencyName }}
{{ languageCode | localeLanguageName }} ({{ languageCode | uppercase }})
</option>
</select>
</vdr-form-field>
<vdr-form-field [label]="'common.default-language' | translate" for="defaultLanguage">
<vdr-form-field [label]="'settings.default-currency' | translate" for="defaultCurrency">
<select
name="defaultLanguageCode"
formControlName="defaultLanguageCode"
name="defaultCurrencyCode"
formControlName="defaultCurrencyCode"
[vdrDisabled]="!(updatePermission | hasPermission)"
>
<option
*ngFor="let languageCode of detailForm.value.availableLanguageCodes"
[value]="languageCode"
*ngFor="let code of detailForm.value.availableCurrencyCodes"
[value]="code"
>
{{ languageCode | localeLanguageName }} ({{ languageCode | uppercase }})
{{ code | localeCurrencyName }}
</option>
</select>
</vdr-form-field>
Expand Down Expand Up @@ -162,7 +162,7 @@
</vdr-form-field>
<clr-alert
*ngIf="detailForm.value.code && !detailForm.value.defaultShippingZoneId"
clrAlertType="warning"
clrAlertType="danger"
[clrAlertClosable]="false"
>
<clr-alert-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export class ChannelDetailComponent
pricesIncludeTax: [false],
availableLanguageCodes: [[] as string[]],
availableCurrencyCodes: [[] as string[]],
defaultCurrencyCode: ['' as CurrencyCode],
defaultCurrencyCode: ['' as CurrencyCode, Validators.required],
defaultShippingZoneId: ['', Validators.required],
defaultLanguageCode: [undefined as LanguageCode | undefined],
defaultLanguageCode: [undefined as LanguageCode | undefined, Validators.required],
defaultTaxZoneId: ['', Validators.required],
sellerId: ['', Validators.required],
customFields: this.formBuilder.group(getCustomFieldsDefaults(this.customFields)),
Expand Down

0 comments on commit 7859a15

Please sign in to comment.