added new concept in view in dashbaord
This commit is contained in:
parent
e43c336c63
commit
fad60efb61
@ -30,7 +30,7 @@ const Configuration = () => {
|
||||
"Company Profile": "profile",
|
||||
};
|
||||
|
||||
// ✅ Map paths to tab names
|
||||
// Map paths to tab names
|
||||
const pathToTab = {
|
||||
quarterly: "Quarterly Windows",
|
||||
hscodes: "HS Codes",
|
||||
@ -39,14 +39,14 @@ const Configuration = () => {
|
||||
profile: "Company Profile",
|
||||
};
|
||||
|
||||
// ✅ Navigate to URL when tab changes
|
||||
// Navigate to URL when tab changes
|
||||
useEffect(() => {
|
||||
if (tabToPath[active]) {
|
||||
navigate(`/admin/configuration/${tabToPath[active]}`, { replace: true });
|
||||
}
|
||||
}, [active, navigate]);
|
||||
|
||||
// ✅ Update active tab when URL changes
|
||||
// Update active tab when URL changes
|
||||
useEffect(() => {
|
||||
const path = location.pathname.split("/").pop();
|
||||
if (pathToTab[path] && pathToTab[path] !== active) {
|
||||
@ -54,7 +54,7 @@ const Configuration = () => {
|
||||
}
|
||||
}, [location.pathname]);
|
||||
|
||||
// ✅ Breadcrumb with ">" separators
|
||||
//Breadcrumb with ">" separators
|
||||
const Breadcrumbs = (
|
||||
<nav className="mb-6 text-sm text-[#8F9299] flex items-center gap-2">
|
||||
<Link
|
||||
@ -83,7 +83,7 @@ const Configuration = () => {
|
||||
</nav>
|
||||
);
|
||||
|
||||
// ✅ Tab header
|
||||
// Tab header
|
||||
const PageHeader = (
|
||||
<div className="w-full mb-6">
|
||||
<div className="h-14 w-full border-b border-[#E5E7EB] flex items-end">
|
||||
@ -107,7 +107,7 @@ const Configuration = () => {
|
||||
</div>
|
||||
);
|
||||
|
||||
// ✅ Render selected tab content
|
||||
// Render selected tab content
|
||||
const renderActiveTab = () => {
|
||||
switch (active) {
|
||||
case "Quarterly Windows":
|
||||
|
||||
@ -612,13 +612,11 @@ const ValidationReview = () => {
|
||||
|
||||
// API call
|
||||
const response = await getBeforePreviousData(
|
||||
establishmentId,
|
||||
currentQuarter,
|
||||
currentYear,
|
||||
productId
|
||||
);
|
||||
|
||||
console.log("API Response:", response);
|
||||
establishmentId,
|
||||
currentQuarter,
|
||||
currentYear,
|
||||
productId
|
||||
);
|
||||
|
||||
let mappedDataMap = {};
|
||||
|
||||
@ -948,7 +946,7 @@ const getQuarterYearLabel = (quarter, year) => {
|
||||
const currentLabel = getQuarterYearLabel(currentQuarter, currentYear);
|
||||
|
||||
// Next Year Forecast
|
||||
const forecastLabel = getQuarterYearLabel(forecastQuarter, currentYear);
|
||||
const forecastLabel = getQuarterYearLabel(forecastQuarter, forecastYear );
|
||||
|
||||
// Optional: Previous Forecast (same year usually)
|
||||
// const additionalForecastLabel = getQuarterYearLabel(forecastQuarter, currentYear);
|
||||
@ -1125,7 +1123,7 @@ const additionalForecastLabel =
|
||||
|
||||
<div className="overflow-x-auto rounded-[12px] border border-[#E5E7EB]">
|
||||
<div className="flex items-center justify-between bg-white p-4 rounded-lg "> <div className="flex items-center gap-4">
|
||||
{/* <div className="flex items-center gap-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="varianceHighlighting"
|
||||
@ -1159,8 +1157,8 @@ const additionalForecastLabel =
|
||||
</select>
|
||||
</div>
|
||||
)}
|
||||
</div> */}
|
||||
{/* <div className="flex items-center gap-2">
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="showPreviousNext"
|
||||
@ -1175,7 +1173,7 @@ const additionalForecastLabel =
|
||||
>
|
||||
{fetchingNextQuarter ? 'Loading...' : 'Show Historical Comparison'}
|
||||
</label>
|
||||
</div> */}
|
||||
</div>
|
||||
</div>
|
||||
{varianceHighlighting && (
|
||||
<div className="text-xs text-[#6B7280]">
|
||||
@ -1200,7 +1198,7 @@ const additionalForecastLabel =
|
||||
{currentLabel || 'Q2 2024'} (CURRENT QUARTER)
|
||||
</th>
|
||||
<th colSpan="3" className="bg-[#F2ECCF] text-[#92722A] px-4 py-2 text-xs font-semibold uppercase text-center border border-[#E5E7EB]">
|
||||
{additionalForecastLabel || 'Q3 2023'} (PREVIOUS FORECAST)
|
||||
{additionalForecastLabel || ''} (PREVIOUS FORECAST)
|
||||
</th>
|
||||
<th colSpan="3" className="bg-[#F2ECCF] text-[#92722A] px-4 py-2 text-xs font-semibold uppercase text-center border border-[#E5E7EB]">
|
||||
{forecastLabel || 'Q3 2024'} (NEXT YEAR FORECAST)
|
||||
|
||||
@ -388,7 +388,7 @@ React.useEffect(() => {
|
||||
const matches = matchSearch && matchYear && matchQuarter && matchEmirate && matchStatus;
|
||||
|
||||
if (matches) {
|
||||
console.log('Matching item:', item);
|
||||
// console.log('Matching item:', item);
|
||||
} else {
|
||||
('Filtered out item:', item, { matchSearch, matchYear, matchQuarter, matchEmirate, matchStatus });
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user