Commit aeb0959b authored by Venkaiah Naidu Singamchetty's avatar Venkaiah Naidu Singamchetty

Merge branch 'apiserver' into 'master'

Apiserver

See merge request !73
parents 69c42b34 26bc79cc
...@@ -141,7 +141,7 @@ app.post("/getreportees",async (req, res) => { ...@@ -141,7 +141,7 @@ app.post("/getreportees",async (req, res) => {
"data":{ "data":{
"aName":"Approval of timesheet", "aName":"Approval of timesheet",
"aId":"D001", "aId":"D001",
"type":"default", "type":"duties",
"ratedBy":"Name", "ratedBy":"Name",
"score":3, "score":3,
"comments":"" "comments":""
......
...@@ -52,21 +52,21 @@ function LeftSidebar() { ...@@ -52,21 +52,21 @@ function LeftSidebar() {
return ( return (
<div className=" w-[33%] flex flex-col px-[5px]"> <div className=" w-[33%] flex flex-col px-[5px]">
<div className="flex mt-3 items-center justify-between"> <div className=" flex mt-3 items-center justify-between">
<p className="text-xl text-blue-400 font-semibold pl-4"> <p className="text-xl text-blue-400 font-semibold pl-4">
Reportees Reportees
</p> </p>
<input <input
placeholder="Search" placeholder="Search"
type="text" type="text"
className="p-2 mi-2 border rounded w-[160px]" className="p-2 border rounded w-[160px] placeholder:text-[14px]"
value={inputValue} value={inputValue}
onChange={handleChange} onChange={handleChange}
/> />
</div> </div>
{ {
(loading) ? <Loading /> : (loading) ? <Loading /> :
<div className="p-2 bg-[#E9EDEE] mt-4 max-h-[80vh] overflow-auto"> <div className="p-2 bg-[#E9EDEE] mt-4 max-h-[70vh] overflow-auto">
{reportees?.map(({ empName, score, empId }) => ( {reportees?.map(({ empName, score, empId }) => (
<button onClick={() => dispatch(setViewReportee(empId))} <button onClick={() => dispatch(setViewReportee(empId))}
// to={`/viewreportee`} // to={`/viewreportee`}
......
...@@ -16,6 +16,7 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) { ...@@ -16,6 +16,7 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) {
const [modalLoading, setModalLoading] = useState(true) const [modalLoading, setModalLoading] = useState(true)
const [scoreRender, setScoreRender] = useState([]); const [scoreRender, setScoreRender] = useState([]);
const [showScore, setShowScore] = useState(false) const [showScore, setShowScore] = useState(false)
const [disableAppreciate,setDisableAppreciate]=useState(false)
const getActivitysList = async (type) => { const getActivitysList = async (type) => {
const activities = await axios.get(`${base_url}/activities`) const activities = await axios.get(`${base_url}/activities`)
...@@ -54,7 +55,7 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) { ...@@ -54,7 +55,7 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) {
} }
const handleComments = (e) => { const handleComments = (e) => {
setActivityData({ ...activityData, comments: e.target.value }) setActivityData({ ...activityData, comments:e.target.value.trim() })
} }
const handleSubmit = (e) => { const handleSubmit = (e) => {
...@@ -78,7 +79,11 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) { ...@@ -78,7 +79,11 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) {
setActivtyType(str.charAt(0).toUpperCase() + str.slice(1).toLowerCase()) setActivtyType(str.charAt(0).toUpperCase() + str.slice(1).toLowerCase())
} }
useEffect(() => { useEffect(() => {
if(type==="duties"){
setDisableAppreciate(true);
}else{
setDisableAppreciate(false);
}
SentenceCase(type) SentenceCase(type)
if (visible === false) { if (visible === false) {
setActivityData({ aName: "",ratedBy:"", aId: "", type: type, score: 0, comments: "" }) setActivityData({ aName: "",ratedBy:"", aId: "", type: type, score: 0, comments: "" })
...@@ -108,7 +113,9 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) { ...@@ -108,7 +113,9 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) {
<div> <div>
<div> <div>
<form className=" p-2 max-w-sm mx-auto text-[12px]" onClick={(e) => e.stopPropagation()}> <form className=" p-2 max-w-sm mx-auto text-[12px]" onClick={(e) => e.stopPropagation()}>
<div className="flex items-center justify-between my-5"> <div className="flex items-center my-5">
<label htmlFor="countries">SELECT ACTIVITY<span className="text-[15px]">*</span>: </label> <label htmlFor="countries">SELECT ACTIVITY<span className="text-[15px]">*</span>: </label>
<select disabled={showCustActivity} className="bg-gray-50 ml-2 w-6/12 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 " onChange={(e) => handleActivityName(e)} value={activityData.aName}> <select disabled={showCustActivity} className="bg-gray-50 ml-2 w-6/12 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 " onChange={(e) => handleActivityName(e)} value={activityData.aName}>
<option id="" value="">Select</option> <option id="" value="">Select</option>
...@@ -116,15 +123,19 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) { ...@@ -116,15 +123,19 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) {
activitiesList && activitiesList.map((activity) => <option className=" w-7/12" key={activity.aId} id={activity.aId} value={activity.aName}>{activity.aName}</option>) activitiesList && activitiesList.map((activity) => <option className=" w-7/12" key={activity.aId} id={activity.aId} value={activity.aName}>{activity.aName}</option>)
} }
</select> </select>
<button onClick={(e) => { handleCustBtn(e) }} className="bg-blue-400 ml-2 w-2/12 text-white py-1 rounded hover:scale-95 transition text-sm">Custom</button> <button onClick={(e) => { handleCustBtn(e) }} className={`${showCustActivity && 'hidden'} bg-blue-400 ml-2 w-2/12 text-white py-1 rounded hover:scale-95 transition text-sm`}>Custom</button>
</div> </div>
<div className={`flex items-center ${!showCustActivity && 'hidden'}`}> <div className={`flex items-center ${!showCustActivity && 'hidden'}`}>
<label className={`font-medium mr-2`}>Custom Activity<span className="text-[15px]">*</span>:</label> <label className={`font-medium mr-2`}>Custom Activity<span className="text-[15px]">*</span>:</label>
<input type="text" value={activityData.aName} placeholder="Enter Activity name" name="performance" className={`border border-gray-300 rounded p-2 `} onChange={(e) => handleCustumActivity(e)} /> <input type="text" value={activityData.aName} placeholder="Enter Activity name" name="performance" className={`border border-gray-300 rounded p-2 `} onChange={(e) => handleCustumActivity(e)} />
<button onClick={(e) => { handleCustBtn(e) }} className={`${!showCustActivity && 'hidden'} bg-blue-400 ml-2 w-2/12 text-white py-1 rounded hover:scale-95 transition text-sm`}>Close</button>
</div> </div>
<div className="flex items-center mb-4 "> <div className="flex items-center mb-4 ">
<label htmlFor="appreciate" className=" font-medium ">APPRECIATION<span className="text-[15px]">*</span>:</label> <label htmlFor="appreciate" className="font-medium">APPRECIATION<span className="text-[15px]">*</span>:</label>
<input id="appreciate" type="radio" value="appreciate" name="performance" className="w-4 h-4 m-3 text-blue-600 bg-gray-100 border-gray-300 " onChange={() => handlePerformance(1)} /> <input id="appreciate" disabled={disableAppreciate} type="radio" value="appreciate" name="performance" className="w-4 h-4 m-3 text-blue-600 bg-gray-100 border-gray-300 " onChange={() => handlePerformance(1)} />
<label htmlFor="depreciate" className="ms-2 font-medium ">DEPRECIATION<span className="text-[15px]">*</span>:</label> <label htmlFor="depreciate" className="ms-2 font-medium ">DEPRECIATION<span className="text-[15px]">*</span>:</label>
<input id="depreciate" type="radio" value="depreciate" name="performance" className="w-4 h-4 m-3 text-blue-600 bg-gray-100 border-gray-300 " onChange={() => handlePerformance(-1)} /> <input id="depreciate" type="radio" value="depreciate" name="performance" className="w-4 h-4 m-3 text-blue-600 bg-gray-100 border-gray-300 " onChange={() => handlePerformance(-1)} />
</div> </div>
...@@ -137,6 +148,9 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) { ...@@ -137,6 +148,9 @@ export default function MyModal({ visible, onClose, type, handleAddActivity }) {
} }
</select> </select>
</div> </div>
<div className="flex items-center my-5"> <div className="flex items-center my-5">
<label htmlFor="comments" className="block w-3/12 mb-20 text-start font-medium ">COMMENTS<span className="text-[15px]">*</span>:</label> <label htmlFor="comments" className="block w-3/12 mb-20 text-start font-medium ">COMMENTS<span className="text-[15px]">*</span>:</label>
<textarea id="comments" style={{ resize: "none" }} rows="4" className="block ml-2 p-2.5 w-9/12 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 " placeholder="Comments" onChange={(e) => handleComments(e)} <textarea id="comments" style={{ resize: "none" }} rows="4" className="block ml-2 p-2.5 w-9/12 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 " placeholder="Comments" onChange={(e) => handleComments(e)}
......
...@@ -111,8 +111,8 @@ function Dashboard() { ...@@ -111,8 +111,8 @@ function Dashboard() {
<div> <div>
<div className="mb-2"> <div className="mb-2">
<div className="flex justify-end my-1 mr-2 items-center"> <div className="flex justify-end my-1 mr-2 items-center">
<label>Search Employee:</label> <label>Search :</label>
<input placeholder="Enter" value={inputValue} onChange={handleChange} type="text" className="p-1 px-2 border rounded ml-2"/> <input placeholder="Name/Id/Designation/Role" value={inputValue} onChange={handleChange} type="text" className="p-1 px-2 border rounded ml-2 placeholder:text-[14px]"/>
</div> </div>
<Table headers={headers} data={reportees} loading={loading} maxHeight={88} /> <Table headers={headers} data={reportees} loading={loading} maxHeight={88} />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment