Skip to content

Commit

Permalink
PUSH
Browse files Browse the repository at this point in the history
-> fixed dumb dumb mistakes
  • Loading branch information
NaysKutzu committed Jan 23, 2025
1 parent 6135084 commit fe02088
Show file tree
Hide file tree
Showing 10 changed files with 419 additions and 404 deletions.
2 changes: 1 addition & 1 deletion backend/app/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct(bool $softBoot)
*
* If the soft boot is true, we do not want to initialize the database connection or the router.
*
* This is usefull for commands or other things that do not require the database connection.
* This is useful for commands or other things that do not require the database connection.
*
* This is also a lite way to boot the application without initializing the database connection or the router!.
*/
Expand Down
21 changes: 0 additions & 21 deletions backend/app/Mail/exceptions/InvalidDriver.php

This file was deleted.

9 changes: 5 additions & 4 deletions backend/app/Mail/templates/NewLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
namespace MythicalClient\Mail\templates;

use MythicalClient\App;
use MythicalClient\Chat\User;
use MythicalClient\Mail\Mail;
use MythicalClient\Chat\Mails;
use MythicalClient\Chat\Database;
use MythicalClient\Chat\User\Mails;
use MythicalClient\Chat\User\User;
use MythicalClient\Mail\Mail;


use MythicalClient\Chat\columns\UserColumns;

Expand All @@ -27,7 +28,7 @@ public static function sendMail(string $uuid): void
{
try {
$template = self::getFinalTemplate($uuid);
$email = User::getInfo(User::getTokenFromUUID($uuid), UserColumns::EMAIL, false);
$email = \MythicalClient\Chat\User\User::getInfo(\MythicalClient\Chat\User\User::getTokenFromUUID($uuid), UserColumns::EMAIL, false);
Mails::add('New Login Detected', $template, $uuid);
self::send($email, 'New Login Detected', $template);
} catch (\Exception $e) {
Expand Down
9 changes: 4 additions & 5 deletions backend/app/Mail/templates/ResetPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
namespace MythicalClient\Mail\templates;

use MythicalClient\App;
use MythicalClient\Chat\User;
use MythicalClient\Mail\Mail;
use MythicalClient\Chat\Mails;
use MythicalClient\Chat\Database;

use MythicalClient\Chat\columns\UserColumns;
use MythicalClient\Chat\Database;
use MythicalClient\Chat\User\Mails;
use MythicalClient\Chat\User\User;
use MythicalClient\Mail\Mail;

class ResetPassword extends Mail
{
Expand Down
8 changes: 4 additions & 4 deletions backend/app/Mail/templates/Verify.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
namespace MythicalClient\Mail\templates;

use MythicalClient\App;
use MythicalClient\Chat\User;
use MythicalClient\Mail\Mail;
use MythicalClient\Chat\Mails;
use MythicalClient\Chat\Database;
use MythicalClient\Chat\columns\UserColumns;
use MythicalClient\Chat\Database;
use MythicalClient\Chat\User\Mails;
use MythicalClient\Chat\User\User;
use MythicalClient\Mail\Mail;

class Verify extends Mail
{
Expand Down
12 changes: 6 additions & 6 deletions backend/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@
"vite-plugin-vue-devtools": "^7.5.4",
"vue-tsc": "^2.1.10"
}
}
}
113 changes: 72 additions & 41 deletions frontend/src/components/client/Dashboard/Main/TicketList.vue
Original file line number Diff line number Diff line change
@@ -1,45 +1,76 @@
<template>
<!-- Recent Tickets -->
<CardComponent>
<h2 class="text-lg font-semibold text-white mb-4">Recent Tickets</h2>
<div class="space-y-3">
<div
v-for="ticket in recentTickets"
:key="ticket.id"
class="flex items-center justify-between py-2 border-b border-purple-700 last:border-0"
>
<div>
<div class="font-medium text-white">{{ ticket.title }}</div>
<div class="text-sm text-purple-500">{{ ticket.date }}</div>
</div>
<span
:class="[
'px-2 py-1 rounded text-xs font-medium',
ticket.status === 'Open'
? 'bg-yellow-500/20 text-yellow-400'
: 'bg-emerald-500/20 text-emerald-400',
]"
>
{{ ticket.status }}
</span>
</div>
</div>
<RouterLink
to="/support"
class="mt-4 block w-full px-4 py-2 bg-purple-600 hover:bg-purple-500 text-white rounded transition-colors text-center text-sm"
>
View All Tickets
</RouterLink>
</CardComponent>
</template>

<script setup lang="ts">
import CardComponent from '@/components/client/ui/Card/CardComponent.vue';
import { ref } from 'vue';
import Tickets from '@/mythicalclient/Tickets';
import { ref, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
interface Ticket {
id: number;
title: string;
date: string;
status: string;
}
const { t } = useI18n();
const recentTickets = ref<Ticket[]>([]);
import { format } from 'date-fns';
const recentTickets = ref([
{ id: 1, title: 'Server Performance Issue', date: '2023-07-01', status: 'Open' },
{ id: 2, title: 'Billing Inquiry', date: '2023-06-28', status: 'Closed' },
{ id: 3, title: 'Domain Transfer Request', date: '2023-06-25', status: 'Open' },
]);
const fetchRecentTickets = async () => {
try {
const response = await Tickets.getTickets();
if (response.success && Array.isArray(response.tickets)) {
recentTickets.value = response.tickets.slice(0, 3).map((ticket: { date: string | number | Date; status: string; }) => ({
...ticket,
date: format(new Date(ticket.date), 'PPP'),
status: ticket.status
.split(' ')
.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
.join(' ')
.replace('Inprogress', 'In Progress')
}));
} else {
throw new Error(response.error || 'Failed to fetch tickets');
}
} catch (err) {
console.error('Error fetching recent tickets:', err);
}
};
onMounted(fetchRecentTickets);
</script>

<template>
<!-- Recent Tickets -->
<CardComponent>
<h2 class="text-lg font-semibold text-white mb-4">{{ t('Components.Tickets.title') }}</h2>
<div class="space-y-3">
<div v-for="ticket in recentTickets" :key="ticket.id"
class="flex items-center justify-between py-2 border-b border-purple-700 last:border-0">
<div>
<div class="font-medium text-white">{{ ticket.title }}</div>
<div class="text-sm text-purple-500">{{ ticket.date }}</div>
</div>
<span :class="[
'px-2 py-1 rounded text-xs font-medium',
ticket.status === 'Open'
? 'bg-green-500/20 text-green-400'
: ticket.status === 'Closed'
? 'bg-red-500/20 text-red-400'
: ticket.status === 'Waiting'
? 'bg-orange-500/20 text-orange-400'
: ticket.status === 'Replied'
? 'bg-blue-500/20 text-blue-400'
: ticket.status === 'In Progress'
? 'bg-purple-500/20 text-purple-400'
: '',
]">
{{ ticket.status }}
</span>
</div>
</div>
<RouterLink to="/support"
class="mt-4 block w-full px-4 py-2 bg-purple-600 hover:bg-purple-500 text-white rounded transition-colors text-center text-sm">
{{ t('Components.Tickets.viewMore') }}
</RouterLink>
</CardComponent>
</template>
3 changes: 3 additions & 0 deletions frontend/src/locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Components:
Title: 'Announcements'
Card:
ReadMore: 'Read More'
Tickets:
title: 'Recent tickets'
viewMore: 'View more'
SupportPin:
title: 'Support PIN'
copy: 'Copy'
Expand Down
Loading

0 comments on commit fe02088

Please sign in to comment.