Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove communication outages from signal monitor #419

Merged
merged 11 commits into from
Jun 21, 2024

Conversation

chiaberry
Copy link
Member

@chiaberry chiaberry commented Jun 12, 2024

Tilly is on vacation so I took over wrapping up this issue cityofaustin/atd-data-tech#1585

https://deploy-preview-419--austin-transportation.netlify.app/signal-monitor?

I reworked Tilly's original code a little by adding a hook to check how many results were returned, and displaying a message based on that instead of the length of the filtered geojson.

Also liked John's suggesting of giving the message some styling, I used the success Alert component

Screenshot 2024-06-12 at 4 59 43 PM

Test by visiting the preview link and unchecking all the check boxes. Confirm the message does not appear.

Locally you can get the success message to appear by changing the conditional to be if there are more than 0 features. Otherwise wait until the signal system is operating normally to see the message :)

utils/helpers.js Outdated
@@ -81,6 +81,17 @@ export const useFeatureCounts = ({ geojson, filters }) =>
// eslint-disable-next-line
}, [geojson]);

/**
Copy link
Member Author

Choose a reason for hiding this comment

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

above is just linting, this is the hook i added

@chiaberry
Copy link
Member Author

Another feedback that John gave on the previous PR, was wondering if there was an error with the socrata query, if this "all clear" message would still appear. I tested by mangling the url for the query, and instead of this error appearing, the MapList component fails because the data munging throws errors before the page even renders.

Copy link
Member

@frankhereford frankhereford left a comment

Choose a reason for hiding this comment

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

While the signal system may not be operating normally, this PR sure is. This code looks great, and I've tested both in your preview and locally. 🚢🚢🚢

image

Copy link

@mddilley mddilley left a comment

Choose a reason for hiding this comment

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

Looks great! I no longer see the comm outage list items or filter. 🙏 🚢

components/MapList/index.js Outdated Show resolved Hide resolved
utils/helpers.js Outdated Show resolved Hide resolved
pages/signal-monitor.js Outdated Show resolved Hide resolved
Copy link
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.

this is looking great, Chia 🙏

pages/signal-monitor.js Outdated Show resolved Hide resolved
components/MapList/index.js Show resolved Hide resolved
utils/helpers.js Outdated Show resolved Hide resolved
@@ -72,6 +75,8 @@ function MapList({

const featureCounts = useFeatureCounts({ geojson, filters });

const totalFeatureCount = useTotalFeatureCount(featureCounts);
Copy link
Member

Choose a reason for hiding this comment

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

this hook looks great, but in this case i think we might be able to just check if geojson?.features.length > 0, since geojson contains the full feature array before any filters are applied?

Copy link
Member Author

Choose a reason for hiding this comment

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

It does contain the full features array which means that it also returns all of the signals with communication issues since those are still in the dataset. For example the length of total feature count right now is 1 but geojson features length is 31.

Copy link
Member

Choose a reason for hiding this comment

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

ah, i see. should be filtered in the socrata API call if we don't want them?

@@ -89,13 +94,13 @@ function MapList({
maxWidth: MAX_SMALL_SCREEN_WIDTH_PIXELS,
});

// hids overflow on the document <body> while this component is mounted #noScrollBar
// hides overflow on the document <body> while this component is mounted #noScrollBar
Copy link
Member

Choose a reason for hiding this comment

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

🥇

pages/signal-monitor.js Outdated Show resolved Hide resolved
@johnclary
Copy link
Member

@chiaberry this old dark signals link can be removed

const darkSignalsLink =

Copy link
Member Author

Choose a reason for hiding this comment

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

this is just linting now

@@ -62,6 +62,10 @@ export const SIGNAL_STATUS_QUERY = {
key: "limit",
value: "99999999",
},
{
key: "where",
value: "operation_text!='Communication issue'"
Copy link
Member Author

Choose a reason for hiding this comment

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

other option is "operation_state!='3'", but I find this easier to remember

Copy link
Member

Choose a reason for hiding this comment

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

nice—this looks good to me 🙏

@chiaberry chiaberry requested a review from johnclary June 20, 2024 20:56
Copy link
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.

thanks @chiaberry!! 🚢 🚢 🚢 🚢 🚢 🚢

@@ -62,6 +62,10 @@ export const SIGNAL_STATUS_QUERY = {
key: "limit",
value: "99999999",
},
{
key: "where",
value: "operation_text!='Communication issue'"
Copy link
Member

Choose a reason for hiding this comment

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

nice—this looks good to me 🙏

@chiaberry
Copy link
Member Author

Christina let me know this was good to merge!

@chiaberry chiaberry merged commit 85e1087 into production Jun 21, 2024
4 checks passed
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.

None yet

5 participants