Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f96e0ac4a |
+12
-7
@@ -2,14 +2,13 @@
|
|||||||
|
|
||||||
namespace KTXM\Chrono;
|
namespace KTXM\Chrono;
|
||||||
|
|
||||||
use KTXF\Module\Configuration\BrowserModuleContextInterface;
|
use KTXF\Module\ModuleBrowserInterface;
|
||||||
use KTXF\Module\Configuration\ModuleContextInterface;
|
|
||||||
use KTXF\Module\ModuleInstanceAbstract;
|
use KTXF\Module\ModuleInstanceAbstract;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Chrono Module - Calendaring and Tasks
|
* Chrono Module - Calendaring and Tasks
|
||||||
*/
|
*/
|
||||||
class Module extends ModuleInstanceAbstract
|
class Module extends ModuleInstanceAbstract implements ModuleBrowserInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
@@ -51,11 +50,17 @@ class Module extends ModuleInstanceAbstract
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configure(ModuleContextInterface $context): void
|
public function registerBI(): array
|
||||||
{
|
{
|
||||||
if ($context instanceof BrowserModuleContextInterface) {
|
return [
|
||||||
$context->registerModule($this, 'Chrono', 'static/module.mjs');
|
'handle' => $this->handle(),
|
||||||
}
|
'namespace' => 'Chrono',
|
||||||
|
'version' => $this->version(),
|
||||||
|
'label' => $this->label(),
|
||||||
|
'author' => $this->author(),
|
||||||
|
'description' => $this->description(),
|
||||||
|
'boot' => 'static/module.mjs',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+329
-258
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -28,7 +28,7 @@
|
|||||||
"@vitest/coverage-v8": "^4.1.6",
|
"@vitest/coverage-v8": "^4.1.6",
|
||||||
"@vue/test-utils": "^2.4.10",
|
"@vue/test-utils": "^2.4.10",
|
||||||
"@vue/tsconfig": "^0.9.0",
|
"@vue/tsconfig": "^0.9.0",
|
||||||
"jsdom": "^30.0.0",
|
"jsdom": "^29.1.1",
|
||||||
"typescript": "~6.0.0",
|
"typescript": "~6.0.0",
|
||||||
"vite": "^8.0.0",
|
"vite": "^8.0.0",
|
||||||
"vitest": "^4.1.6",
|
"vitest": "^4.1.6",
|
||||||
|
|||||||
@@ -252,7 +252,9 @@ watch(
|
|||||||
|
|
||||||
<EventEditorParticipants
|
<EventEditorParticipants
|
||||||
:mode="mode"
|
:mode="mode"
|
||||||
|
:organizer="entityObject!.organizer"
|
||||||
:participants="entityObject!.participants || {}"
|
:participants="entityObject!.participants || {}"
|
||||||
|
@update:organizer="entityObject!.organizer = $event"
|
||||||
@add-participant="addParticipant"
|
@add-participant="addParticipant"
|
||||||
@remove-participant="removeParticipant"
|
@remove-participant="removeParticipant"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -22,30 +22,21 @@ const hasLocations = () => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="hasLocations() || mode === 'edit'" class="event-editor-section">
|
<div v-if="hasLocations() || mode === 'edit'" class="event-editor-section">
|
||||||
<div class="d-flex align-center justify-space-between mb-2">
|
<div class="text-subtitle-1 mb-2">Locations</div>
|
||||||
<div class="text-subtitle-1">Locations</div>
|
|
||||||
<div v-if="mode === 'edit'" class="d-flex ga-2">
|
|
||||||
<v-btn
|
|
||||||
icon="mdi-map-marker"
|
|
||||||
size="x-small"
|
|
||||||
variant="text"
|
|
||||||
rounded="0"
|
|
||||||
title="Add Physical Location"
|
|
||||||
@click="$emit('add-location-physical')">
|
|
||||||
</v-btn>
|
|
||||||
<v-btn
|
|
||||||
icon="mdi-web"
|
|
||||||
size="x-small"
|
|
||||||
variant="text"
|
|
||||||
rounded="0"
|
|
||||||
title="Add Virtual Location"
|
|
||||||
@click="$emit('add-location-virtual')">
|
|
||||||
</v-btn>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Physical Locations -->
|
<!-- Physical Locations -->
|
||||||
<div v-if="Object.keys(locationsPhysical || {}).length > 0 || mode === 'edit'" class="mb-4">
|
<div v-if="Object.keys(locationsPhysical || {}).length > 0 || mode === 'edit'" class="mb-4">
|
||||||
|
<div class="d-flex align-center justify-space-between mb-2">
|
||||||
|
<div class="text-subtitle-2">Physical</div>
|
||||||
|
<v-btn v-if="mode === 'edit'"
|
||||||
|
size="small"
|
||||||
|
variant="outlined"
|
||||||
|
@click="$emit('add-location-physical')">
|
||||||
|
<v-icon left>mdi-plus</v-icon>
|
||||||
|
Add
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Read-only view -->
|
<!-- Read-only view -->
|
||||||
<div v-if="mode === 'view'">
|
<div v-if="mode === 'view'">
|
||||||
<div v-for="(location, key) in locationsPhysical" :key="key" class="mb-2 pa-2 border rounded">
|
<div v-for="(location, key) in locationsPhysical" :key="key" class="mb-2 pa-2 border rounded">
|
||||||
@@ -109,6 +100,17 @@ const hasLocations = () => {
|
|||||||
|
|
||||||
<!-- Virtual Locations -->
|
<!-- Virtual Locations -->
|
||||||
<div v-if="Object.keys(locationsVirtual || {}).length > 0 || mode === 'edit'">
|
<div v-if="Object.keys(locationsVirtual || {}).length > 0 || mode === 'edit'">
|
||||||
|
<div class="d-flex align-center justify-space-between mb-2">
|
||||||
|
<div class="text-subtitle-2">Virtual</div>
|
||||||
|
<v-btn v-if="mode === 'edit'"
|
||||||
|
size="small"
|
||||||
|
variant="outlined"
|
||||||
|
@click="$emit('add-location-virtual')">
|
||||||
|
<v-icon left>mdi-plus</v-icon>
|
||||||
|
Add
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Read-only view -->
|
<!-- Read-only view -->
|
||||||
<div v-if="mode === 'view'">
|
<div v-if="mode === 'view'">
|
||||||
<div v-for="(location, key) in locationsVirtual" :key="key" class="mb-2 pa-2 border rounded">
|
<div v-for="(location, key) in locationsVirtual" :key="key" class="mb-2 pa-2 border rounded">
|
||||||
|
|||||||
@@ -56,12 +56,11 @@ const formatNotification = (notification: any) => {
|
|||||||
<div class="d-flex align-center justify-space-between mb-2">
|
<div class="d-flex align-center justify-space-between mb-2">
|
||||||
<div class="text-subtitle-1">Notifications</div>
|
<div class="text-subtitle-1">Notifications</div>
|
||||||
<v-btn v-if="mode === 'edit'"
|
<v-btn v-if="mode === 'edit'"
|
||||||
icon="mdi-bell"
|
size="small"
|
||||||
size="x-small"
|
variant="outlined"
|
||||||
variant="text"
|
|
||||||
rounded="0"
|
|
||||||
title="Add Notification"
|
|
||||||
@click="$emit('add-notification')">
|
@click="$emit('add-notification')">
|
||||||
|
<v-icon left>mdi-plus</v-icon>
|
||||||
|
Add
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -221,13 +221,13 @@ const formatRecurrence = (pattern: RecurrencePattern) => {
|
|||||||
<div class="text-subtitle-1">Recurrence</div>
|
<div class="text-subtitle-1">Recurrence</div>
|
||||||
<v-btn
|
<v-btn
|
||||||
v-if="mode === 'edit' && !pattern"
|
v-if="mode === 'edit' && !pattern"
|
||||||
icon="mdi-repeat"
|
size="small"
|
||||||
size="x-small"
|
variant="outlined"
|
||||||
variant="text"
|
|
||||||
rounded="0"
|
|
||||||
title="Add Recurrence"
|
|
||||||
@click="addRecurrence"
|
@click="addRecurrence"
|
||||||
/>
|
>
|
||||||
|
<v-icon start icon="mdi-plus" />
|
||||||
|
Add
|
||||||
|
</v-btn>
|
||||||
<v-btn
|
<v-btn
|
||||||
v-else-if="mode === 'edit'"
|
v-else-if="mode === 'edit'"
|
||||||
icon="mdi-delete"
|
icon="mdi-delete"
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
interface Props {
|
interface Props {
|
||||||
mode: 'edit' | 'view'
|
mode: 'edit' | 'view'
|
||||||
|
organizer: any | null
|
||||||
participants: Record<string, any>
|
participants: Record<string, any>
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<Props>()
|
const props = defineProps<Props>()
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
'update:organizer': [organizer: any | null]
|
||||||
'add-participant': []
|
'add-participant': []
|
||||||
'remove-participant': [key: string]
|
'remove-participant': [key: string]
|
||||||
}>()
|
}>()
|
||||||
@@ -37,26 +39,61 @@ const typeOptions = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
const hasParticipants = () => {
|
const hasParticipants = () => {
|
||||||
return Object.keys(props.participants || {}).length > 0
|
return props.organizer || Object.keys(props.participants || {}).length > 0
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="hasParticipants() || mode === 'edit'" class="event-editor-section">
|
<div v-if="hasParticipants() || mode === 'edit'" class="event-editor-section">
|
||||||
<div class="d-flex align-center justify-space-between mb-2">
|
<div class="text-subtitle-1 mb-2">Participants</div>
|
||||||
<div class="text-subtitle-1">Participants</div>
|
|
||||||
<v-btn v-if="mode === 'edit'"
|
<!-- Organizer -->
|
||||||
icon="mdi-account"
|
<div v-if="organizer || mode === 'edit'" class="mb-4">
|
||||||
size="x-small"
|
<div class="text-subtitle-2 mb-2">Organizer</div>
|
||||||
variant="text"
|
|
||||||
rounded="0"
|
<!-- Read-only view -->
|
||||||
title="Add Attendee"
|
<div v-if="mode === 'view' && organizer" class="pa-2 border rounded">
|
||||||
@click="$emit('add-participant')">
|
<div class="mb-1"><strong>{{ organizer.name || organizer.address }}</strong></div>
|
||||||
</v-btn>
|
<div class="text-caption text-grey">{{ organizer.address }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Edit view -->
|
||||||
|
<div v-else-if="mode === 'edit'" class="pa-3 border rounded">
|
||||||
|
<v-row dense>
|
||||||
|
<v-col cols="12" md="6">
|
||||||
|
<v-text-field
|
||||||
|
v-model="organizer.name"
|
||||||
|
label="Name"
|
||||||
|
variant="outlined"
|
||||||
|
density="compact"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="12" md="6">
|
||||||
|
<v-text-field
|
||||||
|
v-model="organizer.address"
|
||||||
|
label="Email/Address"
|
||||||
|
variant="outlined"
|
||||||
|
density="compact"
|
||||||
|
:rules="[v => !!v || 'Address is required']"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Participants List -->
|
<!-- Participants List -->
|
||||||
<div v-if="Object.keys(participants || {}).length > 0 || mode === 'edit'">
|
<div v-if="Object.keys(participants || {}).length > 0 || mode === 'edit'">
|
||||||
|
<div class="d-flex align-center justify-space-between mb-2">
|
||||||
|
<div class="text-subtitle-2">Attendees</div>
|
||||||
|
<v-btn v-if="mode === 'edit'"
|
||||||
|
size="small"
|
||||||
|
variant="outlined"
|
||||||
|
@click="$emit('add-participant')">
|
||||||
|
<v-icon left>mdi-plus</v-icon>
|
||||||
|
Add
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Read-only view -->
|
<!-- Read-only view -->
|
||||||
<div v-if="mode === 'view'">
|
<div v-if="mode === 'view'">
|
||||||
<div v-for="(participant, key) in participants" :key="key" class="mb-2 pa-2 border rounded">
|
<div v-for="(participant, key) in participants" :key="key" class="mb-2 pa-2 border rounded">
|
||||||
|
|||||||
Reference in New Issue
Block a user