PluginProbe
Extendify / 3.2.3
Extendify v3.2.3
3.2.3 3.2.2 3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 All 129 releases
extendify / src / Agent / workflows / settings / update-search-indexing.js

update-search-indexing.js in Extendify 3.2.3, at src/Agent/workflows/settings/update-search-indexing.js

62 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { UpdateSearchIndexingConfirm } from '@agent/workflows/settings/components/UpdateSearchIndexingConfirm';
2 import { __ } from '@wordpress/i18n';
3
4 const { abilities, agentContext } = window.extAgentData;
5
6 const enableExample = {
7 text: __('Enable search engine indexing', 'extendify-local'),
8 agentResponse: {
9 // translators: Shown when the user clicks the "Enable search engine indexing" suggestion, above a confirm card.
10 reply: __('Ready to let search engines find your site?', 'extendify-local'),
11 whenFinishedTool: {
12 id: 'update-search-indexing',
13 inputs: { indexing: 'enabled' },
14 labels: {
15 confirm: __('Enabled search engine indexing', 'extendify-local'),
16 // translators: Neutral notice — the user backed out, so search engines are still discouraged.
17 cancel: __(
18 'Canceled enabling search engine indexing',
19 'extendify-local',
20 ),
21 },
22 },
23 },
24 };
25
26 const disableExample = {
27 text: __('Stop search engines indexing my site', 'extendify-local'),
28 agentResponse: {
29 // translators: Shown when the user clicks the "Stop search engines indexing my site" suggestion, above a confirm card.
30 reply: __(
31 'Ready to ask search engines not to index your site?',
32 'extendify-local',
33 ),
34 whenFinishedTool: {
35 id: 'update-search-indexing',
36 inputs: { indexing: 'disabled' },
37 labels: {
38 confirm: __(
39 'Asked search engines not to index the site',
40 'extendify-local',
41 ),
42 cancel: __(
43 'Canceled discouraging search engine indexing',
44 'extendify-local',
45 ),
46 },
47 },
48 },
49 };
50
51 // A blocked site stays eligible with the flag off, or it can never be indexed.
52 const inScope = () =>
53 Boolean(agentContext?.searchEngineBlockEnabled) ||
54 Boolean(agentContext?.searchEnginesBlocked);
55
56 export default {
57 available: () => Boolean(abilities?.canEditSettings) && inScope(),
58 id: 'update-search-indexing',
59 whenFinished: { component: UpdateSearchIndexingConfirm },
60 example: agentContext?.searchEnginesBlocked ? enableExample : disableExample,
61 };
62