mirror of
https://github.com/wekan/wekan.git
synced 2026-11-20 09:45:04 -05:00
A board can let every signed-in user edit it, when Admin Panel / Settings / Visibility allows it: a non-member then comments, edits and moves cards like a Normal member, and their first edit makes them one. Board-wide settings stay members-only. Lists can allow or refuse editing and commenting per role (list menu, board admins): built-in roles, custom roles and, on an open board, everyone signed in. The server applies it to card, checklist, attachment and comment writes and to moves into the list; the REST API honours a list's refusal on every per-list card route. A direct client write of the setting is refused and shown in Admin Panel / Problems. Every board has a key, unique in the instance, suggested from its title and set for existing boards at startup; card numbers show as KEY-7 and searching for KEY-7 finds the card. Shared labels in Admin Panel / Labels, for every board or an organization's or team's boards; a board uses them beside its own, and a rename or colour change reaches every board that uses it. New strings translated in all languages. Low confidence: chr, tlh, wal, ay, ace, nah, gn, iu, zgh, rup, wo, se, ff, tig, vo, bm, kl, bua, nap, mai, to, ks, qu, bo, fj, haw, om, ss, ts, ve-PP, lld, scn. Thanks to Meeques, justinr1234, tiFabGrinch, ejlkemper and xet7 ! Fixes #4575, Fixes #4527, Fixes #2449, Fixes #2450, Fixes #2761, Fixes #4698.
37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
import { Mongo } from 'meteor/mongo';
|
|
const { SimpleSchema } = require('/imports/simpleSchema');
|
|
|
|
// Shared labels (#2761, #4698): the catalogs, written only by site admins
|
|
// through server/sharedLabels.js. Rules in models/lib/sharedLabels.js.
|
|
const SharedLabels = new Mongo.Collection('sharedLabels');
|
|
|
|
SharedLabels.attachSchema(new SimpleSchema({
|
|
name: { type: String, optional: true, max: 100 },
|
|
color: { type: String },
|
|
// 'instance', 'org' or 'team'; scopeId is the organization or team.
|
|
scope: { type: String, allowedValues: ['instance', 'org', 'team'] },
|
|
scopeId: { type: String, optional: true },
|
|
sort: { type: Number, optional: true },
|
|
createdAt: {
|
|
type: Date,
|
|
optional: true,
|
|
// eslint-disable-next-line consistent-return
|
|
autoValue() {
|
|
if (this.isInsert) return new Date();
|
|
if (this.isUpsert) return { $setOnInsert: new Date() };
|
|
this.unset();
|
|
},
|
|
},
|
|
modifiedAt: {
|
|
type: Date,
|
|
optional: true,
|
|
// eslint-disable-next-line consistent-return
|
|
autoValue() {
|
|
if (this.isInsert || this.isUpsert || this.isUpdate) return new Date();
|
|
this.unset();
|
|
},
|
|
},
|
|
}));
|
|
|
|
export default SharedLabels;
|