Read inventory item number column decimal value from backend [SCI-9764] (#6698)

This commit is contained in:
wandji 2023-11-23 17:45:50 +01:00 committed by GitHub
parent eaa0989c77
commit 3b165ba92d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View file

@ -15,6 +15,7 @@
:updatePath="updatePath"
:optionsPath="column.options_path"
:inArchivedRepositoryRow="inArchivedRepositoryRow"
:decimals="column.decimals"
:canEdit="permissions.can_manage && !inArchivedRepositoryRow"
:editingField="editingField"
@setEditingField="editingField = $event"

View file

@ -65,12 +65,9 @@ export default {
colName: String,
colVal: Number,
permissions: null,
decimals: { type: Number, default: 0 },
canEdit: { type: Boolean, defaul: false}
},
created() {
// constants
this.decimals = Number(document.getElementById(`${this.colId}`).dataset['metadataDecimals']) || 0;
},
methods: {
toggleCollapse() {
if (!this.expandable) return;

View file

@ -57,6 +57,12 @@ json.custom_columns do
{
options_path: items_repository_repository_columns_checklist_column_path(@repository, repository_column)
}
when 'RepositoryNumberValue'
{
decimals: repository_column.metadata.fetch(
'decimals', Constants::REPOSITORY_NUMBER_TYPE_DEFAULT_DECIMALS
).to_i
}
else
{
options_path: ''