Skip to content

DBC22-7096: Create basic workflow for CCP on Ride FE and BE - #152

Open
bcgov-brwang wants to merge 14 commits into
mainfrom
feature/DBC22-7096
Open

bcgov-brwang wants to merge 14 commits into
mainfrom
feature/DBC22-7096

Conversation

@bcgov-brwang

@bcgov-brwang bcgov-brwang commented Aug 26, 2026 •

Copy link
Copy Markdown
Collaborator

This PR integrates the CCP features into RIDE and includes the following implemented functionality.
For reference, I have also included links to the relevant wireframes and UI designs.

Create workflow of CCP:
https://moti-imb.atlassian.net/browse/DBC22-7096

Cameras overview:
https://moti-imb.atlassian.net/browse/DBC22-7099
https://moti-imb.atlassian.net/browse/DBC22-7100
https://moti-imb.atlassian.net/browse/DBC22-7104
https://moti-imb.atlassian.net/browse/DBC22-7106
https://moti-imb.atlassian.net/browse/DBC22-7232
https://moti-imb.atlassian.net/browse/DBC22-7105
https://moti-imb.atlassian.net/browse/DBC22-7101
https://moti-imb.atlassian.net/browse/DBC22-7396

Camera details:
https://moti-imb.atlassian.net/browse/DBC22-7148
https://moti-imb.atlassian.net/browse/DBC22-7152
https://moti-imb.atlassian.net/browse/DBC22-7153
https://moti-imb.atlassian.net/browse/DBC22-7155

Camera manage settings:
https://moti-imb.atlassian.net/browse/DBC22-7219
https://moti-imb.atlassian.net/browse/DBC22-7218

Wireframes:
https://www.figma.com/design/3jGqiZv1mNwArO0TUzDNvV/RIDE-Wireframes?node-id=4708-24157&t=JWTiXIGmiXzo1OFL-0

UI design:
https://www.figma.com/design/T60vAzhOfq0rmUGnmR2zXz/RIDE-UI-Design?node-id=1-20781&t=97yhj217SEr6R4YL-0

Test steps:

  1. Deploy the latest version to the RIDE Dev environment.

  2. Verify the implemented features against the wireframes and UI design.
    Review the implementation list and confirm that each feature has been implemented as expected. There are some inconsistencies between the wireframes and the UI design. Where differences exist, the implementation should follow the UI design.

  3. Verify CCP camera overview, details and database settings modules:

    For testing purposes, follow the basic CCP workflow, including:

    • Creating a new camera
    • Updating an existing camera
    • Deleting a camera
    • Setting up database data through Manage Settings → Database Setup
    • Configuring Default Messaging
    • Verifying other available settings and related workflows

    The goal is to verify that the main workflows function correctly from the UI through to the backend and database.

@bcgov-brwang bcgov-brwang changed the title DBC22-7096: added cameras main menu for ccp DBC22-7096: Create basic workflow for CCP on Ride FE and BE Aug 26, 2026
Comment thread src/webapp/apps/cameras/views.py Fixed
Comment thread src/webapp/apps/cameras/views.py Fixed
DBC22-7096: updated camera list styling

DBC22-7096: added flyout context menu

DBC22-7096: added basic details page

DBC22-7096: added setup tab for details

DBC22-7096: added other tabs with test data

DBC22-7096: CRUD on camera

DBC22-7096: updated camera model with camera views

DBC22-7096: updated saving for camera views fields

DBC22-7096: updated search camera by view description

DBC22-7096: fixed image thumbnail url issue

DBC22-7096: updated data model

DBC22-7096: fixed region filter issue

DBC22-7096: fixed region and road saving issue

DBC22-7096: saved road mentainance contractor info

DBC22-7096: saved business area info

DBC22-7096: saved electrical contractor info

DBC22-7096: added camera type make references

DBC22-7096: added connection type and protocol reference

DBC22-7096: added other references on setup tab

DBC22-7096: update basics and setup tab styling

DBC22-7096: added additional fields for basics tab

DBC22-7096: added basics tab left fields

DBC22-7096: fixed orientation issue on overview page

DBC22-7096: overview styling updated 1

DBC22-7096: overview styling updated 2

DBC22-7096: added left side navigation panel for details page

DBC22-7096: deleted component that not used

DBC22-7096: notes tab implementation

DBC22-7096: corrected camera row showing logic

DBC22-7096: passed in view id to show view images correctly

DBC22-7096: updated logs tab

DBC22-7096: added manage settings page

DBC22-7096: fixed manage setting region cannot be saved

DBC22-7096: updated manage settings saving logic

DBC22-7096: added history updates

DBC22-7096: added service request modal frontend component

DBC22-7096: protected cameras route for auth user

DBC22-7096: DBC22-7232 implemented refresh time updates

DBC22-7096: fixed save failures

DBC22-7096: added unavailable image styling

DBC22-7096: updated  unavailable image styling

DBC22-7096: regenerate migration files

DBC22-7096: fixed sonar cloud alerts 1

DBC22-7096: to fix sonar cloud alerts 2

DBC22-7096: to fix sonar clould alerts 3

DBC22-7096: to fix sonar cloud alerts 4

DBC22-7096: to fix sonar cloud alerts 5

DBC22-7096: to fix sonar cloud alerts 6

DBC22-7096: regenerate migration files

DBC22-7096: fixed build error

DBC22-7096: to fix nginx proxy error

DBC22-7096: to fix image display error

DBC22-7096: to solve image proxy issue

DBC22-7096: to solve image proxy issue 2

DBC22-7096: updated overview page styling

DBC22-7096: enable regions filter to be expandable

DBC22-7096: fixed the issue that toggle switch button does not work

DBC22-7096: added roles control for ccp

DBC22-7096: fixed view on drivebc link issue

DBC22-7096: added view visibility madal and toast

DBC22-7096: added export report for cameras

DBC22-7096: added backend logic to handle service request

DBC22-7096: updated camera details page fly out menu

DBC22-7096: added delete camera modal and toast

DBC22-7096: added timelapse modal

DBC22-7096: timelapse backend api updated

DBC22-7096: added report fields

DBC22-7096: saved report fields to database

DBC22-7096: added request service ccs data setup

DBC22-7096: regenerate migration file

DBC22-7096: regenerate migration file

DBC22-7096: styling updated 1

DBC22-7096: styling updated 2

DBC22-7096: styling updated 3

DBC22-7096: overview styling updated

DBC22-7096: overview styling updated

DBC22-7096: overview styling updated

DBC22-7096: details styling updated 1

DBC22-7096: details styling updated 3

DBC22-7096: details styling updated 4

DBC22-7096: details styling updated 4

DBC22-7096: added expand views envent handler

DBC22-7096: expanded view style updated

DBC22-7096: updated expanded view syling

DBC22-7096: updated request service on details page

DBC22-7096: small styling changes for details

DBC22-7096: updated request service on details page

DBC22-7096: added missing fields for setup tab

DBC22-7096: added missing files to source control

DBC22-7096: fixed details view card displaying wrong timestamps issue

DBC22-7096: added connection ip address and port for setup tab

DBC22-7096: access timelapse api with api key

DBC22-7096: updated for editing view orientation title

DBC22-7096: updated for editing view orientation title 1

DBC22-7096: refresh details page to get latest data from drivebc

DBC22-7096: updatd logs tab for retrieving image updated logs from drivebc

DBC22-7096: history tab updated

DBC22-7096: added user checking for notes editing

DBC22-7096: added default messaging

DBC22-7096: added search on settings tree view

DBC22-7096: solve conflicts on migration files

DBC22-7096: remove client id in the header for timelapse api call

DBC22-7096: fixed the issue that showing wrong image for cameras when page refreshed

DBC22-7096: fixed idir login issue

DBC22-7096: fixed disabling view 500 error

DBC22-7096: added clone camera location

DBC22-7096: get default messaging text when disabling view

DBC22-7096: added cameras order for admin settings

DBC22-7096: reorder cameras based on display_order in settings

DBC22-7096: updated cameras order styling on admin page

DBC22-7096: fixed the details image cover issue

DBC22-7096: updated cameras details image displaying style

DBC22-7096: added enabling or disabling view on details page

DBC22-7096: added camera road and region to django admin

DBC22-7096: updated on command from frontend

DBC22-7096: keep the camera off icon in the middle of the view card

DBC22-7096: fix sonar cloud warning part 1

DBC22-7096: fix sonar cloud warning part 2

DBC22-7096: fix sonar cloud warning part 3

DBC22-7096: fix sonar cloud warning part 4

DBC22-7096: fix sonar cloud alert part 6

DBC22-7096: fix sonar cloud alert part 7

DBC22-7096: fix sonar cloud alert part 8

DBC22-7096: fix sonar cloud alert part 9

DBC22-7096: fix run test failure about timelapse api key

DBC22-7096: fix run test failure about timelapse api root

DBC22-7096: fixed issue that new camera cannot be saved

DBC22-7096: added initial load data from legacy sql database

initial design qa work to address flyouts, sidebar component, buttons, and manage camera settings

DBC22-7096: merged views to associate with single camera

update camera details and panels

more cleanup on camera list and general styles

DBC22-7096: fixed issue that view on drivebc does not work

DBC22-7096: to fix the loading performance issue

DBC22-7096: added cameras main menu for ccp

DBC22-7096: updated camera list styling

DBC22-7096: added flyout context menu

DBC22-7096: added basic details page

DBC22-7096: added setup tab for details

DBC22-7096: added other tabs with test data

DBC22-7096: CRUD on camera

DBC22-7096: updated camera model with camera views

DBC22-7096: updated saving for camera views fields

DBC22-7096: updated search camera by view description

DBC22-7096: fixed image thumbnail url issue

DBC22-7096: updated data model

DBC22-7096: fixed region filter issue

DBC22-7096: fixed region and road saving issue

DBC22-7096: saved road mentainance contractor info

DBC22-7096: saved business area info

DBC22-7096: saved electrical contractor info

DBC22-7096: added camera type make references

DBC22-7096: added connection type and protocol reference

DBC22-7096: added other references on setup tab

DBC22-7096: update basics and setup tab styling

DBC22-7096: added additional fields for basics tab

DBC22-7096: added basics tab left fields

DBC22-7096: fixed orientation issue on overview page

DBC22-7096: overview styling updated 1

DBC22-7096: overview styling updated 2

DBC22-7096: added left side navigation panel for details page

DBC22-7096: deleted component that not used

DBC22-7096: notes tab implementation

DBC22-7096: corrected camera row showing logic

DBC22-7096: passed in view id to show view images correctly

DBC22-7096: updated logs tab

DBC22-7096: added manage settings page

DBC22-7096: fixed manage setting region cannot be saved

DBC22-7096: updated manage settings saving logic

DBC22-7096: added history updates

DBC22-7096: added service request modal frontend component

DBC22-7096: protected cameras route for auth user

DBC22-7096: DBC22-7232 implemented refresh time updates

DBC22-7096: fixed save failures

DBC22-7096: added unavailable image styling

DBC22-7096: updated  unavailable image styling

DBC22-7096: regenerate migration files

DBC22-7096: fixed sonar cloud alerts 1

DBC22-7096: to fix sonar cloud alerts 2

DBC22-7096: to fix sonar clould alerts 3

DBC22-7096: to fix sonar cloud alerts 4

DBC22-7096: to fix sonar cloud alerts 5

DBC22-7096: to fix sonar cloud alerts 6

DBC22-7096: regenerate migration files

DBC22-7096: fixed build error

DBC22-7096: to fix nginx proxy error

DBC22-7096: to fix image display error

DBC22-7096: to solve image proxy issue

DBC22-7096: to solve image proxy issue 2

DBC22-7096: updated overview page styling

DBC22-7096: enable regions filter to be expandable

DBC22-7096: fixed the issue that toggle switch button does not work

DBC22-7096: added roles control for ccp

DBC22-7096: fixed view on drivebc link issue

DBC22-7096: added view visibility madal and toast

DBC22-7096: added export report for cameras

DBC22-7096: added backend logic to handle service request

DBC22-7096: updated camera details page fly out menu

DBC22-7096: added delete camera modal and toast

DBC22-7096: added timelapse modal

DBC22-7096: timelapse backend api updated

DBC22-7096: added report fields

DBC22-7096: saved report fields to database

DBC22-7096: added request service ccs data setup

DBC22-7096: regenerate migration file

DBC22-7096: regenerate migration file

DBC22-7096: styling updated 1

DBC22-7096: styling updated 2

DBC22-7096: styling updated 3

DBC22-7096: overview styling updated

DBC22-7096: overview styling updated

DBC22-7096: overview styling updated

DBC22-7096: details styling updated 1

DBC22-7096: details styling updated 3

DBC22-7096: details styling updated 4

DBC22-7096: details styling updated 4

DBC22-7096: added expand views envent handler

DBC22-7096: expanded view style updated

DBC22-7096: updated expanded view syling

DBC22-7096: updated request service on details page

DBC22-7096: small styling changes for details

DBC22-7096: updated request service on details page

DBC22-7096: added missing fields for setup tab

DBC22-7096: added missing files to source control

DBC22-7096: fixed details view card displaying wrong timestamps issue

DBC22-7096: added connection ip address and port for setup tab

DBC22-7096: access timelapse api with api key

DBC22-7096: updated for editing view orientation title

DBC22-7096: updated for editing view orientation title 1

DBC22-7096: refresh details page to get latest data from drivebc

DBC22-7096: updatd logs tab for retrieving image updated logs from drivebc

DBC22-7096: history tab updated

DBC22-7096: added user checking for notes editing

DBC22-7096: added default messaging

DBC22-7096: added search on settings tree view

DBC22-7096: solve conflicts on migration files

DBC22-7096: remove client id in the header for timelapse api call

DBC22-7096: fixed the issue that showing wrong image for cameras when page refreshed

DBC22-7096: fixed idir login issue

DBC22-7096: fixed disabling view 500 error

DBC22-7096: added clone camera location

DBC22-7096: get default messaging text when disabling view

DBC22-7096: added cameras order for admin settings

DBC22-7096: reorder cameras based on display_order in settings

DBC22-7096: updated cameras order styling on admin page

DBC22-7096: fixed the details image cover issue

DBC22-7096: updated cameras details image displaying style

DBC22-7096: added enabling or disabling view on details page

DBC22-7096: added camera road and region to django admin

DBC22-7096: updated on command from frontend

DBC22-7096: keep the camera off icon in the middle of the view card

DBC22-7096: fix sonar cloud warning part 1

DBC22-7096: fix sonar cloud warning part 2

DBC22-7096: fix sonar cloud warning part 3

DBC22-7096: fix sonar cloud warning part 4

DBC22-7096: fix sonar cloud alert part 6

DBC22-7096: fix sonar cloud alert part 7

DBC22-7096: fix sonar cloud alert part 8

DBC22-7096: fix sonar cloud alert part 9

DBC22-7096: fix run test failure about timelapse api key

DBC22-7096: fix run test failure about timelapse api root

initial design qa work to address flyouts, sidebar component, buttons, and manage camera settings

DBC22-7096: fixed issue that new camera cannot be saved

update camera details and panels

more cleanup on camera list and general styles

DBC22-7096: added initial load data from legacy sql database

more work on tabs, modals, layout

update to overview and refactor

fixes draggable, updates type, and design system components

update panel scrolling for cam details

skeleton loader

cleaned up, fixed layout, added basic motion

DBC22-7096: initial load maitenance info for cameras

DBC22-7096: imported camera make from maitenance table

DBC22-7096: added placeholder views from imported cameras

DBC22-7096: removed camera off badge for staled camera

DBC22-7096: get rid of sonar cloud alerts part 1

DBC22-7096: get rid of sonar cloud alerts part 2

DBC22-7096: get rid of sonar cloud alerts part 3

DBC22-7096: get rid of sonar cloud alerts part 4

DBC22-7096: get rid of sonar cloud alerts part 5

DBC22-7096: get rid of sonar cloud alerts part 3

DBC22-7096: get rid of sonar cloud alerts part test

DBC22-7096: removed code no needed

DBC22-7096: fixed frontend build error

DBC22-7096: pulled extra info from legacy db
@ray-oxd

ray-oxd commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Here are the suggested blockers and should-fix items suggested by a coding agent. I've reviewed these and most of these seem valid. Please address:

  1. Many camera endpoints are open to anonymous users. The repo sets no default permission in config/settings/third_party.py, so any viewset without its own permission class lets anyone in. Django REST Framework also skips its CSRF check for anonymous requests, so these accept writes from anyone. Affected, in apps/cameras/views.py:
  • BulkUpdateViewSet and all its subclasses (about line 52). Anyone can call PUT /api//bulk-update/ with an empty list, which deactivates every region, road, contractor and so on.
  • CameraLogViewSet (about line 743): full create, update and delete, no authentication.
  • CameraHistoryViewSet (about line 645): exposes users' full names.
  • CameraReportSettingsViewSet, ServiceRequestCcsViewSet, CameraDefaultMessagingViewSet and CamerasOrderViewSet (about lines 753–870).
  • CameraNoteViewSet only requires login, not the camera role. Also, only edits check the author, so any logged-in user can delete anyone's note.

Suggested fix: reads need IsCameraRole, writes need IsCameraAdmin, the same pattern CameraViewSet already uses.

  1. The config/adapter.py change likely breaks account linking. pre_social_login now reads sociallogin.account.extra_data directly instead of calling get_oidc_claims(). On main, the claims are nested under userinfo, so identity_provider comes back None and the function quietly returns early. Imported users would stop being linked to their SSO accounts. populate_user and the rest of the code still use get_oidc_claims, so this looks like a merge or rebase leftover. It's unrelated to CCP and should be reverted.

  2. Camera device passwords are stored in plain text and sent to every camera-role user. Camera.password (models.py about line 281) is serialized because CameraSerializer uses fields='all'. The detail page then loads it into form state. It should at least be write-only in the API, and ideally stored encrypted.

  3. frontend/app/layout.jsx has a broken comparison. About line 106:
    if (ret.is_camera_role != prior.is_camera_role || prior.is_camera_admin) { return ret; }
    This always returns a new object for camera admins, causing extra re-renders. The PR also deleted the request_organization comparison, so changes to that field no longer update the auth context. That's a regression in existing behaviour.

  4. The detail page's one-minute refresh overwrites unsaved edits. In CameraDetails.jsx (about line 443), loadCamera() calls setBasicsData and setSetupData unconditionally every minute. A user who is mid-edit loses their changes. The same block also has console.log of a Promise.

  5. Camera logs are written by the browser. "Image received / No image received" entries are created by CameraDetails only when someone has the page open. Each open tab writes its own copy, so you get duplicates with several viewers and nothing when nobody is looking. This belongs in a backend task. The client also sends a view field, which CameraLogSerializer drops.

  6. The timelapse-image endpoint passes user input into the upstream URL. The timestamp query parameter goes into the URL unvalidated, and that request carries the API key (about line 546). The webcam_id in image-proxy has the same problem. Both should be checked to be digits only.

  7. CSV export has wrong field mappings. In EXPORT_FIELD_MAP, these keys always come out blank because the field names don't match the model:
    Export key
    Actual model field
    elevation
    locations_elevation
    installed_date
    camera_installed
    last_inspected
    camera_last_inspected
    camera_url, camera_views, view_descriptions, weather_stations and geotechnical_sensors don't exist on the model at all. notes is worse: it writes the related-manager object's text representation into the CSV instead of the notes.

  8. New required settings will break existing environments. DRIVEBC_TIMELAPSE_API_KEY and DRIVEBC_TIMELAPSE_API_ROOT are read with env() and no default, so Django won't start until every deployment config adds them. CI was updated; dev, test and prod config need the same. A default like the other API settings in third_party.py would avoid this.

  9. The Dockerfile change adds weight and may break Apple Silicon builds. It installs the Microsoft SQL Server ODBC driver (msodbcsql18) and pyodbc into the main webapp image only for the one-time import_legacy_cameras command. The apt source is hard-coded to arch=amd64, which will probably fail on M-series Macs. A separate image or job for the import would avoid both problems.

  10. Migrations should be squashed. The new app ships 13 migrations (0001–0013), including renames and alters made during development. Collapse them into a single 0001_initial before the first merge. The organizations/0009 migration (ServiceArea ordering) is unrelated to this work.

  11. The nginx /drivebc-api/ block is an open proxy. It forwards any path to www.drivebc.ca with no authentication. The frontend could go through the backend instead, which already proxies images.

@sonarqubecloud

Copy link
Copy Markdown

This branch was successfully deployed

1 active (outdated) deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants