mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
Admin Panel / Settings / Shared labels chose a colour from a dropdown of colour names. The board label popup's picker - the palette swatches and the custom colour wheel - is its own template now, labelColorPicker, and the popup and every Shared labels row use it; a custom colour is saved as its hex, which the server already accepted. A pick reaches the row through an object with set(), because Spacebars calls a function argument instead of passing it. The swatches grow to fill their row, so on the wide admin page their width followed the window. There they have the size they have in an opened card's label popup, 54 x 33px, at every window width. tests/sharedLabelsColorPicker.test.cjs pins the shared picker and the size; tests/playwright/specs/shared-labels-color-picker.e2e.js picks a swatch and a custom colour, saves both, and measures the swatches at 1366, 1920 and 2560px. Thanks to xet7 !
37 lines
1.8 KiB
Markdown
37 lines
1.8 KiB
Markdown
# Shared labels
|
|
|
|
Labels used to belong to one board each. **Shared labels** (#2761, #4698) are
|
|
kept in catalogs that boards use beside their own labels:
|
|
|
|
| Catalog | Where it can be used |
|
|
| --- | --- |
|
|
| **Every board** | on every board of this WeKan |
|
|
| **An organization** | on the boards that organization is assigned to |
|
|
| **A team** | on the boards that team is assigned to |
|
|
|
|
A site admin keeps the catalogs in **Admin Panel → Settings → Labels**
|
|
(`/admin/settings/labels`). Each row has the label's name, colour and catalog,
|
|
and saves on its own; the last row adds a label. The colour is picked with the
|
|
same picker as a board label's - the palette swatches, at the size they have on
|
|
an opened card, or any custom colour from the colour wheel.
|
|
|
|
**On a board:** open a card's labels. Below the board's own labels, under
|
|
**Shared labels**, are the shared ones this board may use and does not have
|
|
yet. Clicking one puts it on the card. From then on it is one of the board's
|
|
labels, with a share icon instead of the edit pencil, so filters, rules,
|
|
exports and the minicard treat it like any other label.
|
|
|
|
- **Renaming or recolouring** a shared label in the Admin Panel changes it on
|
|
every board that uses it.
|
|
- **Deleting** a shared label keeps it on those boards, as their own label.
|
|
- **Who sees a catalog:** a user is offered the "every board" catalog and the
|
|
catalogs of their own organizations and teams. Another organization's label
|
|
names are never sent to them.
|
|
- **Who may use one:** anybody who may edit the board.
|
|
|
|
Code: `models/lib/sharedLabels.js` (the rules), `server/sharedLabels.js`
|
|
(catalog, publication, methods), `client/components/cards/labels.*` (the card
|
|
popup), `client/components/settings/sharedLabelsSettings.*` (the Admin Panel).
|
|
Tests: `tests/sharedLabels.test.cjs` and the runtime suite
|
|
`server/lib/tests/sharedLabels.tests.js`.
|