@salesforcedevs/dx-components 1.3.206-alpha.11 → 1.3.206-alpha.13
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.
package/package.json
CHANGED
|
@@ -47,8 +47,8 @@ const resultsTemplatesInnerHtml = `
|
|
|
47
47
|
<div class="dx-result">
|
|
48
48
|
<div class="dx-result-info">
|
|
49
49
|
<span class="CoveoFieldValue" data-field="@content_type" data-helper="badge" data-html-value="true"></span>
|
|
50
|
-
<span class="CoveoFieldValue" data-field="@uri" data-helper="uriBreadcrumbs" data-html-value="true"></span>
|
|
51
50
|
<span class="CoveoFieldValue" data-field="@breadcrumbs" data-helper="breadcrumbs" data-html-value="true"></span>
|
|
51
|
+
<span class="CoveoFieldValue" data-field="@uri" data-helper="uriBreadcrumbs" data-html-value="true"></span>
|
|
52
52
|
</div>
|
|
53
53
|
<p class="dx-result-title">
|
|
54
54
|
<a
|
|
@@ -67,8 +67,8 @@ const resultsTemplatesInnerHtml = `
|
|
|
67
67
|
<div class="dx-result">
|
|
68
68
|
<div class="dx-result-info">
|
|
69
69
|
<span class="CoveoFieldValue" data-field="@content_type" data-helper="badge" data-html-value="true"></span>
|
|
70
|
-
<span class="CoveoFieldValue" data-field="@uri" data-helper="uriBreadcrumbs" data-html-value="true"></span>
|
|
71
70
|
<span class="CoveoFieldValue" data-field="@breadcrumbs" data-helper="breadcrumbs" data-html-value="true"></span>
|
|
71
|
+
<span class="CoveoFieldValue" data-field="@uri" data-helper="uriBreadcrumbs" data-html-value="true"></span>
|
|
72
72
|
</div>
|
|
73
73
|
<p class="dx-result-title">
|
|
74
74
|
<a class="CoveoResultLink"></a>
|
|
@@ -120,8 +120,13 @@ const buildTemplateHelperUriBreadcrumbs = (value: string) => {
|
|
|
120
120
|
|
|
121
121
|
// Only generate breadcrumbs for external links using the URL
|
|
122
122
|
const hostnamePattern =
|
|
123
|
-
/^((www\.)?developer\.salesforce\.com|
|
|
124
|
-
if (
|
|
123
|
+
/^((www\.)?(youtube\.com|developer\.salesforce\.com|developer-website-s\.herokuapp\.com))$/;
|
|
124
|
+
if (
|
|
125
|
+
hostnamePattern.test(url.hostname) &&
|
|
126
|
+
!/\/blogs|\/podcast/.test(url.pathname) &&
|
|
127
|
+
!/\/docs\/component-library/.test(url.pathname) &&
|
|
128
|
+
!/\/references\//.test(url.pathname)
|
|
129
|
+
) {
|
|
125
130
|
return "";
|
|
126
131
|
}
|
|
127
132
|
|
|
@@ -139,13 +144,28 @@ const buildTemplateHelperUriBreadcrumbs = (value: string) => {
|
|
|
139
144
|
|
|
140
145
|
const breadcrumbs = processParts(parts);
|
|
141
146
|
|
|
142
|
-
|
|
147
|
+
// if url.hostname is developer.salesforce.com or developer-website-s.herokuapp.com, remove the first part
|
|
148
|
+
if (
|
|
149
|
+
url.hostname !== "developer.salesforce.com" &&
|
|
150
|
+
url.hostname !== "developer-website-s.herokuapp.com"
|
|
151
|
+
) {
|
|
152
|
+
breadcrumbs.unshift(
|
|
153
|
+
`<span class="breadcrumb-item">${url.hostname}</span>`
|
|
154
|
+
);
|
|
143
155
|
|
|
144
|
-
|
|
156
|
+
return `
|
|
145
157
|
<span class="breadcrumb">
|
|
146
158
|
${breadcrumbs.join(" / ")}
|
|
147
159
|
</span>
|
|
148
160
|
`;
|
|
161
|
+
} else if (breadcrumbs.length === 1) {
|
|
162
|
+
return "";
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// remove the last breadcrumb item (since the search result is the last item anyway)
|
|
166
|
+
breadcrumbs.pop();
|
|
167
|
+
|
|
168
|
+
return `<span class="breadcrumb">/ ${breadcrumbs.join(" / ")} /</span>`;
|
|
149
169
|
};
|
|
150
170
|
|
|
151
171
|
const buildTemplateHelperBreadcrumbs = (value: string) => {
|
|
@@ -159,7 +179,7 @@ const buildTemplateHelperBreadcrumbs = (value: string) => {
|
|
|
159
179
|
}
|
|
160
180
|
|
|
161
181
|
// Don't show breadcrumbs if there's only one part or two (two because we remove the last item in the next step)
|
|
162
|
-
if (parts.length === 1
|
|
182
|
+
if (parts.length === 1) {
|
|
163
183
|
return "";
|
|
164
184
|
}
|
|
165
185
|
|
|
@@ -167,7 +187,6 @@ const buildTemplateHelperBreadcrumbs = (value: string) => {
|
|
|
167
187
|
|
|
168
188
|
// Remove the last breadcrumb item
|
|
169
189
|
breadcrumbs.pop();
|
|
170
|
-
console.log(breadcrumbs);
|
|
171
190
|
|
|
172
191
|
return `
|
|
173
192
|
<span class="breadcrumb">/ ${breadcrumbs.join(" / ")} /</span>
|