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

feat(operator): Add Org DeleteOn and Account CancelledAt dates #6736

Merged
merged 2 commits into from
Jun 21, 2023

Conversation

abshierjoel
Copy link
Contributor

Quartz now optionally includes the date an account was cancelled as well as the date a suspended org will be deleted on. We're going to show these in the UI.

Checklist

Authors and Reviewer(s), please verify the following:

  • A PR description, regardless of the triviality of this change, that communicates the value of this PR
  • Well-formatted conventional commit messages that provide context into the change
  • Documentation updated or issue created (provide link to issue/PR)
  • Signed CLA (if not already signed)
  • Feature flagged, if applicable

@abshierjoel abshierjoel requested a review from a team as a code owner June 20, 2023 20:15
@wdoconnell
Copy link
Contributor

Taking a look now

wdoconnell
wdoconnell previously approved these changes Jun 20, 2023
const deleteOn = organization?.deleteOn
? new Date(organization?.deleteOn)
: null

Copy link
Contributor

Choose a reason for hiding this comment

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

One possibility here is that the deleteOn string exists but isn't valid, so new Date evaluates to NaN. That would cause any methods chained off deleteOn to fail, but you should be fine here since [whatever conditions] && NaN is falsy, so the code that relies on those chained methods will not render.

What could be more explicit (and defer to you on which you prefer) would be to separate the variable that gates whether to render the data from the data that is being rendered, so that we know the rendering condition can only be true or false.

const deleteOn = organization?.deleteOn ? new Date(organization?.deleteOn) : null
const hasDeleteDate = Boolean(deleteOn)

And then make the condition for rendering hasDeleteDate

But up to you - I've done some testing here and both should have the same effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I think that's probably a good change. Plus hasDeleteDate is a better name for a rendering condition than just the truthiness of deleteOn

: 'N/A'
}
testID="cancelled-at"
/>
</FlexBox>
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good; but if you change anything based on the above comment, this component should have the same logic. 👍

Copy link
Contributor

@wdoconnell wdoconnell left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for considering the comment.

@abshierjoel abshierjoel added this pull request to the merge queue Jun 21, 2023
Merged via the queue into master with commit 8666a79 Jun 21, 2023
1 check passed
@abshierjoel abshierjoel deleted the add-delete-cancelled-dates branch June 21, 2023 19:24
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.

2 participants