Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion frontend/src/app/(public-area)/contact/ContactForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export const ContactForm = () => {
};

return success ? (
<SuccessMessage>Message submitted! We&apos;ll be in touch soon.</SuccessMessage>
<SuccessMessage>
Message submitted! We&apos;ll be in touch soon. If you don&apos;t see any emails from us within a few
business days, please be sure to check your spam folder.
</SuccessMessage>
) : (
<>
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ interface CreateIntegrationFormProps {
onSuccess: () => void;
}

const startsWithAwsLogsRegex = /^\/?AWSLogs($|\/)/;
const includesAwsLogsRegex = /(^|\/)AWSLogs($|\/)/;

const CreateIntegrationForm = (props: CreateIntegrationFormProps) => {
const dispatch = useDispatch();

Expand Down Expand Up @@ -122,6 +125,20 @@ const CreateIntegrationForm = (props: CreateIntegrationFormProps) => {
onChange={setS3BucketName}
/>
<TextField disabled={isBusy} label="S3 Key Prefix" value={s3KeyPrefix} onChange={setS3KeyPrefix} />
{s3KeyPrefix &&
(startsWithAwsLogsRegex.test(s3KeyPrefix) ? (
<p className="text-xs text-indian-red">
Cloud Snitch will automatically search for the &quot;AWSLogs&quot; directory in your S3
bucket. This field is only necessary if you have a custom prefix for your CloudTrail
logs. Otherwise, you should leave it empty.
</p>
) : includesAwsLogsRegex.test(s3KeyPrefix) ? (
<p className="text-xs text-indian-red">
Cloud Snitch will automatically search for the &quot;AWSLogs&quot; directory in your S3
bucket. This field should only contain the custom prefix that you specified when
creating the trail, if any.
</p>
) : null)}
Comment on lines +128 to +141
Copy link

Copilot AI May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The nested ternary conditions for rendering warnings make the code harder to read; consider refactoring the conditional logic into a clearer structure or helper functions.

Suggested change
{s3KeyPrefix &&
(startsWithAwsLogsRegex.test(s3KeyPrefix) ? (
<p className="text-xs text-indian-red">
Cloud Snitch will automatically search for the &quot;AWSLogs&quot; directory in your S3
bucket. This field is only necessary if you have a custom prefix for your CloudTrail
logs. Otherwise, you should leave it empty.
</p>
) : includesAwsLogsRegex.test(s3KeyPrefix) ? (
<p className="text-xs text-indian-red">
Cloud Snitch will automatically search for the &quot;AWSLogs&quot; directory in your S3
bucket. This field should only contain the custom prefix that you specified when
creating the trail, if any.
</p>
) : null)}
{getS3KeyPrefixWarning(s3KeyPrefix)}

Copilot uses AI. Check for mistakes.
<Checkbox
disabled={isBusy}
checked={getAccountNamesFromOrganizations}
Expand Down
Loading