@coveo/quantic 3.43.3 → 3.43.5

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 (127) hide show
  1. package/force-app/main/default/classes/CaseAssistController.cls +18 -0
  2. package/force-app/main/default/classes/CaseAssistController.cls-meta.xml +5 -0
  3. package/force-app/main/default/classes/CaseAssistControllerTest.cls +15 -0
  4. package/force-app/main/default/classes/CaseAssistControllerTest.cls-meta.xml +5 -0
  5. package/force-app/main/default/classes/HeadlessControllerTest.cls +1 -1
  6. package/force-app/main/default/classes/InsightController.cls +4 -2
  7. package/force-app/main/default/classes/SampleCaseAssistTokenProvider.cls +19 -0
  8. package/force-app/main/default/classes/SampleCaseAssistTokenProvider.cls-meta.xml +5 -0
  9. package/force-app/main/default/classes/SampleCaseAssistTokenProviderTest.cls +15 -0
  10. package/force-app/main/default/classes/SampleCaseAssistTokenProviderTest.cls-meta.xml +5 -0
  11. package/force-app/main/default/classes/SampleInsightTokenProvider.cls +24 -0
  12. package/force-app/main/default/classes/SampleInsightTokenProvider.cls-meta.xml +5 -0
  13. package/force-app/main/default/classes/SampleInsightTokenProviderTest.cls +24 -0
  14. package/force-app/main/default/classes/SampleInsightTokenProviderTest.cls-meta.xml +5 -0
  15. package/force-app/main/default/classes/SampleTokenProvider.cls +2 -1
  16. package/force-app/main/default/classes/SampleTokenProviderTest.cls +1 -1
  17. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/data.ts +130 -0
  18. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/fixture.ts +25 -14
  19. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/quanticBreadcrumbManager.e2e.ts +57 -16
  20. package/force-app/main/default/lwc/quanticCardContainer/quanticCardContainer.css +3 -4
  21. package/force-app/main/default/lwc/quanticCardContainer/quanticCardContainer.html +1 -1
  22. package/force-app/main/default/lwc/quanticCarousel/quanticCarousel.css +5 -5
  23. package/force-app/main/default/lwc/quanticCaseAssistInterface/quanticCaseAssistInterface.js +1 -1
  24. package/force-app/main/default/lwc/quanticCaseClassification/quanticCaseClassification.css +3 -3
  25. package/force-app/main/default/lwc/quanticCategoryFacet/quanticCategoryFacet.css +1 -1
  26. package/force-app/main/default/lwc/quanticCitation/quanticCitation.css +12 -11
  27. package/force-app/main/default/lwc/quanticDidYouMean/e2e/fixture.ts +6 -2
  28. package/force-app/main/default/lwc/quanticDocumentSuggestion/quanticDocumentSuggestion.css +2 -2
  29. package/force-app/main/default/lwc/quanticFacet/quanticFacet.css +1 -1
  30. package/force-app/main/default/lwc/quanticFacetManager/e2e/data.ts +59 -0
  31. package/force-app/main/default/lwc/quanticFacetManager/e2e/fixture.ts +26 -15
  32. package/force-app/main/default/lwc/quanticFacetManager/e2e/quanticFacetManager.e2e.ts +7 -7
  33. package/force-app/main/default/lwc/quanticFacetStyles/quanticFacetStyles.css +10 -10
  34. package/force-app/main/default/lwc/quanticFeedbackModalQna/templates/quanticFeedbackModalQna.css +1 -1
  35. package/force-app/main/default/lwc/quanticFoldedResultList/e2e/fixture.ts +6 -2
  36. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/agentData.ts +32 -1
  37. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/pageObject.ts +6 -0
  38. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswerAgent.e2e.ts +66 -1
  39. package/force-app/main/default/lwc/quanticGeneratedAnswer/quanticGeneratedAnswer.css +1 -1
  40. package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/generatedAnswer.css +3 -3
  41. package/force-app/main/default/lwc/quanticGeneratedAnswerBody/__tests__/quanticGeneratedAnswerBody.test.js +39 -0
  42. package/force-app/main/default/lwc/quanticGeneratedAnswerBody/quanticGeneratedAnswerBody.js +4 -1
  43. package/force-app/main/default/lwc/quanticGeneratedAnswerContent/templates/generatedMarkdownContent.css +21 -21
  44. package/force-app/main/default/lwc/quanticGeneratedAnswerContent/templates/generatedTextContent.css +2 -2
  45. package/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/quanticGeneratedAnswerFollowUpInput.css +9 -9
  46. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/quanticGeneratedAnswerStreamOfThought.css +2 -2
  47. package/force-app/main/default/lwc/quanticGeneratedAnswerThread/quanticGeneratedAnswerThread.css +8 -8
  48. package/force-app/main/default/lwc/quanticInsightSummary/quanticInsightSummary.css +2 -1
  49. package/force-app/main/default/lwc/quanticModal/quanticModal.css +3 -3
  50. package/force-app/main/default/lwc/quanticNotifications/e2e/fixture.ts +6 -2
  51. package/force-app/main/default/lwc/quanticNotifications/quanticNotifications.css +2 -2
  52. package/force-app/main/default/lwc/quanticPill/quanticPill.css +2 -2
  53. package/force-app/main/default/lwc/quanticPlaceholder/quanticPlaceholder.css +2 -6
  54. package/force-app/main/default/lwc/quanticPlaceholder/quanticPlaceholder.html +1 -1
  55. package/force-app/main/default/lwc/quanticRadioButtonsGroup/quanticRadioButtonsGroup.css +9 -9
  56. package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/fixture.ts +1 -0
  57. package/force-app/main/default/lwc/quanticRecentQueriesList/quanticRecentQueriesList.css +3 -7
  58. package/force-app/main/default/lwc/quanticRecentQueriesList/quanticRecentQueriesList.html +1 -1
  59. package/force-app/main/default/lwc/quanticRecentResultsList/e2e/fixture.ts +1 -0
  60. package/force-app/main/default/lwc/quanticRecentResultsList/quanticRecentResultsList.css +2 -6
  61. package/force-app/main/default/lwc/quanticRecentResultsList/quanticRecentResultsList.html +1 -1
  62. package/force-app/main/default/lwc/quanticRecommendationList/e2e/fixture.ts +1 -0
  63. package/force-app/main/default/lwc/quanticRecommendationList/quanticRecommendationList.css +1 -1
  64. package/force-app/main/default/lwc/quanticRefineToggle/quanticRefineToggle.css +4 -4
  65. package/force-app/main/default/lwc/quanticResultActionStyles/quanticResultActionStyles.css +2 -2
  66. package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/fixture.ts +5 -2
  67. package/force-app/main/default/lwc/quanticResultLink/quanticResultLink.css +1 -1
  68. package/force-app/main/default/lwc/quanticResultList/e2e/fixture.ts +6 -2
  69. package/force-app/main/default/lwc/quanticResultPrintableUri/quanticResultPrintableUri.css +1 -1
  70. package/force-app/main/default/lwc/quanticResultQuickview/e2e/fixture.ts +7 -3
  71. package/force-app/main/default/lwc/quanticResultQuickview/quanticResultQuickview.css +6 -6
  72. package/force-app/main/default/lwc/quanticResultTag/quanticResultTag.css +2 -0
  73. package/force-app/main/default/lwc/quanticResultTemplate/quanticResultTemplate.css +1 -1
  74. package/force-app/main/default/lwc/quanticResultsPerPage/e2e/fixture.ts +6 -2
  75. package/force-app/main/default/lwc/quanticSearchBox/e2e/fixture.ts +3 -1
  76. package/force-app/main/default/lwc/quanticSearchBoxInput/templates/defaultSearchBoxInput.css +1 -1
  77. package/force-app/main/default/lwc/quanticSearchBoxInput/templates/expandableSearchBoxInput.css +4 -12
  78. package/force-app/main/default/lwc/quanticSearchBoxInput/templates/expandableSearchBoxInput.html +2 -2
  79. package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/fixture.ts +3 -0
  80. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/fixture.ts +6 -4
  81. package/force-app/main/default/lwc/quanticSmartSnippetSource/quanticSmartSnippetSource.css +1 -1
  82. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/fixture.ts +6 -4
  83. package/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts +6 -0
  84. package/force-app/main/default/lwc/quanticSort/quanticSort.css +3 -3
  85. package/force-app/main/default/lwc/quanticSourceCitations/quanticSourceCitations.css +1 -1
  86. package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/fixture.ts +2 -1
  87. package/force-app/main/default/lwc/quanticStatefulButton/quanticStatefulButton.css +2 -2
  88. package/force-app/main/default/lwc/quanticTab/e2e/fixture.ts +6 -2
  89. package/force-app/main/default/lwc/quanticTabBar/e2e/fixture.ts +6 -2
  90. package/force-app/main/default/lwc/quanticTabBar/e2e/quanticTabBar.e2e.ts +3 -2
  91. package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.css +6 -6
  92. package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.js +0 -1
  93. package/force-app/main/default/lwc/quanticTimeframeFacet/quanticTimeframeFacet.css +1 -1
  94. package/force-app/main/default/lwc/quanticTooltip/quanticTooltip.css +3 -3
  95. package/force-app/main/default/lwc/quanticUserAction/quanticUserAction.css +7 -7
  96. package/force-app/main/default/lwc/quanticUserActionsSession/quanticUserActionsSession.css +3 -3
  97. package/force-app/main/default/lwc/quanticUserActionsTimeline/templates/userActionsTimeline.css +2 -2
  98. package/force-app/main/default/lwc/searchBoxStyle/searchBoxStyle.css +10 -10
  99. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +17 -17
  100. package/force-app/main/default/staticresources/coveoheadless/definitions/api/analytics/case-assist-analytics.d.ts +2 -1
  101. package/force-app/main/default/staticresources/coveoheadless/definitions/api/analytics/insight-analytics.d.ts +2 -1
  102. package/force-app/main/default/staticresources/coveoheadless/definitions/api/analytics/search-analytics.d.ts +2 -1
  103. package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/search/query-suggest/query-suggest-request.d.ts +6 -1
  104. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-api.d.ts +2 -1
  105. package/force-app/main/default/staticresources/coveoheadless/definitions/app/engine-configuration.d.ts +34 -0
  106. package/force-app/main/default/staticresources/coveoheadless/definitions/app/insight-thunk-extra-arguments.d.ts +2 -0
  107. package/force-app/main/default/staticresources/coveoheadless/definitions/app/search-thunk-extra-arguments.d.ts +2 -0
  108. package/force-app/main/default/staticresources/coveoheadless/definitions/app/thunk-extra-arguments.d.ts +9 -0
  109. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search-box/headless-search-box-options.d.ts +9 -1
  110. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/standalone-search-box/headless-standalone-search-box-options.d.ts +1 -0
  111. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/generated-answer/headless-core-generated-answer.d.ts +1 -25
  112. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/generated-answer/headless-searchapi-generated-answer.d.ts +2 -1
  113. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/field-suggestions/facet/headless-field-suggestions.d.ts +1 -0
  114. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/headless-answerapi-generated-answer.d.ts +2 -1
  115. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/headless-generated-answer-with-follow-ups.d.ts +2 -1
  116. package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/analytics-utils.d.ts +1 -0
  117. package/force-app/main/default/staticresources/coveoheadless/definitions/features/attached-results/attached-results-analytics-actions.d.ts +4 -0
  118. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/query-suggest/commerce-query-suggest-slice.d.ts +3 -2
  119. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/query-suggest/query-suggest-actions.d.ts +16 -5
  120. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-analytics-client.d.ts +38 -0
  121. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-insight-analytics-actions.d.ts +2 -2
  122. package/force-app/main/default/staticresources/coveoheadless/definitions/features/result/result-insight-analytics-actions.d.ts +1 -0
  123. package/force-app/main/default/staticresources/coveoheadless/headless.js +17 -17
  124. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
  125. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +16 -16
  126. package/force-app/main/default/staticresources/dompurify/purify.min.js +2 -2
  127. package/package.json +8 -8
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Simple Apex Controller to fetch data for Headless initialization specific to the Case Assist use case.
3
+ */
4
+ global with sharing class CaseAssistController {
5
+ /**
6
+ * Get the configuration object for the initialization of Coveo Headless Case Assist.
7
+ * This uses the sample token with Case Assist permissions.
8
+ * @return {String} A serialized object containing the Case Assist Headless configuration.
9
+ */
10
+ @AuraEnabled(cacheable=true)
11
+ public static String getHeadlessConfiguration() {
12
+ /**
13
+ * e.g. To switch to the Coveo Token Provider, you simply need to replace the following line by:
14
+ * `return CoveoTokenProvider.getHeadlessConfiguration();`
15
+ */
16
+ return SampleCaseAssistTokenProvider.getHeadlessConfiguration();
17
+ }
18
+ }
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ApexClass xmlns="urn:metadata.tooling.soap.sforce.com">
3
+ <apiVersion>53.0</apiVersion>
4
+ <status>Active</status>
5
+ </ApexClass>
@@ -0,0 +1,15 @@
1
+ @isTest
2
+ private class CaseAssistControllerTest {
3
+ // This API key is intentionally public — it belongs to a sample organization used for samples/docs.
4
+ static final String sampleHeadlessConfiguration = '{"accessToken":"xx564559b1-0045-48e1-953c-3addd1ee4457","organizationId":"searchuisamples"}';
5
+
6
+ @IsTest
7
+ static void shouldReturnStringifiedConfiguration() {
8
+ Test.startTest();
9
+ System.assertEquals(
10
+ sampleHeadlessConfiguration,
11
+ CaseAssistController.getHeadlessConfiguration()
12
+ );
13
+ Test.stopTest();
14
+ }
15
+ }
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ApexClass xmlns="urn:metadata.tooling.soap.sforce.com">
3
+ <apiVersion>53.0</apiVersion>
4
+ <status>Active</status>
5
+ </ApexClass>
@@ -1,7 +1,7 @@
1
1
  @isTest
2
2
  private class HeadlessControllerTest {
3
3
  // This API key is intentionally public — it belongs to a sample organization used for samples/docs.
4
- static final String sampleHeadlessConfiguration = '{"accessToken":"xx564559b1-0045-48e1-953c-3addd1ee4457","organizationId":"searchuisamples"}';
4
+ static final String sampleHeadlessConfiguration = '{"accessToken":"xxb9c21134-8dad-4d53-8a5e-855bacddba8f","organizationId":"searchuisamples"}';
5
5
  @IsTest
6
6
  static void shouldReturnStringifiedConfiguration() {
7
7
  Test.startTest();
@@ -15,9 +15,11 @@ global with sharing class InsightController {
15
15
  @AuraEnabled(cacheable=true)
16
16
  public static String getHeadlessConfiguration(String recordId) {
17
17
  /**
18
- * e.g. To switch to the Insight Token Provider, you simply need to replace the following line by:
18
+ * The SampleInsightTokenProvider returns a static sample configuration with
19
+ * hardcoded demo credentials for the Coveo sample organization.
20
+ * To switch to the real Insight Token Provider, replace the following line by:
19
21
  * `return InsightTokenProvider.getHeadlessConfiguration(recordId);`
20
22
  */
21
- return SampleTokenProvider.getHeadlessConfiguration();
23
+ return SampleInsightTokenProvider.getHeadlessConfiguration(recordId);
22
24
  }
23
25
  }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Return a static sample configuration with pre-configured value for the sample organization (Case Assist use case).
3
+ */
4
+ global with sharing class SampleCaseAssistTokenProvider implements ITokenProvider {
5
+ /**
6
+ * @see `ITokenProvider.getHeadlessConfiguration`.
7
+ */
8
+ @AuraEnabled
9
+ global static String getHeadlessConfiguration() {
10
+ Map<String, String> headlessConfiguration = new Map<String, String>();
11
+ headlessConfiguration.put('organizationId', 'searchuisamples');
12
+ headlessConfiguration.put(
13
+ 'accessToken',
14
+ // This API key is intentionally public — it belongs to a sample organization used for samples/docs.
15
+ 'xx564559b1-0045-48e1-953c-3addd1ee4457'
16
+ );
17
+ return JSON.serialize(headlessConfiguration);
18
+ }
19
+ }
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ApexClass xmlns="urn:metadata.tooling.soap.sforce.com">
3
+ <apiVersion>50.0</apiVersion>
4
+ <status>Active</status>
5
+ </ApexClass>
@@ -0,0 +1,15 @@
1
+ @isTest
2
+ private class SampleCaseAssistTokenProviderTest {
3
+ // This API key is intentionally public — it belongs to a sample organization used for samples/docs.
4
+ static final String sampleHeadlessConfiguration = '{"accessToken":"xx564559b1-0045-48e1-953c-3addd1ee4457","organizationId":"searchuisamples"}';
5
+
6
+ @IsTest
7
+ static void shouldReturnStringifiedConfiguration() {
8
+ Test.startTest();
9
+ System.assertEquals(
10
+ sampleHeadlessConfiguration,
11
+ SampleCaseAssistTokenProvider.getHeadlessConfiguration()
12
+ );
13
+ Test.stopTest();
14
+ }
15
+ }
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ApexClass xmlns="urn:metadata.tooling.soap.sforce.com">
3
+ <apiVersion>50.0</apiVersion>
4
+ <status>Active</status>
5
+ </ApexClass>
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Return a static sample configuration with pre-configured value for the sample organization (Insight use case).
3
+ */
4
+ global with sharing class SampleInsightTokenProvider implements IInsightTokenProvider {
5
+ @AuraEnabled
6
+ global static String getHeadlessConfiguration() {
7
+ return getHeadlessConfiguration('');
8
+ }
9
+
10
+ /**
11
+ * @see `IInsightTokenProvider.getHeadlessConfiguration`.
12
+ */
13
+ @AuraEnabled(continuation=true cacheable=false)
14
+ global static String getHeadlessConfiguration(String recordId) {
15
+ Map<String, String> headlessConfiguration = new Map<String, String>();
16
+ headlessConfiguration.put('organizationId', 'searchuisamples');
17
+ headlessConfiguration.put(
18
+ 'accessToken',
19
+ // This API key is intentionally public — it belongs to a sample organization used for samples/docs.
20
+ 'xx564559b1-0045-48e1-953c-3addd1ee4457'
21
+ );
22
+ return JSON.serialize(headlessConfiguration);
23
+ }
24
+ }
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ApexClass xmlns="urn:metadata.tooling.soap.sforce.com">
3
+ <apiVersion>50.0</apiVersion>
4
+ <status>Active</status>
5
+ </ApexClass>
@@ -0,0 +1,24 @@
1
+ @isTest
2
+ private class SampleInsightTokenProviderTest {
3
+ // This API key is intentionally public — it belongs to a sample organization used for samples/docs.
4
+ static final String sampleHeadlessConfiguration = '{"accessToken":"xx564559b1-0045-48e1-953c-3addd1ee4457","organizationId":"searchuisamples"}';
5
+ @IsTest
6
+ static void shouldReturnStringifiedConfiguration() {
7
+ Test.startTest();
8
+ System.assertEquals(
9
+ sampleHeadlessConfiguration,
10
+ SampleInsightTokenProvider.getHeadlessConfiguration('')
11
+ );
12
+ Test.stopTest();
13
+ }
14
+
15
+ @IsTest
16
+ static void shouldReturnStringifiedConfigurationWithNoArgs() {
17
+ Test.startTest();
18
+ System.assertEquals(
19
+ sampleHeadlessConfiguration,
20
+ SampleInsightTokenProvider.getHeadlessConfiguration()
21
+ );
22
+ Test.stopTest();
23
+ }
24
+ }
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ApexClass xmlns="urn:metadata.tooling.soap.sforce.com">
3
+ <apiVersion>50.0</apiVersion>
4
+ <status>Active</status>
5
+ </ApexClass>
@@ -11,7 +11,8 @@ global with sharing class SampleTokenProvider implements ITokenProvider {
11
11
  headlessConfiguration.put(
12
12
  'accessToken',
13
13
  // This API key is intentionally public — it belongs to a sample organization used for samples/docs.
14
- 'xx564559b1-0045-48e1-953c-3addd1ee4457'
14
+ // Name: Quantic__sampleTokenProvider_key_dnd - Anonymous Search key.
15
+ 'xxb9c21134-8dad-4d53-8a5e-855bacddba8f'
15
16
  );
16
17
  return JSON.serialize(headlessConfiguration);
17
18
  }
@@ -1,7 +1,7 @@
1
1
  @isTest
2
2
  private class SampleTokenProviderTest {
3
3
  // This API key is intentionally public — it belongs to a sample organization used for samples/docs.
4
- static final String sampleHeadlessConfiguration = '{"accessToken":"xx564559b1-0045-48e1-953c-3addd1ee4457","organizationId":"searchuisamples"}';
4
+ static final String sampleHeadlessConfiguration = '{"accessToken":"xxb9c21134-8dad-4d53-8a5e-855bacddba8f","organizationId":"searchuisamples"}';
5
5
  @IsTest
6
6
  static void shouldReturnStringifiedConfiguration() {
7
7
  Test.startTest();
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Facet response builders for the breadcrumb manager example page
3
+ * (`exampleQuanticBreadcrumbManager.html`), which registers four facets:
4
+ * filetype (regular), ytlikecount (numeric), date (timeframe), and
5
+ * geographicalhierarchy (category).
6
+ */
7
+ type State = 'idle' | 'selected';
8
+
9
+ const filetypeFacet = (state: State = 'idle') => ({
10
+ facetId: 'filetype',
11
+ field: 'filetype',
12
+ moreValuesAvailable: false,
13
+ values: [
14
+ {value: 'YouTubeVideo', state, numberOfResults: 100},
15
+ {value: 'txt', state: 'idle', numberOfResults: 50},
16
+ ],
17
+ indexScore: 0.5,
18
+ });
19
+
20
+ const numericFacet = (state: State = 'idle') => ({
21
+ facetId: 'ytlikecount',
22
+ field: 'ytlikecount',
23
+ moreValuesAvailable: false,
24
+ values: [
25
+ {start: 0, end: 1000, endInclusive: false, state, numberOfResults: 100},
26
+ {
27
+ start: 1000,
28
+ end: 2000,
29
+ endInclusive: false,
30
+ state: 'idle',
31
+ numberOfResults: 50,
32
+ },
33
+ ],
34
+ indexScore: 0.4,
35
+ });
36
+
37
+ const timeframeFacet = (state: State = 'idle') => ({
38
+ facetId: 'date',
39
+ field: 'date',
40
+ moreValuesAvailable: false,
41
+ values: [
42
+ {start: 'past-1-week', end: 'now', endInclusive: false, state, numberOfResults: 100},
43
+ {
44
+ start: 'past-1-month',
45
+ end: 'now',
46
+ endInclusive: false,
47
+ state: 'idle',
48
+ numberOfResults: 50,
49
+ },
50
+ {
51
+ start: 'past-6-month',
52
+ end: 'now',
53
+ endInclusive: false,
54
+ state: 'idle',
55
+ numberOfResults: 40,
56
+ },
57
+ {
58
+ start: 'past-1-year',
59
+ end: 'now',
60
+ endInclusive: false,
61
+ state: 'idle',
62
+ numberOfResults: 30,
63
+ },
64
+ {
65
+ start: 'past-10-year',
66
+ end: 'now',
67
+ endInclusive: false,
68
+ state: 'idle',
69
+ numberOfResults: 20,
70
+ },
71
+ ],
72
+ indexScore: 0.3,
73
+ });
74
+
75
+ const categoryFacet = (state: State = 'idle') => ({
76
+ facetId: 'geographicalhierarchy',
77
+ field: 'geographicalhierarchy',
78
+ moreValuesAvailable: false,
79
+ values:
80
+ state === 'selected'
81
+ ? [
82
+ {
83
+ value: 'North America',
84
+ state: 'selected',
85
+ numberOfResults: 100,
86
+ children: [],
87
+ path: ['North America'],
88
+ isLeafValue: false,
89
+ },
90
+ ]
91
+ : [
92
+ {
93
+ value: 'North America',
94
+ state: 'idle',
95
+ numberOfResults: 100,
96
+ children: [],
97
+ path: ['North America'],
98
+ isLeafValue: false,
99
+ },
100
+ {
101
+ value: 'Africa',
102
+ state: 'idle',
103
+ numberOfResults: 50,
104
+ children: [],
105
+ path: ['Africa'],
106
+ isLeafValue: false,
107
+ },
108
+ ],
109
+ indexScore: 0.2,
110
+ });
111
+
112
+ const allFacets = (selected?: 'regular' | 'numeric' | 'timeframe' | 'category') => [
113
+ filetypeFacet(selected === 'regular' ? 'selected' : 'idle'),
114
+ numericFacet(selected === 'numeric' ? 'selected' : 'idle'),
115
+ timeframeFacet(selected === 'timeframe' ? 'selected' : 'idle'),
116
+ categoryFacet(selected === 'category' ? 'selected' : 'idle'),
117
+ ];
118
+
119
+ export const allIdle = allFacets();
120
+ export const regularSelected = allFacets('regular');
121
+ export const numericSelected = allFacets('numeric');
122
+ export const timeframeSelected = allFacets('timeframe');
123
+ export const categorySelected = allFacets('category');
124
+
125
+ export const regularAndTimeframeSelected = [
126
+ filetypeFacet('selected'),
127
+ numericFacet('idle'),
128
+ timeframeFacet('selected'),
129
+ categoryFacet('idle'),
130
+ ];
@@ -1,12 +1,13 @@
1
1
  import {BreadcrumbManagerObject} from './pageObject';
2
- import {quanticBase} from '../../../../../../playwright/fixtures/baseFixture';
3
- import {SearchObject} from '../../../../../../playwright/page-object/searchObject';
2
+ import {facetBase} from '../../../../../../playwright/fixtures/baseFacetFixture';
3
+ import {BaseFacetObject} from '../../../../../../playwright/page-object/baseFacetObject';
4
4
  import {
5
5
  searchRequestRegex,
6
6
  insightSearchRequestRegex,
7
7
  } from '../../../../../../playwright/utils/requests';
8
8
  import {InsightSetupObject} from '../../../../../../playwright/page-object/insightSetupObject';
9
9
  import {useCaseEnum} from '../../../../../../playwright/utils/useCase';
10
+ import {allIdle} from './data';
10
11
 
11
12
  const breadcrumbManagerUrl = 's/quantic-breadcrumb-manager';
12
13
 
@@ -17,7 +18,6 @@ interface BreadcrumbManagerOptions {
17
18
 
18
19
  type QuanticBreadcrumbManagerE2EFixtures = {
19
20
  breadcrumbManager: BreadcrumbManagerObject;
20
- search: SearchObject;
21
21
  options: Partial<BreadcrumbManagerOptions>;
22
22
  };
23
23
 
@@ -32,43 +32,54 @@ type QuanticBreadcrumbManagerE2eInsightFixtures =
32
32
  };
33
33
 
34
34
  export const testSearch =
35
- quanticBase.extend<QuanticBreadcrumbManagerE2ESearchFixtures>({
35
+ facetBase.extend<QuanticBreadcrumbManagerE2ESearchFixtures>({
36
36
  options: {},
37
37
  urlHash: '',
38
- search: async ({page}, use) => {
39
- await use(new SearchObject(page, searchRequestRegex));
38
+ facetResponses: {responses: [allIdle]},
39
+ baseFacet: async ({page}, use) => {
40
+ await use(new BaseFacetObject(page, searchRequestRegex));
40
41
  },
41
42
  breadcrumbManager: async (
42
- {page, options, configuration, search, urlHash},
43
+ {page, options, configuration, baseFacet, urlHash, facetResponses},
43
44
  use
44
45
  ) => {
46
+ await baseFacet.mockSearchWithBaseResponse();
45
47
  await page.goto(
46
48
  urlHash ? `${breadcrumbManagerUrl}#${urlHash}` : breadcrumbManagerUrl
47
49
  );
50
+ await baseFacet.mockSearchWithFacetResponseSequence(
51
+ facetResponses?.responses
52
+ );
48
53
  configuration.configure(options);
49
- await search.waitForSearchResponse();
54
+ await baseFacet.waitForSearchResponse();
50
55
  await use(new BreadcrumbManagerObject(page));
51
56
  },
52
57
  });
53
58
 
54
59
  export const testInsight =
55
- quanticBase.extend<QuanticBreadcrumbManagerE2eInsightFixtures>({
60
+ facetBase.extend<QuanticBreadcrumbManagerE2eInsightFixtures>({
56
61
  options: {},
57
- search: async ({page}, use) => {
58
- await use(new SearchObject(page, insightSearchRequestRegex));
62
+ facetResponses: {responses: [allIdle]},
63
+ baseFacet: async ({page}, use) => {
64
+ await use(new BaseFacetObject(page, insightSearchRequestRegex));
59
65
  },
60
66
  insightSetup: async ({page}, use) => {
61
67
  await use(new InsightSetupObject(page));
62
68
  },
63
69
  breadcrumbManager: async (
64
- {page, options, search, configuration, insightSetup},
70
+ {page, options, baseFacet, configuration, insightSetup, facetResponses},
65
71
  use
66
72
  ) => {
67
73
  await page.goto(breadcrumbManagerUrl);
74
+ await baseFacet.mockSearchWithFacetResponseSequence(
75
+ facetResponses?.responses
76
+ );
68
77
  configuration.configure({...options, useCase: useCaseEnum.insight});
69
78
  await insightSetup.waitForInsightInterfaceInitialization();
70
- await search.performSearch();
71
- await search.waitForSearchResponse();
79
+ await Promise.all([
80
+ baseFacet.waitForSearchResponse(),
81
+ baseFacet.performSearch(),
82
+ ]);
72
83
  await use(new BreadcrumbManagerObject(page));
73
84
  },
74
85
  });
@@ -3,6 +3,14 @@ import {
3
3
  useCaseEnum,
4
4
  useCaseTestCases,
5
5
  } from '../../../../../../playwright/utils/useCase';
6
+ import {
7
+ regularSelected,
8
+ numericSelected,
9
+ timeframeSelected,
10
+ categorySelected,
11
+ regularAndTimeframeSelected,
12
+ allIdle,
13
+ } from './data';
6
14
 
7
15
  const fixtures = {
8
16
  search: testSearch,
@@ -23,17 +31,22 @@ useCaseTestCases.forEach((useCase) => {
23
31
  test.describe(`quantic breadcrumb manager ${useCase.label}`, () => {
24
32
  test.describe('when de-selecting a facet value', () => {
25
33
  test.describe('with regular facet values', () => {
34
+ test.use({
35
+ facetResponses: {
36
+ responses: [allIdle, regularSelected, allIdle],
37
+ },
38
+ });
26
39
  test('should trigger a new search and log analytics', async ({
27
40
  breadcrumbManager,
28
- search,
41
+ baseFacet,
29
42
  }) => {
30
43
  const firstRegularFacetValue =
31
44
  await breadcrumbManager.firstRegularFacetValue;
32
- const searchResponsePromise = search.waitForSearchResponse();
45
+ const searchResponsePromise = baseFacet.waitForSearchResponse();
33
46
  await breadcrumbManager.clickFirstRegularFacetLink();
34
47
  await searchResponsePromise;
35
48
 
36
- const secondSearchResponsePromise = search.waitForSearchResponse();
49
+ const secondSearchResponsePromise = baseFacet.waitForSearchResponse();
37
50
  const breadcrumbAnalyticsPromise =
38
51
  breadcrumbManager.waitForBreadcrumbFacetUaAnalytics({
39
52
  facetValue: firstRegularFacetValue,
@@ -45,18 +58,23 @@ useCaseTestCases.forEach((useCase) => {
45
58
  });
46
59
 
47
60
  test.describe('with numeric facet values', () => {
61
+ test.use({
62
+ facetResponses: {
63
+ responses: [allIdle, numericSelected, allIdle],
64
+ },
65
+ });
48
66
  test('should trigger a new search and log analytics', async ({
49
67
  breadcrumbManager,
50
- search,
68
+ baseFacet,
51
69
  }) => {
52
70
  const [facetRangeStart, facetRangeEnd] =
53
71
  (await breadcrumbManager.firstNumericFacetValue)?.split(' - ') ??
54
72
  [];
55
- const searchResponsePromise = search.waitForSearchResponse();
73
+ const searchResponsePromise = baseFacet.waitForSearchResponse();
56
74
  await breadcrumbManager.clickFirstNumericFacetLink();
57
75
  await searchResponsePromise;
58
76
 
59
- const secondSearchResponsePromise = search.waitForSearchResponse();
77
+ const secondSearchResponsePromise = baseFacet.waitForSearchResponse();
60
78
  // We use the facet display value to compare, but the display value is localized and can contain non-numeric characters while the analytics request doesn't contain those characters.
61
79
  const breadcrumbAnalyticsPromise =
62
80
  breadcrumbManager.waitForBreadcrumbFacetUaAnalytics({
@@ -70,17 +88,22 @@ useCaseTestCases.forEach((useCase) => {
70
88
  });
71
89
 
72
90
  test.describe('with timeframe|date facet values', () => {
91
+ test.use({
92
+ facetResponses: {
93
+ responses: [allIdle, timeframeSelected, allIdle],
94
+ },
95
+ });
73
96
  test('should trigger a new search and log analytics', async ({
74
97
  breadcrumbManager,
75
- search,
98
+ baseFacet,
76
99
  }) => {
77
100
  const facetValue = await breadcrumbManager.firstTimeframeFacetValue;
78
101
  test.expect(facetValue).not.toBeNull();
79
- const searchResponsePromise = search.waitForSearchResponse();
102
+ const searchResponsePromise = baseFacet.waitForSearchResponse();
80
103
  await breadcrumbManager.clickFirstTimeframeFacetLink();
81
104
  await searchResponsePromise;
82
105
 
83
- const secondSearchResponsePromise = search.waitForSearchResponse();
106
+ const secondSearchResponsePromise = baseFacet.waitForSearchResponse();
84
107
  // We use the facet display value to compare, but the display value is prettified and is transformed to be human readable, while the analytics request isn't.
85
108
  const [expectedFacetRangeStart, expectedFacetRangeEnd] =
86
109
  datetimeFacetLabelToValue[facetValue!].split('..');
@@ -96,17 +119,22 @@ useCaseTestCases.forEach((useCase) => {
96
119
  });
97
120
 
98
121
  test.describe('with category facet values', () => {
122
+ test.use({
123
+ facetResponses: {
124
+ responses: [allIdle, categorySelected, allIdle],
125
+ },
126
+ });
99
127
  test('should trigger a new search and log analytics', async ({
100
128
  breadcrumbManager,
101
- search,
129
+ baseFacet,
102
130
  }) => {
103
131
  const facetValue = await breadcrumbManager.firstCategoryFacetValue;
104
132
  test.expect(facetValue).not.toBeNull();
105
- const searchResponsePromise = search.waitForSearchResponse();
133
+ const searchResponsePromise = baseFacet.waitForSearchResponse();
106
134
  await breadcrumbManager.clickFirstCategoryFacetLink();
107
135
  await searchResponsePromise;
108
136
 
109
- const secondSearchResponsePromise = search.waitForSearchResponse();
137
+ const secondSearchResponsePromise = baseFacet.waitForSearchResponse();
110
138
  const expectedFacetValue = facetValue!;
111
139
  const breadcrumbAnalyticsPromise =
112
140
  breadcrumbManager.waitForBreadcrumbFacetUaAnalytics({
@@ -120,20 +148,30 @@ useCaseTestCases.forEach((useCase) => {
120
148
  });
121
149
 
122
150
  test.describe('when clicking on the clear all filters button', () => {
151
+ test.use({
152
+ facetResponses: {
153
+ responses: [
154
+ allIdle,
155
+ regularSelected,
156
+ regularAndTimeframeSelected,
157
+ allIdle,
158
+ ],
159
+ },
160
+ });
123
161
  test('should send a clear all filters analytics event and clear all selected facets values', async ({
124
162
  breadcrumbManager,
125
- search,
163
+ baseFacet,
126
164
  }) => {
127
- const searchResponsePromise = search.waitForSearchResponse();
165
+ const searchResponsePromise = baseFacet.waitForSearchResponse();
128
166
  await breadcrumbManager.clickFirstRegularFacetLink();
129
167
  await searchResponsePromise;
130
168
 
131
- const searchResponsePromiseTwo = search.waitForSearchResponse();
169
+ const searchResponsePromiseTwo = baseFacet.waitForSearchResponse();
132
170
  await breadcrumbManager.clickFirstTimeframeFacetLink();
133
171
  await searchResponsePromiseTwo;
134
172
 
135
173
  await test.expect(breadcrumbManager.clearAllButton).toBeVisible();
136
- const clearAllSearchResponsePromise = search.waitForSearchResponse();
174
+ const clearAllSearchResponsePromise = baseFacet.waitForSearchResponse();
137
175
  const clearAllAnalyticsPromise =
138
176
  breadcrumbManager.waitForBreadcrumbResetAllUaAnalytics();
139
177
  await breadcrumbManager.clickClearAllButton();
@@ -152,6 +190,9 @@ useCaseTestCases.forEach((useCase) => {
152
190
  const facetSelectedHash = 'f-filetype=YouTubeVideo';
153
191
  test.use({
154
192
  urlHash: facetSelectedHash,
193
+ facetResponses: {
194
+ responses: [regularSelected],
195
+ },
155
196
  });
156
197
 
157
198
  test('should have a facet selected in the breadcrumb manager', async ({
@@ -1,9 +1,8 @@
1
1
  .card {
2
2
  position: relative;
3
- padding: 1rem 0.9rem;
4
- background: var(--lwc-colorBackgroundAlt, #ffffff);
5
- border: var(--lwc-borderWidthThin, 1px) solid var(--lwc-colorBorder, #dddbda);
6
- border-radius: 0.25rem;
3
+ background: var(--slds-g-color-surface-1, var(--lwc-colorBackgroundAlt, #ffffff));
4
+ border: var(--slds-g-sizing-border-1, var(--lwc-borderWidthThin, 1px)) solid var(--slds-g-color-neutral-base-90, var(--lwc-colorBorder, #dddbda));
5
+ border-radius: var(--slds-g-radius-border-2, 0.25rem);
7
6
  background-clip: padding-box;
8
7
  -webkit-box-shadow: 0 2px 2px 0 rgb(0 0 0 / 10%);
9
8
  box-shadow: 0 2px 2px 0 rgb(0 0 0 / 10%);
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <host>
3
- <article class="card">
3
+ <article class="card slds-p-around_medium">
4
4
  <header class="slds-grid slds-p-horizontal_x-small slds-has-flexi-truncate">
5
5
  <div class="slds-media__body card_focusable-header" onclick={handleHeaderClick} onkeydown={handleHeaderKeyDown}
6
6
  role="button" tabindex="0" data-testid="card-container__header">
@@ -13,19 +13,19 @@
13
13
 
14
14
  .carousel__indicator {
15
15
  width: 3.25rem;
16
- height: 0.25rem;
16
+ height: var(--slds-g-sizing-2, 0.25rem);
17
17
  border: 0;
18
- border-radius: var(--lwc-borderRadiusMedium, 0.25rem);
19
- background-color: var(--lwc-brandLightActive, #e3e5ed);
18
+ border-radius: var(--slds-g-radius-border-2, var(--lwc-borderRadiusMedium, 0.25rem));
19
+ background-color: var(--slds-g-color-accent-light-1, var(--lwc-brandLightActive, #e3e5ed));
20
20
  transition: 0.2s;
21
21
  }
22
22
 
23
23
  .carousel__indicator--active {
24
- background-color: var(--lwc-brandPrimary, #1b96ff);
24
+ background-color: var(--slds-g-color-accent-1, var(--lwc-brandPrimary, #1b96ff));
25
25
  }
26
26
 
27
27
  .carousel__indicator:hover {
28
- background-color: var(--lwc-brandPrimaryActive, #0176d3);
28
+ background-color: var(--slds-g-color-accent-2, var(--lwc-brandPrimaryActive, #0176d3));
29
29
  }
30
30
 
31
31
  .carousel__previous-navigation {
@@ -1,5 +1,5 @@
1
1
  // @ts-ignore
2
- import getHeadlessConfiguration from '@salesforce/apex/HeadlessController.getHeadlessConfiguration';
2
+ import getHeadlessConfiguration from '@salesforce/apex/CaseAssistController.getHeadlessConfiguration';
3
3
  import {
4
4
  getHeadlessBindings,
5
5
  loadDependencies,