Merge pull request 'patches v1.2.1' (#54) from develop into main
Reviewed-on: #54
This commit is contained in:
commit
725093c433
22 changed files with 640 additions and 123 deletions
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"id": "0",
|
"id": "0",
|
||||||
"name": "administration-db",
|
"name": "administration-db",
|
||||||
"createdAt": "2025-01-12T13:30:56.612Z",
|
"createdAt": "2025-01-25T11:15:11.340Z",
|
||||||
"updatedAt": "2025-01-12T13:30:56.612Z",
|
"updatedAt": "2025-01-25T11:15:11.340Z",
|
||||||
"databaseType": "mariadb",
|
"databaseType": "mariadb",
|
||||||
"tables": [
|
"tables": [
|
||||||
{
|
{
|
||||||
|
@ -453,8 +453,8 @@
|
||||||
"id": "35",
|
"id": "35",
|
||||||
"name": "membership",
|
"name": "membership",
|
||||||
"schema": "administration",
|
"schema": "administration",
|
||||||
"x": 431.0493261325482,
|
"x": 423.2353392314366,
|
||||||
"y": -194.01007034924007,
|
"y": -235.03350158007595,
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"id": "36",
|
"id": "36",
|
||||||
|
@ -698,8 +698,8 @@
|
||||||
"id": "56",
|
"id": "56",
|
||||||
"name": "membership_status",
|
"name": "membership_status",
|
||||||
"schema": "administration",
|
"schema": "administration",
|
||||||
"x": 712.2717493973673,
|
"x": 704.4577624962558,
|
||||||
"y": -155.53936203938048,
|
"y": -196.5627932702164,
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"id": "57",
|
"id": "57",
|
||||||
|
@ -766,21 +766,6 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "62",
|
"id": "62",
|
||||||
"name": "salutation",
|
|
||||||
"type": {
|
|
||||||
"id": "varchar",
|
|
||||||
"name": "varchar"
|
|
||||||
},
|
|
||||||
"primaryKey": false,
|
|
||||||
"unique": false,
|
|
||||||
"nullable": false,
|
|
||||||
"character_maximum_length": "255",
|
|
||||||
"default": "'none'",
|
|
||||||
"collation": "utf8mb4_general_ci",
|
|
||||||
"createdAt": 1734524896259
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "63",
|
|
||||||
"name": "firstname",
|
"name": "firstname",
|
||||||
"type": {
|
"type": {
|
||||||
"id": "varchar",
|
"id": "varchar",
|
||||||
|
@ -794,7 +779,7 @@
|
||||||
"createdAt": 1734524896259
|
"createdAt": 1734524896259
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "64",
|
"id": "63",
|
||||||
"name": "lastname",
|
"name": "lastname",
|
||||||
"type": {
|
"type": {
|
||||||
"id": "varchar",
|
"id": "varchar",
|
||||||
|
@ -808,7 +793,7 @@
|
||||||
"createdAt": 1734524896259
|
"createdAt": 1734524896259
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "65",
|
"id": "64",
|
||||||
"name": "nameaffix",
|
"name": "nameaffix",
|
||||||
"type": {
|
"type": {
|
||||||
"id": "varchar",
|
"id": "varchar",
|
||||||
|
@ -822,7 +807,7 @@
|
||||||
"createdAt": 1734524896259
|
"createdAt": 1734524896259
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "66",
|
"id": "65",
|
||||||
"name": "birthdate",
|
"name": "birthdate",
|
||||||
"type": {
|
"type": {
|
||||||
"id": "date",
|
"id": "date",
|
||||||
|
@ -834,7 +819,7 @@
|
||||||
"createdAt": 1734524896259
|
"createdAt": 1734524896259
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "67",
|
"id": "66",
|
||||||
"name": "internalId",
|
"name": "internalId",
|
||||||
"type": {
|
"type": {
|
||||||
"name": "varchar",
|
"name": "varchar",
|
||||||
|
@ -845,6 +830,21 @@
|
||||||
"primaryKey": false,
|
"primaryKey": false,
|
||||||
"createdAt": 1736351121650
|
"createdAt": 1736351121650
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "67",
|
||||||
|
"name": "salutationId",
|
||||||
|
"type": {
|
||||||
|
"name": "int",
|
||||||
|
"id": "int"
|
||||||
|
},
|
||||||
|
"primaryKey": false,
|
||||||
|
"unique": false,
|
||||||
|
"nullable": false,
|
||||||
|
"character_maximum_length": "255",
|
||||||
|
"default": "'none'",
|
||||||
|
"collation": "utf8mb4_general_ci",
|
||||||
|
"createdAt": 1734524896259
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "68",
|
"id": "68",
|
||||||
"name": "sendNewsletterId",
|
"name": "sendNewsletterId",
|
||||||
|
@ -889,8 +889,8 @@
|
||||||
"id": "71",
|
"id": "71",
|
||||||
"name": "communication_type",
|
"name": "communication_type",
|
||||||
"schema": "administration",
|
"schema": "administration",
|
||||||
"x": 712.818422135433,
|
"x": 735.756546723297,
|
||||||
"y": 325.42673695158805,
|
"y": 175.00748910518985,
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"id": "72",
|
"id": "72",
|
||||||
|
@ -1231,8 +1231,8 @@
|
||||||
"id": "96",
|
"id": "96",
|
||||||
"name": "communication",
|
"name": "communication",
|
||||||
"schema": "administration",
|
"schema": "administration",
|
||||||
"x": 428.2501516386368,
|
"x": 451.18827622650076,
|
||||||
"y": 181.28410937476986,
|
"y": 30.864861528371677,
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"id": "97",
|
"id": "97",
|
||||||
|
@ -1682,11 +1682,48 @@
|
||||||
"isMaterializedView": false,
|
"isMaterializedView": false,
|
||||||
"createdAt": 1734524896260,
|
"createdAt": 1734524896260,
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "132",
|
||||||
|
"name": "salutation",
|
||||||
|
"x": 428.6069830535669,
|
||||||
|
"y": 516.5938067201159,
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"id": "133",
|
||||||
|
"name": "id",
|
||||||
|
"type": {
|
||||||
|
"name": "int",
|
||||||
|
"id": "int"
|
||||||
|
},
|
||||||
|
"unique": true,
|
||||||
|
"nullable": false,
|
||||||
|
"primaryKey": true,
|
||||||
|
"createdAt": 1737803524494
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "134",
|
||||||
|
"name": "salutation",
|
||||||
|
"type": {
|
||||||
|
"name": "varchar",
|
||||||
|
"id": "varchar"
|
||||||
|
},
|
||||||
|
"unique": false,
|
||||||
|
"nullable": false,
|
||||||
|
"primaryKey": false,
|
||||||
|
"createdAt": 1737803546875
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [],
|
||||||
|
"color": "#4dee8a",
|
||||||
|
"createdAt": 1737803524494,
|
||||||
|
"isView": false,
|
||||||
|
"order": 15
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"relationships": [
|
"relationships": [
|
||||||
{
|
{
|
||||||
"id": "132",
|
"id": "135",
|
||||||
"name": "FK_1fd52c8f109123e5a2c67dc2c83",
|
"name": "FK_1fd52c8f109123e5a2c67dc2c83",
|
||||||
"sourceSchema": "administration",
|
"sourceSchema": "administration",
|
||||||
"targetSchema": "administration",
|
"targetSchema": "administration",
|
||||||
|
@ -1700,7 +1737,7 @@
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "133",
|
"id": "136",
|
||||||
"name": "FK_21994db635b47e07f45b2686a51",
|
"name": "FK_21994db635b47e07f45b2686a51",
|
||||||
"sourceSchema": "administration",
|
"sourceSchema": "administration",
|
||||||
"targetSchema": "administration",
|
"targetSchema": "administration",
|
||||||
|
@ -1714,7 +1751,7 @@
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "134",
|
"id": "137",
|
||||||
"name": "FK_2912b056a5d0b7977360a986164",
|
"name": "FK_2912b056a5d0b7977360a986164",
|
||||||
"sourceSchema": "administration",
|
"sourceSchema": "administration",
|
||||||
"targetSchema": "administration",
|
"targetSchema": "administration",
|
||||||
|
@ -1728,7 +1765,7 @@
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "135",
|
"id": "138",
|
||||||
"name": "FK_3b4b41597707b13086e71727422",
|
"name": "FK_3b4b41597707b13086e71727422",
|
||||||
"sourceSchema": "administration",
|
"sourceSchema": "administration",
|
||||||
"targetSchema": "administration",
|
"targetSchema": "administration",
|
||||||
|
@ -1742,7 +1779,7 @@
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "136",
|
"id": "139",
|
||||||
"name": "FK_98b70e687c35709d2f01b3d7d74",
|
"name": "FK_98b70e687c35709d2f01b3d7d74",
|
||||||
"sourceSchema": "administration",
|
"sourceSchema": "administration",
|
||||||
"targetSchema": "administration",
|
"targetSchema": "administration",
|
||||||
|
@ -1756,7 +1793,7 @@
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "137",
|
"id": "140",
|
||||||
"name": "FK_a47e04bfd3671d8a375d1896d25",
|
"name": "FK_a47e04bfd3671d8a375d1896d25",
|
||||||
"sourceSchema": "administration",
|
"sourceSchema": "administration",
|
||||||
"targetSchema": "administration",
|
"targetSchema": "administration",
|
||||||
|
@ -1770,7 +1807,7 @@
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "138",
|
"id": "141",
|
||||||
"name": "FK_ba47b44c2ddf34c1bcc75df6675",
|
"name": "FK_ba47b44c2ddf34c1bcc75df6675",
|
||||||
"sourceSchema": "administration",
|
"sourceSchema": "administration",
|
||||||
"targetSchema": "administration",
|
"targetSchema": "administration",
|
||||||
|
@ -1784,7 +1821,7 @@
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "139",
|
"id": "142",
|
||||||
"name": "FK_dbebe53df1caa0b6715a220b0ea",
|
"name": "FK_dbebe53df1caa0b6715a220b0ea",
|
||||||
"sourceSchema": "administration",
|
"sourceSchema": "administration",
|
||||||
"targetSchema": "administration",
|
"targetSchema": "administration",
|
||||||
|
@ -1798,7 +1835,7 @@
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "140",
|
"id": "143",
|
||||||
"name": "FK_e9fd4d37c4ac0fb08bd6eeeda3c",
|
"name": "FK_e9fd4d37c4ac0fb08bd6eeeda3c",
|
||||||
"sourceSchema": "administration",
|
"sourceSchema": "administration",
|
||||||
"targetSchema": "administration",
|
"targetSchema": "administration",
|
||||||
|
@ -1812,7 +1849,7 @@
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "141",
|
"id": "144",
|
||||||
"name": "FK_fc5f59e5c9aafdedd25ed8ed36e",
|
"name": "FK_fc5f59e5c9aafdedd25ed8ed36e",
|
||||||
"sourceSchema": "administration",
|
"sourceSchema": "administration",
|
||||||
"targetSchema": "administration",
|
"targetSchema": "administration",
|
||||||
|
@ -1824,11 +1861,24 @@
|
||||||
"targetCardinality": "one",
|
"targetCardinality": "one",
|
||||||
"createdAt": 1734524896262,
|
"createdAt": 1734524896262,
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "145",
|
||||||
|
"name": "member_salutationId_fk",
|
||||||
|
"sourceSchema": "administration",
|
||||||
|
"sourceTableId": "60",
|
||||||
|
"targetSchema": "administration",
|
||||||
|
"targetTableId": "132",
|
||||||
|
"sourceFieldId": "67",
|
||||||
|
"targetFieldId": "133",
|
||||||
|
"sourceCardinality": "many",
|
||||||
|
"targetCardinality": "one",
|
||||||
|
"createdAt": 1737803651894
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
{
|
{
|
||||||
"id": "142",
|
"id": "146",
|
||||||
"schema": "administration",
|
"schema": "administration",
|
||||||
"tableId": "60",
|
"tableId": "60",
|
||||||
"dependentSchema": "administration",
|
"dependentSchema": "administration",
|
||||||
|
@ -1837,7 +1887,7 @@
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "143",
|
"id": "147",
|
||||||
"schema": "administration",
|
"schema": "administration",
|
||||||
"tableId": "127",
|
"tableId": "127",
|
||||||
"dependentSchema": "administration",
|
"dependentSchema": "administration",
|
||||||
|
@ -1846,7 +1896,7 @@
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "144",
|
"id": "148",
|
||||||
"schema": "administration",
|
"schema": "administration",
|
||||||
"tableId": "112",
|
"tableId": "112",
|
||||||
"dependentSchema": "administration",
|
"dependentSchema": "administration",
|
||||||
|
@ -1854,55 +1904,19 @@
|
||||||
"createdAt": 1734524897267,
|
"createdAt": 1734524897267,
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "145",
|
|
||||||
"schema": "administration",
|
|
||||||
"tableId": "60",
|
|
||||||
"dependentSchema": "administration",
|
|
||||||
"dependentTableId": "11",
|
|
||||||
"createdAt": 1734524897283,
|
|
||||||
"diagramId": "7gb18czobyir"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "146",
|
|
||||||
"schema": "administration",
|
|
||||||
"tableId": "1",
|
|
||||||
"dependentSchema": "administration",
|
|
||||||
"dependentTableId": "11",
|
|
||||||
"createdAt": 1734524897283,
|
|
||||||
"diagramId": "7gb18czobyir"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "147",
|
|
||||||
"schema": "administration",
|
|
||||||
"tableId": "60",
|
|
||||||
"dependentSchema": "administration",
|
|
||||||
"dependentTableId": "21",
|
|
||||||
"createdAt": 1734524897244,
|
|
||||||
"diagramId": "7gb18czobyir"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "148",
|
|
||||||
"schema": "administration",
|
|
||||||
"tableId": "56",
|
|
||||||
"dependentSchema": "administration",
|
|
||||||
"dependentTableId": "76",
|
|
||||||
"createdAt": 1734524897297,
|
|
||||||
"diagramId": "7gb18czobyir"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "149",
|
"id": "149",
|
||||||
"schema": "administration",
|
"schema": "administration",
|
||||||
"tableId": "35",
|
"tableId": "60",
|
||||||
"dependentSchema": "administration",
|
"dependentSchema": "administration",
|
||||||
"dependentTableId": "76",
|
"dependentTableId": "11",
|
||||||
"createdAt": 1734524897297,
|
"createdAt": 1734524897283,
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "150",
|
"id": "150",
|
||||||
"schema": "administration",
|
"schema": "administration",
|
||||||
"tableId": "123",
|
"tableId": "1",
|
||||||
"dependentSchema": "administration",
|
"dependentSchema": "administration",
|
||||||
"dependentTableId": "11",
|
"dependentTableId": "11",
|
||||||
"createdAt": 1734524897283,
|
"createdAt": 1734524897283,
|
||||||
|
@ -1913,6 +1927,42 @@
|
||||||
"schema": "administration",
|
"schema": "administration",
|
||||||
"tableId": "60",
|
"tableId": "60",
|
||||||
"dependentSchema": "administration",
|
"dependentSchema": "administration",
|
||||||
|
"dependentTableId": "21",
|
||||||
|
"createdAt": 1734524897244,
|
||||||
|
"diagramId": "7gb18czobyir"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "152",
|
||||||
|
"schema": "administration",
|
||||||
|
"tableId": "56",
|
||||||
|
"dependentSchema": "administration",
|
||||||
|
"dependentTableId": "76",
|
||||||
|
"createdAt": 1734524897297,
|
||||||
|
"diagramId": "7gb18czobyir"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "153",
|
||||||
|
"schema": "administration",
|
||||||
|
"tableId": "35",
|
||||||
|
"dependentSchema": "administration",
|
||||||
|
"dependentTableId": "76",
|
||||||
|
"createdAt": 1734524897297,
|
||||||
|
"diagramId": "7gb18czobyir"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "154",
|
||||||
|
"schema": "administration",
|
||||||
|
"tableId": "123",
|
||||||
|
"dependentSchema": "administration",
|
||||||
|
"dependentTableId": "11",
|
||||||
|
"createdAt": 1734524897283,
|
||||||
|
"diagramId": "7gb18czobyir"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "155",
|
||||||
|
"schema": "administration",
|
||||||
|
"tableId": "60",
|
||||||
|
"dependentSchema": "administration",
|
||||||
"dependentTableId": "86",
|
"dependentTableId": "86",
|
||||||
"createdAt": 1734524897266,
|
"createdAt": 1734524897266,
|
||||||
"diagramId": "7gb18czobyir"
|
"diagramId": "7gb18czobyir"
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 650 KiB After Width: | Height: | Size: 478 KiB |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 11 MiB After Width: | Height: | Size: 12 MiB |
|
@ -6,13 +6,13 @@
|
||||||
<br />
|
<br />
|
||||||
<form class="flex flex-col gap-4 py-2" @submit.prevent="triggerCreate">
|
<form class="flex flex-col gap-4 py-2" @submit.prevent="triggerCreate">
|
||||||
<div>
|
<div>
|
||||||
<Listbox v-model="selectedSalutation" name="salutation">
|
<Listbox v-model="selectedSalutation" name="salutation" by="id">
|
||||||
<ListboxLabel>Anrede</ListboxLabel>
|
<ListboxLabel>Anrede</ListboxLabel>
|
||||||
<div class="relative mt-1">
|
<div class="relative mt-1">
|
||||||
<ListboxButton
|
<ListboxButton
|
||||||
class="rounded-md shadow-sm relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-0 focus:z-10 sm:text-sm resize-none"
|
class="rounded-md shadow-sm relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-0 focus:z-10 sm:text-sm resize-none"
|
||||||
>
|
>
|
||||||
<span class="block truncate w-full text-start"> {{ selectedSalutation }}</span>
|
<span class="block truncate w-full text-start"> {{ selectedSalutation?.salutation }}</span>
|
||||||
<span class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
|
<span class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
|
||||||
<ChevronUpDownIcon class="h-5 w-5 text-gray-400" aria-hidden="true" />
|
<ChevronUpDownIcon class="h-5 w-5 text-gray-400" aria-hidden="true" />
|
||||||
</span>
|
</span>
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
<ListboxOption
|
<ListboxOption
|
||||||
v-slot="{ active, selected }"
|
v-slot="{ active, selected }"
|
||||||
v-for="salutation in salutations"
|
v-for="salutation in salutations"
|
||||||
:key="salutation"
|
:key="salutation.id"
|
||||||
:value="salutation"
|
:value="salutation"
|
||||||
as="template"
|
as="template"
|
||||||
>
|
>
|
||||||
|
@ -39,7 +39,9 @@
|
||||||
'relative cursor-default select-none py-2 pl-10 pr-4',
|
'relative cursor-default select-none py-2 pl-10 pr-4',
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<span :class="[selected ? 'font-medium' : 'font-normal', 'block truncate']">{{ salutation }}</span>
|
<span :class="[selected ? 'font-medium' : 'font-normal', 'block truncate']">{{
|
||||||
|
salutation.salutation
|
||||||
|
}}</span>
|
||||||
<span v-if="selected" class="absolute inset-y-0 left-0 flex items-center pl-3 text-primary">
|
<span v-if="selected" class="absolute inset-y-0 left-0 flex items-center pl-3 text-primary">
|
||||||
<CheckIcon class="h-5 w-5" aria-hidden="true" />
|
<CheckIcon class="h-5 w-5" aria-hidden="true" />
|
||||||
</span>
|
</span>
|
||||||
|
@ -97,9 +99,10 @@ import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||||
import FailureXMark from "@/components/FailureXMark.vue";
|
import FailureXMark from "@/components/FailureXMark.vue";
|
||||||
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
|
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
|
||||||
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
|
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
|
||||||
import { Salutation } from "@/enums/salutation";
|
|
||||||
import { useMemberStore } from "@/stores/admin/club/member/member";
|
import { useMemberStore } from "@/stores/admin/club/member/member";
|
||||||
import type { CreateMemberViewModel } from "@/viewmodels/admin/club/member/member.models";
|
import type { CreateMemberViewModel } from "@/viewmodels/admin/club/member/member.models";
|
||||||
|
import { useSalutationStore } from "../../../../stores/admin/settings/salutation";
|
||||||
|
import type { SalutationViewModel } from "../../../../viewmodels/admin/settings/salutation.models";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
@ -108,12 +111,14 @@ export default defineComponent({
|
||||||
return {
|
return {
|
||||||
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
|
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
|
||||||
timeout: undefined as any,
|
timeout: undefined as any,
|
||||||
salutations: [] as Array<string>,
|
selectedSalutation: null as null | SalutationViewModel,
|
||||||
selectedSalutation: Salutation.none as Salutation,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(useSalutationStore, ["salutations"]),
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.salutations = Object.values(Salutation);
|
this.fetchSalutations();
|
||||||
},
|
},
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
try {
|
try {
|
||||||
|
@ -123,10 +128,12 @@ export default defineComponent({
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useModalStore, ["closeModal"]),
|
...mapActions(useModalStore, ["closeModal"]),
|
||||||
...mapActions(useMemberStore, ["createMember"]),
|
...mapActions(useMemberStore, ["createMember"]),
|
||||||
|
...mapActions(useSalutationStore, ["fetchSalutations"]),
|
||||||
triggerCreate(e: any) {
|
triggerCreate(e: any) {
|
||||||
|
if (!this.selectedSalutation) return;
|
||||||
let formData = e.target.elements;
|
let formData = e.target.elements;
|
||||||
let createMember: CreateMemberViewModel = {
|
let createMember: CreateMemberViewModel = {
|
||||||
salutation: this.selectedSalutation,
|
salutationId: this.selectedSalutation.id,
|
||||||
firstname: formData.firstname.value,
|
firstname: formData.firstname.value,
|
||||||
lastname: formData.lastname.value,
|
lastname: formData.lastname.value,
|
||||||
nameaffix: formData.nameaffix.value,
|
nameaffix: formData.nameaffix.value,
|
||||||
|
|
|
@ -41,9 +41,6 @@ import { useModalStore } from "@/stores/modal";
|
||||||
import Spinner from "@/components/Spinner.vue";
|
import Spinner from "@/components/Spinner.vue";
|
||||||
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||||
import FailureXMark from "@/components/FailureXMark.vue";
|
import FailureXMark from "@/components/FailureXMark.vue";
|
||||||
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
|
|
||||||
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
|
|
||||||
import { Salutation } from "@/enums/salutation";
|
|
||||||
import { useMemberStore } from "@/stores/admin/club/member/member";
|
import { useMemberStore } from "@/stores/admin/club/member/member";
|
||||||
import type { CreateMemberViewModel } from "@/viewmodels/admin/club/member/member.models";
|
import type { CreateMemberViewModel } from "@/viewmodels/admin/club/member/member.models";
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
<template>
|
||||||
|
<div class="w-full md:max-w-md">
|
||||||
|
<div class="flex flex-col items-center">
|
||||||
|
<p class="text-xl font-medium">Anrede erstellen</p>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<form class="flex flex-col gap-4 py-2" @submit.prevent="triggerCreate">
|
||||||
|
<div>
|
||||||
|
<label for="salutation">Anrede</label>
|
||||||
|
<input type="text" id="salutation" required />
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-row gap-2">
|
||||||
|
<button primary type="submit" :disabled="status == 'loading' || status?.status == 'success'">erstellen</button>
|
||||||
|
<Spinner v-if="status == 'loading'" class="my-auto" />
|
||||||
|
<SuccessCheckmark v-else-if="status?.status == 'success'" />
|
||||||
|
<FailureXMark v-else-if="status?.status == 'failed'" />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="flex flex-row justify-end">
|
||||||
|
<div class="flex flex-row gap-4 py-2">
|
||||||
|
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
|
||||||
|
abbrechen
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { defineComponent } from "vue";
|
||||||
|
import { mapState, mapActions } from "pinia";
|
||||||
|
import { useModalStore } from "@/stores/modal";
|
||||||
|
import Spinner from "@/components/Spinner.vue";
|
||||||
|
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||||
|
import FailureXMark from "@/components/FailureXMark.vue";
|
||||||
|
import { useSalutationStore } from "@/stores/admin/settings/salutation";
|
||||||
|
import type { CreateSalutationViewModel } from "@/viewmodels/admin/settings/salutation.models";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default defineComponent({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
|
||||||
|
timeout: undefined as any,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
try {
|
||||||
|
clearTimeout(this.timeout);
|
||||||
|
} catch (error) {}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions(useModalStore, ["closeModal"]),
|
||||||
|
...mapActions(useSalutationStore, ["createSalutation"]),
|
||||||
|
triggerCreate(e: any) {
|
||||||
|
let formData = e.target.elements;
|
||||||
|
let createSalutation: CreateSalutationViewModel = {
|
||||||
|
salutation: formData.salutation.value,
|
||||||
|
};
|
||||||
|
this.status = "loading";
|
||||||
|
this.createSalutation(createSalutation)
|
||||||
|
.then(() => {
|
||||||
|
this.status = { status: "success" };
|
||||||
|
this.timeout = setTimeout(() => {
|
||||||
|
this.closeModal();
|
||||||
|
}, 1500);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.status = { status: "failed" };
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -0,0 +1,76 @@
|
||||||
|
<template>
|
||||||
|
<div class="w-full md:max-w-md">
|
||||||
|
<div class="flex flex-col items-center">
|
||||||
|
<p class="text-xl font-medium">Anrede {{ salutation?.salutation }} löschen?</p>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<div class="flex flex-row gap-2">
|
||||||
|
<button primary :disabled="status == 'loading' || status?.status == 'success'" @click="triggerDelete">
|
||||||
|
unwiederuflich löschen
|
||||||
|
</button>
|
||||||
|
<Spinner v-if="status == 'loading'" class="my-auto" />
|
||||||
|
<SuccessCheckmark v-else-if="status?.status == 'success'" />
|
||||||
|
<FailureXMark v-else-if="status?.status == 'failed'" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-row justify-end">
|
||||||
|
<div class="flex flex-row gap-4 py-2">
|
||||||
|
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
|
||||||
|
abbrechen
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { defineComponent } from "vue";
|
||||||
|
import { mapState, mapActions } from "pinia";
|
||||||
|
import { useModalStore } from "@/stores/modal";
|
||||||
|
import Spinner from "@/components/Spinner.vue";
|
||||||
|
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||||
|
import FailureXMark from "@/components/FailureXMark.vue";
|
||||||
|
import { useRoleStore } from "@/stores/admin/user/role";
|
||||||
|
import { useSalutationStore } from "@/stores/admin/settings/salutation";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default defineComponent({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
|
||||||
|
timeout: undefined as any,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
try {
|
||||||
|
clearTimeout(this.timeout);
|
||||||
|
} catch (error) {}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(useModalStore, ["data"]),
|
||||||
|
...mapState(useSalutationStore, ["salutations"]),
|
||||||
|
salutation() {
|
||||||
|
return this.salutations.find((r) => r.id == this.data);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions(useModalStore, ["closeModal"]),
|
||||||
|
...mapActions(useSalutationStore, ["deleteSalutation"]),
|
||||||
|
triggerDelete() {
|
||||||
|
this.status = "loading";
|
||||||
|
this.deleteSalutation(this.data)
|
||||||
|
.then(() => {
|
||||||
|
this.status = { status: "success" };
|
||||||
|
this.timeout = setTimeout(() => {
|
||||||
|
this.closeModal();
|
||||||
|
}, 1500);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.status = { status: "failed" };
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -0,0 +1,47 @@
|
||||||
|
<template>
|
||||||
|
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
|
||||||
|
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
|
||||||
|
<p>{{ salutation.salutation }}</p>
|
||||||
|
<div class="flex flex-row">
|
||||||
|
<RouterLink
|
||||||
|
v-if="can('update', 'settings', 'salutation')"
|
||||||
|
:to="{ name: 'admin-settings-salutation-edit', params: { id: salutation.id } }"
|
||||||
|
>
|
||||||
|
<PencilIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
|
||||||
|
</RouterLink>
|
||||||
|
<div v-if="can('delete', 'settings', 'salutation')" @click="openDeleteModal">
|
||||||
|
<TrashIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { defineComponent, defineAsyncComponent, markRaw, type PropType } from "vue";
|
||||||
|
import { mapState, mapActions } from "pinia";
|
||||||
|
import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline";
|
||||||
|
import { useAbilityStore } from "@/stores/ability";
|
||||||
|
import { useModalStore } from "@/stores/modal";
|
||||||
|
import type { SalutationViewModel } from "@/viewmodels/admin/settings/salutation.models";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default defineComponent({
|
||||||
|
props: {
|
||||||
|
salutation: { type: Object as PropType<SalutationViewModel>, default: {} },
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(useAbilityStore, ["can"]),
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions(useModalStore, ["openModal"]),
|
||||||
|
openDeleteModal() {
|
||||||
|
this.openModal(
|
||||||
|
markRaw(defineAsyncComponent(() => import("@/components/admin/settings/salutation/DeleteSalutationModal.vue"))),
|
||||||
|
this.salutation.id
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -24,7 +24,11 @@
|
||||||
>
|
>
|
||||||
<PencilIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
|
<PencilIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
<div v-if="can('delete', 'user', 'user')" @click="openDeleteModal">
|
<div
|
||||||
|
v-if="can('delete', 'user', 'user')"
|
||||||
|
:class="user.isOwner ? 'opacity-75 pointer-events-none' : ''"
|
||||||
|
@click="openDeleteModal"
|
||||||
|
>
|
||||||
<TrashIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
|
<TrashIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -70,6 +74,7 @@ export default defineComponent({
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useModalStore, ["openModal"]),
|
...mapActions(useModalStore, ["openModal"]),
|
||||||
openDeleteModal() {
|
openDeleteModal() {
|
||||||
|
if (this.user.isOwner) return;
|
||||||
this.openModal(
|
this.openModal(
|
||||||
markRaw(defineAsyncComponent(() => import("@/components/admin/user/user/DeleteUserModal.vue"))),
|
markRaw(defineAsyncComponent(() => import("@/components/admin/user/user/DeleteUserModal.vue"))),
|
||||||
this.user.id
|
this.user.id
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
export enum Salutation {
|
|
||||||
sir = "sir",
|
|
||||||
madam = "madam",
|
|
||||||
other = "other",
|
|
||||||
none = "none",
|
|
||||||
}
|
|
|
@ -422,6 +422,28 @@ const router = createRouter({
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "salutation",
|
||||||
|
name: "admin-settings-salutation-route",
|
||||||
|
component: () => import("@/views/RouterView.vue"),
|
||||||
|
meta: { type: "read", section: "settings", module: "salutation" },
|
||||||
|
beforeEnter: [abilityAndNavUpdate],
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "",
|
||||||
|
name: "admin-settings-salutation",
|
||||||
|
component: () => import("@/views/admin/settings/salutation/Salutation.vue"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ":id/edit",
|
||||||
|
name: "admin-settings-salutation-edit",
|
||||||
|
component: () => import("@/views/admin/settings/salutation/SalutationEdit.vue"),
|
||||||
|
meta: { type: "update", section: "settings", module: "salutation" },
|
||||||
|
beforeEnter: [abilityAndNavUpdate],
|
||||||
|
props: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "calendar-type",
|
path: "calendar-type",
|
||||||
name: "admin-settings-calendar_type-route",
|
name: "admin-settings-calendar_type-route",
|
||||||
|
|
|
@ -88,7 +88,7 @@ export const useMemberStore = defineStore("member", {
|
||||||
},
|
},
|
||||||
async createMember(member: CreateMemberViewModel): Promise<AxiosResponse<any, any>> {
|
async createMember(member: CreateMemberViewModel): Promise<AxiosResponse<any, any>> {
|
||||||
const result = await http.post(`/admin/member`, {
|
const result = await http.post(`/admin/member`, {
|
||||||
salutation: member.salutation,
|
salutationId: member.salutationId,
|
||||||
firstname: member.firstname,
|
firstname: member.firstname,
|
||||||
lastname: member.lastname,
|
lastname: member.lastname,
|
||||||
nameaffix: member.nameaffix,
|
nameaffix: member.nameaffix,
|
||||||
|
@ -100,7 +100,7 @@ export const useMemberStore = defineStore("member", {
|
||||||
},
|
},
|
||||||
async updateActiveMember(member: UpdateMemberViewModel): Promise<AxiosResponse<any, any>> {
|
async updateActiveMember(member: UpdateMemberViewModel): Promise<AxiosResponse<any, any>> {
|
||||||
const result = await http.patch(`/admin/member/${member.id}`, {
|
const result = await http.patch(`/admin/member/${member.id}`, {
|
||||||
salutation: member.salutation,
|
salutationId: member.salutationId,
|
||||||
firstname: member.firstname,
|
firstname: member.firstname,
|
||||||
lastname: member.lastname,
|
lastname: member.lastname,
|
||||||
nameaffix: member.nameaffix,
|
nameaffix: member.nameaffix,
|
||||||
|
|
|
@ -63,7 +63,7 @@ export const useNavigationStore = defineStore("navigation", {
|
||||||
{
|
{
|
||||||
key: "settings",
|
key: "settings",
|
||||||
title: "Einstellungen",
|
title: "Einstellungen",
|
||||||
levelDefault: "award",
|
levelDefault: "salutation",
|
||||||
} as topLevelNavigationModel,
|
} as topLevelNavigationModel,
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
|
@ -99,6 +99,7 @@ export const useNavigationStore = defineStore("navigation", {
|
||||||
mainTitle: "Einstellungen",
|
mainTitle: "Einstellungen",
|
||||||
main: [
|
main: [
|
||||||
{ key: "divider1", title: "Mitgliederdaten" },
|
{ key: "divider1", title: "Mitgliederdaten" },
|
||||||
|
...(abilityStore.can("read", "settings", "salutation") ? [{ key: "salutation", title: "Anrede" }] : []),
|
||||||
...(abilityStore.can("read", "settings", "award") ? [{ key: "award", title: "Auszeichnungen" }] : []),
|
...(abilityStore.can("read", "settings", "award") ? [{ key: "award", title: "Auszeichnungen" }] : []),
|
||||||
...(abilityStore.can("read", "settings", "communication_type")
|
...(abilityStore.can("read", "settings", "communication_type")
|
||||||
? [{ key: "communication_type", title: "Kommunikationsarten" }]
|
? [{ key: "communication_type", title: "Kommunikationsarten" }]
|
||||||
|
|
53
src/stores/admin/settings/salutation.ts
Normal file
53
src/stores/admin/settings/salutation.ts
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
import { defineStore } from "pinia";
|
||||||
|
import type {
|
||||||
|
CreateSalutationViewModel,
|
||||||
|
UpdateSalutationViewModel,
|
||||||
|
SalutationViewModel,
|
||||||
|
} from "@/viewmodels/admin/settings/salutation.models";
|
||||||
|
import { http } from "@/serverCom";
|
||||||
|
import type { AxiosResponse } from "axios";
|
||||||
|
|
||||||
|
export const useSalutationStore = defineStore("salutation", {
|
||||||
|
state: () => {
|
||||||
|
return {
|
||||||
|
salutations: [] as Array<SalutationViewModel>,
|
||||||
|
loading: "loading" as "loading" | "fetched" | "failed",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
fetchSalutations() {
|
||||||
|
this.loading = "loading";
|
||||||
|
http
|
||||||
|
.get("/admin/salutation")
|
||||||
|
.then((result) => {
|
||||||
|
this.salutations = result.data;
|
||||||
|
this.loading = "fetched";
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.loading = "failed";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fetchSalutationById(id: number): Promise<AxiosResponse<any, any>> {
|
||||||
|
return http.get(`/admin/salutation/${id}`);
|
||||||
|
},
|
||||||
|
async createSalutation(salutation: CreateSalutationViewModel): Promise<AxiosResponse<any, any>> {
|
||||||
|
const result = await http.post(`/admin/salutation`, {
|
||||||
|
salutation: salutation.salutation,
|
||||||
|
});
|
||||||
|
this.fetchSalutations();
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
async updateActiveSalutation(salutation: UpdateSalutationViewModel): Promise<AxiosResponse<any, any>> {
|
||||||
|
const result = await http.patch(`/admin/salutation/${salutation.id}`, {
|
||||||
|
salutation: salutation.salutation,
|
||||||
|
});
|
||||||
|
this.fetchSalutations();
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
async deleteSalutation(salutation: number): Promise<AxiosResponse<any, any>> {
|
||||||
|
const result = await http.delete(`/admin/salutation/${salutation}`);
|
||||||
|
this.fetchSalutations();
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
|
@ -11,6 +11,7 @@ export type PermissionModule =
|
||||||
| "executive_position"
|
| "executive_position"
|
||||||
| "communication_type"
|
| "communication_type"
|
||||||
| "membership_status"
|
| "membership_status"
|
||||||
|
| "salutation"
|
||||||
| "calendar_type"
|
| "calendar_type"
|
||||||
| "user"
|
| "user"
|
||||||
| "role"
|
| "role"
|
||||||
|
@ -53,6 +54,7 @@ export const permissionModules: Array<PermissionModule> = [
|
||||||
"executive_position",
|
"executive_position",
|
||||||
"communication_type",
|
"communication_type",
|
||||||
"membership_status",
|
"membership_status",
|
||||||
|
"salutation",
|
||||||
"calendar_type",
|
"calendar_type",
|
||||||
"user",
|
"user",
|
||||||
"role",
|
"role",
|
||||||
|
@ -71,6 +73,7 @@ export const sectionsAndModules: SectionsAndModulesObject = {
|
||||||
"executive_position",
|
"executive_position",
|
||||||
"communication_type",
|
"communication_type",
|
||||||
"membership_status",
|
"membership_status",
|
||||||
|
"salutation",
|
||||||
"calendar_type",
|
"calendar_type",
|
||||||
"query_store",
|
"query_store",
|
||||||
"template",
|
"template",
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Salutation } from "@/enums/salutation";
|
|
||||||
import type { CommunicationViewModel } from "./communication.models";
|
import type { CommunicationViewModel } from "./communication.models";
|
||||||
import type { MembershipViewModel } from "./membership.models";
|
import type { MembershipViewModel } from "./membership.models";
|
||||||
|
import type { SalutationViewModel } from "../../settings/salutation.models";
|
||||||
|
|
||||||
export interface MemberViewModel {
|
export interface MemberViewModel {
|
||||||
id: number;
|
id: number;
|
||||||
salutation: Salutation;
|
salutation: SalutationViewModel;
|
||||||
firstname: string;
|
firstname: string;
|
||||||
lastname: string;
|
lastname: string;
|
||||||
nameaffix: string;
|
nameaffix: string;
|
||||||
|
@ -19,7 +19,7 @@ export interface MemberViewModel {
|
||||||
|
|
||||||
export interface MemberStatisticsViewModel {
|
export interface MemberStatisticsViewModel {
|
||||||
id: number;
|
id: number;
|
||||||
salutation: Salutation;
|
salutation: string;
|
||||||
firstname: string;
|
firstname: string;
|
||||||
lastname: string;
|
lastname: string;
|
||||||
nameaffix: string;
|
nameaffix: string;
|
||||||
|
@ -30,7 +30,7 @@ export interface MemberStatisticsViewModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CreateMemberViewModel {
|
export interface CreateMemberViewModel {
|
||||||
salutation: Salutation;
|
salutationId: number;
|
||||||
firstname: string;
|
firstname: string;
|
||||||
lastname: string;
|
lastname: string;
|
||||||
nameaffix: string;
|
nameaffix: string;
|
||||||
|
@ -40,7 +40,7 @@ export interface CreateMemberViewModel {
|
||||||
|
|
||||||
export interface UpdateMemberViewModel {
|
export interface UpdateMemberViewModel {
|
||||||
id: number;
|
id: number;
|
||||||
salutation: Salutation;
|
salutationId: number;
|
||||||
firstname: string;
|
firstname: string;
|
||||||
lastname: string;
|
lastname: string;
|
||||||
nameaffix: string;
|
nameaffix: string;
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import type { Salutation } from "../../../../enums/salutation";
|
|
||||||
|
|
||||||
export interface MembershipViewModel {
|
export interface MembershipViewModel {
|
||||||
id: number;
|
id: number;
|
||||||
start: Date;
|
start: Date;
|
||||||
|
@ -15,7 +13,7 @@ export interface MembershipStatisticsViewModel {
|
||||||
status: string;
|
status: string;
|
||||||
statusId: number;
|
statusId: number;
|
||||||
memberId: number;
|
memberId: number;
|
||||||
memberSalutation: Salutation;
|
memberSalutation: string;
|
||||||
memberFirstname: string;
|
memberFirstname: string;
|
||||||
memberLastname: string;
|
memberLastname: string;
|
||||||
memberNameaffix: string;
|
memberNameaffix: string;
|
||||||
|
|
13
src/viewmodels/admin/settings/salutation.models.ts
Normal file
13
src/viewmodels/admin/settings/salutation.models.ts
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
export interface SalutationViewModel {
|
||||||
|
id: number;
|
||||||
|
salutation: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateSalutationViewModel {
|
||||||
|
salutation: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateSalutationViewModel {
|
||||||
|
id: number;
|
||||||
|
salutation: string;
|
||||||
|
}
|
|
@ -9,13 +9,13 @@
|
||||||
>
|
>
|
||||||
<p class="mx-auto">Mitglied bearbeiten</p>
|
<p class="mx-auto">Mitglied bearbeiten</p>
|
||||||
<div>
|
<div>
|
||||||
<Listbox v-model="member.salutation" name="salutation">
|
<Listbox v-model="member.salutation" name="salutation" by="id">
|
||||||
<ListboxLabel>Anrede</ListboxLabel>
|
<ListboxLabel>Anrede</ListboxLabel>
|
||||||
<div class="relative mt-1">
|
<div class="relative mt-1">
|
||||||
<ListboxButton
|
<ListboxButton
|
||||||
class="rounded-md shadow-sm relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-0 focus:z-10 sm:text-sm resize-none"
|
class="rounded-md shadow-sm relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-0 focus:z-10 sm:text-sm resize-none"
|
||||||
>
|
>
|
||||||
<span class="block truncate w-full text-start"> {{ member.salutation }}</span>
|
<span class="block truncate w-full text-start"> {{ member.salutation.salutation }}</span>
|
||||||
<span class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
|
<span class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
|
||||||
<ChevronUpDownIcon class="h-5 w-5 text-gray-400" aria-hidden="true" />
|
<ChevronUpDownIcon class="h-5 w-5 text-gray-400" aria-hidden="true" />
|
||||||
</span>
|
</span>
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
<ListboxOption
|
<ListboxOption
|
||||||
v-slot="{ active, selected }"
|
v-slot="{ active, selected }"
|
||||||
v-for="salutation in salutations"
|
v-for="salutation in salutations"
|
||||||
:key="salutation"
|
:key="salutation.id"
|
||||||
:value="salutation"
|
:value="salutation"
|
||||||
as="template"
|
as="template"
|
||||||
>
|
>
|
||||||
|
@ -42,7 +42,9 @@
|
||||||
'relative cursor-default select-none py-2 pl-10 pr-4',
|
'relative cursor-default select-none py-2 pl-10 pr-4',
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<span :class="[selected ? 'font-medium' : 'font-normal', 'block truncate']">{{ salutation }}</span>
|
<span :class="[selected ? 'font-medium' : 'font-normal', 'block truncate']">{{
|
||||||
|
salutation.salutation
|
||||||
|
}}</span>
|
||||||
<span v-if="selected" class="absolute inset-y-0 left-0 flex items-center pl-3 text-primary">
|
<span v-if="selected" class="absolute inset-y-0 left-0 flex items-center pl-3 text-primary">
|
||||||
<CheckIcon class="h-5 w-5" aria-hidden="true" />
|
<CheckIcon class="h-5 w-5" aria-hidden="true" />
|
||||||
</span>
|
</span>
|
||||||
|
@ -101,7 +103,7 @@ import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } f
|
||||||
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
|
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
|
||||||
import cloneDeep from "lodash.clonedeep";
|
import cloneDeep from "lodash.clonedeep";
|
||||||
import isEqual from "lodash.isequal";
|
import isEqual from "lodash.isequal";
|
||||||
import { Salutation } from "@/enums/salutation";
|
import { useSalutationStore } from "../../../../stores/admin/settings/salutation";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
@ -123,7 +125,6 @@ export default defineComponent({
|
||||||
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
|
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
|
||||||
member: null as null | MemberViewModel,
|
member: null as null | MemberViewModel,
|
||||||
timeout: null as any,
|
timeout: null as any,
|
||||||
salutations: [] as Array<string>,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -131,10 +132,11 @@ export default defineComponent({
|
||||||
return isEqual(this.activeMemberObj, this.member);
|
return isEqual(this.activeMemberObj, this.member);
|
||||||
},
|
},
|
||||||
...mapState(useMemberStore, ["activeMemberObj", "loadingActive"]),
|
...mapState(useMemberStore, ["activeMemberObj", "loadingActive"]),
|
||||||
|
...mapState(useSalutationStore, ["salutations"]),
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.fetchItem();
|
this.fetchItem();
|
||||||
this.salutations = Object.values(Salutation);
|
this.fetchSalutations();
|
||||||
},
|
},
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
try {
|
try {
|
||||||
|
@ -143,6 +145,7 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useMemberStore, ["fetchMemberByActiveId", "updateActiveMember"]),
|
...mapActions(useMemberStore, ["fetchMemberByActiveId", "updateActiveMember"]),
|
||||||
|
...mapActions(useSalutationStore, ["fetchSalutations"]),
|
||||||
resetForm() {
|
resetForm() {
|
||||||
this.member = cloneDeep(this.activeMemberObj);
|
this.member = cloneDeep(this.activeMemberObj);
|
||||||
},
|
},
|
||||||
|
@ -154,11 +157,11 @@ export default defineComponent({
|
||||||
let formData = e.target.elements;
|
let formData = e.target.elements;
|
||||||
let updateMember: UpdateMemberViewModel = {
|
let updateMember: UpdateMemberViewModel = {
|
||||||
id: this.member.id,
|
id: this.member.id,
|
||||||
salutation: formData.salutation.value,
|
salutationId: formData.salutation.value,
|
||||||
firstname: formData.firstname.value,
|
firstname: formData.firstname.value,
|
||||||
lastname: formData.lastname.value,
|
lastname: formData.lastname.value,
|
||||||
nameaffix: formData.nameaffix.value,
|
nameaffix: formData.nameaffix.value,
|
||||||
birthdate: formData.birthdate.value,
|
birthdate: formData.birthdate.value,
|
||||||
internalId: formData.internalId.value,
|
internalId: formData.internalId.value,
|
||||||
};
|
};
|
||||||
this.status = "loading";
|
this.status = "loading";
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="salutation">Anrede</label>
|
<label for="salutation">Anrede</label>
|
||||||
<input type="text" id="salutation" :value="activeMemberObj.salutation" readonly />
|
<input type="text" id="salutation" :value="activeMemberObj.salutation.salutation" readonly />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="firstname">Vorname</label>
|
<label for="firstname">Vorname</label>
|
||||||
|
|
52
src/views/admin/settings/salutation/Salutation.vue
Normal file
52
src/views/admin/settings/salutation/Salutation.vue
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
<template>
|
||||||
|
<MainTemplate>
|
||||||
|
<template #topBar>
|
||||||
|
<div class="flex flex-row items-center justify-between pt-5 pb-3 px-7">
|
||||||
|
<h1 class="font-bold text-xl h-8">Anrede</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #diffMain>
|
||||||
|
<div class="flex flex-col gap-4 h-full pl-7">
|
||||||
|
<div class="flex flex-col gap-2 grow overflow-y-scroll pr-7">
|
||||||
|
<SalutationListItem v-for="salutation in salutations" :key="salutation.id" :salutation="salutation" />
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-row gap-4">
|
||||||
|
<button v-if="can('create', 'settings', 'salutation')" primary class="!w-fit" @click="openCreateModal">
|
||||||
|
Anrede erstellen
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</MainTemplate>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { defineComponent, defineAsyncComponent, markRaw } from "vue";
|
||||||
|
import { mapState, mapActions } from "pinia";
|
||||||
|
import MainTemplate from "@/templates/Main.vue";
|
||||||
|
import { useSalutationStore } from "@/stores/admin/settings/salutation";
|
||||||
|
import SalutationListItem from "@/components/admin/settings/salutation/SalutationListItem.vue";
|
||||||
|
import { useModalStore } from "@/stores/modal";
|
||||||
|
import { useAbilityStore } from "@/stores/ability";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default defineComponent({
|
||||||
|
computed: {
|
||||||
|
...mapState(useSalutationStore, ["salutations"]),
|
||||||
|
...mapState(useAbilityStore, ["can"]),
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetchSalutations();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions(useSalutationStore, ["fetchSalutations"]),
|
||||||
|
...mapActions(useModalStore, ["openModal"]),
|
||||||
|
openCreateModal() {
|
||||||
|
this.openModal(
|
||||||
|
markRaw(defineAsyncComponent(() => import("@/components/admin/settings/salutation/CreateSalutationModal.vue")))
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
120
src/views/admin/settings/salutation/SalutationEdit.vue
Normal file
120
src/views/admin/settings/salutation/SalutationEdit.vue
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
<template>
|
||||||
|
<MainTemplate>
|
||||||
|
<template #headerInsert>
|
||||||
|
<RouterLink to="../" class="text-primary">zurück zur Liste (abbrechen)</RouterLink>
|
||||||
|
</template>
|
||||||
|
<template #topBar>
|
||||||
|
<div class="flex flex-row items-center justify-between pt-5 pb-3 px-7">
|
||||||
|
<h1 class="font-bold text-xl h-8">Anrede {{ origin?.salutation }} - Daten bearbeiten</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #main>
|
||||||
|
<Spinner v-if="loading == 'loading'" class="mx-auto" />
|
||||||
|
<p v-else-if="loading == 'failed'">laden fehlgeschlagen</p>
|
||||||
|
<form
|
||||||
|
v-else-if="salutation != null"
|
||||||
|
class="flex flex-col gap-4 py-2 w-full max-w-xl mx-auto"
|
||||||
|
@submit.prevent="triggerUpdate"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<label for="salutation">Anrede</label>
|
||||||
|
<input type="text" id="salutation" required v-model="salutation.salutation" />
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-row justify-end gap-2">
|
||||||
|
<button primary-outline type="reset" class="!w-fit" :disabled="canSaveOrReset" @click="resetForm">
|
||||||
|
verwerfen
|
||||||
|
</button>
|
||||||
|
<button primary type="submit" class="!w-fit" :disabled="status == 'loading' || canSaveOrReset">
|
||||||
|
speichern
|
||||||
|
</button>
|
||||||
|
<Spinner v-if="status == 'loading'" class="my-auto" />
|
||||||
|
<SuccessCheckmark v-else-if="status?.status == 'success'" />
|
||||||
|
<FailureXMark v-else-if="status?.status == 'failed'" />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</template>
|
||||||
|
</MainTemplate>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { defineComponent } from "vue";
|
||||||
|
import { mapState, mapActions } from "pinia";
|
||||||
|
import MainTemplate from "@/templates/Main.vue";
|
||||||
|
import { useSalutationStore } from "@/stores/admin/settings/salutation";
|
||||||
|
import Spinner from "@/components/Spinner.vue";
|
||||||
|
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||||
|
import FailureXMark from "@/components/FailureXMark.vue";
|
||||||
|
import { RouterLink } from "vue-router";
|
||||||
|
import type { SalutationViewModel, UpdateSalutationViewModel } from "@/viewmodels/admin/settings/salutation.models";
|
||||||
|
import cloneDeep from "lodash.clonedeep";
|
||||||
|
import isEqual from "lodash.isequal";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default defineComponent({
|
||||||
|
props: {
|
||||||
|
id: String,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: "loading" as "loading" | "fetched" | "failed",
|
||||||
|
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
|
||||||
|
origin: null as null | SalutationViewModel,
|
||||||
|
salutation: null as null | SalutationViewModel,
|
||||||
|
timeout: null as any,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
canSaveOrReset(): boolean {
|
||||||
|
return isEqual(this.origin, this.salutation);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetchItem();
|
||||||
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
try {
|
||||||
|
clearTimeout(this.timeout);
|
||||||
|
} catch (error) {}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions(useSalutationStore, ["fetchSalutationById", "updateActiveSalutation"]),
|
||||||
|
resetForm() {
|
||||||
|
this.salutation = cloneDeep(this.origin);
|
||||||
|
},
|
||||||
|
fetchItem() {
|
||||||
|
this.fetchSalutationById(parseInt(this.id ?? ""))
|
||||||
|
.then((result) => {
|
||||||
|
this.salutation = result.data;
|
||||||
|
this.origin = cloneDeep(result.data);
|
||||||
|
this.loading = "fetched";
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.loading = "failed";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
triggerUpdate(e: any) {
|
||||||
|
if (this.salutation == null) return;
|
||||||
|
let formData = e.target.elements;
|
||||||
|
let updateSalutation: UpdateSalutationViewModel = {
|
||||||
|
id: this.salutation.id,
|
||||||
|
salutation: formData.salutation.value,
|
||||||
|
};
|
||||||
|
this.status = "loading";
|
||||||
|
this.updateActiveSalutation(updateSalutation)
|
||||||
|
.then(() => {
|
||||||
|
this.fetchItem();
|
||||||
|
this.status = { status: "success" };
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.status = { status: "failed" };
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.timeout = setTimeout(() => {
|
||||||
|
this.status = null;
|
||||||
|
}, 2000);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
Loading…
Reference in a new issue