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