Commit Graph
30 Commits
Author SHA1 Message Date
Lauri Ojansivu 935e68dfdd GitHub organization import: repositories, issues, releases, Actions, wiki.
Import -> GitHub -> Import a whole GitHub organization makes every
repository of an organization or user its own board, opening in Board View
/ Version Control. Issues go through the ordinary importBoard, as the person
who started the job, with their comments, labels and files. Releases are
cards in a Releases list, their files attached only when chosen. Each
.github/workflows file becomes Rules. The wiki is read from its git
repository with isomorphic-git (1.42.4, pinned), every request through the
SSRF guard and only to github.com: a page is a card in the Wiki list, its
[[links]] point at and are attached to the linked pages' cards, and each
commit that changed it is a dated edit in the card's history, so Restore
brings back an older version. The job shows progress, can be cancelled,
pauses on a restart and stops at a rate limit; the token is kept in memory
only.

Version Control gains Releases and Wiki tabs: the wiki as GitHub shows it,
with the page list, _Sidebar and _Footer, links that stay in the tab, and
each page's history with Restore.

GitHub Actions workflows map to Rules: issue events to triggers, label,
close, reopen, comment, assign and create steps to actions, actions/stale to
an aging rule. Code - builds, tests, scripts - is never run: such a workflow
is a disabled rule with its YAML as the description. WeKan's Rules gain what
they lacked for it: a "commented on" trigger, an "add comment" action written
as the person whose change ran the rule and only where they may comment,
cron schedules in UTC, and a rule description shown on the rule. A disabled
rule no longer fires on a schedule or from its button, which it did.

The new strings are translated in every locale.

Thanks to xet7 !
2026-10-14 12:43:36 +03:00
Lauri Ojansivu 69eeb00c84 Let a rule have several triggers (any fires it) and several actions (in order).
Maintainer decision for #4294 and #2953: a rule keeps its own trigger and
action and may add up to ten more of each. It fires when any of its
triggers fires - once per activity, even when several match - and runs its
actions in order, its own first. Rule details lists the extra parts with
Add another trigger / Add another action and Remove; the new
rules.addPart/removePart methods keep the board-admin and cross-board
destination checks of rules.createRule and refuse a button as an extra
trigger.

Ordinary, scheduled and button rules, the durable Sync rule plan, rule
History (snapshot, part edits and restore), deletion, board copy, WeKan
export/import, the rules JSON export/import, the REST representation and
the admin rules report all handle every part. Two rule-engine test
harnesses now receive the new helpers they evaluate.

New strings are in en.i18n.json, pending translation.

Thanks to xet7 !

Fixes #2953,
2026-09-29 14:34:18 +03:00
Lauri Ojansivu 952679f9c3 CHANGELOG: close the list/swimlane link issue (#1089).
Thanks to xet7 and xet7 !

Fixes #1089,
2026-09-10 21:01:12 +03:00
Lauri Ojansivu 52972b3e4c Add Admin Panel setting to restrict board creation to admins only.
Admin Panel -> Settings -> Visibility gets a new checkbox beside "Public
boards": "Only admins can create boards"
(tableVisibilityMode-boardCreationAdminOnly, off by default). It follows
the exact TableVisibilityModeSettings pattern its sibling
tableVisibilityMode-allowPrivateOnly already uses: a collection doc seeded
in server/models/collectionBootstrap.js, a jade checkbox and reactive
helper in settingBody.jade/js, and a write in the section's own Save
handler.

The real enforcement is server-side: createBoardWithInitialSwimlanes
(server/models/boards.js) now rejects the call with a not-authorized error
when the setting is on and the caller is not isAdmin === true, before the
board is ever inserted. The client mirrors this only as a convenience - a
new client/lib/boardCreationAllowed.js helper hides the top-bar "+" (header
header.js/.jade) and the All Boards "Add board" tile (boardsList.js) for a
restricted non-admin, but nothing depends on that for security.

A full per-user allow/deny override was left out of this pass: it would
need is own schema field, a People/Admin Panel UI to flip it per account,
and server enforcement layered under the global toggle, which is a larger
change than this issue's "let an admin forbid board creation instance-wide"
core request. The global toggle covers that request cleanly on its own.

Added imports/i18n/data/en.i18n.json's board-creation-admin-only string and
a direct translation (no external translation API) in all other locale
files, in en.i18n.json's key order. tests/boardCreationAdminOnly.test.cjs
pins the default-off setting, the checkbox/handler wiring, the server-side
admin check (and that it runs before the insert), the shared client helper,
the i18n key placement, and - as a negative test - that no OTHER
Boards.insertAsync call site was silently added outside the two already
known and deliberately ungated ones (the per-user Templates container and
createBoardFromCard).

Thanks to belf88 and xet7 !

Closes #4475,
2026-09-10 19:45:52 +03:00
Lauri Ojansivu c1add5bc5e Paginate the admin lists honestly: one page of ten, index-backed.
Admin Panel / People showed the admin on every one of its 578 pages, and
Admin Panel / Problems / Broken cards was one endless page under a pager that
said "1 / 1". Same bug in two shapes: the pane subscribes to a publication
that sends exactly one page, then reads the page back out of minimongo - which
holds far more than the page. The logged-in user's own record is always there
(accounts publishes it), and so is every card of every board the admin has
opened. A plain find(query) cannot tell those apart from the page.

So the server names the page. getPeoplePageIds returns the ids of the People
page with the publication's own selector, sort and window; the Broken cards,
Cards and Boards report publications send the ids of the page they just sent
alongside it. Both panes render that list, in that order, and nothing else.

Every paginated page in WeKan now loads ten rows at a time, from one constant -
TABLE_PAGE_ROWS_PER_PAGE - including the pages that draw a pager of their own:
the reports and event streams, the four People panes, Translation, the search
pages and the archive. docs/Design/Page/Table.md records the rule and its two
deliberate exceptions.

And the counting behind those pagers is index-backed. Every count already asks
the database for a count rather than fetching the rows, but several counted and
paged on unindexed fields: People sorts users newest-first, so on an instance
with 14000 users each page of ten sorted all 14000 first. Broken cards asks an
$or over boardId/swimlaneId/listId/type, which uses no index at all unless
every branch has one. The missing indexes are created at startup by the
idempotent ensureIndex, so an upgrade adds them by itself.

Thanks to xet7 !
2026-07-27 23:39:37 +03:00
Lauri OjansivuandClaude Opus 4.8 073842b3c5 Render board/card automation buttons reliably; warn on empty WeKan import
Board/card 'button' rules now denormalise their button type/label onto the
schema-backed rules document (via a board-admin-gated rules.createRule method)
and the header/card read them from there, because the schemaless triggers
collection's documents do not reach the client over the board subscription;
the boardRules publication and the rules-list editor read from it too. Also
warn (instead of silently creating an empty board) when a pasted WeKan export
has no swimlanes/lists/cards (a broken older export).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 12:55:11 +03:00
Harry Adel 63ce45c538 Split shared models from Meteor 3 server runtime 2026-03-24 01:50:39 +02:00
Harry Adel 2e3fbf25db Meteor 3.4 migration: Convert allow/deny callbacks to async
Meteor 3.x supports async allow/deny callbacks. Convert all 25 sync
allow/deny callbacks across 23 model files to use async/await with
findOneAsync/fetchAsync instead of sync findOne/find().fetch().

Also converts helper functions in server/lib/utils.js:
- allowIsBoardMemberWithWriteAccessByCard -> async
- allowIsBoardMemberByCard -> async
- canUpdateCard (cards.js) -> async
- permissionHelper.allow (integrations.js) -> async
2026-03-22 17:44:29 +02:00
Harry Adel e77be37450 Use sync code in allow/deny for 2.x 2026-02-19 00:26:47 +02:00
Harry Adel f934aea2a5 Return data on client (sync) and Promise on server (async) naturally, without wrapping in an extra Promise 2026-02-18 18:24:55 +02:00
Harry Adel 71eb01e233 Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async

Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
  checklists, checklistItems, customFields, attachments, integrations,
  cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
Lauri Ojansivu 25eedd187e Merge pull request #6093 from harryadel/createIndex-migration
Migrate createIndex to createIndexAsync
2026-01-24 02:04:35 +02:00
Harry Adel ca2083c858 Migrate createIndex to createIndexAsync 2026-01-24 01:55:29 +02:00
Harry Adel 94a3575e2c Replace mquandalle:collection-mutations with collection helpers 2026-01-21 19:22:54 +02:00
Martin Filser f5796faa84 Move every Triggers.findOne(idOrFirstObjectSelector, options) to the ReactiveCache 2023-07-18 21:25:28 +02:00
Martin Filser b48297df22 Move every Actions.findOne(idOrFirstObjectSelector, options) to the ReactiveCache 2023-07-18 21:25:28 +02:00
Martin Filser a182482cfb Move every Boards.findOne(boardId) to the ReactiveCache (Part 2) 2023-07-18 21:25:28 +02:00
Lauri Ojansivu c926475eb1 Fixed _ensureIndex to createIndex for MongoDB 5. Updated to latest Meteor beta. 2022-04-18 18:08:12 +03:00
John R. Supplee 1d4a65d0b4 Add new rules report 2021-04-12 11:44:28 +02:00
Lauri Ojansivu e4a9dc25ec Revert Removed extra imports of Meteor. Hopefully fixes email notifications
and rules on old cars not working.

Thanks to xet7 !
2021-03-03 15:23:43 +02:00
Lauri Ojansivu de13b8b9ba Removed extra imports of Meteor.
Thanks to xet7 !
2021-03-02 16:25:27 +02:00
Justin Reynolds 3b9f2ca7c2 Fixes #2596 incorrect date types for created & updated 2019-09-05 12:29:45 -05:00
Justin Reynolds 3eb4d2c341 Prettier & eslint project style update 2019-06-28 12:56:51 -05:00
Justin Reynolds c60e80d25b Add createdAt and modifiedAt to all collections 2019-06-27 09:13:20 -05:00
Lauri Ojansivu df84a2be9a Fix lint errors. 2018-09-16 01:50:36 +03:00
Angelo Gallarello 34b37116cf Fixed rule allows 2018-09-12 00:52:29 +02:00
Angelo Gallarello 6828ccd7f1 Main flow implemented 2018-08-16 00:32:31 +02:00
Angelo Gallarello 9b0eb0a9f1 Almost full circle 2018-08-15 18:47:09 +02:00
Angelo Gallarello 7e4bd4a0a7 Add and remove ui 2018-08-03 20:43:37 +02:00
Angelo Gallarello f63482b587 UI for rules list 2018-08-03 19:47:20 +02:00