@salesforcedevs/dx-components 1.3.206-alpha.11 → 1.3.206-alpha.12
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,12 @@ 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
|
+
) {
|
|
125
129
|
return "";
|
|
126
130
|
}
|
|
127
131
|
|
|
@@ -139,13 +143,28 @@ const buildTemplateHelperUriBreadcrumbs = (value: string) => {
|
|
|
139
143
|
|
|
140
144
|
const breadcrumbs = processParts(parts);
|
|
141
145
|
|
|
142
|
-
|
|
146
|
+
// if url.hostname is developer.salesforce.com or developer-website-s.herokuapp.com, remove the first part
|
|
147
|
+
if (
|
|
148
|
+
url.hostname !== "developer.salesforce.com" &&
|
|
149
|
+
url.hostname !== "developer-website-s.herokuapp.com"
|
|
150
|
+
) {
|
|
151
|
+
breadcrumbs.unshift(
|
|
152
|
+
`<span class="breadcrumb-item">${url.hostname}</span>`
|
|
153
|
+
);
|
|
143
154
|
|
|
144
|
-
|
|
155
|
+
return `
|
|
145
156
|
<span class="breadcrumb">
|
|
146
157
|
${breadcrumbs.join(" / ")}
|
|
147
158
|
</span>
|
|
148
159
|
`;
|
|
160
|
+
} else if (breadcrumbs.length === 1) {
|
|
161
|
+
return "";
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// remove the last breadcrumb item (since the search result is the last item anyway)
|
|
165
|
+
breadcrumbs.pop();
|
|
166
|
+
|
|
167
|
+
return `<span class="breadcrumb">/ ${breadcrumbs.join(" / ")} /</span>`;
|
|
149
168
|
};
|
|
150
169
|
|
|
151
170
|
const buildTemplateHelperBreadcrumbs = (value: string) => {
|
|
@@ -159,7 +178,7 @@ const buildTemplateHelperBreadcrumbs = (value: string) => {
|
|
|
159
178
|
}
|
|
160
179
|
|
|
161
180
|
// 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
|
|
181
|
+
if (parts.length === 1) {
|
|
163
182
|
return "";
|
|
164
183
|
}
|
|
165
184
|
|
|
@@ -167,7 +186,6 @@ const buildTemplateHelperBreadcrumbs = (value: string) => {
|
|
|
167
186
|
|
|
168
187
|
// Remove the last breadcrumb item
|
|
169
188
|
breadcrumbs.pop();
|
|
170
|
-
console.log(breadcrumbs);
|
|
171
189
|
|
|
172
190
|
return `
|
|
173
191
|
<span class="breadcrumb">/ ${breadcrumbs.join(" / ")} /</span>
|