Fixed some TS warnings
This commit is contained in:
parent
270df75fc8
commit
887262ae5a
|
@ -1,10 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<q-page padding class="fit row justify-center items-center content-center">
|
<q-page padding class="fit row justify-center items-center content-center">
|
||||||
<q-card class="col-xs-11 col-sm-8 col-md-6 col-lg-4 justify-center items-center content-center">
|
<q-card class="col-xs-11 col-sm-8 col-md-6 col-lg-4 justify-center items-center content-center">
|
||||||
<q-toolbar class="bg-primary text-white">
|
<q-toolbar class="bg-primary text-white">
|
||||||
<q-toolbar-title>
|
<q-toolbar-title> Passwort vergessen </q-toolbar-title>
|
||||||
Passwort vergessen
|
|
||||||
</q-toolbar-title>
|
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
|
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
|
@ -43,8 +41,6 @@ import { AxiosResponse } from 'axios';
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
// name: 'PageName'
|
// name: 'PageName'
|
||||||
setup(_, { root }) {
|
setup(_, { root }) {
|
||||||
const mainRoute = { name: 'dashboard' };
|
|
||||||
|
|
||||||
const password = ref('');
|
const password = ref('');
|
||||||
const password2 = ref('');
|
const password2 = ref('');
|
||||||
|
|
||||||
|
|
|
@ -13,11 +13,11 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { ref, computed, defineComponent, onBeforeMount } from '@vue/composition-api';
|
import { ref, computed, defineComponent, onBeforeMount } from '@vue/composition-api';
|
||||||
import UserSelector from 'src/plugins/user/components/UserSelector.vue';
|
import UserSelector from 'src/plugins/user/components/UserSelector.vue';
|
||||||
import { StateInterfaceBalance, UserBalance } from '../store/balance';
|
import { StateInterfaceBalance } from '../store/balance';
|
||||||
import { Store } from 'vuex';
|
import { Store } from 'vuex';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
showSelector: boolean;
|
showSelector: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
@ -28,14 +28,19 @@ export default defineComponent({
|
||||||
onBeforeMount(() => void store.dispatch('balance/getBalance'));
|
onBeforeMount(() => void store.dispatch('balance/getBalance'));
|
||||||
const store = <Store<StateInterfaceBalance>>root.$store;
|
const store = <Store<StateInterfaceBalance>>root.$store;
|
||||||
const user = ref(<FG.User>store.state.user.currentUser);
|
const user = ref(<FG.User>store.state.user.currentUser);
|
||||||
const balance = computed(() => {const balances = store.state.balance.balances; return balances.get(user.value.userid) || {balance: 0, limit: null} ;});
|
const balance = computed(() => {
|
||||||
|
const balances = store.state.balance.balances;
|
||||||
|
return balances.get(user.value.userid) || { balance: 0, limit: null };
|
||||||
|
});
|
||||||
|
|
||||||
const isLocked = computed(() => balance.value.limit !== null && balance.value.balance >= balance.value.limit);
|
const isLocked = computed(
|
||||||
|
() => balance.value.limit !== null && balance.value.balance >= balance.value.limit
|
||||||
|
);
|
||||||
|
|
||||||
function userUpdated(selectedUser: FG.User) {
|
function userUpdated(selectedUser: FG.User) {
|
||||||
void store.dispatch('balance/getBalance', selectedUser);
|
void store.dispatch('balance/getBalance', selectedUser);
|
||||||
user.value = selectedUser;
|
user.value = selectedUser;
|
||||||
emit('update:user', selectedUser);
|
emit('update:user', selectedUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
return { user, balance, isLocked, userUpdated };
|
return { user, balance, isLocked, userUpdated };
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, defineComponent, onBeforeMount } from '@vue/composition-api';
|
import { computed, defineComponent, onBeforeMount } from '@vue/composition-api';
|
||||||
import { StateInterfaceBalance, UserBalance } from 'src/plugins/balance/store/balance';
|
import { StateInterfaceBalance } from 'src/plugins/balance/store/balance';
|
||||||
import { Store } from 'vuex';
|
import { Store } from 'vuex';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { FG_Plugin } from 'src/plugins';
|
import { FG_Plugin } from 'src/plugins';
|
||||||
import mainRoutes from './routes';
|
import mainRoutes from './routes';
|
||||||
import store from './store/schedule';
|
import store, { ScheduleInterface } from './store/schedule';
|
||||||
import { Module } from 'vuex';
|
import { Module } from 'vuex';
|
||||||
import { StateInterface } from 'src/store';
|
import { StateInterface } from 'src/store';
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ const plugin: FG_Plugin.Plugin = {
|
||||||
requiredModules: ['User'],
|
requiredModules: ['User'],
|
||||||
requiredBackendModules: ['schedule'],
|
requiredBackendModules: ['schedule'],
|
||||||
version: '0.0.1',
|
version: '0.0.1',
|
||||||
store: new Map<string, Module<any, StateInterface>>([['schedule', store]]),
|
store: new Map<string, Module<ScheduleInterface, StateInterface>>([['schedule', store]]),
|
||||||
widgets: [
|
widgets: [
|
||||||
{
|
{
|
||||||
priority: 0,
|
priority: 0,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Module } from 'vuex';
|
import { Module } from 'vuex';
|
||||||
import userStore from './store/user';
|
import userStore, { UserStateInterface } from './store/user';
|
||||||
import sessionsStore from './store/session';
|
import sessionsStore, { SessionInterface } from './store/session';
|
||||||
import routes from './routes';
|
import routes from './routes';
|
||||||
import { StateInterface } from 'src/store';
|
import { StateInterface } from 'src/store';
|
||||||
import { FG_Plugin } from 'src/plugins';
|
import { FG_Plugin } from 'src/plugins';
|
||||||
|
@ -11,7 +11,10 @@ const plugin: FG_Plugin.Plugin = {
|
||||||
requiredModules: [],
|
requiredModules: [],
|
||||||
requiredBackendModules: ['auth'],
|
requiredBackendModules: ['auth'],
|
||||||
version: '0.0.1',
|
version: '0.0.1',
|
||||||
store: new Map<string, Module<any, StateInterface>>([
|
store: new Map<
|
||||||
|
string,
|
||||||
|
Module<UserStateInterface, StateInterface> | Module<SessionInterface, StateInterface>
|
||||||
|
>([
|
||||||
['user', userStore],
|
['user', userStore],
|
||||||
['session', sessionsStore]
|
['session', sessionsStore]
|
||||||
]),
|
]),
|
||||||
|
|
Loading…
Reference in New Issue