Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version lakshmi #11

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
0b53eb3
Merge branch 'SJ' of https://github.com/saijamii/employee-management …
Ksishore Mar 11, 2024
8e03b64
Merge branch 'SJ' of https://github.com/saijamii/employee-management …
Ksishore Mar 11, 2024
253e7ed
Merge branch 'lakshmi_emp' of https://github.com/saijamii/employee-ma…
Ksishore Mar 11, 2024
6b8f72a
Merge branch 'SJ' of https://github.com/saijamii/employee-management …
Ksishore Mar 11, 2024
faa933a
appVersion
saijamii Mar 11, 2024
ce524f5
Merge branch 'lakshmi_emp' of https://github.com/saijamii/employee-ma…
jamesuno Mar 12, 2024
3ccb516
Login page changes
jamesuno Mar 12, 2024
3757998
Merge branch 'lakshmi_emp' of https://github.com/saijamii/employee-ma…
jamesuno Mar 12, 2024
1d024de
Merge branch 'Version_James' of https://github.com/saijamii/employee-…
Ksishore Mar 12, 2024
f766427
leaves component
Ksishore Mar 12, 2024
af85be0
Merge branch 'lakshmi_emp' of https://github.com/saijamii/employee-ma…
saijamii Mar 12, 2024
f4a2908
Merge branch 'Version_James' of https://github.com/saijamii/employee-…
saijamii Mar 12, 2024
e204b89
Merge branch 'kishore-sk' of https://github.com/saijamii/employee-man…
saijamii Mar 12, 2024
73d3cd6
AppRoutes Changes
saijamii Mar 12, 2024
dd7d99d
Login Path Added
saijamii Mar 12, 2024
c37c2ab
v12.03.24.02
saijamii Mar 12, 2024
ea7ff12
cHANGES
Mar 13, 2024
e0b4d04
PUSH CHANGE
Mar 13, 2024
c56409f
Merge branch 'lakshmi_emp' of https://github.com/saijamii/employee-ma…
Mar 13, 2024
5baae9d
leave type chnages add table data
Mar 13, 2024
e347aee
chnages for leave management
Mar 13, 2024
d7cd91f
header changes
Mar 13, 2024
d65725e
josn
Mar 13, 2024
0947f20
chnages for leave managemenr
Mar 13, 2024
c59f11c
Merge branch 'lakshmi_emp' of https://github.com/saijamii/employee-ma…
Mar 13, 2024
fa956a2
Merge branch 'kishore-sk' of https://github.com/saijamii/employee-man…
Geetha-vysyaraju Mar 13, 2024
5054e41
Salary Component basic ui
Geetha-vysyaraju Mar 13, 2024
50ed548
Merge branch 'kishore-sk' of https://github.com/saijamii/employee-man…
saijamii Mar 13, 2024
f140ece
Merge branch 'geetha-v' of https://github.com/saijamii/employee-manag…
saijamii Mar 13, 2024
8a29f31
Terminal Chanegs
saijamii Mar 13, 2024
662476f
Href issue
saijamii Mar 13, 2024
99e6e68
v13.03.24.02
saijamii Mar 13, 2024
4d08339
appVersion added at Sider
saijamii Mar 13, 2024
8556064
Merge branch 'lakshmi_emp' of https://github.com/saijamii/employee-ma…
Mar 14, 2024
a0a1f38
Merge https://github.com/saijamii/employee-management into Version_AJ
jamesuno Mar 18, 2024
2d89393
Merge branch 'Version_SJ' of https://github.com/saijamii/employee-man…
saijamiuno Mar 18, 2024
49ec95b
Merge branch 'Version_SJ' of https://github.com/saijamii/employee-man…
Mar 21, 2024
be58b0d
changes added leave type management
Mar 21, 2024
2a8f778
Merge branch 'dev' of https://github.com/saijamii/employee-management…
saijamiuno Mar 22, 2024
ca8b07c
/users added
saijamiuno Mar 22, 2024
a6c2a42
MONGO_URL env added
saijamiuno Mar 22, 2024
875902f
Image Issues
saijamiuno Mar 22, 2024
64f2fd2
Terminal Changes
saijamiuno Mar 22, 2024
d81c081
v22.03.24.02
saijamiuno Mar 22, 2024
48b6fc5
changes for leave managemnr
Mar 23, 2024
e5fca03
Merge pull request #7 from saijamii/satya_sk
saijamii Mar 24, 2024
d4994be
changes for leave Requsest
Mar 25, 2024
acdf8c6
changes
Mar 25, 2024
351b439
Merge pull request #8 from saijamii/satya_sk
saijamii Mar 26, 2024
590388c
useLocalStorage init
saijamii Mar 27, 2024
6c171b6
dataValue modal changes
saijamii Mar 27, 2024
caaf61d
v27.03.24.02
saijamii Mar 27, 2024
2c3e306
Merge branch 'Version_AJ' of https://github.com/saijamii/employee-man…
saijamii Mar 27, 2024
37c658d
api for department
sailakshmi761 Apr 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Node/.env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
PORT = 8000
PORT = 8000
MONGO_URL = mongodb+srv://saijami:EcUpT3Et6dpojJz3@atlascluster.iotmmxp.mongodb.net/?retryWrites=true&w=majority
46 changes: 45 additions & 1 deletion Node/api.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,57 @@
require("dotenv").config();
const express = require("express");

const { MongoClient, ServerApiVersion } = require("mongodb");
const appVersion = "v22.03.24.02";
console.log(appVersion);
const cors = require("cors");

const app = express();

app.use(express.json());
app.use(cors());

//Intial Route
app.get("/", (req, res) => {
res.send(`Welcome to Node App ${appVersion}`);
});

const uri = process.env.MONGO_URL;

const client = new MongoClient(uri, {
serverApi: {
version: ServerApiVersion.v1,
strict: true,
deprecationErrors: true,
},
});

const dataBase = client.db("employee-management");
const usersCollection = dataBase.collection("employees");

app.get("/users", async (req, res) => {
try {
const users = await getUsers();
res.status(200).json(users);
} catch (error) {
res.status(500).json({
error: `Internal Server Error: ${error.message}`,
});
}
});

const getUsers = async () => {
try {
const result = await usersCollection.find().toArray();
const data = result.map((e) => {
const { password, ...rest } = e;
return rest;
});
return data;
} catch (error) {
console.log(`ERROR : ${error}`);
}
};

const PORT = process.env.PORT;
app.listen(PORT, () => {
console.log(`Server running on ${PORT}`);
Expand Down
84 changes: 84 additions & 0 deletions Node/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.json());
const { MongoClient,ObjectId} = require('mongodb');

const client = new MongoClient(
'mongodb+srv://sailakshmiyyy:qH8z7c9FkOimu0QF@cluster0.mz8v4ou.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0'
);

client.connect().then(() => console.log("Connected Successfully"))
.catch((error) => console.log("Failed to connect", error));

const db = client.db("Department");
const collection = db.collection('department');

app.get('/',async(req,res) => {
res.send('App is running')
})

app.get('/getList',async(req,res) => {
try {
const result = await collection.find().toArray();
console.log('result',result)
res.status(200).json(result)

} catch (error) {
console.error(`ERROR: ${error}`);
res.status(500).json({error:"An Error occured while fetching Data"});

}
})

app.post('/create', async(req,res) => {
// const { deptName } = req.body;
// console.log("req",req.body)
// const newData = {
// deptName:req.body,
// }
// console.log('newData',newData)
try {
const result = await collection.insertOne(req.body);
res.json({success:true,message:"Name Added Successfully"});

} catch (error) {
console.error(`Error:${error}`);
res.status(500).json({success: false,message:"Failed to Insert"})
}
})

app.put('/editDept/:id',async(req,res) => {
const id = req.params.id;
const data = req.body;
try {
const result =await collection.updateOne({_id:new ObjectId(id)},{$set:data});
console.log('result',result);
if (result.modifiedCount > 0) {
res.json({ success: true, message: "Updated Successfully" });
} else {
res.status(404).json({ success: false, message: "Not Updated" });
}

} catch (error) {
console.error("Error",error);
res.status(500).json({success:true,message:"Failed to Update"})
}
})

app.delete('/deleteDept/:id',async(req,res) => {
const id = req.params.id;
try {
const result = await collection.deleteOne({ _id: new ObjectId(id) });
res.json({success:true,message:"Deleted Successfully"})

} catch (error) {
console.error("Error deleting",error);
res.status(500).json({success:false,message:"Server Error"})
}
})


app.listen('4000',() => {
console.log('App is running on port 4000')
})
1 change: 1 addition & 0 deletions Node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"dotenv": "^16.4.1",
"express": "^4.18.2",
"jsonwebtoken": "^9.0.2",
"mongodb": "^6.5.0",
"mongoose": "^8.1.1"
}
}
2 changes: 1 addition & 1 deletion src/Config/AppConfig.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const appConfig = {
appVersion: "v20.03.24.04",
appVersion: "v27.03.24.02",
};
export default appConfig;
27 changes: 27 additions & 0 deletions src/Hooks/useLocalStorage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { useEffect, useState } from "react";

export function useLocalStorage(key, initialValue) {
const [storedValue, setStoredValue] = useState(() => {
try {
const item = window.localStorage.getItem(key);
return item !== undefined && item !== null && item !== ""
? JSON.parse(item)
: initialValue;
} catch (error) {
console.error("Error retrieving data from local storage:", error);
return initialValue;
}
});

console.log(storedValue, "storedValue");

useEffect(() => {
try {
window.localStorage.setItem(key, JSON.stringify(storedValue));
} catch (error) {
console.error("Error saving data to local storage:", error);
}
}, [storedValue, key]);

return [storedValue, setStoredValue];
}
Binary file added src/Images/Maternity.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/casual.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/comp.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/earned.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/loss.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/sick.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 19 additions & 2 deletions src/Pages/Department/Department.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import React, { useEffect, useState } from "react";
import { UseDocumentTitle } from "../../Common/UseDocumentTitle";
import { Table, Row, Col, Modal, Select, Form, Button } from "antd";
import { useLocalStorage } from "../../Hooks/useLocalStorage";
const { Option } = Select;

const Department = () => {
const [dataValue, setDataValue] = useLocalStorage("obj1", []);
console.log(dataValue, "dataValue");
useEffect(() => {
UseDocumentTitle(window.location.pathname);
}, []);
const [showModal, setShowModal] = useState("");
const [showModal, setShowModal] = useState(false);
const columns = [
{
title: "Department Name",
Expand Down Expand Up @@ -50,6 +53,18 @@ const Department = () => {
];
const openModal = () => {
setShowModal(true);
setDataValue([
{
title: "Department Name",
dataIndex: "name",
key: "name",
},
{
width: "10%",
title: "Action",
key: "action",
},
]);
};
const cancelModal = () => {
setShowModal(false);
Expand All @@ -63,7 +78,9 @@ const Department = () => {
<h4>Department Details</h4>
</Col>
<Col span={2} offset={14}>
<Button type="primary">Add</Button>
<Button type="primary" onClick={openModal}>
Add
</Button>
</Col>
</Row>
<Row style={{ marginTop: "20px" }}>
Expand Down
68 changes: 65 additions & 3 deletions src/Pages/Employee/Request.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,74 @@
import React, { useEffect } from "react";
import { Table, Row, Col} from "antd";
import { UseDocumentTitle } from "../../Common/UseDocumentTitle";

const Request = () => {
useEffect(() => {
useEffect(() => {
UseDocumentTitle(window.location.pathname);
}, []);
const columns = [
{
title: "Employee Id",
dataIndex: "id",
key: "id",
},

return <h1>Request</h1>;
};
{
title: "Name",
dataIndex: "name",
key: "name",
},

{
title: "Email",
dataIndex: "email",
key: "email",
},
{
title: "Reason",
dataIndex: "reason",
key: "mobile",
},

];
const data = [
{
key: "1",
name: "John Brown",
},
{
key: "2",
name: "Jim Green",
},
{
key: "3",
name: "Joe Black",
},
];

return (
<>
<Row>
<Col span={24}>
<Row>
<Col span={5}>
<h4 style={{fontWeight:'bold'}}>Leave Request</h4>
</Col>
<Col span={2} offset={14}>
{/* <Link to={"/app/addEmployee"}>
<Button type="primary">Add</Button>
</Link> */}
</Col>
</Row>
<Row>
<Col span={24}>
<Table columns={columns} dataSource={data} pagination={false} />
</Col>
</Row>
</Col>
</Row>

</>
);
};
export default Request;
Loading