release v2.0.0 #4
|
@ -39,7 +39,10 @@ declare namespace FG {
|
|||
type: EventType;
|
||||
jobs: Array<Job>;
|
||||
}
|
||||
type EventType = string;
|
||||
interface EventType {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
interface Job {
|
||||
id: number;
|
||||
start: Date;
|
||||
|
|
|
@ -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('');
|
||||
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -115,7 +115,7 @@ export default defineComponent({
|
|||
const eventname = ref('');
|
||||
const eventdescription = ref('');
|
||||
const eventdate = ref<Date>();
|
||||
const eventtype = ref<FG.EventType | null>('');
|
||||
// const eventtype = ref<FG.EventType | null>('');
|
||||
const eventtypes = computed(() => state.eventTypes);
|
||||
const jobtypes = computed(() => state.jobTypes);
|
||||
let jobnum = 1;
|
||||
|
@ -142,7 +142,7 @@ export default defineComponent({
|
|||
id: NaN,
|
||||
start: new Date(),
|
||||
description: '',
|
||||
type: '',
|
||||
type: { id: NaN, name: '' },
|
||||
jobs: [newJob]
|
||||
});
|
||||
|
||||
|
@ -166,7 +166,7 @@ export default defineComponent({
|
|||
}
|
||||
}
|
||||
function save() {
|
||||
console.log('Eventtype:', eventtype);
|
||||
// console.log('Eventtype:', eventtype);
|
||||
console.log('Event:', event);
|
||||
store.dispatch('schedule/addEvent', event.value).catch(error => {
|
||||
console.warn(error);
|
||||
|
@ -188,7 +188,6 @@ export default defineComponent({
|
|||
eventname,
|
||||
eventdescription,
|
||||
eventdate,
|
||||
eventtype,
|
||||
jobs,
|
||||
addJob,
|
||||
eventtypes,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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]
|
||||
]),
|
||||
|
|
Loading…
Reference in New Issue