minor: v1.1.0 #45

Merged
jkeffects merged 4 commits from develop into main 2025-01-19 12:56:44 +00:00
4 changed files with 45 additions and 37 deletions

View file

@ -46,18 +46,13 @@
</div> </div>
</div> </div>
<div class="grow max-lg:hidden"></div> <div class="grow max-lg:hidden"></div>
<div class="p-1 border border-gray-400 bg-gray-100 rounded-md" title="Schema-Struktur" @click="showStructure">
<SparklesIcon class="text-gray-500 h-6 w-6 cursor-pointer" />
</div>
<div class="flex flex-row min-w-fit overflow-hidden border border-gray-400 rounded-md"> <div class="flex flex-row min-w-fit overflow-hidden border border-gray-400 rounded-md">
<div <div
class="p-1" class="p-1"
:class="queryMode == 'structure' ? 'bg-gray-200' : ''" :class="typeof value == 'object' ? 'bg-gray-200' : ''"
title="Schema-Struktur"
@click="queryMode = 'structure'"
>
<SparklesIcon class="text-gray-500 h-6 w-6 cursor-pointer" />
</div>
<div
class="p-1"
:class="typeof value == 'object' && queryMode != 'structure' ? 'bg-gray-200' : ''"
title="Visual Builder" title="Visual Builder"
@click="queryMode = 'builder'" @click="queryMode = 'builder'"
> >
@ -65,7 +60,7 @@
</div> </div>
<div <div
class="p-1" class="p-1"
:class="typeof value == 'string' && queryMode != 'structure' ? 'bg-gray-200' : ''" :class="typeof value == 'string' ? 'bg-gray-200' : ''"
title="SQL Editor" title="SQL Editor"
@click="queryMode = 'editor'" @click="queryMode = 'editor'"
> >
@ -74,10 +69,7 @@
</div> </div>
</div> </div>
<div class="p-2 h-44 md:h-60 w-full overflow-y-auto"> <div class="p-2 h-44 md:h-60 w-full overflow-y-auto">
<div v-if="queryMode == 'structure'"> <textarea v-if="typeof value == 'string'" v-model="value" placeholder="SQL Query" class="h-full w-full" />
<img src="/administration-db.png" class="h-full w-full cursor-pointer" @click="showStructure" />
</div>
<textarea v-else-if="typeof value == 'string'" v-model="value" placeholder="SQL Query" class="h-full w-full" />
<Table v-else v-model="value" /> <Table v-else v-model="value" />
</div> </div>
</div> </div>
@ -153,7 +145,7 @@ export default defineComponent({
data() { data() {
return { return {
autoChangeFlag: false as boolean, autoChangeFlag: false as boolean,
queryMode: "builder" as "builder" | "editor" | "structure", queryMode: "builder" as "builder" | "editor",
}; };
}, },
computed: { computed: {

View file

@ -11,7 +11,10 @@
<div class="flex flex-row justify-end"> <div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2"> <div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal">schnließen</button> <a href="/administration-db.png" button primary-outline download="Datenbank-Schema" class="!whitespace-nowrap"
>Bild herunterladen</a
>
<button primary-outline @click="closeModal">schließen</button>
</div> </div>
</div> </div>
</div> </div>

View file

@ -1,6 +1,7 @@
export interface ProtocolPresenceViewModel { export interface ProtocolPresenceViewModel {
memberId: number; memberId: number;
absent: boolean; absent: boolean;
excused: boolean;
protocolId: number; protocolId: number;
} }

View file

@ -46,7 +46,8 @@
}" }"
> >
<span class="block truncate" :class="{ 'font-medium': selected, 'font-normal': !selected }"> <span class="block truncate" :class="{ 'font-medium': selected, 'font-normal': !selected }">
{{ getMember(member.memberId)?.firstname }} {{ getMember(member.memberId)?.lastname }} {{ getMember(member.memberId)?.nameaffix }} {{ getMember(member.memberId)?.firstname }} {{ getMember(member.memberId)?.lastname }}
{{ getMember(member.memberId)?.nameaffix }}
</span> </span>
<span <span
v-if="selected" v-if="selected"
@ -71,12 +72,21 @@
class="flex flex-row h-fit w-full border border-primary rounded-md bg-primary p-2 text-white justify-between items-center" class="flex flex-row h-fit w-full border border-primary rounded-md bg-primary p-2 text-white justify-between items-center"
> >
<div class="flex flex-col items-start"> <div class="flex flex-col items-start">
<p>{{ getMember(member.memberId)?.lastname }}, {{ getMember(member.memberId)?.firstname }} {{ getMember(member.memberId)?.nameaffix ? `- ${getMember(member.memberId)?.nameaffix}` : "" }}</p> <p>
<label class="flex flex-row gap-2 items-center"> {{ getMember(member.memberId)?.lastname }}, {{ getMember(member.memberId)?.firstname }}
<input type="checkbox" v-model="member.absent" /> {{ getMember(member.memberId)?.nameaffix ? `- ${getMember(member.memberId)?.nameaffix}` : "" }}
war abwesend </p>
</label> <div class="flex flex-row gap-4">
</div> <label class="flex flex-row gap-2 items-center">
<input type="checkbox" v-model="member.absent" />
war abwesend
</label>
<label v-if="member.absent" class="flex flex-row gap-2 items-center">
<input type="checkbox" v-model="member.excused" />
ist entschuldigt
</label>
</div>
</div>
<TrashIcon <TrashIcon
v-if="can('create', 'club', 'protocol')" v-if="can('create', 'club', 'protocol')"
class="w-5 h-5 p-1 box-content cursor-pointer" class="w-5 h-5 p-1 box-content cursor-pointer"
@ -123,21 +133,23 @@ export default defineComponent({
...mapWritableState(useProtocolPresenceStore, ["presence", "loading"]), ...mapWritableState(useProtocolPresenceStore, ["presence", "loading"]),
...mapState(useMemberStore, ["members"]), ...mapState(useMemberStore, ["members"]),
...mapState(useAbilityStore, ["can"]), ...mapState(useAbilityStore, ["can"]),
filtered(): Array<{memberId:number, absent:boolean; protocolId:number}> { filtered(): Array<{ memberId: number; absent: boolean; excused: boolean; protocolId: number }> {
return (this.query === "" return (
? this.members this.query === ""
: this.members.filter((member) => ? this.members
(member.firstname + " " + member.lastname) : this.members.filter((member) =>
.toLowerCase() (member.firstname + " " + member.lastname)
.replace(/\s+/g, "") .toLowerCase()
.includes(this.query.toLowerCase().replace(/\s+/g, "")) .replace(/\s+/g, "")
)).map(m =>({memberId: m.id, absent:false, protocolId:parseInt(this.protocolId ?? "")})); .includes(this.query.toLowerCase().replace(/\s+/g, ""))
)
).map((m) => ({ memberId: m.id, absent: false, excused: true, protocolId: parseInt(this.protocolId ?? "") }));
},
getMember() {
return (memberId: number) => {
return this.members.find((m) => memberId == m.id);
};
}, },
getMember(){
return (memberId:number) => {
return this.members.find(m => memberId == m.id)
}
}
}, },
mounted() { mounted() {
this.fetchMembers(0, 1000, "", true); this.fetchMembers(0, 1000, "", true);