PluginProbe
ElasticPress / 5.0.1
ElasticPress v5.0.1
5.3.5 5.3.4 3.6.5 3.6.6 4.0.0 4.0.1 4.1.0 4.2.0 4.2.1 4.2.2 4.3.0 4.3.1 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.6.0 4.6.1 4.7.0 4.7.1 4.7.2 5.0.0 5.0.1 5.0.2 All 108 releases
elasticpress / assets / js / sync-ui / components / put-mapping.js

put-mapping.js in ElasticPress 5.0.1, at assets/js/sync-ui/components/put-mapping.js

48 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WordPress dependencies.
3 */
4 import { CheckboxControl, Notice } from '@wordpress/components';
5 import { WPElement } from '@wordpress/element';
6 import { __ } from '@wordpress/i18n';
7
8 /**
9 * Internal dependencies.
10 */
11 import { useSync } from '../../sync';
12 import { useSyncSettings } from '../provider';
13
14 /**
15 * Delete checkbox component.
16 *
17 * @returns {WPElement} Sync page component.
18 */
19 export default () => {
20 const { isDeleting, isSyncing } = useSync();
21 const { args, setArgs } = useSyncSettings();
22
23 return (
24 <>
25 {args.put_mapping ? (
26 <Notice isDismissible={false} status="warning">
27 {__(
28 'Search results could be out of date or returned in different order while the sync completes.',
29 'elasticpress',
30 )}
31 </Notice>
32 ) : null}
33 <CheckboxControl
34 className="ep-sync-delete"
35 disabled={isSyncing}
36 checked={args.put_mapping}
37 help={__(
38 'All indexed data on ElasticPress will be deleted without affecting anything on your WordPress website. This may take a few hours depending on the amount of content that needs to be synced and indexed. While this is happening, searches will use the default WordPress results.',
39 'elasticpress',
40 )}
41 indeterminate={isSyncing && isDeleting && !args.put_mapping}
42 label={__('Delete all data and start fresh sync', 'elasticpress')}
43 onChange={(checked) => setArgs({ ...args, put_mapping: checked })}
44 />
45 </>
46 );
47 };
48