Skip to content

Show eCapris statuses in Notes tab#1615

Merged
mddilley merged 37 commits into
mike/22270_notes_viewfrom
mike/21794_show_ecapris_statuses
Jul 2, 2025
Merged

Show eCapris statuses in Notes tab#1615
mddilley merged 37 commits into
mike/22270_notes_viewfrom
mike/21794_show_ecapris_statuses

Conversation

@mddilley
Copy link
Copy Markdown
Collaborator

@mddilley mddilley commented Jun 23, 2025

Associated issues

Closes cityofaustin/atd-data-tech#21794

This PR:

  • Updates the Notes tab to show eCAPRIS statuses if a project has an eCAPRIS subproject ID
  • Updates the three places to show the latest status update (from eCAPRIS if syncing is enabled and from Moped if syncing is disabled)
    • Dashboard Following and My Projects tabs
    • Project summary view

Testing

URL to test:

Local

Steps to test:

  1. Go to https://localhost:3000/moped/projects/331
  2. Follow this project and then add yourself to the team so you can see this project in the dashboard views later on
  3. Go to the Notes tab and see that internal notes, status updates, and statuses synced from eCAPRIS can be viewed in the list. eCAPRIS statuses should show the content, author, and created at date and time just like Moped notes.
  4. Switch the "Sync from eCAPRIS" toggle off and notice that the eCAPRIS statuses no longer show in the list (disabling the eCAPRIS filter button when eCAPRIS syncing is disabled is covered in Filter Notes tab to eCapris statuses only atd-data-tech#22702)
  5. Switch the toggle back on and test filtering to the three note types. Hooray because this part came free! 🙌
  6. Make sure that you cannot create a new eCAPRIS status update through the rich text editor
  7. Now, go to the project summary and remove the eCAPRIS subproject id. It is 13240.027 just in case you lose it before the next step - I got you!
  8. Go to the Notes tab and see that the eCAPRIS toggle is switched off and disabled to make sure that Rose's work didn't break
  9. Go to the Funding table and add the eCAPRIS subproject id back in
  10. Go to the Notes tab again and see that the eCAPRIS sync toggle is enabled and switched on again. You can try removing and adding from either the Summary or Funding tab to see the switch toggle off when an id is removed and on when an id is added.
  11. Now, make sure you have a subproject id added and the syncing switch is on. Then, go to the Project summary. You should see the latest status update has "Unfunded for construction." at the end which is a status from eCAPRIS.
  12. Go to Dashboard and check the rows for project 331 in the Following and My Projects tabs. You should see these also end with "Unfunded for construction."
  13. Now, go back to the Notes tab and switch the eCAPRIS toggle off.
  14. Go back to the project summary and Following and My Projects tabs to make sure that the status update shown does not have "Unfunded for construction." at the end. This is the latest status update added through Moped which is what we should see if syncing is disabled.

Ship list

mddilley and others added 27 commits June 12, 2025 13:49
- id
- name
- slug
- source
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this helps prevent rendering UI elements that are rendered from the rows in moped_note_types like the radio buttons in the rich text editor (source = ecapris).

- project_partners
- project_sponsor
- project_status_update
- project_status_update_author
Copy link
Copy Markdown
Collaborator Author

@mddilley mddilley Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new view column lets us fetch status update authors through the project_list_view to show in the project summary page.

It is also why this PR needed the migration that I also used to update the name of eCAPRIS note types from "eCapris status update" to "Synced from eCAPRIS".

Comment on lines +201 to +205
// ProjectNotes will expect data to be passed in this shape with note type lookups
data={{
moped_project: [row],
moped_note_types: data.moped_note_types,
}}
Copy link
Copy Markdown
Collaborator Author

@mddilley mddilley Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awkward and doesn't feel great, but I found myself in a place where I either did this or break the way we used DashboardStatusModal in the project summary view. I decided to save any further refactoring for another day.

Copy link
Copy Markdown
Collaborator Author

@mddilley mddilley Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the large diff here. I found myself struggling to separate the note render from the rest of this component so I pulled it out into its own component.

I also moved all styles into sx props since we will one day need to fully migrate away from useStyles/makesStyles which is deprecated in new MUI versions.

* @param {Object} classes - The shared style settings
* @param {Object} data - The project data object from the GraphQL query
* @returns {JSX.Element}
*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ ✨

Copy link
Copy Markdown
Contributor

@roseeichelmann roseeichelmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks and works great mike!! i like that you pulled each ProjectNote into its own component ✨ 🚀 this was a huge chunk of work!!

Copy link
Copy Markdown
Member

@johnclary johnclary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow—this looks great. All of the note interactions worked exactly as promised. It's so cool to see this in action!!! 🙌 🚢

Comment thread moped-editor/src/queries/project.js Outdated
@@ -149,6 +138,9 @@ export const SUMMARY_QUERY = gql`
project_list_view(where: { project_id: { _eq: $projectId } }) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if i'm not mistaken, you no longer need this where condition because you added the manually-configured object relationship in the Hasura metadata 👀

Copy link
Copy Markdown
Collaborator Author

@mddilley mddilley Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yep! thanks for catching. I'll update here to make use of the object relationship too. 🙌

* @param {Object} classes - The shared style settings
* @param {Object} data - The project data object from the GraphQL query
* @returns {JSX.Element}
*/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ ✨

color: theme.palette.text.primary,
},
}));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ 🙌

// use currentPhaseId if passed down from ProjectSummaryStatusUpdate component,
// otherwise use data passed from ProjectView
/* User details for create and update mutations */
const userSessionData = getSessionDatabaseData();
Copy link
Copy Markdown
Member

@johnclary johnclary Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this call to local storage is firing on every keystroke when writing a status update. maybe a separate tech debt issue to turn this auth utility into a proper hook.

...or a quick useMemo wrapper around this call 😄

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am going to memo this - thanks for pointing out because now I can't unsee even though I probably scanned past it many times in this code. 🙏

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

displayNotes = displayNotes.filter(
(note) => note.note_type_slug !== "ecapris_status_update"
);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just my two cents, but it might be helpful to persist this helper text about sync frequency somewhere on the screen when syncing is enabled so that all users are aware of that cadence. E.g. read-only users or non-project managers might not hover over that toggle very often 🤔

Screenshot 2025-07-01 at 4 07 49 PM

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good point, and the frequency does feel very hidden away when I'm looking at this now. I'll bring an alternative to refinement today for some feedback. I think that reaching for FormHelperText could be a nice improvement. Thanks!

@mddilley mddilley merged commit da7137d into mike/22270_notes_view Jul 2, 2025
@mddilley mddilley deleted the mike/21794_show_ecapris_statuses branch July 2, 2025 22:05
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.

3 participants