Skip to content

Commit

Permalink
refactor(ProductCard): new prop to hide categories & labels chip
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Nov 14, 2024
1 parent e755d8b commit 767f813
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/components/PriceCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<span v-if="hasProductSource">
<ProductBrands :productBrands="product.brands" :readonly="readonly" />
<ProductQuantityChip class="mr-1" :productQuantity="product.product_quantity" :productQuantityUnit="product.product_quantity_unit" />
<!-- ProductCategoriesChip, ProductLabelsChip -->
<br v-if="showProductBarcode">
<ProductBarcodeChip v-if="showProductBarcode" :product="product" />
</span>
Expand Down
10 changes: 7 additions & 3 deletions src/components/ProductCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<span v-if="hasProductSource">
<ProductBrands :productBrands="product.brands" :readonly="readonly" />
<ProductQuantityChip class="mr-1" :productQuantity="product.product_quantity" :productQuantityUnit="product.product_quantity_unit" />
<br>
<ProductCategoriesChip class="mr-1" :productCategories="product.categories_tags" />
<ProductLabelsChip :productLabels="product.labels_tags" />
<br v-if="!hideCategoriesAndLabels">
<ProductCategoriesChip v-if="!hideCategoriesAndLabels" class="mr-1" :productCategories="product.categories_tags" />
<ProductLabelsChip v-if="!hideCategoriesAndLabels" :productLabels="product.labels_tags" />
</span>
<ProductMissingChip v-else />
<br v-if="showProductBarcode">
Expand Down Expand Up @@ -68,6 +68,10 @@ export default {
type: Object,
default: null
},
hideCategoriesAndLabels: {
type: Boolean,
default: false
},
hideProductBarcode: {
type: Boolean,
default: true
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProductInputRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<span class="d-sm-none">{{ $t('AddPriceSingle.ProductInfo.Type') }}</span>
<span class="d-none d-sm-inline-flex">{{ $t('AddPriceSingle.ProductInfo.TypeBarcode') }}</span>
</v-btn>
<ProductCard v-if="productForm.product" class="mb-2" :product="productForm.product" :hidePriceFooterRow="true" :hideProductActions="true" :readonly="true" elevation="1" />
<ProductCard v-if="productForm.product" class="mb-2" :product="productForm.product" :hideCategoriesAndLabels="true" :hideProductActions="true" :readonly="true" elevation="1" />
</v-sheet>
<v-sheet v-if="productForm.mode === 'category'">
<v-row>
Expand Down

0 comments on commit 767f813

Please sign in to comment.