mirror of
https://github.com/wassname/talk.git
synced 2026-07-02 21:57:13 +08:00
translations
This commit is contained in:
@@ -57,7 +57,7 @@ class OrganizationSettings extends React.Component {
|
||||
}
|
||||
|
||||
const updater = { organizationContactEmail: { $set: email } };
|
||||
const errorUpdater = { organizationEmail: { $set: error } };
|
||||
const errorUpdater = { organizationContactEmail: { $set: error } };
|
||||
|
||||
this.props.updatePending({ updater, errorUpdater });
|
||||
};
|
||||
|
||||
@@ -12,10 +12,7 @@ class AccountDeletionRequestedSign extends React.Component {
|
||||
const { cancelAccountDeletion, notify } = this.props;
|
||||
try {
|
||||
await cancelAccountDeletion();
|
||||
notify(
|
||||
'success',
|
||||
t('talk-plugin-profile-data.delete_request.account_deletion_cancelled')
|
||||
);
|
||||
notify('success', t('delete_request.account_deletion_cancelled'));
|
||||
} catch (err) {
|
||||
notify('error', getErrorMessages(err));
|
||||
}
|
||||
@@ -25,32 +22,27 @@ class AccountDeletionRequestedSign extends React.Component {
|
||||
const { me: { scheduledDeletionDate } } = this.props.root;
|
||||
|
||||
const deletionScheduledFor = moment(scheduledDeletionDate).format(
|
||||
'MMM Do YYYY, h:mm:ss a'
|
||||
'MMM Do YYYY, h:mm a'
|
||||
);
|
||||
const deletionScheduledOn = moment(scheduledDeletionDate)
|
||||
.subtract(12, 'hours')
|
||||
.format('MMM Do YYYY, h:mm:ss a');
|
||||
.subtract(24, 'hours')
|
||||
.format('MMM Do YYYY, h:mm a');
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<h4 className={styles.title}>
|
||||
<Icon name="warning" className={styles.icon} />{' '}
|
||||
{t(
|
||||
'talk-plugin-profile-data.delete_request.account_deletion_requested'
|
||||
)}
|
||||
{t('delete_request.account_deletion_requested')}
|
||||
</h4>
|
||||
<p className={styles.description}>
|
||||
{t('talk-plugin-profile-data.delete_request.received_on')}
|
||||
{t('delete_request.received_on')}
|
||||
{deletionScheduledFor}.
|
||||
</p>
|
||||
<p className={styles.description}>
|
||||
{t(
|
||||
'talk-plugin-profile-data.delete_request.cancel_request_description'
|
||||
)}
|
||||
{t('delete_request.cancel_request_description')}
|
||||
<b>
|
||||
{' '}
|
||||
{t('talk-plugin-profile-data.delete_request.before')}{' '}
|
||||
{deletionScheduledOn}
|
||||
{t('delete_request.before')} {deletionScheduledOn}
|
||||
</b>.
|
||||
</p>
|
||||
<div className={styles.actions}>
|
||||
@@ -58,9 +50,7 @@ class AccountDeletionRequestedSign extends React.Component {
|
||||
className={cn(styles.button, styles.secondary)}
|
||||
onClick={this.cancelAccountDeletion}
|
||||
>
|
||||
{t(
|
||||
'talk-plugin-profile-data.delete_request.cancel_account_deletion_request'
|
||||
)}
|
||||
{t('delete_request.cancel_account_deletion_request')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -29,10 +29,7 @@ class DeleteMyAccount extends React.Component {
|
||||
const { cancelAccountDeletion, notify } = this.props;
|
||||
try {
|
||||
await cancelAccountDeletion();
|
||||
notify(
|
||||
'success',
|
||||
t('talk-plugin-profile-data.delete_request.account_deletion_requested')
|
||||
);
|
||||
notify('success', t('delete_request.account_deletion_requested'));
|
||||
} catch (err) {
|
||||
notify('error', getErrorMessages(err));
|
||||
}
|
||||
@@ -42,23 +39,25 @@ class DeleteMyAccount extends React.Component {
|
||||
const { requestAccountDeletion, notify } = this.props;
|
||||
try {
|
||||
await requestAccountDeletion();
|
||||
notify(
|
||||
'success',
|
||||
t('talk-plugin-profile-data.delete_request.account_deletion_requested')
|
||||
);
|
||||
notify('success', t('delete_request.account_deletion_requested'));
|
||||
} catch (err) {
|
||||
notify('error', getErrorMessages(err));
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { me: { scheduledDeletionDate } } = this.props.root;
|
||||
const {
|
||||
me: { scheduledDeletionDate },
|
||||
settings: { organizationContactEmail },
|
||||
} = this.props.root;
|
||||
return (
|
||||
<div className="talk-plugin-auth--delete-my-account">
|
||||
<DeleteMyAccountDialog
|
||||
requestAccountDeletion={this.requestAccountDeletion}
|
||||
showDialog={this.state.showDialog}
|
||||
closeDialog={this.closeDialog}
|
||||
scheduledDeletionDate={scheduledDeletionDate}
|
||||
organizationContactEmail={organizationContactEmail}
|
||||
/>
|
||||
<h3
|
||||
className={cn(
|
||||
@@ -66,7 +65,7 @@ class DeleteMyAccount extends React.Component {
|
||||
'talk-plugin-auth--delete-my-account-description'
|
||||
)}
|
||||
>
|
||||
{t('talk-plugin-profile-data.delete_request.delete_my_account')}
|
||||
{t('delete_request.delete_my_account')}
|
||||
</h3>
|
||||
<p
|
||||
className={cn(
|
||||
@@ -74,9 +73,7 @@ class DeleteMyAccount extends React.Component {
|
||||
'talk-plugin-auth--delete-my-account-description'
|
||||
)}
|
||||
>
|
||||
{t(
|
||||
'talk-plugin-profile-data.delete_request.delete_my_account_description'
|
||||
)}
|
||||
{t('delete_request.delete_my_account_description')}
|
||||
</p>
|
||||
<p
|
||||
className={cn(
|
||||
@@ -86,7 +83,7 @@ class DeleteMyAccount extends React.Component {
|
||||
>
|
||||
{scheduledDeletionDate &&
|
||||
t(
|
||||
'talk-plugin-profile-data.delete_request.already_submitted_request_description',
|
||||
'delete_request.already_submitted_request_description',
|
||||
moment(scheduledDeletionDate).format('MMM Do YYYY, h:mm:ss a')
|
||||
)}
|
||||
</p>
|
||||
@@ -95,9 +92,7 @@ class DeleteMyAccount extends React.Component {
|
||||
className={cn(styles.button, styles.secondary)}
|
||||
onClick={this.cancelAccountDeletion}
|
||||
>
|
||||
{t(
|
||||
'talk-plugin-profile-data.delete_request.cancel_account_deletion_request'
|
||||
)}
|
||||
{t('delete_request.cancel_account_deletion_request')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
@@ -105,7 +100,7 @@ class DeleteMyAccount extends React.Component {
|
||||
icon="delete"
|
||||
onClick={this.showDialog}
|
||||
>
|
||||
{t('talk-plugin-profile-data.delete_request.delete_my_account')}
|
||||
{t('delete_request.delete_my_account')}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -43,13 +43,15 @@ class DeleteMyAccountDialog extends React.Component {
|
||||
|
||||
render() {
|
||||
const { step } = this.state;
|
||||
const { scheduledDeletionDate, organizationContactEmail } = this.props;
|
||||
|
||||
return (
|
||||
<Dialog open={this.props.showDialog} className={styles.dialog}>
|
||||
<span className={styles.close} onClick={this.cancel}>
|
||||
×
|
||||
</span>
|
||||
<h3 className={styles.title}>
|
||||
{t('talk-plugin-profile-data.delete_request.delete_my_account')}
|
||||
{t('delete_request.delete_my_account')}
|
||||
</h3>
|
||||
<StepProgress currentStep={this.state.step} totalSteps={4} />
|
||||
{step === 0 && (
|
||||
@@ -79,7 +81,13 @@ class DeleteMyAccountDialog extends React.Component {
|
||||
onChange={this.onChange}
|
||||
/>
|
||||
)}
|
||||
{step === 4 && <DeleteMyAccountFinalStep finish={this.cancel} />}
|
||||
{step === 4 && (
|
||||
<DeleteMyAccountFinalStep
|
||||
scheduledDeletionDate={scheduledDeletionDate}
|
||||
organizationContactEmail={organizationContactEmail}
|
||||
finish={this.cancel}
|
||||
/>
|
||||
)}
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
@@ -89,6 +97,8 @@ DeleteMyAccountDialog.propTypes = {
|
||||
showDialog: PropTypes.bool.isRequired,
|
||||
closeDialog: PropTypes.func.isRequired,
|
||||
requestAccountDeletion: PropTypes.func.isRequired,
|
||||
scheduledDeletionDate: PropTypes.any.isRequired,
|
||||
organizationContactEmail: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
export default DeleteMyAccountDialog;
|
||||
|
||||
@@ -4,44 +4,39 @@ import PropTypes from 'prop-types';
|
||||
import { Button, Icon } from 'plugin-api/beta/client/components/ui';
|
||||
import styles from './DeleteMyAccountStep.css';
|
||||
import { t } from 'plugin-api/beta/client/services';
|
||||
import moment from 'moment';
|
||||
|
||||
const DeleteMyAccountFinalStep = props => (
|
||||
<div className={styles.step}>
|
||||
<p className={styles.description}>
|
||||
{t(
|
||||
'talk-plugin-profile-data.delete_request.your_request_submitted_description'
|
||||
)}
|
||||
{t('delete_request.your_request_submitted_description')}
|
||||
</p>
|
||||
|
||||
<div className={cn(styles.box, styles.scheduledDeletion)}>
|
||||
<strong className={styles.block}>
|
||||
{t(
|
||||
'talk-plugin-profile-data.delete_request.your_account_deletion_scheduled'
|
||||
)}
|
||||
{t('delete_request.your_account_deletion_scheduled')}
|
||||
</strong>
|
||||
<strong className={styles.block}>
|
||||
<Icon name="access_time" className={styles.timeIcon} />
|
||||
<span>{0}</span>
|
||||
<span>
|
||||
{moment(props.scheduledDeletionDate).format('MMM Do YYYY, h:mm a')}
|
||||
</span>
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
<p className={styles.description}>
|
||||
<strong>
|
||||
{' '}
|
||||
{t('talk-plugin-profile-data.delete_request.changed_your_mind')}
|
||||
</strong>{' '}
|
||||
{t('talk-plugin-profile-data.delete_request.simply_go_to')} “<strong>
|
||||
{t(
|
||||
'talk-plugin-profile-data.delete_request.cancel_account_deletion_request'
|
||||
)}.
|
||||
<strong> {t('delete_request.changed_your_mind')}</strong>{' '}
|
||||
{t('delete_request.simply_go_to')} “<strong>
|
||||
{t('delete_request.cancel_account_deletion_request')}.
|
||||
</strong>”
|
||||
</p>
|
||||
|
||||
<p className={styles.description}>
|
||||
<strong>
|
||||
{t('talk-plugin-profile-data.delete_request.tell_us_why')}.
|
||||
</strong>{' '}
|
||||
{t('talk-plugin-profile-data.delete_request.feedback_copy')}
|
||||
<strong>{t('delete_request.tell_us_why')}.</strong>{' '}
|
||||
{t('delete_request.feedback_copy')}
|
||||
<a href={`mailto:${props.organizationContactEmail}`}>
|
||||
{props.organizationContactEmail}
|
||||
</a>.
|
||||
</p>
|
||||
|
||||
<div className={cn(styles.actions, styles.columnView)}>
|
||||
@@ -50,7 +45,7 @@ const DeleteMyAccountFinalStep = props => (
|
||||
onClick={props.finish}
|
||||
full
|
||||
>
|
||||
{t('talk-plugin-profile-data.delete_request.done')}
|
||||
{t('delete_request.done')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -58,6 +53,8 @@ const DeleteMyAccountFinalStep = props => (
|
||||
|
||||
DeleteMyAccountFinalStep.propTypes = {
|
||||
finish: PropTypes.func.isRequired,
|
||||
scheduledDeletionDate: PropTypes.any.isRequired,
|
||||
organizationContactEmail: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
export default DeleteMyAccountFinalStep;
|
||||
|
||||
@@ -8,26 +8,20 @@ import { t } from 'plugin-api/beta/client/services';
|
||||
const DeleteMyAccountStep0 = props => (
|
||||
<div className={styles.step}>
|
||||
<p className={styles.description}>
|
||||
{t('talk-plugin-profile-data.delete_request.you_are_attempting')}
|
||||
{t('delete_request.step_0.you_are_attempting')}
|
||||
</p>
|
||||
<ul className={styles.list}>
|
||||
<li className={styles.item}>
|
||||
<Icon name="done" className={styles.itemIcon} />
|
||||
<span className={styles.text}>
|
||||
{t('talk-plugin-profile-data.delete_request.item_1')}
|
||||
</span>
|
||||
<span className={styles.text}>{t('delete_request.step_0.item_1')}</span>
|
||||
</li>
|
||||
<li className={styles.item}>
|
||||
<Icon name="done" className={styles.itemIcon} />
|
||||
<span className={styles.text}>
|
||||
{t('talk-plugin-profile-data.delete_request.item_2')}
|
||||
</span>
|
||||
<span className={styles.text}>{t('delete_request.step_0.item_2')}</span>
|
||||
</li>
|
||||
<li className={styles.item}>
|
||||
<Icon name="done" className={styles.itemIcon} />
|
||||
<span className={styles.text}>
|
||||
{t('talk-plugin-profile-data.delete_request.item_3')}
|
||||
</span>
|
||||
<span className={styles.text}>{t('delete_request.step_0.item_3')}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<div className={cn(styles.actions)}>
|
||||
@@ -35,13 +29,13 @@ const DeleteMyAccountStep0 = props => (
|
||||
className={cn(styles.button, styles.cancel)}
|
||||
onClick={props.cancel}
|
||||
>
|
||||
{t('talk-plugin-profile-data.delete_request.cancel')}
|
||||
{t('delete_request.cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
className={cn(styles.button, styles.proceed)}
|
||||
onClick={props.goToNextStep}
|
||||
>
|
||||
{t('talk-plugin-profile-data.delete_request.proceed')}
|
||||
{t('delete_request.proceed')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,30 +7,26 @@ import { t } from 'plugin-api/beta/client/services';
|
||||
|
||||
const DeleteMyAccountStep1 = props => (
|
||||
<div className={styles.step}>
|
||||
<h4 className={styles.subTitle}>
|
||||
{t('talk-plugin-profile-data.delete_request.step1.subtitle')}
|
||||
</h4>
|
||||
<h4 className={styles.subTitle}>{t('delete_request.step_1.subtitle')}</h4>
|
||||
<p className={styles.description}>
|
||||
{t('talk-plugin-profile-data.delete_request.step1.description')}
|
||||
{t('delete_request.step_1.description')}
|
||||
</p>
|
||||
<h4 className={styles.subTitle}>
|
||||
{t('talk-plugin-profile-data.delete_request.step1.subtitle_2')}
|
||||
</h4>
|
||||
<h4 className={styles.subTitle}>{t('delete_request.step_1.subtitle_2')}</h4>
|
||||
<p className={styles.description}>
|
||||
{t('talk-plugin-profile-data.delete_request.step1.description_2')}
|
||||
{t('delete_request.step_1.description_2')}
|
||||
</p>
|
||||
<div className={cn(styles.actions)}>
|
||||
<Button
|
||||
className={cn(styles.button, styles.cancel)}
|
||||
onClick={props.cancel}
|
||||
>
|
||||
{t('talk-plugin-profile-data.delete_request.cancel')}
|
||||
{t('delete_request.cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
className={cn(styles.button, styles.proceed)}
|
||||
onClick={props.goToNextStep}
|
||||
>
|
||||
{t('talk-plugin-profile-data.delete_request.proceed')}
|
||||
{t('delete_request.proceed')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,12 +8,12 @@ import { t } from 'plugin-api/beta/client/services';
|
||||
const DeleteMyAccountStep2 = props => (
|
||||
<div className={styles.step}>
|
||||
<p className={styles.description}>
|
||||
{t('talk-plugin-profile-data.delete_request.step2.description')}
|
||||
{t('delete_request.step_2.description')}
|
||||
</p>
|
||||
<p className={styles.description}>
|
||||
{t('talk-plugin-profile-data.delete_request.step2.to_download')}
|
||||
{t('delete_request.step_2.to_download')}
|
||||
<strong className={styles.block}>
|
||||
{t('talk-plugin-profile-data.delete_request.step2.path')}
|
||||
{t('delete_request.step_2.path')}
|
||||
</strong>
|
||||
</p>
|
||||
<div className={cn(styles.actions)}>
|
||||
@@ -21,13 +21,13 @@ const DeleteMyAccountStep2 = props => (
|
||||
className={cn(styles.button, styles.cancel)}
|
||||
onClick={props.cancel}
|
||||
>
|
||||
{t('talk-plugin-profile-data.delete_request.step2.cancel')}
|
||||
{t('delete_request.cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
className={cn(styles.button, styles.proceed)}
|
||||
onClick={props.goToNextStep}
|
||||
>
|
||||
{t('talk-plugin-profile-data.delete_request.step2.proceed')}
|
||||
{t('delete_request.proceed')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -43,10 +43,10 @@ class DeleteMyAccountStep3 extends React.Component {
|
||||
return (
|
||||
<div className={styles.step}>
|
||||
<h4 className={styles.subTitle}>
|
||||
{t('talk-plugin-profile-data.delete_request.step3.subtitle')}
|
||||
{t('delete_request.step_3.subtitle')}
|
||||
</h4>
|
||||
<p className={styles.description}>
|
||||
{t('talk-plugin-profile-data.delete_request.step3.description')}
|
||||
{t('delete_request.step_3.description')}
|
||||
</p>
|
||||
<input
|
||||
className={styles.textBox}
|
||||
@@ -56,17 +56,13 @@ class DeleteMyAccountStep3 extends React.Component {
|
||||
/>
|
||||
<InputField
|
||||
id="confirmPhrase"
|
||||
label={t(
|
||||
'talk-plugin-profile-data.delete_request.step3.type_to_confirm'
|
||||
)}
|
||||
label={t('delete_request.step_3.type_to_confirm')}
|
||||
name="confirmPhrase"
|
||||
type="text"
|
||||
onChange={this.props.onChange}
|
||||
defaultValue=""
|
||||
hasError={this.formHasError()}
|
||||
errorMsg={t(
|
||||
'talk-plugin-profile-data.delete_request.input_is_not_correct'
|
||||
)}
|
||||
errorMsg={t('delete_request.input_is_not_correct')}
|
||||
showError={this.state.showError}
|
||||
columnDisplay
|
||||
/>
|
||||
@@ -75,13 +71,13 @@ class DeleteMyAccountStep3 extends React.Component {
|
||||
className={cn(styles.button, styles.cancel)}
|
||||
onClick={this.props.cancel}
|
||||
>
|
||||
{t('talk-plugin-profile-data.delete_request.cancel')}
|
||||
{t('delete_request.cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
className={cn(styles.button, styles.danger)}
|
||||
onClick={this.deleteAndContinue}
|
||||
>
|
||||
{t('talk-plugin-profile-data.delete_request.delete_my_account')}
|
||||
{t('delete_request.delete_my_account')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,9 @@ const withData = withFragments({
|
||||
me {
|
||||
scheduledDeletionDate
|
||||
}
|
||||
settings {
|
||||
organizationContactEmail
|
||||
}
|
||||
}
|
||||
`,
|
||||
});
|
||||
|
||||
@@ -46,7 +46,7 @@ export const withRequestAccountDeletion = withMutation(
|
||||
});
|
||||
|
||||
const scheduledDeletionDate = moment()
|
||||
.add(12, 'hours')
|
||||
.add(24, 'hours')
|
||||
.toDate();
|
||||
|
||||
const data = update(prev, {
|
||||
|
||||
@@ -26,25 +26,26 @@ en:
|
||||
changed_your_mind: "Changed your mind?"
|
||||
simply_go_to: "Simply go to your account again before this time and click"
|
||||
tell_us_why: "Tell us why"
|
||||
feedback_copy: "We'd like to know why you chose to delete your account. Send us feedback on our comment system by emailing."
|
||||
feedback_copy: "We would like to know why you chose to delete your account. Send us feedback on our comment system by emailing"
|
||||
done: "Done"
|
||||
cancel: "Cancel"
|
||||
proceed: "Proceed"
|
||||
input_is_not_correct: "The input is not correct"
|
||||
you_are_attempting: "You are attempting to delete your account. This means:"
|
||||
item_1: "All of your comments are removed from this site"
|
||||
item_2: "All of your comments are deleted from our database"
|
||||
item_3: "Your username and email address are removed from our system"
|
||||
step1:
|
||||
step_0:
|
||||
you_are_attempting: "You are attempting to delete your account. This means:"
|
||||
item_1: "All of your comments are removed from this site"
|
||||
item_2: "All of your comments are deleted from our database"
|
||||
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."
|
||||
subtitle_2: "Can I still write comments until my account is deleted?"
|
||||
description_2: "No. Once you have requested account deletion, you can no longer write comments, reply to comments, or select reactions."
|
||||
step2:
|
||||
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:"
|
||||
path: "My Profile > Download My Comment History"
|
||||
step3:
|
||||
step_3:
|
||||
subtitle: "Are you sure you want to delete your account?"
|
||||
description: "To confirm you would like to delete your account please type in the following phrase into the text box below:"
|
||||
type_to_confirm: "Type phrase below to confirm"
|
||||
|
||||
@@ -93,16 +93,16 @@ async function sendDownloadLink(ctx) {
|
||||
}
|
||||
|
||||
// requestDeletion will schedule the current user to have their account deleted
|
||||
// by setting the `scheduledDeletionDate` on the user 12 hours from now.
|
||||
// by setting the `scheduledDeletionDate` on the user 24 hours from now.
|
||||
async function requestDeletion({ user, connectors: { models: { User } } }) {
|
||||
// Ensure the user doesn't already have a deletion scheduled.
|
||||
if (get(user, 'metadata.scheduledDeletionDate')) {
|
||||
throw new ErrDeletionAlreadyScheduled();
|
||||
}
|
||||
|
||||
// Get the date in the future 12 hours from now.
|
||||
// Get the date in the future 24 hours from now.
|
||||
const scheduledDeletionDate = moment()
|
||||
.add(12, 'hours')
|
||||
.add(24, 'hours')
|
||||
.toDate();
|
||||
|
||||
// Amend the scheduledDeletionDate on the user.
|
||||
|
||||
Reference in New Issue
Block a user