Repository navigation
fix: ui: workspace bumpers now honour template max_ttl - #3532
Conversation
There was a problem hiding this comment.
review: moved to util/workspace.ts
EDIT: actually moved to util/schedule.ts which is a more sensible place for it
There was a problem hiding this comment.
I think this should be treated as a loading state like !workspace. I'm assuming that if fetching it failed, we'll have an error.
There was a problem hiding this comment.
That's fair. Although I'd really like to be able to add information to FullScreenLoader on what's currently happening (e.g. Reticulating Splines)
There was a problem hiding this comment.
We could add a prop to FullScreenLoader that can take that info?
There was a problem hiding this comment.
That sounds like a good idea. I'll open a separate issue for that.
There was a problem hiding this comment.
It's generally better to test things that are apparent to the user than internals like whether a function was called, but sometimes it's necessary. Is this one of the cases where testing user-apparent effects is too hard?
There was a problem hiding this comment.
I'm not sure -- I'll try seeing if I can make some assertions about child components here.
There was a problem hiding this comment.
Actually, it seems like testing properties of child components is considered somewhat of an anti-pattern. I'll factor some more stuff out to a util file and test it separately.
There was a problem hiding this comment.
You don't have to change this here, but I'm wondering if we want to try to push logic like this into XState. Instead of one UPDATE_DEADLINE event, we could have multiple events that do calculations within them. The idea would be to try to get more logic out of components. Maybe a topic for Frontend Variety.
There was a problem hiding this comment.
Yeah, I was wondering that but didn't want to over-complicate the machine. :-)
There was a problem hiding this comment.
Love that you put util functions in their own spot and tested them! I noticed when I was working on the schedule form that there are a lot of different places for schedule-related util functions. Any thoughts on that? I don't want to make you figure it all out in this PR but I might at least call this util file something about the schedule instead of just the workspace.
There was a problem hiding this comment.
IMO I think it makes sense to keep it in the workspace util file, as workspaces and schedules are tightly coupled. If we eventually move schedules into more of a separate entity of their own, then maybe I could see it making more sense.
EDIT: Silly me, I forgot about util/schedule.ts. Moving things in there.
presleyp
left a comment
There was a problem hiding this comment.
Great work! The loading state is the only thing I feel strongly about.
3a16557 to
e69ff7f
Compare
util/schedule.tsand unit test separatelyVerification Steps:
Fixes #2764.