Skip to content

Commit

Permalink
final touches of user reg
Browse files Browse the repository at this point in the history
  • Loading branch information
potts99 committed Mar 26, 2024
1 parent e1d0979 commit b8c76f0
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 63 deletions.
32 changes: 18 additions & 14 deletions apps/client/layouts/newLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -963,11 +963,13 @@ export default function NewLayout({ children }: any) {

<div className="flex flex-1 gap-x-4 self-stretch lg:gap-x-6 items-center">
<div className="flex w-full justify-start items-center space-x-6">
<Link href="https://github.com/Peppermint-Lab/peppermint/releases">
<span className="inline-flex items-center rounded-md bg-green-700/10 px-3 py-2 text-xs font-medium text-green-600 ring-1 ring-inset ring-green-500/20">
Version 0.4.5
</span>
</Link>
{user.isAdmin && (
<Link href="https://github.com/Peppermint-Lab/peppermint/releases">
<span className="inline-flex items-center rounded-md bg-green-700/10 px-3 py-2 text-xs font-medium text-green-600 ring-1 ring-inset ring-green-500/20">
Version 0.4.5
</span>
</Link>
)}

<CommandModal />
</div>
Expand Down Expand Up @@ -1064,15 +1066,17 @@ export default function NewLayout({ children }: any) {
</Popover.Panel>
</Popover>

<Link
href="https://github.com/Peppermint-Lab/peppermint/discussions"
target="_blank"
className="hover:cursor-pointer"
>
<Button variant="outline" className="hover:cursor-pointer">
Send Feedback
</Button>
</Link>
{user.isAdmin && (
<Link
href="https://github.com/Peppermint-Lab/peppermint/discussions"
target="_blank"
className="hover:cursor-pointer"
>
<Button variant="outline" className="hover:cursor-pointer">
Send Feedback
</Button>
</Link>
)}

{/* Profile dropdown */}
<Menu as="div" className="relative">
Expand Down
32 changes: 23 additions & 9 deletions apps/client/pages/admin/clients/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,6 @@ export default function Clients() {
>
Delete
</button>
<Link
href={`/portal/${row.original.id}/ticket/new`}
type="button"
className="inline-flex items-center px-2.5 py-1.5 border font-semibold border-gray-300 shadow-sm text-xs rounded text-gray-700 bg-white hover:bg-gray-50 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
>
Portal Url
</Link>
</div>
);
},
Expand All @@ -286,10 +279,31 @@ export default function Clients() {
A list of all internal users of your instance.
</p>
</div>
<div className="sm:ml-16 mt-5 sm:flex-none">
<div className="sm:ml-16 mt-5 flex flex-row space-x-2">
<Link
href={`/submit`}
type="button"
className="inline-flex items-center px-2.5 py-1.5 border font-semibold border-gray-300 shadow-sm text-xs rounded text-gray-700 bg-white hover:bg-gray-50 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
>
Guest Ticket Url
</Link>
<Link
href={`/portal/`}
type="button"
className="inline-flex items-center px-2.5 py-1.5 border font-semibold border-gray-300 shadow-sm text-xs rounded text-gray-700 bg-white hover:bg-gray-50 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
>
Portal Url
</Link>
<Link
href={`/auth/register`}
type="button"
className="inline-flex items-center px-2.5 py-1.5 border font-semibold border-gray-300 shadow-sm text-xs rounded text-gray-700 bg-white hover:bg-gray-50 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
>
Portal Register
</Link>
<Link
href="/admin/clients/new"
className="rounded bg-white px-4 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50"
className="rounded bg-white px-2.5 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50"
>
New Client
</Link>
Expand Down
82 changes: 42 additions & 40 deletions apps/client/pages/ticket/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -918,51 +918,53 @@ export default function Ticket() {
leaveTo="opacity-0"
>
<Listbox.Options className="absolute z-50 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm">
{users.map((user: any) => (
<Listbox.Option
key={user.id}
className={({ active }) =>
classNames(
active
? "text-white bg-indigo-600"
: "text-gray-900",
"cursor-default select-none relative py-2 pl-3 pr-9"
)
}
value={user}
>
{({ n, active }: any) => (
<>
<span
className={classNames(
n
? "font-semibold"
: "font-normal",
"block truncate"
)}
>
{user.name}
</span>

{n ? (
{users
.filter((e) => !e.external_user)
.map((user: any) => (
<Listbox.Option
key={user.id}
className={({ active }) =>
classNames(
active
? "text-white bg-indigo-600"
: "text-gray-900",
"cursor-default select-none relative py-2 pl-3 pr-9"
)
}
value={user}
>
{({ n, active }: any) => (
<>
<span
className={classNames(
active
? "text-white"
: "text-indigo-600",
"absolute inset-y-0 right-0 flex items-center pr-4"
n
? "font-semibold"
: "font-normal",
"block truncate"
)}
>
<CheckIcon
className="h-5 w-5"
aria-hidden="true"
/>
{user.name}
</span>
) : null}
</>
)}
</Listbox.Option>
))}

{n ? (
<span
className={classNames(
active
? "text-white"
: "text-indigo-600",
"absolute inset-y-0 right-0 flex items-center pr-4"
)}
>
<CheckIcon
className="h-5 w-5"
aria-hidden="true"
/>
</span>
) : null}
</>
)}
</Listbox.Option>
))}
</Listbox.Options>
</Transition>
</div>
Expand Down

0 comments on commit b8c76f0

Please sign in to comment.