- Created migration scripts to manage the 'prisma' role and its privileges across various schemas including 'public', 'gis', 'auth', and 'storage'.
- Added explicit grants for all necessary tables, sequences, and functions to ensure the 'prisma' role has appropriate access.
- Implemented triggers for user management in the 'auth' schema to handle new user creation, updates, and deletions.
- Established default privileges for future objects in the specified schemas to streamline permission management.
- Updated remote schema management scripts to include grants for 'postgres' on specific tables and functions.
- Dropped and recreated types in the 'gis' schema to ensure proper structure and functionality.
- Introduced a new TimelineLayer to visualize average incident times per district.
- Added UnitsLayer to display police stations and connection lines to incidents.
- Updated Layers component to conditionally render the new layers based on active controls.
- Implemented a query to fetch units data from the server.
- Created utility functions for color generation based on crime categories.
- Enhanced map interaction with popups for detailed information on incidents and units.
- Added legends for timeline and units to improve user experience.
- Refactored existing types and interfaces to accommodate new features.
- Removed the MapLayerManager component and integrated its functionality into the Layers component.
- Added FlyToHandler component to manage map fly-to animations and highlight incidents.
- Introduced ClusterLayer and UnclusteredPointLayer components for better handling of crime incident clustering and display.
- Updated types in map.ts to include new interfaces for district features and layer props.
- Enhanced crime data processing functions for better data management and visualization.
- Adjusted button styles in button.tsx for improved UI consistency.
- Implemented SidebarStatisticsTab component to display monthly incidents and crime overview statistics.
- Integrated StatCard components for total incidents, monthly average, and clearance rate.
- Added visualization for incidents by month with dynamic height based on incident counts.
- Included CrimeTypeCard for displaying the most common crimes with percentage breakdown.
feat: Create Additional Tooltips for enhanced map controls
- Developed AdditionalTooltips component to provide year, month, and category selection.
- Integrated MonthSelector, YearSelector, and CategorySelector for filtering options.
- Added functionality to toggle visibility of selectors.
feat: Implement Crime Tooltips for crime data controls
- Created CrimeTooltips component to manage various crime data views.
- Included tooltips for incidents, heatmap, trends, patrol areas, clusters, and timeline.
feat: Enhance Search Control with incident search capabilities
- Developed SearchTooltip component for searching incidents by various criteria.
- Implemented suggestion filtering based on selected search type (crime ID, incident ID, coordinates, description, address).
- Added functionality to display detailed information about selected incidents.
feat: Consolidate tooltips into a unified Tooltip component
- Merged CrimeTooltips, AdditionalTooltips, and SearchTooltip into a single Tooltips component.
- Streamlined props for managing active controls and selected filters.
feat: Add Map Legend for crime rate visualization
- Created MapLegend component to visually represent crime rates using color coding.
- Integrated with existing map overlay for better user experience.
- Implemented `getIncidentSeverity` function to categorize incidents based on predefined categories.
- Added `formatMonthKey` function to format month keys for display.
- Introduced `getTimeAgo` function to calculate and format time elapsed since a given timestamp.
feat: create custom hooks and components for crime analytics
- Developed `useCrimeAnalytics` hook to process and analyze crime data, providing insights such as total incidents, recent incidents, and category counts.
- Created `CrimeTypeCard`, `IncidentCard`, `StatCard`, and `SystemStatusCard` components for displaying crime statistics and incident details in the sidebar.
- Implemented `SidebarIncidentsTab` and `SidebarStatisticsTab` components to manage and display incident data and statistics.
feat: enhance sidebar functionality with info and statistics tabs
- Added `SidebarInfoTab` and `SidebarStatisticsTab` components to provide users with information about crime severity, map markers, and overall crime statistics.
- Integrated pagination functionality with `usePagination` hook to manage incident history navigation.
style: improve UI components with consistent styling and layout adjustments
- Updated card components and layout for better visual hierarchy and user experience.
- Ensured responsive design and accessibility across all new components.
- Implemented DistrictLayer to display district information and crime data on the map.
- Added interactivity for district selection, including animations and data retrieval.
- Created MapLayerManager to manage multiple layers on the map, including district and crime layers.
- Integrated crime data processing and visualization based on user interactions.
- Ensured proper handling of map style loading and layer management.
feat(district-popup): enhance badge hover styles for crime levels
feat(map): implement year timeline control with smooth animation
feat(ui): create a reusable slider component using Radix UI
chore(package): update package.json and package-lock.json to include @radix-ui/react-slider
- Updated CrimeSidebar component with improved layout and styling for better user experience.
- Added new icons and adjusted colors for better visibility and aesthetics.
- Enhanced tab styles to a pill format for a more modern look.
- Improved card designs for incident statistics and crime overview.
- Refactored SystemStatusCard and StatCard components to accept additional styling props.
- Removed unused ReportCard component and related styles.
- Cleaned up global CSS by removing unnecessary chart color variables.
- Added `CrimePopup` component to display detailed information about individual crime incidents.
- Introduced `DistrictPopup` component to show district-level crime statistics and demographics.
- Implemented `useFilteredCrimeData` hook for filtering crime data based on selected categories.
- Created `calculateCrimeStats` utility function to compute various crime statistics from raw data.
- Updated package.json to include necessary dependencies for map and geocoder functionalities.
- Implemented CrimePopup component to show detailed information about individual crime incidents.
- Implemented DistrictPopup component to provide an overview of crime statistics and demographics for selected districts.
- Added useFilteredCrimeData hook to filter crime data based on selected categories.
- Created calculateCrimeStats utility function to compute various crime statistics from raw data.
- Added GeolocateControl to the map for user location tracking.
- Introduced CategorySelector for filtering crime categories.
- Implemented TopNavigation for year, month, and category selection.
- Created MapSelectors for managing filters with reset functionality.
- Developed CrimeSidebar for displaying incidents, statistics, and reports.
- Added SidebarToggle for collapsing and expanding the sidebar.
- Prefetch crime data based on selected year and month.
- Updated Popover and Skeleton components for better UI experience.
- Refactored OverlayControl for improved rendering and cleanup.
- Enhanced styling and responsiveness across components.
- Updated OverlayProps to include className and style for customization.
- Modified OverlayControl to apply custom styles and handle control addition.
- Improved rendering logic in _Overlay to pass addControl method to children.
- Refactored SelectContent to accept a container prop for better positioning.
- Cleaned up useFullscreen hook by removing unnecessary comments and improving readability.
- Updated global CSS for better styling of map popups and controls.
- Removed unused dependencies related to mapbox-gl-draw from package.json and package-lock.json.
- Added CustomControl and MonthSelector components for enhanced map functionality.
- Implemented MapControls component for selecting various crime-related metrics.
- Created MapFilterControl for filtering data by year and month.
- Developed MapSidebar to display crime statistics and district information.
- Added SidebarToggle for opening and closing the sidebar.
- Introduced SeverityIndicator to visually represent crime severity levels.
- Created TimeControls for selecting time frames for data analysis.
- Added useFullscreen hook for managing fullscreen functionality.
- Added year validation in CrimeIncidentsSeeder to skip records with undefined year.
- Implemented importAllYearSummaries method in CrimesSeeder to import crime summaries from CSV for 2020-2024.
- Cleared existing data for units before seeding geographic data.
- Cleared locations data in role seeder before seeding roles.
- Added district summary CSV file for crime data from 2020 to 2024.
- Created resources data structure in `resources.ts`
- Added roles data structure in `roles.ts`
- Implemented seeding for crime categories and incidents with detailed logic in `crime-category.ts` and `crime-incident.ts`
- Developed demographic data seeding logic in `demographic.ts`
- Implemented geographic data seeding from GeoJSON files in `geographic.ts`
- Added permission seeding logic in `permission.ts`
- Created resource and role seeding scripts in `resource.ts` and `role.ts`
- Implemented MapLegend component to display crime rate legend.
- Created YearSelector component for selecting the year of crime data.
- Developed CrimeMap component to manage crime incidents and district data.
- Added DistrictLayer for rendering districts on the map with hover and click interactions.
- Introduced CrimeMarker for displaying crime incidents on the map.
- Built MapView component for rendering the map with various controls.
- Established utility constants for crime colors and rates.
- Defined types for crime management and map features.
- Updated UserLogsTab to fetch logs for selectedUser and adjusted related state and props.
- Refactored UserOverviewTab to utilize selectedUser, including permission checks and user actions.
- Modified user-management component to pass selectedUser to UserInformationSheet.
- Enhanced use-detail-sheet handler to operate with selectedUser for user actions.
- Implemented useCheckPermissionsHandler to manage user permissions based on current user.
- Added new components: ActionRow, DangerAction, InfoRow, ProviderInfo, Section for better UI structure.
- Introduced constants for user roles and updated role model to include IUserRoles type.
- Updated global styles to include new color variables for better theming.
- Improved utility function getFullName to handle null or undefined values.