added durations to configuration file

This commit is contained in:
Wyatt Johnson
2018-05-03 11:36:34 -06:00
parent 8caf995517
commit 06b08756e7
6 changed files with 34 additions and 16 deletions
@@ -6,6 +6,7 @@ import moment from 'moment';
import { Button, Icon } from 'plugin-api/beta/client/components/ui';
import styles from './AccountDeletionRequestedSign.css';
import { getErrorMessages } from 'coral-framework/utils';
import { scheduledDeletionDelayHours } from '../../config.json';
class AccountDeletionRequestedSign extends React.Component {
cancelAccountDeletion = async () => {
@@ -25,7 +26,7 @@ class AccountDeletionRequestedSign extends React.Component {
'MMM Do YYYY, h:mm a'
);
const deletionScheduledOn = moment(scheduledDeletionDate)
.subtract(24, 'hours')
.subtract(scheduledDeletionDelayHours, 'hours')
.format('MMM Do YYYY, h:mm a');
return (
@@ -4,16 +4,17 @@ import cn from 'classnames';
import { Button } from 'plugin-api/beta/client/components/ui';
import styles from './DeleteMyAccountStep.css';
import { t } from 'plugin-api/beta/client/services';
import { scheduledDeletionDelayHours } from '../../config.json';
const DeleteMyAccountStep1 = props => (
<div className={styles.step}>
<h4 className={styles.subTitle}>{t('delete_request.step_1.subtitle')}</h4>
<p className={styles.description}>
{t('delete_request.step_1.description')}
{t('delete_request.step_1.description', scheduledDeletionDelayHours)}
</p>
<h4 className={styles.subTitle}>{t('delete_request.step_1.subtitle_2')}</h4>
<p className={styles.description}>
{t('delete_request.step_1.description_2')}
{t('delete_request.step_1.description_2', scheduledDeletionDelayHours)}
</p>
<div className={cn(styles.actions)}>
<Button
@@ -4,6 +4,7 @@ import { t } from 'plugin-api/beta/client/services';
import { Button } from 'plugin-api/beta/client/components/ui';
import styles from './DownloadCommentHistory.css';
import { getErrorMessages } from 'coral-framework/utils';
import { downloadRateLimitDays } from '../../config.json';
export const readableDuration = durAsHours => {
const durAsDays = Math.ceil(durAsHours / 24);
@@ -42,7 +43,8 @@ class DownloadCommentHistory extends Component {
lastAccountDownload && new Date(lastAccountDownload);
const hoursLeft = lastAccountDownloadDate
? Math.ceil(
7 * 24 - (now.getTime() - lastAccountDownloadDate.getTime()) / 3.6e6
downloadRateLimitDays * 24 -
(now.getTime() - lastAccountDownloadDate.getTime()) / 3.6e6
)
: 0;
const canRequestDownload = !lastAccountDownloadDate || hoursLeft <= 0;
@@ -52,7 +54,7 @@ class DownloadCommentHistory extends Component {
<h3>{t('download_request.section_title')}</h3>
<p>
{t('download_request.you_will_get_a_copy')}{' '}
<b>{t('download_request.download_rate')}</b>.
<b>{t('download_request.download_rate', downloadRateLimitDays)}</b>.
</p>
{lastAccountDownloadDate && (
<p className={styles.most_recent}>
@@ -2,7 +2,7 @@ en:
download_request:
section_title: "Download My Comment History"
you_will_get_a_copy: "You will recieve an email with a link to download your comment history. You can make"
download_rate: "one download request every 7 days"
download_rate: "one download request every {0} days"
most_recent_request: "Your most recent request"
request: "Request Comment History"
rate_limit: "You can submit another Comment History request in {0}"
@@ -38,9 +38,9 @@ en:
item_3: "Your username and email address are removed from our system"
step_1:
subtitle: "When will my account be deleted?"
description: "Your account will be deleted 24 hours after your request has been submitted."
description: "Your account will be deleted {0} hours after your request has been submitted."
subtitle_2: "Can I still write comments until my account is deleted?"
description_2: "Yes, you can still comment, reply, and react to comments until the 24 hours expires."
description_2: "Yes, you can still comment, reply, and react to comments until the {0} hours expires."
step_2:
description: "Before your account is deleted, we recommend you download your comment history for your records. After your account is deleted, you will be unable to request your comment history."
to_download: "To download your comment history go to:"