Gradual rollout of new compile timeout to existing users (#15478)

* Rollout compile timeout to existing users

* Update copy for compile timeout messages

GitOrigin-RevId: bada02efb3fc506ae6e35bdb7871a58ef4295cbe
This commit is contained in:
Thomas
2023-10-31 09:04:11 +00:00
committed by Copybot
parent 221d16f4e4
commit 3cd0cefd30
7 changed files with 137 additions and 54 deletions
@@ -17,7 +17,7 @@ export const CompileTimeoutChangingSoon: FC<{
}> = ({ isProjectOwner = false, handleDismissChangingSoon }) => {
const { t } = useTranslation()
const compileTimeoutBlogLinks = [
const compileTimeoutChangesBlogLink = (
/* eslint-disable-next-line jsx-a11y/anchor-has-content */
<a
aria-label={t('read_more_about_free_compile_timeouts_servers')}
@@ -26,7 +26,10 @@ export const CompileTimeoutChangingSoon: FC<{
rel="noopener noreferrer"
target="_blank"
onClick={sendInfoClickEvent}
/>,
/>
)
const fixingCompileTimeoutsLearnLink = (
/* eslint-disable-next-line jsx-a11y/anchor-has-content */
<a
aria-label={t('read_more_about_fix_prevent_timeout')}
@@ -34,8 +37,8 @@ export const CompileTimeoutChangingSoon: FC<{
key="compileTimeoutBlogLink2"
target="_blank"
rel="noopener noreferrer"
/>,
]
/>
)
if (isProjectOwner) {
return (
@@ -56,11 +59,14 @@ export const CompileTimeoutChangingSoon: FC<{
<div>
<p>
<Trans
i18nKey="compile_timeout_will_be_reduced_project_exceeds_limit_speed_up_compile"
components={compileTimeoutBlogLinks}
values={{ date: 'October 27 2023' }}
shouldUnescape
tOptions={{ interpolation: { escapeValue: true } }}
i18nKey="compiles_on_our_free_plan_are_now_on_faster_servers"
components={[compileTimeoutChangesBlogLink]}
/>
</p>
<p className="row-spaced">
<Trans
i18nKey="you_may_be_able_to_fix_issues_to_speed_up_the_compile"
components={[fixingCompileTimeoutsLearnLink]}
/>{' '}
<Trans
i18nKey="and_you_can_upgrade_for_plenty_more_compile_time"
@@ -85,11 +91,12 @@ export const CompileTimeoutChangingSoon: FC<{
<div>
<p>
<Trans
i18nKey="compile_timeout_will_be_reduced_project_exceeds_limit_speed_up_compile"
components={compileTimeoutBlogLinks}
values={{ date: 'October 27 2023' }}
shouldUnescape
tOptions={{ interpolation: { escapeValue: true } }}
i18nKey="compiles_on_our_free_plan_are_now_on_faster_servers"
components={[compileTimeoutChangesBlogLink]}
/>{' '}
<Trans
i18nKey="you_may_be_able_to_fix_issues_to_speed_up_the_compile"
components={[fixingCompileTimeoutsLearnLink]}
/>
</p>
<p className="row-spaced">
@@ -42,6 +42,7 @@ function TimeoutUpgradePromptNew() {
compileTimeChanging={compileTimeChanging}
handleEnableStopOnFirstErrorClick={handleEnableStopOnFirstErrorClick}
lastCompileOptions={lastCompileOptions}
isProjectOwner={isProjectOwner}
/>
</>
)
@@ -123,12 +124,14 @@ type PreventTimeoutHelpMessageProps = {
compileTimeChanging?: boolean
lastCompileOptions: any
handleEnableStopOnFirstErrorClick: () => void
isProjectOwner: boolean
}
const PreventTimeoutHelpMessage = memo(function PreventTimeoutHelpMessage({
compileTimeChanging,
lastCompileOptions,
handleEnableStopOnFirstErrorClick,
isProjectOwner,
}: PreventTimeoutHelpMessageProps) {
const { t } = useTranslation()
@@ -139,38 +142,56 @@ const PreventTimeoutHelpMessage = memo(function PreventTimeoutHelpMessage({
})
}
const compileTimeoutChangesBlogLink = (
/* eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-key */
<a
aria-label={t('read_more_about_free_compile_timeouts_servers')}
href="/blog/changes-to-free-compile-timeouts-and-servers"
rel="noopener noreferrer"
target="_blank"
onClick={sendInfoClickEvent}
/>
)
return (
<PdfLogEntry
headerTitle={t('other_ways_to_prevent_compile_timeouts')}
headerTitle={t('reasons_for_compile_timeouts')}
formattedContent={
<>
<p>
{t('you_may_be_able_to_prevent_a_compile_timeout')}
{compileTimeChanging && (
<>
{' '}
<Trans
i18nKey="but_note_that_free_compile_timeout_limit_will_be_reduced_on_x_date"
components={[
// eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-key
<a
aria-label={t(
'read_more_about_free_compile_timeouts_servers'
)}
href="/blog/changes-to-free-compile-timeouts-and-servers"
rel="noopener noreferrer"
target="_blank"
onClick={sendInfoClickEvent}
/>,
]}
values={{ date: 'October 27 2023' }}
shouldUnescape
tOptions={{ interpolation: { escapeValue: true } }}
/>
</>
)}
<em>
{compileTimeChanging ? (
<>
{isProjectOwner ? (
<Trans
i18nKey="were_in_the_process_of_reducing_compile_timeout_which_may_affect_your_project"
components={[compileTimeoutChangesBlogLink]}
/>
) : (
<Trans
i18nKey="were_in_the_process_of_reducing_compile_timeout_which_may_affect_this_project"
components={[compileTimeoutChangesBlogLink]}
/>
)}
</>
) : (
<>
{isProjectOwner ? (
<Trans
i18nKey="weve_recently_reduced_the_compile_timeout_limit_which_may_have_affected_your_project"
components={[compileTimeoutChangesBlogLink]}
/>
) : (
<Trans
i18nKey="weve_recently_reduced_the_compile_timeout_limit_which_may_have_affected_this_project"
components={[compileTimeoutChangesBlogLink]}
/>
)}
</>
)}
</em>
</p>
<p>{t('common_causes_of_compile_timeouts_are')}:</p>
<p>{t('common_causes_of_compile_timeouts_include')}:</p>
<ul>
<li>
<Trans
@@ -233,7 +254,7 @@ const PreventTimeoutHelpMessage = memo(function PreventTimeoutHelpMessage({
</>
}
// @ts-ignore
entryAriaLabel={t('other_ways_to_prevent_compile_timeouts')}
entryAriaLabel={t('reasons_for_compile_timeouts')}
level="raw"
/>
)