Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

Overview

Adds manager interface for reviewing and approving/rejecting employee absence requests. Backend endpoints already exist at /absence-requests/inbox, /mine, /{id}/approve, /{id}/reject.

Implementation

Module Structure (modules/absence-requests/)

  • Container: Dual-view component (manager inbox / employee's requests)
  • Table: mtx-grid with status-based action columns
  • Modals: Approve/reject dialogs with optional comment fields

Service (TimePlanningPnAbsenceRequestsService)

  • Wraps existing C# endpoints
  • Uses current user ID from auth state as SDK site ID parameter

Auth Integration

// Frontend auth state doesn't export selectCurrentUserId
// Use selectAuthUser and extract id property instead
this.store.select(selectAuthUser).pipe(take(1)).subscribe((user) => {
  this.currentUserId = user?.id || null;
});

Routing

  • Added /absence-requests route with lazy-loaded module
  • Direct URL navigation in tests (no menu entries in backend yet)

Testing

  • Cypress e2e tests in l/ directory with required SQL setup files
  • Tests handle mtx-grid structure and empty data states
  • Jest unit tests for service methods
  • Added l to test matrix in both PR and master pipelines

Note: Backend menu configuration in EformTimePlanningPlugin.cs not included - route is functional but menu navigation requires separate backend update.

Original prompt

This section details on the original issue you should resolve

<issue_title>Implement angular component for AbsenceRequests</issue_title>
<issue_description>In order for a manager to approve/reject and see all AbsenceRequests we need a component to list all AbsenceRequests.

It needs to follow same patteren as other mtx-grid tables with filtering and and search.

We need cypress e2e tests and angular unit tests.

The user should be able to accept/reject a AbsenceRequests.

Use the already implemented C# parts for implmenting the angular parts.</issue_description>

<agent_instructions>Follow github workflow for running the tests and checking that everything compiles.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits January 30, 2026 16:07
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement Angular component for AbsenceRequests Implement AbsenceRequests management UI with approve/reject workflow Jan 30, 2026
Copilot AI requested a review from renemadsen January 30, 2026 16:18
Copilot AI and others added 3 commits January 30, 2026 17:01
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Copilot AI changed the title Implement AbsenceRequests management UI with approve/reject workflow Add absence requests test suite and integrate auth state Jan 30, 2026
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Copilot AI changed the title Add absence requests test suite and integrate auth state Add AbsenceRequests component with manager inbox and approval workflow Jan 30, 2026
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Copilot AI changed the title Add AbsenceRequests component with manager inbox and approval workflow Implement AbsenceRequests management UI with manager approval workflow Jan 30, 2026
Copy link
Member

@renemadsen renemadsen left a comment

Choose a reason for hiding this comment

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

@copilot look at the comments and fix accordingly

Copy link
Member

Choose a reason for hiding this comment

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

This needs to follow the same design as this one eform-client/cypress/e2e/plugins/time-planning-pn/b/activate-plugin.spec.cy.ts

Also the names needs to be the same for follow same order.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated activate-plugin.spec.cy.ts to match the design from b/activate-plugin.spec.cy.ts. The test now follows the same structure with the describe block "Enable Backend Config plugin" and test case "should enabled Time registration plugin". (commit 0810477)

Copy link
Member

Choose a reason for hiding this comment

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

In order for this file to run after the plugin have been activated, the filename needs to be something that alphabetically comes after activate-plugin.spec.cy.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed absence-requests.spec.cy.ts to time-planning-absence-requests.spec.cy.ts so it runs alphabetically after both activate-plugin.spec.cy.ts and assert-true.spec.cy.ts. (commit 0810477)

…ry and rename absence-requests test for proper alphabetical ordering

Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
.should('be.visible')
.click({ force: true });

cy.get('#plugin-settings-link0').click({ force: true });
Copy link
Member

Choose a reason for hiding this comment

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

@copilot Why are we trying to navigate to the plugin settings, when we should be navigating to the index of abscenes requests?
Have we changed the C# code to include the menu entries for abscense requests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're correct - the C# backend does not have menu entries for Absence Requests in EformTimePlanningPlugin.cs. The Angular route exists at /plugins/time-planning-pn/absence-requests, but the menu configuration was not added to the backend plugin.

Updated the test to navigate directly to the URL (cy.visit('http://localhost:4200/plugins/time-planning-pn/absence-requests')) instead of trying to click through non-existent menu items. This allows the tests to run successfully while the backend menu integration can be added separately. (commit d897da2)

…f menu navigation

Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Copilot AI changed the title Implement AbsenceRequests management UI with manager approval workflow Implement AbsenceRequests management UI with approval workflow Jan 31, 2026
@renemadsen renemadsen marked this pull request as ready for review January 31, 2026 06:45
@renemadsen renemadsen merged commit 8683b4e into master Jan 31, 2026
16 checks passed
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.

Implement angular component for AbsenceRequests

2 participants