Hunted the last of the \t's to extinction

This commit is contained in:
Stefan Zermatten
2022-10-09 16:56:28 +02:00
parent 2fa913b09a
commit aa8f2d230d
19 changed files with 1044 additions and 1024 deletions

View File

@@ -3,69 +3,69 @@ import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js';
import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js';
let ContainerSchema = createPropertySchema({
name: {
type: String,
optional: true,
trim: false,
max: STORAGE_LIMITS.name,
},
carried: {
type: Boolean,
defaultValue: true,
optional: true,
},
contentsWeightless: {
type: Boolean,
optional: true,
},
weight: {
type: Number,
min: 0,
optional: true,
},
value: {
type: Number,
min: 0,
optional: true,
},
description: {
type: 'inlineCalculationFieldToCompute',
optional: true,
},
name: {
type: String,
optional: true,
trim: false,
max: STORAGE_LIMITS.name,
},
carried: {
type: Boolean,
defaultValue: true,
optional: true,
},
contentsWeightless: {
type: Boolean,
optional: true,
},
weight: {
type: Number,
min: 0,
optional: true,
},
value: {
type: Number,
min: 0,
optional: true,
},
description: {
type: 'inlineCalculationFieldToCompute',
optional: true,
},
});
const ComputedOnlyContainerSchema = createPropertySchema({
description: {
type: 'computedOnlyInlineCalculationField',
optional: true,
},
// Weight of all the contents, zero if `contentsWeightless` is true
contentsWeight: {
type: Number,
optional: true,
removeBeforeCompute: true,
},
// Weight of all the carried contents (some sub-containers might not be carried)
// zero if `contentsWeightless` is true
carriedWeight: {
type: Number,
optional: true,
removeBeforeCompute: true,
},
contentsValue: {
type: Number,
optional: true,
removeBeforeCompute: true,
},
carriedValue: {
type: Number,
optional: true,
removeBeforeCompute: true,
},
description: {
type: 'computedOnlyInlineCalculationField',
optional: true,
},
// Weight of all the contents, zero if `contentsWeightless` is true
contentsWeight: {
type: Number,
optional: true,
removeBeforeCompute: true,
},
// Weight of all the carried contents (some sub-containers might not be carried)
// zero if `contentsWeightless` is true
carriedWeight: {
type: Number,
optional: true,
removeBeforeCompute: true,
},
contentsValue: {
type: Number,
optional: true,
removeBeforeCompute: true,
},
carriedValue: {
type: Number,
optional: true,
removeBeforeCompute: true,
},
});
const ComputedContainerSchema = new SimpleSchema()
.extend(ComputedOnlyContainerSchema)
.extend(ContainerSchema);
.extend(ComputedOnlyContainerSchema)
.extend(ContainerSchema);
export { ContainerSchema, ComputedOnlyContainerSchema, ComputedContainerSchema };