Initial commit: AgentForceTest Salesforce DX project

This commit is contained in:
2026-01-23 20:27:42 +05:30
commit 5f4ee0506f
41 changed files with 10998 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
/**
* Apex class for JIRA Integration
* This class handles fetching and processing JIRA issues
*/
public with sharing class JiraIntegration {
/**
* Default constructor
*/
public JiraIntegration() {
// Constructor logic can be added here if needed
}
/**
* Inner class to represent a JIRA issue
*/
public class JiraIssue {
public String key { get; set; }
public String summary { get; set; }
public String priority { get; set; }
public String assignee { get; set; }
public String status { get; set; }
public String createdDate { get; set; }
public String updatedDate { get; set; }
public String description { get; set; }
public String url { get; set; }
}
/**
* Method to fetch JIRA issues (simulated for this example)
* In a real implementation, this would connect to JIRA REST API
* @return List of JiraIssue objects
*/
public List<JiraIssue> getJiraIssues() {
// Simulate fetching JIRA issues - in reality this would make HTTP callouts to JIRA API
List<JiraIssue> issues = new List<JiraIssue>();
// Create sample issues based on the existing Jira summaries
JiraIssue issue1 = new JiraIssue();
issue1.key = 'KAN-4';
issue1.summary = 'Implement Account Quick Create Feature';
issue1.priority = 'High';
issue1.assignee = 'John Doe';
issue1.status = 'In Progress';
issue1.createdDate = '2023-10-15';
issue1.updatedDate = '2023-10-20';
issue1.description = 'Implement a quick create feature for Accounts that allows users to create new accounts directly from the Account list view without navigating to a separate page.';
issue1.url = 'https://your-jira-instance.com/browse/KAN-4';
issues.add(issue1);
JiraIssue issue2 = new JiraIssue();
issue2.key = 'KAN-5';
issue2.summary = 'Update Account Quick Create Validation Rules';
issue2.priority = 'Medium';
issue2.assignee = 'Jane Smith';
issue2.status = 'Done';
issue2.createdDate = '2023-10-18';
issue2.updatedDate = '2023-10-22';
issue2.description = 'Update the validation rules for the Account Quick Create feature to align with the latest business requirements.';
issue2.url = 'https://your-jira-instance.com/browse/KAN-5';
issues.add(issue2);
return issues;
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>65.0</apiVersion>
<status>Active</status>
</ApexClass>

View File

@@ -0,0 +1,66 @@
<template>
<section class="slds-card slds-p-around_medium">
<h2 class="slds-text-heading_medium slds-m-bottom_medium">
Create Person Account
</h2>
<div class="slds-grid slds-wrap slds-gutters">
<div
class="slds-col slds-size_1-of-1 slds-medium-size_1-of-2 slds-p-bottom_small"
>
<lightning-input
type="text"
name="firstName"
label="First Name"
value={firstName}
onchange={handleInputChange}
>
</lightning-input>
</div>
<div
class="slds-col slds-size_1-of-1 slds-medium-size_1-of-2 slds-p-bottom_small"
>
<lightning-input
type="text"
name="lastName"
label="Last Name"
value={lastName}
required
onchange={handleInputChange}
>
</lightning-input>
</div>
<div
class="slds-col slds-size_1-of-1 slds-medium-size_1-of-2 slds-p-bottom_small"
>
<lightning-input
type="email"
name="email"
label="Email"
value={email}
onchange={handleInputChange}
>
</lightning-input>
</div>
</div>
<div class="slds-m-top_large slds-grid slds-grid_align-end">
<lightning-button
variant="brand"
label="Continue"
title="Continue"
onclick={handleContinue}
disabled={isContinueDisabled}
>
</lightning-button>
</div>
<template if:true={message}>
<div class="slds-m-top_medium">
<lightning-formatted-text value={message}></lightning-formatted-text>
</div>
</template>
</section>
</template>

View File

@@ -0,0 +1,79 @@
import { LightningElement, track } from "lwc";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
/**
* Account Quick Create (Standalone Inputs)
* - Standalone lightning-input fields for First Name, Last Name, and Email
* - No LDS save; exposes values and basic validation
*/
export default class AccountQuickCreate extends LightningElement {
@track message;
@track firstName = "";
@track lastName = "";
@track email = "";
get isContinueDisabled() {
// Require Last Name per standard person-name requirements; email optional here
return !this.lastName;
}
handleInputChange(event) {
const { name, value } = event.target;
if (name === "firstName") {
this.firstName = value;
} else if (name === "lastName") {
this.lastName = value;
} else if (name === "email") {
this.email = value;
}
this.message = undefined;
}
handleContinue() {
// Basic validation: enforce Last Name
if (!this.lastName) {
this.dispatchEvent(
new ShowToastEvent({
title: "Validation",
message: "Last Name is required.",
variant: "warning"
})
);
return;
}
// Email validation
if (this.email && !this.isValidEmail(this.email)) {
this.dispatchEvent(
new ShowToastEvent({
title: "Validation",
message: "Please enter a valid email address.",
variant: "warning"
})
);
return;
}
// Example: expose collected values (could dispatch custom event to parent)
const detail = {
firstName: this.firstName?.trim(),
lastName: this.lastName?.trim(),
email: this.email?.trim()
};
this.dispatchEvent(
new CustomEvent("contactinput", {
detail,
bubbles: true,
composed: true
})
);
this.message = `Captured input - First: ${detail.firstName || ""}, Last: ${detail.lastName}, Email: ${detail.email || ""}`;
}
isValidEmail(email) {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return emailRegex.test(email);
}
}

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>65.0</apiVersion>
<isExposed>true</isExposed>
<masterLabel>Account Quick Create (Person Account)</masterLabel>
<description
>LWC to create a Person Account with First Name, Last Name, and Email using standalone inputs.</description>
<targets>
<target>lightning__AppPage</target>
<target>lightning__RecordPage</target>
<target>lightning__HomePage</target>
<target>lightning__FlowScreen</target>
</targets>
<targetConfigs>
<targetConfig targets="lightning__RecordPage">
<objects>
<object>Account</object>
</objects>
</targetConfig>
</targetConfigs>
</LightningComponentBundle>

View File

@@ -0,0 +1,26 @@
import { LightningElement, wire } from "lwc";
import getJiraIssues from "@salesforce/apex/JiraIntegration.getJiraIssues";
export default class JiraIssueList extends LightningElement {
@wire(getJiraIssues)
wiredIssues({ error, data }) {
if (data) {
this.issues = data;
this.error = undefined;
} else if (error) {
this.error = error;
this.issues = undefined;
}
}
issues;
error;
get hasIssues() {
return this.issues && this.issues.length > 0;
}
get hasError() {
return this.error !== undefined;
}
}

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>60.0</apiVersion>
<isExposed>true</isExposed>
<masterLabel>Jira Issue List</masterLabel>
<description>Displays a list of Jira issues</description>
<targets>
<target>lightning__RecordPage</target>
<target>lightning__AppPage</target>
<target>lightning__HomePage</target>
</targets>
</LightningComponentBundle>

View File

@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<actionOverrides>
<actionName>Accept</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>CancelEdit</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Clone</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Delete</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Edit</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>List</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>New</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>SaveEdit</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Tab</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>View</actionName>
<type>Default</type>
</actionOverrides>
<allowInChatterGroups>false</allowInChatterGroups>
<!-- Remove compactLayoutAssignment entirely to avoid defaultCompactLayoutAssignment error -->
<deploymentStatus>Deployed</deploymentStatus>
<description>Custom Project object</description>
<enableActivities>true</enableActivities>
<enableBulkApi>true</enableBulkApi>
<enableFeeds>false</enableFeeds>
<enableHistory>false</enableHistory>
<enableLicensing>false</enableLicensing>
<enableReports>true</enableReports>
<enableSearch>true</enableSearch>
<enableSharing>true</enableSharing>
<enableStreamingApi>true</enableStreamingApi>
<label>Project</label>
<nameField>
<displayFormat>PRJ-{00000}</displayFormat>
<label>Project Number</label>
<trackHistory>false</trackHistory>
<type>AutoNumber</type>
</nameField>
<pluralLabel>Projects</pluralLabel>
<recordTypeTrackHistory>false</recordTypeTrackHistory>
<searchLayouts />
<sharingModel>ReadWrite</sharingModel>
</CustomObject>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>Budget__c</fullName>
<externalId>false</externalId>
<label>Budget</label>
<precision>16</precision>
<scale>2</scale>
<required>false</required>
<trackHistory>false</trackHistory>
<trackTrending>false</trackTrending>
<type>Currency</type>
<unique>false</unique>
</CustomField>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>Project_Name__c</fullName>
<externalId>false</externalId>
<label>Project Name</label>
<length>255</length>
<required>true</required>
<trackHistory>false</trackHistory>
<trackTrending>false</trackTrending>
<type>Text</type>
<unique>false</unique>
</CustomField>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>Start_Date__c</fullName>
<externalId>false</externalId>
<label>Start Date</label>
<required>false</required>
<trackHistory>false</trackHistory>
<trackTrending>false</trackTrending>
<type>Date</type>
<unique>false</unique>
</CustomField>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>Project__c</fullName>
<customObject>true</customObject>
<motif>Custom47: Rhino</motif>
</CustomTab>