Repository navigation
G1 - HR Module #228
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
Open
nkg05official
wants to merge
18
commits into
FusionIIIT:hr-eis-v1
Choose a base branch
from
nkg05official:hr-eis-v1
base: hr-eis-v1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
G1 - HR Module #228
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
3923cd8
Fix route export error and update frontend
nkg05official 07e2466
updated structured code of frontend added
RuchiF 9168f26
changes done till T-025 not highlighted
RuchiF a1eeb56
frontend done
d-sanchita28 3f337dd
cpda advance and ltc forms working
RuchiF 0d53bcd
Merge branch 'hr-eis-v1' of https://github.com/RuchiF/Fusion-client i…
RuchiF acfdbcc
view button is working in forms
RuchiF 558b2a5
cpda claim form working
RuchiF 5f5b4b7
everything working - (but msg not showing on submitting)
RuchiF bd1f464
cpda workflow changes made
RuchiF f18137e
all workflows working
RuchiF eb4a96a
leave workflow working
RuchiF c4e4087
ltc constraint last req > 4 yrs added
RuchiF cab161a
cpda expense check added
RuchiF 9eaf7e3
director self sanction and reviewer assignment flow by hr for apprais…
RuchiF 9223eda
LTC thresholding added
RuchiF 32fde74
subs added
RuchiF 5ffa16b
Merge pull request #2 from RuchiF/hr-eis-v1
nkg05official File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,8 +62,7 @@ | |
| "lint-staged": { | ||
| "*.{js,jsx}": [ | ||
| "prettier --write", | ||
| "eslint --fix", | ||
| "git add" | ||
| "eslint --fix" | ||
| ] | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| import React, { useState, useEffect } from "react"; | ||
| import { Modal, Button, ScrollArea, Loader, Text, Group } from "@mantine/core"; | ||
| import { Wallet } from "@phosphor-icons/react"; | ||
| import { getLeaveBalance } from "../../services/api"; | ||
|
|
||
| function CPDABalanceButton() { | ||
| const [opened, setOpened] = useState(false); | ||
| const [cpdaBalance, setCpdaBalance] = useState(null); | ||
| const [loading, setLoading] = useState(false); | ||
| const [error, setError] = useState(null); | ||
|
|
||
| const fetchCpdaBalance = async () => { | ||
| setLoading(true); | ||
| setError(null); | ||
|
|
||
| try { | ||
| const data = await getLeaveBalance(); // Backend returns both leave and cpda balance | ||
| setCpdaBalance(data.cpda_balance); | ||
| } catch (err) { | ||
| console.error(err); | ||
| setError("Failed to fetch CPDA balance."); | ||
| } finally { | ||
| setLoading(false); | ||
| } | ||
| }; | ||
|
|
||
| useEffect(() => { | ||
| if (opened) { | ||
| fetchCpdaBalance(); | ||
| } | ||
| }, [opened]); | ||
|
|
||
| return ( | ||
| <> | ||
| <div | ||
| style={{ | ||
| display: "flex", | ||
| justifyContent: "flex-end", | ||
| marginTop: "-50px", | ||
| position: "relative", | ||
| top: "50px", | ||
| zIndex: 10 | ||
| }} | ||
| > | ||
| <Button | ||
| onClick={() => setOpened(true)} | ||
| leftSection={<Wallet size={20} />} | ||
| color="green" | ||
| variant="light" | ||
| > | ||
| Check CPDA Balance | ||
| </Button> | ||
| </div> | ||
|
|
||
| <Modal | ||
| opened={opened} | ||
| onClose={() => setOpened(false)} | ||
| title={ | ||
| <span style={{ fontWeight: "bold", fontSize: "20px" }}> | ||
| Cumulative Professional Development Allowance (CPDA) | ||
| </span> | ||
| } | ||
| centered | ||
| size="md" | ||
| > | ||
| {loading ? ( | ||
| <div style={{ display: "flex", justifyContent: "center", padding: "40px" }}> | ||
| <Loader size="lg" /> | ||
| </div> | ||
| ) : error ? ( | ||
| <Text color="red" ta="center" fw={700} p="md">{error}</Text> | ||
| ) : cpdaBalance ? ( | ||
| <div style={{ padding: "10px" }}> | ||
| <Group position="apart" mb="md"> | ||
| <Text fw={500}>Total Allotted:</Text> | ||
| <Text fw={700} color="blue">Rs. {cpdaBalance.allotted.toLocaleString()}</Text> | ||
| </Group> | ||
| <Group position="apart" mb="md"> | ||
| <Text fw={500}>Total Used:</Text> | ||
| <Text fw={700} color="orange">Rs. {cpdaBalance.taken.toLocaleString()}</Text> | ||
| </Group> | ||
| <Group position="apart" pt="md" style={{ borderTop: "2px solid #eee" }}> | ||
| <Text fw={700} size="lg">Current Balance:</Text> | ||
| <Text fw={800} size="xl" color={cpdaBalance.balance > 0 ? "green" : "red"}> | ||
| Rs. {cpdaBalance.balance.toLocaleString()} | ||
| </Text> | ||
| </Group> | ||
| <Text size="xs" color="dimmed" mt="xl" ta="center"> | ||
| *This balance represents your cumulative eligibility for the current block period. | ||
| </Text> | ||
| </div> | ||
| ) : ( | ||
| <Text ta="center" fw={500} p="md">No CPDA balance data available.</Text> | ||
| )} | ||
| </Modal> | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| export default CPDABalanceButton; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Modules/HR/components/HeroBanner.jsx → ...dules/HR/components/common/HeroBanner.jsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import React from "react"; | ||
| import PropTypes from "prop-types"; | ||
|
|
||
| function LoadingSpinner({ message = "Loading..." }) { | ||
| return ( | ||
| <div className="loading-spinner"> | ||
| <div className="spinner" /> | ||
| <p>{message}</p> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default LoadingSpinner; | ||
|
|
||
| LoadingSpinner.propTypes = { | ||
| message: PropTypes.string, | ||
| }; |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hr/*route has noRequireAuthguard. All other protected routes in this file (dashboard, academics, profile, examination, etc.) are wrapped in<RequireAuth>. The HR route is not. An unauthenticated user who navigates directly to/hrwill hit the HR module instead of being redirected to login.