Skip to content

Commit

Permalink
Merge pull request #255 from fairnesscoop/feat/add-illimited-leaves
Browse files Browse the repository at this point in the history
Add illimlited leave type
  • Loading branch information
mmarchois authored Apr 29, 2022
2 parents df0fb2b + aaa09b3 commit 2108a72
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
6 changes: 4 additions & 2 deletions client/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}
},
"accounting": {
"breadcrumb": "Gestion & Comptabilité",
"breadcrumb": "FairGestion",
"invoices": {
"title": "Factures",
"date": "Date",
Expand Down Expand Up @@ -229,6 +229,7 @@
"leave_paid": "Congé payé",
"leave_unpaid": "Congé sans solde",
"leave_special": "Congé exceptionnel",
"leave_illimited": "Congé illimité",
"other": "Autres"
},
"filter": {
Expand All @@ -248,7 +249,7 @@
}
},
"human_resources": {
"breadcrumb": "RH",
"breadcrumb": "FairRH",
"meal_tickets": {
"breadcrumb": "Tickets Restaurant",
"title": "Tickets Restaurant - {month}",
Expand Down Expand Up @@ -292,6 +293,7 @@
"title": "Type de congé",
"medical": "Congé maladie",
"paid": "Congé payé",
"illimited": "Congé illimité",
"unpaid": "Congé sans solde",
"special": "Congé exceptionnel"
},
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/Nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,17 @@
<li class={subLinkClass}>
<a
class="w-full"
href="human_resources/meal_tickets">{$_('human_resources.meal_tickets.breadcrumb')}</a>
href="human_resources/leaves">{$_('human_resources.leaves.title')}</a>
</li>
<li class={subLinkClass}>
<a
class="w-full"
href="human_resources/users">{$_('human_resources.users.title')}</a>
href="human_resources/meal_tickets">{$_('human_resources.meal_tickets.breadcrumb')}</a>
</li>
<li class={subLinkClass}>
<a
class="w-full"
href="human_resources/leaves">{$_('human_resources.leaves.title')}</a>
href="human_resources/users">{$_('human_resources.users.title')}</a>
</li>
{/if}
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import Input from 'components/inputs/Input.svelte';
const dispatch = createEventDispatcher();
const types = ['paid', 'unpaid', 'medical', 'special'];
const types = ['paid', 'unpaid', 'medical', 'special', 'illimited'];
export let type = 'paid';
export let startDate = '';
Expand Down
19 changes: 19 additions & 0 deletions server/migrations/1651234850677-IllimitedLeaveType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {MigrationInterface, QueryRunner} from "typeorm";

export class IllimitedLeaveType1651234850677 implements MigrationInterface {
name = 'IllimitedLeaveType1651234850677'

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TYPE "leave_request_type_enum" RENAME TO "leave_request_type_enum_old"`);
await queryRunner.query(`CREATE TYPE "leave_request_type_enum" AS ENUM('paid', 'unpaid', 'special', 'medical', 'illimited')`);
await queryRunner.query(`ALTER TABLE "leave_request" ALTER COLUMN "type" TYPE "leave_request_type_enum" USING "type"::"text"::"leave_request_type_enum"`);
await queryRunner.query(`DROP TYPE "leave_request_type_enum_old"`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TYPE "leave_request_type_enum_old" AS ENUM('paid', 'unpaid', 'special', 'medical')`);
await queryRunner.query(`ALTER TABLE "leave_request" ALTER COLUMN "type" TYPE "leave_request_type_enum_old" USING "type"::"text"::"leave_request_type_enum_old"`);
await queryRunner.query(`DROP TYPE "leave_request_type_enum"`);
await queryRunner.query(`ALTER TYPE "leave_request_type_enum_old" RENAME TO "leave_request_type_enum"`);
}
}
3 changes: 2 additions & 1 deletion server/src/Domain/HumanResource/Leave/LeaveRequest.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export enum Type {
PAID = 'paid',
UNPAID = 'unpaid',
SPECIAL = 'special',
MEDICAL = 'medical'
MEDICAL = 'medical',
ILLIMITED = 'illimited',
}

@Entity()
Expand Down

0 comments on commit 2108a72

Please sign in to comment.