Files
wekan/client/components/rules/rules.css
T
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

422 lines
10 KiB
CSS

/* Rules is now a fullscreen board-scoped page (below the single top bar),
* no longer a wide modal. .rules-page centers the content and gives it room. */
.rules-page {
max-width: 1100px;
margin: 0 auto;
padding: 9px 14px 36px;
}
.rules-page h2 {
margin-bottom: 9px;
}
.rules-toolbar {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-bottom: 9px;
}
.rules-toolbar button {
cursor: pointer;
}
.rules-list {
overflow: hidden;
overflow-y: auto;
max-height: 65vh;
padding-inline-end: 10px;
}
.rules-lists-item .js-rule-select {
float: inline-start;
margin: 6px 8px 0 0;
}
.rules-lists-item .js-edit-rule-input {
width: 60%;
}
/* Visual workflow view */
.rules-workflow .workflow-group {
margin-bottom: 18px;
}
.rules-workflow .workflow-group-title {
border-bottom: 2px solid #cfcfcf;
padding-bottom: 4px;
margin-bottom: 9px;
}
.rules-workflow .workflow-rule {
display: flex;
align-items: stretch;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 8px;
}
.rules-workflow .workflow-node {
flex: 1 1 200px;
background: #fff;
border: 1px solid #e0e0e0;
border-radius: 6px;
padding: 8px 10px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.rules-workflow .workflow-node-when {
border-inline-start: 4px solid #1565c0;
}
.rules-workflow .workflow-node-then {
border-inline-start: 4px solid #2e7d32;
}
.rules-workflow .workflow-node-label {
display: block;
font-size: calc(11px * var(--wekan-ui-font-scale, 1));
text-transform: uppercase;
color: #888;
}
.rules-workflow .workflow-node-text {
font-size: calc(14px * var(--wekan-ui-font-scale, 1));
}
.rules-workflow .workflow-arrow {
display: flex;
align-items: center;
font-size: calc(20px * var(--wekan-ui-font-scale, 1));
color: #888;
}
/* Drag-and-drop workflow editor */
.rules-workflow .workflow-help {
color: #727479;
font-size: calc(13px * var(--wekan-ui-font-scale, 1));
margin-bottom: 9px;
}
.rules-workflow .workflow-builder {
background: #f7f7f7;
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 12px;
margin-bottom: 14px;
}
.rules-workflow .workflow-builder-row {
display: flex;
align-items: stretch;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 10px;
}
.rules-workflow .workflow-slot {
flex: 1 1 220px;
min-height: 52px;
border: 2px dashed #b0b0b0;
border-radius: 6px;
display: flex;
align-items: center;
padding: 6px 10px;
background: #fff;
}
.rules-workflow .workflow-slot-placeholder {
color: #999;
font-style: italic;
}
.rules-workflow .workflow-slot-clear {
margin-inline-start: auto;
color: #b00;
cursor: pointer;
padding-inline-start: 8px;
}
.rules-workflow .workflow-builder-controls {
display: flex;
gap: 8px;
align-items: center;
flex-wrap: wrap;
}
.rules-workflow .workflow-builder-controls input {
flex: 1 1 240px;
}
.rules-workflow .workflow-palettes {
display: flex;
gap: 16px;
flex-wrap: wrap;
margin-bottom: 14px;
}
.rules-workflow .workflow-palette {
flex: 1 1 240px;
}
.rules-workflow .workflow-chip {
display: inline-flex;
align-items: center;
gap: 6px;
background: #fff;
border: 1px solid #cfcfcf;
border-radius: 16px;
padding: 6px 12px;
margin: 0 6px 6px 0;
cursor: grab;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.rules-workflow .workflow-chip:active {
cursor: grabbing;
}
.rules-workflow .js-trigger-chip {
border-inline-start: 4px solid #1565c0;
}
.rules-workflow .js-action-chip {
border-inline-start: 4px solid #2e7d32;
}
.rules-workflow .workflow-existing-title {
margin-top: 9px;
}
.rules-workflow .workflow-rule {
position: relative;
}
.rules-workflow .workflow-rule-delete {
display: flex;
align-items: center;
color: #b00;
padding-inline-start: 8px;
}
.rules-lists-item {
display: block;
position: relative;
overflow: auto;
border-bottom: 1px solid #bfbfbf;
}
.rules-lists-item p {
display: inline-block;
float: inline-start;
margin: revert;
}
.hide-element {
display: none !important;
}
.user-details {
display: inline-block;
}
.rules-btns-group {
position: absolute;
inset-inline-end: 0;
top: 50%;
transform: translateY(-50%);
}
.rules-btns-group button {
margin: auto;
}
.rules-add {
display: block;
overflow: auto;
margin-top: 18px;
margin-bottom: 6px;
}
.rules-add input {
display: inline-block;
float: inline-end;
margin: auto;
margin-inline-end: 18px;
}
.rules-add button {
display: inline-block;
float: inline-end;
margin: auto;
}
.rules-back {
display: block;
overflow: auto;
margin-top: 15px;
margin-bottom: 5px;
}
.rules-back button {
display: inline-block;
float: inline-end;
margin: auto;
margin-inline-end: 14px;
}
.rules-back .js-goback .fa-arrow-left {
color: #fff !important;
}
.flex,
.triggers-content .triggers-body .triggers-side-menu ul li a {
display: -webkit-box;
display: -moz-box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
}
.triggers-content {
color: #727479;
background: #dedede;
}
.triggers-content .triggers-body {
display: flex;
padding-top: 15px;
height: 100%;
}
.triggers-content .triggers-body .triggers-side-menu {
background-color: #f7f7f7;
border: 1px solid #f0f0f0;
border-radius: 4px;
height: intrinsic;
box-shadow: inset -1px -1px 3px rgba(0,0,0,0.05);
}
.triggers-content .triggers-body .triggers-side-menu ul li {
margin: 0.1rem 0.2rem;
width: 50px;
height: 50px;
text-align: center;
font-size: calc(25px * var(--wekan-ui-font-scale, 1));
position: relative;
}
.triggers-content .triggers-body .triggers-side-menu ul li i {
position: absolute;
top: 50%;
left: 50%;
box-shadow: none;
transform: translate(-50%, -50%);
}
.triggers-content .triggers-body .triggers-side-menu ul li.active {
background: #fff;
box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.triggers-content .triggers-body .triggers-side-menu ul li:hover {
background: #fff;
box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.triggers-content .triggers-body .triggers-side-menu ul li a {
padding: 1rem 0 1rem 1rem;
width: 95%;
}
.triggers-content .triggers-body .triggers-side-menu ul li a span {
font-size: calc(13px * var(--wekan-ui-font-scale, 1));
}
.triggers-content .triggers-body .triggers-main-body {
padding: 0.1em 1em;
width: 100%;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item {
overflow: auto;
padding: 10px;
height: 100px;
margin-bottom: 5px;
border-radius: 3px;
position: relative;
background-color: #fff;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-content {
position: absolute;
top: 50%;
transform: translateY(-50%);
inset-inline-start: 10px;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-content .trigger-text {
font-size: calc(16px * var(--wekan-ui-font-scale, 1));
display: inline-block;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-content .trigger-inline-button {
font-size: calc(16px * var(--wekan-ui-font-scale, 1));
display: inline;
padding: 6px;
border: 1px solid #eee;
border-radius: 4px;
box-shadow: inset -1px -1px 3px rgba(0,0,0,0.05);
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-content .trigger-inline-button:hover,
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-content .trigger-inline-button.is-active {
box-shadow: 0 0 0 2px #666 inset;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-content .trigger-text.trigger-text-email {
margin-inline-start: 5px;
margin-top: 10px;
margin-bottom: 10px;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-content .trigger-dropdown {
display: inline-block;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-content .trigger-dropdown select {
width: auto;
height: 30px;
margin: 0px;
margin-inline-start: 5px;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-content .trigger-dropdown input {
display: inline-block;
width: 80px;
margin: 0;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-content-mail {
inset-inline-start: 20px;
inset-inline-end: 100px;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-button {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 30px;
height: 30px;
border: 1px solid #eee;
border-radius: 4px;
box-shadow: inset -1px -1px 3px rgba(0,0,0,0.05);
text-align: center;
font-size: calc(20px * var(--wekan-ui-font-scale, 1));
inset-inline-end: 10px;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-button i {
position: absolute;
top: 50%;
left: 50%;
box-shadow: none;
transform: translate(-50%, -50%);
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-button:hover,
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-button.is-active {
box-shadow: 0 0 0 2px #666 inset;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-button.trigger-button-email {
top: 30px;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-button.trigger-button-person {
inset-inline-end: -40px;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item .trigger-button.trigger-button-color {
top: unset;
position: unset;
transform: unset;
font-size: calc(16px * var(--wekan-ui-font-scale, 1));
width: auto;
padding-inline-start: 10px;
padding-inline-end: 10px;
height: 40px;
}
.triggers-content .triggers-body .triggers-main-body .trigger-item.trigger-item-mail {
height: 300px;
}
/* Rules import/export popup */
.rules-import-export h3 {
margin: 0.6em 0 0.3em;
font-size: calc(15px * var(--wekan-ui-font-scale, 1));
}
.rules-import-export .rules-ie-hint {
font-size: calc(12px * var(--wekan-ui-font-scale, 1));
color: #727479;
margin-bottom: 0.3em;
}
.rules-import-export .rules-ie-textarea {
width: 100%;
box-sizing: border-box;
}
.rules-import-export .rules-ie-btns {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.rules-import-export .rules-ie-btns button {
flex: 1 1 auto;
}
.rules-import-export .rules-ie-message {
margin-top: 0.6em;
padding: 6px 8px;
background: #e8f0fe;
border-radius: 4px;
font-size: calc(13px * var(--wekan-ui-font-scale, 1));
}
/* #4294: empty-title validation on the "Add Rule" input. */
.rules-add .rules-field-error {
border: 1px solid #d9534f;
background: #fdf2f2;
}
.rules-add .rules-field-error-message {
margin: 0.3em 0 0;
color: #d9534f;
font-size: calc(12px * var(--wekan-ui-font-scale, 1));
}