@salesforcedevs/docs-components 1.3.10-sprig-2 → 1.3.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/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": "1.3.10-sprig-2",
3
+ "version": "1.3.13",
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": "4629fdd9ca18a13480044ad43515b91945d16aad"
27
+ "gitHead": "94b6a0ecb51f4bc853ec3083419de8256db2bd6a"
28
28
  }
@@ -1,9 +1,20 @@
1
- <template>
1
+ <template lwc:render-mode="light">
2
2
  <hr />
3
3
  <div class="survey-container">
4
- <dx-button class="survey-btn" variant="primary" onclick={openSurvey}>
5
- Share Feedback
6
- </dx-button>
4
+ <div class="text-container">
5
+ <b>DID THIS ARTICLE SOLVE YOUR ISSUE?</b>
6
+ <br />
7
+ Let us know so we can improve!
8
+ </div>
9
+ <div class="btn-container">
10
+ <dx-button
11
+ variant="secondary"
12
+ aria-label="Share Your Feedback"
13
+ onclick={openSurvey}
14
+ >
15
+ Share your feedback
16
+ </dx-button>
17
+ </div>
7
18
  </div>
8
19
  <hr />
9
20
  </template>
@@ -1,7 +1,12 @@
1
1
  :host .survey-container {
2
2
  align-items: center;
3
3
  align-content: center;
4
+ width: 100%;
4
5
  display: flex;
5
- flex-direction: column;
6
- margin: 20px;
6
+ flex-direction: row;
7
+ margin: 20px 0 20px 0;
8
+ }
9
+
10
+ .text-container {
11
+ width: 100%;
7
12
  }
@@ -4,12 +4,12 @@ import cx from "classnames";
4
4
  declare const Sprig: (eventType: string, eventNme: string) => void;
5
5
 
6
6
  export default class Phase extends LightningElement {
7
+ static renderMode = "light";
8
+
7
9
  get className() {
8
10
  return cx("container");
9
11
  }
10
12
 
11
- renderedCallback() {}
12
-
13
13
  openSurvey() {
14
14
  Sprig("track", "ProvideFeedback");
15
15
  }
@@ -615,6 +615,20 @@ export default class DocXmlContent extends LightningElementWithState<{
615
615
  return [item];
616
616
  }
617
617
 
618
+ // This method take docId and drops the version from the docId.
619
+ // Example:
620
+ // Takes input string: docId = "atlas.en-us.238.0.b2b_b2c_comm_dev.meta"
621
+ // Output string: filteredDocId = "atlas.en-us.b2b_b2c_comm_dev.meta"
622
+ dropVersionFromDocId(docId: string): string {
623
+ if (!this.version?.id) {
624
+ return docId;
625
+ }
626
+
627
+ const curVersion = this.version.id + ".";
628
+ const filteredDocId = docId.replace(curVersion, "");
629
+ return filteredDocId;
630
+ }
631
+
618
632
  addMetatags(): void {
619
633
  const div = document.createElement("div");
620
634
  div.innerHTML = this.docContent;
@@ -646,12 +660,16 @@ export default class DocXmlContent extends LightningElementWithState<{
646
660
  'link[rel="canonical"]'
647
661
  );
648
662
  if (metadescription) {
663
+ const copyPageReference = { ...this.pageReference };
664
+ copyPageReference.docId = copyPageReference.docId
665
+ ? this.dropVersionFromDocId(copyPageReference.docId)
666
+ : copyPageReference.docId;
649
667
  metadescription.setAttribute(
650
668
  "href",
651
669
  window.location.protocol +
652
670
  "//" +
653
671
  window.location.host +
654
- this.pageReferenceToString(this.pageReference)
672
+ this.pageReferenceToString(copyPageReference)
655
673
  );
656
674
  }
657
675
  }