sfdx-browserforce-plugin 5.2.0-next.5 → 6.0.0-next.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/README.md +66 -87
  2. package/lib/browserforce-command.d.ts +14 -3
  3. package/lib/browserforce-command.js +117 -17
  4. package/lib/browserforce-command.js.map +1 -1
  5. package/lib/browserforce.d.ts +14 -12
  6. package/lib/browserforce.js +98 -100
  7. package/lib/browserforce.js.map +1 -1
  8. package/lib/commands/browserforce/apply.js +17 -12
  9. package/lib/commands/browserforce/apply.js.map +1 -1
  10. package/lib/commands/browserforce/playwright.js +9 -3
  11. package/lib/commands/browserforce/playwright.js.map +1 -1
  12. package/lib/config-parser.js.map +1 -1
  13. package/lib/pages/login.d.ts +2 -2
  14. package/lib/pages/login.js +5 -15
  15. package/lib/pages/login.js.map +1 -1
  16. package/lib/plugin.d.ts +0 -2
  17. package/lib/plugin.js +0 -2
  18. package/lib/plugin.js.map +1 -1
  19. package/lib/plugins/activity-settings/index.e2e-spec.js +1 -1
  20. package/lib/plugins/activity-settings/index.e2e-spec.js.map +1 -1
  21. package/lib/plugins/activity-settings/index.js +92 -21
  22. package/lib/plugins/activity-settings/index.js.map +1 -1
  23. package/lib/plugins/company-information/index.e2e-spec.js +1 -1
  24. package/lib/plugins/company-information/index.e2e-spec.js.map +1 -1
  25. package/lib/plugins/company-information/index.js +100 -31
  26. package/lib/plugins/company-information/index.js.map +1 -1
  27. package/lib/plugins/customer-portal/available-custom-objects/index.js +161 -73
  28. package/lib/plugins/customer-portal/available-custom-objects/index.js.map +1 -1
  29. package/lib/plugins/customer-portal/available-custom-objects/index.test.js +1 -1
  30. package/lib/plugins/customer-portal/available-custom-objects/index.test.js.map +1 -1
  31. package/lib/plugins/customer-portal/enabled/index.js +76 -13
  32. package/lib/plugins/customer-portal/enabled/index.js.map +1 -1
  33. package/lib/plugins/customer-portal/enabled/index.test.js +1 -1
  34. package/lib/plugins/customer-portal/enabled/index.test.js.map +1 -1
  35. package/lib/plugins/customer-portal/index.e2e-spec.js +12 -19
  36. package/lib/plugins/customer-portal/index.e2e-spec.js.map +1 -1
  37. package/lib/plugins/customer-portal/index.js +3 -4
  38. package/lib/plugins/customer-portal/index.js.map +1 -1
  39. package/lib/plugins/customer-portal/index.test.js +1 -1
  40. package/lib/plugins/customer-portal/index.test.js.map +1 -1
  41. package/lib/plugins/customer-portal/portals/index.js +186 -110
  42. package/lib/plugins/customer-portal/portals/index.js.map +1 -1
  43. package/lib/plugins/customer-portal/portals/index.test.js +1 -1
  44. package/lib/plugins/customer-portal/portals/index.test.js.map +1 -1
  45. package/lib/plugins/density-settings/index.e2e-spec.js +1 -1
  46. package/lib/plugins/density-settings/index.e2e-spec.js.map +1 -1
  47. package/lib/plugins/density-settings/index.js +91 -22
  48. package/lib/plugins/density-settings/index.js.map +1 -1
  49. package/lib/plugins/email-deliverability/index.e2e-spec.js +1 -1
  50. package/lib/plugins/email-deliverability/index.e2e-spec.js.map +1 -1
  51. package/lib/plugins/email-deliverability/index.js +93 -22
  52. package/lib/plugins/email-deliverability/index.js.map +1 -1
  53. package/lib/plugins/high-velocity-sales-settings/index.d.ts +1 -1
  54. package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.js +1 -1
  55. package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.js.map +1 -1
  56. package/lib/plugins/high-velocity-sales-settings/index.js +71 -8
  57. package/lib/plugins/high-velocity-sales-settings/index.js.map +1 -1
  58. package/lib/plugins/high-velocity-sales-settings/page.d.ts +2 -1
  59. package/lib/plugins/high-velocity-sales-settings/page.js +2 -6
  60. package/lib/plugins/high-velocity-sales-settings/page.js.map +1 -1
  61. package/lib/plugins/history-tracking/index.e2e-spec.js +3 -4
  62. package/lib/plugins/history-tracking/index.e2e-spec.js.map +1 -1
  63. package/lib/plugins/history-tracking/index.js +156 -94
  64. package/lib/plugins/history-tracking/index.js.map +1 -1
  65. package/lib/plugins/home-page-layouts/index.e2e-spec.js +1 -1
  66. package/lib/plugins/home-page-layouts/index.e2e-spec.js.map +1 -1
  67. package/lib/plugins/home-page-layouts/index.js +121 -57
  68. package/lib/plugins/home-page-layouts/index.js.map +1 -1
  69. package/lib/plugins/home-page-layouts/index.test.js +1 -1
  70. package/lib/plugins/home-page-layouts/index.test.js.map +1 -1
  71. package/lib/plugins/index.d.ts +1 -1
  72. package/lib/plugins/index.js +1 -1
  73. package/lib/plugins/index.js.map +1 -1
  74. package/lib/plugins/lightning-experience-settings/index.e2e-spec.js +1 -1
  75. package/lib/plugins/lightning-experience-settings/index.e2e-spec.js.map +1 -1
  76. package/lib/plugins/lightning-experience-settings/index.js +90 -27
  77. package/lib/plugins/lightning-experience-settings/index.js.map +1 -1
  78. package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.js +1 -1
  79. package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.js.map +1 -1
  80. package/lib/plugins/linkedin-sales-navigator-settings/index.js +84 -6
  81. package/lib/plugins/linkedin-sales-navigator-settings/index.js.map +1 -1
  82. package/lib/plugins/linkedin-sales-navigator-settings/page.d.ts +2 -1
  83. package/lib/plugins/linkedin-sales-navigator-settings/page.js +2 -7
  84. package/lib/plugins/linkedin-sales-navigator-settings/page.js.map +1 -1
  85. package/lib/plugins/omni-channel-settings/index.e2e-spec.js +1 -1
  86. package/lib/plugins/omni-channel-settings/index.e2e-spec.js.map +1 -1
  87. package/lib/plugins/omni-channel-settings/index.js +87 -14
  88. package/lib/plugins/omni-channel-settings/index.js.map +1 -1
  89. package/lib/plugins/opportunity-splits/index.e2e-spec.js +1 -1
  90. package/lib/plugins/opportunity-splits/index.e2e-spec.js.map +1 -1
  91. package/lib/plugins/opportunity-splits/index.js +103 -18
  92. package/lib/plugins/opportunity-splits/index.js.map +1 -1
  93. package/lib/plugins/opportunity-splits/pages/layout-selection.js.map +1 -1
  94. package/lib/plugins/opportunity-splits/pages/overview.d.ts +2 -1
  95. package/lib/plugins/opportunity-splits/pages/overview.js +2 -3
  96. package/lib/plugins/opportunity-splits/pages/overview.js.map +1 -1
  97. package/lib/plugins/opportunity-splits/pages/setup.d.ts +2 -1
  98. package/lib/plugins/opportunity-splits/pages/setup.js +1 -1
  99. package/lib/plugins/opportunity-splits/pages/setup.js.map +1 -1
  100. package/lib/plugins/permission-sets/index.e2e-spec.js +1 -1
  101. package/lib/plugins/permission-sets/index.e2e-spec.js.map +1 -1
  102. package/lib/plugins/permission-sets/index.js.map +1 -1
  103. package/lib/plugins/permission-sets/service-presence-status/index.js +106 -53
  104. package/lib/plugins/permission-sets/service-presence-status/index.js.map +1 -1
  105. package/lib/plugins/picklists/field-dependencies/index.js +91 -14
  106. package/lib/plugins/picklists/field-dependencies/index.js.map +1 -1
  107. package/lib/plugins/picklists/field-dependencies/index.test.js +1 -1
  108. package/lib/plugins/picklists/field-dependencies/index.test.js.map +1 -1
  109. package/lib/plugins/picklists/field-dependencies/pages.d.ts +3 -2
  110. package/lib/plugins/picklists/field-dependencies/pages.js +5 -14
  111. package/lib/plugins/picklists/field-dependencies/pages.js.map +1 -1
  112. package/lib/plugins/picklists/index.d.ts +1 -1
  113. package/lib/plugins/picklists/index.e2e-spec.js +36 -14
  114. package/lib/plugins/picklists/index.e2e-spec.js.map +1 -1
  115. package/lib/plugins/picklists/index.js +136 -68
  116. package/lib/plugins/picklists/index.js.map +1 -1
  117. package/lib/plugins/picklists/pages.js +13 -28
  118. package/lib/plugins/picklists/pages.js.map +1 -1
  119. package/lib/plugins/picklists/standard-value-set.js +2 -2
  120. package/lib/plugins/picklists/standard-value-set.js.map +1 -1
  121. package/lib/plugins/record-types/index.e2e-spec.js +2 -3
  122. package/lib/plugins/record-types/index.e2e-spec.js.map +1 -1
  123. package/lib/plugins/record-types/index.js +81 -20
  124. package/lib/plugins/record-types/index.js.map +1 -1
  125. package/lib/plugins/record-types/pages.js +1 -5
  126. package/lib/plugins/record-types/pages.js.map +1 -1
  127. package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.js +2 -2
  128. package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.js.map +1 -1
  129. package/lib/plugins/relate-contact-to-multiple-accounts/index.js +99 -35
  130. package/lib/plugins/relate-contact-to-multiple-accounts/index.js.map +1 -1
  131. package/lib/plugins/reports-and-dashboards/folder-sharing/index.js +100 -37
  132. package/lib/plugins/reports-and-dashboards/folder-sharing/index.js.map +1 -1
  133. package/lib/plugins/reports-and-dashboards/index.js +1 -1
  134. package/lib/plugins/reports-and-dashboards/index.js.map +1 -1
  135. package/lib/plugins/salesforce-cpq-config/index.e2e-spec.js +1 -1
  136. package/lib/plugins/salesforce-cpq-config/index.e2e-spec.js.map +1 -1
  137. package/lib/plugins/salesforce-cpq-config/index.js +213 -167
  138. package/lib/plugins/salesforce-cpq-config/index.js.map +1 -1
  139. package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.js +1 -2
  140. package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.js.map +1 -1
  141. package/lib/plugins/salesforce-to-salesforce/index.js +93 -23
  142. package/lib/plugins/salesforce-to-salesforce/index.js.map +1 -1
  143. package/lib/plugins/security/authentication-configuration/index.e2e-spec.js +2 -3
  144. package/lib/plugins/security/authentication-configuration/index.e2e-spec.js.map +1 -1
  145. package/lib/plugins/security/authentication-configuration/index.js +122 -50
  146. package/lib/plugins/security/authentication-configuration/index.js.map +1 -1
  147. package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.js +4 -25
  148. package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.js.map +1 -1
  149. package/lib/plugins/security/certificate-and-key-management/index.js +141 -65
  150. package/lib/plugins/security/certificate-and-key-management/index.js.map +1 -1
  151. package/lib/plugins/security/certificate-and-key-management/index.test.js +1 -1
  152. package/lib/plugins/security/certificate-and-key-management/index.test.js.map +1 -1
  153. package/lib/plugins/security/index.js +1 -2
  154. package/lib/plugins/security/index.js.map +1 -1
  155. package/lib/plugins/service-channels/capacity/index.js +145 -112
  156. package/lib/plugins/service-channels/capacity/index.js.map +1 -1
  157. package/lib/plugins/service-channels/index.e2e-spec.js +5 -6
  158. package/lib/plugins/service-channels/index.e2e-spec.js.map +1 -1
  159. package/lib/plugins/service-channels/index.js +1 -2
  160. package/lib/plugins/service-channels/index.js.map +1 -1
  161. package/lib/plugins/slack/index.e2e-spec.js +1 -1
  162. package/lib/plugins/slack/index.e2e-spec.js.map +1 -1
  163. package/lib/plugins/slack/index.js +97 -28
  164. package/lib/plugins/slack/index.js.map +1 -1
  165. package/lib/plugins/user-access-policies/index.e2e-spec.js +3 -5
  166. package/lib/plugins/user-access-policies/index.e2e-spec.js.map +1 -1
  167. package/lib/plugins/user-access-policies/index.js +95 -26
  168. package/lib/plugins/user-access-policies/index.js.map +1 -1
  169. package/lib/plugins/user-access-policies/page.d.ts +2 -1
  170. package/lib/plugins/user-access-policies/page.js +1 -7
  171. package/lib/plugins/user-access-policies/page.js.map +1 -1
  172. package/lib/plugins/utils.js +2 -7
  173. package/lib/plugins/utils.js.map +1 -1
  174. package/oclif.manifest.json +67 -71
  175. package/package.json +10 -8
  176. package/lib/commands/browserforce/plan.d.ts +0 -10
  177. package/lib/commands/browserforce/plan.js +0 -56
  178. package/lib/commands/browserforce/plan.js.map +0 -1
@@ -1,6 +1,58 @@
1
+ var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
2
+ if (value !== null && value !== void 0) {
3
+ if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
4
+ var dispose, inner;
5
+ if (async) {
6
+ if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
7
+ dispose = value[Symbol.asyncDispose];
8
+ }
9
+ if (dispose === void 0) {
10
+ if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
11
+ dispose = value[Symbol.dispose];
12
+ if (async) inner = dispose;
13
+ }
14
+ if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
15
+ if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
16
+ env.stack.push({ value: value, dispose: dispose, async: async });
17
+ }
18
+ else if (async) {
19
+ env.stack.push({ async: true });
20
+ }
21
+ return value;
22
+ };
23
+ var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
24
+ return function (env) {
25
+ function fail(e) {
26
+ env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
27
+ env.hasError = true;
28
+ }
29
+ var r, s = 0;
30
+ function next() {
31
+ while (r = env.stack.pop()) {
32
+ try {
33
+ if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
34
+ if (r.dispose) {
35
+ var result = r.dispose.call(r.value);
36
+ if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
37
+ }
38
+ else s |= 1;
39
+ }
40
+ catch (e) {
41
+ fail(e);
42
+ }
43
+ }
44
+ if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
45
+ if (env.hasError) throw env.error;
46
+ }
47
+ return next();
48
+ };
49
+ })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
50
+ var e = new Error(message);
51
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
52
+ });
1
53
  import { waitForPageErrors } from '../../browserforce.js';
2
54
  import { BrowserforcePlugin } from '../../plugin.js';
3
- const BASE_PATH = 'ui/setup/layout/FieldHistoryTracking?pEntity={APINAME}';
55
+ const BASE_PATH = `/ui/setup/layout/FieldHistoryTracking?pEntity={APINAME}&retURL=${encodeURIComponent('/setup/forcecomHomepage.apexp')}`;
4
56
  const ENABLE_HISTORY_SELECTOR = 'input[type="checkbox"][id="enable"]';
5
57
  const ENABLE_FIELD_HISTORY_SELECTOR = 'input[id="{APINAME}_fht"]';
6
58
  const SAVE_BUTTON_SELECTOR = 'input[type="submit"][name="save"]';
@@ -12,52 +64,59 @@ export class HistoryTracking extends BrowserforcePlugin {
12
64
  const tableEnumOrIdByObjectApiName = await this.getTableEnumOrIdByObjectApiName(definition);
13
65
  // Now we can iterate over all history tracking configurations in the definition
14
66
  for (const historyTrackingConfig of definition) {
15
- const historyTrackingResult = { ...historyTrackingConfig };
16
- // Open the object history tracking setup page
17
- const page = await this.browserforce.openPage(BASE_PATH.replace('{APINAME}', tableEnumOrIdByObjectApiName.get(historyTrackingConfig.objectApiName)));
18
- // Retrieve the object history tracking
19
- // If this is a custom object, this checkbox does not exist, so skip
20
- if (!historyTrackingConfig.objectApiName.includes('__c')) {
21
- historyTrackingResult.enableHistoryTracking = await page
22
- .locator(ENABLE_HISTORY_SELECTOR)
23
- .isChecked();
24
- }
25
- // If we have no field history tracking, there is nothing more to do
26
- if (!historyTrackingConfig.fieldHistoryTracking) {
27
- historyTrackingConfigs.push(historyTrackingResult);
28
- continue;
29
- }
30
- const fieldHistoryTrackingConfigs = [];
31
- // If the object history tracking is false, then we already know all field history tracking is false
32
- // Only so long as this is a standard object
33
- if (!historyTrackingResult.enableHistoryTracking &&
34
- !historyTrackingConfig.objectApiName.includes('__c')) {
67
+ const env_1 = { stack: [], error: void 0, hasError: false };
68
+ try {
69
+ const historyTrackingResult = { ...historyTrackingConfig };
70
+ // Open the object history tracking setup page
71
+ const page = __addDisposableResource(env_1, await this.browserforce.openPage(BASE_PATH.replace('{APINAME}', tableEnumOrIdByObjectApiName.get(historyTrackingConfig.objectApiName))), true);
72
+ // Retrieve the object history tracking
73
+ // If this is a custom object, this checkbox does not exist, so skip
74
+ if (!historyTrackingConfig.objectApiName.includes('__c')) {
75
+ historyTrackingResult.enableHistoryTracking = await page.locator(ENABLE_HISTORY_SELECTOR).isChecked();
76
+ }
77
+ // If we have no field history tracking, there is nothing more to do
78
+ if (!historyTrackingConfig.fieldHistoryTracking) {
79
+ historyTrackingConfigs.push(historyTrackingResult);
80
+ continue;
81
+ }
82
+ const fieldHistoryTrackingConfigs = [];
83
+ // If the object history tracking is false, then we already know all field history tracking is false
84
+ // Only so long as this is a standard object
85
+ if (!historyTrackingResult.enableHistoryTracking && !historyTrackingConfig.objectApiName.includes('__c')) {
86
+ for (const fieldHistoryTracking of historyTrackingConfig.fieldHistoryTracking) {
87
+ fieldHistoryTrackingConfigs.push({
88
+ ...fieldHistoryTracking,
89
+ enableHistoryTracking: false,
90
+ });
91
+ }
92
+ historyTrackingResult.fieldHistoryTracking = fieldHistoryTrackingConfigs;
93
+ historyTrackingConfigs.push(historyTrackingResult);
94
+ continue;
95
+ }
96
+ // We need to determine the correct html selector for each field that is configured
97
+ // This is because custom fields are identified using their CustomField.Id value
98
+ const fieldSelectorByFieldApiName = await this.getFieldSelectorByFieldApiName(tableEnumOrIdByObjectApiName.get(historyTrackingConfig.objectApiName), historyTrackingConfig.fieldHistoryTracking);
99
+ // We can now retrieve the field history settings for the fields specified for the object
35
100
  for (const fieldHistoryTracking of historyTrackingConfig.fieldHistoryTracking) {
36
- fieldHistoryTrackingConfigs.push({
37
- ...fieldHistoryTracking,
38
- enableHistoryTracking: false,
39
- });
101
+ const fieldHistoryTrackingResult = { ...fieldHistoryTracking };
102
+ const fieldApiName = fieldSelectorByFieldApiName.get(fieldHistoryTracking.fieldApiName);
103
+ fieldHistoryTrackingResult.enableHistoryTracking = await page
104
+ .locator(ENABLE_FIELD_HISTORY_SELECTOR.replace('{APINAME}', fieldApiName))
105
+ .isChecked();
106
+ fieldHistoryTrackingConfigs.push(fieldHistoryTrackingResult);
40
107
  }
41
- historyTrackingResult.fieldHistoryTracking =
42
- fieldHistoryTrackingConfigs;
108
+ historyTrackingResult.fieldHistoryTracking = fieldHistoryTrackingConfigs;
43
109
  historyTrackingConfigs.push(historyTrackingResult);
44
- continue;
45
110
  }
46
- // We need to determine the correct html selector for each field that is configured
47
- // This is because custom fields are identified using their CustomField.Id value
48
- const fieldSelectorByFieldApiName = await this.getFieldSelectorByFieldApiName(tableEnumOrIdByObjectApiName.get(historyTrackingConfig.objectApiName), historyTrackingConfig.fieldHistoryTracking);
49
- // We can now retrieve the field history settings for the fields specified for the object
50
- for (const fieldHistoryTracking of historyTrackingConfig.fieldHistoryTracking) {
51
- const fieldHistoryTrackingResult = { ...fieldHistoryTracking };
52
- const fieldApiName = fieldSelectorByFieldApiName.get(fieldHistoryTracking.fieldApiName);
53
- fieldHistoryTrackingResult.enableHistoryTracking = await page
54
- .locator(ENABLE_FIELD_HISTORY_SELECTOR.replace('{APINAME}', fieldApiName))
55
- .isChecked();
56
- fieldHistoryTrackingConfigs.push(fieldHistoryTrackingResult);
111
+ catch (e_1) {
112
+ env_1.error = e_1;
113
+ env_1.hasError = true;
114
+ }
115
+ finally {
116
+ const result_1 = __disposeResources(env_1);
117
+ if (result_1)
118
+ await result_1;
57
119
  }
58
- historyTrackingResult.fieldHistoryTracking = fieldHistoryTrackingConfigs;
59
- historyTrackingConfigs.push(historyTrackingResult);
60
- await page.close();
61
120
  }
62
121
  return historyTrackingConfigs;
63
122
  }
@@ -67,49 +126,54 @@ export class HistoryTracking extends BrowserforcePlugin {
67
126
  const tableEnumOrIdByObjectApiName = await this.getTableEnumOrIdByObjectApiName(plan);
68
127
  // Now we can iterate over all history tracking configurations in the plan
69
128
  for (const historyTrackingConfig of plan) {
70
- // Open the object history tracking setup page
71
- const page = await this.browserforce.openPage(BASE_PATH.replace('{APINAME}', tableEnumOrIdByObjectApiName.get(historyTrackingConfig.objectApiName)));
72
- // Retrieve the object history tracking
73
- // If this is a custom object, this checkbox does not exist, so skip
74
- if (!historyTrackingConfig.objectApiName.includes('__c')) {
75
- const historyTrackingEnabled = await page
76
- .locator(ENABLE_HISTORY_SELECTOR)
77
- .isChecked();
78
- if (historyTrackingConfig.enableHistoryTracking !== historyTrackingEnabled) {
79
- // Click the checkbox
80
- await page.locator(ENABLE_HISTORY_SELECTOR).click();
81
- }
82
- }
83
- if (historyTrackingConfig.fieldHistoryTracking) {
84
- // We need to determine the correct html selector for each field that is configured
85
- // This is because custom fields are identified using their CustomField.Id value
86
- const fieldSelectorByFieldApiName = await this.getFieldSelectorByFieldApiName(tableEnumOrIdByObjectApiName.get(historyTrackingConfig.objectApiName), historyTrackingConfig.fieldHistoryTracking);
87
- // We can now retrieve the field history settings for the fields specified for the object
88
- for (const fieldHistoryTracking of historyTrackingConfig.fieldHistoryTracking) {
89
- const fieldApiName = fieldSelectorByFieldApiName.get(fieldHistoryTracking.fieldApiName);
90
- const fieldSelector = ENABLE_FIELD_HISTORY_SELECTOR.replace('{APINAME}', fieldApiName);
91
- const fieldHistoryTrackingEnabled = await page
92
- .locator(fieldSelector)
93
- .isChecked();
94
- if (fieldHistoryTracking.enableHistoryTracking !==
95
- fieldHistoryTrackingEnabled) {
129
+ const env_2 = { stack: [], error: void 0, hasError: false };
130
+ try {
131
+ // Open the object history tracking setup page
132
+ const page = __addDisposableResource(env_2, await this.browserforce.openPage(BASE_PATH.replace('{APINAME}', tableEnumOrIdByObjectApiName.get(historyTrackingConfig.objectApiName))), true);
133
+ // Retrieve the object history tracking
134
+ // If this is a custom object, this checkbox does not exist, so skip
135
+ if (!historyTrackingConfig.objectApiName.includes('__c')) {
136
+ const historyTrackingEnabled = await page.locator(ENABLE_HISTORY_SELECTOR).isChecked();
137
+ if (historyTrackingConfig.enableHistoryTracking !== historyTrackingEnabled) {
96
138
  // Click the checkbox
97
- await page.locator(fieldSelector).click();
139
+ await page.locator(ENABLE_HISTORY_SELECTOR).click();
98
140
  }
99
141
  }
142
+ if (historyTrackingConfig.fieldHistoryTracking) {
143
+ // We need to determine the correct html selector for each field that is configured
144
+ // This is because custom fields are identified using their CustomField.Id value
145
+ const fieldSelectorByFieldApiName = await this.getFieldSelectorByFieldApiName(tableEnumOrIdByObjectApiName.get(historyTrackingConfig.objectApiName), historyTrackingConfig.fieldHistoryTracking);
146
+ // We can now retrieve the field history settings for the fields specified for the object
147
+ for (const fieldHistoryTracking of historyTrackingConfig.fieldHistoryTracking) {
148
+ const fieldApiName = fieldSelectorByFieldApiName.get(fieldHistoryTracking.fieldApiName);
149
+ const fieldSelector = ENABLE_FIELD_HISTORY_SELECTOR.replace('{APINAME}', fieldApiName);
150
+ const fieldHistoryTrackingEnabled = await page.locator(fieldSelector).isChecked();
151
+ if (fieldHistoryTracking.enableHistoryTracking !== fieldHistoryTrackingEnabled) {
152
+ // Click the checkbox
153
+ await page.locator(fieldSelector).click();
154
+ }
155
+ }
156
+ }
157
+ // Save the settings
158
+ await page
159
+ .locator(SAVE_BUTTON_SELECTOR)
160
+ .filter({ visible: true }) // there are three save buttons [not visible, top row, bottom row]
161
+ .first()
162
+ .click();
163
+ await Promise.race([
164
+ page.waitForURL((url) => url.pathname.startsWith('/setup/forcecomHomepage.apexp')),
165
+ waitForPageErrors(page),
166
+ ]);
167
+ }
168
+ catch (e_2) {
169
+ env_2.error = e_2;
170
+ env_2.hasError = true;
171
+ }
172
+ finally {
173
+ const result_2 = __disposeResources(env_2);
174
+ if (result_2)
175
+ await result_2;
100
176
  }
101
- // Save the settings
102
- await page
103
- .locator(SAVE_BUTTON_SELECTOR)
104
- .filter({ visible: true }) // there are three save buttons [not visible, top row, bottom row]
105
- .first()
106
- .click();
107
- await Promise.race([
108
- page.waitForURL((url) => url.pathname !== `/ui/setup/layout/FieldHistoryTracking`),
109
- waitForPageErrors(page),
110
- ]);
111
- // Close the page
112
- await page.close();
113
177
  }
114
178
  }
115
179
  async getFieldSelectorByFieldApiName(tableEnumOrId, fieldHistoryTrackingConfigs) {
@@ -118,8 +182,7 @@ export class HistoryTracking extends BrowserforcePlugin {
118
182
  const personAccountFieldApiNames = [];
119
183
  for (const fieldHistoryTrackingConfig of fieldHistoryTrackingConfigs) {
120
184
  // If this is a person account field, we must do special handling for this
121
- if (tableEnumOrId === 'Account' &&
122
- fieldHistoryTrackingConfig.fieldApiName.includes('__pc')) {
185
+ if (tableEnumOrId === 'Account' && fieldHistoryTrackingConfig.fieldApiName.includes('__pc')) {
123
186
  personAccountFieldApiNames.push(`'${fieldHistoryTrackingConfig.fieldApiName.replace('__pc', '')}'`);
124
187
  continue;
125
188
  }
@@ -131,22 +194,21 @@ export class HistoryTracking extends BrowserforcePlugin {
131
194
  // Otherwise, if this is a standard field, the Selector is the Field API Name
132
195
  fieldSelectorByFieldApiName.set(fieldHistoryTrackingConfig.fieldApiName, fieldHistoryTrackingConfig.fieldApiName);
133
196
  }
134
- if (customFieldApiNames.length === 0 &&
135
- personAccountFieldApiNames.length === 0) {
197
+ if (customFieldApiNames.length === 0 && personAccountFieldApiNames.length === 0) {
136
198
  return fieldSelectorByFieldApiName;
137
199
  }
138
200
  if (personAccountFieldApiNames.length > 0) {
139
- const personAccountFieldsQuery = await this.org
140
- .getConnection()
141
- .tooling.query(`SELECT Id, DeveloperName FROM CustomField WHERE DeveloperName IN (${personAccountFieldApiNames.join(',')}) AND TableEnumOrId = 'Contact'`);
201
+ // NOTE: Unfortunately this includes deleted records
202
+ // WORKAROUND: ORDER BY CreatedDate
203
+ const personAccountFieldsQuery = await this.browserforce.connection.tooling.query(`SELECT Id, DeveloperName FROM CustomField WHERE DeveloperName IN (${personAccountFieldApiNames.join(',')}) AND TableEnumOrId = 'Contact' ORDER By CreatedDate ASC`);
142
204
  for (const personAccountField of personAccountFieldsQuery.records) {
143
205
  fieldSelectorByFieldApiName.set(`${personAccountField.DeveloperName}__pc`, personAccountField.Id.substring(0, 15));
144
206
  }
145
207
  }
146
208
  if (customFieldApiNames.length > 0) {
147
- const customFieldsQuery = await this.org
148
- .getConnection()
149
- .tooling.query(`SELECT Id, DeveloperName FROM CustomField WHERE DeveloperName IN (${customFieldApiNames.join(',')}) AND TableEnumOrId = '${tableEnumOrId}'`);
209
+ // NOTE: Unfortunately this includes deleted records
210
+ // WORKAROUND: ORDER BY CreatedDate
211
+ const customFieldsQuery = await this.browserforce.connection.tooling.query(`SELECT Id, DeveloperName FROM CustomField WHERE DeveloperName IN (${customFieldApiNames.join(',')}) AND TableEnumOrId = '${tableEnumOrId}' ORDER By CreatedDate ASC`);
150
212
  for (const customField of customFieldsQuery.records) {
151
213
  fieldSelectorByFieldApiName.set(`${customField.DeveloperName}__c`, customField.Id.substring(0, 15));
152
214
  }
@@ -168,9 +230,9 @@ export class HistoryTracking extends BrowserforcePlugin {
168
230
  if (customObjectApiNames.length === 0) {
169
231
  return tableEnumOrIdByObjectApiName;
170
232
  }
171
- const customObjectsQuery = await this.org
172
- .getConnection()
173
- .tooling.query(`SELECT Id, DeveloperName FROM CustomObject WHERE DeveloperName IN (${customObjectApiNames.join(',')})`);
233
+ // NOTE: Unfortunately this includes deleted records
234
+ // WORKAROUND: ORDER BY CreatedDate
235
+ const customObjectsQuery = await this.browserforce.connection.tooling.query(`SELECT Id, DeveloperName FROM CustomObject WHERE DeveloperName IN (${customObjectApiNames.join(',')}) ORDER BY CreatedDate ASC`);
174
236
  for (const customObject of customObjectsQuery.records) {
175
237
  tableEnumOrIdByObjectApiName.set(`${customObject.DeveloperName}__c`, customObject.Id);
176
238
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/history-tracking/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,SAAS,GAAG,wDAAwD,CAAC;AAE3E,MAAM,uBAAuB,GAAG,qCAAqC,CAAC;AACtE,MAAM,6BAA6B,GAAG,2BAA2B,CAAC;AAClE,MAAM,oBAAoB,GAAG,mCAAmC,CAAC;AAajE,MAAM,OAAO,eAAgB,SAAQ,kBAAkB;IAC9C,KAAK,CAAC,QAAQ,CACnB,UAAoC;QAEpC,MAAM,sBAAsB,GAA4B,EAAE,CAAC;QAE3D,wFAAwF;QACxF,sEAAsE;QACtE,MAAM,4BAA4B,GAChC,MAAM,IAAI,CAAC,+BAA+B,CAAC,UAAU,CAAC,CAAC;QAEzD,gFAAgF;QAChF,KAAK,MAAM,qBAAqB,IAAI,UAAU,EAAE,CAAC;YAC/C,MAAM,qBAAqB,GAAG,EAAE,GAAG,qBAAqB,EAAE,CAAC;YAE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AAC,sBAA+C;QAC3F,MAAM,4BAA4B,GAAG,IAAI,GAAG,EAAE,CAAC;QAE/C,MAAM,oBAAoB,GAAG,EAAE,CAAC;QAEhC,KAAK,MAAM,qBAAqB,IAAI,sBAAsB,EAAE,CAAC;YAC3D,2EAA2E;YAC3E,IAAI,qBAAqB,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBACxD,oBAAoB,CAAC,IAAI,CAAC,IAAI,qBAAqB,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;gBACzF,SAAS;YACX,CAAC;YAED,gGAAgG;YAChG,4BAA4B,CAAC,GAAG,CAAC,qBAAqB,CAAC,aAAa,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;QAC7G,CAAC;QAED,IAAI,oBAAoB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtC,OAAO,4BAA4B,CAAC;QACtC,CAAC;QAED,oDAAoD;QACpD,mCAAmC;QACnC,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CACzE,sEAAsE,oBAAoB,CAAC,IAAI,CAC7F,GAAG,CACJ,4BAA4B,CAC9B,CAAC;QAEF,KAAK,MAAM,YAAY,IAAI,kBAAkB,CAAC,OAAO,EAAE,CAAC;YACtD,4BAA4B,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,aAAa,KAAK,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;QACxF,CAAC;QAED,OAAO,4BAA4B,CAAC;IACtC,CAAC;CACF"}
@@ -3,7 +3,7 @@ import { HomePageLayouts } from './index.js';
3
3
  describe(HomePageLayouts.name, function () {
4
4
  let plugin;
5
5
  before(() => {
6
- plugin = new HomePageLayouts(global.bf);
6
+ plugin = new HomePageLayouts(global.browserforce);
7
7
  });
8
8
  const configPageDefault = {
9
9
  homePageLayoutAssignments: [
@@ -1 +1 @@
1
- {"version":3,"file":"index.e2e-spec.js","sourceRoot":"","sources":["../../../src/plugins/home-page-layouts/index.e2e-spec.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,QAAQ,CAAC,eAAe,CAAC,IAAI,EAAE;IAC7B,IAAI,MAAuB,CAAC;IAC5B,MAAM,CAAC,GAAG,EAAE;QACV,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAAG;QACxB,yBAAyB,EAAE;YACzB;gBACE,OAAO,EAAE,eAAe;gBACxB,MAAM,EAAE,EAAE;aACX;YACD;gBACE,OAAO,EAAE,sBAAsB;gBAC/B,MAAM,EAAE,EAAE;aACX;SACF;KACF,CAAC;IACF,MAAM,gBAAgB,GAAG;QACvB,yBAAyB,EAAE;YACzB;gBACE,OAAO,EAAE,eAAe;gBACxB,MAAM,EAAE,YAAY;aACrB;YACD;gBACE,OAAO,EAAE,sBAAsB;gBAC/B,MAAM,EAAE,YAAY;aACrB;SACF;KACF,CAAC;IACF,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAChD,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC/C,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"index.e2e-spec.js","sourceRoot":"","sources":["../../../src/plugins/home-page-layouts/index.e2e-spec.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,QAAQ,CAAC,eAAe,CAAC,IAAI,EAAE;IAC7B,IAAI,MAAuB,CAAC;IAC5B,MAAM,CAAC,GAAG,EAAE;QACV,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAAG;QACxB,yBAAyB,EAAE;YACzB;gBACE,OAAO,EAAE,eAAe;gBACxB,MAAM,EAAE,EAAE;aACX;YACD;gBACE,OAAO,EAAE,sBAAsB;gBAC/B,MAAM,EAAE,EAAE;aACX;SACF;KACF,CAAC;IACF,MAAM,gBAAgB,GAAG;QACvB,yBAAyB,EAAE;YACzB;gBACE,OAAO,EAAE,eAAe;gBACxB,MAAM,EAAE,YAAY;aACrB;YACD;gBACE,OAAO,EAAE,sBAAsB;gBAC/B,MAAM,EAAE,YAAY;aACrB;SACF;KACF,CAAC;IACF,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAChD,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC/C,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,24 +1,85 @@
1
+ var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
2
+ if (value !== null && value !== void 0) {
3
+ if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
4
+ var dispose, inner;
5
+ if (async) {
6
+ if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
7
+ dispose = value[Symbol.asyncDispose];
8
+ }
9
+ if (dispose === void 0) {
10
+ if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
11
+ dispose = value[Symbol.dispose];
12
+ if (async) inner = dispose;
13
+ }
14
+ if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
15
+ if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
16
+ env.stack.push({ value: value, dispose: dispose, async: async });
17
+ }
18
+ else if (async) {
19
+ env.stack.push({ async: true });
20
+ }
21
+ return value;
22
+ };
23
+ var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
24
+ return function (env) {
25
+ function fail(e) {
26
+ env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
27
+ env.hasError = true;
28
+ }
29
+ var r, s = 0;
30
+ function next() {
31
+ while (r = env.stack.pop()) {
32
+ try {
33
+ if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
34
+ if (r.dispose) {
35
+ var result = r.dispose.call(r.value);
36
+ if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
37
+ }
38
+ else s |= 1;
39
+ }
40
+ catch (e) {
41
+ fail(e);
42
+ }
43
+ }
44
+ if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
45
+ if (env.hasError) throw env.error;
46
+ }
47
+ return next();
48
+ };
49
+ })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
50
+ var e = new Error(message);
51
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
52
+ });
1
53
  import { waitForPageErrors } from '../../browserforce.js';
2
54
  import { BrowserforcePlugin } from '../../plugin.js';
3
- const BASE_PATH = 'setup/ui/assignhomelayoutedit.jsp';
55
+ const BASE_PATH = `/setup/ui/assignhomelayoutedit.jsp?retURL=${encodeURIComponent('/setup/forcecomHomepage.apexp')}`;
4
56
  const BASE_SELECTOR = 'table.detailList';
5
57
  const SAVE_BUTTON_SELECTOR = 'input[name="save"]';
6
58
  export class HomePageLayouts extends BrowserforcePlugin {
7
59
  async retrieve() {
8
- const page = await this.browserforce.openPage(BASE_PATH);
9
- await page.locator(BASE_SELECTOR).waitFor();
10
- const profiles = (await page.locator('table.detailList tbody tr td label').allTextContents()).map((label) => label.replace(/^\*/, '')); // removing * from assistiveText
11
- const layouts = (await page
12
- .locator('table.detailList tbody tr td select option:checked')
13
- .allTextContents()).map((layout) => (layout === 'Home Page Default' ? '' : layout)); // value is "default" instead of an id
14
- const homePageLayoutAssignments = profiles.map((profile, i) => ({
15
- profile,
16
- layout: layouts[i],
17
- }));
18
- await page.close();
19
- return {
20
- homePageLayoutAssignments,
21
- };
60
+ const env_1 = { stack: [], error: void 0, hasError: false };
61
+ try {
62
+ const page = __addDisposableResource(env_1, await this.browserforce.openPage(BASE_PATH), true);
63
+ await page.locator(BASE_SELECTOR).waitFor();
64
+ const profiles = (await page.locator('table.detailList tbody tr td label').allTextContents()).map((label) => label.replace(/^\*/, '')); // removing * from assistiveText
65
+ const layouts = (await page.locator('table.detailList tbody tr td select option:checked').allTextContents()).map((layout) => (layout === 'Home Page Default' ? '' : layout)); // value is "default" instead of an id
66
+ const homePageLayoutAssignments = profiles.map((profile, i) => ({
67
+ profile,
68
+ layout: layouts[i],
69
+ }));
70
+ return {
71
+ homePageLayoutAssignments,
72
+ };
73
+ }
74
+ catch (e_1) {
75
+ env_1.error = e_1;
76
+ env_1.hasError = true;
77
+ }
78
+ finally {
79
+ const result_1 = __disposeResources(env_1);
80
+ if (result_1)
81
+ await result_1;
82
+ }
22
83
  }
23
84
  diff(source, target) {
24
85
  target.homePageLayoutAssignments.sort(compareAssignment);
@@ -29,50 +90,53 @@ export class HomePageLayouts extends BrowserforcePlugin {
29
90
  return super.diff(source, target);
30
91
  }
31
92
  async apply(config) {
32
- const profilesList = config.homePageLayoutAssignments
33
- .map((assignment) => {
34
- return `'${assignment.profile}'`;
35
- })
36
- .join(',');
37
- const layoutsList = config.homePageLayoutAssignments
38
- .map((assignment) => {
39
- return `'${assignment.layout}'`;
40
- })
41
- .join(',');
42
- const profiles = await this.org
43
- .getConnection()
44
- .tooling.query(`SELECT Id, Name FROM Profile WHERE Name IN (${profilesList})`);
45
- const homePageLayouts = await this.org
46
- .getConnection()
47
- .tooling.query(`SELECT Id, Name FROM HomePageLayout WHERE Name IN (${layoutsList})`);
48
- const page = await this.browserforce.openPage(BASE_PATH);
49
- await page.locator(BASE_SELECTOR).waitFor();
50
- for (const assignment of config.homePageLayoutAssignments) {
51
- const homePageLayoutName = assignment.layout;
52
- const profile = profiles.records.find((p) => p.Name === assignment.profile);
53
- if (!profile) {
54
- await page.close();
55
- throw new Error(`could not find profile '${assignment.profile}'`);
56
- }
57
- let homePageLayout = homePageLayouts.records.find((l) => l.Name === homePageLayoutName);
58
- if (homePageLayoutName === '') {
59
- homePageLayout = { Id: 'default', Name: 'default' };
93
+ const env_2 = { stack: [], error: void 0, hasError: false };
94
+ try {
95
+ const profilesList = config.homePageLayoutAssignments
96
+ .map((assignment) => {
97
+ return `'${assignment.profile}'`;
98
+ })
99
+ .join(',');
100
+ const layoutsList = config.homePageLayoutAssignments
101
+ .map((assignment) => {
102
+ return `'${assignment.layout}'`;
103
+ })
104
+ .join(',');
105
+ const profiles = await this.browserforce.connection.tooling.query(`SELECT Id, Name FROM Profile WHERE Name IN (${profilesList})`);
106
+ const homePageLayouts = await this.browserforce.connection.tooling.query(`SELECT Id, Name FROM HomePageLayout WHERE Name IN (${layoutsList})`);
107
+ const page = __addDisposableResource(env_2, await this.browserforce.openPage(BASE_PATH), true);
108
+ await page.locator(BASE_SELECTOR).waitFor();
109
+ for (const assignment of config.homePageLayoutAssignments) {
110
+ const homePageLayoutName = assignment.layout;
111
+ const profile = profiles.records.find((p) => p.Name === assignment.profile);
112
+ if (!profile) {
113
+ throw new Error(`could not find profile '${assignment.profile}'`);
114
+ }
115
+ let homePageLayout = homePageLayouts.records.find((l) => l.Name === homePageLayoutName);
116
+ if (homePageLayoutName === '') {
117
+ homePageLayout = { Id: 'default', Name: 'default' };
118
+ }
119
+ if (homePageLayout === undefined) {
120
+ throw new Error(`Could not find home page layout "${homePageLayoutName}" in list of home page layouts: ${homePageLayouts.records.map((l) => l.Name)}`);
121
+ }
122
+ const profileSelector = `select[id='${profile.Id.substring(0, 15)}']`;
123
+ await page.locator(profileSelector).selectOption(homePageLayout.Id.substring(0, 15));
60
124
  }
61
- if (homePageLayout === undefined) {
62
- await page.close();
63
- throw new Error(`Could not find home page layout "${homePageLayoutName}" in list of home page layouts: ${homePageLayouts.records.map((l) => l.Name)}`);
64
- }
65
- const profileSelector = `select[id='${profile.Id.substring(0, 15)}']`;
66
- await page
67
- .locator(profileSelector)
68
- .selectOption(homePageLayout.Id.substring(0, 15));
125
+ await page.locator(SAVE_BUTTON_SELECTOR).first().click();
126
+ await Promise.race([
127
+ page.waitForURL((url) => url.pathname === '/setup/forcecomHomepage.apexp'),
128
+ waitForPageErrors(page),
129
+ ]);
130
+ }
131
+ catch (e_2) {
132
+ env_2.error = e_2;
133
+ env_2.hasError = true;
134
+ }
135
+ finally {
136
+ const result_2 = __disposeResources(env_2);
137
+ if (result_2)
138
+ await result_2;
69
139
  }
70
- await page.locator(SAVE_BUTTON_SELECTOR).first().click();
71
- await Promise.race([
72
- page.waitForURL((url) => url.pathname !== `/${BASE_PATH}`),
73
- waitForPageErrors(page),
74
- ]);
75
- await page.close();
76
140
  }
77
141
  }
78
142
  function compareAssignment(a, b) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/home-page-layouts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,SAAS,GAAG,mCAAmC,CAAC;AAEtD,MAAM,aAAa,GAAG,kBAAkB,CAAC;AACzC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAmBlD,MAAM,OAAO,eAAgB,SAAQ,kBAAkB;IAC9C,KAAK,CAAC,QAAQ;QACnB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE,CAAC;QAE5C,MAAM,QAAQ,GAAG,CACf,MAAM,IAAI,CAAC,OAAO,CAAC,oCAAoC,CAAC,CAAC,eAAe,EAAE,CAC3E,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,gCAAgC;QAE5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,CAAC,YAAY,CAAC,cAAc,CAAC,EAAG,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;YACxF,CAAC;YAED,MAAM,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC;YACzD,MAAM,OAAO,CAAC,IAAI,CAAC;gBACjB,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,+BAA+B,CAAC;gBAC1E,iBAAiB,CAAC,IAAI,CAAC;aACxB,CAAC,CAAC;;;;;;;;;;;KACJ;CACF;AAED,SAAS,iBAAiB,CAAC,CAA2B,EAAE,CAA2B;IACjF,OAAO,GAAG,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AACvG,CAAC"}
@@ -92,7 +92,7 @@ const tests = [
92
92
  ];
93
93
  describe('HomePageLayouts', () => {
94
94
  describe('diff()', () => {
95
- const p = new HomePageLayouts(global.bf);
95
+ const p = new HomePageLayouts(global.browserforce);
96
96
  for (const t of tests) {
97
97
  it(t.description, () => {
98
98
  const actual = p.diff(t.source, t.target);
@@ -1 +1 @@
1
- {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../src/plugins/home-page-layouts/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,KAAK,GAAG;IACZ;QACE,WAAW,EAAE,yBAAyB;QACtC,MAAM,EAAE;YACN,yBAAyB,EAAE;gBACzB;oBACE,OAAO,EAAE,eAAe;oBACxB,MAAM,EAAE,EAAE;iBACX;gBACD;oBACE,OAAO,EAAE,s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QACtB,MAAM,CAAC,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACzC,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;YACtB,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,EAAE;gBACrB,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;gBAC1C,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;YAC7C,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../src/plugins/home-page-layouts/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,KAAK,GAAG;IACZ;QACE,WAAW,EAAE,yBAAyB;QACtC,MAAM,EAAE;YACN,yBAAyB,EAAE;gBACzB;oBACE,OAAO,EAAE,eAAe;oBACxB,MAAM,EAAE,EAAE;iBACX;gBACD;oBACE,OAAO,EAAE,sBAAsB;oBAC/B,MAAM,EAAE,EAAE;iBACX;aACF;SACF;QACD,MAAM,EAAE;YACN,yBAAyB,EAAE;gBACzB;oBACE,OAAO,EAAE,eAAe;oBACxB,MAAM,EAAE,EAAE;iBACX;gBACD;oBACE,OAAO,EAAE,sBAAsB;oBAC/B,MAAM,EAAE,EAAE;iBACX;aACF;SACF;QACD,QAAQ,EAAE,SAAS;KACpB;IACD;QACE,WAAW,EAAE,sCAAsC;QACnD,MAAM,EAAE;YACN,yBAAyB,EAAE;gBACzB;oBACE,OAAO,EAAE,UAAU;oBACnB,MAAM,EAAE,EAAE;iBACX;gBACD;oBACE,OAAO,EAAE,eAAe;oBACxB,MAAM,EAAE,EAAE;iBACX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