-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add month/year filters to payroll elements page
- Loading branch information
1 parent
0d4639e
commit 86cd179
Showing
8 changed files
with
84 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/Infrastructure/HumanResource/PayrollElements/DTO/GetPayrollElementsControllerDTO.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { IsNumber, IsOptional } from 'class-validator'; | ||
|
||
export class GetPayrollElementsControllerDTO { | ||
@IsNumber() | ||
@IsOptional() | ||
public month: number; | ||
|
||
@IsNumber() | ||
@IsOptional() | ||
public year: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { onParsed } from '../lib/customElements'; | ||
|
||
export default class extends HTMLFormElement { | ||
connectedCallback() { | ||
onParsed(() => { | ||
for (const formControl of this) { | ||
formControl.addEventListener('change', () => this.requestSubmit()); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% macro filters_form() %} | ||
<form | ||
is="pc-auto-form" | ||
method="GET" | ||
action="{{ path('people_payroll_elements') }}" | ||
class="pc-cluster pc-gap" | ||
style="--cluster-align: flex-end" | ||
> | ||
<div class="pc-select-group pc-m" style="--m: 0"> | ||
<label class="pc-label" for="month">{{ 'payroll-elements-filters-month-title'|trans }}</label> | ||
<select name="month" id="month"> | ||
{% for monthValue in range(12) %} | ||
<option value="{{ monthValue }}" {% if monthValue == month %}selected{% endif %}>{{ monthValue|longMonth|capitalize }}</option> | ||
{% endfor %} | ||
</select> | ||
</div> | ||
|
||
<div class="pc-input-group pc-m" style="--m: 0"> | ||
<label class="pc-label" for="year">{{ 'payroll-elements-filters-year-title'|trans }}</label> | ||
<input type="number" id="year" name="year" pattern="\d+" value="{{ year }}" style="--input-width: 12ch"> | ||
</div> | ||
</form> | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters