Show eCapris statuses in Notes tab#1615
Conversation
…or viewing and editing Moped notes
…ilter ecapris source
…s expected shape instead
…when eCAPRIS syncing is enabled/disabled
| - id | ||
| - name | ||
| - slug | ||
| - source |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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".
| // 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, | ||
| }} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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} | ||
| */ |
johnclary
left a comment
There was a problem hiding this comment.
Wow—this looks great. All of the note interactions worked exactly as promised. It's so cool to see this in action!!! 🙌 🚢
| @@ -149,6 +138,9 @@ export const SUMMARY_QUERY = gql` | |||
| project_list_view(where: { project_id: { _eq: $projectId } }) { | |||
There was a problem hiding this comment.
if i'm not mistaken, you no longer need this where condition because you added the manually-configured object relationship in the Hasura metadata 👀
There was a problem hiding this comment.
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} | ||
| */ |
| color: theme.palette.text.primary, | ||
| }, | ||
| })); | ||
|
|
| // use currentPhaseId if passed down from ProjectSummaryStatusUpdate component, | ||
| // otherwise use data passed from ProjectView | ||
| /* User details for create and update mutations */ | ||
| const userSessionData = getSessionDatabaseData(); |
There was a problem hiding this comment.
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 😄
There was a problem hiding this comment.
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. 🙏
There was a problem hiding this comment.
| displayNotes = displayNotes.filter( | ||
| (note) => note.note_type_slug !== "ecapris_status_update" | ||
| ); | ||
| } |
There was a problem hiding this comment.
There was a problem hiding this comment.
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!
…_filter Disable eCAPRIS Notes Filter
… text when switched on

Associated issues
Closes cityofaustin/atd-data-tech#21794
This PR:
Testing
URL to test:
Local
Steps to test:
13240.027just in case you lose it before the next step - I got you!Ship list
[ ] Product manager added to QA test script if applicable