- JavaScript 100%
| .forgejo/workflows | ||
| src | ||
| .gitattributes | ||
| build.js | ||
| README.md | ||
| script.user.js | ||
crm-helpers
Tampermonkey userscript with small quality-of-life helpers for the OneCRM
web app (https://onecrm.g1i.one/*).
Features
- Click to copy: contract IDs, contract title values (cluster or domain), customer number, customer number + name, email, phone number, mobile number.
- Auto-linked fields: Business ID Norway links to Brønnøysundregistrene, contract clusters get a button row linking to Platform Tools, and invoice/customer numbers link into PayEx.
- EFaktura -> EHF: a button that copies the Business ID Norway into the electronic invoice ID field and switches the invoicing type to EHF.
- Compact contracts view: a toolbar toggle that collapses each contract (including nested add-ons) down to one line, hiding the price/term/start/notes details. Remembered across page reloads.
How to install
-
Install the Tampermonkey browser extension (or another userscript manager that supports
@updateURL/@downloadURL). -
Open this URL in your browser:
https://git.ratlab.xyz/OfficeRat/crm-helpers/raw/branch/main/script.user.jsTampermonkey will intercept it and show an install prompt — review the script and click Install.
-
Visit
https://onecrm.g1i.one/and the helpers should be active.
Because @updateURL/@downloadURL point at the main branch, the
script checks for and installs updates automatically whenever a new
version is released there.
To try the in-development version instead, install from the beta
branch URL:
https://git.ratlab.xyz/OfficeRat/crm-helpers/raw/branch/beta/script.user.js
It's named Crm-helpers-beta in the Tampermonkey dashboard, so it can
be installed side by side with the release version without conflicting.
Project structure
The deployed script must be a single file, since that's what
Tampermonkey fetches. To keep it easy to work on, the source is split
one function per file under src/, and build.js (plain Node, no
dependencies) concatenates them into script.user.js:
src/
meta.js userscript header block
*.js one function (or closely related pair) per file
build.js concatenates src/ into script.user.js
After editing anything in src/, rebuild with:
node build.js
Commit the regenerated script.user.js along with your source changes
— it's the file Tampermonkey actually runs.
Branches and releases
beta— development branch. The userscript header on this branch is namedCrm-helpers-beta, so it can be installed side by side with the release version for testing.main— release branch, namedCrm-helpers. This is what@updateURL/@downloadURLpoint at.
To ship what's on beta, run the Release beta to main workflow
(.forgejo/workflows/release.yml) from the Actions tab. It's a manual
(workflow_dispatch) workflow that takes a version input and:
- Merges
betaintomain(without deleting or otherwise touchingbeta). - Renames the userscript from
Crm-helpers-betatoCrm-helpersand sets@versionto the value you entered. - Rebuilds
script.user.js. - Commits, tags (
vX.Y.Z), and pushesmain.
It runs on a self-hosted runner (label selfhosted) and needs Node
available on that runner.