Move group link to memberships
This commit is contained in:
parent
4cc47e64b2
commit
6972091ad0
|
@ -55,6 +55,7 @@ class ActivityResource extends JsonResource
|
||||||
'links' => [
|
'links' => [
|
||||||
'index' => route('activity.index'),
|
'index' => route('activity.index'),
|
||||||
'create' => route('activity.create'),
|
'create' => route('activity.create'),
|
||||||
|
'membership_masslist' => route('membership.masslist.index'),
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Group\Actions;
|
namespace App\Membership\Actions;
|
||||||
|
|
||||||
use App\Activity;
|
use App\Activity;
|
||||||
use App\Group;
|
use App\Group;
|
||||||
|
@ -8,14 +8,14 @@ use Inertia\Inertia;
|
||||||
use Inertia\Response;
|
use Inertia\Response;
|
||||||
use Lorisleiva\Actions\Concerns\AsAction;
|
use Lorisleiva\Actions\Concerns\AsAction;
|
||||||
|
|
||||||
class ListAction
|
class MassListAction
|
||||||
{
|
{
|
||||||
use AsAction;
|
use AsAction;
|
||||||
|
|
||||||
public function asController(): Response
|
public function asController(): Response
|
||||||
{
|
{
|
||||||
session()->put('menu', 'group');
|
session()->put('menu', 'activity');
|
||||||
session()->put('title', 'Gruppen');
|
session()->put('title', 'Mitgliedschaften zuweisen');
|
||||||
$activities = Activity::with('subactivities')->get();
|
$activities = Activity::with('subactivities')->get();
|
||||||
|
|
||||||
return Inertia::render('group/Index', [
|
return Inertia::render('group/Index', [
|
|
@ -14,7 +14,7 @@ use Illuminate\Support\Facades\DB;
|
||||||
use Lorisleiva\Actions\ActionRequest;
|
use Lorisleiva\Actions\ActionRequest;
|
||||||
use Lorisleiva\Actions\Concerns\AsAction;
|
use Lorisleiva\Actions\Concerns\AsAction;
|
||||||
|
|
||||||
class StoreForGroupAction
|
class MassStoreAction
|
||||||
{
|
{
|
||||||
use AsAction;
|
use AsAction;
|
||||||
use TracksJob;
|
use TracksJob;
|
|
@ -2,11 +2,13 @@
|
||||||
<v-notification class="fixed z-40 right-0 bottom-0 mb-3 mr-3"></v-notification>
|
<v-notification class="fixed z-40 right-0 bottom-0 mb-3 mr-3"></v-notification>
|
||||||
|
|
||||||
<!-- ******************************** Sidebar ******************************** -->
|
<!-- ******************************** Sidebar ******************************** -->
|
||||||
<div class="fixed z-40 bg-gray-800 p-6 w-56 top-0 h-screen border-r border-gray-600 border-solid flex flex-col justify-between transition-all"
|
<div
|
||||||
|
class="fixed z-40 bg-gray-800 p-6 w-56 top-0 h-screen border-r border-gray-600 border-solid flex flex-col justify-between transition-all"
|
||||||
:class="{
|
:class="{
|
||||||
'-left-[14rem]': !menuStore.isShifted,
|
'-left-[14rem]': !menuStore.isShifted,
|
||||||
'left-0': menuStore.isShifted,
|
'left-0': menuStore.isShifted,
|
||||||
}">
|
}"
|
||||||
|
>
|
||||||
<div class="grid gap-2">
|
<div class="grid gap-2">
|
||||||
<v-link href="/" menu="dashboard" icon="loss">Dashboard</v-link>
|
<v-link href="/" menu="dashboard" icon="loss">Dashboard</v-link>
|
||||||
<v-link href="/member" menu="member" icon="user">Mitglieder</v-link>
|
<v-link href="/member" menu="member" icon="user">Mitglieder</v-link>
|
||||||
|
@ -14,7 +16,6 @@
|
||||||
<v-link v-show="hasModule('bill')" href="/invoice" menu="invoice" icon="moneypaper">Rechnungen</v-link>
|
<v-link v-show="hasModule('bill')" href="/invoice" menu="invoice" icon="moneypaper">Rechnungen</v-link>
|
||||||
<v-link href="/contribution" menu="contribution" icon="contribution">Zuschüsse</v-link>
|
<v-link href="/contribution" menu="contribution" icon="contribution">Zuschüsse</v-link>
|
||||||
<v-link href="/activity" menu="activity" icon="activity">Tätigkeiten</v-link>
|
<v-link href="/activity" menu="activity" icon="activity">Tätigkeiten</v-link>
|
||||||
<v-link href="/group" menu="group" icon="group">Gruppen</v-link>
|
|
||||||
<v-link href="/maildispatcher" menu="maildispatcher" icon="at">Mail-Verteiler</v-link>
|
<v-link href="/maildispatcher" menu="maildispatcher" icon="at">Mail-Verteiler</v-link>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid gap-2">
|
<div class="grid gap-2">
|
||||||
|
@ -31,7 +32,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import VLink from './_VLink.vue';
|
import VLink from './_VLink.vue';
|
||||||
import { menuStore } from '../stores/menuStore.js';
|
import {menuStore} from '../stores/menuStore.js';
|
||||||
import VNotification from '../components/VNotification.vue';
|
import VNotification from '../components/VNotification.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<page-layout page-class="pb-6">
|
<page-layout page-class="pb-6">
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<page-toolbar-button :href="meta.links.create" color="primary" icon="plus">Tätigkeit
|
<page-toolbar-button :href="meta.links.create" color="primary" icon="plus">Tätigkeit erstellen</page-toolbar-button>
|
||||||
erstellen</page-toolbar-button>
|
<page-toolbar-button :href="meta.links.membership_masslist" color="primary" icon="pencil">Mitgliedschaften zuweisen</page-toolbar-button>
|
||||||
</template>
|
</template>
|
||||||
<ui-popup v-if="deleting !== null" heading="Bitte bestätigen" @close="deleting = null">
|
<ui-popup v-if="deleting !== null" heading="Bitte bestätigen" @close="deleting = null">
|
||||||
<div>
|
<div>
|
||||||
|
@ -23,10 +23,8 @@
|
||||||
<td v-text="activity.name"></td>
|
<td v-text="activity.name"></td>
|
||||||
<td>
|
<td>
|
||||||
<div class="flex space-x-1">
|
<div class="flex space-x-1">
|
||||||
<i-link v-tooltip="`Bearbeiten`" :href="activity.links.edit"
|
<i-link v-tooltip="`Bearbeiten`" :href="activity.links.edit" class="inline-flex btn btn-warning btn-sm"><ui-sprite src="pencil"></ui-sprite></i-link>
|
||||||
class="inline-flex btn btn-warning btn-sm"><ui-sprite src="pencil"></ui-sprite></i-link>
|
<a v-tooltip="`Entfernen`" href="#" class="inline-flex btn btn-danger btn-sm" @click.prevent="deleting = activity"><ui-sprite src="trash"></ui-sprite></a>
|
||||||
<a v-tooltip="`Entfernen`" href="#" class="inline-flex btn btn-danger btn-sm"
|
|
||||||
@click.prevent="deleting = activity"><ui-sprite src="trash"></ui-sprite></a>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -39,11 +37,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, defineProps } from 'vue';
|
import {ref, defineProps} from 'vue';
|
||||||
import { indexProps, useIndex } from '../../composables/useIndex.js';
|
import {indexProps, useIndex} from '../../composables/useIndex.js';
|
||||||
|
|
||||||
const props = defineProps(indexProps);
|
const props = defineProps(indexProps);
|
||||||
const { router, data, meta } = useIndex(props.data, 'activity');
|
const {router, data, meta} = useIndex(props.data, 'activity');
|
||||||
const deleting = ref(null);
|
const deleting = ref(null);
|
||||||
|
|
||||||
function remove() {
|
function remove() {
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<script lang="js" setup>
|
<script lang="js" setup>
|
||||||
import { onBeforeUnmount, ref, defineProps, reactive, inject } from 'vue';
|
import { onBeforeUnmount, ref, defineProps, reactive, inject } from 'vue';
|
||||||
import useQueueEvents from '../../composables/useQueueEvents.js';
|
import useQueueEvents from '../../composables/useQueueEvents.js';
|
||||||
const {startListener, stopListener} = useQueueEvents('group', () => null);
|
const { startListener, stopListener } = useQueueEvents('group', () => null);
|
||||||
const axios = inject('axios');
|
const axios = inject('axios');
|
||||||
|
|
||||||
startListener();
|
startListener();
|
||||||
|
@ -86,7 +86,7 @@ async function setActivityId(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function submit() {
|
async function submit() {
|
||||||
await axios.post('/api/membership/sync', {
|
await axios.post('/api/membership/masslist', {
|
||||||
...meta,
|
...meta,
|
||||||
members: selected.value,
|
members: selected.value,
|
||||||
});
|
});
|
||||||
|
|
|
@ -22,6 +22,7 @@ class IndexTest extends TestCase
|
||||||
$this->assertInertiaHas('Local', $response, 'data.data.0.name');
|
$this->assertInertiaHas('Local', $response, 'data.data.0.name');
|
||||||
$this->assertInertiaHas(route('activity.update', ['activity' => $first]), $response, 'data.data.0.links.update');
|
$this->assertInertiaHas(route('activity.update', ['activity' => $first]), $response, 'data.data.0.links.update');
|
||||||
$this->assertInertiaHas(route('activity.destroy', ['activity' => $first]), $response, 'data.data.0.links.destroy');
|
$this->assertInertiaHas(route('activity.destroy', ['activity' => $first]), $response, 'data.data.0.links.destroy');
|
||||||
|
$this->assertInertiaHas(route('membership.masslist.index'), $response, 'data.meta.links.membership_masslist');
|
||||||
$this->assertCount(2, $this->inertia($response, 'data.data'));
|
$this->assertCount(2, $this->inertia($response, 'data.data'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue