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

1280: Simplified planning form. Added default value #112

Merged
merged 21 commits into from
May 3, 2024

Conversation

tuj
Copy link
Contributor

@tuj tuj commented May 1, 2024

Link to ticket

https://leantime.itkdev.dk/#/tickets/showTicket/1280

Description

Simplified planning form. Added default value.

Checklist

  • My code is covered by test cases.
  • My code passes our test (all our tests).
  • My code passes our static analysis suite.
  • My code passes our continuous integration process.

@tuj tuj self-assigned this May 1, 2024
@tuj tuj added the enhancement New feature or request label May 1, 2024
@tuj tuj requested a review from yepzdk May 1, 2024 06:29
@rimi-itk rimi-itk self-requested a review May 3, 2024 11:12
Comment on lines 27 to 28
const { x } = scrollToColumn.getBoundingClientRect();
const { x: firstColumnX } = firstColumn.getBoundingClientRect();
Copy link
Contributor

Choose a reason for hiding this comment

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

It took me a while to actually understand what's going on here.

Suggested change
const { x } = scrollToColumn.getBoundingClientRect();
const { x: firstColumnX } = firstColumn.getBoundingClientRect();
const x = scrollToColumn.getBoundingClientRect().x;
const firstColumnX = firstColumn.getBoundingClientRect().x;

is much easier to understand.

Copy link
Contributor

Choose a reason for hiding this comment

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

Changed it. Thanks for the suggestion.

@@ -378,6 +377,7 @@ public function getPlanningDataWeeks(): PlanningData
$weeks = $planning->weeks;

$currentYear = (int) (new \DateTime())->format('Y');
$currentWeek = (int) (new \DateTime())->format('W');

for ($weekNumber = 1; $weekNumber <= 52; ++$weekNumber) {
Copy link
Contributor

@rimi-itk rimi-itk May 3, 2024

Choose a reason for hiding this comment

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

A year can actually have 53 weeks (cf. https://en.wikipedia.org/wiki/ISO_week_date#Weeks_per_year), and the year 2026 (in the near future is one of them), so this should be rewritten to iterate over all weeks in the year (or use https://stackoverflow.com/a/21480444).

Copy link
Contributor

Choose a reason for hiding this comment

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

I can't take credit for this. So, I have pasted your suggestion into a comment.

Copy link
Contributor

@rimi-itk rimi-itk left a comment

Choose a reason for hiding this comment

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

Approved with a couple of comments.

@yepzdk yepzdk requested review from rimi-itk and removed request for yepzdk May 3, 2024 11:40
@rimi-itk rimi-itk merged commit 35ecbff into develop May 3, 2024
9 checks passed
@rimi-itk rimi-itk deleted the feature/1280-simplifying-planning-form branch May 3, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants