Skip to content

Commit

Permalink
Merge pull request #100 from tsalb/enhancements-and-polish
Browse files Browse the repository at this point in the history
Enhancements and polish
  • Loading branch information
tsalb authored Jun 29, 2021
2 parents f72e06a + 6bcf879 commit a1b2271
Show file tree
Hide file tree
Showing 23 changed files with 282 additions and 119 deletions.
2 changes: 1 addition & 1 deletion config/project-scratch-def.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"orgName": "lwc-utils",
"edition": "Developer",
"hasSampleData": true,
"features": ["ForceComPlatform", "LightningServiceConsole"],
"features": ["LightningServiceConsole"],
"settings": {
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true,
Expand Down
116 changes: 65 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lwc-utils",
"version": "1.7.0",
"version": "1.8.0",
"scripts": {
"eslint:validate": "eslint **/lwc/**/*.js",
"prettier:validate": "prettier --check '**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}'",
Expand Down Expand Up @@ -39,8 +39,8 @@
"eslint-plugin-jest": "^23.8.2",
"husky": "^5.2.0",
"jest-canvas-mock": "^2.3.1",
"prettier": "^2.3.0",
"prettier-plugin-apex": "^1.9.1",
"prettier": "^2.3.2",
"prettier-plugin-apex": "^1.10.0",
"rimraf": "^3.0.2"
}
}
14 changes: 7 additions & 7 deletions sfdx-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
"path": "utils-core",
"default": true,
"package": "LWC Utils",
"versionName": "ver 1.7.0",
"versionNumber": "1.7.0.NEXT",
"versionName": "ver 1.8.0",
"versionNumber": "1.8.0.NEXT",
"postInstallUrl": "https://github.com/tsalb/lwc-utils/releases",
"releaseNotesUrl": "https://github.com/tsalb/lwc-utils/releases"
},
{
"path": "utils-recipes",
"default": false,
"package": "LWC Utils Recipes",
"versionName": "ver 1.7.0",
"versionNumber": "1.7.0.NEXT",
"versionName": "ver 1.8.0",
"versionNumber": "1.8.0.NEXT",
"postInstallUrl": "https://github.com/tsalb/lwc-utils/releases",
"releaseNotesUrl": "https://github.com/tsalb/lwc-utils/releases",
"dependencies": [
{
"package": "LWC Utils",
"versionNumber": "1.7.0.LATEST"
"versionNumber": "1.8.0.LATEST"
}
]
}
Expand All @@ -31,8 +31,8 @@
"packageAliases": {
"LWC Utils": "0Ho1Q000000blJiSAI",
"LWC Utils Recipes": "0Ho1Q000000blJnSAI",
"LWC [email protected]": "04t1Q000001MRpeQAG",
"LWC [email protected]": "04t1Q000001MRsYQAW",
"LWC Utils [email protected]": "04t1Q000001MRsdQAG"
"LWC [email protected]": "04t1Q000001MRtvQAG",
"LWC Utils [email protected]": "04t1Q000001MRu0QAG"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@
},
createOverlayModalWithEventFooter: function (component, event, helper) {
let params = event.getParam('arguments');
let singleton = component.find('singleton');

helper.createBody(
component,
params,
Expand All @@ -150,6 +152,8 @@
}
if (modalBody.isValid() && !$A.util.isEmpty(modalBody)) {
helper.createEventFooter(
// Helps scope messageService events from body to footer
params.bodyParams.uniqueBoundary || null,
$A.getCallback((error, eventFooter) => {
helper
.overlayLib(component)
Expand Down Expand Up @@ -178,6 +182,7 @@
})
);
} else {
singleton.setIsCreatingModal(false);
console.error('modalBody error is: ' + error[0].message);
}
})
Expand Down
20 changes: 13 additions & 7 deletions utils-core/main/default/aura/DialogService/DialogServiceHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,20 @@
}
);
},
createEventFooter: function (ctrlCallback) {
$A.createComponent('c:EventFooter', {}, (eventFooter, status, errorMessage) => {
if (status === 'SUCCESS') {
ctrlCallback(null, eventFooter);
} else {
ctrlCallback(errorMessage);
createEventFooter: function (uniqueBoundary, ctrlCallback) {
$A.createComponent(
'c:EventFooter',
{
uniqueBoundary: uniqueBoundary
},
(eventFooter, status, errorMessage) => {
if (status === 'SUCCESS') {
ctrlCallback(null, eventFooter);
} else {
ctrlCallback(errorMessage);
}
}
});
);
},
defineLargeModalAttribute: function (isLargeModalVal) {
if ($A.util.isUndefinedOrNull(isLargeModalVal)) {
Expand Down
8 changes: 7 additions & 1 deletion utils-core/main/default/aura/EventFooter/EventFooter.cmp
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<aura:component>
<c:messageService
aura:id="messageService"
boundary="{! v.uniqueBoundary }"
onflowfinish="{! c.handleCancel }"
onclosedialog="{! c.handleCancel }"
/>
<aura:attribute name="uniqueBoundary" type="String" access="PUBLIC" />
<lightning:overlayLibrary aura:id="overlayLib" />
<c:messageService aura:id="messageService" onclosedialog="{! c.handleCancel }" />
</aura:component>
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
({
handleCancel: function (component) {
component.find('overlayLib').notifyClose();
component.destroy();
}
});
1 change: 1 addition & 0 deletions utils-core/main/default/aura/FlowWrapper/FlowWrapper.cmp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<aura:component>
<c:messageService aura:id="messageService" />

<aura:attribute name="uniqueBoundary" type="String" access="PUBLIC" />
<aura:attribute name="flowApiName" type="String" access="PUBLIC" />
<aura:attribute name="inputVariables" type="Object[]" access="PUBLIC" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
onworkspaceapi="{! c.handleWorkspaceApi }"
onrecordedit="{! c.handleRecordEdit }"
onrecordcreate="{! c.handleRecordCreate }"
onflowforcerefreshview="{! c.handleFlowForceRefreshView }"
/>

<c:singleton aura:id="singleton" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,8 @@
singleton.setIsMessaging(true);

helper.fireRecordCreate(component, payload);
},
handleFlowForceRefreshView: function (component, event, helper) {
helper.messageService(component).forceRefreshView();
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
headerLabel: payload.config.flowHeaderLabel,
component: 'c:FlowWrapper',
componentParams: {
uniqueBoundary: payload.config.componentParams.uniqueBoundary,
flowApiName: payload.config.componentParams.flowApiName,
inputVariables: payload.config.componentParams.inputVariables
}
Expand Down
Loading

0 comments on commit a1b2271

Please sign in to comment.