/* ────────────────────────────────────────────────────────────────────────── CENTRAL FEEDBACK CONFIGURATION ---------------------------------------------------------------------------- By default the suite stores all feedback in each user's own browser (localStorage) and reviewers share it via Export / Import. That needs no server and works behind any firewall. To ALSO collect feedback automatically into one central place, set FEEDBACK_ENDPOINT below to a URL that accepts an HTTP POST of JSON. This works with either: • a small backend on your host (Node/PHP/Python/ASP.NET) that appends the body to a feedback.json / .csv you can download, or • a Microsoft Power Automate "When an HTTP request is received" trigger that writes to a SharePoint list / Excel table. Leave it as an empty string to stay fully local (export/import only). See DEPLOYMENT.md for setup details and sample receivers. ────────────────────────────────────────────────────────────────────────── */ window.FEEDBACK_ENDPOINT = ''; /* Best-effort send to the central endpoint. Never throws and never blocks the UI: feedback is always saved locally first by the caller, so a failed or disabled POST simply means "not centrally collected." Returns a Promise that resolves true on success, false otherwise. */ window.postFeedback = function (payload) { if (!window.FEEDBACK_ENDPOINT) return Promise.resolve(false); try { return fetch(window.FEEDBACK_ENDPOINT, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ app: 'Work Package Suite', page: (typeof location !== 'undefined' && location.pathname) || '', submittedAt: new Date().toISOString(), ...payload }), keepalive: true // allow the send to complete even if the page unloads }).then(function (r) { return r.ok; }).catch(function () { return false; }); } catch (e) { return Promise.resolve(false); } };