Skip to content

Commit 29dcb4d

Browse files
committed
Added post a job component
1 parent d287740 commit 29dcb4d

File tree

11 files changed

+316
-22
lines changed

11 files changed

+316
-22
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ $RECYCLE.BIN/
4545
**/venv/
4646

4747
testingLWC
48+
postJobsModal

design document.pages

71.9 KB
Binary file not shown.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/**
2+
* @description : To extract the picklist field values in job custom object
3+
* @author : Rudransh Shukla
4+
* @group :
5+
* @last modified on : 01-05-2024
6+
* @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc
7+
**/
8+
public with sharing class JobPicklistController {
9+
public List<String> getPicklistValues(
10+
String objectApiName,
11+
String fieldName
12+
) {
13+
List<String> picklistValues = new List<String>();
14+
15+
try {
16+
Schema.DescribeFieldResult fieldDescribe = Schema.getGlobalDescribe()
17+
.get(objectApiName)
18+
.getDescribe()
19+
.fields.getMap()
20+
.get(fieldName)
21+
.getDescribe();
22+
for (Schema.PicklistEntry entry : fieldDescribe.getPicklistValues()) {
23+
picklistValues.add(entry.getLabel());
24+
}
25+
System.debug('picklistValues: ' + picklistValues);
26+
} catch (Exception e) {
27+
System.debug('Error: ' + e.getMessage());
28+
}
29+
30+
return picklistValues;
31+
}
32+
33+
@AuraEnabled
34+
public static List<String> experienceFieldValues() {
35+
System.debug('started');
36+
37+
String fieldName = 'experience__c';
38+
String objectApiName = 'Job__c';
39+
40+
JobPicklistController controller = new JobPicklistController();
41+
42+
List<String> picklistValues = controller.getPicklistValues(
43+
objectApiName,
44+
fieldName
45+
);
46+
47+
System.debug('Picklist Values: ' + picklistValues);
48+
49+
return picklistValues;
50+
}
51+
@AuraEnabled
52+
public static list<string> typePickListValues() {
53+
System.debug('started');
54+
55+
String fieldName = 'type__c';
56+
String objectApiName = 'Job__c';
57+
58+
JobPicklistController controller = new JobPicklistController();
59+
60+
List<String> picklistValues = controller.getPicklistValues(objectApiName,fieldName);
61+
62+
System.debug('Picklist Values: ' + picklistValues);
63+
64+
return picklistValues;
65+
}
66+
@AuraEnabled
67+
public static list<string> IndustryPickListValues() {
68+
System.debug('started');
69+
70+
String fieldName = 'Industry__c';
71+
String objectApiName = 'Job__c';
72+
73+
JobPicklistController controller = new JobPicklistController();
74+
75+
List<String> picklistValues = controller.getPicklistValues(objectApiName,fieldName);
76+
77+
System.debug('Picklist Values: ' + picklistValues);
78+
79+
return picklistValues;
80+
}
81+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<apiVersion>58.0</apiVersion>
4+
<status>Active</status>
5+
</ApexClass>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { createElement } from 'lwc';
2+
import AddJobsPage from 'c/addJobsPage';
3+
4+
describe('c-add-jobs-page', () => {
5+
afterEach(() => {
6+
// The jsdom instance is shared across test cases in a single file so reset the DOM
7+
while (document.body.firstChild) {
8+
document.body.removeChild(document.body.firstChild);
9+
}
10+
});
11+
12+
it('TODO: test case generated by CLI command, please fill in test logic', () => {
13+
// Arrange
14+
const element = createElement('c-add-jobs-page', {
15+
is: AddJobsPage
16+
});
17+
18+
// Act
19+
document.body.appendChild(element);
20+
21+
// Assert
22+
// const div = element.shadowRoot.querySelector('div');
23+
expect(1).toBe(1);
24+
});
25+
});
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
.main {
2+
background: white;
3+
width: 86vw;
4+
height: 100%;
5+
}
6+
.job-content {
7+
display: flex;
8+
flex-direction: row;
9+
justify-content: center;
10+
height: 100%;
11+
width: 100%;
12+
}
13+
.about-job,
14+
.location {
15+
width: 50%;
16+
height: 100%;
17+
margin: 2%;
18+
}
19+
.about-job,
20+
.location {
21+
font-size: 1.5vw;
22+
font-weight: 500;
23+
}
24+
.Add-jobs-text {
25+
font-weight: 600;
26+
font-size: 2vw;
27+
}
28+
.requirements {
29+
max-width: 70%;
30+
margin: 2%;
31+
}
32+
33+
.requirements h1 {
34+
color: #333;
35+
font-size: 1.5vw;
36+
font-weight: 500;
37+
margin-bottom: 10px;
38+
}
39+
40+
.picklist {
41+
display: flex;
42+
flex-direction: column;
43+
}
44+
45+
label {
46+
display: block;
47+
margin-bottom: 1%;
48+
color: #333;
49+
}
50+
51+
select {
52+
width: 100%;
53+
padding: 1%;
54+
border: 1px solid #ccc;
55+
border-radius: 5px;
56+
background-color: #fff;
57+
color: #333;
58+
margin-bottom: 2%;
59+
outline: none;
60+
transition: border-color 0.3s;
61+
}
62+
63+
select:hover,
64+
select:focus {
65+
border-color: #007bff;
66+
}
67+
68+
option {
69+
color: #333;
70+
}
71+
select::-ms-expand {
72+
display: none;
73+
}
74+
.buttons {
75+
display: flex;
76+
flex-direction: row;
77+
}
78+
.post {
79+
padding-left: 2%;
80+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<!--
2+
@description : Add jobs page for HR portal
3+
@author : Rudransh Shukla
4+
@group :
5+
@last modified on : 01-08-2024
6+
@last modified by : ChangeMeIn@UserSettingsUnder.SFDoc
7+
-->
8+
<template>
9+
<div class="main">
10+
<div class="Add-jobs-text">
11+
<h1>Add Jobs</h1>
12+
</div>
13+
<hr />
14+
<div>
15+
<div class="job-content">
16+
<div class="about-job">
17+
<h1>About Job</h1>
18+
<lightning-input type="text" label="Job Title"></lightning-input>
19+
<lightning-input type="text" label="Summary"></lightning-input>
20+
<lightning-input type="text" label="Description"></lightning-input>
21+
<lightning-input type="text" label="Salary Range"></lightning-input>
22+
<lightning-input type="text" label="Company Name"></lightning-input>
23+
</div>
24+
<div class="location">
25+
<h1>Location</h1>
26+
<lightning-input type="text" label="Country"></lightning-input>
27+
<lightning-input type="text" label="City"></lightning-input>
28+
</div>
29+
</div>
30+
<hr />
31+
<div class="requirements">
32+
<h1>Job Requirements</h1>
33+
<div class="picklist">
34+
<label for="experience">Select Experience</label>
35+
<select id="experience" onchange={handleExperienceChange}>
36+
<option value="" disabled selected>Select Experience</option>
37+
<template for:each={experienceValues} for:item="experience">
38+
<option key={experience} value={experience}>{experience}</option>
39+
</template>
40+
</select>
41+
42+
<label for="type">Select Type</label>
43+
<select id="type" onchange={handleTypeChange}>
44+
<option value="" disabled selected>Select Type</option>
45+
<template for:each={typeValues} for:item="type">
46+
<option key={type} value={type}>{type}</option>
47+
</template>
48+
</select>
49+
50+
<label for="industry">Select Industry</label>
51+
<select id="industry" onchange={handleIndustryChange}>
52+
<option value="" disabled selected>Select Industry</option>
53+
<template for:each={industryValues} for:item="industry">
54+
<option key={industry} value={industry}>{industry}</option>
55+
</template>
56+
</select>
57+
</div>
58+
</div>
59+
</div>
60+
<hr>
61+
<div class="buttons">
62+
<div class="draft">
63+
<lightning-button variant="neutral" label="Save To Draft" style="text-align: center;"></lightning-button>
64+
</div>
65+
<div class="post">
66+
<lightning-button variant="brand" label="Post Now"></lightning-button>
67+
</div>
68+
</div>
69+
</div>
70+
</template>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { LightningElement } from "lwc";
2+
import experienceFieldValues from "@salesforce/apex/JobPicklistController.experienceFieldValues";
3+
import typePickListValues from "@salesforce/apex/JobPicklistController.typePickListValues";
4+
import IndustryPickListValues from "@salesforce/apex/JobPicklistController.IndustryPickListValues";
5+
6+
export default class AddJobsPage extends LightningElement {
7+
experienceValues = [];
8+
industryValues = [];
9+
typeValues = [];
10+
11+
connectedCallback() {
12+
13+
experienceFieldValues().then((result) => {
14+
this.experienceValues = result;
15+
console.log(
16+
"this.experienceOptions ---------->",
17+
JSON.stringify(this.experienceOptions)
18+
);
19+
});
20+
21+
typePickListValues().then((result) => {
22+
this.typeValues = result;
23+
console.log("this.typeValues", JSON.stringify(this.typeValues));
24+
});
25+
IndustryPickListValues().then((result) => {
26+
this.industryValues = result;
27+
// this.industryValues = this.industryValues.map((data) => {
28+
// return { label: data, value: data };
29+
// });
30+
console.log("this.industryValues", JSON.stringify(this.industryValues));
31+
});
32+
}
33+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<apiVersion>58.0</apiVersion>
4+
<isExposed>true</isExposed>
5+
<targets>
6+
<target>lightning__AppPage</target>
7+
<target>lightning__RecordPage</target>
8+
<target>lightning__HomePage</target>
9+
<target>lightningCommunity__Page</target>
10+
<target>lightningCommunity__Default</target>
11+
</targets>
12+
</LightningComponentBundle>

force-app/main/default/lwc/manageJobs/manageJobs.html

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@description : Manage Jobs Component for Recruitment Portal
33
@author : Rudransh Shukla
44
@group :
5-
@last modified on : 01-04-2024
5+
@last modified on : 01-05-2024
66
@last modified by : ChangeMeIn@UserSettingsUnder.SFDoc
77
-->
88
<template>
@@ -12,25 +12,15 @@
1212
<h1>Manage Jobs and Responses</h1>
1313
</div>
1414
<div class="post-job-button">
15-
<lightning-button
16-
variant="brand"
17-
label="Post a Job"
18-
type="button"
19-
icon-name="utility:down"
20-
icon-position="right"
21-
></lightning-button>
15+
<lightning-button variant="brand" label="Post a Job" type="button" icon-name="utility:down"
16+
icon-position="right"></lightning-button>
2217
</div>
2318
</div>
2419

2520
<div class="main-content">
2621
<div class="filter">
2722
<div class="filter-text">
28-
<lightning-icon
29-
icon-name="utility:down"
30-
alternative-text="NA"
31-
size="small"
32-
variant="brand"
33-
></lightning-icon>
23+
<lightning-icon icon-name="utility:down" alternative-text="NA" size="small" variant="brand"></lightning-icon>
3424
<p>Filter Jobs</p>
3525
</div>
3626
<hr class="hr-1" />
@@ -46,13 +36,10 @@ <h1>Job Status</h1>
4636
<img src={noJobs} alt="NA" />
4737
<h1>No Jobs Posted</h1>
4838
<p>Once you post jobs you can the list here</p>
49-
<lightning-button
50-
variant="brand"
51-
label="Post a job"
52-
></lightning-button>
39+
<lightning-button variant="brand" label="Post a job"></lightning-button>
5340
</div>
5441
<div class="posted-jobs"></div>
5542
</div>
5643
</div>
5744
</div>
58-
</template>
45+
</template>

0 commit comments

Comments
 (0)