Releases: jongpie/SimpleLightningComponents
Summer '18 Release
Created new toast notification component
Added toastNotification.cmp to the project. To use it:
-
Add the component to your Lightning app or component
<c:toastNotification />
-
When ready to display a notification, fire the toast application event
var toastEvent = $A.get('e.c:toastNotificationEvent'); toastEvent.setParams({ type : 'error', title: 'Something broke' }); toastEvent.fire();
All components in the project have also been upgraded to API v42.0
outputField.cmp now shows picklist translations instead of the raw value
This functionality works for both picklists & multi-select picklists
SimpleMetadata & New Components
SimpleMetadata is now being used for the metadata Apex classes. These classes are helpful for accessing metadata, so they have been split off into their own separate repo.
Major Changes & Backwards Compatibility
- Attributes have been updated to use the naming convention 'ApiName' instead of 'Name'. For example, sobjectMetadata.cmp now has sobjectApiName instead of sobjectName. Existing code will need to be updated to use the new naming convention
New Components & Classes
Several new service components have been added. These are no-UI components that make it easy to get different types of metadata
- simpleAdmin.cmp - this is a demo component that provides examples of how to use the other components. It's also a handy admin tool to quickly get information about your org
- currentUser.cmp - return info about the current user. Additional user fields can be returned by setting currentUser.additionalFieldApiNames
- environmentMetadata.cmp - returns an instance of the class EnvironmentMetadata.cls
- fieldSetMetadata.cmp - returns info about a field set, including instances of FieldMetadata for each field in the field set
- listviewMetadata.cmp - returns info for a specified list view ID or sobject API name + list view API name
- queueMetadata.cmp - returns info for a specified queue ID or queue API name
- recordTypeMetadata.cmp - returns info for a specified record type ID or sobject API name + record type API name
Created sobjectMetadata & lookup components
- Created a new extensible component, sobjectMetadata
- Created a lookup component - this is used by inputField.cmp for any lookup or master-detail fields. It supports for standard lookups, as well as polymorphic lookups
- fieldMetadata component is no longer abstract so it can be used as a service component
Created fieldMetadata abstract component
- fieldMetadata is a new abstract component that handles calling the Apex controller, LightningMetadataController, to get field metadata - this is then inherited by any component that extends fieldMetadata
- inputField, outputField and fieldLabel now extend the new abstract component, fieldMetadata.cmp
Code Cleanup & Error Handling
- Updated comparison operators to use === instead of ==
- Improved some handling of null and undefined values
- FieldMetadata now has isNameField
- Some name fields aren't flagged as required by describe calls - inputField now requires it if it's editable
- The methods in LightningMetadataController now have a try-catch block that throws an AuraHandledException when there is an error
Initial beta release of several metadata-driven components
First beta release of 4 components
- sobjectLabel
- fieldLabel
- inputField
- outputField
These are designed to support
- Automatic detection of field type and related metadata (like automatically getting picklist values)
- Automatic detection of sobject-level security and field-level security
- Automatic translation support for sobject labels & field labels
- Overrides and additional options (like additional rendering conditions on inputField) to give developers control when needed
There are a few additional components also included in this release
- modal
- objectPropertyValue