- {{ stock_formatted }}
+
+ {{ colVal.stock_formatted }}
{{ i18n.t('repositories.item_card.repository_stock_value.no_stock') }}
@@ -26,12 +34,29 @@ export default {
data_type: String,
colId: Number,
colName: String,
- colVal: Object
+ colVal: Object,
+ repositoryRowId: null,
+ permissions: null
},
created() {
this.stock_formatted = this.colVal.stock_formatted
this.stock_amount = this.colVal.stock_amount
this.low_stock_threshold = this.colVal.low_stock_threshold
+ },
+ methods: {
+ exportConsumptionCallback(event) {
+ $('#exportStockConsumptionModal')
+ .one('show.bs.modal', function() {
+ $('#exportStockConsumptionModal').attr(
+ 'data-rows',
+ $(event.target).attr('data-rows')
+ );
+ })
+ .one('hide.bs.modal', function() {
+ $('#exportStockConsumptionModal').attr('data-rows', null);
+ })
+ .modal('show');
+ }
}
}
diff --git a/app/views/repository_rows/show.json.jbuilder b/app/views/repository_rows/show.json.jbuilder
index d222ba73d..8278793f3 100644
--- a/app/views/repository_rows/show.json.jbuilder
+++ b/app/views/repository_rows/show.json.jbuilder
@@ -2,6 +2,9 @@
json.id @repository_row.id
json.repository_name @repository.name
+json.permissions do
+ json.can_export_repository_stock can_export_repository_stock?(@repository_row.repository)
+end
json.default_columns do
json.name @repository_row.name
json.code @repository_row.code
diff --git a/config/locales/en.yml b/config/locales/en.yml
index f8bd8a206..535429ec4 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -2227,8 +2227,9 @@ en:
id: "Item ID"
added_on: "Added on"
added_at: "Added at"
- added_by: 'Added by'
- custom_columns_label: 'Custom columns'
+ added_by: "Added by"
+ custom_columns_label: "Custom columns"
+ stock_export: "Export"
no_custom_columns_label: 'This item has no custom columns'
repository_time_range_value:
no_time_range: 'No time range'