Fixed some TS warnings

This commit is contained in:
Ferdinand Thiessen 2021-01-26 16:37:45 +01:00
parent 270df75fc8
commit 887262ae5a
5 changed files with 23 additions and 19 deletions

View File

@ -1,10 +1,8 @@
<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-toolbar class="bg-primary text-white">
<q-toolbar-title>
Passwort vergessen
</q-toolbar-title>
<q-toolbar-title> Passwort vergessen </q-toolbar-title>
</q-toolbar>
<q-card-section>
@ -43,8 +41,6 @@ import { AxiosResponse } from 'axios';
export default defineComponent({
// name: 'PageName'
setup(_, { root }) {
const mainRoute = { name: 'dashboard' };
const password = ref('');
const password2 = ref('');

View File

@ -13,11 +13,11 @@
<script lang="ts">
import { ref, computed, defineComponent, onBeforeMount } from '@vue/composition-api';
import UserSelector from 'src/plugins/user/components/UserSelector.vue';
import { StateInterfaceBalance, UserBalance } from '../store/balance';
import { StateInterfaceBalance } from '../store/balance';
import { Store } from 'vuex';
interface Props {
showSelector: boolean;
showSelector: boolean;
}
export default defineComponent({
@ -28,14 +28,19 @@ export default defineComponent({
onBeforeMount(() => void store.dispatch('balance/getBalance'));
const store = <Store<StateInterfaceBalance>>root.$store;
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) {
void store.dispatch('balance/getBalance', selectedUser);
user.value = selectedUser;
emit('update:user', selectedUser);
void store.dispatch('balance/getBalance', selectedUser);
user.value = selectedUser;
emit('update:user', selectedUser);
}
return { user, balance, isLocked, userUpdated };

View File

@ -8,7 +8,7 @@
<script lang="ts">
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';
export default defineComponent({

View File

@ -1,6 +1,6 @@
import { FG_Plugin } from 'src/plugins';
import mainRoutes from './routes';
import store from './store/schedule';
import store, { ScheduleInterface } from './store/schedule';
import { Module } from 'vuex';
import { StateInterface } from 'src/store';
@ -10,7 +10,7 @@ const plugin: FG_Plugin.Plugin = {
requiredModules: ['User'],
requiredBackendModules: ['schedule'],
version: '0.0.1',
store: new Map<string, Module<any, StateInterface>>([['schedule', store]]),
store: new Map<string, Module<ScheduleInterface, StateInterface>>([['schedule', store]]),
widgets: [
{
priority: 0,

View File

@ -1,6 +1,6 @@
import { Module } from 'vuex';
import userStore from './store/user';
import sessionsStore from './store/session';
import userStore, { UserStateInterface } from './store/user';
import sessionsStore, { SessionInterface } from './store/session';
import routes from './routes';
import { StateInterface } from 'src/store';
import { FG_Plugin } from 'src/plugins';
@ -11,7 +11,10 @@ const plugin: FG_Plugin.Plugin = {
requiredModules: [],
requiredBackendModules: ['auth'],
version: '0.0.1',
store: new Map<string, Module<any, StateInterface>>([
store: new Map<
string,
Module<UserStateInterface, StateInterface> | Module<SessionInterface, StateInterface>
>([
['user', userStore],
['session', sessionsStore]
]),