Skip to content

Commit 13e68b7

Browse files
authored
Merge pull request #327 from Peppermint-Lab/master
main inline with staging
2 parents 8da7d60 + 4bea6d6 commit 13e68b7

File tree

13 files changed

+231
-16
lines changed

13 files changed

+231
-16
lines changed

apps/api/src/controllers/auth.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,19 @@ export function authRoutes(fastify: FastifyInstance) {
753753
const token = checkToken(bearer);
754754
if (token) {
755755
const { id, role } = request.body as { id: string; role: boolean };
756-
756+
// check for atleast one admin on role downgrade
757+
if (role === false) {
758+
const admins = await prisma.user.findMany({
759+
where: { isAdmin: true },
760+
});
761+
if (admins.length === 1) {
762+
reply.code(400).send({
763+
message: "Atleast one admin is required",
764+
success: false
765+
});
766+
return;
767+
}
768+
}
757769
await prisma.user.update({
758770
where: { id },
759771
data: {

apps/api/src/lib/nodemailer/ticket/status.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ export async function sendTicketStatus(ticket: any) {
5151
.sendMail({
5252
from: replyto, // sender address
5353
to: ticket.email,
54-
subject: `Ticket ${ticket.id} status is now ${
54+
subject: `Ticket ${ticket.Number} status is now ${
5555
ticket.isComplete ? "COMPLETED" : "OUTSTANDING"
5656
}`, // Subject line
57-
text: `Hello there, Ticket ${ticket.id}, now has a status of ${
57+
text: `Hello there, Ticket ${ticket.Number}, now has a status of ${
5858
ticket.isComplete ? "COMPLETED" : "OUTSTANDING"
5959
}`, // plain text body
6060
html: htmlToSend,

apps/client/components/UpdateUserModal/index.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Dialog, Transition } from "@headlessui/react";
22
import { XMarkIcon } from "@heroicons/react/24/outline";
3+
import { notifications } from "@mantine/notifications";
34
import { getCookie } from "cookies-next";
45
import { useRouter } from "next/router";
56
import { Fragment, useState } from "react";
@@ -22,6 +23,24 @@ export default function UpdateUserModal({ user }) {
2223
role: admin,
2324
id: user.id,
2425
}),
26+
})
27+
.then((res) => res.json())
28+
.then((res) => {
29+
if (res.success === true) {
30+
notifications.show({
31+
title: "User Updated",
32+
message: "User updated succesfully",
33+
color: "green",
34+
autoClose: 5000,
35+
});
36+
} else {
37+
notifications.show({
38+
title: "Error",
39+
message: res.message,
40+
color: "red",
41+
autoClose: 5000,
42+
});
43+
}
2544
});
2645
// .then(() => router.reload());
2746
}

apps/client/i18n.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
locales: ["en", "da", "de", "es", "fr", "no", "pt", "se", "tl", "it", "he"],
2+
locales: ["en", "da", "de", "es", "fr", "no", "pt", "se", "tl", "it", "he", "tr", "hu"],
33
defaultLocale: "en",
44
pages: {
55
"*": ["peppermint"],

apps/client/locales/de/peppermint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"notebooks": "Notizbücher",
5353
"notebooks_description": "Dies ist ein persönliches Notizbuch. Hier können Sie Notizen, Links, Code-Snippets usw. speichern.",
5454
"create_notebook": "Notizbuch erstellen",
55-
"open": "Öffnen",
55+
"open": "Offen",
5656
"assigned_to_me": "Mir Zugewiesen",
5757
"unassigned": "Nicht Zugewiesen",
5858
"closed": "Geschlossen",

apps/client/locales/en/peppermint.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,11 @@
8282
"select_a_client": "Select a Client",
8383
"select_an_engineer": "Select an Engineer",
8484
"ticket_create": "Create Ticket",
85-
"internallycommented_at": "Internally Commented at"
85+
"internallycommented_at": "Internally Commented at",
86+
"reopen_issue": "Reopen Issue",
87+
"needs_support": "Needs Support",
88+
"in_progress": "In Progress",
89+
"in_review": "In Review",
90+
"done": "Done",
91+
"select_new_user": "Select new user"
8692
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"hello_good": "Szép",
3+
"hello_morning": "reggelt",
4+
"hello_afternoon": "délutánt",
5+
"sl_dashboard": "Vezérlőpult",
6+
"sl_tickets": "Jegyek",
7+
"sl_history": "Előzmények",
8+
"sl_notebook": "Saját jegyzetek",
9+
"sl_users": "Felhasználók",
10+
"sl_clients": "Kliensek",
11+
"sl_settings": "Beállítások",
12+
"open_tickets": "Nyitott jegyek",
13+
"completed_tickets": "Lezárt jegyek",
14+
"account_status": "Fiók státusz",
15+
"todo_list": "Teendő lista",
16+
"personal_files": "Saját fájlok",
17+
"create_ticket": "Új jegy",
18+
"ticket_new": "Új",
19+
"ticket_name_here": "Név",
20+
"ticket_email_here": "Email",
21+
"ticket_details": "Cím",
22+
"ticket_select_client": "Válassz egy ügyfelet",
23+
"ticket_select_eng": "Válassz egy fejlesztőt",
24+
"ticket_extra_details": "Írd be a jegy részleteit...",
25+
"cancel": "Mégse",
26+
"create": "Mentés",
27+
"low": "Alacsony",
28+
"normal": "Normál",
29+
"high": "Magas",
30+
"edit-btn": "Szerkesztés",
31+
"reset_password": "Jelszó emlékeztető",
32+
"internal_users": "Belső felhasználók",
33+
"clients": "Ügyfelek",
34+
"new_user": "Új felhasználó",
35+
"new_client": "Új ügyfél",
36+
"previous": "Előző",
37+
"next": "Következő",
38+
"show": "Megtekintés",
39+
"name": "Név",
40+
"email": "Email",
41+
"settings": "Beállítások",
42+
"webhooks": "Webhookok",
43+
"version": "Verzió",
44+
"v_profile": "Profil megtekintése",
45+
"reminders": "Emlékeztetők",
46+
"title": "Cím",
47+
"priority": "Prioritás",
48+
"status": "Státusz",
49+
"created": "Létrehozva",
50+
"assigned_to": "Hozzárendelve",
51+
"enter_todo": "Adj hozzá teendőt",
52+
"notebooks": "Jegyzetek",
53+
"notebooks_description": "Ez a személyes jegyzeted. Elmenthetsz jegyzeteket, linkeket, kód részleteket, stb.",
54+
"create_notebook": "Jegyzet létrehozása",
55+
"open": "Nyitott",
56+
"assigned_to_me": "Hozzám rendelve",
57+
"unassigned": "Nincs hozzárendelve",
58+
"closed": "Lezárt",
59+
"description": "Leírás",
60+
"comments": "Kommentek",
61+
"leave_comment": "Komment írása",
62+
"close_issue": "Probléma lezárása",
63+
"comment": "Komment",
64+
"save": "Mentés",
65+
"labels": "Címkék",
66+
"created_at": "Létrehozva ekkor",
67+
"updated_at": "Frissítve ekkor",
68+
"hide_ticket": "Jegy elrejtése",
69+
"show_ticket": "Megjelenít",
70+
"open_issue": "Nyitott problémák",
71+
"closed_issue": "Lezárt problémák",
72+
"recent_tickets": "Legutolsó jegyek",
73+
"notebook_title": "Jegyzet cím",
74+
"admin_settings": "Admin beállítások",
75+
"profile": "Profil",
76+
"logout": "Kijelentkezés",
77+
"unassigned_tickets": "Hozzárendelés nélküli jegyek",
78+
"profile_desc": "Ez az információ nyilvánosan megjelenik, ezért légy óvatos, mit osztasz meg.",
79+
"language": "Nyelv",
80+
"notifications": "Értesítések",
81+
"save_and_reload": "Mentés és újratöltés",
82+
"select_a_client": "Válassz egy ügyfelet",
83+
"select_an_engineer": "Válassz egy fejlesztőt",
84+
"ticket_create": "Jegy létrehozása",
85+
"internallycommented_at": "Belső komment létrehozva"
86+
}

apps/client/locales/no/peppermint.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
"hello_morning": "Morgen",
44
"hello_afternoon": "Ettermiddag",
55
"sl_dashboard": "Instrumentpanel",
6-
"sl_tickets": "Billetter",
6+
"sl_tickets": "Saker",
77
"sl_history": "Historikk",
88
"sl_notebook": "Personlig Notatbok",
99
"sl_users": "Brukere",
1010
"sl_clients": "Klienter",
1111
"sl_settings": "Innstillinger",
12-
"open_tickets": "Åpne Billetter",
13-
"completed_tickets": "Fullførte Billetter",
12+
"open_tickets": "Åpne Saker",
13+
"completed_tickets": "Fullførte Saker",
1414
"account_status": "Kontostatus",
1515
"todo_list": "Oppgaveliste",
1616
"personal_files": "Personlige Filer",
17-
"create_ticket": "Opprett Billett",
18-
"ticket_new": "Ny Billett",
17+
"create_ticket": "Opprett Saker",
18+
"ticket_new": "Ny Saker",
1919
"ticket_name_here": "Navn",
2020
"ticket_email_here": "E-post",
2121
"ticket_details": "Tittel",
@@ -65,22 +65,22 @@
6565
"labels": "Etiketter",
6666
"created_at": "Opprettet den",
6767
"updated_at": "Oppdatert den",
68-
"hide_ticket": "Skjul Billett",
68+
"hide_ticket": "Skjul Sak",
6969
"show_ticket": "Vis Globalt",
7070
"open_issue": "Åpne Problem",
7171
"closed_issue": "Lukket Problem",
72-
"recent_tickets": "Nylige Billetter",
72+
"recent_tickets": "Nylige Saker",
7373
"notebook_title": "Notatbok Tittel",
7474
"admin_settings": "Admininnstillinger",
7575
"profile": "Profil",
7676
"logout": "Logg Ut",
77-
"unassigned_tickets": "Ikke Tildelte Billetter",
77+
"unassigned_tickets": "Ikke Tildelte Saker",
7878
"profile_desc": "Denne informasjonen vil bli vist offentlig, så vær forsiktig med hva du deler.",
7979
"language": "Språk",
8080
"notifications": "Varsler",
8181
"save_and_reload": "Lagre og Last Inn på Nytt",
8282
"select_a_client": "Velg en Kunde",
8383
"select_an_engineer": "Velg en Ingeniør",
84-
"ticket_create": "Opprett Billett",
84+
"ticket_create": "Opprett Sak",
8585
"internallycommented_at": "Kommentert Internt kl."
8686
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"hello_good": "",
3+
"hello_morning": "Günaydın",
4+
"hello_afternoon": "Tünaydın",
5+
"sl_dashboard": "Özet Tablo",
6+
"sl_tickets": "Destek Biletleri",
7+
"sl_history": "Geçmiş",
8+
"sl_notebook": "Kişisel Not Defteri",
9+
"sl_users": "Kullanıcılar",
10+
"sl_clients": "Müşteriler",
11+
"sl_settings": "Ayarlar",
12+
"open_tickets": "Açık Destek Biletleri",
13+
"completed_tickets": "Tamamlanan Destek Biletleri",
14+
"account_status": "Hesap Durumu",
15+
"todo_list": "Yapılacaklar Listesi",
16+
"personal_files": "Kişisel Dosyalar",
17+
"create_ticket": "Destek Bileti Oluştur",
18+
"ticket_new": "Yeni Destek Bileti",
19+
"ticket_name_here": "İsim",
20+
"ticket_email_here": "E-posta",
21+
"ticket_details": "Başlık",
22+
"ticket_select_client": "Müşteri Seç",
23+
"ticket_select_eng": "Mühendis Seç",
24+
"ticket_extra_details": "Buraya ekstra detayları yazınız... markdown desteklenir",
25+
"cancel": "İptal",
26+
"create": "Oluştur",
27+
"low": "Düşük",
28+
"normal": "Normal",
29+
"high": "Yüksek",
30+
"edit-btn": "Düzenle",
31+
"reset_password": "Parola Sıfırla",
32+
"internal_users": "Dahili Kullanıcılar",
33+
"clients": "Müşteriler",
34+
"new_user": "Yeni Kullanıcı",
35+
"new_client": "Yeni Müşteri",
36+
"previous": "Önceki",
37+
"next": "Sonraki",
38+
"show": "Göster",
39+
"name": "İsim",
40+
"email": "E-posta",
41+
"settings": "Ayarlar",
42+
"webhooks": "Web Kancaları",
43+
"version": "Versiyon",
44+
"v_profile": "Profili Görüntüle",
45+
"reminders": "Hatırlatıcılar",
46+
"title": "Başlık",
47+
"priority": "Öncelik",
48+
"status": "Durum",
49+
"created": "Oluşturuldu",
50+
"assigned_to": "Atanan Kişi",
51+
"enter_todo": "Yapılacak Ekle",
52+
"notebooks": "Not Defterleri",
53+
"notebooks_description": "Bu kişisel bir not defteridir. Burada notları, bağlantıları, kod parçacıklarını vb. kaydedebilirsiniz.",
54+
"create_notebook": "Not Defteri Oluştur",
55+
"open": "Açık",
56+
"assigned_to_me": "Bana Ata",
57+
"unassigned": "Atanmamış",
58+
"closed": "Kapalı",
59+
"description": "Açıklama",
60+
"comments": "Yorumlar",
61+
"leave_comment": "Yorum Yap",
62+
"close_issue": "Bileti Kapat",
63+
"comment": "Yorum",
64+
"save": "Kaydet",
65+
"labels": "Etiketler",
66+
"created_at": "Oluşturulma Tarihi",
67+
"updated_at": "Güncellenme Tarihi",
68+
"hide_ticket": "Destek Biletini Gizli Yap",
69+
"show_ticket": "Destek Biletini Görünür Yap",
70+
"open_issue": "Açık Bilet",
71+
"closed_issue": "Kapalı Bilet",
72+
"recent_tickets": "Son Destek Biletileri",
73+
"notebook_title": "Not Defteri Başlığı",
74+
"admin_settings": "Yönetici Ayarları",
75+
"profile": "Profil",
76+
"logout": "Çıkış Yap",
77+
"unassigned_tickets": "Atanmamış Destek Biletileri",
78+
"profile_desc": "Bu bilgiler herkese açık olarak görüntülenecektir, bu nedenle ne paylaştığınıza dikkat edin.",
79+
"language": "Dil",
80+
"notifications": "Bildirimler",
81+
"save_and_reload": "Kaydet ve Yenile",
82+
"select_a_client": "Bir müşteri seç",
83+
"select_an_engineer": "Bir mühendis seç",
84+
"ticket_create": "Destek Bileti Oluştur",
85+
"internallycommented_at": "Dahili Yorum Yapan"
86+
}

apps/client/pages/admin/email-queues/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default function EmailQueues() {
4848
<div className="sm:flex sm:items-center">
4949
<div className="sm:flex-auto mt-4">
5050
<p className="mt-2 text-sm text-gray-700 dark:text-white">
51-
A list of the mailboxes you are listening too, these will
51+
A list of the mailboxes you are listening to, these will
5252
automatically create tickets and can be accessed down the
5353
side navigation.
5454
</p>

0 commit comments

Comments
 (0)