@salesforcedevs/dw-components 0.54.6 → 0.54.7-alpha

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.54.6",
3
+ "version": "0.54.7-alpha",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -22,6 +22,5 @@
22
22
  "@types/lodash.clonedeep": "^4.5.7",
23
23
  "@types/lodash.orderby": "^4.6.7",
24
24
  "@types/lodash.uniqby": "^4.7.7"
25
- },
26
- "gitHead": "643dd94de9c0f755960b748bdb425720f4ad53f3"
25
+ }
27
26
  }
@@ -1,9 +1,10 @@
1
1
  import { api, LightningElement } from "lwc";
2
2
  import { toJson } from "dxUtils/normalizers";
3
- import { DocsTile, DropdownItem } from "typings/custom";
3
+ import { DocsTile, DropdownItem, Language } from "typings/custom";
4
4
  import qs from "query-string";
5
5
  import uniqBy from "lodash.uniqby";
6
6
  import orderBy from "lodash.orderby";
7
+ import { isGivenLanguageSupported } from "dxUtils/language";
7
8
 
8
9
  const DSC_API_URL = {
9
10
  "en-us": "/docs/get_index/en-us/000.0/false/All%20Services/all",
@@ -39,6 +40,7 @@ export default abstract class DocsGrid extends LightningElement {
39
40
  private deviceType: "desktop" | "mobile" | "mobile-small" = "desktop";
40
41
  private _searchTimeout?: number;
41
42
  private _couchDbDocTileExclusions?: Set<any>;
43
+ private _allLanguages: Array<Language> = [];
42
44
 
43
45
  connectedCallback(): void {
44
46
  this.retrieveDscApis(true);
@@ -201,6 +203,17 @@ export default abstract class DocsGrid extends LightningElement {
201
203
  );
202
204
  }
203
205
 
206
+ @api
207
+ get allLanguages(): Array<Language> {
208
+ return this._allLanguages;
209
+ }
210
+
211
+ set allLanguages(value: string) {
212
+ if (value) {
213
+ this._allLanguages = JSON.parse(value);
214
+ }
215
+ }
216
+
204
217
  get showEmptyState() {
205
218
  return this.dataRetrieved && !this.filteredDocs.length;
206
219
  }
@@ -504,7 +517,11 @@ export default abstract class DocsGrid extends LightningElement {
504
517
  this.selectedProductFilters =
505
518
  productFilters === "" ? [] : productFilters.split(",");
506
519
 
507
- if (languageFilter === "en-us" || languageFilter === "ja-jp") {
520
+ const isSupportedLocale = isGivenLanguageSupported(
521
+ this.allLanguages,
522
+ languageFilter
523
+ );
524
+ if (isSupportedLocale) {
508
525
  this.selectedLanguageFilter = languageFilter;
509
526
  }
510
527
  }
@@ -47,7 +47,7 @@
47
47
  onchange={handleChange}
48
48
  placeholder="Select your Country/Region"
49
49
  message-when-value-missing="Select your country/region"
50
- json-options={countries}
50
+ options={countries}
51
51
  value={country}
52
52
  required="true"
53
53
  ></dx-select>
@@ -177,8 +177,8 @@ export default class Form extends LightningElement {
177
177
 
178
178
  handleConsent(countrySelectElement: any) {
179
179
  if (this.checkboxTextSet) {
180
- const countryOptions = countrySelectElement.jsonOptions.find(
181
- (jsonOption) => jsonOption.value === countrySelectElement.value
180
+ const countryOptions = countrySelectElement.options.find(
181
+ (option) => option.value === countrySelectElement.value
182
182
  );
183
183
 
184
184
  this.setLegalAndMarketingData(countryOptions);
package/LICENSE DELETED
@@ -1,12 +0,0 @@
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.