diff --git a/appinfo/info.xml b/appinfo/info.xml
index 72b0a632..a889023f 100755
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -29,7 +29,7 @@ If you require adaptations to comply with your country's regulations, please ope
[](https://www.buymeacoffee.com/benjaminaimard)
]]>
- 3.4.7
+ 3.4.8
agpl
Benjamin AIMARD
Gestion
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 352fd786..8cb94d07 100755
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -7,6 +7,7 @@
['name' => 'view#produit', 'url' => '/produit', 'verb' => 'GET'],
['name' => 'configuration#config', 'url' => '/config', 'verb' => 'GET'],
['name' => 'configuration#isConfig', 'url' => '/isconfig', 'verb' => 'GET'],
+ ['name' => 'announcement#acknowledge', 'url' => '/announcements/acknowledge', 'verb' => 'POST'],
['name' => 'view#statistique', 'url' => '/statistique', 'verb' => 'GET'],
['name' => 'view#legalnotice', 'url' => '/legalnotice', 'verb' => 'GET'],
['name' => 'view#france', 'url' => '/legalnotice/france', 'verb' => 'GET'],
diff --git a/css/style.css b/css/style.css
index 9ba9bf32..0d4e785e 100755
--- a/css/style.css
+++ b/css/style.css
@@ -1053,6 +1053,8 @@ button.electronic-invoice-help:focus-visible {
.gestion-workspace-dialog h2 { font-size: 22px; line-height: 1.4; margin: 0 0 16px; }
.gestion-workspace-dialog p { margin-block: 12px; line-height: 1.6; }
.gestion-workspace-dialog button { min-height: 44px; }
+.gestion-announcement-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 20px; }
+.gestion-announcement-actions .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border-radius: var(--border-radius-element, 8px); text-decoration: none; }
.gestion-history { list-style: none; padding: 0; }
.gestion-history li { padding: 16px 0; border-bottom: 1px solid var(--color-border); overflow-wrap: anywhere; }
.gestion-history li p { margin: 4px 0; color: var(--color-text-maxcontrast); }
diff --git a/documentation/source/developer.rst b/documentation/source/developer.rst
index 1de7a937..00ae381a 100644
--- a/documentation/source/developer.rst
+++ b/documentation/source/developer.rst
@@ -128,6 +128,27 @@ PR fonctionnelle.
Version et publication
----------------------
+Annonce à tous les utilisateurs
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+La version ``3.4.8`` prépare un appel à bêta-testeurs pour l'application Qonto,
+en vue d'une intégration complète avec Gestion. L'annonce apparaît à l'ouverture
+de Gestion dès cette version, pour chaque utilisateur authentifié, même lorsque
+plusieurs personnes partagent la même société. Le bouton de participation ouvre
+le logiciel de messagerie ; Gestion n'envoie pas d'e-mail automatiquement.
+
+Le déclencheur est ``AnnouncementService::VERSION``. Pour une future annonce,
+choisissez une nouvelle version, adaptez le texte traduisible dans
+``templates/content/changelog.php`` et publiez une version de Gestion au moins
+égale au déclencheur. Un simple correctif ultérieur ne réaffiche pas l'annonce
+aux utilisateurs qui l'ont déjà fermée. Aucun tag ni aucune publication du store
+n'est nécessaire pour préparer ces changements sur ``master``.
+
+L'acquittement est enregistré dans les préférences de l'utilisateur seulement
+après fermeture et confirmation du serveur, par une requête authentifiée avec
+protection CSRF. Recharger la page sans fermer le message ne le marque pas comme
+lu. Ce mécanisme est distinct de l'ancien champ ``changelog`` des sociétés.
+
La source de vérité de la version est ``appinfo/info.xml``. L'interface et la
documentation Sphinx lisent cette valeur automatiquement. Lors d'une
publication, vérifiez également les métadonnées du paquet et le tag Git.
diff --git a/l10n/fr.js b/l10n/fr.js
index 7a1936bd..18565a3e 100644
--- a/l10n/fr.js
+++ b/l10n/fr.js
@@ -1,6 +1,10 @@
OC.L10N.register(
"gestion",
{
+ "Qonto application: beta testers wanted" : "Application Qonto : recherche de bêta-testeurs",
+ "I am looking for beta testers for the Qonto application, with the aim of fully integrating it with Gestion." : "Je recherche des bêta-testeurs pour l’application Qonto, en vue de son intégration complète avec Gestion.",
+ "Your feedback will help shape the integration and test real-world workflows. If you would like to take part, contact me and tell me how you use Qonto and Gestion." : "Vos retours aideront à concevoir cette intégration et à la tester en conditions réelles. Pour participer, contactez-moi en précisant votre utilisation de Qonto et de Gestion.",
+ "Join the beta testing" : "Participer aux bêta-tests",
"Last name" : "Nom",
"First name" : "Prénom",
"Limited company" : "Siret",
diff --git a/l10n/fr.json b/l10n/fr.json
index f2367c6a..de4f3d10 100644
--- a/l10n/fr.json
+++ b/l10n/fr.json
@@ -1,4 +1,9 @@
{ "translations": {
+ "Qonto application: beta testers wanted" : "Application Qonto : recherche de bêta-testeurs",
+ "I am looking for beta testers for the Qonto application, with the aim of fully integrating it with Gestion." : "Je recherche des bêta-testeurs pour l’application Qonto, en vue de son intégration complète avec Gestion.",
+ "Your feedback will help shape the integration and test real-world workflows. If you would like to take part, contact me and tell me how you use Qonto and Gestion." : "Vos retours aideront à concevoir cette intégration et à la tester en conditions réelles. Pour participer, contactez-moi en précisant votre utilisation de Qonto et de Gestion.",
+ "Join the beta testing" : "Participer aux bêta-tests",
+
"Last name" : "Nom",
"First name" : "Prénom",
"Limited company" : "Siret",
diff --git a/lib/Controller/AnnouncementController.php b/lib/Controller/AnnouncementController.php
new file mode 100644
index 00000000..2a906157
--- /dev/null
+++ b/lib/Controller/AnnouncementController.php
@@ -0,0 +1,27 @@
+announcementService->acknowledge($version);
+ return new DataResponse(['acknowledged' => true]);
+ } catch (\InvalidArgumentException $e) {
+ return new DataResponse(['message' => $e->getMessage()], 400);
+ }
+ }
+}
diff --git a/lib/Service/AnnouncementService.php b/lib/Service/AnnouncementService.php
new file mode 100644
index 00000000..7d221b89
--- /dev/null
+++ b/lib/Service/AnnouncementService.php
@@ -0,0 +1,32 @@
+UserId || version_compare($this->appManager->getAppVersion('gestion'), self::VERSION, '<')) {
+ return '';
+ }
+ $seen = $this->config->getUserValue($this->UserId, 'gestion', self::SEEN_KEY, '');
+ return $seen !== '' && version_compare($seen, self::VERSION, '>=') ? '' : self::VERSION;
+ }
+
+ public function acknowledge(string $version): void {
+ if (!$this->UserId || $version !== self::VERSION || version_compare($this->appManager->getAppVersion('gestion'), self::VERSION, '<')) {
+ throw new \InvalidArgumentException('Invalid announcement version.');
+ }
+ $seen = $this->config->getUserValue($this->UserId, 'gestion', self::SEEN_KEY, '');
+ if ($seen === '' || version_compare($seen, $version, '<')) {
+ $this->config->setUserValue($this->UserId, 'gestion', self::SEEN_KEY, $version);
+ }
+ }
+}
diff --git a/lib/Service/TemplateService.php b/lib/Service/TemplateService.php
index a3d95752..e00d75d6 100755
--- a/lib/Service/TemplateService.php
+++ b/lib/Service/TemplateService.php
@@ -21,7 +21,8 @@ public function __construct(
DataService $dataService,
FileService $fileService,
NavigationService $navigationService,
- ContentSecurityPolicy $csp
+ ContentSecurityPolicy $csp,
+ private AnnouncementService $announcementService
) {
$this->userId = $UserId;
$this->appManager = $appManager;
@@ -36,6 +37,7 @@ private function baseParams(): array {
return [
'path' => $this->userId,
'appVersion' => $this->appManager->getAppVersion('gestion'),
+ 'announcementVersion' => $this->announcementService->pendingVersion(),
'url' => $this->navigationService->getNavigationLink(),
'CompaniesList' => $this->companyService->getCompaniesList(),
'CurrentCompany' => $this->companyService->getCurrentCompany(),
diff --git a/package-lock.json b/package-lock.json
index 8dcf3781..83472dae 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "gestion",
- "version": "3.4.7",
+ "version": "3.4.8",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "gestion",
- "version": "3.4.7",
+ "version": "3.4.8",
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@nextcloud/dialogs": "^7.4.0",
diff --git a/package.json b/package.json
index c267abf0..99c5eb39 100755
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "gestion",
- "version": "3.4.7",
+ "version": "3.4.8",
"description": "Application pour gérer votre micro entreprise, client, facture, devis",
"author": "Benjamin AIMARD",
"contributors": [
diff --git a/src/js/modules/workspace.js b/src/js/modules/workspace.js
index 1782da33..582de1c6 100644
--- a/src/js/modules/workspace.js
+++ b/src/js/modules/workspace.js
@@ -174,6 +174,32 @@ function applyLockedState() {
}
document.addEventListener('DOMContentLoaded', () => {
+ const announcement = document.getElementById('gestion-announcement');
+ if (announcement) {
+ const close = announcement.querySelector('[data-dismiss-announcement]');
+ const dismiss = async () => {
+ if (close.disabled) return;
+ close.disabled = true;
+ try {
+ await request('/announcements/acknowledge', {version: announcement.dataset.announcementVersion});
+ announcement.close();
+ announcement.remove();
+ } catch {
+ close.disabled = false;
+ showError(t('gestion', 'The operation could not be completed.'));
+ }
+ };
+ close.addEventListener('click', dismiss);
+ announcement.addEventListener('cancel', event => { event.preventDefault(); dismiss(); });
+ announcement.addEventListener('keydown', event => {
+ if (event.key === 'Escape') {
+ event.preventDefault();
+ event.stopPropagation();
+ dismiss();
+ }
+ });
+ announcement.showModal();
+ }
applyLockedState();
// Keep action menus outside table clipping, including on the final row.
let openActions = null;
diff --git a/templates/content/changelog.php b/templates/content/changelog.php
index 4fc6ee21..e8cb1e22 100755
--- a/templates/content/changelog.php
+++ b/templates/content/changelog.php
@@ -1,3 +1,16 @@
+
+
+
×
diff --git a/tests/Browser/announcements.cjs b/tests/Browser/announcements.cjs
new file mode 100644
index 00000000..c8420f0c
--- /dev/null
+++ b/tests/Browser/announcements.cjs
@@ -0,0 +1,85 @@
+// Opt-in on a disposable Nextcloud instance, with two ordinary test accounts.
+const { chromium } = require('playwright');
+const assert = require('node:assert/strict');
+
+(async () => {
+ const base = process.env.NEXTCLOUD_TEST_URL || 'http://127.0.0.1:8080';
+ const alice = process.env.NEXTCLOUD_TEST_USER;
+ const bob = process.env.NEXTCLOUD_SECOND_TEST_USER;
+ const password = process.env.NEXTCLOUD_TEST_PASSWORD;
+ const bobEmail = process.env.NEXTCLOUD_SECOND_TEST_EMAIL;
+ assert.ok(alice && bob && password && bobEmail, 'Provide two fresh disposable accounts, their shared test password and the second account email.');
+ const browser = await chromium.launch({ executablePath: process.env.CHROMIUM_PATH || '/usr/bin/chromium', args: ['--no-sandbox', '--disable-dev-shm-usage'] });
+ const errors = [];
+ const login = async (context, user) => {
+ const page = await context.newPage();
+ page.on('pageerror', error => errors.push(error.message));
+ await page.goto(base + '/index.php/apps/gestion/config');
+ await page.locator('[name=user]').fill(user);
+ await page.locator('[name=password]').fill(password);
+ await page.locator('button[type=submit]').click();
+ await page.waitForURL('**/apps/gestion/**');
+ return page;
+ };
+ const api = (page, path, data, token = true, method = 'POST') => page.evaluate(async ({path, data, token, method}) => {
+ const response = await fetch(OC.generateUrl('/apps/gestion' + path), {
+ method, headers: {'Content-Type': 'application/json', ...(token ? {requesttoken: OC.requestToken} : {})},
+ body: JSON.stringify(data),
+ });
+ return {status: response.status, data: await response.json().catch(() => null)};
+ }, {path, data, token, method});
+ const centered = async page => {
+ const b = await page.locator('#gestion-announcement').evaluate(el => {
+ const r = el.getBoundingClientRect();
+ return {x:r.x,y:r.y,w:r.width,h:r.height,vw:innerWidth,vh:innerHeight,overflow:el.scrollWidth > el.clientWidth};
+ });
+ assert.ok(Math.abs(b.x+b.w/2-b.vw/2)<2 && Math.abs(b.y+b.h/2-b.vh/2)<2, JSON.stringify(b));
+ assert.equal(b.overflow,false);
+ };
+ try {
+ const aContext = await browser.newContext({viewport:{width:1440,height:900}});
+ const a = await login(aContext, alice);
+ await a.locator('#gestion-announcement[open]').waitFor();
+ assert.match(await a.locator('#gestion-announcement').innerText(), /Qonto/);
+ assert.match(await a.locator('#gestion-announcement a').getAttribute('href'), /^mailto:contact@cybercorp\.fr\?/);
+ await centered(a);
+ for (const viewport of [{width:390,height:844},{width:844,height:390},{width:320,height:568}]) {
+ await a.setViewportSize(viewport);
+ await centered(a);
+ }
+ await a.reload();
+ await a.locator('#gestion-announcement[open]').waitFor();
+ if (process.env.NEXTCLOUD_TEST_SCREENSHOT) await a.screenshot({path:process.env.NEXTCLOUD_TEST_SCREENSHOT});
+ assert.equal((await api(a, '/announcements/acknowledge', {version:'3.4.9'})).status,400);
+ assert.equal((await api(a, '/announcements/acknowledge', {version:'3.4.8'},false)).status,412);
+ const company = await a.locator('#CurrentCompany-select').inputValue();
+ const share = await api(a, '/addShareUser', {email:bobEmail});
+ assert.equal(share.data.status,'success',JSON.stringify(share));
+ await a.route('**/announcements/acknowledge', route => route.fulfill({status:503,contentType:'application/json',body:'{}'}));
+ await a.locator('[data-dismiss-announcement]').click();
+ await a.waitForFunction(() => !document.querySelector('[data-dismiss-announcement]').disabled);
+ assert.ok(await a.locator('#gestion-announcement[open]').isVisible());
+ await a.unroute('**/announcements/acknowledge');
+ await a.locator('[data-dismiss-announcement]').click();
+ await a.locator('#gestion-announcement').waitFor({state:'detached'});
+ await a.reload();
+ assert.equal(await a.locator('#gestion-announcement').count(),0);
+ const bContext = await browser.newContext({viewport:{width:390,height:844}});
+ const b = await login(bContext,bob);
+ await b.locator('#gestion-announcement[open]').waitFor();
+ assert.equal(await b.locator('#CurrentCompany-select').inputValue(),company, 'Both users access the same company');
+ await b.keyboard.press('Escape');
+ await b.locator('#gestion-announcement').waitFor({state:'detached'});
+ await b.reload();
+ assert.equal(await b.locator('#gestion-announcement').count(),0);
+ const fresh = await browser.newContext();
+ const again = await login(fresh,alice);
+ assert.equal(await again.locator('#gestion-announcement').count(),0,'Acknowledgement survives a new browser session');
+ const anonymous = await browser.newContext();
+ const unauthenticated = await anonymous.request.post(base+'/index.php/apps/gestion/announcements/acknowledge',{data:{version:'3.4.8'},maxRedirects:0});
+ assert.ok([303,401,412].includes(unauthenticated.status()),String(unauthenticated.status()));
+ assert.equal((await api(a,'/deleteCompany',{},true,'DELETE')).status,200);
+ assert.deepEqual(errors,[]);
+ console.log('Announcement checks passed: two ordinary users sharing a company, independent acknowledgement, reload without dismissal, persistence, invalid version, CSRF/login required, retry after failure, Close/Escape, desktop/mobile centering. No email sent.');
+ } finally { await browser.close(); }
+})().catch(error => { console.error(error); process.exitCode = 1; });
diff --git a/tests/Browser/contact-import.cjs b/tests/Browser/contact-import.cjs
index 604bfd9a..a8d77b60 100644
--- a/tests/Browser/contact-import.cjs
+++ b/tests/Browser/contact-import.cjs
@@ -1,3 +1,4 @@
+const dismissAnnouncement = require('./dismiss-announcement.cjs');
// Run against a disposable instance with a standard user and an accessible fixture contact.
const { chromium } = require('playwright');
const assert = require('node:assert/strict');
@@ -21,6 +22,7 @@ const assert = require('node:assert/strict');
await page.locator('[name=password]').fill(password);
await page.getByRole('button', { name: 'Log in', exact: true }).click();
await page.waitForURL('**/apps/gestion/**');
+ await dismissAnnouncement(page);
const profile = await page.evaluate(async () => (await (await fetch('/ocs/v2.php/cloud/user?format=json', { headers: { 'OCS-APIRequest': 'true', requesttoken: OC.requestToken } })).json()).ocs.data);
assert.ok(Array.isArray(profile.groups) && !profile.groups.includes('admin'), 'This regression must run as a non-administrator.');
const api = (path, data, method = 'POST', invalidToken = false) => page.evaluate(async ({ path, data, method, invalidToken }) => {
diff --git a/tests/Browser/dismiss-announcement.cjs b/tests/Browser/dismiss-announcement.cjs
new file mode 100644
index 00000000..0edee15d
--- /dev/null
+++ b/tests/Browser/dismiss-announcement.cjs
@@ -0,0 +1,9 @@
+// Unrelated UI scenarios dismiss the real announcement before exercising their feature.
+module.exports = async function dismissAnnouncement(page) {
+ await page.waitForLoadState('domcontentloaded');
+ const dialog = page.locator('#gestion-announcement');
+ if (await dialog.count()) {
+ await dialog.locator('[data-dismiss-announcement]').click();
+ await dialog.waitFor({state: 'detached'});
+ }
+};
diff --git a/tests/Browser/documents.cjs b/tests/Browser/documents.cjs
index c759bfbd..bf275708 100644
--- a/tests/Browser/documents.cjs
+++ b/tests/Browser/documents.cjs
@@ -1,3 +1,4 @@
+const dismissAnnouncement = require('./dismiss-announcement.cjs');
// Opt-in on a disposable instance. Creates a company, customer, product, quote and invoice.
const { chromium } = require('playwright');
const assert = require('node:assert/strict');
@@ -26,6 +27,7 @@ const fs = require('node:fs');
await page.locator('[name=password]').fill(process.env.NEXTCLOUD_TEST_PASSWORD);
await page.getByRole('button', { name: 'Log in', exact: true }).click();
await page.waitForURL('**/apps/gestion/**');
+ await dismissAnnouncement(page);
const api = (path, data, method = 'POST') => page.evaluate(async ({ path, data, method }) => {
const response = await fetch(OC.generateUrl('/apps/gestion' + path), {
method, headers: { 'Content-Type': 'application/json', requesttoken: OC.requestToken },
diff --git a/tests/Browser/lock-information.cjs b/tests/Browser/lock-information.cjs
index b0beccfa..19ca7a4d 100644
--- a/tests/Browser/lock-information.cjs
+++ b/tests/Browser/lock-information.cjs
@@ -1,3 +1,4 @@
+const dismissAnnouncement = require('./dismiss-announcement.cjs');
const {chromium}=require('playwright');const fs=require('fs');const assert=require('node:assert/strict');
(async()=>{
const fixture=JSON.parse(fs.readFileSync(process.env.NEXTCLOUD_TEST_FIXTURE || '/tmp/gestion-e2e-fixture.json'));
@@ -8,6 +9,7 @@ await context.route('**/personal-mail/status',r=>r.fulfill({json:{available:true
await context.route('**/personal-mail/send',r=>{mailRequests++;return r.fulfill({status:400,json:{message:'Simulated delivery failure.',documentLocked:true}})});
await context.route('**/sendFacturXToIopole',r=>{iopoleRequests++;return r.fulfill({status:400,json:{message:'Simulated platform failure.',documentLocked:true}})});
await page.goto('http://127.0.0.1:8080/index.php/apps/gestion/config');if(page.url().includes('login')){await page.locator('[name=user]').fill(process.env.NEXTCLOUD_TEST_USER);await page.locator('[name=password]').fill(process.env.NEXTCLOUD_TEST_PASSWORD);await page.getByRole('button',{name:'Log in',exact:true}).click();await page.waitForURL('**/apps/gestion/**');}
+await dismissAnnouncement(page);
await page.evaluate(async id=>{await fetch(OC.generateUrl('/apps/gestion/updateSession'),{method:'POST',headers:{'Content-Type':'application/json',requesttoken:OC.requestToken||oc_requesttoken},body:JSON.stringify({companyID:String(id)})})},fixture.company);
await page.goto(`http://127.0.0.1:8080/index.php/apps/gestion/devis/${fixture.quote}/show`);await page.waitForFunction(()=>document.documentElement.dataset.gestionDocumentReady==='true');
assert.match(await page.locator('.gestion-document-toolbar [role=status]').innerText(),/cannot be edited or deleted/);
diff --git a/tests/Browser/navigation.cjs b/tests/Browser/navigation.cjs
index 8723d35d..aeee8df1 100644
--- a/tests/Browser/navigation.cjs
+++ b/tests/Browser/navigation.cjs
@@ -1,3 +1,4 @@
+const dismissAnnouncement = require('./dismiss-announcement.cjs');
// Opt-in read-only navigation checks on a disposable Nextcloud instance.
const { chromium } = require('playwright');
const assert = require('node:assert/strict');
@@ -16,6 +17,7 @@ const assert = require('node:assert/strict');
await page.locator('[name=password]').fill(process.env.NEXTCLOUD_TEST_PASSWORD);
await page.locator('button[type=submit]').click();
await page.waitForURL('**/apps/gestion/**');
+ await dismissAnnouncement(page);
const toggle = page.locator('.gestion-navigation-toggle');
const navigation = page.locator('#app-navigation');
const close = page.locator('.gestion-navigation-close');
diff --git a/tests/Browser/security.cjs b/tests/Browser/security.cjs
index 7b83a327..19d7bb2f 100644
--- a/tests/Browser/security.cjs
+++ b/tests/Browser/security.cjs
@@ -1,3 +1,4 @@
+const dismissAnnouncement = require('./dismiss-announcement.cjs');
// Opt-in against a disposable Nextcloud instance after documents.cjs created its fixture.
const { chromium } = require('playwright');
const assert = require('node:assert/strict');
@@ -20,6 +21,7 @@ const fs = require('node:fs');
await page.locator('[name=password]').fill(process.env.NEXTCLOUD_TEST_PASSWORD);
await page.getByRole('button', { name: 'Log in', exact: true }).click();
await page.waitForURL('**/apps/gestion/**');
+ await dismissAnnouncement(page);
const api = (path, data, method = 'POST') => page.evaluate(async ({ path, data, method }) => {
const response = await fetch(OC.generateUrl('/apps/gestion' + path), {
method, headers: { 'Content-Type': 'application/json', requesttoken: OC.requestToken },
diff --git a/tests/Browser/seed-store-demo.cjs b/tests/Browser/seed-store-demo.cjs
index 88193eec..45d5e895 100644
--- a/tests/Browser/seed-store-demo.cjs
+++ b/tests/Browser/seed-store-demo.cjs
@@ -1,3 +1,4 @@
+const dismissAnnouncement = require('./dismiss-announcement.cjs');
// Opt-in: creates fictional data only in a dedicated disposable store-demo account.
const { chromium, request } = require('playwright');
const assert = require('node:assert/strict');
@@ -15,6 +16,7 @@ const assert = require('node:assert/strict');
await page.locator('[name=password]').fill(password);
await page.locator('button[type=submit]').click();
await page.waitForURL('**/apps/gestion/**');
+ await dismissAnnouncement(page);
const api = (path, data, method = 'POST') => page.evaluate(async ({ path, data, method }) => {
const response = await fetch(OC.generateUrl('/apps/gestion' + path), {
method, headers: { 'Content-Type': 'application/json', requesttoken: OC.requestToken },
diff --git a/tests/Browser/workspace.cjs b/tests/Browser/workspace.cjs
index acf3d239..64958c67 100644
--- a/tests/Browser/workspace.cjs
+++ b/tests/Browser/workspace.cjs
@@ -1,3 +1,4 @@
+const dismissAnnouncement = require('./dismiss-announcement.cjs');
const {chromium}=require('playwright');const fs=require('fs');const assert=require('node:assert/strict');
(async()=>{
const browser=await chromium.launch({executablePath:'/usr/bin/chromium',args:['--no-sandbox','--disable-dev-shm-usage']});
@@ -5,6 +6,7 @@ const {chromium}=require('playwright');const fs=require('fs');const assert=requi
const page=await ctx.newPage();const errors=[];page.on('pageerror',e=>errors.push(e.message));
await page.goto('http://127.0.0.1:8080/index.php/apps/gestion/config');
if(page.url().includes('login')){await page.locator('input[name=user]').fill(process.env.NEXTCLOUD_TEST_USER);await page.locator('input[name=password]').fill(process.env.NEXTCLOUD_TEST_PASSWORD);await page.getByRole('button',{name:'Log in',exact:true}).click();await page.waitForURL('**/apps/gestion/**');}
+await dismissAnnouncement(page);
await page.waitForTimeout(600);
await page.locator('input[name=price_decimals]').fill('4');await page.locator('#gestion-precision button').click();
await page.waitForTimeout(400);await page.reload();await page.waitForTimeout(500);assert.equal(await page.locator('input[name=price_decimals]').inputValue(),'4');
diff --git a/tests/Unit/Controller/RoutePermissionsTest.php b/tests/Unit/Controller/RoutePermissionsTest.php
index 65c36a98..622514a0 100644
--- a/tests/Unit/Controller/RoutePermissionsTest.php
+++ b/tests/Unit/Controller/RoutePermissionsTest.php
@@ -38,7 +38,7 @@ public function testRecentlyAddedSessionRoutesStillRequireCsrf(string $controlle
public function sessionRoutes(): array {
$cases = [];
- foreach (['Client' => ['contacts', 'importContact'], 'Admin' => ['backup', 'restore'], 'Crud' => ['lockDocument', 'history', 'reorderProducts'], 'Pdf' => ['personalMailStatus', 'sendPersonalMail']] as $controller => $methods) {
+ foreach (['Client' => ['contacts', 'importContact'], 'Admin' => ['backup', 'restore'], 'Crud' => ['lockDocument', 'history', 'reorderProducts'], 'Pdf' => ['personalMailStatus', 'sendPersonalMail'], 'Announcement' => ['acknowledge']] as $controller => $methods) {
foreach ($methods as $method) $cases[$controller . '::' . $method] = ['OCA\\Gestion\\Controller\\' . $controller . 'Controller', $method];
}
return $cases;
diff --git a/tests/Unit/Panther/IhmTest.php b/tests/Unit/Panther/IhmTest.php
index 2eb24238..d7d4e829 100755
--- a/tests/Unit/Panther/IhmTest.php
+++ b/tests/Unit/Panther/IhmTest.php
@@ -41,6 +41,11 @@ function capture(Client $client, string $filename): void {
$client->request('GET', $baseUrl . '/index.php/apps/gestion/config');
$client->waitFor('.gestion-settings-page');
$client->waitFor('#CurrentCompany-select option');
+if ($client->getCrawler()->filter('#gestion-announcement')->count()) {
+ $client->waitForVisibility('#gestion-announcement');
+ $client->executeScript("document.querySelector('[data-dismiss-announcement]').click()");
+ $client->waitForInvisibility('#gestion-announcement');
+}
if ($companyId = getenv('NEXTCLOUD_TEST_COMPANY_ID')) {
if (!ctype_digit($companyId)) throw new RuntimeException('Invalid demo company id.');
$status = $client->executeAsyncScript(<<<'JS'
diff --git a/tests/Unit/Service/AnnouncementServiceTest.php b/tests/Unit/Service/AnnouncementServiceTest.php
new file mode 100644
index 00000000..bb6c90ab
--- /dev/null
+++ b/tests/Unit/Service/AnnouncementServiceTest.php
@@ -0,0 +1,62 @@
+createMock(IAppManager::class);
+ $apps->method('getAppVersion')->with('gestion')->willReturn($installed);
+ return new AnnouncementService($config, $apps, $user);
+ }
+
+ public function testReadingTheAnnouncementDoesNotAcknowledgeIt(): void {
+ $config = $this->createMock(IConfig::class);
+ $config->method('getUserValue')->willReturn('');
+ $config->expects($this->never())->method('setUserValue');
+ $this->assertSame('3.4.8', $this->service($config)->pendingVersion());
+ $this->assertSame('3.4.8', $this->service($config)->pendingVersion());
+ }
+
+ public function testEachUserAcknowledgesIndependentlyAcrossVersions(): void {
+ $seen = [];
+ $config = $this->createMock(IConfig::class);
+ $config->method('getUserValue')->willReturnCallback(static function ($user) use (&$seen) { return $seen[$user] ?? ''; });
+ $config->method('setUserValue')->willReturnCallback(static function ($user, $app, $key, $version) use (&$seen): void { $seen[$user] = $version; });
+ $alice = $this->service($config);
+ $alice->acknowledge('3.4.8');
+ $this->assertSame('', $alice->pendingVersion());
+ $this->assertSame('3.4.8', $this->service($config, '3.4.8', 'bob')->pendingVersion());
+ $this->assertSame('', $this->service($config, '3.4.9')->pendingVersion());
+ }
+
+ public function testNoDisplayBeforeTheSelectedVersionOrWithoutLogin(): void {
+ $config = $this->createMock(IConfig::class);
+ $this->assertSame('', $this->service($config, '3.4.7')->pendingVersion());
+ $this->assertSame('', $this->service($config, '3.4.8', null)->pendingVersion());
+ }
+
+ /** @dataProvider invalidAcknowledgements */
+ public function testCannotAcknowledgeAnUnknownOrUnavailableVersion(string $installed, string $version, ?string $user): void {
+ $config = $this->createMock(IConfig::class);
+ $config->expects($this->never())->method('setUserValue');
+ $this->expectException(\InvalidArgumentException::class);
+ $this->service($config, $installed, $user)->acknowledge($version);
+ }
+
+ public function invalidAcknowledgements(): array {
+ return [['3.4.8', '3.4.9', 'alice'], ['3.4.7', '3.4.8', 'alice'], ['3.4.8', '3.4.8', null]];
+ }
+
+ public function testAnOldTabCannotDowngradeANewerAcknowledgement(): void {
+ $config = $this->createMock(IConfig::class);
+ $config->method('getUserValue')->willReturn('3.4.9');
+ $config->expects($this->never())->method('setUserValue');
+ $service = $this->service($config, '3.4.9');
+ $this->assertSame('', $service->pendingVersion());
+ $service->acknowledge('3.4.8');
+ }
+}
diff --git a/translationfiles/fr/gestion.po b/translationfiles/fr/gestion.po
index 1b7b8507..b1c02b5a 100755
--- a/translationfiles/fr/gestion.po
+++ b/translationfiles/fr/gestion.po
@@ -1919,3 +1919,15 @@ msgstr "Une hauteur maximale de 0 signifie une hauteur automatique. Les images s
msgid "Logo proportions are preserved. Large main logos appear above the address table. On small screens, logos shrink to fit the available space."
msgstr "Les proportions des logos sont conservées. Les grands logos principaux apparaissent au-dessus du tableau des coordonnées. Sur petit écran, les logos sont réduits à la place disponible."
+
+msgid "Qonto application: beta testers wanted"
+msgstr "Application Qonto : recherche de bêta-testeurs"
+
+msgid "I am looking for beta testers for the Qonto application, with the aim of fully integrating it with Gestion."
+msgstr "Je recherche des bêta-testeurs pour l’application Qonto, en vue de son intégration complète avec Gestion."
+
+msgid "Your feedback will help shape the integration and test real-world workflows. If you would like to take part, contact me and tell me how you use Qonto and Gestion."
+msgstr "Vos retours aideront à concevoir cette intégration et à la tester en conditions réelles. Pour participer, contactez-moi en précisant votre utilisation de Qonto et de Gestion."
+
+msgid "Join the beta testing"
+msgstr "Participer aux bêta-tests"