Skip to content

Commit

Permalink
Merge branch 'upstream/develop' into feat/1092-update-color-and-box-s…
Browse files Browse the repository at this point in the history
…hadows
  • Loading branch information
umrkhn committed Nov 23, 2023
2 parents c1acdaf + 842bfa8 commit 436fc2f
Show file tree
Hide file tree
Showing 19 changed files with 609 additions and 618 deletions.
285 changes: 146 additions & 139 deletions dashboard/components/feedback-widget/FeedbackWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,149 +161,156 @@ const useFeedbackWidget = (defaultState: boolean = false) => {
id={FEEDBACK_MODAL_ID}
>
<div className="w-[546px]">
<h3 className="text-lg font-bold text-gray-950">
Describe your issue
</h3>
<p className="text-base text-gray-700">
By providing details of the issue you’ve encountered and outlining
the steps to reproduce it, we’ll be able to give you better
support.
</p>
<form onSubmit={uploadFeedback} className="mt-4">
<Input
disabled={isSendingFeedback}
type="email"
label="Your email"
name="email"
action={change => {
updateEmail(change.email);
}}
value={email}
required
/>
<textarea
disabled={isSendingFeedback}
rows={13}
placeholder={textAreaPlaceholder}
className="peer mt-4 w-full rounded bg-white px-4 pb-[0.75rem] pt-[1.75rem] text-sm text-gray-950 caret-darkcyan-500 outline outline-[0.063rem] outline-gray-300 focus:outline-[0.12rem] focus:outline-darkcyan-500"
onChange={event => updateDescription(event?.target?.value)}
value={description}
required
/>
<div className="mt-4 h-[96px] max-h-[96px] w-full">
<div className="flex h-full basis-1/2 items-stretch justify-stretch gap-2">
{fileAttachement === null && (
<>
<div
onClick={() => takeScreenshot()}
className="flex-1 grow cursor-pointer rounded border-2 border-gray-200 py-5 text-center text-xs transition hover:border-[#B6EAEA] hover:bg-gray-50"
>
<svg
className="mb-2 inline-block"
width="25"
height="24"
viewBox="0 0 25 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
<div className="fixed left-0 top-0 border-b border-gray-200 p-8">
<h3 className="text-lg font-bold text-gray-950">
Describe your issue
</h3>
<p className="text-base text-gray-700">
By providing details of the issue you’ve encountered and
outlining the steps to reproduce it, we’ll be able to give you
better support.
</p>
</div>
<div className="mt-[130px] h-[420px] overflow-y-auto overflow-x-hidden pb-[10px] pl-[16px] pr-[16px] pt-[1px]">
<form onSubmit={uploadFeedback}>
<Input
disabled={isSendingFeedback}
type="email"
label="Your email"
name="email"
action={change => {
updateEmail(change.email);
}}
value={email}
required
/>
<textarea
disabled={isSendingFeedback}
rows={13}
placeholder={textAreaPlaceholder}
className="peer mt-4 w-full rounded bg-white px-4 pb-[0.75rem] pt-[1.75rem] text-sm text-gray-950 caret-darkcyan-500 outline outline-[0.063rem] outline-gray-300 focus:outline-[0.12rem] focus:outline-darkcyan-500"
onChange={event => updateDescription(event?.target?.value)}
value={description}
required
/>
<div className="mt-4 h-[96px] max-h-[96px] w-full">
<div className="flex h-full basis-1/2 items-stretch justify-stretch gap-2">
{fileAttachement === null && (
<>
<div
onClick={() => takeScreenshot()}
className="flex-1 grow cursor-pointer rounded border-2 border-gray-200 py-5 text-center text-xs transition hover:border-[#B6EAEA] hover:bg-gray-50"
>
<path
d="M2.25 9V6.5C2.25 4.01 4.26 2 6.75 2H9.25"
stroke="#0C1717"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M15.25 2H17.75C20.24 2 22.25 4.01 22.25 6.5V9"
stroke="#0C1717"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M22.25 16V17.5C22.25 19.99 20.24 22 17.75 22H16.25"
stroke="#0C1717"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M9.25 22H6.75C4.26 22 2.25 19.99 2.25 17.5V15"
stroke="#0C1717"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>

<p>
{isTakingScreenCapture
? 'Taking screencapture...'
: 'Capture current screen'}
</p>
</div>
<span className="self-center justify-self-center text-sm text-gray-700">
or
</span>
</>
)}
<div className="flex-1 grow">
<Upload
multiple={false}
fileOrFiles={fileAttachement}
handleChange={uploadFile}
onClose={() => setFileAttachement(null)}
disabled={
fileAttachement !== null ||
isSendingFeedback ||
isTakingScreenCapture
}
onTypeError={(err: string) =>
showToast({
hasError: true,
title: 'File upload failed',
message: err
})
}
onSizeError={(err: string) =>
showToast({
hasError: true,
title: 'File upload failed',
message: err
})
}
/>
<svg
className="mb-2 inline-block"
width="25"
height="24"
viewBox="0 0 25 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M2.25 9V6.5C2.25 4.01 4.26 2 6.75 2H9.25"
stroke="#0C1717"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M15.25 2H17.75C20.24 2 22.25 4.01 22.25 6.5V9"
stroke="#0C1717"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M22.25 16V17.5C22.25 19.99 20.24 22 17.75 22H16.25"
stroke="#0C1717"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M9.25 22H6.75C4.26 22 2.25 19.99 2.25 17.5V15"
stroke="#0C1717"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
<p>
{isTakingScreenCapture
? 'Taking screencapture...'
: 'Capture current screen'}
</p>
</div>
<span className="self-center justify-self-center text-sm text-gray-700">
or
</span>
</>
)}
<div className="flex-1 grow">
<Upload
multiple={false}
fileOrFiles={fileAttachement}
handleChange={uploadFile}
onClose={() => setFileAttachement(null)}
disabled={
fileAttachement !== null ||
isSendingFeedback ||
isTakingScreenCapture
}
onTypeError={(err: string) =>
showToast({
hasError: true,
title: 'File upload failed',
message: err
})
}
onSizeError={(err: string) =>
showToast({
hasError: true,
title: 'File upload failed',
message: err
})
}
/>
</div>
</div>
</div>
</div>
<div className="mt-4 flex justify-between">
<p className="text-xs text-gray-700">
Need in depth assistance?
<br />
Email us at{' '}
<a
href="mailto:[email protected]"
className="text-darkcyan-500"
>
[email protected]
</a>
.
</p>
<div className="flex gap-2">
<Button
size="xs"
disabled={isSendingFeedback}
style="ghost"
onClick={() => closeFeedbackModal()}
>
Cancel
</Button>
<Button type="submit" size="xs" disabled={isSendingFeedback}>
{isSendingFeedback ? `Sending...` : `Send Feedback`}
</Button>
<div className="mt-4 flex justify-between">
<p className="text-xs text-gray-700">
Need in depth assistance?
<br />
Email us at{' '}
<a
href="mailto:[email protected]"
className="text-darkcyan-500"
>
[email protected]
</a>
.
</p>
<div className="flex gap-2">
<Button
size="xs"
disabled={isSendingFeedback}
style="ghost"
onClick={() => closeFeedbackModal()}
>
Cancel
</Button>
<Button
type="submit"
size="xs"
disabled={isSendingFeedback}
>
{isSendingFeedback ? `Sending...` : `Send Feedback`}
</Button>
</div>
</div>
</div>
</form>
</form>
</div>
</div>
</Modal>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,16 @@ function getCustomViewInventoryListAndStats({
}
}
});
} else {
setTimeout(() => router.push(router.pathname), 5000);
return showToast({
hasError: true,
title: `Invalid view`,
message: `We couldn't find this view. Redirecting back to home...`
});
}
}
// TODO: https://github.com/tailwarden/komiser/issues/1208
// else {
// setTimeout(() => router.push(router.pathname), 5000);
// return showToast({
// hasError: true,
// title: `Invalid view`,
// message: `We couldn't find this view. Redirecting back to home...`
// });
// }
}
return null;
}
Expand Down
Loading

0 comments on commit 436fc2f

Please sign in to comment.