Rebrand ForceBuy to ForceEntry

This commit is contained in:
Matthias 2022-05-25 19:20:18 +02:00
parent 2f2e88b8ec
commit 136d3f257a
3 changed files with 16 additions and 16 deletions

View File

@ -63,7 +63,7 @@ forceexit
> >
<PlayIcon /> <PlayIcon />
</button> </button>
<ForceBuyForm :modal-show="forcebuyShow" @close="$bvModal.hide('forcebuy-modal')" /> <ForceEntryForm :modal-show="forcebuyShow" @close="$bvModal.hide('forceentry-modal')" />
</div> </div>
</template> </template>
@ -75,14 +75,14 @@ import PauseIcon from 'vue-material-design-icons/Pause.vue';
import ReloadIcon from 'vue-material-design-icons/Reload.vue'; import ReloadIcon from 'vue-material-design-icons/Reload.vue';
import ForceExitIcon from 'vue-material-design-icons/CloseBoxMultiple.vue'; import ForceExitIcon from 'vue-material-design-icons/CloseBoxMultiple.vue';
import ForceEntryIcon from 'vue-material-design-icons/PlusBoxMultipleOutline.vue'; import ForceEntryIcon from 'vue-material-design-icons/PlusBoxMultipleOutline.vue';
import ForceBuyForm from './ForceBuyForm.vue'; import ForceEntryForm from './ForceEntryForm.vue';
import { defineComponent, computed, ref } from '@vue/composition-api'; import { defineComponent, computed, ref } from '@vue/composition-api';
import { useBotStore } from '@/stores/ftbotwrapper'; import { useBotStore } from '@/stores/ftbotwrapper';
export default defineComponent({ export default defineComponent({
name: 'BotControls', name: 'BotControls',
components: { components: {
ForceBuyForm, ForceEntryForm,
PlayIcon, PlayIcon,
StopIcon, StopIcon,
PauseIcon, PauseIcon,
@ -99,7 +99,7 @@ export default defineComponent({
}); });
const initiateForceenter = () => { const initiateForceenter = () => {
root.$bvModal.show('forcebuy-modal'); root.$bvModal.show('forceentry-modal');
}; };
const handleStopBot = () => { const handleStopBot = () => {

View File

@ -1,12 +1,12 @@
<template> <template>
<div> <div>
<b-modal <b-modal
id="forcebuy-modal" id="forceentry-modal"
ref="modal" ref="modal"
title="Force entering a trade" title="Force entering a trade"
@show="resetForm" @show="resetForm"
@hidden="resetForm" @hidden="resetForm"
@ok="handleBuy" @ok="handleEntry"
> >
<form ref="form" @submit.stop.prevent="handleSubmit"> <form ref="form" @submit.stop.prevent="handleSubmit">
<b-form-group <b-form-group
@ -28,7 +28,7 @@
id="pair-input" id="pair-input"
v-model="pair" v-model="pair"
required required
@keydown.enter.native="handleBuy" @keydown.enter.native="handleEntry"
></b-form-input> ></b-form-input>
</b-form-group> </b-form-group>
<b-form-group <b-form-group
@ -41,7 +41,7 @@
v-model="price" v-model="price"
type="number" type="number"
step="0.00000001" step="0.00000001"
@keydown.enter.native="handleBuy" @keydown.enter.native="handleEntry"
></b-form-input> ></b-form-input>
</b-form-group> </b-form-group>
<b-form-group <b-form-group
@ -55,7 +55,7 @@
v-model="stakeAmount" v-model="stakeAmount"
type="number" type="number"
step="0.000001" step="0.000001"
@keydown.enter.native="handleBuy" @keydown.enter.native="handleEntry"
></b-form-input> ></b-form-input>
</b-form-group> </b-form-group>
<b-form-group <b-form-group
@ -85,7 +85,7 @@ import { ForceEnterPayload, OrderSides } from '@/types';
import { defineComponent, ref, nextTick } from '@vue/composition-api'; import { defineComponent, ref, nextTick } from '@vue/composition-api';
export default defineComponent({ export default defineComponent({
name: 'ForceBuyForm', name: 'ForceEntryForm',
setup(_, { root }) { setup(_, { root }) {
const botStore = useBotStore(); const botStore = useBotStore();
@ -107,7 +107,7 @@ export default defineComponent({
if (!checkFormValidity()) { if (!checkFormValidity()) {
return; return;
} }
// call forcebuy // call forceentry
const payload: ForceEnterPayload = { pair: pair.value }; const payload: ForceEnterPayload = { pair: pair.value };
if (price.value) { if (price.value) {
payload.price = Number(price.value); payload.price = Number(price.value);
@ -121,9 +121,9 @@ export default defineComponent({
if (botStore.activeBot.botApiVersion >= 2.13 && botStore.activeBot.shortAllowed) { if (botStore.activeBot.botApiVersion >= 2.13 && botStore.activeBot.shortAllowed) {
payload.side = orderSide.value; payload.side = orderSide.value;
} }
botStore.activeBot.forcebuy(payload); botStore.activeBot.forceentry(payload);
nextTick(() => { nextTick(() => {
root.$bvModal.hide('forcebuy-modal'); root.$bvModal.hide('forceentry-modal');
}); });
}; };
const resetForm = () => { const resetForm = () => {
@ -141,7 +141,7 @@ export default defineComponent({
} }
}; };
const handleBuy = (bvModalEvt) => { const handleEntry = (bvModalEvt) => {
// Prevent modal from closing // Prevent modal from closing
bvModalEvt.preventDefault(); bvModalEvt.preventDefault();
// Trigger submit handler // Trigger submit handler
@ -151,7 +151,7 @@ export default defineComponent({
handleSubmit, handleSubmit,
botStore, botStore,
form, form,
handleBuy, handleEntry,
resetForm, resetForm,
pair, pair,
price, price,

View File

@ -616,7 +616,7 @@ export function createBotSubStore(botId: string, botName: string) {
return Promise.reject(error); return Promise.reject(error);
} }
}, },
async forcebuy(payload: ForceEnterPayload) { async forceentry(payload: ForceEnterPayload) {
if (payload && payload.pair) { if (payload && payload.pair) {
try { try {
// TODO: Update forcebuy to forceenter ... // TODO: Update forcebuy to forceenter ...