Remove deprecated dashboard pages and update vertical menu links for streamlined navigation
- Deleted unused pages for crop zoning, farm AI assistant, fertilization recommendation, irrigation recommendation, pest detection, plant simulator, soil data, and water data. - Updated the vertical menu to reflect the removal of these pages, ensuring a cleaner and more efficient user experience.
This commit is contained in:
@@ -17,18 +17,17 @@ import SensorValuesList from '@views/dashboards/farm/SensorValuesList'
|
||||
// Service
|
||||
import { farmDashboardService } from '@/libs/api/services/farmDashboardService'
|
||||
import type { CardId } from '@views/dashboards/farm/farmDashboardConfig'
|
||||
import { CARD_GRID_SIZE } from '@views/dashboards/farm/farmDashboardConfig'
|
||||
|
||||
const WATER_CARD_IDS: CardId[] = [
|
||||
'farmWeatherCard',
|
||||
'farmAlertsTimeline',
|
||||
'waterNeedPrediction',
|
||||
'sensorValuesList'
|
||||
/** هر ردیف: آرایهٔ کارتها؛ در هر ردیف فضا مساوی بین گریدها تقسیم میشود (جمع = ۱۲) */
|
||||
const WATER_ROWS: CardId[][] = [
|
||||
['farmWeatherCard', 'farmAlertsTimeline', 'waterNeedPrediction'],
|
||||
['sensorValuesList']
|
||||
]
|
||||
|
||||
const cardRowSx = {
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
minHeight: 380,
|
||||
'& > *': { flex: 1, minHeight: 0 }
|
||||
}
|
||||
|
||||
@@ -62,18 +61,28 @@ const WaterDataDashboardWrapper = () => {
|
||||
return (
|
||||
<Box position='relative'>
|
||||
<Grid container spacing={6}>
|
||||
<Grid size={12} container spacing={6} sx={{ display: 'flex', alignItems: 'flex-start' }}>
|
||||
{WATER_CARD_IDS.map(cardId => {
|
||||
const size = CARD_GRID_SIZE[cardId]
|
||||
const Component = CARD_COMPONENTS[cardId]
|
||||
if (!Component) return null
|
||||
return (
|
||||
<Grid key={cardId} size={size} sx={cardRowSx}>
|
||||
<Component data={cardsData?.[cardId]} />
|
||||
</Grid>
|
||||
)
|
||||
})}
|
||||
</Grid>
|
||||
{WATER_ROWS.map((rowCards, rowIndex) => {
|
||||
const sizePerCard = 12 / rowCards.length
|
||||
return (
|
||||
<Grid
|
||||
key={rowIndex}
|
||||
size={12}
|
||||
container
|
||||
spacing={6}
|
||||
sx={{ display: 'flex', alignItems: 'stretch' }}
|
||||
>
|
||||
{rowCards.map(cardId => {
|
||||
const Component = CARD_COMPONENTS[cardId]
|
||||
if (!Component) return null
|
||||
return (
|
||||
<Grid key={cardId} size={sizePerCard} sx={cardRowSx}>
|
||||
<Component data={cardsData?.[cardId]} />
|
||||
</Grid>
|
||||
)
|
||||
})}
|
||||
</Grid>
|
||||
)
|
||||
})}
|
||||
</Grid>
|
||||
</Box>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user