From 0b05d64cb99d02c9af2e1c0bcc6b14a955f613c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?John=20Molakvo=C3=A6?=
<14975046+skjnldsv@users.noreply.github.com>
Date: Tue, 17 Nov 2026 15:02:36 +0100
Subject: [PATCH] fix(profile): trim one's own profile and make its links
visible
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
On one's own profile the vacation card repeated the full ledger of My
leave, the contract card dated the same day twice when the working
pattern began on the start date, and the visibility note spoke of "this
person". The holidays link looked like plain text and the region field's
"Change" button gave no hint of what it does.
One's own profile now shows the balance ring and a link to My leave;
managers and HR keep the ledger on someone else's profile. The "Since"
line is left out when it is the start date, the note says "you, your
manager and HR" to the person, the links use the primary colour, and
the region field says it sets your public holidays, with a Save button
that first shows the change dialog.
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
---
SPECIFICATION.md | 10 +++++---
src/components/RegionCodeField.vue | 4 ++--
src/utils/contract.spec.ts | 16 ++++++++++++-
src/utils/contract.ts | 11 +++++++++
src/views/ProfileView.vue | 37 +++++++++++++++++++++++++-----
5 files changed, 66 insertions(+), 12 deletions(-)
diff --git a/SPECIFICATION.md b/SPECIFICATION.md
index 1ffcd736..5b9e4ede 100644
--- a/SPECIFICATION.md
+++ b/SPECIFICATION.md
@@ -1739,9 +1739,13 @@ NcContent(app-name="absence")
(filter form + CSV buttons), plus entitlement / leave-type / holiday management.
- **Profile** (`#/profile`, `#/profile/:uid`) — the first entry of the navigation. The person's
vacation balance and next leave (HR edits the vacation days there with the entitlement
- editor of the Employees list, §13), their region code (editable by the person, with the
- change dialog of §7.2), the number of public holidays this year and the next ones, the
- contract (§6.4: read-only, editable by HR), sick days this year (HR only when sick
+ editor of the Employees list, §13): on one's own profile the ring and a link to *My
+ leave* for the details, on someone else's the ring with its ledger. Their region code
+ (editable by the person: *Save* first shows the change dialog of §7.2), the number of
+ public holidays this year and the next ones with a link to the list, the
+ contract (§6.4: read-only, editable by HR; the "Since" line of today's working pattern is
+ left out when it began on the start date, and the note says who sees it, "you, your
+ manager and HR" on one's own profile), sick days this year (HR only when sick
leave is a confidential type, §5.7), and the history of
changes (the person and HR only). The person, their manager and HR may open it
(`GET /api/profiles/{uid}`), the same rule as balances. An account that does not
diff --git a/src/components/RegionCodeField.vue b/src/components/RegionCodeField.vue
index f0455e42..4ee16976 100644
--- a/src/components/RegionCodeField.vue
+++ b/src/components/RegionCodeField.vue
@@ -12,10 +12,10 @@
:modelValue="code"
:label="t('absence', 'My region code')"
:error="code !== '' && !codeValid"
- :helperText="code !== '' && !codeValid ? t('absence', 'Use a country like DE or a region like DE-BY') : ''"
+ :helperText="code !== '' && !codeValid ? t('absence', 'Use a country like DE or a region like DE-BY') : t('absence', 'Sets your public holidays')"
@update:modelValue="code = String($event)" />
diff --git a/src/utils/contract.spec.ts b/src/utils/contract.spec.ts
index 3c55128b..61418853 100644
--- a/src/utils/contract.spec.ts
+++ b/src/utils/contract.spec.ts
@@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { describe, expect, it } from 'vitest'
-import { contractDiff, describePeriod, weekdaysOn } from './contract.ts'
+import { contractDiff, describePeriod, patternSince, weekdaysOn } from './contract.ts'
const fullTime = { from: '2024-03-01', weekdays: [1, 2, 3, 4, 5], percent: 100 }
const fourDays = { from: '2026-07-01', weekdays: [1, 2, 3, 4], percent: 80 }
@@ -43,3 +43,17 @@ describe('contractDiff', () => {
expect(contractDiff([], [fullTime])).toEqual({ removed: [], added: [fullTime], kept: [] })
})
})
+
+describe('patternSince', () => {
+ it('dates a pattern that began after the start', () => {
+ expect(patternSince(fourDays.from, fullTime.from)).toBe('2026-07-01')
+ })
+
+ it('leaves the date out when the pattern began on the start date', () => {
+ expect(patternSince(fullTime.from, '2024-03-01')).toBeNull()
+ })
+
+ it('dates the pattern when there is no start date', () => {
+ expect(patternSince(fullTime.from, null)).toBe('2024-03-01')
+ })
+})
diff --git a/src/utils/contract.ts b/src/utils/contract.ts
index 8434fad1..529acc3a 100644
--- a/src/utils/contract.ts
+++ b/src/utils/contract.ts
@@ -54,3 +54,14 @@ export function contractDiff
- {{ t('absence', 'Since {date}', { date: formatDate(current.from) }) }}
+
+ {{ t('absence', 'Since {date}', { date: formatDate(since) }) }}
@@ -130,7 +138,7 @@
- {{ t('absence', 'Set by HR. Visible to this person, their manager and HR.') }}
+ {{ profile.self ? t('absence', 'Set by HR. Visible to you, your manager and HR.') : t('absence', 'Set by HR. Visible to this person, their manager and HR.') }}
{{ t('absence', 'Vacation {year}', { year: profile.holidays.year }) }}
-