Skip to content

Commit

Permalink
improve modal and path
Browse files Browse the repository at this point in the history
Work on field layouts
  • Loading branch information
aheber committed Feb 8, 2024
1 parent f359c36 commit 89c190a
Show file tree
Hide file tree
Showing 9 changed files with 705 additions and 602 deletions.
13 changes: 13 additions & 0 deletions dlrs/main/classes/LookupRollupStatusCheckController.cls
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ public with sharing class LookupRollupStatusCheckController {
];
}

/**
* Get count of scheduled items older than yesterday
* The assumption is that normal processing should have handled these
*/
@AuraEnabled(Cacheable=true)
public static Integer getOutstandingScheduledItemsForLookup(String lookupID) {
return [
SELECT COUNT()
FROM LookupRollupSummaryScheduleItems__c
WHERE LookupRollupSummary2__c = :lookupID AND LastModifiedDate < YESTERDAY
];
}

/**
* Check if the rollup has a Full Calculate schedule
*/
Expand Down
4 changes: 1 addition & 3 deletions dlrs/main/lwc/flexiblePath/flexiblePath.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@
</div>
</div>
<div class="slds-grid slds-path__action" lwc:if={nextActionLabel}>
<span id="slds-path__stage-name" class="slds-path__stage-name"
>Next Action: {nextActionLabel}</span
>
<span id="slds-path__stage-name" class="slds-path__stage-name"></span>
<button
class="slds-button slds-button_brand slds-path__mark-complete"
onclick={handleNextActionClick}
Expand Down
29 changes: 22 additions & 7 deletions dlrs/main/lwc/flexiblePath/flexiblePath.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import { LightningElement, api } from "lwc";

export const PATH_STATES = {
complete: "complete",
current: "current",
incomplete: "incomplete",
failed: "failed"
};

/**
* @typedef step
* @property {string} label
* @property {"complete"|"current"|"incomplete"|"failed"} status
* @property {string} name
* @property {keyof typeof PATH_STATES} status
* @property {string?} nextActionLabel
*/

export default class FlexiblePath extends LightningElement {
Expand All @@ -25,18 +34,24 @@ export default class FlexiblePath extends LightningElement {
if (!this.steps) {
return "unknown";
}
let nextLabel = this.steps.find((s) => s.status === "current")?.label;
if (!nextLabel) {
nextLabel = this.steps.find((s) => s.status === "incomplete")?.label;
}
return nextLabel;
let nextCurrent = this.nextAction;
return nextCurrent?.nextActionLabel ?? nextCurrent?.label;
}

get nextAction() {
return (
this.steps.find((s) => s.status === "current") ??
this.steps.find((s) => s.status === "incomplete")
);
}

handleNextActionClick() {
const nextAction = this.nextAction;
this.dispatchEvent(
new CustomEvent("nextactionclick", {
detail: {
label: this.nextActionLabel
label: nextAction.label,
name: nextAction.name
}
})
);
Expand Down
53 changes: 38 additions & 15 deletions dlrs/main/lwc/manageRollups/manageRollups.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { LightningElement } from "lwc";
import { LightningElement, wire } from "lwc";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import LightningConfirm from "lightning/confirm";
import { NavigationMixin, CurrentPageReference } from "lightning/navigation";

import getAllRollupConfigs from "@salesforce/apex/RollupEditorController.getAllRollupConfigs";
import deleteRollupConfig from "@salesforce/apex/RollupEditorController.deleteRollupConfig";
import USER_ID from "@salesforce/user/Id";
import RollupEditorModal from "c/rollupEditorModal";
import RollupEditor from "c/rollupEditor";

import {
subscribe,
Expand All @@ -13,7 +15,7 @@ import {
isEmpEnabled
} from "lightning/empApi";

export default class ManageRollups extends LightningElement {
export default class ManageRollups extends NavigationMixin(LightningElement) {
dtColumns = [
{
type: "button",
Expand All @@ -29,21 +31,21 @@ export default class ManageRollups extends LightningElement {
}
},
{
label: "Parent",
fieldName: "ParentObject__c"
label: "Child",
fieldName: "ChildObject__c"
},
{
label: "Field To Aggregate",
fieldName: "FieldToAggregate__c"
},
{
label: "Child",
fieldName: "ChildObject__c"
},
{
label: "Relationship Field",
fieldName: "RelationshipField__c"
},
{
label: "Parent",
fieldName: "ParentObject__c"
},
{
label: "Operation",
fieldName: "AggregateOperation__c"
Expand All @@ -54,7 +56,8 @@ export default class ManageRollups extends LightningElement {
},
{
label: "Active",
fieldName: "Active__c"
fieldName: "Active__c",
type: "boolean"
},
{
type: "button-icon",
Expand All @@ -67,6 +70,9 @@ export default class ManageRollups extends LightningElement {
}
];

@wire(CurrentPageReference)
pageRef;

// We only want events for which we've been assigned as the recipient
channelName = `/event/UserNotification__e?Recipient__c='${USER_ID.substring(
1,
Expand Down Expand Up @@ -125,15 +131,32 @@ export default class ManageRollups extends LightningElement {
}

async openEditor(rollupName) {
const result = await RollupEditorModal.open({
// `label` is not included here in this example.
// it is set on lightning-modal-header instead
const result = await RollupEditor.open({
size: "large",
description: "Rollup Config Editor",
rollupName
});
if (result?.action === "delete") {
this.requestDelete(result.rollupName);

switch (result?.action) {
case "delete":
this.requestDelete(result.rollupName);
break;
case "deloyStart":
// const rollupName = result.rollupName;
this.dispatchEvent(
new ShowToastEvent({
title: "Deployment Started",
message:
"Started Metadata Record Upates in Deployment " + result.jobId,
variant: "info"
})
);
break;
case "navigate":
this[NavigationMixin.Navigate](result.config);
break;
default:
break;
}
}

Expand Down
Loading

0 comments on commit 89c190a

Please sign in to comment.