@salesforcedevs/docs-components 0.55.5-couch-db-scope-search → 0.55.7
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/LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright (c) 2020, Salesforce.com, Inc.
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
+
|
|
8
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
+
|
|
10
|
+
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "0.55.
|
|
3
|
+
"version": "0.55.7",
|
|
4
4
|
"description": "Docs Lightning web components for DSC",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"@types/lodash.orderby": "^4.6.7",
|
|
25
25
|
"@types/lodash.uniqby": "^4.7.7"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "91a0fb158be75ba597dc240fce61784cd0cb74af"
|
|
28
28
|
}
|
|
@@ -150,11 +150,26 @@ export default class Content extends LightningElement {
|
|
|
150
150
|
is: ContentCallout
|
|
151
151
|
});
|
|
152
152
|
const detailEls = calloutEl.querySelectorAll(
|
|
153
|
-
"p, div.data, ol, ul,
|
|
153
|
+
"p, div.data, ol, ul, p+.codeSection, .mediaBd > span.ph"
|
|
154
154
|
);
|
|
155
155
|
detailEls.forEach((detailEl) => {
|
|
156
|
-
|
|
156
|
+
if (detailEl.innerHTML.trim() !== "") {
|
|
157
|
+
calloutCompEl.appendChild(detailEl);
|
|
158
|
+
}
|
|
157
159
|
});
|
|
160
|
+
|
|
161
|
+
let flag = 1;
|
|
162
|
+
for (let i = 0; i < detailEls.length; i++) {
|
|
163
|
+
flag &= detailEls[i].innerHTML.trim() === "";
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (flag) {
|
|
167
|
+
const codeEls = calloutEl.querySelectorAll(".codeSection");
|
|
168
|
+
codeEls.forEach((codeEl) => {
|
|
169
|
+
calloutCompEl.appendChild(codeEl);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
158
173
|
const type = calloutEl.querySelector("h4").textContent;
|
|
159
174
|
const typeLower = type.toLowerCase();
|
|
160
175
|
Object.assign(calloutCompEl, {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
export type CoveoAdvancedQueryXMLConfig = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
sfdelivarable__c?: string;
|
|
6
|
-
source?: string;
|
|
2
|
+
locale?: string;
|
|
3
|
+
version?: string;
|
|
4
|
+
topicid?: string;
|
|
7
5
|
};
|
|
8
6
|
|
|
9
7
|
export type PageReference = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { api, track } from "lwc";
|
|
2
|
-
import { toJson } from "dxUtils/normalizers";
|
|
2
|
+
import { normalizeBoolean, toJson } from "dxUtils/normalizers";
|
|
3
3
|
import { FetchContent } from "./utils";
|
|
4
4
|
import {
|
|
5
5
|
CoveoAdvancedQueryXMLConfig,
|
|
@@ -35,6 +35,15 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
35
35
|
this._labels = toJson(value);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
@api
|
|
39
|
+
get enableCoveo() {
|
|
40
|
+
return this._enableCoveo;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
set enableCoveo(value) {
|
|
44
|
+
this._enableCoveo = normalizeBoolean(value);
|
|
45
|
+
}
|
|
46
|
+
|
|
38
47
|
private _labels: Labels = null;
|
|
39
48
|
private availableLanguages: Array<DocLanguage> = [];
|
|
40
49
|
private availableVersions: Array<DocVersion> = [];
|
|
@@ -51,6 +60,8 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
51
60
|
private _pathName = "";
|
|
52
61
|
private _pageHeader?: Header;
|
|
53
62
|
private listenerAttached = false;
|
|
63
|
+
private _enableCoveo?: boolean = false;
|
|
64
|
+
|
|
54
65
|
private searchSyncer = new SearchSyncer({
|
|
55
66
|
callbacks: {
|
|
56
67
|
onSearchChange: (nextSearchString: string): void => {
|
|
@@ -184,8 +195,9 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
184
195
|
// Coveo is enabled and the version is greater than 51 (within the latest 3 versions)
|
|
185
196
|
// TODO: we need a better fix for version number check
|
|
186
197
|
return !(
|
|
187
|
-
|
|
188
|
-
|
|
198
|
+
this.enableCoveo &&
|
|
199
|
+
this.coveoOrganizationId &&
|
|
200
|
+
this.coveoPublicAccessToken &&
|
|
189
201
|
(!this.version?.releaseVersion ||
|
|
190
202
|
(this.version?.releaseVersion &&
|
|
191
203
|
parseInt(this.version.releaseVersion.replace("v", ""), 10) >
|
|
@@ -195,15 +207,9 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
195
207
|
|
|
196
208
|
private get coveoAdvancedQueryConfig(): CoveoAdvancedQueryXMLConfig {
|
|
197
209
|
return {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
: {
|
|
202
|
-
objecttype: "HTDeveloperDocumentsC",
|
|
203
|
-
sflocale__c: this.languageId,
|
|
204
|
-
sfrelease__c: this.releaseVersionId,
|
|
205
|
-
sfdelivarable__c: this.deliverable
|
|
206
|
-
})
|
|
210
|
+
locale: this.languageId,
|
|
211
|
+
version: this.releaseVersionId,
|
|
212
|
+
topicid: this.deliverable
|
|
207
213
|
};
|
|
208
214
|
}
|
|
209
215
|
|