@coveops/abi 1.0.7 → 1.2.0

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.
@@ -9,8 +9,8 @@ async function main() {
9
9
  const searchBox = document.querySelector("#searchbox");
10
10
  searchBox && initStandaloneSearchBox(searchBox);
11
11
  // const platformUrl = "https://platform.cloud.coveo.com"!;
12
- // const organizationId = "anheuserbuschinbevprod"!;
13
- // const accessToken = "xa80ebf41-0b5a-4386-a423-d465a2b38f90"!;
12
+ // const organizationId = "anheuserbuschinbevkmnonprod"!;
13
+ // const accessToken = "x2242b5a3-4f36-44f9-99c7-074b09a262fa"!;
14
14
  // await searchInterface.initialize({
15
15
  // accessToken,
16
16
  // organizationId,
@@ -61,8 +61,8 @@ async function main() {
61
61
  }
62
62
  async function initStandaloneSearchBox(searchBox) {
63
63
  const platformUrl = "https://platform.cloud.coveo.com";
64
- const organizationId = "anheuserbuschinbevprod";
65
- const accessToken = "xa80ebf41-0b5a-4386-a423-d465a2b38f90";
64
+ const organizationId = "anheuserbuschinbevkmnonprod";
65
+ const accessToken = "x2242b5a3-4f36-44f9-99c7-074b09a262fa";
66
66
  await searchBox.initialize({
67
67
  accessToken,
68
68
  organizationId,
@@ -90,8 +90,8 @@ async function initStandaloneSearchBox(searchBox) {
90
90
  }
91
91
  async function initSearch(searchInterface) {
92
92
  const platformUrl = "https://platform.cloud.coveo.com";
93
- const organizationId = "anheuserbuschinbevprod";
94
- const accessToken = "xa80ebf41-0b5a-4386-a423-d465a2b38f90";
93
+ const organizationId = "anheuserbuschinbevkmnonprod";
94
+ const accessToken = "x2242b5a3-4f36-44f9-99c7-074b09a262fa";
95
95
  await searchInterface.initialize({
96
96
  accessToken,
97
97
  organizationId,
@@ -106,13 +106,24 @@ async function initSearch(searchInterface) {
106
106
  request.body = JSON.stringify(body);
107
107
  }
108
108
  return request;
109
+ },
110
+ search: {
111
+ preprocessSearchResponseMiddleware: (response) => {
112
+ response.body.results.forEach((result) => {
113
+ if (result.raw.snavatar) {
114
+ result.raw.resultpicture = 'https://abinbevwwdev.service-now.com/' + result.raw.snavatar;
115
+ }
116
+ return result;
117
+ });
118
+ return response;
119
+ },
109
120
  }
110
121
  });
111
122
  searchInterface.executeFirstSearch();
112
123
  }
113
124
  async function initRecs() {
114
- const organizationId = "anheuserbuschinbevprod";
115
- const accessToken = "xa80ebf41-0b5a-4386-a423-d465a2b38f90";
125
+ const organizationId = "anheuserbuschinbevkmnonprod";
126
+ const accessToken = "x2242b5a3-4f36-44f9-99c7-074b09a262fa";
116
127
  const recsInterface = document.querySelector('#recs');
117
128
  await (recsInterface === null || recsInterface === void 0 ? void 0 : recsInterface.initialize({
118
129
  accessToken: accessToken,
@@ -25,6 +25,8 @@ const DocumentsTemplate = "<style>\n /* .field {\n display: inline-flex;\n
25
25
 
26
26
  const MediaTemplate = "<style>\n .field {\n display: inline-flex;\n align-items: center;\n }\n\n .field-label {\n font-weight: bold;\n margin-right: 0.25rem;\n }\n atomic-result-section-excerpt {\n font-size: 1.3rem !important;\n margin-top: 0.875rem !important;\n max-height: unset !important;\n line-height: normal !important;\n }\n\n atomic-result-section-bottom-metadata {\n margin-top: 2px;\n font-size: 1rem !important;\n color: #A6A6A6 !important;\n }\n\n atomic-result-section-bottom-metadata a {\n color: #A6A6A6 !important;\n }\n\n\n atomic-result-section-title a {\n color: #CAA144 !important;\n font-size: 1.7rem !important;\n max-height: unset !important;\n line-height: normal !important;\n }\n\n atomic-result-section-title a:visited {\n color: black !important;\n }\n atomic-result-section-visual {\n width: 3rem !important;\n height: 5rem !important;\n display: grid;\n align-items: center;\n justify-content: center;\n\n }\n\n atomic-result-section-bottom-metadata {\n margin-top: 2px;\n color: #A6A6A6 !important;\n font-size: 1rem !important;\n margin-right: 3px;\n line-height: 18px !important;\n display: grid;\n grid-template-columns: auto auto auto;\n gap: 1rem;\n align-items: center;\n }\n\n atomic-result-date{\n font-size:1.0rem;\n }\n</style>\n\n<atomic-result-section-visual>\n <atomic-field-condition class=\"field\" must-match-filetype=\"mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,mpg\">\n <img src=\"https://cdn.jsdelivr.net/npm/@coveops/abi@latest/dist/abi/images/Movies.png\" alt=\"Image\">\n <!-- <atomic-icon class=\"icon\"></atomic-icon>\n <img src=\"https://abiglobal--c.vf.force.com/resource/PP_Coveo/img/Movies.png\" class=\"thumbnail\"> -->\n </atomic-field-condition>\n <atomic-field-condition class=\"field\" must-match-filetype=\"gif,jpeg,jpg,png,bmp,Image\">\n <img src=\"https://cdn.jsdelivr.net/npm/@coveops/abi@latest/dist/abi/images/Images.png\" alt=\"Image\">\n <!-- <atomic-icon class=\"icon\"></atomic-icon>\n <img src=\"https://abiglobal--c.vf.force.com/resource/PP_Coveo/img/Images.png\" class=\"thumbnail\"> -->\n </atomic-field-condition>\n \n</atomic-result-section-visual>\n\n<atomic-result-section-title>\n <atomic-result-link> <a slot=\"attributes\" target=\"_blank\"></a></atomic-result-link>\n</atomic-result-section-title>\n\n\n<atomic-result-section-bottom-metadata>\n <span>\n <atomic-text value=\"Date: &nbsp;\"></atomic-text>\n <atomic-result-date></atomic-result-date>\n </span><span>\n <atomic-text value=\"Source: &nbsp;\"></atomic-text><atomic-result-text field=\"sourcetype\"></atomic-result-text>\n </span><span> <atomic-text value=\"Sharepoint: &nbsp;\"></atomic-text>\n <atomic-result-link><a slot=\"attributes\" target=\"_blank\"></a>\n <atomic-result-text field=\"spsitename\"></atomic-result-text>\n </atomic-result-link>\n </span>\n</atomic-result-section-bottom-metadata>\n";
27
27
 
28
+ const PeopleSnowTemplate = "<style>\n .field {\n display: inline-flex;\n align-items: center;\n line-height: normal !important;\n }\n\n .field-label {\n font-weight: bold;\n margin-right: 0.25rem;\n }\n\n atomic-result-section-bottom-metadata {\n display: grid;\n grid-template-columns: 1fr 1fr;\n font-size: 1.3rem !important;\n width: 100%;\n margin-top: 2px;\n max-height: 25rem !important;\n }\n\n atomic-result-section-title{\n color: #CAA144 !important;\n font-size: 1.7rem !important;\n max-height: unset !important;\n line-height: normal !important;\n }\n atomic-result-section-visual {\n width: 3rem !important;\n height: 5rem !important;\n display: grid;\n align-items: center;\n }\n atomic-result-image{\n width: auto !important;\n height: auto !important;\n }\n atomic-result-image img{\n border-radius: 20% !important;\n }\n</style>\n\n<atomic-result-section-visual>\n <atomic-field-condition class=\"field\" if-defined=\"resultpicture\">\n <atomic-result-image field=\"resultpicture\"></atomic-result-image>\n </atomic-field-condition>\n <atomic-field-condition class=\"field\" if-not-defined=\"resultpicture\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d=\"M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304l-91.4 0z\"/></svg>\n </atomic-field-condition>\n</atomic-result-section-visual>\n\n<atomic-result-section-title>\n <atomic-result-link href-template=\"/cheers?id=cheers_hub_profile&sys_id=${raw.snsysid}\">\n <a slot=\"attributes\" target=\"_blank\"></a>\n </atomic-result-link>\n</atomic-result-section-title>\n\n<atomic-result-section-bottom-metadata>\n\n <atomic-field-condition class=\"field\" if-defined=\"sntitle\">\n <span class=\"field-label\">\n <atomic-text value=\"Title\"></atomic-text>:\n </span>\n <atomic-result-text field=\"sntitle\"></atomic-result-text>\n </atomic-field-condition>\n <br>\n <atomic-field-condition class=\"field\" if-defined=\"snupreferredzone\">\n <span class=\"field-label\">\n <atomic-text value=\"Zone\"></atomic-text>:\n </span>\n <atomic-result-text field=\"snupreferredzone\"></atomic-result-text>\n </atomic-field-condition>\n \n <atomic-field-condition class=\"field\" if-defined=\"snbuilding\">\n <span class=\"field-label\">\n <atomic-text value=\"OfficeLocation\"></atomic-text>:\n </span>\n <atomic-result-text field=\"snbuilding\"></atomic-result-text>\n </atomic-field-condition>\n <atomic-field-condition class=\"field\" if-defined=\"snufunction\">\n <span class=\"field-label\">\n <atomic-text value=\"Function\"></atomic-text>:\n </span>\n <atomic-result-text field=\"snufunction\"></atomic-result-text>\n </atomic-field-condition>\n\n <atomic-field-condition class=\"field\" if-defined=\"snemail\">\n <span class=\"field-label\">\n <atomic-text value=\"Email\"></atomic-text>:\n </span>\n <atomic-result-text field=\"snemail\"></atomic-result-text>\n </atomic-field-condition>\n\n\n\n</atomic-result-section-bottom-metadata>\n";
29
+
28
30
  const ResultsManager = class {
29
31
  constructor(hostRef) {
30
32
  index.registerInstance(this, hostRef);
@@ -33,7 +35,7 @@ const ResultsManager = class {
33
35
  return atomic.waitForAtomic();
34
36
  }
35
37
  render() {
36
- return (index.h("atomic-result-list", null, index.h("atomic-result-template", { "must-match-filetype": 'mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,gif,jpeg,jpg,png,bmp,Image,mp3,mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,mpg' }, index.h("template", { innerHTML: MediaTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": "Site Pages" }, index.h("template", { innerHTML: SitePagesTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": "Knowledge Article" }, index.h("template", { innerHTML: KATemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'FAQ' }, index.h("template", { innerHTML: FAQTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'Quick Links' }, index.h("template", { innerHTML: QuickLinksTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'Application' }, index.h("template", { innerHTML: AppTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'eLearning' }, index.h("template", { innerHTML: ELearningTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'People' }, index.h("template", { innerHTML: PeopleTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'Documents' }, index.h("template", { innerHTML: DocumentsTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'Media' }, index.h("template", { innerHTML: MediaTemplate })), index.h("atomic-result-template", null, index.h("template", { innerHTML: template1 }))));
38
+ return (index.h("atomic-result-list", null, index.h("atomic-result-template", { "must-match-filetype": 'mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,gif,jpeg,jpg,png,bmp,Image,mp3,mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,mpg' }, index.h("template", { innerHTML: MediaTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": "Site Pages" }, index.h("template", { innerHTML: SitePagesTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": "Knowledge Article" }, index.h("template", { innerHTML: KATemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'FAQ' }, index.h("template", { innerHTML: FAQTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'Quick Links' }, index.h("template", { innerHTML: QuickLinksTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'Application' }, index.h("template", { innerHTML: AppTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'eLearning' }, index.h("template", { innerHTML: ELearningTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'People', "must-match-objecttype": 'Account' }, index.h("template", { innerHTML: PeopleTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'People', "must-match-filetype": 'sys_user' }, index.h("template", { innerHTML: PeopleSnowTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'Documents' }, index.h("template", { innerHTML: DocumentsTemplate })), index.h("atomic-result-template", { "must-match-abicontenttype": 'Media' }, index.h("template", { innerHTML: MediaTemplate })), index.h("atomic-result-template", null, index.h("template", { innerHTML: template1 }))));
37
39
  }
38
40
  };
39
41
 
@@ -10,6 +10,7 @@ import ELearningTemplate from "./ELearningTemplate.html";
10
10
  import PeopleTemplate from "./PeopleTemplate.html";
11
11
  import DocumentsTemplate from "./DocumentsTemplate.html";
12
12
  import MediaTemplate from "./MediaTemplate.html";
13
+ import PeopleSnowTemplate from './PeopleSnowTemplate.html';
13
14
  /**
14
15
  * Component used to manage results & result templates.
15
16
  * See https://docs.coveo.com/en/atomic/latest/usage/create-a-result-list/
@@ -34,8 +35,10 @@ export class ResultsManager {
34
35
  h("template", { innerHTML: AppTemplate })),
35
36
  h("atomic-result-template", { "must-match-abicontenttype": 'eLearning' },
36
37
  h("template", { innerHTML: ELearningTemplate })),
37
- h("atomic-result-template", { "must-match-abicontenttype": 'People' },
38
+ h("atomic-result-template", { "must-match-abicontenttype": 'People', "must-match-objecttype": 'Account' },
38
39
  h("template", { innerHTML: PeopleTemplate })),
40
+ h("atomic-result-template", { "must-match-abicontenttype": 'People', "must-match-filetype": 'sys_user' },
41
+ h("template", { innerHTML: PeopleSnowTemplate })),
39
42
  h("atomic-result-template", { "must-match-abicontenttype": 'Documents' },
40
43
  h("template", { innerHTML: DocumentsTemplate })),
41
44
  h("atomic-result-template", { "must-match-abicontenttype": 'Media' },
@@ -103,6 +103,17 @@ async function initSearch(searchInterface) {
103
103
  request.body = JSON.stringify(body);
104
104
  }
105
105
  return request;
106
+ },
107
+ search: {
108
+ preprocessSearchResponseMiddleware: (response) => {
109
+ response.body.results.forEach((result) => {
110
+ if (result.raw.snavatar) {
111
+ result.raw.resultpicture = 'https://abinbevwwdev.service-now.com/' + result.raw.snavatar;
112
+ }
113
+ return result;
114
+ });
115
+ return response;
116
+ },
106
117
  }
107
118
  });
108
119
  searchInterface.executeFirstSearch();
@@ -1052,8 +1052,8 @@ async function main() {
1052
1052
  const searchBox = document.querySelector("#searchbox");
1053
1053
  searchBox && initStandaloneSearchBox(searchBox);
1054
1054
  // const platformUrl = "https://platform.cloud.coveo.com"!;
1055
- // const organizationId = "anheuserbuschinbevprod"!;
1056
- // const accessToken = "xa80ebf41-0b5a-4386-a423-d465a2b38f90"!;
1055
+ // const organizationId = "anheuserbuschinbevkmnonprod"!;
1056
+ // const accessToken = "x2242b5a3-4f36-44f9-99c7-074b09a262fa"!;
1057
1057
  // await searchInterface.initialize({
1058
1058
  // accessToken,
1059
1059
  // organizationId,
@@ -1104,8 +1104,8 @@ async function main() {
1104
1104
  }
1105
1105
  async function initStandaloneSearchBox(searchBox) {
1106
1106
  const platformUrl = "https://platform.cloud.coveo.com";
1107
- const organizationId = "anheuserbuschinbevprod";
1108
- const accessToken = "xa80ebf41-0b5a-4386-a423-d465a2b38f90";
1107
+ const organizationId = "anheuserbuschinbevkmnonprod";
1108
+ const accessToken = "x2242b5a3-4f36-44f9-99c7-074b09a262fa";
1109
1109
  await searchBox.initialize({
1110
1110
  accessToken,
1111
1111
  organizationId,
@@ -1133,8 +1133,8 @@ async function initStandaloneSearchBox(searchBox) {
1133
1133
  }
1134
1134
  async function initSearch(searchInterface) {
1135
1135
  const platformUrl = "https://platform.cloud.coveo.com";
1136
- const organizationId = "anheuserbuschinbevprod";
1137
- const accessToken = "xa80ebf41-0b5a-4386-a423-d465a2b38f90";
1136
+ const organizationId = "anheuserbuschinbevkmnonprod";
1137
+ const accessToken = "x2242b5a3-4f36-44f9-99c7-074b09a262fa";
1138
1138
  await searchInterface.initialize({
1139
1139
  accessToken,
1140
1140
  organizationId,
@@ -1149,13 +1149,24 @@ async function initSearch(searchInterface) {
1149
1149
  request.body = JSON.stringify(body);
1150
1150
  }
1151
1151
  return request;
1152
+ },
1153
+ search: {
1154
+ preprocessSearchResponseMiddleware: (response) => {
1155
+ response.body.results.forEach((result) => {
1156
+ if (result.raw.snavatar) {
1157
+ result.raw.resultpicture = 'https://abinbevwwdev.service-now.com/' + result.raw.snavatar;
1158
+ }
1159
+ return result;
1160
+ });
1161
+ return response;
1162
+ },
1152
1163
  }
1153
1164
  });
1154
1165
  searchInterface.executeFirstSearch();
1155
1166
  }
1156
1167
  async function initRecs() {
1157
- const organizationId = "anheuserbuschinbevprod";
1158
- const accessToken = "xa80ebf41-0b5a-4386-a423-d465a2b38f90";
1168
+ const organizationId = "anheuserbuschinbevkmnonprod";
1169
+ const accessToken = "x2242b5a3-4f36-44f9-99c7-074b09a262fa";
1159
1170
  const recsInterface = document.querySelector('#recs');
1160
1171
  await (recsInterface === null || recsInterface === void 0 ? void 0 : recsInterface.initialize({
1161
1172
  accessToken: accessToken,
@@ -3189,6 +3200,8 @@ const DocumentsTemplate = "<style>\n /* .field {\n display: inline-flex;\n
3189
3200
 
3190
3201
  const MediaTemplate = "<style>\n .field {\n display: inline-flex;\n align-items: center;\n }\n\n .field-label {\n font-weight: bold;\n margin-right: 0.25rem;\n }\n atomic-result-section-excerpt {\n font-size: 1.3rem !important;\n margin-top: 0.875rem !important;\n max-height: unset !important;\n line-height: normal !important;\n }\n\n atomic-result-section-bottom-metadata {\n margin-top: 2px;\n font-size: 1rem !important;\n color: #A6A6A6 !important;\n }\n\n atomic-result-section-bottom-metadata a {\n color: #A6A6A6 !important;\n }\n\n\n atomic-result-section-title a {\n color: #CAA144 !important;\n font-size: 1.7rem !important;\n max-height: unset !important;\n line-height: normal !important;\n }\n\n atomic-result-section-title a:visited {\n color: black !important;\n }\n atomic-result-section-visual {\n width: 3rem !important;\n height: 5rem !important;\n display: grid;\n align-items: center;\n justify-content: center;\n\n }\n\n atomic-result-section-bottom-metadata {\n margin-top: 2px;\n color: #A6A6A6 !important;\n font-size: 1rem !important;\n margin-right: 3px;\n line-height: 18px !important;\n display: grid;\n grid-template-columns: auto auto auto;\n gap: 1rem;\n align-items: center;\n }\n\n atomic-result-date{\n font-size:1.0rem;\n }\n</style>\n\n<atomic-result-section-visual>\n <atomic-field-condition class=\"field\" must-match-filetype=\"mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,mpg\">\n <img src=\"https://cdn.jsdelivr.net/npm/@coveops/abi@latest/dist/abi/images/Movies.png\" alt=\"Image\">\n <!-- <atomic-icon class=\"icon\"></atomic-icon>\n <img src=\"https://abiglobal--c.vf.force.com/resource/PP_Coveo/img/Movies.png\" class=\"thumbnail\"> -->\n </atomic-field-condition>\n <atomic-field-condition class=\"field\" must-match-filetype=\"gif,jpeg,jpg,png,bmp,Image\">\n <img src=\"https://cdn.jsdelivr.net/npm/@coveops/abi@latest/dist/abi/images/Images.png\" alt=\"Image\">\n <!-- <atomic-icon class=\"icon\"></atomic-icon>\n <img src=\"https://abiglobal--c.vf.force.com/resource/PP_Coveo/img/Images.png\" class=\"thumbnail\"> -->\n </atomic-field-condition>\n \n</atomic-result-section-visual>\n\n<atomic-result-section-title>\n <atomic-result-link> <a slot=\"attributes\" target=\"_blank\"></a></atomic-result-link>\n</atomic-result-section-title>\n\n\n<atomic-result-section-bottom-metadata>\n <span>\n <atomic-text value=\"Date: &nbsp;\"></atomic-text>\n <atomic-result-date></atomic-result-date>\n </span><span>\n <atomic-text value=\"Source: &nbsp;\"></atomic-text><atomic-result-text field=\"sourcetype\"></atomic-result-text>\n </span><span> <atomic-text value=\"Sharepoint: &nbsp;\"></atomic-text>\n <atomic-result-link><a slot=\"attributes\" target=\"_blank\"></a>\n <atomic-result-text field=\"spsitename\"></atomic-result-text>\n </atomic-result-link>\n </span>\n</atomic-result-section-bottom-metadata>\n";
3191
3202
 
3203
+ const PeopleSnowTemplate = "<style>\n .field {\n display: inline-flex;\n align-items: center;\n line-height: normal !important;\n }\n\n .field-label {\n font-weight: bold;\n margin-right: 0.25rem;\n }\n\n atomic-result-section-bottom-metadata {\n display: grid;\n grid-template-columns: 1fr 1fr;\n font-size: 1.3rem !important;\n width: 100%;\n margin-top: 2px;\n max-height: 25rem !important;\n }\n\n atomic-result-section-title{\n color: #CAA144 !important;\n font-size: 1.7rem !important;\n max-height: unset !important;\n line-height: normal !important;\n }\n atomic-result-section-visual {\n width: 3rem !important;\n height: 5rem !important;\n display: grid;\n align-items: center;\n }\n atomic-result-image{\n width: auto !important;\n height: auto !important;\n }\n atomic-result-image img{\n border-radius: 20% !important;\n }\n</style>\n\n<atomic-result-section-visual>\n <atomic-field-condition class=\"field\" if-defined=\"resultpicture\">\n <atomic-result-image field=\"resultpicture\"></atomic-result-image>\n </atomic-field-condition>\n <atomic-field-condition class=\"field\" if-not-defined=\"resultpicture\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d=\"M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304l-91.4 0z\"/></svg>\n </atomic-field-condition>\n</atomic-result-section-visual>\n\n<atomic-result-section-title>\n <atomic-result-link href-template=\"/cheers?id=cheers_hub_profile&sys_id=${raw.snsysid}\">\n <a slot=\"attributes\" target=\"_blank\"></a>\n </atomic-result-link>\n</atomic-result-section-title>\n\n<atomic-result-section-bottom-metadata>\n\n <atomic-field-condition class=\"field\" if-defined=\"sntitle\">\n <span class=\"field-label\">\n <atomic-text value=\"Title\"></atomic-text>:\n </span>\n <atomic-result-text field=\"sntitle\"></atomic-result-text>\n </atomic-field-condition>\n <br>\n <atomic-field-condition class=\"field\" if-defined=\"snupreferredzone\">\n <span class=\"field-label\">\n <atomic-text value=\"Zone\"></atomic-text>:\n </span>\n <atomic-result-text field=\"snupreferredzone\"></atomic-result-text>\n </atomic-field-condition>\n \n <atomic-field-condition class=\"field\" if-defined=\"snbuilding\">\n <span class=\"field-label\">\n <atomic-text value=\"OfficeLocation\"></atomic-text>:\n </span>\n <atomic-result-text field=\"snbuilding\"></atomic-result-text>\n </atomic-field-condition>\n <atomic-field-condition class=\"field\" if-defined=\"snufunction\">\n <span class=\"field-label\">\n <atomic-text value=\"Function\"></atomic-text>:\n </span>\n <atomic-result-text field=\"snufunction\"></atomic-result-text>\n </atomic-field-condition>\n\n <atomic-field-condition class=\"field\" if-defined=\"snemail\">\n <span class=\"field-label\">\n <atomic-text value=\"Email\"></atomic-text>:\n </span>\n <atomic-result-text field=\"snemail\"></atomic-result-text>\n </atomic-field-condition>\n\n\n\n</atomic-result-section-bottom-metadata>\n";
3204
+
3192
3205
  const ResultsManager$1 = class extends H {
3193
3206
  constructor() {
3194
3207
  super();
@@ -3198,7 +3211,7 @@ const ResultsManager$1 = class extends H {
3198
3211
  return waitForAtomic();
3199
3212
  }
3200
3213
  render() {
3201
- return (h("atomic-result-list", null, h("atomic-result-template", { "must-match-filetype": 'mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,gif,jpeg,jpg,png,bmp,Image,mp3,mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,mpg' }, h("template", { innerHTML: MediaTemplate })), h("atomic-result-template", { "must-match-abicontenttype": "Site Pages" }, h("template", { innerHTML: SitePagesTemplate })), h("atomic-result-template", { "must-match-abicontenttype": "Knowledge Article" }, h("template", { innerHTML: KATemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'FAQ' }, h("template", { innerHTML: FAQTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Quick Links' }, h("template", { innerHTML: QuickLinksTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Application' }, h("template", { innerHTML: AppTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'eLearning' }, h("template", { innerHTML: ELearningTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'People' }, h("template", { innerHTML: PeopleTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Documents' }, h("template", { innerHTML: DocumentsTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Media' }, h("template", { innerHTML: MediaTemplate })), h("atomic-result-template", null, h("template", { innerHTML: template1 }))));
3214
+ return (h("atomic-result-list", null, h("atomic-result-template", { "must-match-filetype": 'mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,gif,jpeg,jpg,png,bmp,Image,mp3,mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,mpg' }, h("template", { innerHTML: MediaTemplate })), h("atomic-result-template", { "must-match-abicontenttype": "Site Pages" }, h("template", { innerHTML: SitePagesTemplate })), h("atomic-result-template", { "must-match-abicontenttype": "Knowledge Article" }, h("template", { innerHTML: KATemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'FAQ' }, h("template", { innerHTML: FAQTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Quick Links' }, h("template", { innerHTML: QuickLinksTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Application' }, h("template", { innerHTML: AppTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'eLearning' }, h("template", { innerHTML: ELearningTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'People', "must-match-objecttype": 'Account' }, h("template", { innerHTML: PeopleTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'People', "must-match-filetype": 'sys_user' }, h("template", { innerHTML: PeopleSnowTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Documents' }, h("template", { innerHTML: DocumentsTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Media' }, h("template", { innerHTML: MediaTemplate })), h("atomic-result-template", null, h("template", { innerHTML: template1 }))));
3202
3215
  }
3203
3216
  };
3204
3217
 
package/dist/esm/index.js CHANGED
@@ -7,8 +7,8 @@ async function main() {
7
7
  const searchBox = document.querySelector("#searchbox");
8
8
  searchBox && initStandaloneSearchBox(searchBox);
9
9
  // const platformUrl = "https://platform.cloud.coveo.com"!;
10
- // const organizationId = "anheuserbuschinbevprod"!;
11
- // const accessToken = "xa80ebf41-0b5a-4386-a423-d465a2b38f90"!;
10
+ // const organizationId = "anheuserbuschinbevkmnonprod"!;
11
+ // const accessToken = "x2242b5a3-4f36-44f9-99c7-074b09a262fa"!;
12
12
  // await searchInterface.initialize({
13
13
  // accessToken,
14
14
  // organizationId,
@@ -59,8 +59,8 @@ async function main() {
59
59
  }
60
60
  async function initStandaloneSearchBox(searchBox) {
61
61
  const platformUrl = "https://platform.cloud.coveo.com";
62
- const organizationId = "anheuserbuschinbevprod";
63
- const accessToken = "xa80ebf41-0b5a-4386-a423-d465a2b38f90";
62
+ const organizationId = "anheuserbuschinbevkmnonprod";
63
+ const accessToken = "x2242b5a3-4f36-44f9-99c7-074b09a262fa";
64
64
  await searchBox.initialize({
65
65
  accessToken,
66
66
  organizationId,
@@ -88,8 +88,8 @@ async function initStandaloneSearchBox(searchBox) {
88
88
  }
89
89
  async function initSearch(searchInterface) {
90
90
  const platformUrl = "https://platform.cloud.coveo.com";
91
- const organizationId = "anheuserbuschinbevprod";
92
- const accessToken = "xa80ebf41-0b5a-4386-a423-d465a2b38f90";
91
+ const organizationId = "anheuserbuschinbevkmnonprod";
92
+ const accessToken = "x2242b5a3-4f36-44f9-99c7-074b09a262fa";
93
93
  await searchInterface.initialize({
94
94
  accessToken,
95
95
  organizationId,
@@ -104,13 +104,24 @@ async function initSearch(searchInterface) {
104
104
  request.body = JSON.stringify(body);
105
105
  }
106
106
  return request;
107
+ },
108
+ search: {
109
+ preprocessSearchResponseMiddleware: (response) => {
110
+ response.body.results.forEach((result) => {
111
+ if (result.raw.snavatar) {
112
+ result.raw.resultpicture = 'https://abinbevwwdev.service-now.com/' + result.raw.snavatar;
113
+ }
114
+ return result;
115
+ });
116
+ return response;
117
+ },
107
118
  }
108
119
  });
109
120
  searchInterface.executeFirstSearch();
110
121
  }
111
122
  async function initRecs() {
112
- const organizationId = "anheuserbuschinbevprod";
113
- const accessToken = "xa80ebf41-0b5a-4386-a423-d465a2b38f90";
123
+ const organizationId = "anheuserbuschinbevkmnonprod";
124
+ const accessToken = "x2242b5a3-4f36-44f9-99c7-074b09a262fa";
114
125
  const recsInterface = document.querySelector('#recs');
115
126
  await (recsInterface === null || recsInterface === void 0 ? void 0 : recsInterface.initialize({
116
127
  accessToken: accessToken,
@@ -21,6 +21,8 @@ const DocumentsTemplate = "<style>\n /* .field {\n display: inline-flex;\n
21
21
 
22
22
  const MediaTemplate = "<style>\n .field {\n display: inline-flex;\n align-items: center;\n }\n\n .field-label {\n font-weight: bold;\n margin-right: 0.25rem;\n }\n atomic-result-section-excerpt {\n font-size: 1.3rem !important;\n margin-top: 0.875rem !important;\n max-height: unset !important;\n line-height: normal !important;\n }\n\n atomic-result-section-bottom-metadata {\n margin-top: 2px;\n font-size: 1rem !important;\n color: #A6A6A6 !important;\n }\n\n atomic-result-section-bottom-metadata a {\n color: #A6A6A6 !important;\n }\n\n\n atomic-result-section-title a {\n color: #CAA144 !important;\n font-size: 1.7rem !important;\n max-height: unset !important;\n line-height: normal !important;\n }\n\n atomic-result-section-title a:visited {\n color: black !important;\n }\n atomic-result-section-visual {\n width: 3rem !important;\n height: 5rem !important;\n display: grid;\n align-items: center;\n justify-content: center;\n\n }\n\n atomic-result-section-bottom-metadata {\n margin-top: 2px;\n color: #A6A6A6 !important;\n font-size: 1rem !important;\n margin-right: 3px;\n line-height: 18px !important;\n display: grid;\n grid-template-columns: auto auto auto;\n gap: 1rem;\n align-items: center;\n }\n\n atomic-result-date{\n font-size:1.0rem;\n }\n</style>\n\n<atomic-result-section-visual>\n <atomic-field-condition class=\"field\" must-match-filetype=\"mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,mpg\">\n <img src=\"https://cdn.jsdelivr.net/npm/@coveops/abi@latest/dist/abi/images/Movies.png\" alt=\"Image\">\n <!-- <atomic-icon class=\"icon\"></atomic-icon>\n <img src=\"https://abiglobal--c.vf.force.com/resource/PP_Coveo/img/Movies.png\" class=\"thumbnail\"> -->\n </atomic-field-condition>\n <atomic-field-condition class=\"field\" must-match-filetype=\"gif,jpeg,jpg,png,bmp,Image\">\n <img src=\"https://cdn.jsdelivr.net/npm/@coveops/abi@latest/dist/abi/images/Images.png\" alt=\"Image\">\n <!-- <atomic-icon class=\"icon\"></atomic-icon>\n <img src=\"https://abiglobal--c.vf.force.com/resource/PP_Coveo/img/Images.png\" class=\"thumbnail\"> -->\n </atomic-field-condition>\n \n</atomic-result-section-visual>\n\n<atomic-result-section-title>\n <atomic-result-link> <a slot=\"attributes\" target=\"_blank\"></a></atomic-result-link>\n</atomic-result-section-title>\n\n\n<atomic-result-section-bottom-metadata>\n <span>\n <atomic-text value=\"Date: &nbsp;\"></atomic-text>\n <atomic-result-date></atomic-result-date>\n </span><span>\n <atomic-text value=\"Source: &nbsp;\"></atomic-text><atomic-result-text field=\"sourcetype\"></atomic-result-text>\n </span><span> <atomic-text value=\"Sharepoint: &nbsp;\"></atomic-text>\n <atomic-result-link><a slot=\"attributes\" target=\"_blank\"></a>\n <atomic-result-text field=\"spsitename\"></atomic-result-text>\n </atomic-result-link>\n </span>\n</atomic-result-section-bottom-metadata>\n";
23
23
 
24
+ const PeopleSnowTemplate = "<style>\n .field {\n display: inline-flex;\n align-items: center;\n line-height: normal !important;\n }\n\n .field-label {\n font-weight: bold;\n margin-right: 0.25rem;\n }\n\n atomic-result-section-bottom-metadata {\n display: grid;\n grid-template-columns: 1fr 1fr;\n font-size: 1.3rem !important;\n width: 100%;\n margin-top: 2px;\n max-height: 25rem !important;\n }\n\n atomic-result-section-title{\n color: #CAA144 !important;\n font-size: 1.7rem !important;\n max-height: unset !important;\n line-height: normal !important;\n }\n atomic-result-section-visual {\n width: 3rem !important;\n height: 5rem !important;\n display: grid;\n align-items: center;\n }\n atomic-result-image{\n width: auto !important;\n height: auto !important;\n }\n atomic-result-image img{\n border-radius: 20% !important;\n }\n</style>\n\n<atomic-result-section-visual>\n <atomic-field-condition class=\"field\" if-defined=\"resultpicture\">\n <atomic-result-image field=\"resultpicture\"></atomic-result-image>\n </atomic-field-condition>\n <atomic-field-condition class=\"field\" if-not-defined=\"resultpicture\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d=\"M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304l-91.4 0z\"/></svg>\n </atomic-field-condition>\n</atomic-result-section-visual>\n\n<atomic-result-section-title>\n <atomic-result-link href-template=\"/cheers?id=cheers_hub_profile&sys_id=${raw.snsysid}\">\n <a slot=\"attributes\" target=\"_blank\"></a>\n </atomic-result-link>\n</atomic-result-section-title>\n\n<atomic-result-section-bottom-metadata>\n\n <atomic-field-condition class=\"field\" if-defined=\"sntitle\">\n <span class=\"field-label\">\n <atomic-text value=\"Title\"></atomic-text>:\n </span>\n <atomic-result-text field=\"sntitle\"></atomic-result-text>\n </atomic-field-condition>\n <br>\n <atomic-field-condition class=\"field\" if-defined=\"snupreferredzone\">\n <span class=\"field-label\">\n <atomic-text value=\"Zone\"></atomic-text>:\n </span>\n <atomic-result-text field=\"snupreferredzone\"></atomic-result-text>\n </atomic-field-condition>\n \n <atomic-field-condition class=\"field\" if-defined=\"snbuilding\">\n <span class=\"field-label\">\n <atomic-text value=\"OfficeLocation\"></atomic-text>:\n </span>\n <atomic-result-text field=\"snbuilding\"></atomic-result-text>\n </atomic-field-condition>\n <atomic-field-condition class=\"field\" if-defined=\"snufunction\">\n <span class=\"field-label\">\n <atomic-text value=\"Function\"></atomic-text>:\n </span>\n <atomic-result-text field=\"snufunction\"></atomic-result-text>\n </atomic-field-condition>\n\n <atomic-field-condition class=\"field\" if-defined=\"snemail\">\n <span class=\"field-label\">\n <atomic-text value=\"Email\"></atomic-text>:\n </span>\n <atomic-result-text field=\"snemail\"></atomic-result-text>\n </atomic-field-condition>\n\n\n\n</atomic-result-section-bottom-metadata>\n";
25
+
24
26
  const ResultsManager = class {
25
27
  constructor(hostRef) {
26
28
  registerInstance(this, hostRef);
@@ -29,7 +31,7 @@ const ResultsManager = class {
29
31
  return waitForAtomic();
30
32
  }
31
33
  render() {
32
- return (h("atomic-result-list", null, h("atomic-result-template", { "must-match-filetype": 'mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,gif,jpeg,jpg,png,bmp,Image,mp3,mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,mpg' }, h("template", { innerHTML: MediaTemplate })), h("atomic-result-template", { "must-match-abicontenttype": "Site Pages" }, h("template", { innerHTML: SitePagesTemplate })), h("atomic-result-template", { "must-match-abicontenttype": "Knowledge Article" }, h("template", { innerHTML: KATemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'FAQ' }, h("template", { innerHTML: FAQTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Quick Links' }, h("template", { innerHTML: QuickLinksTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Application' }, h("template", { innerHTML: AppTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'eLearning' }, h("template", { innerHTML: ELearningTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'People' }, h("template", { innerHTML: PeopleTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Documents' }, h("template", { innerHTML: DocumentsTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Media' }, h("template", { innerHTML: MediaTemplate })), h("atomic-result-template", null, h("template", { innerHTML: template1 }))));
34
+ return (h("atomic-result-list", null, h("atomic-result-template", { "must-match-filetype": 'mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,gif,jpeg,jpg,png,bmp,Image,mp3,mp4,wmv,avi,MOV,flv,mkv,webm,ogg,ogv,m4v,mpg' }, h("template", { innerHTML: MediaTemplate })), h("atomic-result-template", { "must-match-abicontenttype": "Site Pages" }, h("template", { innerHTML: SitePagesTemplate })), h("atomic-result-template", { "must-match-abicontenttype": "Knowledge Article" }, h("template", { innerHTML: KATemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'FAQ' }, h("template", { innerHTML: FAQTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Quick Links' }, h("template", { innerHTML: QuickLinksTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Application' }, h("template", { innerHTML: AppTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'eLearning' }, h("template", { innerHTML: ELearningTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'People', "must-match-objecttype": 'Account' }, h("template", { innerHTML: PeopleTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'People', "must-match-filetype": 'sys_user' }, h("template", { innerHTML: PeopleSnowTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Documents' }, h("template", { innerHTML: DocumentsTemplate })), h("atomic-result-template", { "must-match-abicontenttype": 'Media' }, h("template", { innerHTML: MediaTemplate })), h("atomic-result-template", null, h("template", { innerHTML: template1 }))));
33
35
  }
34
36
  };
35
37
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coveops/abi",
3
3
  "description": "Abi project",
4
- "version": "1.0.7",
4
+ "version": "1.2.0",
5
5
  "private": false,
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.js",
@@ -0,0 +1,96 @@
1
+ <style>
2
+ .field {
3
+ display: inline-flex;
4
+ align-items: center;
5
+ line-height: normal !important;
6
+ }
7
+
8
+ .field-label {
9
+ font-weight: bold;
10
+ margin-right: 0.25rem;
11
+ }
12
+
13
+ atomic-result-section-bottom-metadata {
14
+ display: grid;
15
+ grid-template-columns: 1fr 1fr;
16
+ font-size: 1.3rem !important;
17
+ width: 100%;
18
+ margin-top: 2px;
19
+ max-height: 25rem !important;
20
+ }
21
+
22
+ atomic-result-section-title{
23
+ color: #CAA144 !important;
24
+ font-size: 1.7rem !important;
25
+ max-height: unset !important;
26
+ line-height: normal !important;
27
+ }
28
+ atomic-result-section-visual {
29
+ width: 3rem !important;
30
+ height: 5rem !important;
31
+ display: grid;
32
+ align-items: center;
33
+ }
34
+ atomic-result-image{
35
+ width: auto !important;
36
+ height: auto !important;
37
+ }
38
+ atomic-result-image img{
39
+ border-radius: 20% !important;
40
+ }
41
+ </style>
42
+
43
+ <atomic-result-section-visual>
44
+ <atomic-field-condition class="field" if-defined="resultpicture">
45
+ <atomic-result-image field="resultpicture"></atomic-result-image>
46
+ </atomic-field-condition>
47
+ <atomic-field-condition class="field" if-not-defined="resultpicture">
48
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304l-91.4 0z"/></svg>
49
+ </atomic-field-condition>
50
+ </atomic-result-section-visual>
51
+
52
+ <atomic-result-section-title>
53
+ <atomic-result-link href-template='/cheers?id=cheers_hub_profile&sys_id=${raw.snsysid}'>
54
+ <a slot="attributes" target="_blank"></a>
55
+ </atomic-result-link>
56
+ </atomic-result-section-title>
57
+
58
+ <atomic-result-section-bottom-metadata>
59
+
60
+ <atomic-field-condition class="field" if-defined="sntitle">
61
+ <span class="field-label">
62
+ <atomic-text value="Title"></atomic-text>:
63
+ </span>
64
+ <atomic-result-text field="sntitle"></atomic-result-text>
65
+ </atomic-field-condition>
66
+ <br>
67
+ <atomic-field-condition class="field" if-defined="snupreferredzone">
68
+ <span class="field-label">
69
+ <atomic-text value="Zone"></atomic-text>:
70
+ </span>
71
+ <atomic-result-text field="snupreferredzone"></atomic-result-text>
72
+ </atomic-field-condition>
73
+
74
+ <atomic-field-condition class="field" if-defined="snbuilding">
75
+ <span class="field-label">
76
+ <atomic-text value="OfficeLocation"></atomic-text>:
77
+ </span>
78
+ <atomic-result-text field="snbuilding"></atomic-result-text>
79
+ </atomic-field-condition>
80
+ <atomic-field-condition class="field" if-defined="snufunction">
81
+ <span class="field-label">
82
+ <atomic-text value="Function"></atomic-text>:
83
+ </span>
84
+ <atomic-result-text field="snufunction"></atomic-result-text>
85
+ </atomic-field-condition>
86
+
87
+ <atomic-field-condition class="field" if-defined="snemail">
88
+ <span class="field-label">
89
+ <atomic-text value="Email"></atomic-text>:
90
+ </span>
91
+ <atomic-result-text field="snemail"></atomic-result-text>
92
+ </atomic-field-condition>
93
+
94
+
95
+
96
+ </atomic-result-section-bottom-metadata>
@@ -10,6 +10,7 @@ import ELearningTemplate from "./ELearningTemplate.html";
10
10
  import PeopleTemplate from "./PeopleTemplate.html";
11
11
  import DocumentsTemplate from "./DocumentsTemplate.html";
12
12
  import MediaTemplate from "./MediaTemplate.html";
13
+ import PeopleSnowTemplate from './PeopleSnowTemplate.html';
13
14
  /**
14
15
  * Component used to manage results & result templates.
15
16
  * See https://docs.coveo.com/en/atomic/latest/usage/create-a-result-list/
@@ -50,9 +51,12 @@ export class ResultsManager {
50
51
  <atomic-result-template must-match-abicontenttype='eLearning'>
51
52
  <template innerHTML={ELearningTemplate}></template>
52
53
  </atomic-result-template>
53
- <atomic-result-template must-match-abicontenttype='People'>
54
+ <atomic-result-template must-match-abicontenttype='People' must-match-objecttype='Account'>
54
55
  <template innerHTML={PeopleTemplate}></template>
55
56
  </atomic-result-template>
57
+ <atomic-result-template must-match-abicontenttype='People' must-match-filetype='sys_user'>
58
+ <template innerHTML={PeopleSnowTemplate}></template>
59
+ </atomic-result-template>
56
60
  <atomic-result-template must-match-abicontenttype='Documents'>
57
61
  <template innerHTML={DocumentsTemplate}></template>
58
62
  </atomic-result-template>
package/src/index.ts CHANGED
@@ -117,6 +117,17 @@ async function initSearch(searchInterface: any){
117
117
  request.body = JSON.stringify(body);
118
118
  }
119
119
  return request;
120
+ },
121
+ search: {
122
+ preprocessSearchResponseMiddleware: (response:any) => {
123
+ response.body.results.forEach((result:any) => {
124
+ if(result.raw.snavatar) {
125
+ result.raw.resultpicture = 'https://abinbevwwdev.service-now.com/'+result.raw.snavatar;
126
+ }
127
+ return result;
128
+ });
129
+ return response;
130
+ },
120
131
  }
121
132
  });
122
133
  searchInterface.executeFirstSearch();
@@ -55,7 +55,9 @@
55
55
  "moreinformation", "picture", "targettab", "targettemplate", "metatype", "resultimage", "sfppzonec",
56
56
  "sfppemployeeworklocationc", "sfppbusinessfunctionc", "sfpersonemail", "sfpppositontitlec", "istailoredmappingtype",
57
57
  "resultpicture", "abicontenttype", "containsattachment", "spsitename", "spsiteuri", "attachmentfilename", "parents",
58
- "sysparents", "description", "answer","newmoreinfo", "filetype","sfppcustomlinkcppdescriptionc","trainingsource","function","category","sfpersonemail","sfppbusinessfunctionc","sfppemployeeworklocationc","duration"
58
+ "sysparents", "description", "answer","newmoreinfo", "filetype","sfppcustomlinkcppdescriptionc","trainingsource","function",
59
+ "category","sfpersonemail","sfppbusinessfunctionc","sfppemployeeworklocationc","duration",
60
+ "snsysid","sntitle","snupreferredzone","snbuilding","snufunction","snemail","snavatar"
59
61
  ]'><atomic-modal id="faq-modal" is-open="false">
60
62
  <div slot="header" style="display: grid;grid-template-columns: 5fr 01fr; width:100%;">
61
63
  <div class="header-title" style="padding-top:2%;">This is a title</div>
@@ -37,7 +37,7 @@
37
37
  <style>
38
38
  atomic-result-link a {
39
39
  font-size: 1.3rem;
40
- color: var(--atomic-neutral-dark);
40
+ color: #626971 !important;
41
41
  }
42
42
  </style>
43
43
  <atomic-result-section-title>