@salesforcedevs/dw-components 0.67.0 → 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.
|
|
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": "
|
|
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
|
-
|
|
48
|
-
|
|
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
|
|
79
|
+
count = PER_PAGE_COUNT,
|
|
79
80
|
page: number = 1,
|
|
80
81
|
contentType: string = "minimal",
|
|
81
82
|
filterMenuData: FilterMenuData
|