Removed unused dialogs

This commit is contained in:
Stefan Zermatten
2023-06-07 10:44:49 +02:00
parent 99b5ad4e82
commit 54e54ef5a8
5 changed files with 0 additions and 302 deletions

View File

@@ -1,51 +0,0 @@
<template lang="html">
<selectable-property-dialog
:value="forcedType || type"
no-library-only-props
@input="e => type = e"
>
<creature-property-insert-form
:type="forcedType || type"
:property-name="getPropertyName(forcedType || type)"
@back="back"
/>
</selectable-property-dialog>
</template>
<script lang="js">
import SelectablePropertyDialog from '/imports/client/ui/properties/shared/SelectablePropertyDialog.vue';
import CreaturePropertyInsertForm from '/imports/client/ui/creature/creatureProperties/CreaturePropertyInsertForm.vue';
import { getPropertyName } from '/imports/constants/PROPERTIES.js';
export default {
components: {
SelectablePropertyDialog,
CreaturePropertyInsertForm,
},
props: {
forcedType: {
type: String,
default: undefined,
},
},
data() {
return {
type: undefined,
};
},
methods: {
getPropertyName,
back() {
if (this.forcedType) {
this.$store.dispatch('popDialogStack');
} else {
this.type = undefined;
}
},
},
};
</script>
<style lang="css" scoped>
</style>

View File

@@ -1,93 +0,0 @@
<template lang="html">
<dialog-base
:override-back-button="() => $emit('back')"
:color="model.color"
>
<template slot="toolbar">
<v-toolbar-title>
Add {{ propertyName }}
</v-toolbar-title>
<v-spacer />
<color-picker
:value="model.color"
@input="value => change({path: ['color'], value})"
/>
</template>
<component
:is="type"
v-if="type"
class="creature-property-form"
:model="model"
:errors="errors"
@change="change"
@push="push"
@pull="pull"
/>
<div
slot="actions"
class="layout justify-end"
>
<v-btn
text
:disabled="!valid"
@click="$store.dispatch('popDialogStack', model)"
>
Insert
</v-btn>
</div>
</dialog-base>
</template>
<script lang="js">
import propertySchemasIndex from '/imports/api/properties/propertySchemasIndex.js';
import DialogBase from '/imports/client/ui/dialogStack/DialogBase.vue';
import propertyFormIndex from '/imports/client/ui/properties/forms/shared/propertyFormIndex.js';
import ColorPicker from '/imports/client/ui/components/ColorPicker.vue';
import schemaFormMixin from '/imports/client/ui/properties/forms/shared/schemaFormMixin.js';
export default {
components: {
...propertyFormIndex,
DialogBase,
ColorPicker,
},
mixins: [schemaFormMixin],
props: {
propertyName: String,
type: String,
},
reactiveProvide: {
name: 'context',
include: ['debounceTime'],
},
data(){return {
model: {
type: this.type,
},
schema: undefined,
validationContext: undefined,
debounceTime: 0,
};},
watch: {
type(newType){
this.changeType(newType);
},
},
mounted(){
this.changeType(this.type);
},
methods:{
changeType(type){
if (!type) return;
this.schema = propertySchemasIndex[type];
this.validationContext = this.schema.newContext();
let model = this.schema.clean({});
model.type = type;
this.model = model;
}
},
}
</script>
<style lang="css" scoped>
</style>

View File

@@ -3,7 +3,6 @@ import InsertPropertyDialog from '/imports/client/ui/properties/InsertPropertyDi
import CharacterCreationDialog from '/imports/client/ui/creature/character/CharacterCreationDialog.vue';
import CastSpellWithSlotDialog from '/imports/client/ui/properties/components/spells/CastSpellWithSlotDialog.vue';
import CreatureFormDialog from '/imports/client/ui/creature/CreatureFormDialog.vue';
import CreaturePropertyCreationDialog from '/imports/client/ui/creature/creatureProperties/CreaturePropertyCreationDialog.vue';
import CreaturePropertyDialog from '/imports/client/ui/creature/creatureProperties/CreaturePropertyDialog.vue';
import CreaturePropertyFromLibraryDialog from '/imports/client/ui/creature/creatureProperties/CreaturePropertyFromLibraryDialog.vue';
import CreatureRootDialog from '/imports/client/ui/creature/character/CreatureRootDialog.vue';
@@ -26,7 +25,6 @@ const LibraryCollectionCreationDialog = () => import('/imports/client/ui/library
const LibraryCollectionEditDialog = () => import('/imports/client/ui/library/LibraryCollectionEditDialog.vue');
const LibraryCreationDialog = () => import('/imports/client/ui/library/LibraryCreationDialog.vue');
const LibraryEditDialog = () => import('/imports/client/ui/library/LibraryEditDialog.vue');
const LibraryNodeCreationDialog = () => import('/imports/client/ui/library/LibraryNodeCreationDialog.vue');
const LibraryNodeDialog = () => import('/imports/client/ui/library/LibraryNodeDialog.vue');
const MoveLibraryNodeDialog = () => import('/imports/client/ui/library/MoveLibraryNodeDialog.vue');
const SelectCreaturesDialog = () => import('/imports/client/ui/tabletop/SelectCreaturesDialog.vue');
@@ -39,7 +37,6 @@ export default {
CastSpellWithSlotDialog,
CharacterCreationDialog,
CreatureFormDialog,
CreaturePropertyCreationDialog,
CreaturePropertyDialog,
CreaturePropertyFromLibraryDialog,
CreatureRootDialog,
@@ -55,7 +52,6 @@ export default {
LibraryCollectionEditDialog,
LibraryCreationDialog,
LibraryEditDialog,
LibraryNodeCreationDialog,
LibraryNodeDialog,
MoveLibraryNodeDialog,
SelectCreaturesDialog,

View File

@@ -1,34 +0,0 @@
<template lang="html">
<selectable-property-dialog v-model="type">
<library-node-insert-form
:type="type"
:property-name="getPropertyName(type)"
@back="type = undefined"
/>
</selectable-property-dialog>
</template>
<script lang="js">
import SelectablePropertyDialog from '/imports/client/ui/properties/shared/SelectablePropertyDialog.vue';
import LibraryNodeInsertForm from '/imports/client/ui/library/LibraryNodeInsertForm.vue';
import { getPropertyName } from '/imports/constants/PROPERTIES.js';
export default {
components: {
SelectablePropertyDialog,
LibraryNodeInsertForm,
},
data() {
return {
type: undefined,
};
},
methods: {
getPropertyName,
},
};
</script>
<style lang="css" scoped>
</style>

View File

@@ -1,120 +0,0 @@
<template lang="html">
<dialog-base
:override-back-button="() => $emit('back')"
:color="model.color"
>
<template slot="toolbar">
<v-toolbar-title>
Add {{ propertyName }}
</v-toolbar-title>
<v-spacer />
<color-picker
:value="model.color"
@input="value => change({path: ['color'], value})"
/>
<v-btn
icon
data-id="help-button"
@click="helpDialog"
>
<v-icon>mdi-help</v-icon>
</v-btn>
</template>
<component
:is="type"
v-if="type"
class="library-node-form"
:model="model"
:errors="errors"
@change="change"
@push="push"
@pull="pull"
/>
<div
slot="actions"
class="layout justify-end"
>
<v-btn
text
:disabled="!valid"
@click="$store.dispatch('popDialogStack', model)"
>
Insert
</v-btn>
</div>
</dialog-base>
</template>
<script lang="js">
import DialogBase from '/imports/client/ui/dialogStack/DialogBase.vue';
import propertyFormIndex from '/imports/client/ui/properties/forms/shared/propertyFormIndex.js';
import schemaFormMixin from '/imports/client/ui/properties/forms/shared/schemaFormMixin.js';
import ColorPicker from '/imports/client/ui/components/ColorPicker.vue';
import propertySchemasIndex from '/imports/api/properties/propertySchemasIndex.js';
import PROPERTIES from '/imports/constants/PROPERTIES.js';
export default {
components: {
...propertyFormIndex,
DialogBase,
ColorPicker,
},
mixins: [schemaFormMixin],
props: {
propertyName: {
type: String,
default: undefined,
},
type: {
type: String,
default: undefined,
},
},
reactiveProvide: {
name: 'context',
include: ['debounceTime', 'isLibraryForm'],
},
data() {
return {
model: {
type: this.type,
},
schema: undefined,
validationContext: undefined,
debounceTime: 0,
isLibraryForm: true,
};
},
computed: {
docsPath() {
const propDef = PROPERTIES[this.type];
return propDef && propDef.docsPath;
},
},
watch: {
type(newType) {
if (!newType) return;
this.schema = propertySchemasIndex[newType];
this.validationContext = this.schema.newContext();
let model = this.schema.clean({});
model.type = newType;
this.model = model;
},
},
methods: {
helpDialog() {
this.$store.commit('pushDialogStack', {
component: 'help-dialog',
elementId: 'help-button',
data: {
path: this.docsPath,
},
});
},
}
}
</script>
<style lang="css" scoped>
</style>