Skip to content

Commit 4da34f5

Browse files
authored
Merge pull request #232 from Peppermint-Lab/next
🚀 release
2 parents d449226 + 4deb013 commit 4da34f5

File tree

5 files changed

+204
-24
lines changed

5 files changed

+204
-24
lines changed

apps/api/src/prisma/seed.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ async function main() {
3636

3737
const conf = await prisma.config.create({
3838
data: {
39-
gh_version: "0.3.6",
40-
client_version: "0.3.6",
39+
gh_version: "0.4.2",
40+
client_version: "0.4,2",
4141
portal_locale: "en",
4242
encryption_key: encryptionKey,
4343
},

apps/client/layouts/adminLayout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export default function AdminLayout({ children }: any) {
7676
))}
7777
</nav>
7878
</div>
79+
7980
<div className="flex-1 px-6 xl:w-[800px] ">{children}</div>
8081
</div>
8182
</div>

apps/client/layouts/newLayout.tsx

Lines changed: 151 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Link from "next/link";
1313
import { useRouter } from "next/router";
1414
import { Fragment, useEffect, useState } from "react";
1515

16-
import { ContextMenu } from "@radix-ui/themes";
16+
import { Button, ContextMenu } from "@radix-ui/themes";
1717
import useTranslation from "next-translate/useTranslation";
1818
import { useUser } from "../store/session";
1919

@@ -76,6 +76,39 @@ export default function NewLayout({ children }: any) {
7676
// },
7777
];
7878

79+
const admin_settings = [
80+
{
81+
name: t("sl_users"),
82+
href: "/admin/users/internal",
83+
current: location.pathname === "/admin/users/internal",
84+
},
85+
{
86+
name: t("sl_clients"),
87+
href: "/admin/clients",
88+
current: location.pathname === "/admin/clients",
89+
},
90+
{
91+
name: "Email Queues",
92+
href: "/admin/email-queues",
93+
current: location.pathname === "/admin/email-queues",
94+
},
95+
{
96+
name: "Webhooks",
97+
href: "/admin/webhooks",
98+
current: location.pathname === "/admin/webhooks",
99+
},
100+
{
101+
name: "Outbound Emails",
102+
href: "/admin/email",
103+
current: location.pathname === "/admin/email",
104+
},
105+
{
106+
name: "SSO",
107+
href: "/admin/sso",
108+
current: location.pathname === "/admin/sso",
109+
},
110+
];
111+
79112
// async function getQueues() {
80113
// const res = await fetch(
81114
// `/api/v1/email-queues/all`,
@@ -118,8 +151,8 @@ export default function NewLayout({ children }: any) {
118151
// }, [user]);
119152

120153
// useEffect(() => {
121-
// location.push(`${locale}/${location.pathname}`);
122-
// }, [user, location]);
154+
// getQueues();
155+
// }, [user])
123156

124157
// const handleKeyPress = useCallback((event: any, location: any) => {
125158
// console.log(location);
@@ -260,12 +293,13 @@ export default function NewLayout({ children }: any) {
260293
</Transition.Child>
261294
{/* Sidebar component, swap this element with another sidebar if you like */}
262295
<div className="flex grow flex-col gap-y-5 overflow-y-auto bg-white px-6 pb-4">
263-
<div className="flex h-16 shrink-0 items-center">
264-
<img
265-
className="h-8 w-auto"
266-
src="https://tailwindui.com/img/logos/mark.svg?color=indigo&shade=600"
267-
alt="Your Company"
268-
/>
296+
<div className="flex align-middle flex-row h-14 items-center border-b-[1px]">
297+
{/* <img className="h-8 w-auto" src="/logo.svg" alt="Workflow" /> */}
298+
<Link href="https://peppermint.sh">
299+
<span className="text-3xl ml-2 hover:text-green-600 font-bold ">
300+
Peppermint
301+
</span>
302+
</Link>
269303
</div>
270304
<nav className="flex flex-1 flex-col">
271305
<ul role="list" className="flex flex-1 flex-col gap-y-7">
@@ -295,11 +329,6 @@ export default function NewLayout({ children }: any) {
295329
<span className="whitespace-nowrap">
296330
{item.name}
297331
</span>
298-
<div className="flex w-full justify-end float-right">
299-
<span className="flex h-6 w-6 shrink-0 items-center justify-center rounded-lg border border-gray-700 bg-gray-800 text-[0.625rem] font-medium text-gray-400 group-hover:text-white">
300-
{item.initial}
301-
</span>
302-
</div>
303332
</Link>
304333
</li>
305334
) : (
@@ -363,6 +392,100 @@ export default function NewLayout({ children }: any) {
363392
</ul>
364393
</li>
365394

395+
{user.isAdmin && (
396+
<li>
397+
<span className="mb-2 text-sm font-bold">
398+
Admin Settings
399+
</span>
400+
<ul role="list" className="-mx-2 space-y-1">
401+
{admin_settings.map((item: any) =>
402+
!item.children ? (
403+
<li key={item.name}>
404+
<Link
405+
href={item.href}
406+
className={classNames(
407+
item.current
408+
? "bg-gray-50 text-indigo-600"
409+
: "text-gray-700 hover:text-indigo-600 hover:bg-gray-50",
410+
"group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold"
411+
)}
412+
>
413+
{/* <item.icon
414+
className={classNames(
415+
item.current
416+
? "text-indigo-600"
417+
: "text-gray-400 group-hover:text-indigo-600",
418+
"h-6 w-6 shrink-0"
419+
)}
420+
aria-hidden="true"
421+
/> */}
422+
<span className="whitespace-nowrap">
423+
{item.name}
424+
</span>
425+
</Link>
426+
</li>
427+
) : (
428+
<Disclosure
429+
as="div"
430+
key={item.name}
431+
className="space-y-1"
432+
>
433+
{({ open }) => (
434+
<>
435+
{queues.length > 0 && (
436+
<>
437+
<Disclosure.Button
438+
className={classNames(
439+
item.current
440+
? "bg-green-400 text-white"
441+
: "bg-gray-900 text-white hover:bg-green-400 hover:text-white",
442+
"group w-full flex items-center pl-2 pr-2 py-2 text-left text-sm font-medium rounded-md focus:outline-none"
443+
)}
444+
>
445+
<svg
446+
className={classNames(
447+
open
448+
? "text-white rotate-90"
449+
: "text-white",
450+
"mr-2 flex-shrink-0 h-5 w-5 transform group-hover:text-white transition-colors ease-in-out duration-150"
451+
)}
452+
viewBox="0 0 20 20"
453+
aria-hidden="true"
454+
>
455+
<path
456+
d="M6 6L14 10L6 14V6Z"
457+
fill="currentColor"
458+
/>
459+
</svg>
460+
{item.name}
461+
</Disclosure.Button>
462+
<Disclosure.Panel className="space-y-1">
463+
{item.children.map(
464+
(subItem: any) => (
465+
<Link
466+
href={`/queue/${subItem.name}`}
467+
>
468+
<Disclosure.Button
469+
key={subItem.name}
470+
className="group w-full flex items-center pl-10 pr-2 py-2 text-sm font-medium text-white rounded-md hover:text-white hover:bg-green-400 focus:outline-none"
471+
>
472+
{subItem.name}
473+
</Disclosure.Button>
474+
</Link>
475+
)
476+
)}
477+
</Disclosure.Panel>
478+
</>
479+
)}
480+
</>
481+
)}
482+
</Disclosure>
483+
)
484+
)}
485+
</ul>
486+
</li>
487+
)}
488+
366489
<li className="mt-auto">
367490
<a
368491
href="#"
@@ -569,11 +692,14 @@ export default function NewLayout({ children }: any) {
569692
<div className="sticky top-0 z-10 flex h-14 shrink-0 items-center gap-x-4 border-b border-gray-200 bg-white dark:bg-[#0A090C] px-4 sm:gap-x-6">
570693
<button
571694
type="button"
572-
className="-m-2.5 p-2.5 text-white lg:hidden"
695+
className="-m-2.5 p-2.5 text-black dark:text-white lg:hidden"
573696
onClick={() => setSidebarOpen(true)}
574697
>
575698
<span className="sr-only">Open sidebar</span>
576-
<Bars3Icon className="h-6 w-6 text-white" aria-hidden="true" />
699+
<Bars3Icon
700+
className="h-6 w-6 text-black dark:text-white"
701+
aria-hidden="true"
702+
/>
577703
</button>
578704

579705
{/* Separator */}
@@ -697,6 +823,15 @@ export default function NewLayout({ children }: any) {
697823
</Popover.Panel>
698824
</Popover> */}
699825
{/* Profile dropdown */}
826+
<Link
827+
href="https://github.com/Peppermint-Lab/peppermint/discussions"
828+
target="_blank"
829+
className="hover:cursor-pointer"
830+
>
831+
<Button variant="outline" className="hover:cursor-pointer">
832+
Send Feedback
833+
</Button>
834+
</Link>
700835
<Menu as="div" className="relative">
701836
<Menu.Button className="z-50 flex items-center p-1.5">
702837
<span className="sr-only">Open user menu</span>

apps/client/pages/auth/login.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ export default function Login({}) {
8080
return (
8181
<div className="min-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8">
8282
<div className="sm:mx-auto sm:w-full sm:max-w-md">
83-
<a target="_blank" href="https://peppermint.sh/">
83+
{/* <a target="_blank" href="https://peppermint.sh/">
8484
<img
8585
className="mx-auto h-36 w-auto"
8686
src="/login.svg"
8787
alt="peppermint.sh logo"
8888
/>
89-
</a>
89+
</a> */}
9090
<h2 className="mt-6 text-center text-3xl font-extrabold text-gray-900">
9191
Sign in to your account
9292
</h2>

apps/client/pages/ticket/[id].tsx

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { useQuery } from "react-query";
2020
import renderHTML from "react-render-html";
2121
// import TextAlign from '@tiptap/extension-text-align';
2222
import { notifications } from "@mantine/notifications";
23-
import { Text, Tooltip } from "@radix-ui/themes";
23+
import { Button, DropdownMenu, Text, Tooltip } from "@radix-ui/themes";
2424
import SubScript from "@tiptap/extension-subscript";
2525
import Superscript from "@tiptap/extension-superscript";
2626
import { getCookie } from "cookies-next";
@@ -267,6 +267,10 @@ export default function Ticket() {
267267
fetchUsers();
268268
}, []);
269269

270+
useEffect(() => {
271+
transferTicket();
272+
}, [n]);
273+
270274
useEffect(() => {
271275
if (status === "success") {
272276
if (IssueEditor) {
@@ -332,6 +336,43 @@ export default function Ticket() {
332336
</p>
333337
</div>
334338
<div className="mt-4 flex space-x-3 md:mt-0">
339+
{!edit && (
340+
<DropdownMenu.Root>
341+
<DropdownMenu.Trigger className="hover:cursor-pointer">
342+
<Button variant="outline">Options</Button>
343+
</DropdownMenu.Trigger>
344+
<DropdownMenu.Content className="min-w-[176px] mr-6">
345+
<DropdownMenu.Item
346+
className="min-w-[176px] capitalize hover:cursor-pointer"
347+
onClick={() => setEdit(!edit)}
348+
>
349+
{!edit ? t("edit-btn") : "save"}
350+
</DropdownMenu.Item>
351+
352+
{user.isAdmin && (
353+
<DropdownMenu.Item
354+
className="hover:cursor-pointer"
355+
onClick={() => hide(!data.ticket.hidden)}
356+
>
357+
{data.ticket.hidden
358+
? "Show Global"
359+
: "Hide Ticket"}
360+
</DropdownMenu.Item>
361+
)}
362+
</DropdownMenu.Content>
363+
</DropdownMenu.Root>
364+
)}
365+
{edit && (
366+
<Button
367+
className="hover:cursor-pointer"
368+
variant="outline"
369+
onClick={() => {
370+
update();
371+
setEdit(!edit);
372+
}}
373+
>
374+
save
375+
</Button>
335376
{user.isAdmin && (
336377
<button
337378
type="button"
@@ -412,9 +453,12 @@ export default function Ticket() {
412453
<>
413454
<div className="relative">
414455
<Listbox.Button className="bg-white z-50 relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 px-4 py-1.5 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
415-
<span className="block truncate">
416-
{n ? n.name : t("select_new_user")}
417-
</span>
456+
<span className="block min-w-[75px] text-xs">
457+
{data.ticket.assignedTo
458+
? data.ticket.assignedTo.name
459+
: n
460+
? n.name
461+
: t("select_new_user")}
418462
</Listbox.Button>
419463

420464
<Transition

0 commit comments

Comments
 (0)