Skip to content

Commit

Permalink
fix(admin-ui): Improve feedback on attempting to create variant
Browse files Browse the repository at this point in the history
Closes #2210
  • Loading branch information
michaelbromley committed Jun 12, 2023
1 parent 4f421d3 commit e50b271
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 18 deletions.
32 changes: 16 additions & 16 deletions packages/admin-ui/i18n-coverage.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
{
"generatedOn": "2023-06-09T09:28:06.112Z",
"lastCommit": "dae3e93af527fd2696214700896ba577566ae12a",
"generatedOn": "2023-06-12T08:53:10.773Z",
"lastCommit": "00381181bd682df9ce0bec9453afd3b559d0ce95",
"translationStatus": {
"cs": {
"tokenCount": 736,
"tokenCount": 737,
"translatedCount": 544,
"percentage": 74
},
"de": {
"tokenCount": 736,
"tokenCount": 737,
"translatedCount": 538,
"percentage": 73
},
"en": {
"tokenCount": 736,
"translatedCount": 735,
"tokenCount": 737,
"translatedCount": 736,
"percentage": 100
},
"es": {
"tokenCount": 736,
"tokenCount": 737,
"translatedCount": 569,
"percentage": 77
},
"fr": {
"tokenCount": 736,
"tokenCount": 737,
"translatedCount": 564,
"percentage": 77
},
"it": {
"tokenCount": 736,
"tokenCount": 737,
"translatedCount": 568,
"percentage": 77
},
"pl": {
"tokenCount": 736,
"tokenCount": 737,
"translatedCount": 378,
"percentage": 51
},
"pt_BR": {
"tokenCount": 736,
"tokenCount": 737,
"translatedCount": 542,
"percentage": 74
},
"pt_PT": {
"tokenCount": 736,
"tokenCount": 737,
"translatedCount": 577,
"percentage": 78
},
"ru": {
"tokenCount": 736,
"tokenCount": 737,
"translatedCount": 567,
"percentage": 77
},
"uk": {
"tokenCount": 736,
"tokenCount": 737,
"translatedCount": 567,
"percentage": 77
},
"zh_Hans": {
"tokenCount": 736,
"tokenCount": 737,
"translatedCount": 513,
"percentage": 70
},
"zh_Hant": {
"tokenCount": 736,
"tokenCount": 737,
"translatedCount": 358,
"percentage": 49
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,26 @@
>
</ng-select>
</vdr-form-field>
<clr-alert
*ngIf="product.optionGroups.length === 0"
clrAlertType="warning"
[clrAlertClosable]="false"
class="form-grid-span"
>
<clr-alert-item>
<span class="alert-text">
{{ 'catalog.cannot-create-variants-without-options' | translate }}
</span>
</clr-alert-item>
</clr-alert>
</div>
<div *ngIf="existingVariant" class="mt-2">
<clr-alert clrAlertType="warning" [clrAlertClosable]="false" class="">
<clr-alert-item>
<span class="alert-text">
{{ 'catalog.product-variant-exists' | translate }}: {{ existingVariant.name }} ({{ existingVariant.sku }})
{{ 'catalog.product-variant-exists' | translate }}: {{ existingVariant.name }} ({{
existingVariant.sku
}})
</span>
</clr-alert-item>
</clr-alert>
Expand All @@ -38,7 +52,7 @@
type="submit"
(click)="confirm()"
class="btn btn-primary"
[disabled]="form.invalid || existingVariant"
[disabled]="form.invalid || existingVariant || product.optionGroups.length === 0"
>
{{ 'common.confirm' | translate }}
</button>
Expand Down
1 change: 1 addition & 0 deletions packages/admin-ui/src/lib/static/i18n-messages/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"assign-variants-to-channel": "Přiřadit varianty do kanálu",
"auto-update-option-variant-name": "Automaticky aktualizovat jména variant pomocí této",
"auto-update-product-variant-name": "Automaticky aktualizovat jména variant",
"cannot-create-variants-without-options": "",
"channel-price-preview": "Náhled ceny v kanálu",
"collection": "",
"collection-contents": "Obsah kolekce",
Expand Down
1 change: 1 addition & 0 deletions packages/admin-ui/src/lib/static/i18n-messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"assign-variants-to-channel": "Produktvarianten Kanälen zuweisen",
"auto-update-option-variant-name": "Automatisch Namen der Optionsvariante aktualisieren",
"auto-update-product-variant-name": "Automatisch Namen der Produktvariante aktualisieren",
"cannot-create-variants-without-options": "",
"channel-price-preview": "Kanal-Preisvorschau",
"collection": "Sammlung",
"collection-contents": "Inhalt der Sammlung",
Expand Down
1 change: 1 addition & 0 deletions packages/admin-ui/src/lib/static/i18n-messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"assign-variants-to-channel": "Assign product variants to channel",
"auto-update-option-variant-name": "Automatically update the names of ProductVariants using this option",
"auto-update-product-variant-name": "Automatically update the names of ProductVariants",
"cannot-create-variants-without-options": "Product variants cannot be created until an option group with at least two product options has been defined",
"channel-price-preview": "Channel price preview",
"collection": "Collection",
"collection-contents": "Collection contents",
Expand Down
1 change: 1 addition & 0 deletions packages/admin-ui/src/lib/static/i18n-messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"assign-variants-to-channel": "Asignar variantes de producto a canal de ventas",
"auto-update-option-variant-name": "Actualiza los nombres de las variantes de producto automáticamente usando esta opción",
"auto-update-product-variant-name": "Actualiza los nombres de las variantes de producto automáticamente",
"cannot-create-variants-without-options": "",
"channel-price-preview": "Vista previa de precio para el canal de ventas",
"collection": "",
"collection-contents": "Contenidos de la colección",
Expand Down
1 change: 1 addition & 0 deletions packages/admin-ui/src/lib/static/i18n-messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"assign-variants-to-channel": "Attribuer une variation du produit au canal",
"auto-update-option-variant-name": "Mettre à jour automatiquement les noms de variations du produit en utilisant cette option",
"auto-update-product-variant-name": "Mettre à jour automatiquement les noms de variations du produit ",
"cannot-create-variants-without-options": "",
"channel-price-preview": "Prévisualisation du prix du canal",
"collection": "",
"collection-contents": "Contenu de la Collection",
Expand Down
1 change: 1 addition & 0 deletions packages/admin-ui/src/lib/static/i18n-messages/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"assign-variants-to-channel": "Assegna varianti al canale",
"auto-update-option-variant-name": "Aggiorna automaticamente i nomi delle Varianti utilizzando questa opzione",
"auto-update-product-variant-name": "Aggiorna automaticamente i nomi delle Varianti",
"cannot-create-variants-without-options": "",
"channel-price-preview": "Anteprima prezzo canale",
"collection": "",
"collection-contents": "Contenuti della Collezione",
Expand Down
1 change: 1 addition & 0 deletions packages/admin-ui/src/lib/static/i18n-messages/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"assign-variants-to-channel": "",
"auto-update-option-variant-name": "",
"auto-update-product-variant-name": "",
"cannot-create-variants-without-options": "",
"channel-price-preview": "Podgląd cen kanału",
"collection": "",
"collection-contents": "Zawartość kolekcji",
Expand Down
1 change: 1 addition & 0 deletions packages/admin-ui/src/lib/static/i18n-messages/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"assign-variants-to-channel": "Atribuir variação ao canal",
"auto-update-option-variant-name": "Atualizar automaticamente os nomes das variações do produto usando esta opção",
"auto-update-product-variant-name": "Atualizar automaticamente os nomes das variações do produto",
"cannot-create-variants-without-options": "",
"channel-price-preview": "Visualizar preço do canal",
"collection": "",
"collection-contents": "Conteúdo da categoria",
Expand Down
1 change: 1 addition & 0 deletions packages/admin-ui/src/lib/static/i18n-messages/pt_PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"assign-variants-to-channel": "Atribuir variante ao canal",
"auto-update-option-variant-name": "Utilizar esta opção para actualizar automaticamente os nomes das variantes",
"auto-update-product-variant-name": "Actualizar automaticamente os nomes das variantes do produto",
"cannot-create-variants-without-options": "",
"channel-price-preview": "Visualizar preço do canal",
"collection": "",
"collection-contents": "Conteúdo da categoria",
Expand Down
1 change: 1 addition & 0 deletions packages/admin-ui/src/lib/static/i18n-messages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"assign-variants-to-channel": "Добавить варианты товара в канал",
"auto-update-option-variant-name": "Автоматически обновлять названия вариантов товара с помощью этой опции",
"auto-update-product-variant-name": "Автоматически обновлять названия вариантов товара",
"cannot-create-variants-without-options": "",
"channel-price-preview": "Предварительный просмотр цен канала",
"collection": "",
"collection-contents": "Содержание коллекции",
Expand Down
1 change: 1 addition & 0 deletions packages/admin-ui/src/lib/static/i18n-messages/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"assign-variants-to-channel": "Додати варіанти товару в канал",
"auto-update-option-variant-name": "Автоматично оновлювати назви варіантів товару, використовуючи цю опцію",
"auto-update-product-variant-name": "Автоматично оновлювати назви варіантів товару",
"cannot-create-variants-without-options": "",
"channel-price-preview": "Попередній перегляд цін каналу",
"collection": "",
"collection-contents": "Зміст колекції",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"assign-variants-to-channel": "添加到销售渠道",
"auto-update-option-variant-name": "此选项自动更新不同商品变体名称",
"auto-update-product-variant-name": "自动更新不同商品变体名称",
"cannot-create-variants-without-options": "",
"channel-price-preview": "渠道价格预览",
"collection": "",
"collection-contents": "系列产品",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"assign-variants-to-channel": "",
"auto-update-option-variant-name": "",
"auto-update-product-variant-name": "",
"cannot-create-variants-without-options": "",
"channel-price-preview": "渠道價格覽",
"collection": "",
"collection-contents": "系列產品",
Expand Down

0 comments on commit e50b271

Please sign in to comment.