2
0
mirror of https://github.com/frappe/books.git synced 2024-11-09 23:30:56 +00:00

ux: add Cancel in Setup Wizard

This commit is contained in:
18alantom 2021-12-20 15:22:31 +05:30
parent 2708fb50b6
commit 1eb9431767
2 changed files with 10 additions and 3 deletions

View File

@ -16,6 +16,7 @@
<SetupWizard
v-if="activeScreen === 'SetupWizard'"
@setup-complete="showSetupWizardOrDesk(true)"
@setup-canceled="setupCanceled"
/>
<portal-target name="popovers" multiple></portal-target>
</div>
@ -33,7 +34,7 @@ import config from '@/config';
import { IPC_MESSAGES, IPC_ACTIONS } from '@/messages';
import { connectToLocalDatabase, purgeCache } from '@/initialization';
import { routeTo, showErrorDialog } from './utils';
import { DB_CONN_FAILURE } from './messages';
import fs from 'fs/promises';
export default {
name: 'App',
@ -118,6 +119,11 @@ export default {
purgeCache(true);
this.activeScreen = 'DatabaseSelector';
},
async setupCanceled() {
const filePath = config.get('lastSelectedFilePath')
await fs.unlink(filePath)
this.changeDbFile()
},
},
};
</script>

View File

@ -51,7 +51,8 @@
</div>
<TwoColumnForm :fields="fields" :doc="doc" />
</div>
<div class="flex justify-end px-8 mt-5 window-no-drag">
<div class="flex justify-between px-8 mt-5 window-no-drag">
<Button class="text-sm text-grey-900" @click="$emit('setup-canceled')">Cancel</Button>
<Button
@click="submit"
type="primary"
@ -175,7 +176,7 @@ export default {
return this.meta.getQuickEditFields();
},
buttonText() {
return this.loading ? this._('Setting Up...') : this._('Next');
return this.loading ? this._('Setting Up...') : this._('Submit');
},
},
};