Move group link to memberships

This commit is contained in:
philipp lang 2023-12-30 01:19:02 +01:00
parent 4cc47e64b2
commit 6972091ad0
7 changed files with 21 additions and 20 deletions

View File

@ -55,6 +55,7 @@ class ActivityResource extends JsonResource
'links' => [
'index' => route('activity.index'),
'create' => route('activity.create'),
'membership_masslist' => route('membership.masslist.index'),
],
];
}

View File

@ -1,6 +1,6 @@
<?php
namespace App\Group\Actions;
namespace App\Membership\Actions;
use App\Activity;
use App\Group;
@ -8,14 +8,14 @@ use Inertia\Inertia;
use Inertia\Response;
use Lorisleiva\Actions\Concerns\AsAction;
class ListAction
class MassListAction
{
use AsAction;
public function asController(): Response
{
session()->put('menu', 'group');
session()->put('title', 'Gruppen');
session()->put('menu', 'activity');
session()->put('title', 'Mitgliedschaften zuweisen');
$activities = Activity::with('subactivities')->get();
return Inertia::render('group/Index', [

View File

@ -14,7 +14,7 @@ use Illuminate\Support\Facades\DB;
use Lorisleiva\Actions\ActionRequest;
use Lorisleiva\Actions\Concerns\AsAction;
class StoreForGroupAction
class MassStoreAction
{
use AsAction;
use TracksJob;

View File

@ -2,11 +2,13 @@
<v-notification class="fixed z-40 right-0 bottom-0 mb-3 mr-3"></v-notification>
<!-- ******************************** 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="{
'-left-[14rem]': !menuStore.isShifted,
'left-0': menuStore.isShifted,
}">
}"
>
<div class="grid gap-2">
<v-link href="/" menu="dashboard" icon="loss">Dashboard</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 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="/group" menu="group" icon="group">Gruppen</v-link>
<v-link href="/maildispatcher" menu="maildispatcher" icon="at">Mail-Verteiler</v-link>
</div>
<div class="grid gap-2">
@ -31,7 +32,7 @@
<script>
import VLink from './_VLink.vue';
import { menuStore } from '../stores/menuStore.js';
import {menuStore} from '../stores/menuStore.js';
import VNotification from '../components/VNotification.vue';
export default {

View File

@ -1,8 +1,8 @@
<template>
<page-layout page-class="pb-6">
<template #toolbar>
<page-toolbar-button :href="meta.links.create" color="primary" icon="plus">Tätigkeit
erstellen</page-toolbar-button>
<page-toolbar-button :href="meta.links.create" color="primary" icon="plus">Tätigkeit erstellen</page-toolbar-button>
<page-toolbar-button :href="meta.links.membership_masslist" color="primary" icon="pencil">Mitgliedschaften zuweisen</page-toolbar-button>
</template>
<ui-popup v-if="deleting !== null" heading="Bitte bestätigen" @close="deleting = null">
<div>
@ -23,10 +23,8 @@
<td v-text="activity.name"></td>
<td>
<div class="flex space-x-1">
<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>
<a v-tooltip="`Entfernen`" href="#" class="inline-flex btn btn-danger btn-sm"
@click.prevent="deleting = activity"><ui-sprite src="trash"></ui-sprite></a>
<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>
<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>
</td>
</tr>
@ -39,11 +37,11 @@
</template>
<script setup>
import { ref, defineProps } from 'vue';
import { indexProps, useIndex } from '../../composables/useIndex.js';
import {ref, defineProps} from 'vue';
import {indexProps, useIndex} from '../../composables/useIndex.js';
const props = defineProps(indexProps);
const { router, data, meta } = useIndex(props.data, 'activity');
const {router, data, meta} = useIndex(props.data, 'activity');
const deleting = ref(null);
function remove() {

View File

@ -29,7 +29,7 @@
<script lang="js" setup>
import { onBeforeUnmount, ref, defineProps, reactive, inject } from 'vue';
import useQueueEvents from '../../composables/useQueueEvents.js';
const {startListener, stopListener} = useQueueEvents('group', () => null);
const { startListener, stopListener } = useQueueEvents('group', () => null);
const axios = inject('axios');
startListener();
@ -86,7 +86,7 @@ async function setActivityId(id) {
}
async function submit() {
await axios.post('/api/membership/sync', {
await axios.post('/api/membership/masslist', {
...meta,
members: selected.value,
});

View File

@ -22,6 +22,7 @@ class IndexTest extends TestCase
$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.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'));
}