-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: list of flows should display and be sorted by most recent operations, not flows.updated_at
#3241
Conversation
|
||
export const formatLastPublishMessage = (date: string, user: string): string => | ||
`Last published ${formatLastEditDate(date)} ago by ${user}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a small tidy up so that all of the helper methods that rely on formatDistanceToNow()
are co-located in the same file
Removed vultr server and associated DNS entries |
b.operations[0]["createdAt"].localeCompare( | ||
a.operations[0]["createdAt"], | ||
), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, we sorted directly via the GraphQL query like flows (order_by: { updated_at: desc }) {...}
- but we want to sort via operations, not flows, so now we're doing a custom sort here !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: possibly good use for ToSorted() to copy and sort array with one method
flows.updated_at
flows.updated_at
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely code! Added "nit" comment
b.operations[0]["createdAt"].localeCompare( | ||
a.operations[0]["createdAt"], | ||
), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: possibly good use for ToSorted() to copy and sort array with one method
Changes:
August mentioned that it's really disorienting that all the flows within a team now show the same "Edited 5 days ago" timestamp - this is because this message was referencing
flows.updated_at
which changed whenflows.status
merged and is updated, whereas we really think about "edits" to a flow coming from the associatedoperations
.Now updated to display based on
operations
, sharing the same formatting as in-graph view of "Last edited..." too. This means that both the list & graph timestamps will now match (previously they didn't 🙈), and that the list timestamps now ignore bulk flow migrations or non-data changes like renaming, toggling status, etc.See thread: https://opensystemslab.slack.com/archives/C5Q59R3HB/p1717571853477949
Testing:
Click into a flow, edit the graph data, click back out to the list of services within the team and confirm it's at the top of the list with a correct "Last edited {at} by {user}" message.
Note that real
operations
are not synced from production to other environments (staging, local, pizza), so you won't see a first and last name associated with the timestamp on the pizza until new edits are made. Only production has a full history!