Improved usability with better hints in property forms and property type selection

This commit is contained in:
Stefan Zermatten
2021-07-26 18:19:29 +02:00
parent 332258705c
commit 9a9e6491b9
33 changed files with 993 additions and 802 deletions

View File

View File

@@ -1,6 +1,5 @@
import SimpleSchema from 'simpl-schema';
import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema.js';
import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js';
import InlineComputationSchema from '/imports/api/properties/subSchemas/InlineComputationSchema.js';
let SpellListSchema = new SimpleSchema({
@@ -12,12 +11,6 @@ let SpellListSchema = new SimpleSchema({
type: String,
optional: true,
},
variableName: {
type: String,
regEx: VARIABLE_NAME_REGEX,
min: 2,
optional: true,
},
// Calculation of how many spells in this list can be prepared
maxPrepared: {
type: String,

View File

@@ -2,6 +2,7 @@ import SimpleSchema from 'simpl-schema';
import { ValidatedMethod } from 'meteor/mdg:validated-method';
import { RateLimiterMixin } from 'ddp-rate-limiter-mixin';
import '/imports/api/users/deleteMyAccount.js';
import { some } from 'lodash';
const defaultLibraries = process.env.DEFAULT_LIBRARIES && process.env.DEFAULT_LIBRARIES.split(',') || [];
const userSchema = new SimpleSchema({
@@ -94,6 +95,10 @@ const userSchema = new SimpleSchema({
type: Boolean,
optional: true,
},
'preferences.hidePropertySelectDialogHelp': {
type: Boolean,
optional: true,
},
});
Meteor.users.attachSchema(userSchema);
@@ -155,7 +160,7 @@ Meteor.users.sendVerificationEmail = new ValidatedMethod({
throw new Meteor.Error('User not found',
'Can\'t send a validation email to a user that does not exist');
}
if (!_.some(user.emails, email => email.address === address)) {
if (!some(user.emails, email => email.address === address)) {
throw new Meteor.Error('Email address not found',
'The specified email address wasn\'t found on this user account');
}

View File

@@ -1,104 +1,132 @@
const PROPERTIES = Object.freeze({
action: {
icon: '$vuetify.icons.action',
name: 'Action'
name: 'Action',
helpText: 'Actions are things your character can do. When an action is taken, all the properties under it are applied.'
},
attack: {
icon: '$vuetify.icons.attack',
name: 'Attack'
name: 'Attack',
helpText: 'Attacks are a special form of action that includes an attack roll. Attacks can critical hit, which doubles the number of damage dice in properties under the attack.',
},
attribute: {
icon: '$vuetify.icons.attribute',
name: 'Attribute'
name: 'Attribute',
helpText: 'Attributes are the numbered statistics of your character, excluding rolls you might add proficiency bonus to, those are skills.',
examples: 'Ability scores, speed, hit points, ki'
},
adjustment: {
icon: '$vuetify.icons.attribute_damage',
name: 'Attribute damage'
name: 'Attribute damage',
helpText: 'Attribute damage reduces the current value of an attribute when it is applied by an action. A negative value causes the attribute to increase instead, up to its normal maximum.'
},
buff: {
icon: '$vuetify.icons.buff',
name: 'Buff'
name: 'Buff',
helpText: 'When a buff is activated as a child of an action, it will copy the properties under itself onto a target character.'
},
classLevel: {
icon: '$vuetify.icons.class_level',
name: 'Class level'
name: 'Class level',
helpText: 'Class levels represent a single level gained in a class'
},
constant: {
icon: 'mdi-anchor',
name: 'Constant'
name: 'Constant',
helpText: 'A constant can define a static value that can be used in calculations elsewhere in the sheet'
},
container: {
icon: 'mdi-bag-personal-outline',
name: 'Container'
name: 'Container',
helpText: 'A container holds items in the inventory',
examples: 'Coin pouch, backpack'
},
damage: {
icon: '$vuetify.icons.damage',
name: 'Damage'
name: 'Damage',
helpText: 'When damage is applied by an action it reduces the hit points of the target creature by the calculated amount.'
},
damageMultiplier: {
icon: '$vuetify.icons.damage_multiplier',
name: 'Damage multiplier'
name: 'Damage multiplier',
helpText: 'Resistance, vulnerability, and immunity.'
},
effect: {
icon: '$vuetify.icons.effect',
name: 'Effect'
name: 'Effect',
helpText: 'Effects change the value or state of attributes and skills.',
examples: '+2 Strength, Advantage on dexterity saving throws',
},
feature: {
icon: 'mdi-text-subject',
name: 'Feature'
name: 'Feature',
helpText: 'Descriptive or narrative features your character has access to'
},
folder: {
icon: 'mdi-folder-outline',
name: 'Folder'
name: 'Folder',
helpText: 'A way to organise other properties on the character',
},
item: {
icon: 'mdi-cube-outline',
name: 'Item'
name: 'Item',
helpText: 'Objects and equipment your charcter finds on their adventures'
},
note: {
icon: 'mdi-note-outline',
name: 'Note'
name: 'Note',
helpText: 'Notes about your character and their adventures'
},
proficiency: {
icon: 'mdi-brightness-1',
name: 'Proficiency'
name: 'Proficiency',
helpText: 'Proficiencies apply your proficiency bonus to skills already on your character sheet.'
},
roll: {
icon: '$vuetify.icons.roll',
name: 'Roll'
name: 'Roll',
helpText: 'When activated by an action, rolls perform a calculation and temporarily store the result for other properties under the same action to use'
},
reference: {
icon: 'mdi-vector-link',
name: 'Reference',
libraryOnly: true,
helpText: 'A reference is a link to a different property in a library. When a reference gets copied to a character sheet, it is replaced with the referenced property and all its children.'
},
savingThrow: {
icon: '$vuetify.icons.saving_throw',
name: 'Saving throw'
name: 'Saving throw',
helpText: 'When a saving throw is activated by an action, it causes the target to make a saving throw, if the saving throw fails, the children properties of the saving throw are activated.'
},
skill: {
icon: '$vuetify.icons.skill',
name: 'Skill'
name: 'Skill',
helpText: 'Skills, saves, languages, and weapon and tool proficiencies are all skills. Skills can have a default proficiency set. Proficiencies and effects can change the value and state of skills.'
},
propertySlot: {
icon: 'mdi-power-socket-eu',
name: 'Slot'
name: 'Slot',
helpText: 'A slot in the character sheet is used to specify that a property needs to be selected from a library to fill the slot. The slot can determine what tags it is looking for, and any subscribed library property with matching tags can fill the slot'
},
slotFiller: {
icon: 'mdi-power-plug-outline',
name: 'Slot filler'
name: 'Slot filler',
helpText: 'A slot filler allows for more advanced logic when it attemptst to fill a slot. It can masquarade as any property type, and calculate whether it should fill a slot or not.'
},
spellList: {
icon: '$vuetify.icons.spell_list',
name: 'Spell list'
name: 'Spell list',
helpText: 'A list of spells on your character sheet. It can provide a DC and spell attack bonus to the spells within'
},
spell: {
icon: '$vuetify.icons.spell',
name: 'Spell'
name: 'Spell',
helpText: 'A spell your character can potentially cast'
},
toggle: {
icon: '$vuetify.icons.toggle',
name: 'Toggle'
name: 'Toggle',
helpText: 'Togggles allow parts of the character sheet to be turned on and off, either manually or as the result of a calculation.'
},
});

View File

@@ -30,6 +30,7 @@
label="Roll bonus"
:value="model.rollBonus"
:error-messages="errors.rollBonus"
hint="A number (or calculation which returns a number) that is added to a d20 when making the attack roll"
@change="change('rollBonus', ...arguments)"
/>
<calculation-error-list :errors="model.rollBonusErrors" />
@@ -67,9 +68,11 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
@change="change('tags', ...arguments)"
/>
<!--
<smart-select
label="Target"
style="flex-basis: 300px;"
@@ -79,6 +82,7 @@
:menu-props="{auto: true, lazy: true}"
@change="change('target', ...arguments)"
/>
-->
<div class="layout wrap">
<text-field
label="Uses"
@@ -92,7 +96,7 @@
<text-field
label="Uses used"
type="number"
hint="How many times this action has already been used"
hint="How many times this action has already been used: should be 0 in most cases"
style="flex-basis: 300px;"
:value="model.usesUsed"
:error-messages="errors.uses"
@@ -102,6 +106,7 @@
<smart-select
label="Reset"
clearable
hint="When number of uses used should be reset to zero"
style="flex-basis: 300px;"
:items="resetOptions"
:value="model.reset"

View File

@@ -11,8 +11,8 @@
@change="change('stat', ...arguments)"
/>
<text-field
label="Damage"
hint="The amount of damage to apply to the selected stat, can be a calculation or roll"
label="Amount"
hint="The amount of damage to apply to the selected stat, can be a calculation or roll. Negative values will restore the selected from previous damage. If the operation is set, this is the final value of the stat instead."
style="flex-basis: 300px;"
:value="model.amount"
:error-messages="errors.amount"
@@ -23,6 +23,7 @@
label="Operation"
class="mx-1"
style="flex-basis: 300px;"
hint="Should the attribute be damaged by the amount, or set to the amount"
:items="adjustmentOps"
:value="model.operation"
:error-messages="errors.operation"
@@ -43,6 +44,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
@change="change('tags', ...arguments)"
/>

View File

@@ -11,7 +11,7 @@
/>
<text-field
label="Quantity"
hint="How much of the attribute will be consumed"
hint="How much of the attribute will be consumed. If this amount is not available in the attribute, the action can't be taken"
style="flex-basis: 300px;"
:value="model.quantity"
:error-messages="errors.quantity"

View File

@@ -5,7 +5,7 @@
ref="focusFirst"
label="Base Value"
class="base-value-field"
hint="This is the value of the attribute before effects are applied"
hint="This is the value of the attribute before effects are applied. Can be a number or a calculation"
style="width: 332px;"
:value="model.baseValueCalculation"
:error-messages="errors.baseValueCalculation"
@@ -24,7 +24,7 @@
label="Variable name"
:value="model.variableName"
style="flex-basis: 300px;"
hint="Use this name in formulae to reference this attribute"
hint="Use this name in calculations to reference this attribute"
:error-messages="errors.variableName"
@change="change('variableName', ...arguments)"
/>
@@ -71,6 +71,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
@change="change('tags', ...arguments)"
/>
@@ -92,7 +93,7 @@
type="number"
class="damage-field text-center"
style="max-width: 300px;"
hint="The attribute's final value is reduced by this amount"
hint="The attribute's final value is reduced by this amount. Attribute damage can increase this value until it matches the attribute's computed value. Should mostly be left blank."
:disabled="!context.isLibraryForm"
:value="model.damage"
:error-messages="errors.damage"
@@ -106,6 +107,7 @@
label="Reset"
clearable
style="flex-basis: 300px;"
hint="When damage should be reset to zero"
:items="resetOptions"
:value="model.reset"
:error-messages="errors.reset"
@@ -123,14 +125,14 @@
import CalculationErrorList from '/imports/ui/properties/forms/shared/CalculationErrorList.vue';
export default {
inject: {
context: { default: {} }
},
components: {
FormSection,
CalculationErrorList,
},
mixins: [propertyFormMixin],
inject: {
context: { default: {} }
},
data(){
let data = {
attributeTypes: [

View File

@@ -38,6 +38,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
@change="change('tags', ...arguments)"
/>

View File

@@ -22,7 +22,7 @@
label="Class variable name"
:value="model.variableName"
style="flex-basis: 300px;"
hint="This should be the same for each level in a class"
hint="This should be the same for each level in a class, use `variablName.level` to reference the highest class level for a given class variable name in calculations"
:error-messages="errors.variableName"
@change="change('variableName', ...arguments)"
/>
@@ -50,6 +50,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library"
:value="model.tags"
:error-messages="errors.tags"
@change="change('tags', ...arguments)"

View File

@@ -11,13 +11,14 @@
label="Variable name"
:value="model.variableName"
style="flex-basis: 300px;"
hint="Use this name in formulae to reference this attribute"
hint="Use this name in calculations to reference this attribute"
:error-messages="errors.variableName"
@change="change('variableName', ...arguments)"
/>
</div>
<text-field
label="Value"
hint="Calculation of the constant value, use 'text' for a string value, [1,2,3] for a matrix, or 123 for a number"
:value="model.calculation"
:error-messages="errors.calculation"
@change="change('calculation', ...arguments)"

View File

@@ -12,6 +12,7 @@
<smart-switch
label="Carried"
class="mx-3"
hint="Whether this container and its contents count towards the creature's weight carried"
:value="model.carried"
:error-messages="errors.carried"
@change="change('carried', ...arguments)"
@@ -62,6 +63,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
@change="change('tags', ...arguments)"
/>

View File

@@ -5,6 +5,7 @@
ref="focusFirst"
label="Damage"
style="flex-basis: 300px;"
hint="A caculation including dice rolls of the damge to deal to the target when activated by an action"
:value="model.amount"
:error-messages="errors.amount"
@change="change('amount', ...arguments)"
@@ -13,6 +14,7 @@
<smart-select
label="Damage Type"
style="flex-basis: 200px;"
hint="Use the Healing type to restore hit points"
:items="DAMAGE_TYPES"
:value="model.damageType"
:error-messages="errors.damageType"
@@ -35,6 +37,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
:error-messages="errors.tags"
@change="change('tags', ...arguments)"
@@ -45,8 +48,12 @@
<script lang="js">
import DAMAGE_TYPES from '/imports/constants/DAMAGE_TYPES.js';
import propertyFormMixin from '/imports/ui/properties/forms/shared/propertyFormMixin.js';
import CalculationErrorList from '/imports/ui/properties/forms/shared/CalculationErrorList.vue';
export default {
components: {
CalculationErrorList,
},
mixins: [propertyFormMixin],
props: {
parentTarget: {

View File

@@ -33,6 +33,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
@change="change('tags', ...arguments)"
/>

View File

@@ -11,6 +11,7 @@
label="Operation"
append-icon="mdi-menu-down"
class="mx-2"
:hint="operationHint"
:error-messages="errors.operation"
:menu-props="{transition: 'slide-y-transition', lazy: true}"
:items="operations"
@@ -42,6 +43,7 @@
multiple
chips
deletable-chips
hint="Which stats will this effect apply to"
:value="model.stats"
:items="attributeList"
:error-messages="errors.stats"
@@ -50,13 +52,21 @@
<text-field
label="Value"
class="mr-2"
hint="Number or calculation to determine the value of this effect"
:persistent-hint="needsValue"
:value="needsValue ? (model.calculation) : ' '"
:disabled="!needsValue"
:error-messages="errors.calculation"
:hint="!isFinite(model.calculation) && model.result ? model.result + '' : '' "
@change="change('calculation', ...arguments)"
/>
<v-expand-transition>
<text-field
v-if="!isFinite(+model.calculation) && model.result !== undefined"
disabled
label="Result"
:value="model.result"
/>
</v-expand-transition>
<calculation-error-list :errors="model.errors" />
<smart-combobox
label="Tags"
@@ -100,7 +110,7 @@
],
}},
computed: {
needsValue(){
needsValue(){
switch(this.model.operation) {
case 'base': return true;
case 'add': return true;
@@ -117,6 +127,23 @@
default: return true;
}
},
operationHint(){
switch(this.model.operation) {
case 'base': return 'Stats take their largest base value, and then apply all other effects';
case 'add': return 'Add this vaulue to the stat';
case 'mul': return 'Multiply the stat by this value';
case 'min': return 'The stat will be at least this value';
case 'max': return 'The stat will not exceed this value';
case 'set': return 'The stat will be set to this value';
case 'advantage': return 'If this stat is the basis for a check, that check will be at advantage';
case 'disadvantage': return 'If this stat is the basis for a check, that check will be at advantage';
case 'passiveAdd': return 'This value will be added to the passive check';
case 'fail': return 'Stat based on this attribute will always fail';
case 'conditional': return 'Add a text note to this stat';
case 'rollBonus': return 'Add this value to rolls based on this stat';
default: return '';
}
},
},
watch: {
'model.operation': {

View File

@@ -30,6 +30,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
:error-messages="errors.tags"
@change="change('tags', ...arguments)"

View File

@@ -10,7 +10,7 @@
/>
<text-field
label="Quantity"
hint="How much of the item will be consumed"
hint="How many will be consumed"
style="flex-basis: 300px;"
:value="model.quantity"
:error-messages="errors.quantity"

View File

@@ -30,6 +30,7 @@
label="Plural name"
:value="model.plural"
:error-messages="errors.plural"
hint="The plural name of your item. If your item's name is 'sword' plural name would be 'swords'"
@change="change('plural', ...arguments)"
/>
</div>
@@ -55,6 +56,7 @@
class="mx-1"
style="flex-basis: 300px;"
prepend-inner-icon="$vuetify.icons.weight"
hint="The weight of a single item in lbs. Can be a decimal value"
:value="model.weight"
:error-messages="errors.weight"
@change="change('weight', ...arguments)"
@@ -87,6 +89,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
:error-messages="errors.tags"
@change="change('tags', ...arguments)"

View File

@@ -10,7 +10,7 @@
<text-area
label="Summary"
hint="This will appear in the action card in the character sheet"
hint="This will appear in the card in the character sheet"
:value="model.summary"
:error-messages="errors.summary"
@change="change('summary', ...arguments)"
@@ -19,18 +19,19 @@
<text-area
label="Description"
hint="Text that does not fit in the summary"
:value="model.description"
:error-messages="errors.description"
@change="change('description', ...arguments)"
/>
<calculation-error-list :calculations="model.descriptionCalculations" />
<smart-combobox
label="Tags"
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
@change="change('tags', ...arguments)"
/>

View File

@@ -14,6 +14,7 @@
multiple
chips
deletable-chips
hint="Which skills does this proficiency apply to"
:value="model.stats"
:items="skillList"
:error-messages="errors.stats"
@@ -32,6 +33,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
@change="change('tags', ...arguments)"
/>

View File

@@ -62,10 +62,10 @@
AttributesConsumedListForm,
ItemsConsumedListForm,
},
mixins: [propertyFormMixin],
inject: {
context: { default: {} }
},
mixins: [propertyFormMixin],
props: {
parentTarget: {
type: String,

View File

@@ -19,6 +19,7 @@
<text-field
ref="focusFirst"
label="Roll"
hint="The calculation that will be evaluated when the roll is triggered by an action. The result will be saved as the variable name in the context of the roll."
:value="model.roll"
:error-messages="errors.roll"
@change="change('roll', ...arguments)"
@@ -30,6 +31,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
@change="change('tags', ...arguments)"
/>

View File

@@ -8,15 +8,17 @@
@change="change('name', ...arguments)"
/>
<text-field
ref="focusFirst"
label="DC"
hint="A calculation of the DC that the target of an action needs to save against in order to succeed. If the saving throw is lower than the DC, the children of this property will be activated."
:value="model.dc"
:error-messages="errors.dc"
@change="change('dc', ...arguments)"
/>
<calculation-error-list :errors="model.dcErrors" />
<smart-combobox
label="Save"
hint="Which save the saving throw targets"
hint="Which stat the saving throw targets"
:value="model.stat"
:items="saveList"
:error-messages="errors.stat"
@@ -37,6 +39,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
:error-messages="errors.tags"
@change="change('tags', ...arguments)"

View File

@@ -32,6 +32,7 @@
:value="model.skillType"
:error-messages="errors.skillType"
:menu-props="{auto: true, lazy: true}"
:hint="skillTypeHints[model.skillType]"
@change="change('skillType', ...arguments)"
/>
@@ -42,7 +43,7 @@
@change="change('description', ...arguments)"
/>
<calculation-error-list :calculations="model.descriptionCalculations" />
<form-section
name="Advanced"
standalone
@@ -118,7 +119,17 @@
text: 'Utility',
value: 'utility',
},
]
],
skillTypeHints: {
skill: 'A normal character sheet skill like Athletics, Deception, or Investigation',
'save': 'A saving throw the character can make: Strength Save, etc.',
'check': 'An ability check that might include a proficiency bonus later eg. Initiative',
'tool': 'A tool proficiency. Be sure to add a base proficiency in the advanced section.',
'weapon': 'A weapon proficiency. Be sure to add a base proficiency in the advanced section.',
'armor': 'A armor proficiency. Be sure to add a base proficiency in the advanced section.',
'language': 'A language proficiency. Be sure to add a base proficiency in the advanced section.',
'utility': 'A skill that does not show up in the sheet, but can be used by other caclulations',
}
};},
meteor: {
abilityScoreList(){

View File

@@ -35,6 +35,7 @@
label="Type"
style="flex-basis: 300px;"
clearable
hint="The property type that this slot filler pretends to be when being searched for by a slot"
:items="slotTypes"
:value="model.slotFillerType"
:error-messages="errors.slotFillerType"
@@ -62,6 +63,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this slot filler in a library"
:value="model.tags"
:error-messages="errors.tags"
@change="change('tags', ...arguments)"

View File

@@ -11,6 +11,7 @@
label="Type"
style="flex-basis: 300px;"
clearable
hint="What property type is needed to fill this slot"
:items="slotTypes"
:value="model.slotType"
:error-messages="errors.slotType"

View File

@@ -31,6 +31,7 @@
label="Level"
class="mx-1"
style="flex-basis: 300px;"
hint="The spell level"
:items="spellLevels"
:value="model.level"
:error-messages="errors.level"
@@ -110,6 +111,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
:error-messages="errors.tags"
@change="change('tags', ...arguments)"

View File

@@ -8,14 +8,6 @@
:error-messages="errors.name"
@change="change('name', ...arguments)"
/>
<text-field
label="Variable name"
:value="model.variableName"
style="flex-basis: 300px;"
hint="This name is used by spells to reference which lists they appear on"
:error-messages="errors.variableName"
@change="change('variableName', ...arguments)"
/>
</div>
<text-area
@@ -58,6 +50,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
@change="change('tags', ...arguments)"
/>

View File

@@ -33,6 +33,7 @@
<text-field
v-show="radioSelection === 'calculated'"
label="Condition"
hint="When this calculation returns a value that isn't false or zero the children will be active"
:value="model.condition"
:error-messages="errors.condition"
@change="change('condition', ...arguments)"
@@ -44,6 +45,7 @@
multiple
chips
deletable-chips
hint="Used to let slots find this property in a library, should otherwise be left blank"
:value="model.tags"
@change="change('tags', ...arguments)"
/>

View File

@@ -13,28 +13,44 @@
<v-flex
v-if="!noLibraryOnlyProps || !property.libraryOnly"
:key="type"
sm4
xs6
md4
sm6
xs12
>
<v-card
hover
style="height: 100%; overflow: hidden;"
@click="$emit('select', type)"
>
<div
class="layout align-center justify-center"
style="min-height: 70px;"
>
<v-icon x-large>
{{ property.icon }}
</v-icon>
</div>
<h3
<v-card-title
class="subtitle pb-3"
style="text-align: center;"
>
{{ property.name }}
</h3>
<v-avatar tile>
<v-icon x-large>
{{ property.icon }}
</v-icon>
</v-avatar>
<span class="ml-3">
{{ property.name }}
</span>
</v-card-title>
<v-expand-transition>
<div
v-if="showPropertyHelp"
class="mx-4"
>
{{ property.helpText }}
<div style="height: 16px;" />
<div
v-if="property.examples"
class="text-caption"
>
{{ property.examples }}
<div style="height: 16px;" />
</div>
</div>
</v-expand-transition>
</v-card>
</v-flex>
</template>
@@ -53,6 +69,12 @@ export default {
data(){ return {
PROPERTIES,
};},
meteor: {
showPropertyHelp(){
let user = Meteor.user();
return !(user?.preferences?.hidePropertySelectDialogHelp)
},
},
}
</script>

View File

@@ -5,9 +5,19 @@
key="left"
class="step-1"
>
<v-toolbar-title slot="toolbar">
Property Type
</v-toolbar-title>
<template slot="toolbar">
<v-toolbar-title>
Property Type
</v-toolbar-title>
<v-spacer />
<v-switch
:input-value="showPropertyHelp"
append-icon="mdi-help"
hide-details
flat
@change="propertyHelpChanged"
/>
</template>
<property-selector
slot="unwrapped-content"
:no-library-only-props="noLibraryOnlyProps"
@@ -28,6 +38,7 @@
<script lang="js">
import DialogBase from '/imports/ui/dialogStack/DialogBase.vue';
import PropertySelector from '/imports/ui/properties/shared/PropertySelector.vue';
import {snackbar} from '/imports/ui/components/snackbars/SnackbarQueue.js';
export default {
components: {
@@ -40,6 +51,26 @@ export default {
type: String,
},
},
meteor: {
showPropertyHelp(){
let user = Meteor.user();
return !(user?.preferences?.hidePropertySelectDialogHelp)
},
},
methods: {
propertyHelpChanged(value){
Meteor.users.setPreference.call({
preference: 'hidePropertySelectDialogHelp',
value: !value
}, error => {
if (!error) return;
console.error(error);
snackbar({
text: error.reason,
});
});
}
}
};
</script>

1473
app/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -17,7 +17,7 @@
"npm": "6.13.x"
},
"dependencies": {
"@babel/runtime": "^7.14.6",
"@babel/runtime": "^7.14.8",
"@chenfengyuan/vue-countdown": "^1.1.5",
"@tozd/vue-observer-utils": "^0.5.0",
"animejs": "^2.2.0",
@@ -32,7 +32,7 @@
"ignore-styles": "^5.0.1",
"lodash": "^4.17.20",
"marked": "^0.8.2",
"meteor-node-stubs": "^1.0.3",
"meteor-node-stubs": "^1.1.0",
"moo": "^0.5.1",
"nearley": "^2.19.1",
"qrcode": "^1.4.4",
@@ -46,13 +46,13 @@
"vue-reactive-provide": "^0.3.0",
"vue-router": "^3.5.2",
"vuedraggable": "^2.23.2",
"vuetify": "^2.5.6",
"vuetify": "^2.5.7",
"vuetify-upload-button": "^2.0.2",
"vuex": "^3.1.3"
},
"devDependencies": {
"eslint": "^6.8.0",
"eslint-plugin-vue": "^7.13.0",
"eslint": "^7.31.0",
"eslint-plugin-vue": "^7.14.0",
"eslint-plugin-vuetify": "^1.0.1",
"mem": "^6.1.1",
"sass": "^1.35.2"
@@ -88,10 +88,11 @@
}
],
"parserOptions": {
"ecmaVersion": 2018
"ecmaVersion": 2020
},
"env": {
"es6": true,
"es2021": true,
"es2020": true,
"browser": true,
"node": true,
"meteor": true