Skip to content

Commit

Permalink
Merge pull request #1547 from alexed1/v420Source
Browse files Browse the repository at this point in the history
V420 source
  • Loading branch information
alexed1 authored Jul 5, 2024
2 parents ff6e279 + 788a602 commit 9bc4823
Show file tree
Hide file tree
Showing 20 changed files with 570 additions and 134 deletions.
24 changes: 21 additions & 3 deletions flow_screen_components/datatable/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ https://unofficialsf.com/flow-action-and-screen-component-basepacks/

---
**Install Datatable**
[Version 4.1.6 (Production or Developer)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5G000004XZk9QAG)
[Version 4.1.6 (Sandbox)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5G000004XZk9QAG)
[Version 4.2.0 (Production or Developer)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5G000004XZlHQAW)
[Version 4.2.0 (Sandbox)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5G000004XZlHQAW)

---
**Starting with the Winter '21 Release, Salesforce requires that a User's Profile or Permission Set is given specific permission to access any @AuraEnabled Apex Method.**
Expand All @@ -72,7 +72,25 @@ A Permission Set (**USF Flow Screen Component - Datatable**) is included with th
---
# Release Notes

## 02/06/24 - Eric Smith - Version 4.1.6
## 04/06/24 - Eric Smith - Version 4.2.0
**Updates:**
- Added optional pagination
- Adds a selectable number of Records per Page input to the header - default value 10
- Adds a navigation footer with a editable input showing the current page # and total number of pages
- The footer also includes Prev & Next buttons as well as optional First & Last Buttons
- The appropriate buttons are disabled if the user is on the first or the last page
- New pagination input prompts and button labels are translatable Custom Labels
- (Initial release does not support retaining selected records when sorting, filtering, searching, paginating)
- Made the Table Header Label reactive
- Moved the Configure Columns button from the top to the bottom of the Table Formatting section of the CPE

**Bug Fixes:**
- Fixed bug where the maximum number of rows to be displayed gets cleared
- Fixed bug where an invalid link would show when an Apex Defined Lookup field was empty (@spyros-michailidisspyros-michailidis PR#1524)
- Fixed install issue with ers_DatatableController.cls if the target org has a class named "Test"
- Fixed a bug where Date fields from External Objects would show as blank (@philipnovak-pentair PR#1529)

## 02/06/24 - Eric Smith - Version 4.1.6
**Bug Fixes:**
- Fixed several Spring '24 "Cannot read properties of undefined..." errors
- Allow a full row search when empty cells are present (thanks to clev32 PR#1478)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
* 3/14/22 Version 3.5.0 Added option to suppress the currency conversion introduced in v3.1.1
* 9/6/22 Version 4.0.9 Return a collection of datetime fields for handling in the LWC
* 11/12/23 Version 4.1.5 Identify all datetime fields even if they are not in the Datatable (Needed to support reactive Collection Processors)
* 02/28/24 Version 4.2.0 Fix install issue if the target org has a class named "Test"
*/
@SuppressWarnings('PMD.ClassNamingConventions')

Expand Down Expand Up @@ -389,7 +390,7 @@ public with sharing class ers_DatatableController {
for (String currField : currencyFields) {
currencyFieldsQuery +=
', ' +
(Test.isRunningTest() ? currField : 'convertCurrency(' + currField + ')');
(System.Test.isRunningTest() ? currField : 'convertCurrency(' + currField + ')');
}
currencyFieldsQuery += ' FROM ' + objName + ' WHERE Id IN :records';
Map<Id, SObject> sobjCurrencyFields = new Map<Id, SObject>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<apiVersion>60.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<apiVersion>60.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<apiVersion>60.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<apiVersion>60.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<apiVersion>60.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<apiVersion>60.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,70 @@
<shortDescription>Clear All Filters</shortDescription>
<value>Clear All Filters</value>
</labels>
<labels>
<fullName>ers_FirstButton</fullName>
<categories>buttons</categories>
<language>en_US</language>
<protected>false</protected>
<shortDescription>First Page</shortDescription>
<value>First</value>
</labels>
<labels>
<fullName>ers_PreviousButton</fullName>
<categories>buttons</categories>
<language>en_US</language>
<protected>false</protected>
<shortDescription>Previous Page</shortDescription>
<value>Prev</value>
</labels>
<labels>
<fullName>ers_NextButton</fullName>
<categories>buttons</categories>
<language>en_US</language>
<protected>false</protected>
<shortDescription>Next Page</shortDescription>
<value>Next</value>
</labels>
<labels>
<fullName>ers_LastButton</fullName>
<categories>buttons</categories>
<language>en_US</language>
<protected>false</protected>
<shortDescription>Last Page</shortDescription>
<value>Last</value>
</labels>
<labels>
<fullName>ers_RecordsPerPage</fullName>
<categories>labels</categories>
<language>en_US</language>
<protected>false</protected>
<shortDescription>Records per Page input label</shortDescription>
<value>Records per Page</value>
</labels>
<labels>
<fullName>ers_ShowingPagePrefix</fullName>
<categories>labels</categories>
<language>en_US</language>
<protected>false</protected>
<shortDescription>Showing Page x of y Pages input label prefix</shortDescription>
<value>Showing Page</value>
</labels>
<labels>
<fullName>ers_ShowingPageMiddle</fullName>
<categories>labels</categories>
<language>en_US</language>
<protected>false</protected>
<shortDescription>Showing Page x of y Pages input label middle</shortDescription>
<value>of</value>
</labels>
<labels>
<fullName>ers_ShowingPageSuffix</fullName>
<categories>labels</categories>
<language>en_US</language>
<protected>false</protected>
<shortDescription>Showing Page x of y Pages input label suffix</shortDescription>
<value>Pages</value>
</labels>
<labels>
<fullName>ers_SetFilterAction</fullName>
<categories>actions</categories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ <h3 class="slds-text-heading_medium">Interact with this sample datatable to conf

<!-- DATATABLE -->
<div class={formElementClass}>
<!-- New Format with Searchbar -->
<template if:true={isShowSearchBar}>
<!-- New Format with Searchbar and/or Pagination -->
<template lwc:if={isShowNewheader}>
<abbr class="slds-required" title="required">{requiredSymbol}</abbr>
<lightning-card variant="Narrow" icon-name={tableIcon}>
<div slot="title">
Expand All @@ -119,13 +119,30 @@ <h3 class="slds-text-heading_medium">Interact with this sample datatable to conf
</div>
</div>
<div slot="actions">
<lightning-input
type="search"
placeholder={searchPlaceholder}
value={searchTerm}
onchange={handleSearchChange}
is-loading={isWorking}
></lightning-input>
<div class="slds-grid slds-grid_align-end">
<template lwc:if={isPagination}>
<legend class="slds-form-element__legend slds-form-element__label">{recordCountLabel}</legend>
<lightning-input
type="number"
min="1"
value={recordCountPerPage}
variant="label-hidden"
onchange={handleRecordCountChange}
></lightning-input>
</template>
<template lwc:if={isShowSearchBar}>
<div class="slds-p-left_medium">
<lightning-input
type="search"
placeholder={searchPlaceholder}
value={searchTerm}
variant="label-hidden"
onchange={handleSearchChange}
is-loading={isWorking}
></lightning-input>
</div>
</template>
</div>
</div>
<template if:true={isShowTable}>
<div if:true={isWorking}>
Expand All @@ -138,7 +155,7 @@ <h3 class="slds-text-heading_medium">Interact with this sample datatable to conf

<c-ers_custom-lightning-datatable
aria-label={tableLabel}
data={mydata}
data={paginatedData}
columns={columns}
key-field={keyField}
sorted-by={sortedBy}
Expand Down Expand Up @@ -193,7 +210,7 @@ <h3 class="slds-text-heading_medium">Interact with this sample datatable to conf
</template>

<!-- Old Format with Searchbar commented out -->
<template if:false={isShowSearchBar}>
<template if:false={isShowNewheader}>
<template if:true={isDisplayHeader}>
<div class="slds-grid slds-grid_align-spread">
<div class="slds-col">
Expand Down Expand Up @@ -236,7 +253,7 @@ <h3 class="slds-text-heading_medium">Interact with this sample datatable to conf
<div if:false={isWorking} style={tableHeightAttribute} class={borderClass} id="datatable">
<c-ers_custom-lightning-datatable
aria-label={tableLabel}
data={mydata}
data={paginatedData}
columns={columns}
key-field={keyField}
sorted-by={sortedBy}
Expand Down Expand Up @@ -286,6 +303,68 @@ <h3 class="slds-text-heading_medium">Interact with this sample datatable to conf
</template>
</div>

<!-- Pagination Footer -->
<template lwc:if={isPagination}>
<div class="slds-grid slds-grid_align-center">
<template lwc:if={isShowButtonFirstLast}>
<div class="slds-col slds-align-middle slds-p-top_medium slds-p-right_xx-small">
<lightning-button
label={buttonFirstLabel}
variant="brand-outline"
icon-position="left"
icon-name="utility:arrow_left"
onclick={handleButtonFirst}
disabled={isFirstPage}
></lightning-button>
</div>
</template>
<div class="slds-col slds-align-middle slds-p-top_medium">
<lightning-button
label={buttonPrevLabel}
variant="brand-outline"
icon-position="left"
icon-name="utility:chevronleft"
onclick={handleButtonPrev}
disabled={isFirstPage}
></lightning-button>
</div>
<div class="slds-col slds-text-body_regular slds-p-horizontal_medium slds-align-middle">
<lightning-input
type="number"
min="1"
max={pageTotalCount}
label={pageNumberLabel}
value={pageCurrentNumber}
variant="label-stacked"
onchange={handlePageChange}
disabled={isOnlyOnePage}
></lightning-input>
</div>
<div class="slds-col slds-align-middle slds-p-top_medium">
<lightning-button
label={buttonNextLabel}
variant="brand-outline"
icon-position="right"
icon-name="utility:chevronright"
onclick={handleButtonNext}
disabled={isLastpage}
></lightning-button>
</div>
<template lwc:if={isShowButtonFirstLast}>
<div class="slds-col slds-align-middle slds-p-top_medium slds-p-left_xx-small">
<lightning-button
label={buttonLastLabel}
variant="brand-outline"
icon-position="right"
icon-name="utility:arrow_right"
onclick={handleButtonLast}
disabled={isLastpage}
></lightning-button>
</div>
</template>
</div>
</template>

<!-- Special Footer parameter display for Configuration Mode -->
<template if:true={isConfigMode}>

Expand Down
Loading

0 comments on commit 9bc4823

Please sign in to comment.