Compare commits
3
Commits
0b8424503c
...
bc5ee50bd5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc5ee50bd5 | ||
|
|
42134284e7 | ||
|
|
f5d592ea5e |
No files matched your search
@@ -16,7 +16,7 @@ This is a single-context repo using root `CONTEXT.md` and `docs/adr/`. See `docs
|
||||
|
||||
- `develop` is the default integration branch; `main` contains releases. Start `feature/*` branches from the current `origin/develop` and target their PRs to `develop`.
|
||||
- Rebase working branches onto the latest `origin/develop` before opening or merging a PR. If `develop` advances, rebase and rerun the PR checks before merging.
|
||||
- Integrate through PRs with successful required checks and merges restricted to designated maintainers through Gitea's merge allowlist. Use merge commits (`--no-ff`) with squashing disabled. Direct and forced pushes to `main` and `develop` are forbidden.
|
||||
- Integrate through PRs with successful required checks and merges restricted to designated maintainers through Gitea's merge allowlist. The `develop` allowlist also admits the `renovate` bot, which automerges minor, patch, digest, and pin updates once `required` passes; major updates stay manual. Use merge commits (`--no-ff`) with squashing disabled. Direct and forced pushes to `main` and `develop` are forbidden.
|
||||
- Use Conventional Commits for new commits and PR titles.
|
||||
- Create `release/X.Y.Z` from `develop` and `hotfix/X.Y.Z` from `main`. Only `release/*` and `hotfix/*` PRs target `main`. Merge each release or hotfix into both `main` and `develop`, keeping its branch until both PRs are merged.
|
||||
- Use merges and back-merges for releases and hotfixes. Never rebase `main`, `develop`, or a frozen release branch.
|
||||
|
||||
@@ -286,7 +286,7 @@ git push origin v1.6.0
|
||||
|
||||
The tag must match the tagged commit's `package.json` version, use stable `vMAJOR.MINOR.PATCH` syntax, and point to a commit reachable from `main`. Wait for the main checks and image publication before tagging: promotion requires its `sha-<commit>` image. Tags do not increment the version automatically.
|
||||
|
||||
The Gitea repository policy requires `develop` as the default branch and **Merge commit** as the merge method, with squash and rebase merge methods disabled. Configure [branch protection](https://docs.gitea.com/usage/access-control/protected-branches/) for `main` and `develop` to disable direct and forced pushes, restrict the merge allowlist to designated maintainers, require successful status checks, and block outdated PRs. Administrators must follow the protection rules. After merge-message approval and a successful reviewed PR run, replace the migration gate with the reported pull-request context for the `required` job, as described in the activation guide. These are required settings; the migration does not establish that every setting has already been applied.
|
||||
The Gitea repository policy requires `develop` as the default branch and **Merge commit** as the merge method, with squash and rebase merge methods disabled. Configure [branch protection](https://docs.gitea.com/usage/access-control/protected-branches/) for `main` and `develop` to disable direct and forced pushes, restrict the merge allowlist to designated maintainers, require successful status checks, and block outdated PRs. Administrators must follow the protection rules. The `develop` allowlist also admits the `renovate` bot: [renovate.json](renovate.json) automerges minor, patch, digest, and pin updates three days after their release once the `required` check passes, and leaves major updates for manual review. After merge-message approval and a successful reviewed PR run, replace the migration gate with the reported pull-request context for the `required` job, as described in the activation guide. These are required settings; the migration does not establish that every setting has already been applied.
|
||||
|
||||
Only `release/*` and `hotfix/*` PRs may target `main`; working PRs target `develop`. CI validates these rules and checks working-branch rebases against the fetched integration head. If `develop` advances after validation, rebase and rerun the PR checks before merging.
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
"": {
|
||||
"name": "vac-optimizer",
|
||||
"dependencies": {
|
||||
"@angular/animations": "22.2.3",
|
||||
"@angular/cdk": "^22.0.0",
|
||||
"@angular/common": "22.2.3",
|
||||
"@angular/compiler": "22.2.3",
|
||||
@@ -54,8 +53,6 @@
|
||||
|
||||
"@angular-devkit/schematics": ["@angular-devkit/schematics@22.2.3", "", { "dependencies": { "@angular-devkit/core": "22.2.3", "jsonc-parser": "3.3.1", "magic-string": "1.4.1", "ora": "9.4.1", "rxjs": "7.8.2" } }, "sha512-+XfBViIGqiFQK8KJXA6PgANX9tLuMO/x8GFjlzEmA4LIe9ikAtpGZw+Ezo547BIJQoJBIKCJYR0knE4BmbFeSQ=="],
|
||||
|
||||
"@angular/animations": ["@angular/animations@22.2.3", "", { "dependencies": { "tslib": "^2.3.0" }, "peerDependencies": { "@angular/core": "22.2.3" } }, "sha512-sslKnTrKwHwtTvT/pWj7UoYq0cfuX3PijZM7v0JtCajQkK1Nj0Ljob0mebxXBXUVBrOixfCnfBS0EG4JNEznFA=="],
|
||||
|
||||
"@angular/build": ["@angular/build@22.2.3", "", { "dependencies": { "@ampproject/remapping": "2.3.0", "@angular-devkit/architect": "0.2202.3", "@babel/core": "8.0.5", "@inquirer/confirm": "6.3.2", "@parcel/watcher": "2.6.0", "@vitejs/plugin-basic-ssl": "2.3.0", "beasties": "0.5.4", "browserslist": "^4.26.0", "chokidar": "5.0.0", "esbuild": "0.28.2", "https-proxy-agent": "9.1.0", "jsonc-parser": "3.3.1", "listr2": "11.1.0", "magic-string": "1.4.1", "mrmime": "2.0.1", "oxc-parser": "0.150.0", "parse5-html-rewriting-stream": "8.0.1", "picomatch": "4.0.7", "piscina": "5.3.2", "rolldown": "1.2.8", "sass": "1.104.1", "sass-embedded": "1.104.1", "semver": "7.8.5", "source-map-support": "0.5.21", "tinyglobby": "0.2.17", "vite": "8.3.0", "xxhash-wasm": "1.1.0" }, "optionalDependencies": { "lmdb": "3.5.6" }, "peerDependencies": { "@angular/compiler": "^22.0.0", "@angular/compiler-cli": "^22.0.0", "@angular/core": "^22.0.0", "@angular/localize": "^22.0.0", "@angular/platform-browser": "^22.0.0", "@angular/platform-server": "^22.0.0", "@angular/service-worker": "^22.0.0", "@angular/ssr": "^22.2.3", "istanbul-lib-instrument": "^6.0.0", "karma": "^6.4.0", "less": "^4.2.0", "ng-packagr": "^22.0.0", "postcss": "^8.4.0", "rollup": "^4.0.0", "tailwindcss": "^2.0.0 || ^3.0.0 || ^4.0.0", "tslib": "^2.3.0", "typescript": ">=6.0 <6.1", "vitest": "^4.0.8 || ^5.0.0" }, "optionalPeers": ["@angular/core", "@angular/localize", "@angular/platform-browser", "@angular/platform-server", "@angular/service-worker", "@angular/ssr", "istanbul-lib-instrument", "karma", "less", "ng-packagr", "postcss", "rollup", "tailwindcss", "vitest"] }, "sha512-EtNEuPBUCyIuzdXrQ/nINvgFzW8bUI5AkAZtJiSn7nsFOlvaygaKN0kENNTO3zRl3T9B4GDog+Ks5Nec3FBkhg=="],
|
||||
|
||||
"@angular/cdk": ["@angular/cdk@22.2.1", "", { "dependencies": { "parse5": "^8.0.0", "tslib": "^2.3.0" }, "peerDependencies": { "@angular/common": "^22.0.0 || ^23.0.0", "@angular/core": "^22.0.0 || ^23.0.0", "@angular/forms": "^22.0.0 || ^23.0.0", "@angular/platform-browser": "^22.0.0 || ^23.0.0", "rxjs": "^6.5.3 || ^7.4.0" } }, "sha512-0vjlqYBbLif1EwHhKz2r4thTDvtRI2CKi2js9TzPRD0n4VlFUnAXaaW47s5TCCObIoYun6Bo1zZ0uPgwb+qEMw=="],
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "22.2.3",
|
||||
"@angular/cdk": "^22.0.0",
|
||||
"@angular/common": "22.2.3",
|
||||
"@angular/compiler": "22.2.3",
|
||||
|
||||
+14
-1
@@ -4,5 +4,18 @@
|
||||
"config:recommended"
|
||||
],
|
||||
"prConcurrentLimit": 3,
|
||||
"automerge": false
|
||||
"automerge": false,
|
||||
"automergeStrategy": "merge-commit",
|
||||
"minimumReleaseAge": "3 days",
|
||||
"packageRules": [
|
||||
{
|
||||
"matchUpdateTypes": [
|
||||
"minor",
|
||||
"patch",
|
||||
"digest",
|
||||
"pin"
|
||||
],
|
||||
"automerge": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { provideZonelessChangeDetection } from '@angular/core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { vi } from '../../testing/vitest-compat';
|
||||
import { CalendarService } from './calendar-service';
|
||||
import { CalendarService, SelectableDayType } from './calendar-service';
|
||||
import { CalendarSettingsService } from './calendar-settings-service';
|
||||
import type {
|
||||
PlanOutcome,
|
||||
@@ -11,6 +11,7 @@ import type {
|
||||
PlanningReason,
|
||||
} from './leave-planner.service';
|
||||
import { PlanningCalculationService } from './planning-calculation.service';
|
||||
import { RuleService, RuleType } from './rule-service';
|
||||
import { UserInputService } from './user-input-service';
|
||||
|
||||
function deferred<T>() {
|
||||
@@ -119,6 +120,33 @@ describe('PlanningCalculationService', () => {
|
||||
expect(submission.labels).toBeDefined();
|
||||
});
|
||||
|
||||
it('hands TIME_WINDOW rules the picked calendar dates east of Paris', () => {
|
||||
const previousTimeZone = process.env['TZ'];
|
||||
process.env['TZ'] = 'Pacific/Auckland';
|
||||
try {
|
||||
TestBed.inject(RuleService).addRule({
|
||||
id: 'christmas',
|
||||
name: 'Christmas',
|
||||
type: RuleType.TIME_WINDOW,
|
||||
enabled: true,
|
||||
force: 'obligation',
|
||||
startDate: new Date(2026, 11, 20),
|
||||
endDate: new Date(2026, 11, 31),
|
||||
placeDays: 3,
|
||||
placeType: SelectableDayType.CP,
|
||||
});
|
||||
queue(fakeCalculation('first'));
|
||||
service.start();
|
||||
const submitted = create.mock.calls[0][0].rules.find(
|
||||
(rule: { id: string }) => rule.id === 'christmas',
|
||||
);
|
||||
expect(submitted).toMatchObject({ startDate: '2026-12-20', endDate: '2026-12-31' });
|
||||
} finally {
|
||||
// bun test defaults to UTC without setting TZ; deleting it would fall back to the host zone.
|
||||
process.env['TZ'] = previousTimeZone ?? 'UTC';
|
||||
}
|
||||
});
|
||||
|
||||
it('reports the stage and submission of the latest calculation only, until Cancel', () => {
|
||||
queue(fakeCalculation('old'), fakeCalculation('latest'));
|
||||
service.start();
|
||||
|
||||
@@ -11,7 +11,7 @@ import type {
|
||||
PlanningRequest,
|
||||
PlanningSnapshot,
|
||||
} from './leave-planner.service';
|
||||
import { RuleService } from './rule-service';
|
||||
import { RuleService, RuleType } from './rule-service';
|
||||
import { TranslationService } from './translation-service';
|
||||
import { UserInputService } from './user-input-service';
|
||||
|
||||
@@ -85,7 +85,15 @@ export class PlanningCalculationService {
|
||||
: undefined,
|
||||
expiryDate: dayjs(balance.expiryDate).format('YYYY-MM-DD'),
|
||||
})),
|
||||
rules: this.rules.rules,
|
||||
rules: this.rules.rules.map((rule) =>
|
||||
rule.type === RuleType.TIME_WINDOW
|
||||
? {
|
||||
...rule,
|
||||
startDate: dayjs(rule.startDate).format('YYYY-MM-DD'),
|
||||
endDate: dayjs(rule.endDate).format('YYYY-MM-DD'),
|
||||
}
|
||||
: rule,
|
||||
),
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user