From 888ae46696033db41b0d5f60066d9d976ca4bbef Mon Sep 17 00:00:00 2001 From: Igor Androsov Date: Wed, 20 Dec 2023 10:56:38 +0900 Subject: [PATCH 1/4] FIx data day format on block modal issues #2 --- force-app/main/default/classes/GGW_ContentBlockWrapper.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/force-app/main/default/classes/GGW_ContentBlockWrapper.cls b/force-app/main/default/classes/GGW_ContentBlockWrapper.cls index a8a5ee7..fd76cf5 100644 --- a/force-app/main/default/classes/GGW_ContentBlockWrapper.cls +++ b/force-app/main/default/classes/GGW_ContentBlockWrapper.cls @@ -40,7 +40,7 @@ public class GGW_ContentBlockWrapper { // Count words in rich text with APEX methods integer words = block.Description__c.normalizeSpace().stripHtmlTags().replaceAll('\\S','').length() ; this.wordcount = words; - this.displaydate = block.CreatedDate.format('YYYY-MM'); // Format this to short + this.displaydate = block.CreatedDate.format('YYYY-MM-dd'); // Format this to short // Temporary value for tag default //this.displaybadge = ''; // TODO find how to fill this what make a tag? this.totalblocks = cnt; From 014275ef689eda4d13033b32508851f8fadf6b93 Mon Sep 17 00:00:00 2001 From: Igor Androsov Date: Wed, 20 Dec 2023 11:01:48 +0900 Subject: [PATCH 2/4] Fix for issue #3 word count on text block --- force-app/main/default/classes/GGW_ContentBlockWrapper.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/force-app/main/default/classes/GGW_ContentBlockWrapper.cls b/force-app/main/default/classes/GGW_ContentBlockWrapper.cls index fd76cf5..62e2733 100644 --- a/force-app/main/default/classes/GGW_ContentBlockWrapper.cls +++ b/force-app/main/default/classes/GGW_ContentBlockWrapper.cls @@ -39,7 +39,7 @@ public class GGW_ContentBlockWrapper { this.languagelabel = GGW_Util.toLanguageLabel(block.Language__c); // Language label // Count words in rich text with APEX methods integer words = block.Description__c.normalizeSpace().stripHtmlTags().replaceAll('\\S','').length() ; - this.wordcount = words; + this.wordcount = words + 1; // Adjust of undercount by 1 noted in Issue #3 this.displaydate = block.CreatedDate.format('YYYY-MM-dd'); // Format this to short // Temporary value for tag default //this.displaybadge = ''; // TODO find how to fill this what make a tag? From 32842965122905787d33542ee16717e891f83805 Mon Sep 17 00:00:00 2001 From: Igor Androsov Date: Wed, 20 Dec 2023 13:00:38 +0900 Subject: [PATCH 3/4] Fix issues #10 new section creation --- .../default/classes/GGW_ApplicationCtrl.cls | 2 + .../ggwNewApplication/ggwNewApplication.html | 11 +- .../ggwNewApplication/ggwNewApplication.js | 193 +++++++----------- 3 files changed, 84 insertions(+), 122 deletions(-) diff --git a/force-app/main/default/classes/GGW_ApplicationCtrl.cls b/force-app/main/default/classes/GGW_ApplicationCtrl.cls index af7bd77..c9df4bf 100644 --- a/force-app/main/default/classes/GGW_ApplicationCtrl.cls +++ b/force-app/main/default/classes/GGW_ApplicationCtrl.cls @@ -210,10 +210,12 @@ public without sharing class GGW_ApplicationCtrl { @AuraEnabled public static GGW_SectionWrapper createNewSection(String name){ GGW_Section__c maxOrder = findMaxOrderSection(); + String lang = GGW_Util.getGrantLanguage(); GGW_Section__c s = new GGW_Section__c(); s.Name = name; s.Recommended__c = true; s.Suggested__c = true; + s.Language__c = lang; s.Sort_Order__c = getSectionSortOrder(maxOrder); if(Schema.sObjectType.GGW_Section__c.isCreateable()){ insert s; diff --git a/force-app/main/default/lwc/ggwNewApplication/ggwNewApplication.html b/force-app/main/default/lwc/ggwNewApplication/ggwNewApplication.html index db2beb9..a18ce6e 100644 --- a/force-app/main/default/lwc/ggwNewApplication/ggwNewApplication.html +++ b/force-app/main/default/lwc/ggwNewApplication/ggwNewApplication.html @@ -11,8 +11,7 @@ - +
@@ -66,12 +65,18 @@ class="slds-var-m-bottom_small" > - + + diff --git a/force-app/main/default/lwc/ggwNewApplication/ggwNewApplication.js b/force-app/main/default/lwc/ggwNewApplication/ggwNewApplication.js index d723aa8..873f9f8 100644 --- a/force-app/main/default/lwc/ggwNewApplication/ggwNewApplication.js +++ b/force-app/main/default/lwc/ggwNewApplication/ggwNewApplication.js @@ -18,14 +18,12 @@ const DELAY = 300; export default class GgwNewApplication extends NavigationMixin(LightningElement) { error; _title = 'New Grant Application'; - message = 'New grant was created'; - variant = 'success'; @api availableActions = []; @api language = 'en_US'; - // -- List of checkobxes gested section + // -- List of checkobxes suggested section value = []; //['Statement of need','Plan of action','Budget narrative']; // Sample recommended selected Section IDs or items options = []; // List of Suggested sections display as checkboxes list the values show what is suggested from data - searchKey = ''; // Seach key for find Sections + searchKey = ''; // Search key for find Sections // --- Hold the original list of values temporary basevalue = []; //['Statement of need','Plan of action','Budget narrative']; // Sample recommends selected items @@ -36,10 +34,48 @@ export default class GgwNewApplication extends NavigationMixin(LightningElement) optionsSectionAdd = []; // --- newSectionName; + disableSectionCreateButton = true; // --New Grant name & Status combo box grantNameValue; statusValue; // --- + showToastSuccess(msg){ + const evt = new ShowToastEvent({ + title: this._title, + message: msg, + variant: 'success', + }); + this.dispatchEvent(evt); + } + showToastError(msg){ + const evt = new ShowToastEvent({ + title: this._title, + message: msg, + variant: 'error', + }); + this.dispatchEvent(evt); + } + showToastWarning(msg){ + const evt = new ShowToastEvent({ + title: this._title, + message: msg, + variant: 'warning', + }); + this.dispatchEvent(evt); + } + navigateToGrantEditorPage(recordId){ + this[NavigationMixin.Navigate]({ + type: 'standard__navItemPage', + attributes: { + apiName: 'GGW_Grant_Editor' + }, + state: { + c__recordId: recordId, + c__uictx: 'page' + } + }); + } + connectedCallback() { this.getSectionsList(); } @@ -77,33 +113,6 @@ export default class GgwNewApplication extends NavigationMixin(LightningElement) console.log('New Application wireFoundSections: unknown error') } } - // Intialize seggested sections list for home page - // Used in checkbox group to select sections to use by Grant application - /* - @wire(getSections) - wireSugestedSection({error,data}){ - if (data) { - - for(var i=0; i { console.log('NEW SECTION: '+JSON.stringify(result)); @@ -214,28 +233,19 @@ export default class GgwNewApplication extends NavigationMixin(LightningElement) this.options = this.baseoptions; this.value = []; this.value = this.basevalue; + // Clear Section input + this.disableSectionCreateButton = true; + this.newSectionName = null; - this.message = 'New Section was created with ID: '; - this.variant = 'success'; + this.showToastSuccess(`New Section was created with ID: ${result.recordid}`); }) .catch((error) => { this.error = error; - //this.contacts = undefined; - this.message = this.error; - this.variant = 'error'; + this.showToastError(this.error); }); }else{ - this.message = 'Please provide a name to create a new Section.'; - this.variant = 'warning'; + this.showToastWarning(`Please provide a name to create a new Section.`); } - // Display toaster message - const evt = new ShowToastEvent({ - title: this._title, - message: this.message, - variant: this.variant, - }); - this.dispatchEvent(evt); - } // Create new Grant application event handler @@ -245,74 +255,19 @@ export default class GgwNewApplication extends NavigationMixin(LightningElement) // Create record/s for new app save and continue to next newGrant({name: this.grantNameValue, sections: this.value}) .then((result) => { - //this.contacts = result; console.log('NEW GRANT: '+JSON.stringify(result)); this.error = undefined; - - // check if NEXT is allowed on this screen - /* - console.log('NEXT Try Navigate IF FLOW'); - if (this.availableActions.find((action) => action === 'NEXT')) { - // navigate to the next screen - console.log('Navigate FLOW NEXT IF Action is OK'); - const navigateNextEvent = new FlowNavigationNextEvent(); - this.dispatchEvent(navigateNextEvent); - } - */ - this.message = 'New Grant Application was created with ID: '+result.Id; - this.variant = 'success'; - // Display toaster message - const evt = new ShowToastEvent({ - title: this._title, - message: this.message, - variant: this.variant, - }); - this.dispatchEvent(evt); - + + this.showToastSuccess(`New Grant Application was created with ID: ${result.Id}`); // Navigate to New Grant record page - this[NavigationMixin.Navigate]({ - type: 'standard__navItemPage', - attributes: { - apiName: 'GGW_Grant_Editor' - }, - state: { - c__recordId: result.Id, - c__uictx: 'page' - } - }); - /** This navi to standard Grant record page - type: 'standard__recordPage', - attributes: { - recordId: result.Id, - objectApiName: 'GGW_Grant_Application__c', - actionName: 'view' - } - }); */ + this.navigateToGrantEditorPage(result.Id); }) .catch((error) => { this.error = error; - //this.contacts = undefined; - this.message = this.error; - this.variant = 'error'; - // Display toaster message - const evt = new ShowToastEvent({ - title: this._title, - message: this.message, - variant: this.variant, - }); - this.dispatchEvent(evt); + this.showToastError(this.error); }); }else{ - this.message = 'Please provide a name to create a Grant application.'; - this.variant = 'warning'; - // Display toaster message - const evt = new ShowToastEvent({ - title: this._title, - message: this.message, - variant: this.variant, - }); - this.dispatchEvent(evt); + this.showToastWarning(`Please provide a name to create a Grant application.`); } - } } \ No newline at end of file From 8023922ea88b02c9803e9fd5c25903a668a20d0f Mon Sep 17 00:00:00 2001 From: Igor Androsov Date: Thu, 21 Dec 2023 16:31:36 +0900 Subject: [PATCH 4/4] Update API version 58.0 --- force-app/main/default/classes/GGW_ApplicationCtrl.cls-meta.xml | 2 +- .../main/default/classes/GGW_ContentBlockWrapper.cls-meta.xml | 2 +- .../default/lwc/ggwNewApplication/ggwNewApplication.js-meta.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/force-app/main/default/classes/GGW_ApplicationCtrl.cls-meta.xml b/force-app/main/default/classes/GGW_ApplicationCtrl.cls-meta.xml index 40d6793..7a51829 100644 --- a/force-app/main/default/classes/GGW_ApplicationCtrl.cls-meta.xml +++ b/force-app/main/default/classes/GGW_ApplicationCtrl.cls-meta.xml @@ -1,5 +1,5 @@ - 54.0 + 58.0 Active diff --git a/force-app/main/default/classes/GGW_ContentBlockWrapper.cls-meta.xml b/force-app/main/default/classes/GGW_ContentBlockWrapper.cls-meta.xml index 9bbf7b4..642d054 100644 --- a/force-app/main/default/classes/GGW_ContentBlockWrapper.cls-meta.xml +++ b/force-app/main/default/classes/GGW_ContentBlockWrapper.cls-meta.xml @@ -1,5 +1,5 @@ - 56.0 + 58.0 Active \ No newline at end of file diff --git a/force-app/main/default/lwc/ggwNewApplication/ggwNewApplication.js-meta.xml b/force-app/main/default/lwc/ggwNewApplication/ggwNewApplication.js-meta.xml index 5e6be18..9664297 100644 --- a/force-app/main/default/lwc/ggwNewApplication/ggwNewApplication.js-meta.xml +++ b/force-app/main/default/lwc/ggwNewApplication/ggwNewApplication.js-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 58.0 true New Grant Application