Removed enabled/disabled property of features

This commit is contained in:
Stefan Zermatten
2020-03-09 12:44:30 +02:00
parent 827d567ac2
commit 8e4694f63e
5 changed files with 7 additions and 32 deletions

View File

@@ -146,7 +146,7 @@ const insertPropertyFromLibraryNode = new ValidatedMethod({
const updateProperty = new ValidatedMethod({
name: 'CreatureProperties.methods.update',
validate({_id, path, value, ack}){
validate({_id, path, value}){
if (!_id) return false;
// We cannot change these fields with a simple update
switch (path[0]){

View File

@@ -8,10 +8,6 @@ let FeatureSchema = new SimpleSchema({
type: String,
optional: true,
},
alwaysEnabled: {
type: Boolean,
defaultValue: true
},
});
export { FeatureSchema }

View File

@@ -5,7 +5,6 @@
<feature-card
v-bind="feature"
:data-id="feature._id"
@update="updateFeature"
@click="featureClicked(feature)"
/>
</div>
@@ -33,7 +32,6 @@
let char = Creatures.findOne(this.creatureId, {fields: {variables: 1}});
if (!char) return [];
let vars = char.variables;
console.log('finding features for', this.creatureId);
return CreatureProperties.find({
'ancestors.id': this.creatureId,
type: 'feature',
@@ -41,27 +39,17 @@
}, {
sort: {order: 1},
}).map(f => {
console.log(f);
f.description = evaluateStringWithVariables(f.description, vars);
return f;
});
},
},
methods: {
updateFeature({_id, update}, ack){
updateFeature.call({_id, update}, error => {
if (ack){
ack(error);
} else if(error) {
throw error;
}
});
},
featureClicked(feature){
featureClicked({_id}){
this.$store.commit('pushDialogStack', {
component: 'feature-dialog-container',
elementId: feature._id,
data: {_id: feature._id},
component: 'creature-property-dialog',
elementId: `${_id}`,
data: {_id},
});
},
},

View File

@@ -5,13 +5,6 @@
{{name}}
</span>
<v-spacer/>
<v-checkbox
hide-details
class="shrink"
v-if="!alwaysEnabled"
:value="enabled"
@click.stop="$emit('update', {_id, update: {enabled: !enabled}})"
/>
</template>
<v-card-text v-if="description">
<markdown-text :markdown="description"/>
@@ -26,12 +19,9 @@
export default {
props: {
_id: String,
charId: String,
name: String,
description: String,
color: String,
enabled: Boolean,
alwaysEnabled: Boolean,
},
components: {
MarkdownText,

View File

@@ -7,6 +7,7 @@
:error-messages="errors.name"
:debounce-time="debounceTime"
/>
<!--
<smart-select
label="Enabled"
:items="enabledOptions"
@@ -15,7 +16,7 @@
:menu-props="{auto: true, lazy: true}"
@change="changeEnabled"
:debounce-time="debounceTime"
/>
/>-->
<text-area
label="Description"
:value="model.description"