Compare commits

...

4 Commits

Author SHA1 Message Date
6c75ce1f09 BRM-120: причина выключенной отправки на главной — один раз
All checks were successful
peppa/lint lint: success за 1с
peppa/test test: success за 2с
ci / checks (pull_request) Successful in 10s
deploy / deploy (pull_request) Successful in 30s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-18 00:00:31 +05:00
56446bc16d Merge pull request 'BRM-118: причины недоступных кнопок на «Сводке» и в письме' (#113) from task/brm-118 into main
All checks were successful
peppa/lint lint: success за 0с
peppa/test test: success за 4с
ci / checks (push) Successful in 11s
deploy / deploy (push) Successful in 24s
2026-11-17 23:59:56 +05:00
0fddfaf858 BRM-118: память
All checks were successful
peppa/lint lint: success за 0с
peppa/test test: success за 3с
ci / checks (pull_request) Successful in 28s
deploy / deploy (pull_request) Successful in 16s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 23:52:55 +05:00
82d292c674 BRM-118: у недоступных кнопок «Сводки» всплывающая подсказка — та же причина, что рядом
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 23:52:55 +05:00
8 changed files with 11 additions and 5 deletions

View File

@ -31,6 +31,8 @@
- BRM-106: плашка deployBox без номера задачи и «после принятого изменения»: «Обновлено: время по Алматы» + «Что нового для вас» (ключ deploy.note.brm57 — переписывать под новую выкладку); общая для главной и «Бота и отчётов».
- BRM-107: в письме кнопка lsend называется «Открыть в почте» (письмо само не уходит), порядок шагов — #lsteps (letter.steps), скрыт без письма и после отправки.
- BRM-108: «Итог по регионам» (regionsBox(lang, coverage, AGREED)) содержит #regtotal «Всего N из M» + согласие; сервер считает из coverage, суммы совпадают.
- BRM-118: причины недоступных кнопок (письмо, stop/resume/send на «Сводке») уже были из BRM-96/98; добавлено только title=причина у stop/resume в server.js; тесты гонять через `env -i PATH HOME npm test`.
- BRM-120: на главной причина выключенной отправки — только в списке sendBox (мелкой строки home.send.hint больше нет); время версии одно — в deployBox.
## Команды
- BRM-13: Node без зависимостей; `npm test` (сбросить NODE_TEST_CONTEXT, иначе node:test не стартует); lint = node --check src/*.js; dist/ не трогать.

View File

@ -764,7 +764,6 @@
"why.tg.short.key": "The bot key exists but is not passed to this version; the team does it.",
"why.tg.short.chat": "The key is there, but no chat is set for messages.",
"home.send.title": "Why messages are not sent yet",
"home.send.hint": "This is the preview version: the owner has the bot key, but it has not been passed here yet. The team passes it on; nothing is needed from you.",
"ui.plan.startTip": "The 60-day calendar starts on this date.",
"ui.plan.f.rubricTip": "Pick a rubric so you can see whether its target share is met.",
"ui.plan.f.dateTip": "The day the entry should go out. You can leave it empty.",

View File

@ -764,7 +764,6 @@
"why.tg.short.key": "Бот кілті бар, бірақ бұл нұсқаға берілмеген; команда береді.",
"why.tg.short.chat": "Кілт бар, хабарлама чаты көрсетілмеген.",
"home.send.title": "Хабарлама неге әлі жіберілмейді",
"home.send.hint": "Бұл тексеру нұсқасы: бот кілті иесінде бар, бірақ мұнда әлі берілмеген. Оны команда береді, сізден ештеңе керек емес.",
"ui.plan.startTip": "Күнтізбе осы күннен бастап 60 күнге көрсетіледі.",
"ui.plan.f.rubricTip": "Айдардың үлес мақсатынан ауытқымағанын көру үшін айдарды таңдаңыз.",
"ui.plan.f.dateTip": "Жазба шығатын күн. Бос қалдыруға болады.",

View File

@ -764,7 +764,6 @@
"why.tg.short.key": "Ключ бота есть, но в эту версию не передан; передаёт команда.",
"why.tg.short.chat": "Ключ есть, не указан чат для сообщений.",
"home.send.title": "Почему сообщения пока не уходят",
"home.send.hint": "Это версия для проверки: ключ бота у владельца есть, но в эту версию его пока не передали. Передаёт команда, от вас ничего не нужно.",
"ui.plan.startTip": "С этой даты начинается календарь на 60 дней.",
"ui.plan.f.rubricTip": "Выберите рубрику — по ней видно, соблюдается ли цель по доле.",
"ui.plan.f.dateTip": "День, когда запись должна выйти. Можно оставить пустым.",

View File

@ -363,7 +363,7 @@ export function createApp({ file, oppsFile, metricsFile, telegram = createTelegr
page = page.replace("<table id=\"list\"></table>", metricsTable(pageLang, metrics.list()));
for (const [id, offNow, why] of [["stop", off, "ui.sum.s.stopWhy"], ["resume", !off, "ui.sum.s.resumeWhy"]]) {
if (!offNow) continue;
page = page.replace(`<button id="${id}" `, `<button id="${id}" class="off" aria-disabled="true" `).replace(`<small id="${id}why"></small>`, `<small id="${id}why">${t(pageLang, why)}</small>`);
page = page.replace(`<button id="${id}" `, `<button id="${id}" class="off" aria-disabled="true" `).replace(new RegExp(`(<button id="${id}"[^>]*?) title="[^"]*"`), `$1 title="${t(pageLang, why)}"`).replace(`<small id="${id}why"></small>`, `<small id="${id}why">${t(pageLang, why)}</small>`);
}
if (!telegram.connected()) page = page.replace('<small id="sendwhy"></small>', `<small id="sendwhy">${t(pageLang, telegram.missing?.() ? "why.tg.short." + telegram.missing() : "ui.sum.sendWhy")}</small>`);
}

View File

@ -142,7 +142,7 @@ export function sendBox(lang, missing = {}) {
if (!items.length) return "";
return `<div class="box" id="sendwhy"><strong>${esc(t(lang, "home.send.title"))}</strong><ul>` +
items.map(([k, name, m]) => `<li><b>${name}:</b> ${esc(t(lang, `why.${k}.${m}`))}</li>`).join("") +
`</ul><p><small>${esc(t(lang, "home.send.hint"))}</small></p></div>`;
"</ul></div>";
}
export function homePage(lang = "ru", status = readStatus(), deployView = null, samples = [], missing = {}, strategy = null) {

View File

@ -92,12 +92,14 @@ test("BRM-96: «Сводка» и письмо до скриптов показ
let h = await (await fetch(base + "/summary.html")).text();
assert.match(h, /<button id="resume" class="off" aria-disabled="true"/);
assert.ok(h.includes('<small id="resumewhy">Рассылка уже идёт.</small>'));
assert.match(h, /id="resume"[^>]*title="Рассылка уже идёт\."/);
assert.match(h, /<button id="stop" data-t/, "«Остановить» доступна, причины нет");
assert.ok(h.includes('<small id="stopwhy"></small>'));
await fetch(base + "/api/summary/stop", { method: "POST", headers: { "content-type": "application/json" }, body: "{}" });
h = await (await fetch(base + "/summary.html")).text();
assert.match(h, /<button id="stop" class="off" aria-disabled="true"/);
assert.ok(h.includes('<small id="stopwhy">Рассылка уже остановлена.</small>'));
assert.match(h, /id="stop"[^>]*title="Рассылка уже остановлена\."/);
assert.ok(h.includes('<small id="resumewhy"></small>'));
const o = await (await fetch(base + "/opportunities.html")).text();
assert.match(o, /id="lmark" disabled aria-disabled="true"/);

View File

@ -200,3 +200,8 @@ test("Сценарий: ключ бота есть, чата нет — прич
test("Сценарий: всё подключено — объяснения нет", () => {
assert.doesNotMatch(homePage("ru", undefined, null, [], {}), /id="sendwhy"/);
});
test("BRM-120: причина выключенной отправки на главной написана один раз", () => {
const html = homePage("ru", undefined, null, [], { telegram: "key" });
assert.equal((html.match(/ключ бота у владельца есть/g) ?? []).length, 1);
});