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

2033: Sync worklogs from invoice entry #147

Merged
merged 43 commits into from
Aug 14, 2024

Conversation

jeppekroghitk
Copy link
Contributor

@jeppekroghitk jeppekroghitk commented Aug 8, 2024

Link to ticket

https://leantime.itkdev.dk/?tab=ticketdetails#/tickets/showTicket/2033

Description

When adding worklogs to an invoice entry, a button should be displayed to sync worklogs to the project, ensuring that all worklogs are synced when needed.

Screenshot of the result

Screenshot 2024-08-08 at 13 07 43

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.

@jeppekroghitk jeppekroghitk marked this pull request as draft August 8, 2024 09:25
@jeppekroghitk jeppekroghitk changed the base branch from develop to feature/2034-invoice-date-select-continuity August 8, 2024 09:26
@jeppekroghitk jeppekroghitk force-pushed the feature/2034-invoice-date-select-continuity branch from 80ad37b to 4886af4 Compare August 8, 2024 11:27
@jeppekroghitk jeppekroghitk force-pushed the feature/2033-sync-worklogs-from-invoice-entry branch from e5f6566 to 8131b98 Compare August 8, 2024 11:29
@jeppekroghitk jeppekroghitk marked this pull request as ready for review August 8, 2024 12:37
@jeppekroghitk jeppekroghitk requested a review from tuj August 8, 2024 12:50
/**
* @throws EconomicsException
*/
#[Route('/{projectId}/sync', name: 'app_invoice_entry_project_worklogs_sync', methods: ['POST'])]
Copy link
Contributor

Choose a reason for hiding this comment

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

Use route in project controller instead

</svg>
`;

fetch(this.updateUrl, {
Copy link
Contributor

Choose a reason for hiding this comment

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

Move to js util file

this.updateUrl = this.element.dataset.updateUrl;
}

syncWorklogs(e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Cleanup implementation so html is in the twig component and this controller just changes state of the html

let successText = syncButton.dataset.successtext;
syncButton.disabled = true;
syncButton.innerHTML = `
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor" className="size-6">
Copy link
Contributor

Choose a reason for hiding this comment

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

use components/icons.html.twig instead

@jeppekroghitk jeppekroghitk requested a review from tuj August 12, 2024 08:12
Copy link
Contributor

@tuj tuj left a comment

Choose a reason for hiding this comment

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

Looking good.
Minor issue

@@ -1,6 +1,12 @@
<header class="w-full flex justify-between items-center">
<h1 class="page-title">{{ title }}</h1>
{% if link_url|default(false) %}
Copy link
Contributor

Choose a reason for hiding this comment

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

This change requires that you change the other parts that use:
components/page-header.html.twig
otherwise, they will not display the link

@jeppekroghitk jeppekroghitk force-pushed the feature/2034-invoice-date-select-continuity branch from cfd3b9c to d46cd1e Compare August 13, 2024 07:19
@jeppekroghitk jeppekroghitk requested a review from tuj August 13, 2024 09:13
@jeppekroghitk jeppekroghitk force-pushed the feature/2034-invoice-date-select-continuity branch from 21c1145 to 2a6f11e Compare August 13, 2024 09:27
Base automatically changed from feature/2034-invoice-date-select-continuity to develop August 14, 2024 07:48
@jeppekroghitk jeppekroghitk merged commit e6bc4fe into develop Aug 14, 2024
9 checks passed
@jeppekroghitk jeppekroghitk deleted the feature/2033-sync-worklogs-from-invoice-entry branch August 14, 2024 07:48
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