-
Notifications
You must be signed in to change notification settings - Fork 21
[TSPS-704] Uses outputExpirationDate for Deletion Date in Job History page
#5451
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,13 +284,11 @@ const CompletedCell = ({ pipelineRun }: CellProps): ReactNode => { | |
| }; | ||
|
|
||
| const DataDeletionDateCell = ({ pipelineRun }: CellProps): ReactNode => { | ||
| if (!pipelineRun.timeCompleted || !(pipelineRun.status === 'SUCCEEDED')) { | ||
| if (!pipelineRun.outputExpirationDate || !(pipelineRun.status === 'SUCCEEDED')) { | ||
| return <div>N/A</div>; | ||
| } | ||
|
|
||
| const completionDate = new Date(pipelineRun?.timeCompleted); | ||
| const deletionDate = new Date(completionDate); | ||
| deletionDate.setDate(deletionDate.getDate() + TEASPOONS_FILE_OUTPUT_TTL_DAYS); | ||
| const deletionDate = new Date(pipelineRun?.outputExpirationDate); | ||
|
|
||
| const today = new Date(); | ||
| const threeDaysFromNow = new Date(); | ||
|
|
@@ -339,9 +337,12 @@ const ActionCell = ({ pipelineRun }: CellProps): ReactNode => { | |
| return <ViewErrorModal pipelineRun={pipelineRun} onDismiss={errorModal.close} />; | ||
| }); | ||
|
|
||
| const jobOutputsDeleted = | ||
| // `!!` converts the expression to a boolean | ||
| const jobOutputsDeleted = !!( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm having trouble understanding why the addition of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh goodness, sorry, that's just me not understanding what
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No worries. I did add it as a comment because javascript is confusing and I too as code author did get confused initially. |
||
| pipelineRun.status === 'SUCCEEDED' && | ||
| (hoursElapsedSinceCompletion(pipelineRun) ?? -1) > 24 * TEASPOONS_FILE_OUTPUT_TTL_DAYS; // 24 hours * 14 days | ||
| pipelineRun.outputExpirationDate && | ||
| new Date() >= new Date(pipelineRun.outputExpirationDate) | ||
| ); | ||
|
|
||
| return ( | ||
| <div> | ||
|
|
@@ -505,12 +506,3 @@ const hoursElapsedSinceSubmission = (pipelineRun: PipelineRun): number => { | |
| const currentTime = new Date(); | ||
| return (currentTime.getTime() - submittedTime.getTime()) / (1000 * 60 * 60); | ||
| }; | ||
|
|
||
| const hoursElapsedSinceCompletion = (pipelineRun: PipelineRun): number | undefined => { | ||
| if (!pipelineRun.timeCompleted) { | ||
| return undefined; | ||
| } | ||
| const completedTime = new Date(pipelineRun.timeCompleted); | ||
| const currentTime = new Date(); | ||
| return (currentTime.getTime() - completedTime.getTime()) / (1000 * 60 * 60); | ||
| }; | ||
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.
so cool to test the hover text!