@salesforcedevs/dw-components 0.64.5 → 0.68.1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dw-components",
3
- "version": "0.64.5",
3
+ "version": "0.68.1",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -23,5 +23,5 @@
23
23
  "@types/lodash.orderby": "^4.6.7",
24
24
  "@types/lodash.uniqby": "^4.7.7"
25
25
  },
26
- "gitHead": "8540b5a441e6b34529a1b40693e712a88f4a8a3a"
26
+ "gitHead": "5aa9cb52b70c658e41dbcc89b62baf84e12ce842"
27
27
  }
@@ -1,6 +1,6 @@
1
1
  import { LightningElement } from "lwc";
2
2
  import cx from "classnames";
3
- import { getArchivePosts, getArchiveFilterList } from "./utils";
3
+ import { PER_PAGE_COUNT, getArchivePosts, getArchiveFilterList } from "./utils";
4
4
  import { sortSplittedPostsByMonth } from "dxUtils/dates";
5
5
  import { Filters } from "./contentArchive.types";
6
6
  import { getUrlParamValue, setUrlParamValue } from "dxUtils/queryCoordinator";
@@ -43,16 +43,10 @@ export default class ContentArchive extends LightningElement {
43
43
  if (this.loading) {
44
44
  return "Loading Results...";
45
45
  }
46
-
47
- let currentFirstResultNumber = 0;
48
- const currentLastResultNumber = this.currentPage * this.posts.length;
49
-
50
- if (this.currentPage > 1) {
51
- currentFirstResultNumber =
52
- currentLastResultNumber - this.posts.length;
53
- } else if (this.currentPage === 1 && !this.isEmptyState) {
54
- currentFirstResultNumber = 1;
55
- }
46
+ let currentFirstResultNumber = (this.currentPage - 1) * PER_PAGE_COUNT;
47
+ const currentLastResultNumber =
48
+ currentFirstResultNumber + this.posts.length;
49
+ currentFirstResultNumber += 1;
56
50
 
57
51
  return `Showing ${currentFirstResultNumber} - ${currentLastResultNumber} of ${this.totalResults}`;
58
52
  }
@@ -11,6 +11,7 @@ let controller: AbortController | null = null;
11
11
  const ARCHIVE_BASE_URL = "https://developer.salesforce.com/blogs/wp-json/wp/v2";
12
12
  const ARCHIVE_CONTENT_URL = `${ARCHIVE_BASE_URL}/latest-post-per-site`;
13
13
  const ARCHIVE_FILTER_LIST_URL = `${ARCHIVE_BASE_URL}/archives-filters?order=DESC`;
14
+ export const PER_PAGE_COUNT = 10;
14
15
 
15
16
  async function postsFetchHandler(url: string) {
16
17
  if (controller) {
@@ -75,7 +76,7 @@ function normalizePosts(posts: Array<ArchivePost>, contentType: string) {
75
76
  }
76
77
 
77
78
  export async function getArchivePosts(
78
- count: number = 10,
79
+ count = PER_PAGE_COUNT,
79
80
  page: number = 1,
80
81
  contentType: string = "minimal",
81
82
  filterMenuData: FilterMenuData
@@ -48,6 +48,10 @@ form > .full-name-field {
48
48
  width: calc(50% - var(--dx-g-spacing-lg) / 2);
49
49
  }
50
50
 
51
+ .legal-terms {
52
+ margin-top: var(--dx-g-spacing-lg);
53
+ }
54
+
51
55
  .submit-button {
52
56
  width: 100%;
53
57
  }
@@ -56,6 +60,7 @@ form > .full-name-field {
56
60
  background-color: var(--dx-g-blue-vibrant-40);
57
61
  border-color: var(--dx-g-blue-vibrant-40);
58
62
  }
63
+
59
64
  @media screen and (min-width: 641px) {
60
65
  form > .full-name-field:first-of-type {
61
66
  margin-right: var(--dx-g-spacing-lg);
@@ -67,6 +67,7 @@
67
67
  missing-error-message="Create a user name"
68
68
  error-message={usernameError}
69
69
  format-error-message='Enter a unique username. Your username must be in the form of an email address, but does not have to be a real email address. We suggest "name@yourcompany." It must be unique and not associated with another Salesforce login credential.'
70
+ description-markup='Your username must be in the form of an email address (it does not have to be real). It must be unique and cannot be associated with another Salesforce login credential. <a href="/help" target="_blank">Read more about username recommendations.</a>'
70
71
  label="Username"
71
72
  name="username"
72
73
  placeholder="Ex. name@yourcompany.com"
@@ -75,16 +76,33 @@
75
76
  validity-on-blur={checkUsernameValidity}
76
77
  onchange={handleUsernameChange}
77
78
  ></dx-input>
78
- <dx-checkbox if:true={showMarketingField} name="opt_in" value="explicit">
79
+ <dx-checkbox
80
+ if:true={showMarketingField}
81
+ name="opt_in"
82
+ value="explicit"
83
+ >
79
84
  <span lwc:dom="manual" class="marketing-terms"></span>
80
85
  </dx-checkbox>
81
- <dx-checkbox if:true={showLegalCheckbox} required name="eula" value="accepted">
86
+ <dx-checkbox
87
+ if:true={showLegalCheckbox}
88
+ required
89
+ name="eula"
90
+ value="accepted"
91
+ >
82
92
  <span lwc:dom="manual" class="legal-terms"></span>
83
- <span if:true={learnMore} lwc:dom="manual" class="learn-more"></span>
93
+ <span
94
+ if:true={learnMore}
95
+ lwc:dom="manual"
96
+ class="learn-more"
97
+ ></span>
84
98
  </dx-checkbox>
85
99
  <template if:false={showLegalCheckbox}>
86
100
  <span lwc:dom="manual" class="legal-terms"></span>
87
- <span if:true={learnMore} lwc:dom="manual" class="learn-more"></span>
101
+ <span
102
+ if:true={learnMore}
103
+ lwc:dom="manual"
104
+ class="learn-more"
105
+ ></span>
88
106
  </template>
89
107
  <dx-button
90
108
  class="submit-button"
@@ -503,8 +503,9 @@ export default abstract class DocsGrid extends LightningElement {
503
503
  const searchParams = qs.stringify(params);
504
504
 
505
505
  if (window.history.pushState) {
506
- const newurl = `${window.location.protocol}//${window.location.host}${window.location.pathname}?${searchParams}`;
507
- window.history.pushState({ path: newurl }, "", newurl);
506
+ const { protocol, host, pathname, hash } = window.location;
507
+ const path = `${protocol}//${host}${pathname}?${searchParams}${hash}`;
508
+ window.history.pushState({ path }, "", path);
508
509
  }
509
510
  }
510
511