diff --git a/app/resources/js/components/dashboard/DashboardPageHead.vue b/app/resources/js/components/dashboard/DashboardPageHead.vue index 2a3d621e..5133cb60 100644 --- a/app/resources/js/components/dashboard/DashboardPageHead.vue +++ b/app/resources/js/components/dashboard/DashboardPageHead.vue @@ -29,7 +29,10 @@ const props = withDefaults( const auth = useAuthStore(); /** Имя залогиненного пользователя (было захардкожено «Иван»). */ -const firstName = computed(() => auth.user?.first_name?.trim() || 'коллега'); +const firstName = computed(() => auth.user?.first_name?.trim() || ''); +// U2 (UX-аудит 25.06): без имени НЕ зовём «коллега» (звучит как к чужому) — +// приветствуем нейтрально «Доброе утро!». Имя клиент задаёт в Настройки→Профиль. +const hasName = computed(() => firstName.value !== ''); /** Приветствие по времени суток (МСК машины пользователя). */ const greeting = computed(() => { @@ -55,7 +58,8 @@ const avgCostLabel = computed(() => {

- {{ greeting }}, {{ firstName }} + {{ greeting }}

сегодня {{ leadsToday }} · вчера {{ leadsYesterday }} diff --git a/app/tests/Frontend/DashboardPageHead.spec.ts b/app/tests/Frontend/DashboardPageHead.spec.ts index 421c66b5..fd7f01f6 100644 --- a/app/tests/Frontend/DashboardPageHead.spec.ts +++ b/app/tests/Frontend/DashboardPageHead.spec.ts @@ -34,10 +34,12 @@ describe('DashboardPageHead.vue', () => { expect(greet).not.toContain('Иван'); }); - it('при отсутствии user приветствие рендерится без падения', () => { + it('без имени приветствие нейтральное, без «коллега» (U2)', () => { const wrapper = mountHead(null); - expect(wrapper.find('.page-greet').exists()).toBe(true); - expect(wrapper.find('.page-greet').text().length).toBeGreaterThan(0); + const greet = wrapper.find('.page-greet').text(); + expect(greet.length).toBeGreaterThan(0); + expect(greet).not.toContain('коллега'); + expect(greet).toContain('!'); // «Доброе утро!» — без обращения к чужому }); // F5: meta-строка раньше была захардкоженной «рыбой» (+3 / 11 / 38 / 2 248 ₽).