Commit Graph
100 Commits
Author SHA1 Message Date
Faris Armoush e35a7fdc70 Merge pull request #192 from SyncrowIOT/bugfix/charts-horizontal-lines
bugfix/charts-horizontal-lines
2025-05-15 14:30:37 +03:00
Faris Armoush d80f5e1f3a Refactor energy consumption charts to enhance grid data configuration
Updated the grid data for EnergyConsumptionByPhasesChart, EnergyConsumptionPerDeviceChart, and TotalEnergyConsumptionChart to include horizontal line visibility and set a horizontal interval of 250. Removed unused phasesJson constant from TotalEnergyConsumptionChart for cleaner code.
2025-05-15 14:25:13 +03:00
Faris Armoush 5279020d08 Merge pull request #188 from SyncrowIOT/1495-energy-consumption-per-device-api-integration
1495-energy-consumption-per-device-api-integration.
2025-05-15 09:32:15 +03:00
Faris Armoush da481536c4 1495-energy-consumption-per-device-api-integration. 2025-05-14 16:55:28 +03:00
Faris Armoush f21366268a Merge pull request #187 from SyncrowIOT/SP-1509-FE-Implement-devices-status-based-on-the-selected-device-from-the-dropdown-list
Sp 1509 fe implement devices status based on the selected device from the dropdown list
2025-05-14 16:18:51 +03:00
Faris Armoush c3aef736fd Merge pull request #186 from SyncrowIOT/1511-occupancy-heat-map-tooltip
1511-occupancy-heat-map-tooltip.
2025-05-14 16:18:08 +03:00
Faris Armoush 887ac58f40 fixed import. 2025-05-14 15:59:40 +03:00
Faris Armoush c709477500 some refactors to further clarify intent. 2025-05-14 15:55:12 +03:00
Faris Armoush 63e7b3faa2 resets selection and clears data. 2025-05-14 15:47:07 +03:00
Faris Armoush 0e61e52bf8 Connected devices to widgets, and is currently making the necessary and correct api calls for everything to function properly. 2025-05-14 15:35:22 +03:00
Faris Armoush 7515b347ce analytics devices integtation. 2025-05-14 15:03:30 +03:00
Faris Armoush 3dfbcb5935 connect device dropdown to bloc. 2025-05-14 14:31:28 +03:00
Faris Armoush 4fd4a9b5bf loads analytics devices on sidebar selection. 2025-05-14 13:03:51 +03:00
Faris Armoush 14fa1b355e Added a uuid property to AnalyticsDevice. 2025-05-14 12:50:27 +03:00
Faris Armoush 78d4e58996 Added selected device state/event, and clear data event to AnalyticsDevicesBloc. 2025-05-14 12:50:16 +03:00
Faris Armoush 23b9cb5b78 Injected AnalyticsDevicesBloc into AnalyticsPage. 2025-05-14 12:42:51 +03:00
Faris Armoush 401d0a9788 Created AnalyticsDevicesBloc. 2025-05-14 12:41:44 +03:00
Faris Armoush ac2b0d3fac Created an initial remote implementation of AnalyticsDevicesService. 2025-05-14 12:38:07 +03:00
Faris Armoush 3be7a377c0 Created AnalyticsDevicesService interface. 2025-05-14 12:37:52 +03:00
Faris Armoush e4ee456384 Created empty AnalyticsDevice model. 2025-05-14 12:37:44 +03:00
Faris Armoush f02c5d71ba Created GetAnalyticsDevicesParam. 2025-05-14 12:26:16 +03:00
Faris Armoush d45ff262c7 Merge branch 'dev' into 1511-occupancy-heat-map-tooltip 2025-05-14 12:05:34 +03:00
Faris Armoush ad227febc1 Merge pull request #185 from SyncrowIOT/SP-1512-FE-Apply-Responsive-Behavior-for-Dashboard-Layout-and-Sidebar-Collapse
Sp 1512 fe apply responsive behavior for dashboard layout and sidebar collapse
2025-05-14 12:04:41 +03:00
Faris Armoush a9d6c6f4ee 1511-occupancy-heat-map-tooltip. 2025-05-14 12:03:47 +03:00
Faris Armoush 4d9e57c8b5 Created and connected a remote implementation that fetches the heat map occupancy per space from the API. 2025-05-14 10:51:37 +03:00
Faris Armoush d1bb8da484 Updated OccupancyHeatMapModel model with what the api returns, and only used the necessary fields that the api returns for this feature to work. 2025-05-14 10:51:19 +03:00
Faris Armoush 300f9ae358 Matched the GetOccupancyHeatMapParam with what the API expects and removed the communityId since it is no longer necessary for the api, and renamed spaceId to spaceUuid for more clarity. 2025-05-14 10:49:32 +03:00
Faris Armoush c1dab3400b removed a force unwrap from OccupancyHeatMap._maxValue to avoid any bugs. 2025-05-14 10:48:28 +03:00
Faris Armoush 46815585cb Fixed error in AnalyticsErrorWidget where it used to add the default error message to the errorMessage. 2025-05-14 10:47:54 +03:00
Faris Armoush 5645fb7826 Merge pull request #182 from SyncrowIOT/SP-1519-FE-Handle-Loading-Skeletons-and-No-Data-Error-States
Sp 1519 fe handle loading skeletons and no data error states
2025-05-13 16:55:54 +03:00
Faris Armoush e8f7c29652 Applies correct business logic of the sidebar. 2025-05-13 16:46:34 +03:00
Faris Armoush c7fef11aec Fixed typo Tab to run to Tap to run. 2025-05-12 12:06:37 +03:00
Faris Armoush ef29d78d70 Clears data when needed. 2025-05-12 10:02:56 +03:00
Faris Armoush cd9941f544 Doesn't load occupancy data on initState in AnalyticsOccupancyView. 2025-05-12 10:02:08 +03:00
Faris Armoush 71aa64ba9e Merge pull request #181 from SyncrowIOT/bugfix/analytics_expansion_bugfix
bugfix/analytics_expansion_bugfix.
2025-05-12 09:22:12 +03:00
Faris Armoush 2262d3b2ba bugfix/analytics_expansion_bugfix. 2025-05-12 09:20:01 +03:00
Faris Armoush b7ef9da35d Sp 1513 fe implement device dropdown and live status card presence vacancy (#179)
* Called the widget of presence sensor status widgets.

* Enahnced `PowerClampEnergyDataDeviceDropdown` design and made it a dropdown.

* connected the realtime feature to the occupancy side bar, but with a mock id.

* revert default tab to energyManagement.
2025-05-11 16:59:15 +03:00
Faris Armoush 49e93329c8 Sp 1511 fe build occupancy heat map weekly monthly intensity view (#178)
* set the default tab to occupancy for ease of development.

* Implemented an initial design for the occupancy chart.

* Add Occupacy model and service for occupancy data handling.

* Created `OccupancyBloc`.

* Implemented the sidebar of Occupancy view.

* Moved `OccupancyEndSideBar` widget to its own file.

* Removed unnecessary widgets.

* Matched the `OccupancyChart` with the figma design.

* Added `AnalyticsDateFilterButton` to `OccupancyChartBox`.

* Hides `AnalyticsDateFilterButton` that is in the page header, when the selected tab isn't `AnalyticsPageTab.energyManagement`.

* Added animation to`AnalyticsDateFilterButton`.

* modified the implementation of `FakeOccupacyService` to clamp all the generated values to less than a 100.

* Injected `OccupancyBloc` into `AnalyticsPage`.

* Made `OccupancyChart` read its data from `OccupancyBloc`.

* Refactor AnalyticsCommunitiesSidebar to load data based on selected tab and implement loadEnergyManagementData method

* Refactor Analytics views to use StatefulWidget and load data in initState

* Created `OccupancyHeatMapModel`.

* Add FakeOccupancyHeatMapService implementation.

* Created `OccupancyHeatMapBloc`.

* Injected `OccupancyHeatMapBloc` into `AnalyticsPage`.

* Add OccupancyHeatMapBox widget and integrate into AnalyticsOccupancyView

* Matching the heat map with the design, and added week days.

* Made the HeatMap cells have a dashed border.

* shows months.

* responsiveness.

* Integrate OccupancyHeatMapBloc and update OccupancyHeatMapBox to display heat map data with error handling

* Integrate OccupancyHeatMapBloc and update OccupancyHeatMapBox to display heat map data with error handling

* made the heatmap loading fast af by using painters instead of individually creating a widget for every single event.

* Extracted `OccupancyHeatMapMonths` into its own widgte.

* Moved `OccupancyHeatMapMonths` to its own file.

* Adjusted design of `OccupancyHeatMapMonths`.

* Adjust layout flex properties for `OccupancyEndSideBar` and its parent column in `AnalyticsOccupancyView`.

* moved `OccupancyPaintItem` to `OccupancyPainter`s file.

* removed comments from `OccupancyPainter`.

* used color.withValues instead of .withOpacity.

* re-added `OccupancyHeatMapGradient`.

* Revert initial tab to `energyManagement`.

* Made datepicker dynamic for multiple states.

* Add year picker functionality to date filter button and implement dynamic date selection

* Align date filter button to the end in occupancy chart and heat map boxes for improved UI consistency.

* Enahnced color of border in `OccupancyPainter`.

* Add ClearOccupancyHeatMapEvent to reset heat map state and update occupancy data helper to trigger event on empty selections

* show percentage of value in tool tip of `OccupancyChart`.
2025-05-11 16:58:13 +03:00
Faris Armoush d6f0b53b59 Sp 1494 api integration (#180)
* SP-1494-api-integration.

* fixed left stide titles intervals in total energy consumption chart.

* Adjusted tooltip and title intervals in energy management charts to improve accuracy by incrementing displayed values by one.

* Refactor AnalyticsCommunitiesSidebar to use AnalyticsSpaceTreeView and enhance community/space selection handling

* Gave every tab its own selection logic using the strategy design pattern, along with clearing the selection when changing tabes to avoid collision between features.
2025-05-11 16:46:00 +03:00
Faris Armoush 7154693379 SP-1495-fix-deployment by wrapping ChartsLoadingWidget.CircularProgressIndicator with a padding instead of adding padding as a property of CircularProgressIndicator. (#175) 2025-05-08 16:32:50 +03:00
Faris Armoush 2e2bc99501 Merge pull request #176 from SyncrowIOT/SP-1510-FE-Build-Occupancy-Bar-Chart-Monthly-Consumption-View
Sp 1510 fe build occupancy bar chart monthly consumption view
2025-05-08 16:32:21 +03:00
Faris Armoush 53222bee81 Merge pull request #174 from SyncrowIOT/SP-1495-FE-Build-Energy-Consumption-per-Device-Chart-Placeholder
Sp 1495 fe build energy consumption per device chart placeholder
2025-05-07 15:54:37 +03:00
Faris Armoush bfb9158652 Replaced hardcoded device id from RemotePowerClampInfoService.getInfo, and instead used the one from the method parameter. 2025-05-07 15:47:41 +03:00
Faris Armoush 7f03222c12 Removed unnecessary widgets. 2025-05-07 15:46:24 +03:00
Faris Armoush 5e6c14efeb added loading indicators to charts. 2025-05-07 12:20:46 +03:00
Faris Armoush 9bbf3e75fa bugfixes. 2025-05-07 11:55:04 +03:00
Faris Armoush 303b0236f1 Added default error message for edge case. 2025-05-07 11:44:29 +03:00
Faris Armoush 4e3e63723e added error messages everywhere. 2025-05-07 11:43:05 +03:00
Faris Armoush 38ff20f86a Created initial remote implementation for all the services in the energy management module. 2025-05-07 11:28:31 +03:00
Faris Armoush d539e6266e gets data when changing the date. 2025-05-07 11:12:39 +03:00
Faris Armoush 7467f8d0ea Removed the analytics overview view for now, since there will be no implementation for it. 2025-05-07 10:59:55 +03:00
Faris Armoush a11e20147e preparing for integration, by fetching data when selecting a community. 2025-05-07 10:58:46 +03:00
Faris Armoush 55a6974bdc deselect selected spaces when selecting a new space in analytics side bar. 2025-05-06 15:53:43 +03:00
Faris Armoush f8f58a24b8 . 2025-05-06 15:47:30 +03:00
Faris Armoush 682e69e65f modify data to migrate to days instead of months. 2025-05-06 15:44:33 +03:00
Faris Armoush 59a59231ec Merge branches 'SP-1495-FE-Build-Energy-Consumption-per-Device-Chart-Placeholder' and 'SP-1495-FE-Build-Energy-Consumption-per-Device-Chart-Placeholder' of https://github.com/SyncrowIOT/web into SP-1495-FE-Build-Energy-Consumption-per-Device-Chart-Placeholder 2025-05-06 15:02:46 +03:00
Faris Armoush ad41a2a87e Implemented calendar widget and bloc. 2025-05-06 15:02:09 +03:00
Faris Armoush 974aa8f2a4 Implemented calendar widget and bloc. 2025-05-06 14:59:54 +03:00
Faris Armoush 428cd34492 Fixed device cell sizing. 2025-05-06 13:19:55 +03:00
Faris Armoush 1a6121c452 Made analytics energy management view scrollable, to allow for a better UX experience. 2025-05-06 12:24:47 +03:00
Faris Armoush e8f9ae944c Refactor BlocListener in PowerClampEnergyDataWidget to simplify state handling 2025-05-06 09:17:35 +03:00
Faris Armoush 7e37aed026 formatted PowerClampInfoBloc. 2025-05-06 09:09:27 +03:00
Faris Armoush d89e227599 removed unnecesary type annotations from FirebaseRealtimeDeviceService. 2025-05-06 09:06:33 +03:00
Faris Armoush 5a68b22f0c Update RealtimeDeviceChangesBloc to handle loading and failure states 2025-05-06 09:05:16 +03:00
Faris Armoush 38184ca8b2 Integrated realtime data. 2025-05-05 16:58:48 +03:00
Faris Armoush 4d5de7bc05 making good progress on realtime data integration. 2025-05-05 16:34:56 +03:00
Faris Armoush 1a3006fa43 Power clamp info integration. 2025-05-05 12:57:27 +03:00
Faris Armoush 490ca2057e Reduce bar width in EnergyConsumptionPerDeviceChart for improved visual clarity. 2025-05-05 10:34:23 +03:00
Faris Armoush 06637a16bb Add EnergyConsumptionPerDevice functionality and update related components 2025-05-05 10:32:12 +03:00
Faris Armoush 696978a78d Injected EnergyConsumptionPerDeviceBloc into AnalyticsPage. 2025-05-05 10:20:43 +03:00
Faris Armoush 818e4e4d51 Created EnergyConsumptionPerDeviceBloc. 2025-05-05 10:19:52 +03:00
Faris Armoush af877d7839 Created EnergyConsumptionPerDeviceService and a fake implementation for it. 2025-05-05 10:15:35 +03:00
Faris Armoush a33b1e3f49 uses MediaQuery.sizeOf instead of MediaQuery.of. 2025-05-05 10:02:48 +03:00
Faris Armoush c3cce334ab data populator. 2025-05-05 09:56:29 +03:00
Faris Armoush 947e9e404c left side intervals. 2025-05-05 09:54:17 +03:00
Faris Armoush cd8264b6ce Progress on making EnergyManagementView responsive. 2025-05-05 09:47:54 +03:00
Faris Armoush 7467be6980 Refactored PowerClampPhase to be more readable by extracting widgets into helper private methods to enhance readability. 2025-05-05 09:15:13 +03:00
Faris Armoush 0353c73dac Moved PowerClampPhase widget to its own file. 2025-05-05 09:12:27 +03:00
Faris Armoush a050792f32 extracted PowerClampPhase into its own widget. 2025-05-05 09:11:11 +03:00
Faris Armoush 464f7b7347 working on responsiveness. 2025-05-04 16:50:28 +03:00
Faris Armoush cd54574279 progress towards drawing the phases widgts. 2025-05-04 16:07:51 +03:00
Faris Armoush 18acae3e85 Added type annotation. 2025-05-04 15:02:27 +03:00
Faris Armoush f081a7fc2d implemented header, and power clamp data widgets. 2025-05-04 14:59:49 +03:00
Faris Armoush 5996ff3928 Extracted fetching energy management data from the widgets themselves to the parent widget AnalyticsEnergyManagementView. 2025-05-04 14:29:35 +03:00
Faris Armoush a0d1cb988a moved EnergyConsumptionByPhasesTitle to its own file. 2025-05-04 14:26:52 +03:00
Faris Armoush c3ec9000d4 Extracted EnergyConsumptionByPhasesTitle into its own widget to improve readability and assert separation of concerns. 2025-05-04 14:26:38 +03:00
Faris Armoush 3d6a60b406 load energy consumption by phases from bloc, and made the widget use the said data. 2025-05-04 14:24:53 +03:00
Faris Armoush 69c9240641 Injected EnergyConsumptionByPhasesBloc into AnalyticsPage. 2025-05-04 14:22:01 +03:00
Faris Armoush 098013e5c8 Created EnergyConsumptionByPhasesBloc. 2025-05-04 14:20:59 +03:00
Faris Armoush 11fb9e4894 Abstracted EnergyConsumptionByPhasesService, and created a fake implementation that returns mock data, which also simulates a network delay. 2025-05-04 14:20:52 +03:00
Faris Armoush 390da9213d Made PhasesEnergyConsumption extend from Equatable. 2025-05-04 14:19:15 +03:00
Faris Armoush cae8b029fe Created GetEnergyConsumptionByPhasesParam class. 2025-05-04 14:18:56 +03:00
Faris Armoush 6b883c8bb3 Implemented Energy Consumption by Phases chart. 2025-05-04 13:22:38 +03:00
Faris Armoush 08c99bcbcb Renamed EnergyConsumptionByPhasesChart to EnergyConsumptionByPhasesChartBox 2025-05-04 12:02:09 +03:00
Faris Armoush f6448d3eff Implement EnergyConsumptionByPhasesChart with structured layout and phase indicators 2025-05-04 12:01:40 +03:00
Faris Armoush a657a9a25e Refactor padding and add const constructors for improved performance and consistency in chart widgets 2025-05-04 11:20:47 +03:00
Faris Armoush f55fa25bdf Added prefer_const_constructors to analysis_options.yaml. 2025-05-04 11:11:32 +03:00
Faris Armoush 7242218b2f Textstyles. 2025-05-04 11:10:22 +03:00
Faris Armoush e43de3f64c Introduce ChartTitle widget for consistent chart headings in EnergyConsumptionPerDeviceChartBox and TotalEnergyConsumptionChartBox 2025-05-04 11:08:56 +03:00
Faris Armoush 9c250986b2 Moved EnergyConsumptionPerDeviceDevicesList to its own file. 2025-05-04 10:55:52 +03:00