mirror of
https://github.com/wekan/wekan.git
synced 2026-11-22 04:44:58 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b7110f2bd | ||
|
|
a9ee0fe874 | ||
|
|
f6e9ab0084 | ||
|
|
cda393614c | ||
|
|
91fea6e50d | ||
|
|
131260b5bc | ||
|
|
b3a1ba762c | ||
|
|
fd7836e99c | ||
|
|
1032b472f3 | ||
|
|
2ba6153617 | ||
|
|
69b034fa39 | ||
|
|
c039243a12 | ||
|
|
fcc8f19fe4 | ||
|
|
c6fbe2d099 | ||
|
|
2e8549032e | ||
|
|
240f0dad93 | ||
|
|
1d774f0d51 | ||
|
|
43bcffcbc9 | ||
|
|
e6875719f5 | ||
|
|
7273fa3e3c | ||
|
|
48b383be9a | ||
|
|
3c8b04109f | ||
|
|
5bb1753894 | ||
|
|
223f547a14 | ||
|
|
a2a13d61b0 | ||
|
|
d0c3af88f0 | ||
|
|
bb1cca3072 | ||
|
|
0bccf9c6a5 | ||
|
|
0f58d63375 | ||
|
|
6c54f2e339 | ||
|
|
15f32403d3 | ||
|
|
a6eea8c0e8 | ||
|
|
8f06265ee2 | ||
|
|
48568706fb | ||
|
|
7174dbbc0d | ||
|
|
d88662d69c | ||
|
|
9a0788a329 | ||
|
|
37bc16e1e5 | ||
|
|
13b0d5fe37 | ||
|
|
93285026b9 | ||
|
|
604b3dbe84 | ||
|
|
ae081a430c | ||
|
|
8652966a47 | ||
|
|
165dfa3c16 | ||
|
|
586c85848c | ||
|
|
1295418d3d | ||
|
|
c1a89b98fd | ||
|
|
7f9fc2e957 | ||
|
|
27c3716f3d | ||
|
|
eb0df61e7f | ||
|
|
bb4a013939 | ||
|
|
23c81e0b6c | ||
|
|
bc5bf3c25e | ||
|
|
b8734a8630 | ||
|
|
83bc49af81 | ||
|
|
a4e7a37509 | ||
|
|
464e0309bf | ||
|
|
cc4a494185 | ||
|
|
6903f630f0 | ||
|
|
3f5e4f3f14 | ||
|
|
b058dcee4d | ||
|
|
a8850a4f9c | ||
|
|
08412ca264 | ||
|
|
4f022b8af6 | ||
|
|
c28f6de378 | ||
|
|
035257dae9 | ||
|
|
17a8fd5c7f | ||
|
|
6f3f6cc5a8 | ||
|
|
20c67216fe | ||
|
|
a53b2fa68f | ||
|
|
02b101ad88 | ||
|
|
358927a114 | ||
|
|
01e88410cd | ||
|
|
046d854ec9 | ||
|
|
f5d2a208f8 | ||
|
|
38db577f31 | ||
|
|
71b0eb9b7c | ||
|
|
fa28e3fba8 | ||
|
|
79cc436257 | ||
|
|
67fa4344c6 | ||
|
|
7b2d37fb41 | ||
|
|
dffbafd30f | ||
|
|
dd57704ed1 | ||
|
|
d3aa34e7b8 | ||
|
|
c5f30d8b7f | ||
|
|
3a4163cfc3 | ||
|
|
2120be5ae1 | ||
|
|
c916b15473 | ||
|
|
0ef02911a8 | ||
|
|
246b23eaf7 | ||
|
|
b4e66b7584 | ||
|
|
9ceb4dbf55 | ||
|
|
49dd8dcb00 | ||
|
|
efeb55f57a | ||
|
|
85da7079fb | ||
|
|
bb733d7692 | ||
|
|
dd8242b82f | ||
|
|
709fa87f4a | ||
|
|
35f3f6c9db | ||
|
|
f918deef0f | ||
|
|
deb4eed14e | ||
|
|
828ca63713 | ||
|
|
133be01324 | ||
|
|
75694ac644 | ||
|
|
9a18cc3dda | ||
|
|
a72b297268 | ||
|
|
651378d163 | ||
|
|
ab884547f4 | ||
|
|
8ac7afe95f | ||
|
|
c72a05d11a | ||
|
|
01f52748f3 | ||
|
|
60f569afe6 | ||
|
|
d8fff9a41a | ||
|
|
f546ff2383 | ||
|
|
e38168789d | ||
|
|
ce646dc937 | ||
|
|
ae1f084fb1 | ||
|
|
cf6f67e789 | ||
|
|
3ccce83480 | ||
|
|
0d65eec4f2 | ||
|
|
b26b148779 | ||
|
|
57a657445e | ||
|
|
b5a97bcd11 | ||
|
|
a4359731b1 | ||
|
|
c05ff7b9a8 | ||
|
|
d7b0641295 | ||
|
|
105a1ed0c1 | ||
|
|
1a02de4b5b | ||
|
|
59ee94667d | ||
|
|
14afc74adb | ||
|
|
ab1067e0b1 | ||
|
|
9bd503a71b | ||
|
|
a81050e9b8 | ||
|
|
22d000b913 | ||
|
|
1081ea7c88 | ||
|
|
28891103f6 | ||
|
|
a86e9d34e8 | ||
|
|
57413fd66a | ||
|
|
1b9ec7b9a1 | ||
|
|
2268f9d8bd | ||
|
|
24b6b9b024 | ||
|
|
07f1028d03 | ||
|
|
c640c5c376 | ||
|
|
0999864cef | ||
|
|
1122e49ca9 | ||
|
|
f72277a398 | ||
|
|
f467e31d17 | ||
|
|
8ff76652d4 | ||
|
|
20c4d90217 | ||
|
|
10caa20b09 | ||
|
|
720374efd8 | ||
|
|
3be07b147b | ||
|
|
c2a9c36829 | ||
|
|
95b88095c4 | ||
|
|
18740f4c22 | ||
|
|
5b9fa791a8 | ||
|
|
b1ab04a764 | ||
|
|
55c3f574f4 | ||
|
|
1984f72d5e | ||
|
|
878e53f418 | ||
|
|
887fdc7e6d | ||
|
|
bfdb37526e | ||
|
|
dc0a1ad049 | ||
|
|
24ac6b2bd2 | ||
|
|
8440a5e0fb | ||
|
|
31a808be6e | ||
|
|
2ce90cb95e | ||
|
|
0c277c4d18 | ||
|
|
b0612ebe57 | ||
|
|
9f85b51695 | ||
|
|
9c3a543f0a | ||
|
|
49dbdbb6d6 | ||
|
|
17ab5f8459 | ||
|
|
6187806cf1 | ||
|
|
369dd91789 | ||
|
|
bd34f44460 | ||
|
|
2d823e16dc | ||
|
|
c9da13b63e | ||
|
|
80e653b4ba | ||
|
|
c0b3d9013d | ||
|
|
394a8fd32c | ||
|
|
d613a00030 | ||
|
|
d1a1d46b73 | ||
|
|
e8330fb090 | ||
|
|
a18d2a553c | ||
|
|
3ac8b802c5 | ||
|
|
1fa7af0679 | ||
|
|
df92d8de63 | ||
|
|
ba31f2b592 | ||
|
|
ba657b9ab7 | ||
|
|
c20c7296a8 | ||
|
|
9222a60e41 | ||
|
|
cde21a7651 | ||
|
|
d1be2d2131 | ||
|
|
5d8c4a7635 | ||
|
|
db9c06dc5e | ||
|
|
338674fd1e | ||
|
|
a2257442a8 | ||
|
|
03e2fb416d | ||
|
|
4666bb60f4 | ||
|
|
bd9ec7e585 | ||
|
|
21c64e092d | ||
|
|
fc502d7206 | ||
|
|
f293ae4076 | ||
|
|
df731e648c | ||
|
|
bad71f9a1e | ||
|
|
b021a8be99 | ||
|
|
e1261ef5fb | ||
|
|
46a66c623b | ||
|
|
ce40b56abd | ||
|
|
3cbf938ae8 | ||
|
|
fd5c207006 | ||
|
|
3a1d670155 | ||
|
|
4989cd0b51 | ||
|
|
2f7a4e210f | ||
|
|
524946c1bf | ||
|
|
6f67fd298e | ||
|
|
6aedd70eeb | ||
|
|
9ac7b916c0 | ||
|
|
5673fd3bcd | ||
|
|
0071dde0f3 | ||
|
|
94ad2fd958 | ||
|
|
4fad2a9000 | ||
|
|
735f52ed11 | ||
|
|
e2cbbe5104 | ||
|
|
4e23929ee6 | ||
|
|
60bbf69164 | ||
|
|
905f60a1ea | ||
|
|
11992ac951 | ||
|
|
640e492593 | ||
|
|
e54c0f4646 | ||
|
|
d1732bd3a5 | ||
|
|
3b1c7ce7bb | ||
|
|
0d8f8b8d96 | ||
|
|
63b5e089f5 | ||
|
|
32c24ed84e | ||
|
|
257835733b | ||
|
|
ef8e82200f | ||
|
|
ccfa6cf362 | ||
|
|
c4da72ff72 | ||
|
|
96e730922e | ||
|
|
a24e3a49a9 | ||
|
|
c0339ccc59 | ||
|
|
b00e2c8133 | ||
|
|
60c25690df | ||
|
|
0ccf182001 | ||
|
|
42959d02f1 | ||
|
|
360387890f | ||
|
|
faf12ea1d5 | ||
|
|
114fb7f235 | ||
|
|
1933025bc8 | ||
|
|
e1d6ad77c0 | ||
|
|
3569b3795f | ||
|
|
97809cbb33 | ||
|
|
08143879d1 | ||
|
|
bf8f45fb5a | ||
|
|
84a4334206 | ||
|
|
cc90b358a0 | ||
|
|
d49922a6da | ||
|
|
985cd8d4a1 | ||
|
|
57ebedf392 | ||
|
|
aa2605b97f | ||
|
|
5a03999896 | ||
|
|
80fb1c65fc | ||
|
|
b590e17820 | ||
|
|
7c92cf3298 | ||
|
|
914a79da0b | ||
|
|
b5495d83d7 | ||
|
|
ccd4a5a78c | ||
|
|
0d9c8c1250 | ||
|
|
f413e53835 | ||
|
|
a8fd080bc8 | ||
|
|
e1a053d059 | ||
|
|
58158ca9ab | ||
|
|
4a8fb736e5 | ||
|
|
4fb99602b6 | ||
|
|
31ea58c408 | ||
|
|
ea680e5389 | ||
|
|
1eb00ff8cb | ||
|
|
31dafef73d | ||
|
|
907e0bd89d | ||
|
|
fb7ab1dc2d | ||
|
|
5539e38242 | ||
|
|
d301fd39f8 | ||
|
|
8cab0730b4 | ||
|
|
daedcf7eee | ||
|
|
cdbf67d359 | ||
|
|
71acbba05c | ||
|
|
c536867b7f | ||
|
|
dfc51e0eae | ||
|
|
1b3b074bf1 | ||
|
|
ec2ea4ca31 | ||
|
|
793683c4c7 | ||
|
|
4e16699fe4 | ||
|
|
ad18fe00e9 | ||
|
|
bb87b93c6e | ||
|
|
298f68dc40 | ||
|
|
5b8341e014 | ||
|
|
96b34e8d9b | ||
|
|
2059ef7612 | ||
|
|
4810de82d6 | ||
|
|
b015f76225 | ||
|
|
18e04f4f02 | ||
|
|
8b7462a1c5 | ||
|
|
7c0f0a2e91 | ||
|
|
1db8366a37 | ||
|
|
3d42a1101c | ||
|
|
65b6eed3b7 | ||
|
|
46adbd0608 | ||
|
|
ffd5c89b6d | ||
|
|
b094d53ff8 | ||
|
|
bbc988b1a8 | ||
|
|
4670cf781c | ||
|
|
4f5aa339b3 | ||
|
|
4992f9d203 | ||
|
|
e812fe45a7 | ||
|
|
c0ff740263 | ||
|
|
05e95004b5 | ||
|
|
cbd27a2c8c | ||
|
|
7f946df622 | ||
|
|
caf5e67842 | ||
|
|
c172b6639d | ||
|
|
383fc6de98 | ||
|
|
79d7141e09 | ||
|
|
6ae104c686 | ||
|
|
38b28fb3e3 | ||
|
|
e2c8e58c20 | ||
|
|
197725ae19 | ||
|
|
59f3e73117 | ||
|
|
39bb89c4a7 | ||
|
|
a833d95adc | ||
|
|
5285ca918a | ||
|
|
cfd9a62466 | ||
|
|
1293dc6b45 | ||
|
|
fc21b0b177 | ||
|
|
2ea288d7c5 | ||
|
|
a0f3681961 | ||
|
|
96430d4679 | ||
|
|
ee24453dcb | ||
|
|
3202a1d7ac | ||
|
|
16f208cb47 | ||
|
|
da6d9d39b8 | ||
|
|
941e1794f7 | ||
|
|
d2966d0624 | ||
|
|
26c457b18e | ||
|
|
879627c641 | ||
|
|
ab10ade956 | ||
|
|
7459c5bde6 | ||
|
|
f23695cc1b | ||
|
|
ba3d94390b | ||
|
|
22dae19a64 | ||
|
|
74dd0b705e | ||
|
|
aacb2fd4d6 | ||
|
|
d1e0bae6a5 | ||
|
|
320a3ca867 | ||
|
|
58ba1e4b3b | ||
|
|
ba9504d6db | ||
|
|
6f7292cffd | ||
|
|
8c1152f234 | ||
|
|
f1fe22ac16 | ||
|
|
333928f123 | ||
|
|
bd6b00c5f4 | ||
|
|
c5344761d8 | ||
|
|
075e6dbe73 | ||
|
|
f34fee6582 | ||
|
|
e30c439fa7 | ||
|
|
6bf2d53d75 | ||
|
|
b6bc2b200c | ||
|
|
c060c6d2db | ||
|
|
7c3b798a1d | ||
|
|
26e27f62c4 | ||
|
|
f1adc7982e | ||
|
|
b8fd94a7e7 | ||
|
|
8abb9504bb | ||
|
|
a9059b7b15 | ||
|
|
399a8defec | ||
|
|
ede46c7a98 | ||
|
|
e4115e6890 | ||
|
|
72ee1c8b23 | ||
|
|
2033c177ce | ||
|
|
db3f489ab2 | ||
|
|
11fc468ff7 | ||
|
|
5f06b28aef | ||
|
|
049b628a03 | ||
|
|
6d8d2a7699 | ||
|
|
79a98822cb | ||
|
|
c59c751547 | ||
|
|
c739eaeeee | ||
|
|
ac365ef116 | ||
|
|
997c6d88ad | ||
|
|
5f92c8efec | ||
|
|
320e98269e | ||
|
|
dc80a93041 | ||
|
|
bf70908c0a | ||
|
|
baaeea27e3 | ||
|
|
c7a496c9cf | ||
|
|
5be568495e | ||
|
|
ebcdf327b0 | ||
|
|
e3da773d03 | ||
|
|
b35184d487 | ||
|
|
db3b12fac2 | ||
|
|
a34beaa62b | ||
|
|
138f727ebb | ||
|
|
39ee1d9512 | ||
|
|
b05972c4c8 | ||
|
|
495a6faa63 | ||
|
|
8eff8bb442 | ||
|
|
00b0431685 | ||
|
|
a364e75025 | ||
|
|
040d853c8e | ||
|
|
79676b3790 | ||
|
|
5ec3aaf85f | ||
|
|
cc302acdd1 | ||
|
|
77c22918d7 | ||
|
|
1051265fc8 | ||
|
|
7875220470 | ||
|
|
628a69c086 |
No files matched your search
@@ -149,8 +149,8 @@ jobs:
|
||||
esac
|
||||
docker run --rm --security-opt seccomp=unconfined -v "$PWD:/work" -w /work \
|
||||
"termux/termux-docker:$TERMUX_ARCH" env "ARCH=$ARCH" DO_NOT_TRACK=1 bash -ec '
|
||||
apt-get update
|
||||
apt-get install -y nodejs-lts python make clang pkg-config libvips curl procps file
|
||||
APT_ATTEMPTS=5 APT_SLEEPS="30 60 120 180" bash releases/apt-install.sh \
|
||||
nodejs-lts python make clang pkg-config libvips curl procps file
|
||||
bash releases/android/build-bundle.sh "$ARCH"'
|
||||
|
||||
- name: Package
|
||||
|
||||
@@ -153,7 +153,15 @@ jobs:
|
||||
arch: ${{ matrix.vm_arch }}
|
||||
sync: rsync
|
||||
copyback: true
|
||||
prepare: pkg install -y bash python3 gmake pkgconf curl
|
||||
prepare: |
|
||||
# A package mirror that is briefly unreachable ("No route to host",
|
||||
# v13.18) is waited out instead of failing the build.
|
||||
for i in 1 2 3 4 5; do
|
||||
pkg install -y bash python3 gmake pkgconf curl && break
|
||||
[ "$i" = 5 ] && { echo "::error::Installing the VM's packages failed 5 times: the package mirror is down, not WeKan. Re-run this job."; exit 1; }
|
||||
echo "Package install failed (attempt $i/5), retrying."
|
||||
sleep $((i * 30))
|
||||
done
|
||||
run: bash releases/bsd/build-bundle.sh freebsd ${{ matrix.arch }}
|
||||
|
||||
- name: Build and start in OpenBSD
|
||||
@@ -164,7 +172,15 @@ jobs:
|
||||
arch: ${{ matrix.vm_arch }}
|
||||
sync: rsync
|
||||
copyback: true
|
||||
prepare: pkg_add bash python%3 gmake curl
|
||||
prepare: |
|
||||
# A package mirror that is briefly unreachable ("No route to host",
|
||||
# v13.18) is waited out instead of failing the build.
|
||||
for i in 1 2 3 4 5; do
|
||||
pkg_add bash python%3 gmake curl && break
|
||||
[ "$i" = 5 ] && { echo "::error::Installing the VM's packages failed 5 times: the package mirror is down, not WeKan. Re-run this job."; exit 1; }
|
||||
echo "Package install failed (attempt $i/5), retrying."
|
||||
sleep $((i * 30))
|
||||
done
|
||||
# V8 writes and runs machine code: OpenBSD allows that only from a
|
||||
# filesystem mounted wxallowed (/usr/local is, by default). The
|
||||
# bundle is started here, from the workspace, so that is mounted so.
|
||||
@@ -180,8 +196,15 @@ jobs:
|
||||
sync: rsync
|
||||
copyback: true
|
||||
prepare: |
|
||||
/usr/sbin/pkg_add pkgin
|
||||
pkgin -y install bash python313 gmake curl gcc14
|
||||
# A package mirror that is briefly unreachable ("No route to host",
|
||||
# v13.18) is waited out instead of failing the build.
|
||||
for i in 1 2 3 4 5; do
|
||||
{ command -v pkgin >/dev/null || /usr/sbin/pkg_add pkgin; } &&
|
||||
pkgin -y install bash python313 gmake curl gcc14 && break
|
||||
[ "$i" = 5 ] && { echo "::error::Installing the VM's packages failed 5 times: the package mirror is down, not WeKan. Re-run this job."; exit 1; }
|
||||
echo "Package install failed (attempt $i/5), retrying."
|
||||
sleep $((i * 30))
|
||||
done
|
||||
# Node 26's headers need C++20, which NetBSD 10's own GCC lacks: the
|
||||
# native modules are compiled with pkgsrc's GCC 14, as Node.js itself
|
||||
# is (wekan/node-patches dist/netbsd).
|
||||
|
||||
@@ -232,8 +232,11 @@ jobs:
|
||||
"TARGET=$TARGET" "TARGET_PLATFORM=$TARGET_PLATFORM" \
|
||||
"TARGET_ARCH=$TARGET_ARCH" "RELEASE_TAG=$RELEASE_TAG" \
|
||||
DO_NOT_TRACK=1 bash -ec '
|
||||
apt-get update
|
||||
apt-get install -y nodejs-lts python make clang pkg-config libvips
|
||||
# A Termux mirror mid-sync fails the index ("File has unexpected
|
||||
# size ... Mirror sync in progress?", v13.18): apt-install.sh waits
|
||||
# it out.
|
||||
APT_ATTEMPTS=5 APT_SLEEPS="30 60 120 180" bash releases/apt-install.sh \
|
||||
nodejs-lts python make clang pkg-config libvips
|
||||
bash releases/bun/build-target.sh'
|
||||
- name: FreeBSD VM build and smoke tests
|
||||
if: matrix.kind == 'freebsd'
|
||||
@@ -245,7 +248,15 @@ jobs:
|
||||
sync: rsync
|
||||
copyback: true
|
||||
cache-after-prepare: true
|
||||
prepare: pkg install -y bash node24 npm-node24 python3 gmake pkgconf vips
|
||||
prepare: |
|
||||
# A package mirror that is briefly unreachable ("No route to host",
|
||||
# v13.18) is waited out instead of failing the build.
|
||||
for i in 1 2 3 4 5; do
|
||||
pkg install -y bash node24 npm-node24 python3 gmake pkgconf vips && break
|
||||
[ "$i" = 5 ] && { echo "::error::Installing the VM's packages failed 5 times: the package mirror is down, not WeKan. Re-run this job."; exit 1; }
|
||||
echo "Package install failed (attempt $i/5), retrying."
|
||||
sleep $((i * 30))
|
||||
done
|
||||
run: bash releases/bun/build-target.sh
|
||||
- name: Check finished archive exists
|
||||
id: ready
|
||||
|
||||
@@ -14,4 +14,4 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: 'Dependency Review'
|
||||
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
|
||||
uses: actions/dependency-review-action@bbc44d14a204704ccc493733616cd1e93a0321ec # v5.0.1
|
||||
@@ -53,9 +53,14 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Release to complete, without the v (e.g. 10.58). Empty = the newest release.'
|
||||
description: 'Release to complete, without the v (e.g. 10.58). Empty = check the newest releases and complete each one that is missing something.'
|
||||
required: false
|
||||
type: string
|
||||
scan:
|
||||
description: 'With no version: how many of the newest releases to check.'
|
||||
required: false
|
||||
type: string
|
||||
default: '10'
|
||||
|
||||
# Read-only by default; the job that writes is granted it below.
|
||||
permissions:
|
||||
@@ -74,6 +79,10 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
recover:
|
||||
# One release at a time: with no version, scan below starts a run of this
|
||||
# workflow for every release that is missing something, and each of those
|
||||
# recovers its own release.
|
||||
if: ${{ inputs.version != '' }}
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
@@ -95,6 +104,41 @@ jobs:
|
||||
[ -n "$V" ] || V="$(gh release view --repo "$GITHUB_REPOSITORY" --json tagName --jq .tagName)"
|
||||
python3 releases/retry-failed-release.py "$V"
|
||||
|
||||
# With no version: which releases are missing something. Each of them gets a
|
||||
# run of its own (`-f version=...`), which does everything below for it -
|
||||
# retries the failed jobs of its full release, builds what can be built,
|
||||
# renames the variant snaps and finishes its Snap Store release - so one
|
||||
# run of this workflow, with no input, adds everything that is missing.
|
||||
scan:
|
||||
if: ${{ inputs.version == '' }}
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
timeout-minutes: 15
|
||||
name: which releases are missing something
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Start a run for each incomplete release
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
SCAN: ${{ inputs.scan }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
case "${SCAN:-10}" in ''|*[!0-9]*) echo "::error::scan must be a number of releases, not '$SCAN'."; exit 1 ;; esac
|
||||
bash releases/release-missing-scan.sh "${GITHUB_REPOSITORY:-wekan/wekan}" "${SCAN:-10}" > incomplete.txt
|
||||
{
|
||||
echo "### Releases missing something"
|
||||
echo ""
|
||||
if [ -s incomplete.txt ]; then sed 's/^/- /' incomplete.txt; else echo "None - the ${SCAN:-10} newest releases are complete."; fi
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
while read -r version count; do
|
||||
echo "v$version is missing $count asset(s): starting Release all missing for it."
|
||||
gh workflow run release-all-missing.yml --repo "${GITHUB_REPOSITORY:-wekan/wekan}" --ref "${GITHUB_REF_NAME:-main}" -f version="$version"
|
||||
done < incomplete.txt
|
||||
|
||||
plan:
|
||||
needs: recover
|
||||
# The planner runs whatever recover's rerun ended with. A rerun that still
|
||||
@@ -102,7 +146,7 @@ jobs:
|
||||
# so in every rerun of it (v12.68's OpenBSD start) - used to skip the
|
||||
# planner and every build after it, so not even the assets that COULD be
|
||||
# filled were. recover stays red and names the jobs; the rest goes on.
|
||||
if: ${{ !cancelled() }}
|
||||
if: ${{ !cancelled() && inputs.version != '' }}
|
||||
timeout-minutes: 15
|
||||
name: what the release is missing
|
||||
runs-on: ubuntu-latest
|
||||
@@ -114,6 +158,8 @@ jobs:
|
||||
mac: ${{ steps.plan.outputs.mac }}
|
||||
flatpak: ${{ steps.plan.outputs.flatpak }}
|
||||
windows: ${{ steps.plan.outputs.windows }}
|
||||
variant: ${{ steps.plan.outputs.variant }}
|
||||
snap: ${{ steps.plan.outputs.snap }}
|
||||
manual: ${{ steps.plan.outputs.manual }}
|
||||
total: ${{ steps.plan.outputs.total }}
|
||||
steps:
|
||||
@@ -168,7 +214,7 @@ jobs:
|
||||
total="$(wc -l < missing.txt | tr -d ' ')"
|
||||
echo "total=$total" >> "$GITHUB_OUTPUT"
|
||||
|
||||
for kind in extra appimage mac flatpak windows bun; do
|
||||
for kind in extra appimage mac flatpak windows bun variant snap; do
|
||||
sels="$(awk -v k="$kind" '$1 == k { print $2 }' missing.txt)"
|
||||
json="$(printf '%s\n' $sels | sed '/^$/d' | jq -R . | jq -sc .)"
|
||||
[ -n "$json" ] || json='[]'
|
||||
@@ -197,18 +243,25 @@ jobs:
|
||||
echo ""
|
||||
echo "Not buildable here (run release-all.yml): \`$manual\`"
|
||||
fi
|
||||
if grep -q '^snap ' missing.txt; then
|
||||
echo ""
|
||||
echo "wekan snaps are rebuilt by retrying the release's snap-native or snap-launchpad job (recover, above)."
|
||||
fi
|
||||
fi
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "Missing $total. Needs release-all.yml: ${manual:-none}"
|
||||
|
||||
# Not a failure HERE: a red plan skipped every build below (they need
|
||||
# plan to succeed), so a release missing its amd64 zip did not get even
|
||||
# the AppImages that could be made. The done job, at the end, is red
|
||||
# for it instead.
|
||||
- name: Say plainly what this run will not do
|
||||
if: ${{ steps.plan.outputs.manual != '' }}
|
||||
env:
|
||||
STEP_PLAN_VERSION: ${{ steps.plan.outputs.version }}
|
||||
STEP_PLAN_MANUAL: ${{ steps.plan.outputs.manual }}
|
||||
run: |
|
||||
echo "::error::v${STEP_PLAN_VERSION} still lacks ${STEP_PLAN_MANUAL} after recovery. Inspect the matching full-release run; older unnamed runs need their failed jobs retried manually."
|
||||
exit 1
|
||||
echo "::warning::v${STEP_PLAN_VERSION} still lacks ${STEP_PLAN_MANUAL} after recovery, which this workflow cannot build; the rest is built anyway. Inspect the matching full-release run; older unnamed runs need their failed jobs retried manually."
|
||||
|
||||
# The six architectures nobody else builds for, repacked from the PUBLISHED
|
||||
# amd64 bundle - which is what makes this possible without a Meteor build.
|
||||
@@ -517,6 +570,74 @@ jobs:
|
||||
esac
|
||||
echo "$mark charts" >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
# wekan-ondra and wekan-gantt-gpl snaps the release lacks: the release's own
|
||||
# wekan snap of that architecture under the variant's name and title
|
||||
# (releases/snap-rename.sh) - what snap-variants builds from source, with
|
||||
# nothing else changed. Releases before v13.21 have none attached.
|
||||
variants:
|
||||
permissions:
|
||||
contents: write
|
||||
name: variant snap ${{ matrix.variant }}
|
||||
needs: plan
|
||||
if: ${{ !cancelled() && needs.plan.result == 'success' && needs.plan.outputs.variant != '[]' }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
variant: ${{ fromJSON(needs.plan.outputs.variant) }}
|
||||
env:
|
||||
VERSION: ${{ needs.plan.outputs.version }}
|
||||
VARIANT: ${{ matrix.variant }}
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Rename the release's wekan snap
|
||||
id: rename
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
name="${VARIANT%%:*}"
|
||||
arch="${VARIANT#*:}"
|
||||
case "$name" in
|
||||
wekan-ondra) title='Wekan Ondra' ;;
|
||||
wekan-gantt-gpl) title='Wekan Gantt GPL' ;;
|
||||
*) echo "::error::'$name' is not a variant snap."; exit 1 ;;
|
||||
esac
|
||||
case "$arch" in *[!a-z0-9]*|'') echo "::error::'$arch' is not an architecture."; exit 1 ;; esac
|
||||
sudo apt-get install -y squashfs-tools >/dev/null
|
||||
mkdir -p source out
|
||||
if ! gh release download "v$VERSION" --repo "$GITHUB_REPOSITORY" --dir source --pattern "wekan_${VERSION}_${arch}.snap"; then
|
||||
echo "::error::v$VERSION has no wekan_${VERSION}_${arch}.snap to make $name from. Retry the release's snap job first (recover does), then run this again."
|
||||
exit 1
|
||||
fi
|
||||
bash releases/snap-rename.sh "source/wekan_${VERSION}_${arch}.snap" "$name" "$title" out
|
||||
- name: Attach it to the release
|
||||
if: ${{ always() && steps.rename.outcome == 'success' }}
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
bash releases/github-release-upload.sh "$GITHUB_REPOSITORY" "v$VERSION" out/*.snap
|
||||
|
||||
# Every snap of the release, in every channel of its snap name: the same
|
||||
# "Push Snap to Store" that release-all.yml ends with. A revision the store
|
||||
# already has is released by number; nothing is uploaded twice.
|
||||
snap-store:
|
||||
needs: [plan, variants]
|
||||
if: ${{ !cancelled() && needs.plan.result == 'success' }}
|
||||
permissions:
|
||||
contents: read
|
||||
uses: ./.github/workflows/snap-store.yml
|
||||
with:
|
||||
tag: v${{ needs.plan.outputs.version }}
|
||||
snaps: wekan wekan-ondra wekan-gantt-gpl
|
||||
channels: stable,candidate,beta,edge
|
||||
secrets:
|
||||
SNAP_AUTH: ${{ secrets.SNAP_AUTH }}
|
||||
|
||||
# The end of the run attaches nothing: every job above attached its own files
|
||||
# as it finished them. This only reports what the release still lacks, and it
|
||||
# runs on always() - not !cancelled() - so a cancelled run still says what
|
||||
@@ -525,7 +646,7 @@ jobs:
|
||||
done:
|
||||
timeout-minutes: 15
|
||||
name: what is still missing
|
||||
needs: [plan, extra-arches, appimage, mac, flatpak, windows-exe, charts, bun]
|
||||
needs: [plan, extra-arches, appimage, mac, flatpak, windows-exe, charts, bun, variants, snap-store]
|
||||
if: ${{ always() && needs.plan.result == 'success' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@@ -566,3 +687,10 @@ jobs:
|
||||
echo "::warning::v$V is still missing:${still}"
|
||||
echo "Still missing:\`${still# }\`" >> "$GITHUB_STEP_SUMMARY"
|
||||
fi
|
||||
# What only release-all.yml can build, still missing: red here,
|
||||
# once everything that could be built has been.
|
||||
case " $still" in
|
||||
*" meteor/"*|*" repack/"*|*" sandstorm/"*)
|
||||
echo "::error::v$V still lacks what only release-all.yml builds:${still}. Inspect the matching full-release run."
|
||||
exit 1 ;;
|
||||
esac
|
||||
@@ -5530,6 +5530,10 @@ jobs:
|
||||
needs: [prepare, release, snap-auth-check]
|
||||
continue-on-error: true
|
||||
timeout-minutes: 90
|
||||
# contents: write attaches the built snap to the GitHub Release; the
|
||||
# workflow's default is read.
|
||||
permissions:
|
||||
contents: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -5655,6 +5659,7 @@ jobs:
|
||||
echo "snap=$BUILT_SNAP" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Verify the built snap is ${{ matrix.snapname }}
|
||||
id: verify
|
||||
if: steps.guard.outputs.snap == 'true'
|
||||
env:
|
||||
STEP_BUILD_SNAP: ${{ steps.build.outputs.snap }}
|
||||
@@ -5684,6 +5689,21 @@ jobs:
|
||||
SNAP_UPLOAD_LABEL="${STEP_BUILD_SNAP}" \
|
||||
bash "$GITHUB_WORKSPACE/wekan/releases/snap-upload-retry.sh" "${STEP_BUILD_SNAP}" stable,candidate,beta,edge
|
||||
|
||||
# always(): a built variant snap goes onto the GitHub Release even when the
|
||||
# Snap Store push above failed. "Push Snap to Store"
|
||||
# (.github/workflows/snap-store.yml) releases the snaps OF A GITHUB
|
||||
# RELEASE to the store - and until v13.21 this job only uploaded to the
|
||||
# store, so v13.20 had no wekan-ondra_*.snap or wekan-gantt-gpl_*.snap and
|
||||
# that workflow failed with "no assets match the file pattern".
|
||||
- name: Attach the ${{ matrix.snapname }} ${{ matrix.arch }} snap to the GitHub Release
|
||||
if: ${{ always() && steps.verify.outcome == 'success' && steps.build.outputs.snap != '' }}
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
STEP_BUILD_SNAP: ${{ steps.build.outputs.snap }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
bash "$GITHUB_WORKSPACE/wekan/releases/github-release-upload.sh" "${GITHUB_REPOSITORY:-wekan/wekan}" "v${VERSION}" "${STEP_BUILD_SNAP}"
|
||||
|
||||
# Always, as the last step: the run summary then answers "what worked and what
|
||||
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
||||
# step that failed has already printed an ::error:: saying why; this names the
|
||||
@@ -5710,6 +5730,28 @@ jobs:
|
||||
|
||||
# Refresh the selected changelog notes after builds. Binary provenance remains
|
||||
# in build artifacts and is never appended to release notes.
|
||||
# ─── Finish the Snap Store release of all three snaps ───────────────────────
|
||||
# snap-native, snap-launchpad and snap-variants upload each snap with
|
||||
# --release to every channel, but the store can keep a revision in
|
||||
# "processing" for hours and then not release it: on v13.20 every snap job
|
||||
# was green and the store kept the old version of wekan, wekan-ondra and
|
||||
# wekan-gantt-gpl. This job takes the snaps those jobs attached to THIS
|
||||
# release and releases each to stable, candidate, beta and edge - a revision
|
||||
# the store already has by number, a missing one by uploading it - and is red
|
||||
# when one did not get there. It also runs by hand as "Push Snap to Store".
|
||||
snap-store:
|
||||
needs: [prepare, snap-native, snap-launchpad, snap-variants]
|
||||
if: ${{ !cancelled() && needs.prepare.result == 'success' }}
|
||||
permissions:
|
||||
contents: read
|
||||
uses: ./.github/workflows/snap-store.yml
|
||||
with:
|
||||
tag: v${{ needs.prepare.outputs.version }}
|
||||
snaps: wekan wekan-ondra wekan-gantt-gpl
|
||||
channels: stable,candidate,beta,edge
|
||||
secrets:
|
||||
SNAP_AUTH: ${{ secrets.SNAP_AUTH }}
|
||||
|
||||
release-notes:
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
@@ -185,8 +185,7 @@ jobs:
|
||||
esac
|
||||
chmod +x host32/node
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq libc6:i386 libstdc++6:i386 libatomic1:i386 >/dev/null
|
||||
bash releases/apt-install.sh libc6:i386 libstdc++6:i386 libatomic1:i386
|
||||
host="$PWD/host32/node"
|
||||
got="$("$host" -p process.version)"
|
||||
[ "$got" = "$NODE_VERSION" ] || { echo "::error::The i386 Node.js resolved for $NODE_VERSION reports $got."; exit 1; }
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
name: Push Snap to Store
|
||||
|
||||
# Puts the .snap files of a GitHub release on the Snap Store and RELEASES them
|
||||
# to every channel: wekan, wekan-ondra and wekan-gantt-gpl, every architecture
|
||||
# the release carries.
|
||||
#
|
||||
# WHY: release-all.yml uploads each snap as it builds it, with
|
||||
# `snapcraft upload --release=...`. The store can keep a revision in
|
||||
# "processing" for hours, and an upload that gives up waiting leaves the
|
||||
# release to the store - the job is green either way. On v13.20 every build
|
||||
# was green and the snaps were on the GitHub release, but the Snap Store kept
|
||||
# the old version. This workflow finishes that from the release itself,
|
||||
# without building anything: releases/snap-store-push.sh releases a revision
|
||||
# the store already has, uploads one it has not, waits for one still
|
||||
# processing, and FAILS - red, not green - when a snap still did not reach a
|
||||
# channel.
|
||||
#
|
||||
# "Release All Platforms" calls it as its last snap job, for the tag it just
|
||||
# released (its snap-store job), and it runs by hand from the Actions tab for
|
||||
# any release, snap names and channels. It used to run on workflow_run after
|
||||
# every Release All run and take "the latest release" - which, for a run that
|
||||
# finished before its release was published, was the previous one (v13.20).
|
||||
#
|
||||
# Secrets: SNAP_AUTH, as for release-all.yml - an exported login carrying
|
||||
# package_access, package_push, package_release and package_update for all
|
||||
# three names.
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Release tag (e.g. v13.20). Empty: the latest release.'
|
||||
required: false
|
||||
default: ''
|
||||
snaps:
|
||||
description: 'Snap names, space separated'
|
||||
required: false
|
||||
default: 'wekan wekan-ondra wekan-gantt-gpl'
|
||||
channels:
|
||||
description: 'Channels to release to'
|
||||
required: false
|
||||
default: 'stable,candidate,beta,edge'
|
||||
workflow_call:
|
||||
inputs:
|
||||
tag:
|
||||
type: string
|
||||
required: true
|
||||
snaps:
|
||||
type: string
|
||||
required: false
|
||||
default: 'wekan wekan-ondra wekan-gantt-gpl'
|
||||
channels:
|
||||
type: string
|
||||
required: false
|
||||
default: 'stable,candidate,beta,edge'
|
||||
secrets:
|
||||
SNAP_AUTH:
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: snap-store
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
DO_NOT_TRACK: 1
|
||||
|
||||
jobs:
|
||||
plan:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
outputs:
|
||||
tag: ${{ steps.plan.outputs.tag }}
|
||||
snaps: ${{ steps.plan.outputs.snaps }}
|
||||
channels: ${{ steps.plan.outputs.channels }}
|
||||
steps:
|
||||
- name: Which release, which snaps, which channels
|
||||
id: plan
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
INPUT_TAG: ${{ inputs.tag }}
|
||||
INPUT_SNAPS: ${{ inputs.snaps }}
|
||||
INPUT_CHANNELS: ${{ inputs.channels }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
tag="${INPUT_TAG:-}"
|
||||
if [ -z "$tag" ]; then
|
||||
tag="$(gh release view --repo "$GITHUB_REPOSITORY" --json tagName --jq .tagName)"
|
||||
fi
|
||||
case "$tag" in v[0-9]*) ;; *) echo "::error::'$tag' is not a release tag like v13.20."; exit 1 ;; esac
|
||||
snaps="${INPUT_SNAPS:-wekan wekan-ondra wekan-gantt-gpl}"
|
||||
for s in $snaps; do
|
||||
case "$s" in wekan|wekan-ondra|wekan-gantt-gpl) ;; *) echo "::error::'$s' is not one of WeKan's snaps (wekan, wekan-ondra, wekan-gantt-gpl)."; exit 1 ;; esac
|
||||
done
|
||||
channels="${INPUT_CHANNELS:-stable,candidate,beta,edge}"
|
||||
case "$channels" in *[!a-z0-9/,.-]*) echo "::error::'$channels' is not a channel list."; exit 1 ;; esac
|
||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||
echo "snaps=$(printf '%s\n' $snaps | jq -R . | jq -cs .)" >> "$GITHUB_OUTPUT"
|
||||
echo "channels=$channels" >> "$GITHUB_OUTPUT"
|
||||
echo "Release $tag: $snaps -> $channels"
|
||||
|
||||
push:
|
||||
needs: [plan]
|
||||
runs-on: ubuntu-24.04
|
||||
# One snap name per job; its architectures one after another. A store
|
||||
# still processing may take the whole wait of snap-store-push.sh.
|
||||
timeout-minutes: 360
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
snap: ${{ fromJSON(needs.plan.outputs.snaps) }}
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
sparse-checkout: releases
|
||||
persist-credentials: false
|
||||
- name: Install snapcraft and check SNAP_AUTH
|
||||
id: snapcraft
|
||||
env:
|
||||
SNAP_AUTH: ${{ secrets.SNAP_AUTH }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -z "${SNAP_AUTH:-}" ]; then
|
||||
echo "::error::SNAP_AUTH is not set. snapcraft export-login --snaps wekan,wekan-ondra,wekan-gantt-gpl --acls package_access,package_push,package_release,package_update snap-auth.txt && gh secret set SNAP_AUTH --repo wekan/wekan < snap-auth.txt"
|
||||
exit 1
|
||||
fi
|
||||
installed=""
|
||||
for i in 1 2 3 4 5; do
|
||||
if timeout 180 sudo snap install snapcraft --classic; then installed=1; break; fi
|
||||
sudo snap abort --last=install >/dev/null 2>&1 || true
|
||||
echo "snapcraft install attempt $i/5 failed; retrying in 30s..."
|
||||
sleep 30
|
||||
done
|
||||
[ -n "$installed" ] || { echo "::error::snapcraft could not be installed: the Snap Store did not answer. Re-run the job."; exit 1; }
|
||||
SNAPCRAFT_STORE_CREDENTIALS="$SNAP_AUTH" snapcraft whoami
|
||||
- name: Download ${{ matrix.snap }} from ${{ needs.plan.outputs.tag }}
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
TAG: ${{ needs.plan.outputs.tag }}
|
||||
SNAP: ${{ matrix.snap }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p snaps
|
||||
# A release cut before v13.22 has no wekan-ondra or wekan-gantt-gpl
|
||||
# snap attached (snap-variants did not attach them). A variant IS
|
||||
# wekan with another name and title, so it is made from the
|
||||
# release's wekan snaps (releases/snap-rename.sh), as Release All
|
||||
# Missing does.
|
||||
if ! gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --dir snaps --pattern "${SNAP}_*.snap"; then
|
||||
case "$SNAP" in
|
||||
wekan-ondra) title='Wekan Ondra' ;;
|
||||
wekan-gantt-gpl) title='Wekan Gantt GPL' ;;
|
||||
*) echo "::error::Release $TAG has no ${SNAP}_*.snap to push: its snap job did not attach one (snap-native and snap-launchpad attach wekan). Re-run that job of the release, or Release All Missing, then this workflow."; exit 1 ;;
|
||||
esac
|
||||
mkdir -p wekan-snaps
|
||||
if ! gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --dir wekan-snaps --pattern "wekan_*.snap"; then
|
||||
echo "::error::Release $TAG has neither ${SNAP}_*.snap nor a wekan_*.snap to make it from. Re-run the release's snap jobs, or Release All Missing, then this workflow."
|
||||
exit 1
|
||||
fi
|
||||
sudo apt-get install -y squashfs-tools >/dev/null
|
||||
for f in wekan-snaps/wekan_*.snap; do
|
||||
bash releases/snap-rename.sh "$f" "$SNAP" "$title" snaps
|
||||
done
|
||||
echo "::notice::$TAG had no ${SNAP} snap; made it from the release's wekan snaps."
|
||||
fi
|
||||
ls -l snaps
|
||||
- name: Push ${{ matrix.snap }} to the Snap Store, releasing to ${{ needs.plan.outputs.channels }}
|
||||
env:
|
||||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_AUTH }}
|
||||
CHANNELS: ${{ needs.plan.outputs.channels }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
failed=""
|
||||
for f in snaps/*.snap; do
|
||||
# Each architecture on its own: one that the store is still
|
||||
# processing does not stop the others.
|
||||
if ! bash releases/snap-store-push.sh "$f" "$CHANNELS"; then failed="$failed $(basename "$f")"; fi
|
||||
done
|
||||
if [ -n "$failed" ]; then
|
||||
echo "::error::Not released:$failed. The ::error:: lines above say why."
|
||||
exit 1
|
||||
fi
|
||||
# The newest revision the store has of each architecture, released to
|
||||
# every channel too - one that reached the store some other way, or a
|
||||
# reviewer approved later, whatever this release's files are. always():
|
||||
# also when a file above was not taken.
|
||||
- name: Release the newest ${{ matrix.snap }} revisions the store has to ${{ needs.plan.outputs.channels }}
|
||||
if: ${{ always() && steps.snapcraft.outcome == 'success' }}
|
||||
env:
|
||||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_AUTH }}
|
||||
CHANNELS: ${{ needs.plan.outputs.channels }}
|
||||
SNAP: ${{ matrix.snap }}
|
||||
run: bash releases/snap-store-release-newest.sh "$SNAP" "$CHANNELS"
|
||||
@@ -166,7 +166,7 @@ git config user.name && git config user.email
|
||||
declined without holding up the others.
|
||||
- **No changelog changes.** Do not edit `CHANGELOG-big.md`, `CHANGELOG.md`, or the
|
||||
`CHANGELOG.md` or `CHANGELOG` of a repository under `.tools/` — not an Upcoming
|
||||
entry, not TODO Later. Describe the change in the pull request instead. The
|
||||
entry, and not `TODO.md` either. Describe the change in the pull request instead. The
|
||||
maintainer writes the entry after merging, when there is a commit for it to link.
|
||||
|
||||
Who that pull request credits follows the attribution rule above, and the two
|
||||
@@ -267,6 +267,32 @@ replaced with the language named by that tag.**
|
||||
misrepresent machine/LLM translations as human. Push only separately reviewed,
|
||||
provenance-known human translations with an explicit push command.
|
||||
|
||||
### Shared translation source for WeKan prototypes under `.tools/`
|
||||
|
||||
The WeKan catalogs in `imports/i18n/data/` are the source of truth for
|
||||
translations in every WeKan prototype under `.tools/`, including WeLite,
|
||||
Weddy, Wami, and any future WeKan prototype with its own catalog.
|
||||
|
||||
1. Before adding a translation key in a prototype, search WeKan's English
|
||||
catalog for a key with the same meaning and usage. Reuse that key and its
|
||||
existing translations. A different key name or catalog format does not
|
||||
require a new translation.
|
||||
2. If no suitable key exists, add it to WeKan's English catalog first, even if
|
||||
the string is currently used only by a prototype. Fill the key for every
|
||||
supported language in the WeKan repository using the translation rules
|
||||
below. Preserve existing human translations and verify the placeholders
|
||||
against the English source.
|
||||
3. Once the key is complete in WeKan, copy the canonical translations into
|
||||
the applicable WeKan prototype repositories under `.tools/`. Use each
|
||||
prototype's catalog format, filename and locale mapping as needed, while
|
||||
preserving the translated text and placeholders. Verify that the prototype
|
||||
loads the synced catalogs and renders the intended strings.
|
||||
|
||||
Apply the same workflow to existing prototype-only keys and translation
|
||||
corrections. Resolve equivalent keys and bring genuinely new strings into
|
||||
WeKan before syncing them back out. Maintain translation text in WeKan so the
|
||||
prototypes share the same translations and receive subsequent updates.
|
||||
|
||||
### Filling the remaining untranslated strings — directly, no translation service
|
||||
|
||||
The strings still equal to the English source after the merge are the ones untranslated
|
||||
@@ -440,7 +466,7 @@ directly after the merge.
|
||||
|
||||
| Repository | File | Format |
|
||||
| --- | --- | --- |
|
||||
| `wekan/wekan` | `CHANGELOG-big.md` (and the generated `CHANGELOG.md`, below) | the WeKan format this section describes: `# Status` (Platforms/Version/TODO Later nested as `<details>`), then `# v<MAJOR>.<MINOR> YYYY-MM-DD WeKan ® release` sections of `<details>` entries whose `<summary>` links the commit |
|
||||
| `wekan/wekan` | `CHANGELOG-big.md` (and the generated `CHANGELOG.md`, below) | the WeKan format this section describes: `# Status` (Platforms/Version nested as `<details>`), then `# v<MAJOR>.<MINOR> YYYY-MM-DD WeKan ® release` sections of `<details>` entries whose `<summary>` links the commit |
|
||||
| `wekan/node-patches` | `CHANGELOG.md` | the same WeKan format, with `# Upcoming node-patches release` |
|
||||
| `wekan/mongo-tools-patches` | `CHANGELOG.md` | the same WeKan format, with `# Upcoming mongo-tools-patches release` |
|
||||
| `wekan/FerretDB` | `CHANGELOG.md` | **upstream FerretDB's** format, not WeKan's: `## [v1.48.0](tag URL) (YYYY-MM-DD)` and `### New Features 🎉` / `### Fixed 🐛` / `### Other Changes 🤖` bullets ending `by @xet7. Thanks to xet7.` |
|
||||
@@ -461,7 +487,7 @@ directly after the merge.
|
||||
|
||||
| | `CHANGELOG.md` |
|
||||
| --- | --- |
|
||||
| Status, TODO Later | none |
|
||||
| Status | none |
|
||||
| First | the unreleased `# Upcoming WeKan ® release`, when there is one: its **In short** paragraph only, then `[All changes so far](CHANGELOG-big.md#upcoming-wekan--release)` |
|
||||
| Below it | the five newest `# v<MAJOR>.<MINOR> YYYY-MM-DD WeKan ® release` |
|
||||
| Per release | its **In short** paragraph only, then `[All changes in v…](CHANGELOG-big.md#anchor)` |
|
||||
@@ -521,7 +547,7 @@ directly after the merge.
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| `CHANGELOG-big.md` | `# Status` (Platforms/TODO Later inside it), `# Upcoming`, and the newest releases that fit the budget |
|
||||
| `CHANGELOG-big.md` | `# Status` (Platforms/Version inside it), `# Upcoming`, and the newest releases that fit the budget |
|
||||
| `old-CHANGELOG/<year>/<MM>.md` | a month's releases, newest first; a month over the budget continues in `<MM>-part2.md`, `<MM>-part3.md`, ... |
|
||||
| `old-CHANGELOG/<year>.md` | 2015–2025, whole |
|
||||
|
||||
@@ -544,24 +570,22 @@ directly after the merge.
|
||||
An archived section is never edited, for the same reason a released one is
|
||||
not.
|
||||
- **The file's shape, top to bottom** — keep it exactly as it is now. There is
|
||||
exactly ONE `#` heading before the releases: `# Status`. Platforms, Version
|
||||
and TODO Later are `<details>` blocks nested inside it, not headings of
|
||||
their own (they used to be `# Platforms` and `# TODO Later`; both were
|
||||
folded under `# Status` so the file opens with a single top-level section
|
||||
rather than three):
|
||||
exactly ONE `#` heading before the releases: `# Status`. Platforms and Version
|
||||
are `<details>` blocks nested inside it, not headings of their own (they used
|
||||
to be `# Platforms` and `# TODO Later`; Platforms was folded under `# Status`
|
||||
so the file opens with a single top-level section, and TODO Later moved out
|
||||
to `TODO.md`, below):
|
||||
1. `# Status` — opens with a `<details>` whose `<summary>` is `More status
|
||||
info`, holding a link to <https://wekan.fi/status/>. Then a `<details>`
|
||||
info`, holding a link to <https://wekan.fi/status/> and the line pointing
|
||||
to [TODO.md](TODO.md). Then a `<details>`
|
||||
whose `<summary>` is `Newest WeKan at these platforms`, holding the line
|
||||
`Newest WeKan at these platforms:` and the Install / Upgrade / Docs / Mac
|
||||
ChangeLog bullets, plus the `Older releases:` bullet linking the per-year
|
||||
archives. Then a `<details>` whose `<summary>` is `Databases` listing
|
||||
which databases WeKan supports and how each is tested, kept in step with
|
||||
`docs/Databases/Supported.md`. Then a `<details>` whose `<summary>` is `Version` holding
|
||||
"which WeKan version uses what". Then a `<details>` whose `<summary>` is
|
||||
`TODO Later`, itself holding a `<details>` whose `<summary>` is `Carried
|
||||
to a future release.` explaining the list, then one `<details>` per
|
||||
category (below). There is no `# Version` or `# TODO Later` heading of
|
||||
its own.
|
||||
"which WeKan version uses what". There is no `# Version` heading of its
|
||||
own, and no TODO Later block: what is not done is in `TODO.md`.
|
||||
2. The releases, newest first, each `# v<MAJOR>.<MINOR> YYYY-MM-DD WeKan ® release`.
|
||||
|
||||
Nothing else is an `#` heading. A `##`/`###` inside a release would break the
|
||||
@@ -605,10 +629,6 @@ directly after the merge.
|
||||
A `<details>` whose body only
|
||||
repeats its summary is noise; use one when there IS a longer story to reveal, which
|
||||
is most fixes.
|
||||
- **TODO Later's own blocks are the same shape with two differences:** the `<summary>` is
|
||||
the short category text (no `<a>`, because nothing was committed), and there is **no
|
||||
`Thanks to`** — nothing is done yet, so there is nobody to thank. The body lists the
|
||||
issues as `[#NNNN](https://github.com/wekan/wekan/issues/NNNN) (one-line reason)`.
|
||||
- **The hash is never the link text.** `[f1c89548e](…)` shows a hash to a reader who
|
||||
cannot do anything with it; the link text says what changed. Same for `[merge
|
||||
commit](…)` and for a bare URL — see the next rule.
|
||||
@@ -707,27 +727,27 @@ directly after the merge.
|
||||
`This release fixes the following SECURITY ISSUES found by GitHub CodeQL code scanning:`.
|
||||
Because CRITICAL comes first, it keeps the `This release ` prefix; a following non-security
|
||||
subsection becomes `and …` per the rule above.
|
||||
- **TODO Later** — a `<details>` nested inside `# Status` near the TOP of
|
||||
`CHANGELOG-big.md` (above the version sections), a triage backlog for open
|
||||
issues that were **investigated but not fixed here**, each
|
||||
recorded with a concrete REASON so whoever picks it up next knows why. Use it when working
|
||||
through open issues (the "Fix open issues" process): for each issue, either **fix it** (commit
|
||||
ending `Fixes #NNNN,`), **close it** if already fixed in current code (commit `Close #NNNN` /
|
||||
`Fixes #NNNN,`), or — when it can't be fixed/verified in this environment — **add it to `TODO
|
||||
Later` under the matching category with the reason**. Group issues by category bullet, e.g.:
|
||||
*Need specific infrastructure / a running server stack* (LDAP/WebHooks/Sandstorm/proxy —
|
||||
environment owners), *Need the running app to reproduce/verify* (runtime UI / publication /
|
||||
mergebox / router state, not unit-testable), *Already correct in the current code* (verified by
|
||||
reading; could not reproduce), *Feature requests / behaviour-by-design rather than bugs*, and
|
||||
*Needs a maintainer decision on the intended contract*. Each category is a `<details>`
|
||||
whose `<summary>` is the SHORT category text and whose body lists the issues with their
|
||||
reasons — and with **no `Thanks to` line**, because nothing is done yet, so there is
|
||||
nobody to thank. Each entry is a normal issue link
|
||||
`[#NNNN](https://github.com/wekan/wekan/issues/NNNN) (one-line reason)` — issue links here, NOT
|
||||
commit links (nothing was committed). **Keep it current:** when an issue in `TODO Later` gets
|
||||
fixed, REMOVE it from the list (its fix commit's `Fixes #NNNN` closes it); do not leave fixed
|
||||
issues in the backlog. This is the only CHANGELOG place that uses issue links and lives above
|
||||
the releases; everything else uses the per-release commit-link bullets above.
|
||||
- **`TODO.md`** — at the repository root, NOT in the changelog (it was the TODO
|
||||
Later block inside `# Status` until 2026-11-18, when it moved out so the
|
||||
changelog says only what changed). A triage backlog of work and open issues
|
||||
that were **investigated but not done here**, each recorded with a concrete
|
||||
REASON so whoever picks it up next knows why. Use it when working through open
|
||||
issues (the "Fix open issues" process): for each issue, either **fix it**
|
||||
(commit ending `Fixes #NNNN,`), **close it** if already fixed in current code
|
||||
(commit `Close #NNNN` / `Fixes #NNNN,`), or — when it can't be fixed/verified
|
||||
in this environment — **add it to `TODO.md` under the matching category with
|
||||
the reason**. Categories are `##` headings there, e.g. *Need specific
|
||||
infrastructure / a running server stack*, *Need the running app to
|
||||
reproduce/verify*, *Already correct in the current code*, *Feature requests /
|
||||
behaviour-by-design rather than bugs* and *Needs a maintainer decision on the
|
||||
intended contract*; an emptied category is removed. Each entry is a bullet with
|
||||
a normal issue link `[#NNNN](https://github.com/wekan/wekan/issues/NNNN) (one-line
|
||||
reason)` when there is an issue — never a commit link, and **no `Thanks to`**,
|
||||
because nothing is done yet, so there is nobody to thank. **When an item is
|
||||
done, MOVE it:** remove it from `TODO.md` and write its entry in `# Upcoming
|
||||
WeKan ® release` of `CHANGELOG-big.md`, linking the commit (its `Fixes #NNNN`
|
||||
closes the issue). A done item never stays in `TODO.md`.
|
||||
`tests/todoFile.test.cjs` checks the file.
|
||||
- FerretDB Upcoming structure — `### New Features 🎉`, `### Fixed 🐛`, `### Other Changes
|
||||
🤖`; entries end `... by @xet7. Thanks to xet7.`
|
||||
- Word-wrap both CHANGELOGs at 80 chars, but never break a long link across lines (a
|
||||
|
||||
+2224
-2459
File diff suppressed because it is too large.
Load diff
+40
-32
@@ -5,49 +5,57 @@ each one changed and the project status are in
|
||||
Written by `node releases/changelog-short.mjs` from CHANGELOG-big.md:
|
||||
make changes there.
|
||||
|
||||
# v13.13 2026-11-15 WeKan ® release
|
||||
# v13.26 2026-11-22 WeKan ® release
|
||||
|
||||
**Copy Checklist** and the other destination pickers list the
|
||||
cards of a large board again: a board that loads its cards lazily used to leave
|
||||
the card dropdown empty. Dependabot's updates, among them **i18next 27** and
|
||||
the **mongodb** driver 7.8.0, are kept.
|
||||
New **Workload and capacity**, **Budget and billing** and **Cloud
|
||||
Panel** pages: hours against working time, each board's cost and margin with
|
||||
**expenses**, **fees**, **quotes** and **invoices** in **PDF**, **Excel** and
|
||||
**e-invoice**, and many customer domains merged into one WeKan. WordPress,
|
||||
Ghost, Blogger and static sites import and export under **Website**, and a
|
||||
public board can show itself as a **website**. The **Venda** and **Klingon**
|
||||
translations hold only their own language, the move and copy pickers show names
|
||||
without numbers (#6135), and unused code is removed.
|
||||
|
||||
[All changes in v13.13](CHANGELOG-big.md#v1313-2026-11-15-wekan--release)
|
||||
[All changes in v13.26](CHANGELOG-big.md#v1326-2026-11-22-wekan--release)
|
||||
|
||||
# v13.12 2026-11-14 WeKan ® release
|
||||
# v13.25 2026-11-21 WeKan ® release
|
||||
|
||||
WeKan is updated to **Meteor 3.6.1**, whose DDP server refuses
|
||||
malformed messages without stalling the connection. **One shared list header
|
||||
row** now shows the same lists in every swimlane, scrolling together, and
|
||||
**Shift+M** and **Shift+C** open Move Card and Copy Card. Those popups
|
||||
remember the swimlane and list, not only the board. The embedded-engine
|
||||
benchmark takes **OpenTelemetry 1.47.0** for a Dependabot alert. A **REST
|
||||
API** write that changes nothing answers 404, and a card deletion naming the
|
||||
wrong list no longer strips the card's checklists (**ListLockBleed**).
|
||||
**CodeQL** alerts #605-#610 in the **OneNote** and **Sandstorm
|
||||
grain** formats are fixed: comments in imported HTML are removed to a fixed
|
||||
point, SandChat user ids come from a cryptographic generator, and the guards
|
||||
that missed these shapes now find them anywhere in the tree.
|
||||
|
||||
[All changes in v13.12](CHANGELOG-big.md#v1312-2026-11-14-wekan--release)
|
||||
[All changes in v13.25](CHANGELOG-big.md#v1325-2026-11-21-wekan--release)
|
||||
|
||||
# v13.11 2026-11-13 WeKan ® release
|
||||
# v13.24 2026-11-21 WeKan ® release
|
||||
|
||||
The **file-integrity scan** stops reporting attachments and
|
||||
avatars that WeKan deleted itself as missing, which had buried real
|
||||
**StorageBleed** findings under thousands of false ones. The recurring-checklist
|
||||
reset no longer scans every **checklist** on each tick. In the **REST API**, a
|
||||
refused custom-field update changes nothing, ownership transfer takes only the
|
||||
boards the user administers, and deleting a missing integration answers 404.
|
||||
Six more of **Microsoft**'s tools are imported and exported under
|
||||
the Microsoft heading: **Azure DevOps Boards**, **Microsoft Lists**,
|
||||
**Microsoft Project** (XML), **Outlook** (.msg in, .eml out), **Teams** and
|
||||
**OneNote**, the last two also fetched from Microsoft Graph. **Sandstorm** grain
|
||||
backups of twelve apps are imported and nine exported, and **Vietnamese** no
|
||||
longer shows Malay text.
|
||||
|
||||
[All changes in v13.11](CHANGELOG-big.md#v1311-2026-11-13-wekan--release)
|
||||
[All changes in v13.24](CHANGELOG-big.md#v1324-2026-11-21-wekan--release)
|
||||
|
||||
# v13.10 2026-11-13 WeKan ® release
|
||||
# v13.23 2026-11-20 WeKan ® release
|
||||
|
||||
The release's **Snap Store** credential check bounds each
|
||||
snapcraft install attempt, so a Snap Store that hangs no longer stops a release.
|
||||
The **Import** page and the **Export** menu list a company's
|
||||
products under the company's name: **37signals**, **Atlassian**, **Google** and
|
||||
**Microsoft**.
|
||||
|
||||
[All changes in v13.10](CHANGELOG-big.md#v1310-2026-11-13-wekan--release)
|
||||
[All changes in v13.23](CHANGELOG-big.md#v1323-2026-11-20-wekan--release)
|
||||
|
||||
# v13.09 2026-11-12 WeKan ® release
|
||||
# v13.22 2026-11-20 WeKan ® release
|
||||
|
||||
The release's **Snap Store** credential check retries installing
|
||||
snapcraft, so one Snap Store timeout no longer stops a release.
|
||||
Repeating tasks of **Taskwarrior**, **Microsoft To Do**,
|
||||
**Todoist**, **TickTick**, **Tasks.org**, **Vikunja**, **Super Productivity**,
|
||||
**iCalendar**, **Org mode** and **Obsidian Kanban** now repeat in WeKan, and
|
||||
their exports write the repeat back. **Release All**
|
||||
builds and pushes **wekan**, **wekan-ondra** and **wekan-gantt-gpl** to every
|
||||
Snap Store channel, and **Release All Missing** adds what a release lacks,
|
||||
snaps included. A **WeKan board** imported from its own export keeps all of
|
||||
its Board Settings and card fields, and **Rocket.Chat** and **Fizzy** are
|
||||
imported and exported.
|
||||
|
||||
[All changes in v13.09](CHANGELOG-big.md#v1309-2026-11-12-wekan--release)
|
||||
[All changes in v13.22](CHANGELOG-big.md#v1322-2026-11-20-wekan--release)
|
||||
@@ -166,7 +166,7 @@ git config user.name && git config user.email
|
||||
declined without holding up the others.
|
||||
- **No changelog changes.** Do not edit `CHANGELOG-big.md`, `CHANGELOG.md`, or the
|
||||
`CHANGELOG.md` or `CHANGELOG` of a repository under `.tools/` — not an Upcoming
|
||||
entry, not TODO Later. Describe the change in the pull request instead. The
|
||||
entry, and not `TODO.md` either. Describe the change in the pull request instead. The
|
||||
maintainer writes the entry after merging, when there is a commit for it to link.
|
||||
|
||||
Who that pull request credits follows the attribution rule above, and the two
|
||||
@@ -267,6 +267,32 @@ replaced with the language named by that tag.**
|
||||
misrepresent machine/LLM translations as human. Push only separately reviewed,
|
||||
provenance-known human translations with an explicit push command.
|
||||
|
||||
### Shared translation source for WeKan prototypes under `.tools/`
|
||||
|
||||
The WeKan catalogs in `imports/i18n/data/` are the source of truth for
|
||||
translations in every WeKan prototype under `.tools/`, including WeLite,
|
||||
Weddy, Wami, and any future WeKan prototype with its own catalog.
|
||||
|
||||
1. Before adding a translation key in a prototype, search WeKan's English
|
||||
catalog for a key with the same meaning and usage. Reuse that key and its
|
||||
existing translations. A different key name or catalog format does not
|
||||
require a new translation.
|
||||
2. If no suitable key exists, add it to WeKan's English catalog first, even if
|
||||
the string is currently used only by a prototype. Fill the key for every
|
||||
supported language in the WeKan repository using the translation rules
|
||||
below. Preserve existing human translations and verify the placeholders
|
||||
against the English source.
|
||||
3. Once the key is complete in WeKan, copy the canonical translations into
|
||||
the applicable WeKan prototype repositories under `.tools/`. Use each
|
||||
prototype's catalog format, filename and locale mapping as needed, while
|
||||
preserving the translated text and placeholders. Verify that the prototype
|
||||
loads the synced catalogs and renders the intended strings.
|
||||
|
||||
Apply the same workflow to existing prototype-only keys and translation
|
||||
corrections. Resolve equivalent keys and bring genuinely new strings into
|
||||
WeKan before syncing them back out. Maintain translation text in WeKan so the
|
||||
prototypes share the same translations and receive subsequent updates.
|
||||
|
||||
### Filling the remaining untranslated strings — directly, no translation service
|
||||
|
||||
The strings still equal to the English source after the merge are the ones untranslated
|
||||
@@ -440,7 +466,7 @@ directly after the merge.
|
||||
|
||||
| Repository | File | Format |
|
||||
| --- | --- | --- |
|
||||
| `wekan/wekan` | `CHANGELOG-big.md` (and the generated `CHANGELOG.md`, below) | the WeKan format this section describes: `# Status` (Platforms/Version/TODO Later nested as `<details>`), then `# v<MAJOR>.<MINOR> YYYY-MM-DD WeKan ® release` sections of `<details>` entries whose `<summary>` links the commit |
|
||||
| `wekan/wekan` | `CHANGELOG-big.md` (and the generated `CHANGELOG.md`, below) | the WeKan format this section describes: `# Status` (Platforms/Version nested as `<details>`), then `# v<MAJOR>.<MINOR> YYYY-MM-DD WeKan ® release` sections of `<details>` entries whose `<summary>` links the commit |
|
||||
| `wekan/node-patches` | `CHANGELOG.md` | the same WeKan format, with `# Upcoming node-patches release` |
|
||||
| `wekan/mongo-tools-patches` | `CHANGELOG.md` | the same WeKan format, with `# Upcoming mongo-tools-patches release` |
|
||||
| `wekan/FerretDB` | `CHANGELOG.md` | **upstream FerretDB's** format, not WeKan's: `## [v1.48.0](tag URL) (YYYY-MM-DD)` and `### New Features 🎉` / `### Fixed 🐛` / `### Other Changes 🤖` bullets ending `by @xet7. Thanks to xet7.` |
|
||||
@@ -461,7 +487,7 @@ directly after the merge.
|
||||
|
||||
| | `CHANGELOG.md` |
|
||||
| --- | --- |
|
||||
| Status, TODO Later | none |
|
||||
| Status | none |
|
||||
| First | the unreleased `# Upcoming WeKan ® release`, when there is one: its **In short** paragraph only, then `[All changes so far](CHANGELOG-big.md#upcoming-wekan--release)` |
|
||||
| Below it | the five newest `# v<MAJOR>.<MINOR> YYYY-MM-DD WeKan ® release` |
|
||||
| Per release | its **In short** paragraph only, then `[All changes in v…](CHANGELOG-big.md#anchor)` |
|
||||
@@ -521,7 +547,7 @@ directly after the merge.
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| `CHANGELOG-big.md` | `# Status` (Platforms/TODO Later inside it), `# Upcoming`, and the newest releases that fit the budget |
|
||||
| `CHANGELOG-big.md` | `# Status` (Platforms/Version inside it), `# Upcoming`, and the newest releases that fit the budget |
|
||||
| `old-CHANGELOG/<year>/<MM>.md` | a month's releases, newest first; a month over the budget continues in `<MM>-part2.md`, `<MM>-part3.md`, ... |
|
||||
| `old-CHANGELOG/<year>.md` | 2015–2025, whole |
|
||||
|
||||
@@ -544,24 +570,22 @@ directly after the merge.
|
||||
An archived section is never edited, for the same reason a released one is
|
||||
not.
|
||||
- **The file's shape, top to bottom** — keep it exactly as it is now. There is
|
||||
exactly ONE `#` heading before the releases: `# Status`. Platforms, Version
|
||||
and TODO Later are `<details>` blocks nested inside it, not headings of
|
||||
their own (they used to be `# Platforms` and `# TODO Later`; both were
|
||||
folded under `# Status` so the file opens with a single top-level section
|
||||
rather than three):
|
||||
exactly ONE `#` heading before the releases: `# Status`. Platforms and Version
|
||||
are `<details>` blocks nested inside it, not headings of their own (they used
|
||||
to be `# Platforms` and `# TODO Later`; Platforms was folded under `# Status`
|
||||
so the file opens with a single top-level section, and TODO Later moved out
|
||||
to `TODO.md`, below):
|
||||
1. `# Status` — opens with a `<details>` whose `<summary>` is `More status
|
||||
info`, holding a link to <https://wekan.fi/status/>. Then a `<details>`
|
||||
info`, holding a link to <https://wekan.fi/status/> and the line pointing
|
||||
to [TODO.md](TODO.md). Then a `<details>`
|
||||
whose `<summary>` is `Newest WeKan at these platforms`, holding the line
|
||||
`Newest WeKan at these platforms:` and the Install / Upgrade / Docs / Mac
|
||||
ChangeLog bullets, plus the `Older releases:` bullet linking the per-year
|
||||
archives. Then a `<details>` whose `<summary>` is `Databases` listing
|
||||
which databases WeKan supports and how each is tested, kept in step with
|
||||
`docs/Databases/Supported.md`. Then a `<details>` whose `<summary>` is `Version` holding
|
||||
"which WeKan version uses what". Then a `<details>` whose `<summary>` is
|
||||
`TODO Later`, itself holding a `<details>` whose `<summary>` is `Carried
|
||||
to a future release.` explaining the list, then one `<details>` per
|
||||
category (below). There is no `# Version` or `# TODO Later` heading of
|
||||
its own.
|
||||
"which WeKan version uses what". There is no `# Version` heading of its
|
||||
own, and no TODO Later block: what is not done is in `TODO.md`.
|
||||
2. The releases, newest first, each `# v<MAJOR>.<MINOR> YYYY-MM-DD WeKan ® release`.
|
||||
|
||||
Nothing else is an `#` heading. A `##`/`###` inside a release would break the
|
||||
@@ -605,10 +629,6 @@ directly after the merge.
|
||||
A `<details>` whose body only
|
||||
repeats its summary is noise; use one when there IS a longer story to reveal, which
|
||||
is most fixes.
|
||||
- **TODO Later's own blocks are the same shape with two differences:** the `<summary>` is
|
||||
the short category text (no `<a>`, because nothing was committed), and there is **no
|
||||
`Thanks to`** — nothing is done yet, so there is nobody to thank. The body lists the
|
||||
issues as `[#NNNN](https://github.com/wekan/wekan/issues/NNNN) (one-line reason)`.
|
||||
- **The hash is never the link text.** `[f1c89548e](…)` shows a hash to a reader who
|
||||
cannot do anything with it; the link text says what changed. Same for `[merge
|
||||
commit](…)` and for a bare URL — see the next rule.
|
||||
@@ -707,27 +727,27 @@ directly after the merge.
|
||||
`This release fixes the following SECURITY ISSUES found by GitHub CodeQL code scanning:`.
|
||||
Because CRITICAL comes first, it keeps the `This release ` prefix; a following non-security
|
||||
subsection becomes `and …` per the rule above.
|
||||
- **TODO Later** — a `<details>` nested inside `# Status` near the TOP of
|
||||
`CHANGELOG-big.md` (above the version sections), a triage backlog for open
|
||||
issues that were **investigated but not fixed here**, each
|
||||
recorded with a concrete REASON so whoever picks it up next knows why. Use it when working
|
||||
through open issues (the "Fix open issues" process): for each issue, either **fix it** (commit
|
||||
ending `Fixes #NNNN,`), **close it** if already fixed in current code (commit `Close #NNNN` /
|
||||
`Fixes #NNNN,`), or — when it can't be fixed/verified in this environment — **add it to `TODO
|
||||
Later` under the matching category with the reason**. Group issues by category bullet, e.g.:
|
||||
*Need specific infrastructure / a running server stack* (LDAP/WebHooks/Sandstorm/proxy —
|
||||
environment owners), *Need the running app to reproduce/verify* (runtime UI / publication /
|
||||
mergebox / router state, not unit-testable), *Already correct in the current code* (verified by
|
||||
reading; could not reproduce), *Feature requests / behaviour-by-design rather than bugs*, and
|
||||
*Needs a maintainer decision on the intended contract*. Each category is a `<details>`
|
||||
whose `<summary>` is the SHORT category text and whose body lists the issues with their
|
||||
reasons — and with **no `Thanks to` line**, because nothing is done yet, so there is
|
||||
nobody to thank. Each entry is a normal issue link
|
||||
`[#NNNN](https://github.com/wekan/wekan/issues/NNNN) (one-line reason)` — issue links here, NOT
|
||||
commit links (nothing was committed). **Keep it current:** when an issue in `TODO Later` gets
|
||||
fixed, REMOVE it from the list (its fix commit's `Fixes #NNNN` closes it); do not leave fixed
|
||||
issues in the backlog. This is the only CHANGELOG place that uses issue links and lives above
|
||||
the releases; everything else uses the per-release commit-link bullets above.
|
||||
- **`TODO.md`** — at the repository root, NOT in the changelog (it was the TODO
|
||||
Later block inside `# Status` until 2026-11-18, when it moved out so the
|
||||
changelog says only what changed). A triage backlog of work and open issues
|
||||
that were **investigated but not done here**, each recorded with a concrete
|
||||
REASON so whoever picks it up next knows why. Use it when working through open
|
||||
issues (the "Fix open issues" process): for each issue, either **fix it**
|
||||
(commit ending `Fixes #NNNN,`), **close it** if already fixed in current code
|
||||
(commit `Close #NNNN` / `Fixes #NNNN,`), or — when it can't be fixed/verified
|
||||
in this environment — **add it to `TODO.md` under the matching category with
|
||||
the reason**. Categories are `##` headings there, e.g. *Need specific
|
||||
infrastructure / a running server stack*, *Need the running app to
|
||||
reproduce/verify*, *Already correct in the current code*, *Feature requests /
|
||||
behaviour-by-design rather than bugs* and *Needs a maintainer decision on the
|
||||
intended contract*; an emptied category is removed. Each entry is a bullet with
|
||||
a normal issue link `[#NNNN](https://github.com/wekan/wekan/issues/NNNN) (one-line
|
||||
reason)` when there is an issue — never a commit link, and **no `Thanks to`**,
|
||||
because nothing is done yet, so there is nobody to thank. **When an item is
|
||||
done, MOVE it:** remove it from `TODO.md` and write its entry in `# Upcoming
|
||||
WeKan ® release` of `CHANGELOG-big.md`, linking the commit (its `Fixes #NNNN`
|
||||
closes the issue). A done item never stays in `TODO.md`.
|
||||
`tests/todoFile.test.cjs` checks the file.
|
||||
- FerretDB Upcoming structure — `### New Features 🎉`, `### Fixed 🐛`, `### Other Changes
|
||||
🤖`; entries end `... by @xet7. Thanks to xet7.`
|
||||
- Word-wrap both CHANGELOGs at 80 chars, but never break a long link across lines (a
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ FROM --platform=$BUILDPLATFORM debian:trixie AS bundle
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
ARG VERSION=13.13
|
||||
ARG VERSION=13.26
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
COPY --chmod=755 releases/check-telemetry.py /tmp/check-telemetry.py
|
||||
@@ -151,7 +151,7 @@ ENV \
|
||||
NODE_VERSION=v26.13.1 \
|
||||
METEOR_RELEASE=METEOR@3.6.1 \
|
||||
USE_EDGE=false \
|
||||
NPM_VERSION=12.2.2 \
|
||||
NPM_VERSION=12.2.3 \
|
||||
SRC_PATH=./ \
|
||||
WITH_API=true \
|
||||
MONGO_OPLOG_URL="" \
|
||||
|
||||
@@ -42,15 +42,38 @@ that by providing one-click installation on various platforms.
|
||||
- Board icons at Remaining, (Sub)Workspaces, Archive
|
||||
- Shared Templates: Boards, Lists, Cards
|
||||
- Add Board / Import ([all import and export formats](docs/Features/Board-Sidebar/Board-Settings/Import-Export/External-Tools.md)):
|
||||
- WeKan JSON/.zip, CSV/TSV, Excel, Markdown, Obsidian Kanban, Leo, OPML, Org mode, todo.txt
|
||||
- Trello, Jira, Asana, Zenkit, Focalboard, Todoist, Microsoft Planner, MeisterTask, Linear, TickTick, ClickUp, Nullboard, Kanri, Pivotal Tracker, Redmine, Tasks.org, monday.com,
|
||||
Super Productivity, Taiga, Vikunja, Wrike (Excel and workflow), Quire, Teamwork.com, Businessmap, Notion, Plane
|
||||
- Kanboard, Nextcloud Deck, OpenProject, Taskwarrior
|
||||
- GitHub, GitLab, Gitea, Forgejo
|
||||
the tools are under the same headings as on the import page, a company's or a platform's products under its name
|
||||
- WeKan JSON and .zip
|
||||
- 37signals: Fizzy, Basecamp
|
||||
- Atlassian: Trello (JSON, and a .zip of many boards with their files), Jira
|
||||
- Google: Takeout (Tasks, Keep, Mail, Calendar, Chat), Tasks, Keep
|
||||
- Microsoft: Excel, GitHub, Planner, Azure DevOps Boards, Lists, Project (XML), Outlook (.msg), To Do, OneNote, Teams
|
||||
- Sandstorm grain backups: WeKan, Prioritize, Yet Another TODO list, μTodo, SandChat, EtherCalc,
|
||||
Radicale calendar and address book, Davros, Hacker CMS, Gogs, WordPress
|
||||
- Kanban and project tools: Kanboard, Nextcloud Deck, OpenProject, Asana, Zenkit, Focalboard, MeisterTask, Obsidian Kanban,
|
||||
ClickUp, Nullboard, Kanri, monday.com, Taiga, Wrike, Teamwork.com, Businessmap, Quire, Notion, Plane
|
||||
- Issue trackers and version control: GitLab, Gitea, Forgejo, Linear, Pivotal Tracker, Redmine
|
||||
- Task and to-do apps: todo.txt, Taskwarrior, Todoist, TickTick, Tasks.org, Super Productivity, Vikunja
|
||||
- Spreadsheets and tables: CSV / TSV
|
||||
- Text and outlines: Markdown, Leo, OPML, Org mode
|
||||
- Mail, calendars, chats and notes, each into the view it fits: Mail (mbox, .eml), iCalendar, Slack, Mattermost,
|
||||
Telegram, WhatsApp, Discord, Rocket.Chat, Evernote
|
||||
- [Website](docs/Features/Board-Sidebar/Board-Settings/Import-Export/Website/Website.md): WordPress (.xml, and Squarespace, Wix and others that write it),
|
||||
WordPress REST API, Ghost, Blogger, Hugo / Jekyll / Eleventy / Astro (.zip of Markdown), HTML website and Medium (.zip), Substack
|
||||
- Fetched from the service's API with your credentials: Planka, KanbanFlow, Basecamp, Microsoft To Do, OneNote and Teams,
|
||||
Google Tasks and Keep
|
||||
- Large files are streamed to disk, within its free space or the Admin Panel limit
|
||||
- Import many boards at once: several export files, or a .zip of them, each its own board;
|
||||
One board per project splits an export of a whole app into a board per project
|
||||
- Change Color: Board theme and background image, Swimlane, List, Card
|
||||
- Overrides: 1 Admin Panel, 2 Board Settings, 3 Member Settings
|
||||
- Professional services (PSA), from the user menu:
|
||||
- [Workload and capacity](docs/Features/Workload/Workload.md): each person's hours against their working time across boards,
|
||||
absences, public holidays, allocations, placeholders for roles, billable utilization against a target, skills and who could do the work
|
||||
- [Budget and billing](docs/Features/Billing/Billing.md): rates and cost rates, budget against cost and forecast, margin and unbilled work,
|
||||
time by day and its approval, expenses, fixed fees and monthly retainers, quotes, invoices of a period
|
||||
with VAT, payments and credit notes, as PDF, SVG, Excel, CSV and Peppol e-invoice, with the payment QR codes and
|
||||
bank barcodes of many countries, in each currency's own decimals
|
||||
- Drag drop reorder with one or Multi-Selection:
|
||||
- Board icons to Workspaces at All Boards page
|
||||
- Swimlane, List, Minicard
|
||||
@@ -60,28 +83,36 @@ that by providing one-click installation on various platforms.
|
||||
- Show My Dependencies, Show Board Dependencies, Import/Export JSON/SVG
|
||||
- Dependencies are for SAFe PI Plannings, drawing colored lines between cards, like Kendis or Scaled Agile Framework. Import Export as JSON and SVG.
|
||||
- My Cards, Due Cards, My Attachments, Search All Boards, Date Settings,
|
||||
Change color - override theme, Nofications Settings (Tray, Email, etc),
|
||||
Change color - override theme, Notifications Settings (Tray, Email, etc),
|
||||
Font change and Font size change, Change Avatar,
|
||||
Change Language (250+ languages)
|
||||
Change Language (234 locale catalogs)
|
||||
- Change Settings: Show desktop drag handles, Submit editors with Enter,
|
||||
Open many cards at once, Play a sound when a checklist item is completed,
|
||||
Show cards count if list contains more than ... cards,
|
||||
Show rescue dialoque before closing for unsaved card descriptions
|
||||
Show rescue dialogue before closing for unsaved card descriptions
|
||||
- Board Views:
|
||||
- Swimlanes, Lists
|
||||
- Minicard: At list there is card, that has not been not opened yet
|
||||
- Card: Opened card popup of minicard
|
||||
- Attachments viewer for PDF and Office documents
|
||||
- Kanban and Scrum flow fields: Blocked, Class of service, MoSCoW priority, WSJF score
|
||||
- List policies, Definition of Ready, commitment point, WIP limit per person,
|
||||
lists split into Doing and Done
|
||||
- Drag drop reorder one or Multi-Selection: Swimlanes, Lists, Minicards, Checklists, Checklist Items
|
||||
- Collapse/Uncollapse: Menus, Swimlanes, Lists, Cards
|
||||
- Table, Calendar, Multi Board Calendar, Time, Timeline
|
||||
- Statistics, Group by Assignee
|
||||
- Gantt, Frappe Gantt, DHTMLX Gantt
|
||||
- Scrum: Product Backlog, Sprints, Sprint Report, Velocity, Roadmap, Dashboard, Bigboard
|
||||
- Burndown, Burnup, Cumulative Flow, Control, Cycle Time, Flow Efficiency,
|
||||
Lead Time, Throughtput Histogram, WIP Run, Pulse, Aging WIP,
|
||||
Blocker Analysis, Monte Carlo Forecasts, Process Behavior (XmR),
|
||||
Work Item Size vs Cycle Time, Map
|
||||
- The Board View menu, under its headings; each view shown, hidden and ordered per board:
|
||||
- Board: Swimlanes, Lists, Table, Group by Assignee, Bigboard, Map, Column sets
|
||||
- Calendar and time: Calendar, Calendar Mode, Multi Board Calendar, Time, Timeline,
|
||||
Gantt, Frappe Gantt, DHTMLX Gantt, Roadmap
|
||||
- Scrum: Product Backlog, Sprints, Sprint Report, Velocity, Burndown, Burnup, Release Burndown, Epic Progress
|
||||
- Kanban flow: Cumulative Flow, Control, Cycle Time, Flow Efficiency, Lead Time, Throughput Histogram,
|
||||
WIP Run, Aging WIP, Blocker Analysis, Monte Carlo Forecasts, Process Behavior (XmR),
|
||||
Work Item Size vs. Cycle Time, Created vs. Resolved, Net Flow, Time in List, Average Age,
|
||||
Throughput Run Chart, Due Date Performance
|
||||
- Overview: Statistics, Dashboard, Pulse, Workload, Distribution, Dependency Map, Activity Heatmap
|
||||
- Communication and code: Email, Chat, Version Control,
|
||||
[Website](docs/Features/Board-Sidebar/Board-Settings/Import-Export/Website/Website.md): the board as a website, which a public board can show at its own address instead of the kanban
|
||||
- The charts and reports each have PDF and Excel export
|
||||
- Right Sidebar / Board Settings:
|
||||
- Rules: like IFTTT like Trello Butler
|
||||
- Lists view for Rules
|
||||
@@ -89,26 +120,38 @@ that by providing one-click installation on various platforms.
|
||||
- Blocks: like Scratch or Jira AutoBlocks, shows same IFTTT Rules
|
||||
- Import / Export IFTTT Rules; import n8n, Node-RED and Trello Butler; import / export Wrike workflows
|
||||
- Export board :
|
||||
- Select what to include: Card details, Board, Activities, Labels, People (Creator, Owner, Members, Assignees), Board Info (Board, List, Swimlane), Dates (Created, Received, Start, Due, End), Description, Custom Fields, Checklists, Subtasks, Comments, Attachments, Votin, Plannin Poker, Stickers, Location (link to map based on coordinates), Dependencies, Sort, Scrum Settings
|
||||
- Export to ([all formats](docs/Features/Board-Sidebar/Board-Settings/Import-Export/External-Tools.md)): PDF, Excel, HTML, Calendar feed (iCal), Dependencies JSON/SVG,
|
||||
CSV , ; TSV, JSON with/without attachmeents, .zip (Attachments),
|
||||
Kanboard, Markdown, Leo, OPML, Org mode, todo.txt, Taskwarrior, Focalboard, Todoist,
|
||||
Microsoft Planner, MeisterTask, Obsidian Kanban, Linear, TickTick, ClickUp, Nullboard, Kanri, Pivotal Tracker, Redmine, Tasks.org, monday.com,
|
||||
Super Productivity, Taiga, Vikunja, Wrike (Excel and workflow), Quire, Teamwork.com, Businessmap, Notion,
|
||||
Trello, Jira, NextCloud Deck, OpenProject, GitHub, GitLab,
|
||||
Gitea, Forgejo, Asana, Zenkit
|
||||
- Select what to include: Card details, Board, Activities, Labels, People (Creator, Owner, Members, Assignees), Board Info (Board, List, Swimlane), Dates (Created, Received, Start, Due, End), Description, Custom Fields, Checklists, Subtasks, Comments, Attachments, Voting, Planning Poker, Stickers, Location (link to map based on coordinates), Dependencies, Sort, Scrum Settings
|
||||
- Export to ([all formats](docs/Features/Board-Sidebar/Board-Settings/Import-Export/External-Tools.md)):
|
||||
under the same headings as Import
|
||||
- WeKan: JSON with or without attachments, .zip with attachments; PDF, Excel, HTML, Calendar feed (iCal),
|
||||
Dependencies JSON/SVG, CSV , ; TSV
|
||||
- 37signals: Fizzy
|
||||
- Atlassian: Trello (JSON, .zip with attachments, or straight into Trello through its API), Jira
|
||||
- Microsoft: Planner, Azure DevOps Boards, Lists, Project (XML), Outlook (.eml), Teams, OneNote, GitHub
|
||||
- Sandstorm grain backups that Sandstorm restores: Prioritize, Yet Another TODO list, μTodo, SandChat, EtherCalc,
|
||||
Radicale calendar and address book, Davros, Hacker CMS
|
||||
- Kanban and project tools: Kanboard, Focalboard, MeisterTask, Obsidian Kanban, ClickUp, Nullboard, Kanri, monday.com,
|
||||
Wrike (Excel and workflow), Teamwork.com, Businessmap, Quire, Notion, Nextcloud Deck, OpenProject, Asana, Zenkit, Taiga
|
||||
- Issue trackers and version control: Linear, Pivotal Tracker, Redmine, GitLab, Gitea, Forgejo
|
||||
- Task and to-do apps: todo.txt, Taskwarrior, Todoist, TickTick, Tasks.org, Super Productivity, Vikunja
|
||||
- Text and outlines: Markdown, Leo, OPML, Org mode
|
||||
- Mail, chats and notes: mbox, Evernote, Mattermost, Rocket.Chat
|
||||
- Website: WordPress (.xml and REST API .json), Ghost, Blogger, Hugo / Jekyll / Eleventy / Astro (.zip of Markdown),
|
||||
HTML website (.zip, the published site ready for any web server)
|
||||
- Every export is written a page of cards at a time, so a large board exports without running out of memory
|
||||
- Export all boards at once (All Boards sidebar, or Multi-Selection): Excel as one workbook
|
||||
with a sheet per board, every other format as a .zip with a file per board
|
||||
- Scrum Settings
|
||||
- Scrum Settings: Definition of Ready and Done, Daily standup timer, Retrospective board
|
||||
- Change color theme, Change Background Image, Date settings
|
||||
- Settings:
|
||||
- Board View: Show/Hide and drag drop reorder what is shown atat Public Board and Private Board
|
||||
- Board View: Show/Hide and drag drop reorder what is shown at Public Board and Private Board
|
||||
- Swimlane: Scrum settings, Lock resize swimlane height, WIP Limit Groups
|
||||
- Board View: Show/Hide and drag drop reorder what is shown at Minicard and Card
|
||||
- Admin Panel
|
||||
- Settings
|
||||
- Version
|
||||
- Visibility: What is shown/hidden, Whitelabeling
|
||||
- Features: which features this WeKan offers, Card fields, Feature profiles
|
||||
- Appearance: What is shown/hidden, Whitelabeling
|
||||
- Announcement
|
||||
- Accessibility
|
||||
- Translation: Add custom translation strings
|
||||
@@ -116,6 +159,9 @@ that by providing one-click installation on various platforms.
|
||||
- Global Webhooks
|
||||
- People
|
||||
- Email, Notifications, Domains, Organizations, Teams, People
|
||||
- Cloud: the [Cloud Panel](docs/Features/Admin-Panel/Cloud-Panel.md) Domain and its SuperAdmin. At that domain the Cloud Panel keeps
|
||||
the customer domains - each with its own WeKan and MongoDB, or sharing this WeKan - and merges many WeKans into one,
|
||||
with CloudFlare DNS, Caddy routes, each customer's invoices, and a chat with earlier Rocket.Chat and SandChat conversations
|
||||
- Locked Users, Roles, Shared Templates
|
||||
- Login, SAML, LDAP, OAuth2 login providers, Passwordless login
|
||||
- Attachments
|
||||
@@ -159,7 +205,7 @@ docker-compose.yml at https://github.com/wekan/wekan/blob/main/docker-compose.ym
|
||||
|
||||
## Standards
|
||||
|
||||
- [WeKan and Standard for Public Code](https://wekan.fi/standard-for-public-code/) assessment was made at 2023-11. At 2026 WeKan becameß full FLOSS with [FerretDB v1 Fork](https://github.com/wekan/FerretDB), also see 2026 talk WeKan 10 years at https://wekan.fi/docs for more details.
|
||||
- [WeKan and Standard for Public Code](https://wekan.fi/standard-for-public-code/) assessment was made at 2023-11. At 2026 WeKan became full FLOSS with [FerretDB v1 Fork](https://github.com/wekan/FerretDB), also see 2026 talk WeKan 10 years at https://wekan.fi/docs for more details.
|
||||
Currently Wekan meets 9 out of 16 criteria out of the box.
|
||||
Some others could be met with small changes.
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
appId: wekan-public/apps/77b94f60-dec9-0136-304e-16ff53095928
|
||||
appVersion: "v13.13.0"
|
||||
appVersion: "v13.26.0"
|
||||
files:
|
||||
userUploads:
|
||||
- README.md
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
# TODO
|
||||
|
||||
What is not done yet in WeKan, with the reason it is not done. This used to be
|
||||
the TODO Later block inside `# Status` of `CHANGELOG-big.md`; it lives here so
|
||||
the changelog only says what changed.
|
||||
|
||||
- An item here is NOT done, so it thanks nobody and links no commit. Link the
|
||||
issue when there is one: `[#NNNN](https://github.com/wekan/wekan/issues/NNNN)`
|
||||
and a one-line reason.
|
||||
- When an item is done, REMOVE it from this file and write its entry in the
|
||||
`# Upcoming WeKan ® release` section of `CHANGELOG-big.md`, linking the commit.
|
||||
A fixed item never stays here.
|
||||
- An investigated issue that cannot be fixed or verified here is added under
|
||||
the category that says why. An emptied category is removed.
|
||||
|
||||
`tests/todoFile.test.cjs` checks this shape.
|
||||
|
||||
## Need the running app to reproduce/verify
|
||||
|
||||
- The WebKit stage cannot run in the Flatpak sandbox: MiniBrowser needs its own
|
||||
sandbox, and turning that off is not allowed there. Run it on a host.
|
||||
|
||||
## Need accounts on the tools, or a running copy of one
|
||||
|
||||
The import/export review asked on 2026-11-20 (everything each tool with a
|
||||
WeKan import or export can hold comes across, whole or in part) went through
|
||||
every parser and formatter against the export format its header documents.
|
||||
What it found is fixed and in the Upcoming release; the round trips are held
|
||||
by `tests/playwright/specs/export-import-round-trip.e2e.js` (41 formats, the
|
||||
description, checklist, comment, dependency, label and due date) and
|
||||
`tests/exportRoundTripFields.test.cjs` (32 formats in plain Node: start and
|
||||
creation dates, spent time, the done tick, recurrence, people, custom fields,
|
||||
color, Blocked), and a WeKan board's every field by
|
||||
`tests/wekanCardFields.test.cjs`. What is left needs what this checkout does
|
||||
not have:
|
||||
|
||||
- Each tool's newest release, checked with a real export file of it: Planner,
|
||||
Wrike, Teamwork, Businessmap, MeisterTask, Quire and Jira - the
|
||||
proprietary ones, whose current export is only seen with an account
|
||||
(Planner's newer Status, Task title and Assignments columns are read, as
|
||||
Microsoft's help page names them; a real file would confirm their exact
|
||||
spelling). The parsers follow
|
||||
the formats the tools document and report what they do not read, so a new
|
||||
field shows up in the import's loss report; checking for one needs an
|
||||
account on each tool. (Checked against their current source on 2026-11-20:
|
||||
Plane's IssueExportSerializer, Kanri's kanban-types.d.ts, Obsidian Kanban's
|
||||
markers, Nullboard's board object, and Gitea's (and Forgejo's) Issue
|
||||
struct, whose created_at, closed_at and time_estimate are read now;
|
||||
GitHub's REST issue, whose issue type is read now; GitLab's Issues API v4,
|
||||
whose health status and incident severity are read now. Redmine and
|
||||
monday.com import every column they do not name as a custom field, so a
|
||||
column a new release adds comes across without a change. Focalboard's archive
|
||||
format is frozen: Mattermost stopped merging changes to Focalboard and
|
||||
Boards in September 2023.
|
||||
Pivotal Tracker was shut down in 2025, so there is no newer release.
|
||||
Linear's open-source importer, @linear/import, declares the columns the
|
||||
parser reads.)
|
||||
@@ -2029,10 +2029,18 @@ if arguments >= 3 and sys.argv[1] == 'exportboardpdf':
|
||||
# { excelBase64 } (Plane's as { xlsxBase64 }), an export .zip as { zipBase64 },
|
||||
# a CSV/TSV file as rows, a text format as its text, and the rest as JSON.
|
||||
EXCEL_IMPORT_SOURCES = {'excel', 'planner', 'monday', 'wrike', 'teamwork', 'businessmap'}
|
||||
ZIP_IMPORT_SOURCES = {'vikunja', 'notion', 'plane'}
|
||||
ZIP_IMPORT_SOURCES = {'vikunja', 'notion', 'plane', 'slack', 'googletakeout', 'telegram', 'discord', 'rocketchat', 'fizzy',
|
||||
'outlook', 'teams', 'onenote',
|
||||
'sandstormwekan', 'sandstormprioritize', 'sandstormyatl', 'sandstormmutodo', 'sandstormsandchat', 'sandstormethercalc',
|
||||
'sandstormradicalecalendar', 'sandstormradicalecontacts', 'sandstormdavros', 'sandstormhackercms', 'sandstormgogs',
|
||||
'markdownsite', 'htmlsite', 'substack', 'sandstormwordpress'}
|
||||
# An Outlook .msg and the Teams export's .tar are sent as { binaryBase64 }.
|
||||
BINARY_IMPORT_EXTENSIONS = {'outlook': ('.msg',), 'teams': ('.tar',)}
|
||||
TEXT_IMPORT_SOURCES = {'markdown', 'todotxt', 'taskwarrior', 'focalboard', 'todoist', 'meistertask', 'obsidian',
|
||||
'linear', 'ticktick', 'clickup', 'nullboard', 'pivotal', 'redmine', 'superproductivity',
|
||||
'quire', 'orgmode', 'leo', 'opml', 'vikunja', 'notion', 'plane'}
|
||||
'quire', 'orgmode', 'leo', 'opml', 'vikunja', 'notion', 'plane',
|
||||
'mail', 'ical', 'mattermost', 'whatsapp', 'evernote', 'slack', 'googletakeout', 'rocketchat', 'fizzy',
|
||||
'azuredevops', 'mslists', 'msproject'}
|
||||
|
||||
def import_document(source, filepath):
|
||||
import base64, csv, io, os
|
||||
@@ -2044,6 +2052,9 @@ def import_document(source, filepath):
|
||||
if source in ZIP_IMPORT_SOURCES and ext == '.zip':
|
||||
with open(filepath, 'rb') as f:
|
||||
return {'zipBase64': base64.b64encode(f.read()).decode('ascii')}
|
||||
if ext in BINARY_IMPORT_EXTENSIONS.get(source, ()):
|
||||
with open(filepath, 'rb') as f:
|
||||
return {'binaryBase64': base64.b64encode(f.read()).decode('ascii')}
|
||||
with open(filepath, encoding='utf-8-sig') as f:
|
||||
text = f.read()
|
||||
if source == 'csv':
|
||||
|
||||
@@ -203,6 +203,8 @@ echo glab login ^(only scratch items it creates and removes^) and the API
|
||||
echo imports, read only ^(releases\live-tests\README.md^)
|
||||
echo 18^) Database speed test: the common WeKan queries on every database with an
|
||||
echo image for this CPU, compared, written to SpeedTest\Results.md
|
||||
echo 19^) Playwright single spec: one spec on the browsers you choose; builds and
|
||||
echo starts the test server when none is running on :3000
|
||||
set "choice="
|
||||
set /p "choice=Choose: "
|
||||
if "%choice%"=="1" goto test_everything_two
|
||||
@@ -223,6 +225,7 @@ if "%choice%"=="15" goto test_ferretdb
|
||||
if "%choice%"=="16" goto test_everything_source
|
||||
if "%choice%"=="17" goto test_live
|
||||
if "%choice%"=="18" goto test_db_speed
|
||||
if "%choice%"=="19" goto test_pw_spec
|
||||
if "%choice%"=="0" goto menu
|
||||
goto menu_tests
|
||||
|
||||
@@ -1532,6 +1535,87 @@ set "WEKAN_PLAYWRIGHT_PROJECT=%PW_PROJECT%"
|
||||
call meteor npm exec playwright test -- --project=%PW_PROJECT% 2>&1 | powershell -NoProfile -Command "$input | Tee-Object -FilePath '%ONELOG%'; exit $LASTEXITCODE"
|
||||
goto end
|
||||
|
||||
REM ===========================================================================
|
||||
:test_pw_spec
|
||||
REM Parity with build.sh's "Playwright single spec" (run_playwright_spec): one
|
||||
REM spec, chosen by file name or a part of it, on the browsers you choose. A
|
||||
REM WeKan already answering on :3000 is used as it is; otherwise a fresh bundle
|
||||
REM is built and the test server started as the whole-suite runs do, and
|
||||
REM stopped again afterwards. Logs in .tools\log\test-playwright-spec\.
|
||||
set "PW_SPEC="
|
||||
set /p "PW_SPEC=Spec file or part of its name (e.g. feature-profiles): "
|
||||
if not defined PW_SPEC goto menu_tests
|
||||
set "PW_MATCH=" & set "PW_COUNT=0"
|
||||
for /f "delims=" %%f in ('dir /b "%REPO%\tests\playwright\specs\*.js" ^| findstr /i /l /c:"%PW_SPEC%"') do (
|
||||
set /a PW_COUNT+=1
|
||||
set "PW_MATCH=%%f"
|
||||
echo %%f
|
||||
)
|
||||
if "%PW_COUNT%"=="0" (
|
||||
echo No spec under tests\playwright\specs matches "%PW_SPEC%".
|
||||
goto test_pw_spec
|
||||
)
|
||||
if not "%PW_COUNT%"=="1" (
|
||||
echo Several specs match - type more of the name.
|
||||
goto test_pw_spec
|
||||
)
|
||||
echo Spec: specs/%PW_MATCH%
|
||||
echo Browser: 1^) chromium 2^) firefox 3^) webkit 4^) all
|
||||
set "PW_B="
|
||||
set /p "PW_B=Choose [1]: "
|
||||
set "PW_BROWSERS=chromium"
|
||||
if "%PW_B%"=="2" set "PW_BROWSERS=firefox"
|
||||
if "%PW_B%"=="3" set "PW_BROWSERS=webkit"
|
||||
if "%PW_B%"=="4" set "PW_BROWSERS=chromium firefox webkit"
|
||||
set "PW_GREP="
|
||||
set /p "PW_GREP=Only the tests whose title contains (empty = the whole spec): "
|
||||
call :logdir test-playwright-spec
|
||||
if errorlevel 1 goto end
|
||||
set "RUN_LOGDIR=%LOG_DIRECTORY%"
|
||||
if not exist "%RUN_LOGDIR%" md "%RUN_LOGDIR%"
|
||||
echo Logs: %RUN_LOGDIR%\
|
||||
set "PW_STARTED=0"
|
||||
curl -fsS http://127.0.0.1:3000/sign-in >nul 2>&1
|
||||
if not errorlevel 1 (
|
||||
echo ==^> Using the WeKan already running on http://localhost:3000 ^(not started or stopped here^).
|
||||
echo It runs whatever code it was started with: after changing the source, stop it and run this again.
|
||||
goto test_pw_spec_run
|
||||
)
|
||||
set "PW_BUILD="
|
||||
set /p "PW_BUILD=Nothing answers on :3000. Build a fresh bundle and start the test server? [Y/n] "
|
||||
if /i "%PW_BUILD%"=="n" goto end
|
||||
call :rebuild_for_tests
|
||||
if errorlevel 1 goto end
|
||||
call :start_bundle_server
|
||||
if errorlevel 1 goto end
|
||||
set "PW_STARTED=1"
|
||||
if not "!SERVER_READY!"=="1" (
|
||||
echo ERROR: the test server did not answer on :3000 ^(see %RUN_LOGDIR%\wekan-test-server.log^).
|
||||
call :stop_test_databases
|
||||
goto end
|
||||
)
|
||||
:test_pw_spec_run
|
||||
set "PW_RESULT="
|
||||
for %%b in (%PW_BROWSERS%) do (
|
||||
echo ==^> Playwright %%b: specs/%PW_MATCH%
|
||||
pushd "%REPO%\tests\playwright"
|
||||
set "WEKAN_PLAYWRIGHT_ALL=1"
|
||||
set "WEKAN_PLAYWRIGHT_PROJECT=%%b"
|
||||
if defined PW_GREP (
|
||||
call meteor npm exec playwright test -- --project=%%b --output=test-results\spec-%%b --reporter=list "specs/%PW_MATCH%" --grep "%PW_GREP%" > "%RUN_LOGDIR%\wekan-playwright-%%b.log" 2>&1
|
||||
) else (
|
||||
call meteor npm exec playwright test -- --project=%%b --output=test-results\spec-%%b --reporter=list "specs/%PW_MATCH%" > "%RUN_LOGDIR%\wekan-playwright-%%b.log" 2>&1
|
||||
)
|
||||
if errorlevel 1 (set "PW_RESULT=!PW_RESULT! FAIL:%%b") else (set "PW_RESULT=!PW_RESULT! PASS:%%b")
|
||||
popd
|
||||
type "%RUN_LOGDIR%\wekan-playwright-%%b.log"
|
||||
)
|
||||
if "%PW_STARTED%"=="1" call :stop_test_databases
|
||||
echo.
|
||||
echo ===== specs/%PW_MATCH% =====
|
||||
for %%r in (!PW_RESULT!) do echo %%r
|
||||
goto end
|
||||
|
||||
REM ===========================================================================
|
||||
:test_pw_parallel
|
||||
echo Running Chromium, Firefox and WebKit Playwright suites sequentially (one browser at a time).
|
||||
|
||||
@@ -1127,6 +1127,185 @@ function run_playwright_single(){
|
||||
return "${PIPESTATUS[0]}"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# One Playwright spec, on the browsers you choose.
|
||||
#
|
||||
# ./build.sh --playwright-spec <spec> [chromium|firefox|webkit|all] [title filter]
|
||||
# or Tests -> "Playwright single spec" (asks the same three things).
|
||||
#
|
||||
# <spec> is a file under tests/playwright/specs or a part of its name
|
||||
# ("feature-profiles" finds specs/feature-profiles.e2e.js). The title filter is
|
||||
# Playwright's --grep. When something already answers on :3000 it is used as it
|
||||
# is; otherwise this builds a fresh bundle and starts the test server exactly
|
||||
# like the whole-suite runs do (Meteor's mongod on :3001, the bundle on :3000),
|
||||
# and stops both when the spec is done. Each browser runs natively when it can
|
||||
# launch here and in the official Playwright container when it cannot (the
|
||||
# same choice as run_pw_all_browser). Logs in .tools/log/test-playwright-spec/.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# The spec files matching $1, relative to tests/playwright, one per line.
|
||||
function playwright_specs_matching(){
|
||||
local want="${1#tests/playwright/}"
|
||||
want="${want#specs/}"
|
||||
local dir="$WEKAN_DIR/tests/playwright/specs"
|
||||
if [ -n "$want" ] && [ -f "$dir/$want" ]; then
|
||||
echo "specs/$want"; return 0
|
||||
fi
|
||||
( cd "$WEKAN_DIR/tests/playwright" && find specs -name '*.js' | sort | grep -F -- "$want" )
|
||||
}
|
||||
|
||||
# Start the test server the way run_all_tests does, unless one answers already.
|
||||
# Sets SPEC_SERVER_PID / SPEC_MONGOD_PID for the processes it started.
|
||||
function start_spec_test_server(){
|
||||
local logdir="$1" build="$2"
|
||||
SPEC_SERVER_PID=""; SPEC_MONGOD_PID=""
|
||||
if curl -fsS --max-time 3 -o /dev/null http://localhost:3000/sign-in 2>/dev/null; then
|
||||
echo "==> Using the WeKan already running on http://localhost:3000 (not started or stopped here)."
|
||||
echo " It runs whatever code it was started with: after changing the source, stop it"
|
||||
echo " and run this again, so a fresh bundle is built."
|
||||
return 0
|
||||
fi
|
||||
if [ "$build" = ask ]; then
|
||||
local ans
|
||||
read -r -p "Nothing answers on :3000. Build a fresh bundle and start the test server? [Y/n] " ans
|
||||
case "$ans" in [Nn]*) echo "Nothing to test against."; return 1 ;; esac
|
||||
fi
|
||||
echo "==> Building WeKan, so the spec runs against the current source."
|
||||
build_wekan || return 1
|
||||
BUNDLE_DIR=".build/bundle"
|
||||
NODE_BIN="$(meteor node -e 'process.stdout.write(process.execPath)' 2>/dev/null)"
|
||||
local MONGOD_BIN=""
|
||||
[ -n "$NODE_BIN" ] && MONGOD_BIN="$(dirname "$(dirname "$NODE_BIN")")/mongodb/bin/mongod"
|
||||
[ -x "$MONGOD_BIN" ] || MONGOD_BIN="$(command -v mongod)"
|
||||
[ -x "$NODE_BIN" ] || NODE_BIN="$(command -v node)"
|
||||
if [ ! -d "$BUNDLE_DIR/programs/server/node_modules" ]; then
|
||||
( cd "$BUNDLE_DIR/programs/server" && meteor npm install ) >> "$logdir/wekan-test-server.log" 2>&1 || {
|
||||
echo "ERROR: npm install in $BUNDLE_DIR/programs/server failed (see $logdir/wekan-test-server.log)."; return 1; }
|
||||
fi
|
||||
local port="${WEKAN_TEST_DB_PORT:-3001}"
|
||||
export WEKAN_MONGO_URL="mongodb://127.0.0.1:$port/meteor"
|
||||
if mongo_answers "$port"; then
|
||||
echo "==> Reusing the MongoDB already answering on :$port."
|
||||
elif (exec 3<>/dev/tcp/127.0.0.1/"$port") 2>/dev/null; then
|
||||
echo "ERROR: :$port is taken by something that does not answer as MongoDB. Set WEKAN_TEST_DB_PORT."; return 1
|
||||
else
|
||||
[ -x "$MONGOD_BIN" ] || { echo "ERROR: no mongod found (Meteor's dev_bundle or PATH)."; return 1; }
|
||||
local dbpath="$WEKAN_DIR/.tools/mongodb-test-$port" i
|
||||
mkdir -p "$dbpath"
|
||||
"$MONGOD_BIN" --port "$port" --dbpath "$dbpath" --bind_ip 127.0.0.1 --nounixsocket > "$logdir/wekan-test-mongod.log" 2>&1 &
|
||||
SPEC_MONGOD_PID=$!
|
||||
for i in $(seq 1 60); do mongo_answers "$port" && break; sleep 1; done
|
||||
mongo_answers "$port" || { echo "ERROR: MongoDB did not start on :$port (see $logdir/wekan-test-mongod.log)."; return 1; }
|
||||
fi
|
||||
local writable="$WEKAN_DIR/.tools/test-writable"
|
||||
mkdir -p "$writable/files"
|
||||
export WEKAN_FILES_PATH="$writable/files" WEKAN_FILES_PATH_HOST="$writable/files"
|
||||
echo "==> Starting the WeKan test server on http://localhost:3000 (log: $logdir/wekan-test-server.log)."
|
||||
MONGO_URL="$WEKAN_MONGO_URL" ROOT_URL="http://localhost:3000" PORT=3000 \
|
||||
WRITABLE_PATH="$writable" WITH_API=true \
|
||||
DEFAULT_METEOR_REACTIVITY_ORDER="changeStreams,oplog,polling" \
|
||||
NODE_OPTIONS="${WEKAN_TEST_NODE_OPTIONS:---max-old-space-size=4096}" \
|
||||
"$NODE_BIN" "$BUNDLE_DIR/main.js" >> "$logdir/wekan-test-server.log" 2>&1 &
|
||||
SPEC_SERVER_PID=$!
|
||||
local i
|
||||
for i in $(seq 1 300); do
|
||||
curl -fsS --max-time 2 -o /dev/null http://localhost:3000/sign-in 2>/dev/null && { echo "==> Server is up."; return 0; }
|
||||
kill -0 "$SPEC_SERVER_PID" 2>/dev/null || break
|
||||
sleep 1
|
||||
done
|
||||
echo "ERROR: the test server did not answer on :3000. Last lines of its log:"
|
||||
tail -n 30 "$logdir/wekan-test-server.log"
|
||||
return 1
|
||||
}
|
||||
|
||||
function stop_spec_test_server(){
|
||||
[ -n "${SPEC_SERVER_PID:-}" ] && kill "$SPEC_SERVER_PID" 2>/dev/null && wait "$SPEC_SERVER_PID" 2>/dev/null
|
||||
[ -n "${SPEC_MONGOD_PID:-}" ] && kill "$SPEC_MONGOD_PID" 2>/dev/null && wait "$SPEC_MONGOD_PID" 2>/dev/null
|
||||
SPEC_SERVER_PID=""; SPEC_MONGOD_PID=""
|
||||
}
|
||||
|
||||
# run_playwright_spec [spec] [browser] [title filter] - asks for what is missing
|
||||
# when run from the menu (interactive), and builds without asking from --playwright-spec.
|
||||
function run_playwright_spec(){
|
||||
local spec="${1:-}" browser="${2:-}" grep="${3:-}" mode="${4:-ask}"
|
||||
if [ -z "$spec" ]; then
|
||||
read -r -p "Spec file or part of its name (e.g. feature-profiles): " spec
|
||||
fi
|
||||
local matches
|
||||
matches="$(playwright_specs_matching "$spec")"
|
||||
if [ -z "$matches" ]; then
|
||||
echo "ERROR: no spec under tests/playwright/specs matches '$spec'."; return 1
|
||||
fi
|
||||
if [ "$(printf '%s\n' "$matches" | wc -l)" -gt 1 ]; then
|
||||
if [ "$mode" != ask ]; then
|
||||
echo "ERROR: '$spec' matches several specs - name one:"; printf ' %s\n' $matches; return 1
|
||||
fi
|
||||
echo "Several specs match '$spec':"
|
||||
local pick
|
||||
select pick in $matches; do [ -n "$pick" ] && break; done
|
||||
matches="$pick"
|
||||
fi
|
||||
spec="$matches"
|
||||
if [ -z "$browser" ]; then
|
||||
echo "Which browser?"
|
||||
select browser in chromium firefox webkit all; do [ -n "$browser" ] && break; done
|
||||
fi
|
||||
case "$browser" in chromium|firefox|webkit) local browsers=("$browser") ;;
|
||||
all) local browsers=(chromium firefox webkit) ;;
|
||||
*) echo "ERROR: browser must be chromium, firefox, webkit or all (got '$browser')."; return 2 ;;
|
||||
esac
|
||||
if [ -z "$grep" ] && [ "$mode" = ask ]; then
|
||||
read -r -p "Only the tests whose title contains (empty = the whole spec): " grep
|
||||
fi
|
||||
local args=("$spec")
|
||||
[ -n "$grep" ] && args+=(--grep "$grep")
|
||||
local logdir
|
||||
logdir="$(log_directory test-playwright-spec)" || return $?
|
||||
mkdir -p "$logdir"; logdir="$(cd "$logdir" && pwd)"
|
||||
echo "Spec: $spec Browsers: ${browsers[*]}${grep:+ Title filter: $grep}"
|
||||
echo "Logs: $logdir/"
|
||||
ensure_playwright_test_dependencies || return 1
|
||||
start_spec_test_server "$logdir" "$mode" || { stop_spec_test_server; return 1; }
|
||||
local pwdir="$WEKAN_DIR/tests/playwright" b rc=0 one results=()
|
||||
for b in "${browsers[@]}"; do
|
||||
local log="$logdir/wekan-playwright-$b.log"
|
||||
# Docker where this platform wants it or the native browser cannot start;
|
||||
# native where Docker is missing but the browser starts (Chromium in the
|
||||
# VSCodium Flatpak on arm64 does, although auto picks Docker there).
|
||||
local use_docker=0
|
||||
browser_needs_docker "$b" && use_docker=1
|
||||
if [ "$use_docker" = 1 ] && ! docker_available; then
|
||||
use_docker=0
|
||||
elif [ "$use_docker" = 0 ]; then
|
||||
ensure_native_playwright_browser "$b" >/dev/null 2>&1
|
||||
native_browser_can_launch "$b" || { docker_available && use_docker=1; }
|
||||
fi
|
||||
if [ "$use_docker" = 0 ] && ! native_browser_can_launch "$b"; then
|
||||
echo "SKIPPED $b: it cannot launch natively here and Docker is unavailable."
|
||||
results+=("SKIPPED $b"); rc=1; continue
|
||||
fi
|
||||
if [ "$use_docker" = 1 ]; then
|
||||
( cd "$pwdir" && run_playwright_docker "$b" --output="test-results/spec-$b" --reporter=list "${args[@]}" ) 2>&1 | tee "$log"
|
||||
one=${PIPESTATUS[0]}
|
||||
else
|
||||
(
|
||||
cd "$pwdir"
|
||||
export HOME="$WEKAN_DIR/.tools"
|
||||
set_playwright_browser_path
|
||||
unset CHROME_DEVEL_SANDBOX
|
||||
export WEKAN_PLAYWRIGHT_ALL=1 WEKAN_PLAYWRIGHT_PROJECT="$b"
|
||||
PLAYWRIGHT_HTML_OPEN=never meteor npm exec playwright test -- --project="$b" \
|
||||
--output="test-results/spec-$b" --reporter=list "${args[@]}"
|
||||
) 2>&1 | tee "$log"
|
||||
one=${PIPESTATUS[0]}
|
||||
fi
|
||||
[ "$one" -eq 0 ] && results+=("PASS $b") || { results+=("FAIL $b (exit $one, $log)"); rc=1; }
|
||||
done
|
||||
stop_spec_test_server
|
||||
echo; echo "===== $spec ====="; printf ' %s\n' "${results[@]}"
|
||||
return "$rc"
|
||||
}
|
||||
|
||||
# Run the full test matrix (Mocha, import regression, Node E2E and the three
|
||||
# Playwright browser suites) against ONE WeKan server on http://localhost:3000,
|
||||
# then print a combined PASS/FAIL summary.
|
||||
@@ -2909,6 +3088,8 @@ WeKan build.sh - menu, or a command line.
|
||||
./build.sh --list every command name, with what it does
|
||||
./build.sh <name> [arguments] run one, without the menu
|
||||
./build.sh --run-everything every test WeKan and FerretDB have
|
||||
./build.sh --playwright-spec <spec> [chromium|firefox|webkit|all] [title filter]
|
||||
one Playwright spec; starts the test server if needed
|
||||
|
||||
Examples:
|
||||
|
||||
@@ -2952,6 +3133,9 @@ cli_run() {
|
||||
# the menu.
|
||||
case "${1:-}" in
|
||||
--run-everything) run_everything "${2:-two-worker}"; exit $? ;;
|
||||
--playwright-spec)
|
||||
[ -n "${2:-}" ] || { echo "Usage: ./build.sh --playwright-spec <spec> [chromium|firefox|webkit|all] [title filter]" >&2; exit 2; }
|
||||
run_playwright_spec "$2" "${3:-chromium}" "${4:-}" build; exit $? ;;
|
||||
-h|--help|help) cli_help; exit 0 ;;
|
||||
-l|--list|list) cli_help | head -8; echo; echo "Commands:"; cli_list; exit 0 ;;
|
||||
"") ;; # no arguments: the menu below
|
||||
@@ -2995,6 +3179,7 @@ while [ -z "$opt" ]; do
|
||||
"Playwright Firefox|Test Playwright Firefox" \
|
||||
"Playwright WebKit|Test Playwright Webkit" \
|
||||
"Playwright ALL browsers|Test Playwright ALL browsers sequentially (Chromium + Firefox + WebKit, one at a time), server already running on :3000" \
|
||||
"Playwright single spec|Test one Playwright spec on the browsers you choose; builds and starts the test server when none is running on :3000" \
|
||||
"Floating-promises guard|Check floating promises guard (@typescript-eslint/no-floating-promises + auth await scan)" \
|
||||
"Count tests by category|Count amount of tests by category" \
|
||||
"Run all FerretDB tests - SEQUENTIAL|Run all FerretDB tests - SEQUENTIAL: unit, vet and the integration suite of the FerretDB subdirectory of this repo, one at a time, logs in log/<datetime>/" \
|
||||
@@ -3383,6 +3568,11 @@ for _once in 1; do
|
||||
break
|
||||
;;
|
||||
|
||||
"Test one Playwright spec on the browsers you choose; builds and starts the test server when none is running on :3000")
|
||||
run_playwright_spec
|
||||
break
|
||||
;;
|
||||
|
||||
"Check floating promises guard (@typescript-eslint/no-floating-promises + auth await scan)")
|
||||
LOG="$(one_log floating-promises)"
|
||||
echo "Log: $LOG"
|
||||
|
||||
@@ -110,6 +110,30 @@ template(name="boardBody")
|
||||
+processBehaviorView
|
||||
else if isViewSizeCycleTime
|
||||
+sizeCycleTimeView
|
||||
else if isViewCreatedResolved
|
||||
+createdResolvedView
|
||||
else if isViewNetFlow
|
||||
+netFlowView
|
||||
else if isViewTimeInList
|
||||
+timeInListView
|
||||
else if isViewAverageAge
|
||||
+averageAgeView
|
||||
else if isViewThroughputRun
|
||||
+throughputRunView
|
||||
else if isViewDueDatePerformance
|
||||
+dueDatePerformanceView
|
||||
else if isViewReleaseBurndown
|
||||
+releaseBurndownView
|
||||
else if isViewEpicProgress
|
||||
+epicProgressView
|
||||
else if isViewWorkload
|
||||
+workloadView
|
||||
else if isViewDistribution
|
||||
+distributionView
|
||||
else if isViewDependencyMap
|
||||
+dependencyMapView
|
||||
else if isViewActivityHeatmap
|
||||
+activityHeatmapView
|
||||
else if isViewPulse
|
||||
+pulseView
|
||||
else if isViewMap
|
||||
@@ -118,6 +142,8 @@ template(name="boardBody")
|
||||
+emailView
|
||||
else if isViewChat
|
||||
+chatView
|
||||
else if isViewWebsite
|
||||
+websiteView
|
||||
else if isViewVersionControl
|
||||
+versionControlView
|
||||
else if isViewColumnSets
|
||||
|
||||
@@ -964,6 +964,55 @@ Template.boardBody.helpers({
|
||||
return Utils.boardView() === 'board-view-size-cycle-time';
|
||||
},
|
||||
|
||||
// The reports of 2026-11-20 (models/lib/boardReports.js).
|
||||
isViewCreatedResolved() {
|
||||
return Utils.boardView() === 'board-view-created-resolved';
|
||||
},
|
||||
|
||||
isViewNetFlow() {
|
||||
return Utils.boardView() === 'board-view-net-flow';
|
||||
},
|
||||
|
||||
isViewTimeInList() {
|
||||
return Utils.boardView() === 'board-view-time-in-list';
|
||||
},
|
||||
|
||||
isViewAverageAge() {
|
||||
return Utils.boardView() === 'board-view-average-age';
|
||||
},
|
||||
|
||||
isViewThroughputRun() {
|
||||
return Utils.boardView() === 'board-view-throughput-run';
|
||||
},
|
||||
|
||||
isViewDueDatePerformance() {
|
||||
return Utils.boardView() === 'board-view-due-date-performance';
|
||||
},
|
||||
|
||||
isViewReleaseBurndown() {
|
||||
return Utils.boardView() === 'board-view-release-burndown';
|
||||
},
|
||||
|
||||
isViewEpicProgress() {
|
||||
return Utils.boardView() === 'board-view-epic-progress';
|
||||
},
|
||||
|
||||
isViewWorkload() {
|
||||
return Utils.boardView() === 'board-view-workload';
|
||||
},
|
||||
|
||||
isViewDistribution() {
|
||||
return Utils.boardView() === 'board-view-distribution';
|
||||
},
|
||||
|
||||
isViewDependencyMap() {
|
||||
return Utils.boardView() === 'board-view-dependency-map';
|
||||
},
|
||||
|
||||
isViewActivityHeatmap() {
|
||||
return Utils.boardView() === 'board-view-activity-heatmap';
|
||||
},
|
||||
|
||||
isViewMap() {
|
||||
return Utils.boardView() === 'board-view-map';
|
||||
},
|
||||
@@ -973,6 +1022,9 @@ Template.boardBody.helpers({
|
||||
isViewChat() {
|
||||
return Utils.boardView() === 'board-view-chat';
|
||||
},
|
||||
isViewWebsite() {
|
||||
return Utils.boardView() === 'board-view-website';
|
||||
},
|
||||
isViewColumnSets() {
|
||||
return Utils.boardView() === 'board-view-column-sets';
|
||||
},
|
||||
|
||||
@@ -983,3 +983,20 @@ body.board-view.mobile-mode #header #header-main-bar .board-header-sidebar-toggl
|
||||
font-size: calc(16px * var(--wekan-ui-font-scale, 1));
|
||||
}
|
||||
}
|
||||
|
||||
/* Board View menu: the heading over each group of views
|
||||
(models/lib/boardViewSettings.js BOARD_VIEW_GROUPS). */
|
||||
.pop-over-list .board-view-group-heading {
|
||||
padding: 8px 10px 2px;
|
||||
font-size: 0.8em;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
/* 4.5:1 for small text; #6b778c on white is 4.48:1. */
|
||||
color: #505f79;
|
||||
cursor: default;
|
||||
}
|
||||
.pop-over-list .board-view-group-heading:not(:first-child) {
|
||||
margin-top: 4px;
|
||||
border-top: 1px solid #dfe1e6;
|
||||
}
|
||||
@@ -173,16 +173,18 @@ template(name="boardChangeWatchPopup")
|
||||
(js-open-<view>-view), which is what the click handlers in boardHeader.js
|
||||
listen for. docs/Features/Board-Sidebar/Board-Settings/Board-View.md
|
||||
template(name="boardChangeViewPopup")
|
||||
//- Grouped, a heading over each group (models/lib/boardViewSettings.js
|
||||
BOARD_VIEW_GROUPS), the board's own order inside a group.
|
||||
ul.pop-over-list
|
||||
each boardViewMenuEntries
|
||||
if groupLabelKey
|
||||
li.board-view-group-heading {{_ groupLabelKey}}
|
||||
li
|
||||
a.js-board-view-entry(class="{{jsClass}}")
|
||||
i.fa(class="{{icon}}")
|
||||
| {{_ labelKey}}
|
||||
if isCurrent
|
||||
i.fa.fa-check
|
||||
if separatorAfter
|
||||
hr
|
||||
|
||||
//- The Create Board form: a title, what the board is visible to, and Create.
|
||||
Four templates drew it letter for letter - the one on the All Boards page and
|
||||
|
||||
@@ -452,6 +452,55 @@ Template.boardChangeViewPopup.events({
|
||||
Utils.setBoardView('board-view-size-cycle-time');
|
||||
Popup.back();
|
||||
},
|
||||
// The reports of 2026-11-20 (models/lib/boardReports.js).
|
||||
'click .js-open-created-resolved-view'() {
|
||||
Utils.setBoardView('board-view-created-resolved');
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-open-net-flow-view'() {
|
||||
Utils.setBoardView('board-view-net-flow');
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-open-time-in-list-view'() {
|
||||
Utils.setBoardView('board-view-time-in-list');
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-open-average-age-view'() {
|
||||
Utils.setBoardView('board-view-average-age');
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-open-throughput-run-view'() {
|
||||
Utils.setBoardView('board-view-throughput-run');
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-open-due-date-performance-view'() {
|
||||
Utils.setBoardView('board-view-due-date-performance');
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-open-release-burndown-view'() {
|
||||
Utils.setBoardView('board-view-release-burndown');
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-open-epic-progress-view'() {
|
||||
Utils.setBoardView('board-view-epic-progress');
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-open-workload-view'() {
|
||||
Utils.setBoardView('board-view-workload');
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-open-distribution-view'() {
|
||||
Utils.setBoardView('board-view-distribution');
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-open-dependency-map-view'() {
|
||||
Utils.setBoardView('board-view-dependency-map');
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-open-activity-heatmap-view'() {
|
||||
Utils.setBoardView('board-view-activity-heatmap');
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-open-map-view'() {
|
||||
Utils.setBoardView('board-view-map');
|
||||
Popup.back();
|
||||
@@ -464,6 +513,10 @@ Template.boardChangeViewPopup.events({
|
||||
Utils.setBoardView('board-view-chat');
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-open-website-view'() {
|
||||
Utils.setBoardView('board-view-website');
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-open-version-control-view'() {
|
||||
Utils.setBoardView('board-view-version-control');
|
||||
Popup.back();
|
||||
@@ -974,8 +1027,21 @@ Template.boardViewMenu.helpers({
|
||||
'board-view-map': 'board-view-map',
|
||||
'board-view-email': 'board-view-email',
|
||||
'board-view-chat': 'board-view-chat',
|
||||
'board-view-website': 'board-view-website',
|
||||
'board-view-version-control': 'board-view-version-control',
|
||||
'board-view-column-sets': 'board-view-column-sets',
|
||||
'board-view-created-resolved': 'board-view-created-resolved',
|
||||
'board-view-net-flow': 'board-view-net-flow',
|
||||
'board-view-time-in-list': 'board-view-time-in-list',
|
||||
'board-view-average-age': 'board-view-average-age',
|
||||
'board-view-throughput-run': 'board-view-throughput-run',
|
||||
'board-view-due-date-performance': 'board-view-due-date-performance',
|
||||
'board-view-release-burndown': 'board-view-release-burndown',
|
||||
'board-view-epic-progress': 'board-view-epic-progress',
|
||||
'board-view-workload': 'board-view-workload',
|
||||
'board-view-distribution': 'board-view-distribution',
|
||||
'board-view-dependency-map': 'board-view-dependency-map',
|
||||
'board-view-activity-heatmap': 'board-view-activity-heatmap',
|
||||
};
|
||||
return TAPi18n.__(names[Utils.boardView()] || 'board-view');
|
||||
},
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/**
|
||||
* Pure helpers for building the option labels shown in board / list /
|
||||
* swimlane selectors (e.g. the move-card and copy-card popups).
|
||||
*
|
||||
* Regression #6135 ("numbering boards, list, swim caused some issues"):
|
||||
* a previous change prepended a sequential number to every option label
|
||||
* (e.g. "3. My Board"). That broke two things:
|
||||
*
|
||||
* 1. Boards whose name itself starts with a digit became hard to read.
|
||||
* 2. First-letter keyboard navigation in the native <select> dropdown
|
||||
* stopped working, because every option started with a number instead
|
||||
* of the board name.
|
||||
*
|
||||
* The fix: numbering is OPTIONAL and OFF by default. By default the label is
|
||||
* exactly the entity name, so its first character is the name's first
|
||||
* character and first-letter navigation works again. When numbering is
|
||||
* explicitly enabled, the number is appended as a trailing visual suffix so
|
||||
* the label still STARTS with the name.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Build the label for a selectable board/list/swimlane option.
|
||||
*
|
||||
* @param {string} name The entity (board/list/swimlane) name/title.
|
||||
* @param {number} index Zero-based position in the list.
|
||||
* @param {Object} [opts]
|
||||
* @param {boolean} [opts.numbered=false] When true, append the 1-based
|
||||
* number as a trailing suffix. When false (default), return the bare
|
||||
* name so first-letter keyboard navigation keeps working.
|
||||
* @returns {string} The option label.
|
||||
*/
|
||||
export function boardOptionLabel(name, index, { numbered = false } = {}) {
|
||||
const label = name == null ? '' : String(name);
|
||||
if (!numbered) {
|
||||
return label;
|
||||
}
|
||||
const position = Number(index);
|
||||
const number = Number.isFinite(position) ? position + 1 : index;
|
||||
return `${label} (${number})`;
|
||||
}
|
||||
|
||||
export default boardOptionLabel;
|
||||
@@ -75,16 +75,11 @@ import { errorMessage } from '/client/lib/errorMessage';
|
||||
// SubsManager removed for Meteor 3 migration
|
||||
|
||||
// #5850: which sharing scopes (organizations/teams/domains) the admin enabled
|
||||
// in Admin Panel > People > Shared Templates (stored in localStorage, like the
|
||||
// Shared Templates admin UI). Used to gate the drag-to-share drop targets.
|
||||
// in Admin Panel > People > Shared Templates - an instance setting, the same in
|
||||
// every browser. Used to gate the drag-to-share drop targets.
|
||||
function loadSharedTemplatesScopes() {
|
||||
try {
|
||||
const raw = window.localStorage.getItem('sharedTemplatesScopes');
|
||||
const arr = raw ? JSON.parse(raw) : [];
|
||||
return Array.isArray(arr) ? arr : [];
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
const { sharedTemplatesScopes } = require('/models/lib/sharedTemplatesScopes');
|
||||
return sharedTemplatesScopes(ReactiveCache.getCurrentSetting());
|
||||
}
|
||||
|
||||
// #5850: share a (template) board with an Organization / Team / Domain by adding
|
||||
@@ -1178,7 +1173,7 @@ Template.boardList.helpers({
|
||||
return Template.instance().selectedMenu.get() === type;
|
||||
},
|
||||
// #5850: drag-to-share drop targets — the user's organizations/teams/domains,
|
||||
// gated by the admin's Shared Templates scopes (localStorage). Shown in the
|
||||
// gated by the admin's Shared Templates scopes (Settings). Shown in the
|
||||
// Templates view so a personal Template Board can be dragged onto one to share.
|
||||
shareTargets() {
|
||||
const scopes = loadSharedTemplatesScopes();
|
||||
|
||||
@@ -51,3 +51,49 @@ template(name="processBehaviorView")
|
||||
|
||||
template(name="sizeCycleTimeView")
|
||||
+boardChartView(chartKey="sizeCycleTime" titleKey="board-view-size-cycle-time")
|
||||
|
||||
//- The reports of 2026-11-20 (models/lib/boardReports.js): each answers bars and
|
||||
a table, drawn and exported by boardChartView like the charts above.
|
||||
|
||||
template(name="createdResolvedView")
|
||||
+boardChartView(chartKey="createdResolved" titleKey="board-view-created-resolved")
|
||||
|
||||
template(name="netFlowView")
|
||||
+boardChartView(chartKey="netFlow" titleKey="board-view-net-flow")
|
||||
|
||||
template(name="timeInListView")
|
||||
+boardChartView(chartKey="timeInList" titleKey="board-view-time-in-list")
|
||||
|
||||
template(name="averageAgeView")
|
||||
+boardChartView(chartKey="averageAge" titleKey="board-view-average-age")
|
||||
|
||||
template(name="throughputRunView")
|
||||
+boardChartView(chartKey="throughputRun" titleKey="board-view-throughput-run")
|
||||
|
||||
template(name="dueDatePerformanceView")
|
||||
+boardChartView(chartKey="dueDatePerformance" titleKey="board-view-due-date-performance")
|
||||
|
||||
template(name="releaseBurndownView")
|
||||
+boardChartView(chartKey="releaseBurndown" titleKey="board-view-release-burndown")
|
||||
|
||||
template(name="epicProgressView")
|
||||
+boardChartView(chartKey="epicProgress" titleKey="board-view-epic-progress")
|
||||
|
||||
template(name="workloadView")
|
||||
+boardChartView(chartKey="workload" titleKey="board-view-workload")
|
||||
//- This board's open cards per person; the hours against each person's
|
||||
capacity, across all their boards, are on the Workload and capacity page.
|
||||
if allowFeature 'workload'
|
||||
p.workload-cross-board-link
|
||||
a(href="{{pathFor 'workload'}}")
|
||||
i.fa.fa-tachometer
|
||||
| {{_ 'workload-title'}}
|
||||
|
||||
template(name="distributionView")
|
||||
+boardChartView(chartKey="distribution" titleKey="board-view-distribution")
|
||||
|
||||
template(name="dependencyMapView")
|
||||
+boardChartView(chartKey="dependencyMap" titleKey="board-view-dependency-map")
|
||||
|
||||
template(name="activityHeatmapView")
|
||||
+boardChartView(chartKey="activityHeatmap" titleKey="board-view-activity-heatmap")
|
||||
@@ -15,6 +15,18 @@ const PLACEHOLDER_VIEW_TEMPLATES = [
|
||||
'throughputHistogramView',
|
||||
'wipRunView',
|
||||
'pulseView',
|
||||
'createdResolvedView',
|
||||
'netFlowView',
|
||||
'timeInListView',
|
||||
'averageAgeView',
|
||||
'throughputRunView',
|
||||
'dueDatePerformanceView',
|
||||
'releaseBurndownView',
|
||||
'epicProgressView',
|
||||
'workloadView',
|
||||
'distributionView',
|
||||
'dependencyMapView',
|
||||
'activityHeatmapView',
|
||||
];
|
||||
|
||||
PLACEHOLDER_VIEW_TEMPLATES.forEach(name => {
|
||||
|
||||
@@ -98,6 +98,12 @@ function barsFromSeries(series, valueKey, labelKey) {
|
||||
|
||||
function computeBarRows(chartKey, data) {
|
||||
if (!data) return [];
|
||||
// The reports (models/lib/boardReports.js) answer their bars ready to draw.
|
||||
if (Array.isArray(data.bars)) {
|
||||
const { labelText } = require('/models/lib/boardReports');
|
||||
return data.bars.map(bar => ({ label: labelText(bar.label, (key, fallback) => TAPi18n.__(key) || fallback),
|
||||
value: Math.round((Number(bar.value) || 0) * 100) / 100 }));
|
||||
}
|
||||
if (chartKey === 'burndown') return barsFromSeries(data.series, 'remaining', 'day');
|
||||
if (chartKey === 'burnup') return barsFromSeries(data.series, 'completed', 'day');
|
||||
if (chartKey === 'wipRun') return barsFromSeries(data.series, 'count', 'day');
|
||||
|
||||
@@ -238,16 +238,46 @@ const EXPORT_FORMAT_GROUPS = [
|
||||
// Straight into Trello through its API (server/trelloApiExport.js), not
|
||||
// a file: an action that opens its own popup.
|
||||
{ key: 'trello-api', icon: 'fa-trello', label: 'Trello', action: 'js-export-to-trello', scopes: BOARD_ONLY },
|
||||
// Trello's board.json with the cards' attachments as files, the .zip
|
||||
// the Trello import reads (server/lib/renderExternalExport.js streamTrelloZip).
|
||||
{ key: 'trellozip', icon: 'fa-file-archive-o', labelKey: 'attachments', labelPrefix: 'Trello .zip', path: 'export/trellozip', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'kanboard', icon: 'fa-upload', label: 'Kanboard', path: 'export/kanboard', ext: 'json', scopes: BOARD_ONLY },
|
||||
{ key: 'markdown', icon: 'fa-file-text-o', label: 'Markdown', path: 'export/markdown', ext: 'md', scopes: BOARD_ONLY },
|
||||
{ key: 'leo', icon: 'fa-sitemap', label: 'Leo', path: 'export/leo', ext: 'leo', scopes: BOARD_ONLY },
|
||||
{ key: 'opml', icon: 'fa-indent', label: 'OPML', path: 'export/opml', ext: 'opml', scopes: BOARD_ONLY },
|
||||
{ key: 'orgmode', icon: 'fa-list-alt', label: 'Org mode', path: 'export/orgmode', ext: 'org', scopes: BOARD_ONLY },
|
||||
{ key: 'mbox', icon: 'fa-envelope-o', label: 'Mail (mbox)', path: 'export/mbox', ext: 'mbox', scopes: BOARD_ONLY },
|
||||
{ key: 'enex', icon: 'fa-sticky-note', label: 'Evernote (.enex)', path: 'export/enex', ext: 'enex', scopes: BOARD_ONLY },
|
||||
{ key: 'mattermost', icon: 'fa-comments', label: 'Mattermost', path: 'export/mattermost', ext: 'jsonl', scopes: BOARD_ONLY },
|
||||
{ key: 'rocketchat', icon: 'fa-comments', label: 'Rocket.Chat', path: 'export/rocketchat', ext: 'zip', scopes: BOARD_ONLY },
|
||||
// Websites (docs/Features/Board-Sidebar/Board-Settings/Import-Export/Website.md).
|
||||
{ key: 'wordpress', icon: 'fa-wordpress', label: 'WordPress (.xml)', path: 'export/wordpress', ext: 'xml', scopes: BOARD_ONLY },
|
||||
{ key: 'wordpressjson', icon: 'fa-wordpress', label: 'WordPress REST API (.json)', path: 'export/wordpressjson', ext: 'json', scopes: BOARD_ONLY },
|
||||
{ key: 'ghost', icon: 'fa-file-text-o', label: 'Ghost', path: 'export/ghost', ext: 'json', scopes: BOARD_ONLY },
|
||||
{ key: 'blogger', icon: 'fa-rss', label: 'Blogger (.xml)', path: 'export/blogger', ext: 'xml', scopes: BOARD_ONLY },
|
||||
{ key: 'markdownsite', icon: 'fa-file-code-o', label: 'Hugo, Jekyll, Eleventy, Astro (.zip)', path: 'export/markdownsite', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'htmlsite', icon: 'fa-globe', label: 'HTML website (.zip)', path: 'export/htmlsite', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'todotxt', icon: 'fa-list-ul', label: 'todo.txt', path: 'export/todotxt', ext: 'txt', scopes: BOARD_ONLY },
|
||||
{ key: 'taskwarrior', icon: 'fa-terminal', label: 'Taskwarrior', path: 'export/taskwarrior', ext: 'json', scopes: BOARD_ONLY },
|
||||
{ key: 'focalboard', icon: 'fa-th-large', label: 'Focalboard', path: 'export/focalboard', ext: 'jsonl', scopes: BOARD_ONLY },
|
||||
{ key: 'todoist', icon: 'fa-check-square-o', label: 'Todoist', path: 'export/todoist', ext: 'csv', scopes: BOARD_ONLY },
|
||||
{ key: 'planner', icon: 'fa-th-list', label: 'Microsoft Planner', path: 'export/planner', ext: 'xlsx', scopes: BOARD_ONLY },
|
||||
{ key: 'azuredevops', icon: 'fa-th-list', label: 'Azure DevOps Boards', path: 'export/azuredevops', ext: 'csv', scopes: BOARD_ONLY },
|
||||
{ key: 'mslists', icon: 'fa-list', label: 'Microsoft Lists', path: 'export/mslists', ext: 'csv', scopes: BOARD_ONLY },
|
||||
{ key: 'msproject', icon: 'fa-tasks', label: 'Microsoft Project (XML)', path: 'export/msproject', ext: 'xml', scopes: BOARD_ONLY },
|
||||
{ key: 'outlook', icon: 'fa-envelope-o', label: 'Microsoft Outlook (.eml)', path: 'export/outlook', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'teams', icon: 'fa-comments', label: 'Microsoft Teams', path: 'export/teams', ext: 'json', scopes: BOARD_ONLY },
|
||||
{ key: 'onenote', icon: 'fa-book', label: 'Microsoft OneNote', path: 'export/onenote', ext: 'zip', scopes: BOARD_ONLY },
|
||||
// Sandstorm grain backups (.zip) Sandstorm restores (models/lib/sandstorm/grainApps.js).
|
||||
{ key: 'sandstormprioritize', icon: 'fa-archive', label: 'Sandstorm Prioritize', path: 'export/sandstormprioritize', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'sandstormyatl', icon: 'fa-archive', label: 'Sandstorm Yet Another TODO list', path: 'export/sandstormyatl', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'sandstormmutodo', icon: 'fa-archive', label: 'Sandstorm μTodo', path: 'export/sandstormmutodo', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'sandstormsandchat', icon: 'fa-archive', label: 'Sandstorm SandChat', path: 'export/sandstormsandchat', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'sandstormethercalc', icon: 'fa-archive', label: 'Sandstorm EtherCalc', path: 'export/sandstormethercalc', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'sandstormradicalecalendar', icon: 'fa-archive', label: 'Sandstorm Radicale calendar', path: 'export/sandstormradicalecalendar', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'sandstormradicalecontacts', icon: 'fa-archive', label: 'Sandstorm Radicale address book', path: 'export/sandstormradicalecontacts', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'sandstormdavros', icon: 'fa-archive', label: 'Sandstorm Davros', path: 'export/sandstormdavros', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'sandstormhackercms', icon: 'fa-archive', label: 'Sandstorm Hacker CMS', path: 'export/sandstormhackercms', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'meistertask', icon: 'fa-tasks', label: 'MeisterTask', path: 'export/meistertask', ext: 'csv', scopes: BOARD_ONLY },
|
||||
{ key: 'obsidian', icon: 'fa-diamond', label: 'Obsidian Kanban', path: 'export/obsidian', ext: 'md', scopes: BOARD_ONLY },
|
||||
{ key: 'linear', icon: 'fa-bars', label: 'Linear', path: 'export/linear', ext: 'csv', scopes: BOARD_ONLY },
|
||||
@@ -261,6 +291,7 @@ const EXPORT_FORMAT_GROUPS = [
|
||||
{ key: 'monday', icon: 'fa-table', label: 'monday.com', path: 'export/monday', ext: 'xlsx', scopes: BOARD_ONLY },
|
||||
{ key: 'superproductivity', icon: 'fa-check-circle-o', label: 'Super Productivity', path: 'export/superproductivity', ext: 'json', scopes: BOARD_ONLY },
|
||||
{ key: 'vikunja', icon: 'fa-file-archive-o', label: 'Vikunja', path: 'export/vikunja', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'fizzy', icon: 'fa-file-archive-o', label: 'Fizzy', path: 'export/fizzy', ext: 'zip', scopes: BOARD_ONLY },
|
||||
{ key: 'wrike', icon: 'fa-table', label: 'Wrike', path: 'export/wrike', ext: 'xlsx', scopes: BOARD_ONLY },
|
||||
{ key: 'wrikeworkflow', icon: 'fa-sitemap', label: 'Wrike workflow', path: 'export/wrikeworkflow', ext: 'json', scopes: BOARD_ONLY },
|
||||
{ key: 'teamwork', icon: 'fa-table', label: 'Teamwork.com', path: 'export/teamwork', ext: 'xlsx', scopes: BOARD_ONLY },
|
||||
@@ -316,7 +347,22 @@ function resolvedFormatGroups() {
|
||||
url: entry.path ? exportUrl(`/api/boards/:boardId/${entry.path}`, entry.query || {}) : '',
|
||||
})),
|
||||
}))
|
||||
.filter(group => group.entries.length);
|
||||
.filter(group => group.entries.length)
|
||||
// The other tools' formats under headings by kind (models/lib/toolGroups.js),
|
||||
// the same groups as the Import page; WeKan's own JSON keeps "JSON", and
|
||||
// a company with several products is headed by the company's name.
|
||||
.flatMap(group => {
|
||||
if (group.key !== 'json') return [group];
|
||||
const { groupTools } = require('/models/lib/toolGroups');
|
||||
const parts = [];
|
||||
for (const entry of groupTools(group.entries)) {
|
||||
if (entry.groupStart) {
|
||||
parts.push({ key: `json-${entry.group}`, heading: entry.groupLabelKey ? TAPi18n.__(entry.groupLabelKey) : entry.groupLabel || group.heading, entries: [] });
|
||||
}
|
||||
parts[parts.length - 1].entries.push(entry);
|
||||
}
|
||||
return parts;
|
||||
});
|
||||
}
|
||||
|
||||
// Import writes to the board, so unlike export it is offered only to somebody
|
||||
|
||||
@@ -63,3 +63,8 @@
|
||||
global form rules give selects one row's height; show a few rows. */
|
||||
.scrum-view select[multiple], .scrum-metadata select[multiple] { min-height: 5.5em; height: auto; }
|
||||
.scrum-multiple-help { display: block; opacity: .8; max-width: 32em; }
|
||||
|
||||
/* The Definition of Ready and of Done, readable by every member. */
|
||||
.scrum-definition .scrum-definition-text {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
@@ -33,6 +33,16 @@ template(name="scrumView")
|
||||
p {{_ 'scrum-history-job-running' done=historyJob.done total=historyJob.total}}
|
||||
.scrum-progress
|
||||
.scrum-progress-bar(style=historyJob.style)
|
||||
//- The team's Definition of Ready and Definition of Done, readable by
|
||||
every member - the settings below are the board admin's.
|
||||
if settings.definitionOfReady
|
||||
details.scrum-definition.js-scrum-definition-of-ready
|
||||
summary {{_ 'scrum-definition-of-ready'}}
|
||||
p.scrum-definition-text= settings.definitionOfReady
|
||||
if settings.definitionOfDone
|
||||
details.scrum-definition.js-scrum-definition-of-done
|
||||
summary {{_ 'scrum-definition-of-done'}}
|
||||
p.scrum-definition-text= settings.definitionOfDone
|
||||
if canAdmin
|
||||
details.scrum-settings(open=settingsOpen)
|
||||
summary {{_ 'scrum-settings'}}
|
||||
@@ -42,8 +52,21 @@ template(name="scrumView")
|
||||
| {{_ 'scrum-enabled'}}
|
||||
label {{_ 'scrum-product-goal'}}
|
||||
textarea(name="productGoal") {{settings.productGoal}}
|
||||
//- Definition of Ready (2026-11-20): when a backlog item may be
|
||||
taken into a sprint, beside the Definition of Done.
|
||||
label {{_ 'scrum-definition-of-ready'}}
|
||||
textarea(name="definitionOfReady") {{settings.definitionOfReady}}
|
||||
label {{_ 'scrum-definition-of-done'}}
|
||||
textarea(name="definitionOfDone") {{settings.definitionOfDone}}
|
||||
//- The meeting helpers of the board menu (scrumMeetings.js).
|
||||
label
|
||||
input(type="checkbox" name="standupTimer" checked=settings.standupTimer)
|
||||
| {{_ 'daily-standup'}}
|
||||
label {{_ 'standup-minutes'}}
|
||||
input(type="number" name="standupMinutes" min="1" max="15" value=settings.standupMinutes)
|
||||
label
|
||||
input(type="checkbox" name="retrospectiveBoard" checked=settings.retrospectiveBoard)
|
||||
| {{_ 'retrospective-board'}}
|
||||
each accountabilityFields
|
||||
label {{label}}
|
||||
select(name=field multiple=multiple)
|
||||
|
||||
@@ -306,7 +306,10 @@ Template.scrumView.events({
|
||||
event.preventDefault(); const values = fields(event.currentTarget);
|
||||
const formData = new FormData(event.currentTarget);
|
||||
await mutate(tpl, 'scrum.configure', { enabled: values.enabled === 'on', productGoal: values.productGoal,
|
||||
definitionOfDone: values.definitionOfDone, estimateSource: values.estimateSource,
|
||||
definitionOfDone: values.definitionOfDone, definitionOfReady: values.definitionOfReady,
|
||||
standupTimer: values.standupTimer === 'on', retrospectiveBoard: values.retrospectiveBoard === 'on',
|
||||
standupMinutes: require('/models/lib/scrumMeetings').standupMinutes(values.standupMinutes),
|
||||
estimateSource: values.estimateSource,
|
||||
estimateCustomFieldId: nullable(values.estimateCustomFieldId), estimateUnit: values.estimateUnit,
|
||||
completionPolicy: values.completionPolicy, productOwnerId: nullable(values.productOwnerId),
|
||||
scrumMasterId: nullable(values.scrumMasterId), developerIds: formData.getAll('developerIds'),
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/* Board View / Website: a readable page, whatever the board's colours. */
|
||||
.website-view {
|
||||
max-width: 48em;
|
||||
margin-inline: auto;
|
||||
padding: 1em;
|
||||
background: #fff;
|
||||
color: #222;
|
||||
line-height: 1.6;
|
||||
overflow-y: auto;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.website-header {
|
||||
border-block-end: 1px solid #ddd;
|
||||
margin-block-end: 1em;
|
||||
}
|
||||
.website-header h1 a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
.website-nav {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.4em 1em;
|
||||
padding-block-end: 0.6em;
|
||||
}
|
||||
.website-nav a.is-current {
|
||||
font-weight: bold;
|
||||
}
|
||||
.website-subnav {
|
||||
display: inline-flex;
|
||||
gap: 0.6em;
|
||||
margin-inline-start: 0.6em;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.website-date {
|
||||
color: #666;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.website-images img {
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
margin-block: 0.6em;
|
||||
}
|
||||
.website-summary {
|
||||
margin-block-end: 1.2em;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
//- Board View / Website (models/lib/websiteView.js): the board as a website -
|
||||
the cards of its Published list, Pages as the menu, the other cards as
|
||||
posts, newest first - built from the board's own cards and attachments.
|
||||
A public board can open in it (Board Settings / Board View), so a visitor
|
||||
sees the site at the board's address instead of the kanban.
|
||||
template(name="websiteView")
|
||||
.website-view
|
||||
header.website-header
|
||||
h1
|
||||
a.js-website-home(href="?") {{boardTitle}}
|
||||
nav.website-nav(aria-label="{{_ 'board-view-website'}}")
|
||||
each page in site.pages
|
||||
span.website-nav-item
|
||||
a.js-website-page(href="?page={{page._id}}" data-id=page._id class="{{#if $eq page._id currentId}}is-current{{/if}}") {{page.title}}
|
||||
if page.children.length
|
||||
span.website-subnav
|
||||
each sub in page.children
|
||||
a.js-website-page(href="?page={{sub._id}}" data-id=sub._id class="{{#if $eq sub._id currentId}}is-current{{/if}}") {{sub.title}}
|
||||
main.website-main
|
||||
if shown.cardId
|
||||
with shownCard
|
||||
article.website-article
|
||||
h2 {{title}}
|
||||
if postDate
|
||||
p.website-date {{postDate}}
|
||||
if description
|
||||
+viewer
|
||||
= description
|
||||
if images.length
|
||||
.website-images
|
||||
each image in images
|
||||
img(src=image.url alt=image.name loading="lazy")
|
||||
if files.length
|
||||
ul.website-files
|
||||
each file in files
|
||||
li
|
||||
a(href=file.url target="_blank" rel="noopener noreferrer") {{file.name}}
|
||||
else if shown.posts
|
||||
each post in site.posts
|
||||
article.website-summary
|
||||
h2
|
||||
a.js-website-page(href="?page={{post._id}}" data-id=post._id) {{post.title}}
|
||||
if post.date
|
||||
p.website-date {{post.date}}
|
||||
else
|
||||
p.quiet {{_ 'website-view-empty'}}
|
||||
@@ -0,0 +1,64 @@
|
||||
// Board View / Website (websiteView.jade, models/lib/websiteView.js). The
|
||||
// board's own subscription brings its lists, swimlanes, cards and
|
||||
// attachments - for a visitor of a public board too - so the site is drawn
|
||||
// from them as they change. Which page is open is in the address (?page=),
|
||||
// so a page of the site can be linked to.
|
||||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
import { Utils } from '/client/lib/utils';
|
||||
|
||||
const { websiteOf, pageFor } = require('/models/lib/websiteView');
|
||||
|
||||
function site() {
|
||||
const boardId = Utils.getCurrentBoardId();
|
||||
if (!boardId) return websiteOf({});
|
||||
return websiteOf({
|
||||
lists: ReactiveCache.getLists({ boardId, archived: false }) || [],
|
||||
swimlanes: ReactiveCache.getSwimlanes({ boardId, archived: false }) || [],
|
||||
cards: ReactiveCache.getCards({ boardId, archived: false }) || [],
|
||||
});
|
||||
}
|
||||
|
||||
function currentId() {
|
||||
return FlowRouter.getQueryParam('page') || '';
|
||||
}
|
||||
|
||||
Template.websiteView.helpers({
|
||||
boardTitle() {
|
||||
const board = Utils.getCurrentBoard();
|
||||
return board ? board.title : '';
|
||||
},
|
||||
site,
|
||||
currentId,
|
||||
shown() {
|
||||
return pageFor(site(), currentId());
|
||||
},
|
||||
shownCard() {
|
||||
const page = pageFor(site(), currentId());
|
||||
return page.cardId ? ReactiveCache.getCard(page.cardId) : null;
|
||||
},
|
||||
postDate() {
|
||||
const when = this.receivedAt || this.startAt || this.createdAt;
|
||||
return when ? new Date(when).toISOString().slice(0, 10) : '';
|
||||
},
|
||||
images() {
|
||||
return (ReactiveCache.getAttachments({ 'meta.cardId': this._id }) || [])
|
||||
.filter(a => a.isImage).map(a => ({ name: a.name, url: typeof a.link === 'function' ? a.link() : '' })).filter(a => a.url);
|
||||
},
|
||||
files() {
|
||||
return (ReactiveCache.getAttachments({ 'meta.cardId': this._id }) || [])
|
||||
.filter(a => !a.isImage).map(a => ({ name: a.name, url: typeof a.link === 'function' ? a.link() : '' })).filter(a => a.url);
|
||||
},
|
||||
});
|
||||
|
||||
Template.websiteView.events({
|
||||
'click .js-website-page'(evt) {
|
||||
evt.preventDefault();
|
||||
FlowRouter.setQueryParams({ page: evt.currentTarget.getAttribute('data-id') });
|
||||
window.scrollTo(0, 0);
|
||||
},
|
||||
'click .js-website-home'(evt) {
|
||||
evt.preventDefault();
|
||||
FlowRouter.setQueryParams({ page: null });
|
||||
},
|
||||
});
|
||||
@@ -398,6 +398,8 @@ template(name="cardFieldSectionDate")
|
||||
template(name="cardFieldSectionMembers")
|
||||
+cardSectionHeader(section="members" icon="fa-users" label="members")
|
||||
if isSectionOpen "members"
|
||||
//- The board's WIP limit per person (listFlowPolicies.jade).
|
||||
+cardPersonWipWarnings(card=this)
|
||||
.card-details-group-body
|
||||
each field in orderedMembersFields
|
||||
if $eq field "members"
|
||||
@@ -548,6 +550,19 @@ template(name="cardFieldSectionCard")
|
||||
a.js-add-dependency(title="{{_ 'add-dependency'}}")
|
||||
i.fa.fa-plus
|
||||
| {{_ 'add-dependency'}}
|
||||
//- The Kanban and Scrum flow fields (docs/Features/Cards/Flow-Fields.md).
|
||||
if $eq field "blocked"
|
||||
if currentBoard.allowsBlockedOnCard
|
||||
+cardFlowBlocked(card=this canModifyCard=canModifyCard)
|
||||
if $eq field "classOfService"
|
||||
if currentBoard.allowsClassOfServiceOnCard
|
||||
+cardFlowClassOfService(card=this canModifyCard=canModifyCard)
|
||||
if $eq field "moscow"
|
||||
if currentBoard.allowsMoscowOnCard
|
||||
+cardFlowMoscow(card=this canModifyCard=canModifyCard)
|
||||
if $eq field "wsjf"
|
||||
if currentBoard.allowsWsjfOnCard
|
||||
+cardFlowWsjf(card=this canModifyCard=canModifyCard)
|
||||
if $eq field "cardSortingByNumber"
|
||||
if currentBoard.allowsCardSortingByNumber
|
||||
.card-details-item.card-details-sort-order
|
||||
@@ -624,7 +639,7 @@ template(name="cardFieldSectionTime")
|
||||
h3.card-details-item-title
|
||||
| {{_ 'spent-time-hours'}}
|
||||
+cardSpentTimeMenu
|
||||
if getSpentTime
|
||||
if hasSpentOrEstimatedTime
|
||||
+cardSpentTime
|
||||
|
||||
//- #6688: the two timers each have a Board Settings / Card toggle,
|
||||
@@ -1141,9 +1156,13 @@ template(name="cardDetailsActionsPopup")
|
||||
Planning Poker, Change spent time and Card kind are in the hamburger of
|
||||
their own section of the opened card, and in Card Settings' pane of that
|
||||
section (docs/Features/Cards/Card-Fields.md).
|
||||
//- Grouped under headings (2026-11-20): Move and copy, Watch, Appearance,
|
||||
Share and history, Archive. Every entry keeps its own condition; a heading
|
||||
sits inside its group's.
|
||||
if currentUser
|
||||
ul.pop-over-list
|
||||
if cardMenuWrites
|
||||
li.menu-group-heading {{_ 'menu-group-move-copy'}}
|
||||
if currentUser.isBoardAdmin
|
||||
li
|
||||
a.js-move-card
|
||||
@@ -1175,6 +1194,7 @@ template(name="cardDetailsActionsPopup")
|
||||
a.js-move-card-to-bottom
|
||||
i.fa.fa-arrow-down
|
||||
| {{_ 'moveCardToBottom-title'}}
|
||||
li.menu-group-heading {{_ 'watch'}}
|
||||
li
|
||||
a.js-toggle-watch-card
|
||||
if isWatching
|
||||
@@ -1196,6 +1216,7 @@ template(name="cardDetailsActionsPopup")
|
||||
unless currentUser.isWorker
|
||||
hr
|
||||
ul.pop-over-list
|
||||
li.menu-group-heading {{_ 'appearance'}}
|
||||
li
|
||||
a.js-set-card-color
|
||||
i.fa.fa-paint-brush
|
||||
@@ -1214,6 +1235,7 @@ template(name="cardDetailsActionsPopup")
|
||||
| {{_ 'action-items-create'}}
|
||||
hr
|
||||
ul.pop-over-list
|
||||
li.menu-group-heading {{_ 'menu-group-share'}}
|
||||
if currentUser
|
||||
//- Copy link, named - the card's header carried this as an icon with only
|
||||
a tooltip. docs/Features/General/Board-Item-Links.md
|
||||
@@ -1254,6 +1276,7 @@ template(name="cardDetailsActionsPopup")
|
||||
if currentUser
|
||||
if cardMenuWrites
|
||||
unless currentUser.isWorker
|
||||
li.menu-group-heading {{_ 'archives'}}
|
||||
if archived
|
||||
li
|
||||
a.js-restore-archived-card
|
||||
@@ -1269,12 +1292,14 @@ template(name="cardDetailsActionsPopup")
|
||||
span.emoji-icon
|
||||
i.fa.fa-link
|
||||
| {{_ 'cardMorePopup-title'}}
|
||||
unless canModifyCard
|
||||
if boardCreationAllowed
|
||||
li
|
||||
a.js-create-board-from-card
|
||||
i.fa.fa-external-link
|
||||
| {{_ 'linkCardToNewBoard'}}
|
||||
//- For every member who may write the card (cardMenuWrites, not a
|
||||
Worker), as when it was added; createBoardFromCard checks the same
|
||||
write access and the assigned-only scope on the server.
|
||||
if boardCreationAllowed
|
||||
li
|
||||
a.js-create-board-from-card
|
||||
i.fa.fa-external-link
|
||||
| {{_ 'linkCardToNewBoard'}}
|
||||
span.copied-tooltip {{_ 'copied'}}
|
||||
|
||||
//- #1173: the card export popup IS the shared export body - the same checkbox
|
||||
|
||||
@@ -933,6 +933,9 @@ function cardSectionHasContent(card, board, id) {
|
||||
case 'card': {
|
||||
const swimlane = typeof card?.swimlane === 'function' ? card.swimlane() : null;
|
||||
return Boolean(board.allowsDependencies || board.allowsCardSortingByNumber || board.allowsShowLists
|
||||
// The flow fields (models/lib/cardFlow.js).
|
||||
|| board.allowsBlockedOnCard || board.allowsClassOfServiceOnCard || board.allowsMoscowOnCard
|
||||
|| board.allowsWsjfOnCard
|
||||
|| (board.allowsSwimlaneNameOnCard && swimlane && swimlane.title)
|
||||
|| (board.allowsCardButtonsOnCard !== false && cardHasButtons(card)));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/* The Kanban and Scrum flow fields (docs/Features/Cards/Flow-Fields.md). */
|
||||
/* Blocked is a labelled native checkbox; the app-wide material form rule hides
|
||||
native checkboxes three ways (display, visibility, an offset), so all three
|
||||
are undone, as in scrumView.css. */
|
||||
.card-flow-blocked-toggle input[type="checkbox"] {
|
||||
display: inline-block;
|
||||
visibility: visible;
|
||||
position: static;
|
||||
inset-inline-start: auto;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
min-height: 0;
|
||||
margin: 0;
|
||||
margin-inline-end: 4px;
|
||||
padding: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.card-details-item-flow-blocked.is-blocked .card-details-item-title,
|
||||
.card-flow-blocked-text {
|
||||
color: #c0392b;
|
||||
}
|
||||
.card-details-item-flow-blocked .js-card-flow-blocked-reason {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.card-flow-blocked-since {
|
||||
font-size: 0.85em;
|
||||
}
|
||||
.card-flow-wsjf-score {
|
||||
margin-inline-start: 6px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.card-flow-wsjf-parts {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px 12px;
|
||||
}
|
||||
.card-flow-wsjf-part {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
.minicard .badges .minicard-flow-blocked {
|
||||
color: #fff;
|
||||
background: #c0392b;
|
||||
border-radius: 3px;
|
||||
padding: 0 4px;
|
||||
}
|
||||
.minicard .badges .minicard-flow-class.flow-class-expedite {
|
||||
color: #fff;
|
||||
background: #d35400;
|
||||
border-radius: 3px;
|
||||
padding: 0 4px;
|
||||
}
|
||||
.minicard .badges .minicard-flow-class.flow-class-fixed-date {
|
||||
color: #8e44ad;
|
||||
}
|
||||
.minicard .badges .minicard-flow-moscow {
|
||||
border: 1px solid currentColor;
|
||||
border-radius: 3px;
|
||||
padding: 0 4px;
|
||||
}
|
||||
.minicard .badges .minicard-flow-moscow.flow-moscow-must {
|
||||
color: #c0392b;
|
||||
}
|
||||
.minicard .badges .minicard-flow-moscow.flow-moscow-wont {
|
||||
color: #7f8c8d;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
//- The Kanban and Scrum flow fields of the opened card (models/lib/cardFlow.js,
|
||||
docs/Features/Cards/Flow-Fields.md): each a row of Board Settings / Card,
|
||||
drawn in the Card section. Saved through the setCardFlow method.
|
||||
template(name="cardFlowBlocked")
|
||||
with flowOf card
|
||||
.card-details-item.card-details-item-flow-blocked(class="{{#if blocked}}is-blocked{{/if}}")
|
||||
h3.card-details-item-title
|
||||
i.fa.fa-ban
|
||||
| {{_ 'card-blocked'}}
|
||||
if ../canModifyCard
|
||||
label.card-flow-blocked-toggle
|
||||
input.js-card-flow-blocked(type="checkbox" checked=blocked)
|
||||
| {{_ 'card-blocked'}}
|
||||
if blocked
|
||||
input.js-card-flow-blocked-reason(type="text" maxlength="1000" value=blockedReason placeholder="{{_ 'card-blocked-reason'}}")
|
||||
else
|
||||
if blocked
|
||||
span.card-flow-blocked-text {{_ 'card-blocked'}}{{#if blockedReason}}: {{blockedReason}}{{/if}}
|
||||
if blocked
|
||||
if blockedAt
|
||||
.card-flow-blocked-since.quiet {{_ 'card-blocked-since' date=(flowDate blockedAt) user=(flowUser blockedBy)}}
|
||||
|
||||
template(name="cardFlowClassOfService")
|
||||
with flowOf card
|
||||
.card-details-item.card-details-item-flow-class
|
||||
h3.card-details-item-title
|
||||
i.fa.fa-road
|
||||
| {{_ 'class-of-service'}}
|
||||
if ../canModifyCard
|
||||
select.js-card-flow-class
|
||||
each option in classOptions
|
||||
option(value=option.value selected=option.selected) {{#if option.labelKey}}{{_ option.labelKey}}{{else}}-{{/if}}
|
||||
else
|
||||
span.card-flow-value {{#if classLabelKey}}{{_ classLabelKey}}{{else}}-{{/if}}
|
||||
|
||||
template(name="cardFlowMoscow")
|
||||
with flowOf card
|
||||
.card-details-item.card-details-item-flow-moscow
|
||||
h3.card-details-item-title
|
||||
i.fa.fa-sort-amount-desc
|
||||
| {{_ 'moscow-priority'}}
|
||||
if ../canModifyCard
|
||||
select.js-card-flow-moscow
|
||||
each option in moscowOptions
|
||||
option(value=option.value selected=option.selected) {{#if option.labelKey}}{{_ option.labelKey}}{{else}}-{{/if}}
|
||||
else
|
||||
span.card-flow-value {{#if moscowLabelKey}}{{_ moscowLabelKey}}{{else}}-{{/if}}
|
||||
|
||||
template(name="cardFlowWsjf")
|
||||
with flowOf card
|
||||
.card-details-item.card-details-item-flow-wsjf
|
||||
h3.card-details-item-title
|
||||
i.fa.fa-balance-scale
|
||||
| {{_ 'wsjf-score'}}
|
||||
if wsjfScore
|
||||
span.card-flow-wsjf-score {{wsjfScore}}
|
||||
.card-flow-wsjf-parts
|
||||
each part in wsjfParts
|
||||
label.card-flow-wsjf-part
|
||||
span {{_ part.labelKey}}
|
||||
if ../canModifyCard
|
||||
select.js-card-flow-wsjf(data-part=part.key)
|
||||
each option in part.options
|
||||
option(value=option.value selected=option.selected) {{option.text}}
|
||||
else
|
||||
span.card-flow-value {{#if part.value}}{{part.value}}{{else}}-{{/if}}
|
||||
@@ -0,0 +1,87 @@
|
||||
// The Kanban and Scrum flow fields of a card (models/lib/cardFlow.js,
|
||||
// docs/Features/Cards/Flow-Fields.md): the opened card's rows and the
|
||||
// minicard's `cardFlowOf` helper. Every change goes through setCardFlow, which
|
||||
// checks the card edit right and the Expedite limit on the server.
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Template } from 'meteor/templating';
|
||||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
const { flowView, CLASSES_OF_SERVICE, MOSCOW, WSJF_PARTS, WSJF_SCALE, CLASS_LABEL, MOSCOW_LABEL } = require('/models/lib/cardFlow');
|
||||
|
||||
const WSJF_LABEL = { businessValue: 'wsjf-business-value', timeCriticality: 'wsjf-time-criticality',
|
||||
riskReduction: 'wsjf-risk-reduction', jobSize: 'wsjf-job-size' };
|
||||
|
||||
// A linked card shows its source's flow, as the server writes it.
|
||||
function sourceOf(card) {
|
||||
if (card && typeof card.isLinkedCard === 'function' && card.isLinkedCard()) {
|
||||
return ReactiveCache.getCard(card.linkedId) || card;
|
||||
}
|
||||
return card;
|
||||
}
|
||||
|
||||
Template.registerHelper('cardFlowOf', card => {
|
||||
const view = flowView(sourceOf(card));
|
||||
return view.blocked || view.classOfService || view.moscow || view.wsjfScore ? view : null;
|
||||
});
|
||||
|
||||
function choices(values, labels, chosen) {
|
||||
return [{ value: '', labelKey: null, selected: !chosen },
|
||||
...values.map(value => ({ value, labelKey: labels[value], selected: value === chosen }))];
|
||||
}
|
||||
|
||||
function save(card, patch) {
|
||||
Meteor.callAsync('setCardFlow', card._id, patch).catch(error => {
|
||||
if (error && error.error === 'expedite-limit') window.alert(TAPi18n.__('expedite-limit'));
|
||||
else window.alert((error && (error.reason || error.error)) || String(error));
|
||||
});
|
||||
}
|
||||
|
||||
const helpers = {
|
||||
flowOf(card) { return flowView(sourceOf(card)); },
|
||||
flowDate(date) { return date ? new Date(date).toLocaleString() : ''; },
|
||||
flowUser(userId) {
|
||||
const user = userId && ReactiveCache.getUser(userId);
|
||||
return (user && (user.profile?.fullname || user.username)) || '-';
|
||||
},
|
||||
// Each select's options, the empty one ("-") first, with which is chosen.
|
||||
classOptions() { return choices(CLASSES_OF_SERVICE, CLASS_LABEL, this.classOfService); },
|
||||
moscowOptions() { return choices(MOSCOW, MOSCOW_LABEL, this.moscow); },
|
||||
wsjfParts() {
|
||||
const wsjf = this.wsjf || {};
|
||||
return WSJF_PARTS.map(key => {
|
||||
const value = WSJF_SCALE.includes(wsjf[key]) ? wsjf[key] : null;
|
||||
return { key, labelKey: WSJF_LABEL[key], value,
|
||||
options: [{ value: '', text: '-', selected: value === null },
|
||||
...WSJF_SCALE.map(n => ({ value: String(n), text: String(n), selected: n === value }))] };
|
||||
});
|
||||
},
|
||||
};
|
||||
['cardFlowBlocked', 'cardFlowClassOfService', 'cardFlowMoscow', 'cardFlowWsjf'].forEach(name => {
|
||||
Template[name].helpers(helpers);
|
||||
});
|
||||
|
||||
Template.cardFlowBlocked.events({
|
||||
'change .js-card-flow-blocked'(event, tpl) {
|
||||
save(tpl.data.card, { blocked: event.currentTarget.checked });
|
||||
},
|
||||
'change .js-card-flow-blocked-reason'(event, tpl) {
|
||||
save(tpl.data.card, { blockedReason: event.currentTarget.value });
|
||||
},
|
||||
});
|
||||
Template.cardFlowClassOfService.events({
|
||||
'change .js-card-flow-class'(event, tpl) {
|
||||
save(tpl.data.card, { classOfService: event.currentTarget.value });
|
||||
},
|
||||
});
|
||||
Template.cardFlowMoscow.events({
|
||||
'change .js-card-flow-moscow'(event, tpl) {
|
||||
save(tpl.data.card, { moscow: event.currentTarget.value });
|
||||
},
|
||||
});
|
||||
Template.cardFlowWsjf.events({
|
||||
'change .js-card-flow-wsjf'(event, tpl) {
|
||||
const value = event.currentTarget.value;
|
||||
save(tpl.data.card, { wsjf: { [event.currentTarget.dataset.part]: value === '' ? null : Number(value) } });
|
||||
},
|
||||
});
|
||||
@@ -4,6 +4,14 @@ template(name="editCardSpentTimePopup")
|
||||
.fields
|
||||
label(for="time") {{_ 'time'}}
|
||||
input.js-time-field#time(type="number" step="0.01" name="time" value="{{card.getSpentTime}}" placeholder=timeFormat autofocus)
|
||||
//- Workload (docs/Features/Workload/Workload.md): what the card is
|
||||
estimated to take; what is left is this less the time spent.
|
||||
label(for="estimated-hours") {{_ 'workload-estimated-hours'}}
|
||||
input.js-estimated-hours-field#estimated-hours(type="number" min="0" max="10000" step="0.25" name="estimatedHours" value="{{card.getEstimatedHours}}")
|
||||
//- Budget and billing: whether this card's time goes on invoices.
|
||||
label(for="billable") {{_ 'billing-billable'}}
|
||||
a.js-toggle-billable
|
||||
.materialCheckBox#billable(class="{{#if billable}}is-checked{{/if}}" name="billable")
|
||||
label(for="overtime") {{_ 'overtime'}}
|
||||
a.js-toggle-overtime
|
||||
.materialCheckBox#overtime(class="{{#if getIsOvertime}}is-checked{{/if}}" name="overtime")
|
||||
@@ -13,11 +21,62 @@ template(name="editCardSpentTimePopup")
|
||||
button.primary.wide.left.js-submit-time(type="submit") {{_ 'save'}}
|
||||
button.js-delete-time.negate.wide.right {{_ 'delete'}}
|
||||
|
||||
+cardTimeEntries(cardId=card._id)
|
||||
|
||||
//- The card's time by day (server/timeEntries.js): log time on a day, and see
|
||||
who logged what. Changing the total above is recorded as an entry too.
|
||||
template(name="cardTimeEntries")
|
||||
.card-time-entries
|
||||
h4 {{_ 'time-entries'}}
|
||||
form.js-time-entry-add
|
||||
label(for="time-entry-date") {{_ 'date'}}
|
||||
input#time-entry-date(type="date" name="date" value=today required)
|
||||
label(for="time-entry-hours") {{_ 'hours'}}
|
||||
input#time-entry-hours(type="number" name="hours" min="0.01" max="1000" step="0.25" required)
|
||||
label(for="time-entry-note") {{_ 'workload-note'}}
|
||||
input#time-entry-note(type="text" name="note" maxlength="500")
|
||||
button.primary(type="submit") {{_ 'time-entry-log'}}
|
||||
if entryError
|
||||
.warning {{entryError}}
|
||||
if entries.length
|
||||
ul.time-entry-list
|
||||
each entry in entries
|
||||
li(class="{{#if entry.invoiced}}is-invoiced{{/if}}")
|
||||
span.time-entry-date
|
||||
if entry.date
|
||||
| {{entry.date}}
|
||||
else
|
||||
| {{_ 'time-entry-undated'}}
|
||||
span.time-entry-hours {{entry.hours}} {{_ 'workload-hours-short'}}
|
||||
if entry.name
|
||||
span.time-entry-who {{entry.name}}
|
||||
if entry.note
|
||||
span.time-entry-note {{entry.note}}
|
||||
if $eq entry.approval 'approved'
|
||||
span.time-entry-approved(title="{{_ 'time-entry-approved'}}" aria-label="{{_ 'time-entry-approved'}}")
|
||||
i.fa.fa-check
|
||||
if $eq entry.approval 'rejected'
|
||||
span.time-entry-rejected(title="{{_ 'time-entry-rejected'}}")
|
||||
i.fa.fa-undo
|
||||
| {{_ 'time-entry-rejected'}}
|
||||
if entry.approvalNote
|
||||
| : {{entry.approvalNote}}
|
||||
if entry.invoiced
|
||||
span.time-entry-invoiced(title="{{_ 'time-entry-invoiced'}}")
|
||||
i.fa.fa-file-text-o
|
||||
else unless $eq entry.approval 'approved'
|
||||
if entry.mine
|
||||
a.js-time-entry-remove(data-id=entry._id title="{{_ 'delete'}}" aria-label="{{_ 'delete'}}")
|
||||
i.fa.fa-trash
|
||||
|
||||
template(name="cardSpentTime")
|
||||
if canModifyCard
|
||||
a.js-edit-time.card-time(title="{{_ 'time'}}" class="{{#if getIsOvertime}}card-label-red{{else}}card-label-green{{/if}}")
|
||||
i.fa.fa-clock-o
|
||||
| {{showTime}}
|
||||
if showEstimate
|
||||
span.card-time-estimate(title="{{_ 'workload-estimated-hours'}}")
|
||||
| / {{showEstimate}}
|
||||
else
|
||||
a.card-time(title="{{_ 'time'}}" class="{{#if getIsOvertime}}card-label-red{{else}}card-label-green{{/if}}")
|
||||
i.fa.fa-clock-o
|
||||
|
||||
@@ -13,6 +13,7 @@ Template.editCardSpentTimePopup.onCreated(function () {
|
||||
this.error = new ReactiveVar('');
|
||||
this.card = Cards.findOne(getCardId());
|
||||
this.overtime = new ReactiveVar(this.card?.getIsOvertime() || false);
|
||||
this.billable = new ReactiveVar(!this.card || typeof this.card.isBillable !== 'function' || this.card.isBillable());
|
||||
});
|
||||
|
||||
Template.editCardSpentTimePopup.helpers({
|
||||
@@ -25,6 +26,9 @@ Template.editCardSpentTimePopup.helpers({
|
||||
getIsOvertime() {
|
||||
return Template.instance().overtime.get();
|
||||
},
|
||||
billable() {
|
||||
return Template.instance().billable.get();
|
||||
},
|
||||
});
|
||||
|
||||
Template.editCardSpentTimePopup.events({
|
||||
@@ -36,9 +40,25 @@ Template.editCardSpentTimePopup.events({
|
||||
|
||||
const spentTime = parseFloat(evt.target.time.value);
|
||||
const isOvertime = tpl.overtime.get();
|
||||
const estimateText = evt.target.estimatedHours ? String(evt.target.estimatedHours.value).trim() : '';
|
||||
const estimatedHours = estimateText === '' ? null : parseFloat(estimateText);
|
||||
if (estimatedHours !== null && !(estimatedHours >= 0 && estimatedHours <= 10000)) {
|
||||
tpl.error.set('workload-invalid-estimate');
|
||||
evt.target.estimatedHours.focus();
|
||||
return;
|
||||
}
|
||||
if (spentTime >= 0) {
|
||||
card.setSpentTime(spentTime);
|
||||
card.setIsOvertime(isOvertime);
|
||||
const currentEstimate = typeof card.getEstimatedHours === 'function' ? card.getEstimatedHours() : null;
|
||||
if (typeof card.setBillable === 'function' && tpl.billable
|
||||
&& tpl.billable.get() !== (typeof card.isBillable === 'function' ? card.isBillable() : true)) {
|
||||
card.setBillable(tpl.billable.get());
|
||||
}
|
||||
if (typeof card.setEstimatedHours === 'function'
|
||||
&& estimatedHours !== (typeof currentEstimate === 'number' ? currentEstimate : null)) {
|
||||
card.setEstimatedHours(estimatedHours);
|
||||
}
|
||||
backIfOwnPopup(evt, 'editCardSpentTimePopup');
|
||||
} else {
|
||||
tpl.error.set('invalid-time');
|
||||
@@ -57,6 +77,10 @@ Template.editCardSpentTimePopup.events({
|
||||
evt.preventDefault();
|
||||
tpl.overtime.set(!tpl.overtime.get());
|
||||
},
|
||||
'click a.js-toggle-billable'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
tpl.billable.set(!tpl.billable.get());
|
||||
},
|
||||
});
|
||||
|
||||
Template.cardSpentTime.helpers({
|
||||
@@ -77,6 +101,12 @@ Template.cardSpentTime.helpers({
|
||||
const card = Cards.findOne(this._id) || this;
|
||||
return card.getSpentTime ? formatSpentTime(card.getSpentTime()) : '';
|
||||
},
|
||||
// Workload: the estimate beside the time spent, "1h 30m / 4h".
|
||||
showEstimate() {
|
||||
const card = Cards.findOne(this._id) || this;
|
||||
const hours = card.getEstimatedHours ? card.getEstimatedHours() : null;
|
||||
return typeof hours === 'number' && hours > 0 ? formatSpentTime(hours) : '';
|
||||
},
|
||||
getIsOvertime() {
|
||||
const card = Cards.findOne(this._id) || this;
|
||||
return card.getIsOvertime ? card.getIsOvertime() : false;
|
||||
@@ -86,3 +116,46 @@ Template.cardSpentTime.helpers({
|
||||
Template.cardSpentTime.events({
|
||||
'click .js-edit-time': Popup.open('editCardSpentTime'),
|
||||
});
|
||||
|
||||
// The card's time by day (server/timeEntries.js).
|
||||
Template.cardTimeEntries.onCreated(function () {
|
||||
this.entries = new ReactiveVar([]);
|
||||
this.error = new ReactiveVar('');
|
||||
this.load = () => {
|
||||
const { cardId } = Template.currentData() || {};
|
||||
if (!cardId) return Promise.resolve();
|
||||
return Meteor.callAsync('timeEntriesOfCard', cardId)
|
||||
.then(result => { this.entries.set(result.entries); this.error.set(''); })
|
||||
.catch(error => this.error.set((error && (error.reason || error.message)) || String(error)));
|
||||
};
|
||||
this.autorun(() => {
|
||||
const card = Cards.findOne((Template.currentData() || {}).cardId);
|
||||
// Reload when the card's total changes (a timer, the field above).
|
||||
if (card) card.spentTime; // eslint-disable-line no-unused-expressions
|
||||
this.load();
|
||||
});
|
||||
});
|
||||
|
||||
Template.cardTimeEntries.helpers({
|
||||
entries: () => Template.instance().entries.get(),
|
||||
entryError: () => Template.instance().error.get(),
|
||||
today: () => new Date().toISOString().slice(0, 10),
|
||||
});
|
||||
|
||||
Template.cardTimeEntries.events({
|
||||
'submit .js-time-entry-add'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget;
|
||||
const entry = { date: form.elements.date.value, hours: parseFloat(form.elements.hours.value) };
|
||||
if (form.elements.note.value.trim()) entry.note = form.elements.note.value.trim();
|
||||
Meteor.callAsync('timeEntryAdd', Template.currentData().cardId, entry)
|
||||
.then(() => { form.elements.hours.value = ''; form.elements.note.value = ''; return tpl.load(); })
|
||||
.catch(error => tpl.error.set((error && (error.reason || error.message)) || String(error)));
|
||||
},
|
||||
'click .js-time-entry-remove'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
Meteor.callAsync('timeEntryRemove', evt.currentTarget.getAttribute('data-id'))
|
||||
.then(() => tpl.load())
|
||||
.catch(error => tpl.error.set((error && (error.reason || error.message)) || String(error)));
|
||||
},
|
||||
});
|
||||
@@ -17,6 +17,7 @@ template(name="minicard")
|
||||
class="{{#if minicardCollapsed}}minicard-collapsed{{/if}}"
|
||||
class="{{#if hasUnreadComments}}minicard-unread-comments{{/if}}"
|
||||
class="{{#if hasUnreadChanges}}minicard-unread-changes{{/if}}"
|
||||
class="{{#if splitDoneHere}}minicard-split-done{{/if}}"
|
||||
title="{{#if hasUnreadComments}}{{_ 'card-has-unread-comments'}}{{else}}{{#if hasUnreadChanges}}{{_ 'card-has-unread-changes'}}{{/if}}{{/if}}"
|
||||
style="{{#if showCardColorOnMinicard}}{{colorStyle}}{{/if}}")
|
||||
if canMoveCard
|
||||
@@ -30,6 +31,8 @@ template(name="minicard")
|
||||
if canModifyCard
|
||||
a.minicard-details-menu-with-handle.js-open-minicard-details-menu(title="{{_ 'cardDetailsActionsPopup-title'}}")
|
||||
i.fa.fa-bars
|
||||
//- Done here, in a list split into Doing and Done (listFlowPolicies.jade).
|
||||
+minicardSplitDone
|
||||
if showDependencyConnectHandle
|
||||
a.dependency-connect-handle.js-dependency-connect-handle(title="{{_ 'drag-to-connect'}}")
|
||||
i.fa.fa-dot-circle-o
|
||||
@@ -211,6 +214,37 @@ template(name="minicard")
|
||||
span.badge-icon(style="color:{{dependencyBadge.color}}")
|
||||
i.fa(class="fa-{{dependencyBadge.icon}}")
|
||||
span.badge-text {{ dependencyBadge.count }}
|
||||
//- The flow fields, Show on Minicard (docs/Features/Cards/Flow-Fields.md).
|
||||
if $eq field "blocked"
|
||||
if currentBoard.allowsBlockedOnMinicard
|
||||
with cardFlowOf this
|
||||
if blocked
|
||||
.badge.minicard-flow-blocked.js-minicard-flow-blocked(title="{{_ 'card-blocked'}}{{#if blockedReason}}: {{blockedReason}}{{/if}}")
|
||||
span.badge-icon
|
||||
i.fa.fa-ban
|
||||
span.badge-text {{_ 'card-blocked'}}
|
||||
if $eq field "classOfService"
|
||||
if currentBoard.allowsClassOfServiceOnMinicard
|
||||
with cardFlowOf this
|
||||
if classOfService
|
||||
.badge.minicard-flow-class(class="flow-class-{{classOfService}}" title="{{_ 'class-of-service'}}: {{_ classLabelKey}}")
|
||||
span.badge-icon
|
||||
i.fa.fa-road
|
||||
span.badge-text {{_ classLabelKey}}
|
||||
if $eq field "moscow"
|
||||
if currentBoard.allowsMoscowOnMinicard
|
||||
with cardFlowOf this
|
||||
if moscow
|
||||
.badge.minicard-flow-moscow(class="flow-moscow-{{moscow}}" title="{{_ 'moscow-priority'}}: {{_ moscowLabelKey}}")
|
||||
span.badge-text {{_ moscowLabelKey}}
|
||||
if $eq field "wsjf"
|
||||
if currentBoard.allowsWsjfOnMinicard
|
||||
with cardFlowOf this
|
||||
if wsjfScore
|
||||
.badge.minicard-flow-wsjf(title="{{_ 'wsjf-score'}}")
|
||||
span.badge-icon
|
||||
i.fa.fa-balance-scale
|
||||
span.badge-text {{wsjfScore}}
|
||||
if $eq field "stickers"
|
||||
if showStickersOnMinicard
|
||||
if stickers.length
|
||||
|
||||
@@ -180,6 +180,12 @@ Template.minicard.helpers({
|
||||
// #3984: visual card aging — fade cards that have not been touched recently,
|
||||
// based on dateLastActivity, when the board has card aging enabled.
|
||||
// docs/Features/Cards/At-Risk.md
|
||||
// Done here in a list split into Doing and Done (models/lib/boardFlowPolicies.js).
|
||||
splitDoneHere() {
|
||||
const { splitShown } = require('/client/components/lists/listFlowPolicies');
|
||||
return splitShown(ReactiveCache.getBoard(this.boardId), ReactiveCache.getList(this.listId))
|
||||
&& require('/models/lib/boardFlowPolicies').isSplitDone(this);
|
||||
},
|
||||
atRisk() {
|
||||
return riskOf(this);
|
||||
},
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
/* Cloud Panel (docs/Features/Admin-Panel/Cloud-Panel.md). The layout is the
|
||||
Admin Panel's (.setting-content, the left menu, the table page); only the
|
||||
panel's own forms, the plan, the Caddyfile and the chat are styled here. */
|
||||
.cloud-form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-width: 40em;
|
||||
gap: 0.3em;
|
||||
}
|
||||
.cloud-form .billing-checkbox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.4em;
|
||||
}
|
||||
.cloud-database {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.3em;
|
||||
}
|
||||
.cloud-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5em;
|
||||
margin-block: 0.8em;
|
||||
}
|
||||
.cloud-caddyfile {
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: anywhere;
|
||||
background: #f5f5f5;
|
||||
padding: 0.8em;
|
||||
}
|
||||
.cloud-plan .cloud-plan-create {
|
||||
color: #2e7d32;
|
||||
}
|
||||
.cloud-plan .cloud-plan-update {
|
||||
color: #8a6d00;
|
||||
}
|
||||
.cloud-chat-messages {
|
||||
list-style: none;
|
||||
padding-inline-start: 0;
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.cloud-chat-messages li {
|
||||
margin-block-end: 0.6em;
|
||||
}
|
||||
.cloud-chat-messages li.is-mine {
|
||||
text-align: end;
|
||||
}
|
||||
.cloud-chat-who {
|
||||
font-weight: bold;
|
||||
}
|
||||
.cloud-chat-text {
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.cloud-invoice-void td {
|
||||
text-decoration: line-through;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
/* Labelled native checkboxes: the app-wide material form rule
|
||||
(client/components/forms/forms.css) hides native checkboxes three ways -
|
||||
display, visibility, an offset - which left these with a label and no box
|
||||
to tick or see ticked. All three are undone, as in cardFlow.css. */
|
||||
.cloud-panel input[type="checkbox"],
|
||||
.js-cloud-panel-settings input[type="checkbox"] {
|
||||
display: inline-block;
|
||||
visibility: visible;
|
||||
position: static;
|
||||
inset-inline-start: auto;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
min-height: 0;
|
||||
margin: 0;
|
||||
margin-inline-end: 4px;
|
||||
flex: none;
|
||||
}
|
||||
@@ -0,0 +1,287 @@
|
||||
//- Cloud Panel (docs/Features/Admin-Panel/Cloud-Panel.md): on the panel's own
|
||||
domain, the Cloud Admins' Cloudflare, Caddy, Domains, Invoices and Chat, and a
|
||||
customer's own Invoices and Chat. The server decides who sees what
|
||||
(server/cloudPanel.js); this page draws what it is given.
|
||||
|
||||
template(name="cloudPanel")
|
||||
.setting-content.cloud-panel
|
||||
if loading
|
||||
+spinner
|
||||
else if notAllowed
|
||||
p.quiet {{_ 'cloud-panel-not-allowed'}}
|
||||
else
|
||||
.content-body
|
||||
+leftMenu(menuItems)
|
||||
.main-body
|
||||
+paneTitle(paneTitleData)
|
||||
if actionError
|
||||
.warning {{actionError}}
|
||||
if $eq pane 'cloudflare'
|
||||
+cloudPanelCloudflare(config=config reload=reload)
|
||||
else if $eq pane 'caddy'
|
||||
+cloudPanelCaddy(config=config reload=reload)
|
||||
else if $eq pane 'domains'
|
||||
+cloudPanelDomains
|
||||
else if $eq pane 'invoices'
|
||||
+cloudPanelInvoices(domains=info.domains isCloudAdmin=info.isCloudAdmin)
|
||||
else if $eq pane 'chat'
|
||||
+cloudPanelChat(domains=info.domains isCloudAdmin=info.isCloudAdmin)
|
||||
|
||||
template(name="cloudPanelCloudflare")
|
||||
form.js-cloud-cloudflare.cloud-form
|
||||
p.quiet {{_ 'cloudflare-api-key-desc'}}
|
||||
label(for="cloud-cf-token") {{_ 'cloudflare-api-key'}}
|
||||
input#cloud-cf-token(type="password" name="apiToken" autocomplete="off")
|
||||
if config.cloudflare.hasToken
|
||||
p.quiet {{_ 'cloudflare-api-key-set'}}
|
||||
else
|
||||
p.quiet {{_ 'cloudflare-api-key-not-set'}}
|
||||
label(for="cloud-cf-zone") {{_ 'cloud-panel-cloudflare-zone'}}
|
||||
input#cloud-cf-zone(type="text" name="zoneId" maxlength="32" value=config.cloudflare.zoneId)
|
||||
label(for="cloud-cf-target") {{_ 'cloud-panel-cloudflare-target'}}
|
||||
input#cloud-cf-target(type="text" name="target" maxlength="253" value=config.cloudflare.target placeholder="203.0.113.10")
|
||||
label.billing-checkbox
|
||||
input(type="checkbox" name="proxied" checked=config.cloudflare.proxied)
|
||||
| {{_ 'cloud-panel-cloudflare-proxied'}}
|
||||
button.primary(type="submit") {{_ 'save'}}
|
||||
.cloud-actions
|
||||
button.js-cloud-dns-plan(type="button") {{_ 'cloud-panel-dns-check'}}
|
||||
if plan
|
||||
button.primary.js-cloud-dns-apply(type="button") {{_ 'cloud-panel-dns-apply'}}
|
||||
if plan
|
||||
ul.cloud-plan
|
||||
each record in plan.create
|
||||
li.cloud-plan-create + {{record.type}} {{record.name}} → {{record.content}}
|
||||
each record in plan.update
|
||||
li.cloud-plan-update ~ {{record.type}} {{record.name}} → {{record.content}}
|
||||
each record in plan.conflicts
|
||||
li.warning {{_ 'cloud-panel-dns-conflict' name=record.name type=record.type}}
|
||||
each name in plan.unchanged
|
||||
li.quiet {{name}}
|
||||
|
||||
template(name="cloudPanelCaddy")
|
||||
form.js-cloud-caddy.cloud-form
|
||||
p.quiet {{_ 'cloud-panel-caddy-intro'}}
|
||||
label(for="cloud-caddy-admin") {{_ 'cloud-panel-caddy-admin'}}
|
||||
input#cloud-caddy-admin(type="text" name="adminUrl" maxlength="200" value=config.caddy.adminUrl placeholder="http://caddy:2019")
|
||||
label(for="cloud-caddy-upstream") {{_ 'cloud-panel-caddy-upstream'}}
|
||||
input#cloud-caddy-upstream(type="text" name="sharedUpstream" maxlength="260" value=config.caddy.sharedUpstream placeholder="wekan:8080")
|
||||
label(for="cloud-caddy-email") {{_ 'email'}}
|
||||
input#cloud-caddy-email(type="text" name="email" maxlength="200" value=config.caddy.email)
|
||||
button.primary(type="submit") {{_ 'save'}}
|
||||
.cloud-actions
|
||||
button.js-cloud-caddyfile(type="button") {{_ 'cloud-panel-caddy-show'}}
|
||||
button.primary.js-cloud-caddy-push(type="button") {{_ 'cloud-panel-caddy-push'}}
|
||||
if pushed
|
||||
span.quiet {{_ 'cloud-panel-caddy-pushed'}}
|
||||
if caddyfile
|
||||
pre.cloud-caddyfile {{caddyfile}}
|
||||
|
||||
template(name="cloudPanelDomains")
|
||||
+tablePage(tablePageData)
|
||||
if editing
|
||||
+cloudPanelDomainForm(domain=editing close=close)
|
||||
if report
|
||||
.cloud-report
|
||||
h3 {{_ 'cloud-panel-import-report'}}
|
||||
p {{_ 'cloud-panel-import-users' created=report.users.created matched=report.users.matched}}
|
||||
ul
|
||||
each item in reportCollections
|
||||
li {{item.name}}: {{item.copied}} (+{{item.skipped}})
|
||||
if report.files
|
||||
p.warning {{_ 'cloud-panel-import-files' count=report.files}}
|
||||
if reportIsDryRun
|
||||
button.primary.js-cloud-import-now(type="button" data-id=reportDomainId) {{_ 'cloud-panel-import-now'}}
|
||||
|
||||
template(name="cloudPanelDomainNew")
|
||||
a.js-cloud-domain-new(title="{{_ 'cloud-panel-domain-new'}}")
|
||||
i.fa.fa-plus
|
||||
| {{_ 'domain'}}
|
||||
|
||||
template(name="cloudPanelDomainRow")
|
||||
tr(class="cloud-domain-{{domain.mode}}")
|
||||
td {{domain.domain}}
|
||||
td {{domain.customerName}}
|
||||
td {{domain.customerEmail}}
|
||||
td {{domain.startDate}}
|
||||
td {{domain.endDate}}
|
||||
td
|
||||
if $eq domain.mode 'shared'
|
||||
| {{_ 'cloud-panel-mode-shared'}}
|
||||
else
|
||||
| {{_ 'cloud-panel-mode-own'}}
|
||||
td {{databaseLabel domain.database}}
|
||||
td
|
||||
button.js-cloud-domain-edit(type="button" data-id=domain._id) {{_ 'edit'}}
|
||||
if domain.database
|
||||
button.js-cloud-domain-test(type="button" data-id=domain._id) {{_ 'cloud-panel-test'}}
|
||||
if $eq domain.mode 'own'
|
||||
button.js-cloud-domain-import(type="button" data-id=domain._id) {{_ 'cloud-panel-import'}}
|
||||
if tested
|
||||
span.quiet {{tested}}
|
||||
|
||||
template(name="cloudPanelDomainForm")
|
||||
form.js-cloud-domain.cloud-form
|
||||
label(for="cloud-domain-domain") {{_ 'domain'}}
|
||||
input#cloud-domain-domain(type="text" name="domain" maxlength="253" value=domain.domain placeholder="customer1.example.com" required)
|
||||
label(for="cloud-domain-customer") {{_ 'cloud-customer-name'}}
|
||||
input#cloud-domain-customer(type="text" name="customerName" maxlength="200" value=domain.customerName)
|
||||
label(for="cloud-domain-email") {{_ 'cloud-customer-email'}}
|
||||
input#cloud-domain-email(type="email" name="customerEmail" maxlength="254" value=domain.customerEmail)
|
||||
label(for="cloud-domain-billing") {{_ 'cloud-billing-email'}}
|
||||
input#cloud-domain-billing(type="email" name="billingEmail" maxlength="254" value=domain.billingEmail)
|
||||
label(for="cloud-domain-start") {{_ 'cloud-start-date'}}
|
||||
input#cloud-domain-start(type="date" name="startDate" value=domain.startDate)
|
||||
label(for="cloud-domain-end") {{_ 'cloud-end-date'}}
|
||||
input#cloud-domain-end(type="date" name="endDate" value=domain.endDate)
|
||||
label(for="cloud-domain-mode") {{_ 'cloud-panel-mode'}}
|
||||
select#cloud-domain-mode(name="mode")
|
||||
option(value="own" selected="{{#if $eq domain.mode 'own'}}selected{{/if}}") {{_ 'cloud-panel-mode-own'}}
|
||||
option(value="shared" selected="{{#if $eq domain.mode 'shared'}}selected{{/if}}") {{_ 'cloud-panel-mode-shared'}}
|
||||
label(for="cloud-domain-upstream") {{_ 'cloud-panel-upstream'}}
|
||||
input#cloud-domain-upstream(type="text" name="upstream" maxlength="260" value=domain.upstream placeholder="wekan-customer1:8080")
|
||||
fieldset.cloud-database
|
||||
legend {{_ 'cloud-panel-database'}}
|
||||
label(for="cloud-db-uri") {{_ 'cloud-panel-database-uri'}}
|
||||
input#cloud-db-uri(type="text" name="uri" maxlength="2000" value=domain.database.uri placeholder="mongodb://…")
|
||||
label(for="cloud-db-host") {{_ 'cloud-panel-database-host'}}
|
||||
input#cloud-db-host(type="text" name="host" maxlength="253" value=domain.database.host placeholder="mongodb")
|
||||
label(for="cloud-db-port") {{_ 'cloud-panel-database-port'}}
|
||||
input#cloud-db-port(type="number" name="port" min="1" max="65535" value=domain.database.port placeholder="27017")
|
||||
label(for="cloud-db-name") {{_ 'cloud-panel-database-name'}}
|
||||
input#cloud-db-name(type="text" name="database" maxlength="64" value=domain.database.database placeholder="wekan")
|
||||
label(for="cloud-db-user") {{_ 'username'}}
|
||||
input#cloud-db-user(type="text" name="username" maxlength="200" value=domain.database.username autocomplete="off")
|
||||
label(for="cloud-db-password") {{_ 'password'}}
|
||||
input#cloud-db-password(type="password" name="password" maxlength="500" autocomplete="new-password" placeholder="{{#if domain.database.hasPassword}}••••••••{{/if}}")
|
||||
label(for="cloud-db-authsource") {{_ 'cloud-panel-database-auth-source'}}
|
||||
input#cloud-db-authsource(type="text" name="authSource" maxlength="64" value=domain.database.authSource placeholder="admin")
|
||||
label(for="cloud-db-replicaset") {{_ 'cloud-panel-database-replica-set'}}
|
||||
input#cloud-db-replicaset(type="text" name="replicaSet" maxlength="64" value=domain.database.replicaSet placeholder="rs0")
|
||||
label.billing-checkbox
|
||||
input(type="checkbox" name="tls" checked=domain.database.tls)
|
||||
| TLS
|
||||
label(for="cloud-domain-customers") {{_ 'cloud-panel-customers'}}
|
||||
input#cloud-domain-customers(type="text" name="customerUsernames" maxlength="2000" value=customers placeholder="customer1, customer2")
|
||||
label.billing-checkbox
|
||||
input(type="checkbox" name="cloudflare" checked=cloudflareOn)
|
||||
| {{_ 'cloud-panel-domain-cloudflare'}}
|
||||
label(for="cloud-domain-notes") {{_ 'workload-note'}}
|
||||
textarea#cloud-domain-notes(name="notes" maxlength="2000" rows="2") {{domain.notes}}
|
||||
button.primary(type="submit") {{_ 'save'}}
|
||||
button.js-cloud-domain-close(type="button") {{_ 'close'}}
|
||||
if domain._id
|
||||
button.js-cloud-domain-remove(type="button" data-id=domain._id) {{_ 'delete'}}
|
||||
|
||||
template(name="cloudPanelInvoices")
|
||||
.cloud-invoices
|
||||
if isCloudAdmin
|
||||
form.js-cloud-invoice.cloud-form
|
||||
label(for="cloud-invoice-domain") {{_ 'domain'}}
|
||||
select#cloud-invoice-domain(name="domainId" required)
|
||||
each domain in allDomains
|
||||
option(value=domain._id) {{domain.domain}}
|
||||
label(for="cloud-invoice-number") {{_ 'billing-number'}}
|
||||
input#cloud-invoice-number(type="text" name="number" maxlength="50" required)
|
||||
label(for="cloud-invoice-issue") {{_ 'billing-issue-date'}}
|
||||
input#cloud-invoice-issue(type="date" name="issueDate" required)
|
||||
label(for="cloud-invoice-due") {{_ 'billing-due-date'}}
|
||||
input#cloud-invoice-due(type="date" name="dueDate")
|
||||
label(for="cloud-invoice-amount") {{_ 'billing-total'}}
|
||||
input#cloud-invoice-amount(type="number" name="amount" min="0" step="0.01" required)
|
||||
label(for="cloud-invoice-currency") {{_ 'billing-currency'}}
|
||||
input#cloud-invoice-currency(type="text" name="currency" maxlength="3" value="EUR" required)
|
||||
label(for="cloud-invoice-status") {{_ 'billing-status'}}
|
||||
select#cloud-invoice-status(name="status")
|
||||
option(value="open") {{_ 'cloud-panel-invoice-open'}}
|
||||
option(value="paid") {{_ 'billing-status-paid'}}
|
||||
option(value="void") {{_ 'billing-status-void'}}
|
||||
label(for="cloud-invoice-paid") {{_ 'cloud-panel-paid-on'}}
|
||||
input#cloud-invoice-paid(type="date" name="paidDate")
|
||||
label(for="cloud-invoice-description") {{_ 'description'}}
|
||||
input#cloud-invoice-description(type="text" name="description" maxlength="1000")
|
||||
label(for="cloud-invoice-link") {{_ 'cloud-panel-invoice-link'}}
|
||||
input#cloud-invoice-link(type="url" name="link" maxlength="500" placeholder="https://")
|
||||
button.primary(type="submit") {{_ 'cloud-panel-add-invoice'}}
|
||||
if invoices.length
|
||||
.billing-table-wrapper
|
||||
table.cloud-invoice-table
|
||||
thead
|
||||
tr
|
||||
th {{_ 'domain'}}
|
||||
th {{_ 'billing-number'}}
|
||||
th {{_ 'billing-issue-date'}}
|
||||
th {{_ 'billing-due-date'}}
|
||||
th {{_ 'billing-total'}}
|
||||
th {{_ 'billing-status'}}
|
||||
th {{_ 'cloud-panel-paid-on'}}
|
||||
th
|
||||
tbody
|
||||
each invoice in invoices
|
||||
tr(class="cloud-invoice-{{invoice.status}}")
|
||||
td {{invoice.domain}}
|
||||
td
|
||||
if invoice.link
|
||||
a(href=invoice.link target="_blank" rel="noopener noreferrer") {{invoice.number}}
|
||||
else
|
||||
| {{invoice.number}}
|
||||
if invoice.description
|
||||
.quiet {{invoice.description}}
|
||||
td {{invoice.issueDate}}
|
||||
td {{invoice.dueDate}}
|
||||
td {{money invoice.amountMinor invoice.currency}}
|
||||
td {{statusLabel invoice.status}}
|
||||
td {{invoice.paidDate}}
|
||||
td
|
||||
if isCloudAdmin
|
||||
a.js-cloud-invoice-remove(data-id=invoice._id title="{{_ 'delete'}}" aria-label="{{_ 'delete'}}")
|
||||
i.fa.fa-trash
|
||||
else
|
||||
p {{_ 'billing-no-invoices'}}
|
||||
|
||||
template(name="cloudPanelChat")
|
||||
.cloud-chat
|
||||
label(for="cloud-chat-domain") {{_ 'domain'}}
|
||||
select#cloud-chat-domain.js-cloud-chat-domain
|
||||
each domain in chatDomains
|
||||
option(value=domain._id selected="{{#if $eq domain._id domainId}}selected{{/if}}") {{domain.domain}}
|
||||
if domainId
|
||||
ul.cloud-chat-messages
|
||||
each message in messages
|
||||
li(class="{{#if message.mine}}is-mine{{/if}}")
|
||||
span.cloud-chat-who {{message.authorName}}
|
||||
if message.room
|
||||
span.quiet · {{message.room}}
|
||||
span.quiet · {{when message.at}}
|
||||
.cloud-chat-text {{message.text}}
|
||||
unless messages.length
|
||||
li.quiet {{_ 'cloud-panel-chat-empty'}}
|
||||
form.js-cloud-chat-send
|
||||
textarea(name="text" maxlength="20000" rows="2" aria-label="{{_ 'cloud-panel-chat-message'}}" required)
|
||||
button.primary(type="submit") {{_ 'cloud-panel-chat-send'}}
|
||||
if isCloudAdmin
|
||||
form.js-cloud-chat-import.cloud-form
|
||||
label(for="cloud-chat-source") {{_ 'cloud-panel-chat-import'}}
|
||||
select#cloud-chat-source(name="source")
|
||||
option(value="rocketchat") Rocket.Chat (.zip)
|
||||
option(value="sandchat") Sandstorm SandChat (.zip)
|
||||
input(type="file" name="file" accept=".zip" aria-label="{{_ 'cloud-panel-chat-import'}}" required)
|
||||
button(type="submit") {{_ 'import'}}
|
||||
if imported
|
||||
span.quiet {{_ 'cloud-panel-chat-imported' count=imported}}
|
||||
|
||||
template(name="cloudPanelSettings")
|
||||
form.js-cloud-panel-settings.cloud-form
|
||||
p.quiet {{_ 'cloud-panel-settings-intro'}}
|
||||
label(for="cloud-settings-domain") {{_ 'cloud-panel-domain'}}
|
||||
input#cloud-settings-domain(type="text" name="domain" maxlength="253" value=settings.domain placeholder="cloud.example.com")
|
||||
label(for="cloud-settings-admin") {{_ 'cloud-superadmin-username'}}
|
||||
input#cloud-settings-admin(type="text" name="superAdminUsername" maxlength="254" value=settings.superAdminUsername)
|
||||
button.primary(type="submit") {{_ 'save'}}
|
||||
if saved
|
||||
span.quiet {{_ 'cloud-saved'}}
|
||||
if error
|
||||
.warning {{error}}
|
||||
if settings.domain
|
||||
p
|
||||
a(href="https://{{settings.domain}}/cloud" target="_blank" rel="noopener noreferrer") https://{{settings.domain}}/cloud
|
||||
@@ -0,0 +1,474 @@
|
||||
// Cloud Panel page (docs/Features/Admin-Panel/Cloud-Panel.md). Everything is
|
||||
// read and written through the cloudPanel* methods of server/cloudPanel.js,
|
||||
// which also decide who may see what; nothing is subscribed.
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Template } from 'meteor/templating';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
import { leftMenuData, paneTitle } from '/models/lib/leftMenu';
|
||||
import { buildHeader, pageInfo, TABLE_PAGE_ROWS_PER_PAGE } from '/models/lib/tablePage';
|
||||
const { formatMoney } = require('/models/lib/billing');
|
||||
|
||||
function errorText(error) {
|
||||
return error ? (error.reason || error.message || String(error)) : '';
|
||||
}
|
||||
|
||||
function language() {
|
||||
try { return TAPi18n.getLanguage ? TAPi18n.getLanguage() : undefined; } catch (e) { return undefined; }
|
||||
}
|
||||
|
||||
function field(form, name) {
|
||||
const el = form.elements[name];
|
||||
return el ? String(el.value).trim() : '';
|
||||
}
|
||||
|
||||
function list(value) {
|
||||
return String(value || '').split(/[\s,;]+/).map(s => s.trim()).filter(Boolean);
|
||||
}
|
||||
|
||||
// Every pane reports through this one place, shown above the pane. It is a
|
||||
// module value, not a function handed down in a data context: Spacebars calls
|
||||
// a function it finds in a data context when it passes it on, so `done=done`
|
||||
// called done() with nothing and the domain form never rendered.
|
||||
const panelError = new ReactiveVar('');
|
||||
function report(promise) {
|
||||
return promise.then(result => { panelError.set(''); return result; })
|
||||
.catch(error => { panelError.set(errorText(error)); });
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- the page
|
||||
|
||||
const ADMIN_MENU = [
|
||||
{ id: 'domains', icon: 'fa-globe', labelKey: 'domains' },
|
||||
{ id: 'invoices', icon: 'fa-file-text-o', labelKey: 'billing-invoices' },
|
||||
{ id: 'chat', icon: 'fa-comments', labelKey: 'board-view-chat' },
|
||||
{ id: 'cloudflare', icon: 'fa-cloud', label: 'Cloudflare' },
|
||||
{ id: 'caddy', icon: 'fa-server', label: 'Caddy' },
|
||||
];
|
||||
const CUSTOMER_MENU = ADMIN_MENU.filter(item => ['invoices', 'chat'].includes(item.id));
|
||||
|
||||
Template.cloudPanel.onCreated(function () {
|
||||
this.loading = new ReactiveVar(true);
|
||||
this.info = new ReactiveVar({ onCloudHost: false, isCloudAdmin: false, domains: [] });
|
||||
this.config = new ReactiveVar(null);
|
||||
this.pane = new ReactiveVar('');
|
||||
panelError.set('');
|
||||
this.loadConfig = () => Meteor.callAsync('cloudPanelConfig').then(config => this.config.set(config));
|
||||
Meteor.callAsync('cloudPanelWhoAmI')
|
||||
.then(info => {
|
||||
this.info.set(info);
|
||||
this.pane.set(info.isCloudAdmin ? 'domains' : 'invoices');
|
||||
return info.isCloudAdmin ? this.loadConfig() : null;
|
||||
})
|
||||
.catch(error => panelError.set(errorText(error)))
|
||||
.finally(() => this.loading.set(false));
|
||||
});
|
||||
|
||||
function menu(info) {
|
||||
return info.isCloudAdmin ? ADMIN_MENU : CUSTOMER_MENU;
|
||||
}
|
||||
|
||||
Template.cloudPanel.helpers({
|
||||
loading: () => Template.instance().loading.get(),
|
||||
info: () => Template.instance().info.get(),
|
||||
config: () => Template.instance().config.get(),
|
||||
pane: () => Template.instance().pane.get(),
|
||||
actionError: () => panelError.get(),
|
||||
// Not at the Cloud Panel Domain, or neither the SuperAdmin nor a customer.
|
||||
notAllowed() {
|
||||
const info = Template.instance().info.get();
|
||||
return !info.onCloudHost || !(info.isCloudAdmin || info.domains.length > 0);
|
||||
},
|
||||
menuItems() {
|
||||
const tpl = Template.instance();
|
||||
return leftMenuData(menu(tpl.info.get()), tpl.pane.get(), 'js-cloud-menu');
|
||||
},
|
||||
paneTitleData() {
|
||||
const tpl = Template.instance();
|
||||
return paneTitle(menu(tpl.info.get()), tpl.pane.get());
|
||||
},
|
||||
reload() {
|
||||
const tpl = Template.instance();
|
||||
return () => tpl.loadConfig();
|
||||
},
|
||||
});
|
||||
|
||||
Template.cloudPanel.events({
|
||||
'click a.js-cloud-menu'(event, tpl) {
|
||||
event.preventDefault();
|
||||
panelError.set('');
|
||||
tpl.pane.set(event.currentTarget.getAttribute('data-id'));
|
||||
},
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------- Cloudflare
|
||||
|
||||
Template.cloudPanelCloudflare.onCreated(function () {
|
||||
this.plan = new ReactiveVar(null);
|
||||
});
|
||||
|
||||
Template.cloudPanelCloudflare.helpers({
|
||||
plan: () => Template.instance().plan.get(),
|
||||
});
|
||||
|
||||
Template.cloudPanelCloudflare.events({
|
||||
'submit .js-cloud-cloudflare'(event) {
|
||||
event.preventDefault();
|
||||
const form = event.currentTarget;
|
||||
const { reload } = Template.currentData();
|
||||
report(Meteor.callAsync('cloudPanelSetCloudflare', {
|
||||
apiToken: field(form, 'apiToken'), zoneId: field(form, 'zoneId'), target: field(form, 'target'),
|
||||
proxied: form.elements.proxied.checked === true,
|
||||
}).then(() => { form.elements.apiToken.value = ''; return reload(); }));
|
||||
},
|
||||
'click .js-cloud-dns-plan'(event, tpl) {
|
||||
event.preventDefault();
|
||||
report(Meteor.callAsync('cloudPanelDnsPlan').then(plan => tpl.plan.set(plan)));
|
||||
},
|
||||
'click .js-cloud-dns-apply'(event, tpl) {
|
||||
event.preventDefault();
|
||||
report(Meteor.callAsync('cloudPanelDnsApply').then(() => Meteor.callAsync('cloudPanelDnsPlan')).then(plan => tpl.plan.set(plan)));
|
||||
},
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------- Caddy
|
||||
|
||||
Template.cloudPanelCaddy.onCreated(function () {
|
||||
this.caddyfile = new ReactiveVar('');
|
||||
this.pushed = new ReactiveVar(false);
|
||||
});
|
||||
|
||||
Template.cloudPanelCaddy.helpers({
|
||||
caddyfile: () => Template.instance().caddyfile.get(),
|
||||
pushed: () => Template.instance().pushed.get(),
|
||||
});
|
||||
|
||||
Template.cloudPanelCaddy.events({
|
||||
'submit .js-cloud-caddy'(event) {
|
||||
event.preventDefault();
|
||||
const form = event.currentTarget;
|
||||
const { reload } = Template.currentData();
|
||||
report(Meteor.callAsync('cloudPanelSetCaddy', {
|
||||
adminUrl: field(form, 'adminUrl'), sharedUpstream: field(form, 'sharedUpstream'), email: field(form, 'email'),
|
||||
}).then(() => reload()));
|
||||
},
|
||||
'click .js-cloud-caddyfile'(event, tpl) {
|
||||
event.preventDefault();
|
||||
report(Meteor.callAsync('cloudPanelCaddyfile').then(text => tpl.caddyfile.set(text)));
|
||||
},
|
||||
'click .js-cloud-caddy-push'(event, tpl) {
|
||||
event.preventDefault();
|
||||
tpl.pushed.set(false);
|
||||
report(Meteor.callAsync('cloudPanelPushCaddy').then(() => tpl.pushed.set(true)));
|
||||
},
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------- Domains
|
||||
|
||||
// Weddy's Domains columns (caddy-wekan-plugin), and what WeKan adds: where
|
||||
// the domain's data is.
|
||||
const DOMAIN_COLUMNS = [
|
||||
{ labelKey: 'domain', headerTemplate: 'cloudPanelDomainNew' },
|
||||
{ labelKey: 'cloud-customer-name' },
|
||||
{ labelKey: 'cloud-customer-email' },
|
||||
{ labelKey: 'cloud-start-date' },
|
||||
{ labelKey: 'cloud-end-date' },
|
||||
{ labelKey: 'cloud-panel-mode' },
|
||||
{ labelKey: 'cloud-panel-database' },
|
||||
{ label: '' },
|
||||
];
|
||||
|
||||
// The domain being edited, shared with the header's "New domain" link: a
|
||||
// table page's header template takes its own clicks (as People's "New" rows
|
||||
// do), so the link and the pane meet here.
|
||||
const editingDomain = new ReactiveVar(null);
|
||||
|
||||
Template.cloudPanelDomainNew.events({
|
||||
'click .js-cloud-domain-new'(event) {
|
||||
event.preventDefault();
|
||||
editingDomain.set({ mode: 'own', database: {}, customerUsernames: [], cloudflare: true });
|
||||
},
|
||||
});
|
||||
|
||||
Template.cloudPanelDomains.onCreated(function () {
|
||||
editingDomain.set(null);
|
||||
this.editing = editingDomain;
|
||||
this.searchTerm = new ReactiveVar('');
|
||||
this.page = new ReactiveVar(1);
|
||||
this.total = new ReactiveVar(0);
|
||||
this.rows = new ReactiveVar([]);
|
||||
this.report = new ReactiveVar(null);
|
||||
this.loadPage = () => Meteor.callAsync('cloudPanelDomainsPage', { search: this.searchTerm.get(), page: this.page.get() })
|
||||
.then(rows => this.rows.set(rows));
|
||||
// The total only when the pane opens or the search changes, never per page.
|
||||
this.loadAll = () => Meteor.callAsync('cloudPanelDomainsCount', this.searchTerm.get())
|
||||
.then(total => { this.total.set(total); return this.loadPage(); });
|
||||
this.loadAll();
|
||||
});
|
||||
|
||||
Template.cloudPanelDomains.helpers({
|
||||
tablePageData() {
|
||||
const tpl = Template.instance();
|
||||
const info = pageInfo(tpl.total.get(), tpl.page.get(), TABLE_PAGE_ROWS_PER_PAGE);
|
||||
const rows = tpl.rows.get();
|
||||
return {
|
||||
emptyKey: 'no-items-message',
|
||||
searchTerm: tpl.searchTerm.get(),
|
||||
header: buildHeader(DOMAIN_COLUMNS),
|
||||
rowTemplate: 'cloudPanelDomainRow',
|
||||
docs: rows.map(domain => ({ domain })),
|
||||
rowCount: rows.length,
|
||||
page: info.page,
|
||||
totalPages: info.totalPages,
|
||||
hasPrev: info.hasPrev,
|
||||
hasNext: info.hasNext,
|
||||
total: info.total,
|
||||
totalLabelKey: 'domains',
|
||||
};
|
||||
},
|
||||
editing: () => Template.instance().editing.get(),
|
||||
report: () => Template.instance().report.get(),
|
||||
reportCollections() {
|
||||
const report = Template.instance().report.get();
|
||||
return Object.entries((report && report.collections) || {}).map(([name, c]) => ({ name, ...c }));
|
||||
},
|
||||
reportIsDryRun: () => !!(Template.instance().report.get() || {}).dryRun,
|
||||
reportDomainId: () => (Template.instance().report.get() || {}).domainId,
|
||||
close() {
|
||||
const tpl = Template.instance();
|
||||
return saved => { tpl.editing.set(null); if (saved) tpl.loadAll(); };
|
||||
},
|
||||
});
|
||||
|
||||
Template.cloudPanelDomains.events({
|
||||
'keydown .js-table-page-search'(event, tpl) {
|
||||
if (event.keyCode !== 13 || event.shiftKey) return;
|
||||
event.preventDefault();
|
||||
tpl.searchTerm.set(event.currentTarget.value || '');
|
||||
tpl.page.set(1);
|
||||
tpl.loadAll();
|
||||
},
|
||||
'click .js-table-page-prev'(event, tpl) {
|
||||
event.preventDefault();
|
||||
if (tpl.page.get() > 1) { tpl.page.set(tpl.page.get() - 1); tpl.loadPage(); }
|
||||
},
|
||||
'click .js-table-page-next'(event, tpl) {
|
||||
event.preventDefault();
|
||||
const { totalPages } = pageInfo(tpl.total.get(), tpl.page.get(), TABLE_PAGE_ROWS_PER_PAGE);
|
||||
if (tpl.page.get() < totalPages) { tpl.page.set(tpl.page.get() + 1); tpl.loadPage(); }
|
||||
},
|
||||
'click .js-cloud-domain-edit'(event, tpl) {
|
||||
event.preventDefault();
|
||||
report(Meteor.callAsync('cloudPanelDomain', event.currentTarget.getAttribute('data-id'))
|
||||
.then(domain => tpl.editing.set({ ...domain, database: domain.database || {} })));
|
||||
},
|
||||
'click .js-cloud-domain-import'(event, tpl) {
|
||||
event.preventDefault();
|
||||
const domainId = event.currentTarget.getAttribute('data-id');
|
||||
// A dry run first: what would be copied, and nothing written.
|
||||
report(Meteor.callAsync('cloudPanelImportDomain', domainId, { dryRun: true })
|
||||
.then(report => tpl.report.set({ ...report, dryRun: true, domainId })));
|
||||
},
|
||||
'click .js-cloud-import-now'(event, tpl) {
|
||||
event.preventDefault();
|
||||
const domainId = event.currentTarget.getAttribute('data-id');
|
||||
report(Meteor.callAsync('cloudPanelImportDomain', domainId, { dryRun: false })
|
||||
.then(report => { tpl.report.set({ ...report, dryRun: false, domainId }); return tpl.loadAll(); }));
|
||||
},
|
||||
});
|
||||
|
||||
Template.cloudPanelDomainRow.onCreated(function () {
|
||||
this.tested = new ReactiveVar('');
|
||||
});
|
||||
|
||||
Template.cloudPanelDomainRow.helpers({
|
||||
tested: () => Template.instance().tested.get(),
|
||||
databaseLabel(db) {
|
||||
if (!db) return '—';
|
||||
if (db.uri) return db.uri;
|
||||
return `${db.username ? `${db.username}@` : ''}${db.host}:${db.port}/${db.database}`;
|
||||
},
|
||||
});
|
||||
|
||||
Template.cloudPanelDomainRow.events({
|
||||
'click .js-cloud-domain-test'(event, tpl) {
|
||||
event.preventDefault();
|
||||
tpl.tested.set('…');
|
||||
Meteor.callAsync('cloudPanelTestDatabase', event.currentTarget.getAttribute('data-id'))
|
||||
.then(r => tpl.tested.set(TAPi18n.__('cloud-panel-test-ok', { users: r.users, boards: r.boards, cards: r.cards })))
|
||||
.catch(error => tpl.tested.set(errorText(error)));
|
||||
},
|
||||
});
|
||||
|
||||
Template.cloudPanelDomainForm.helpers({
|
||||
customers: () => (Template.currentData().domain.customerUsernames || []).join(', '),
|
||||
cloudflareOn: () => Template.currentData().domain.cloudflare !== false,
|
||||
});
|
||||
|
||||
Template.cloudPanelDomainForm.events({
|
||||
'submit .js-cloud-domain'(event) {
|
||||
event.preventDefault();
|
||||
const form = event.currentTarget;
|
||||
const { domain, close } = Template.currentData();
|
||||
const database = {};
|
||||
if (field(form, 'uri')) database.uri = field(form, 'uri');
|
||||
else if (field(form, 'host')) {
|
||||
database.host = field(form, 'host');
|
||||
if (field(form, 'port')) database.port = parseInt(field(form, 'port'), 10);
|
||||
database.database = field(form, 'database');
|
||||
for (const name of ['username', 'authSource', 'replicaSet']) if (field(form, name)) database[name] = field(form, name);
|
||||
if (form.elements.password.value) database.password = form.elements.password.value;
|
||||
if (form.elements.tls.checked) database.tls = true;
|
||||
}
|
||||
const value = {
|
||||
domain: field(form, 'domain'), customerName: field(form, 'customerName'), mode: field(form, 'mode'),
|
||||
customerEmail: field(form, 'customerEmail'), billingEmail: field(form, 'billingEmail'),
|
||||
startDate: field(form, 'startDate'), endDate: field(form, 'endDate'),
|
||||
upstream: field(form, 'upstream'), customerUsernames: list(field(form, 'customerUsernames')),
|
||||
notes: field(form, 'notes'), cloudflare: form.elements.cloudflare.checked === true,
|
||||
};
|
||||
if (Object.keys(database).length) value.database = database;
|
||||
report(Meteor.callAsync('cloudPanelSaveDomain', domain._id || null, value).then(() => close(true)));
|
||||
},
|
||||
'click .js-cloud-domain-close'(event) {
|
||||
event.preventDefault();
|
||||
Template.currentData().close(false);
|
||||
},
|
||||
'click .js-cloud-domain-remove'(event) {
|
||||
event.preventDefault();
|
||||
const { close } = Template.currentData();
|
||||
report(Meteor.callAsync('cloudPanelRemoveDomain', event.currentTarget.getAttribute('data-id')).then(() => close(true)));
|
||||
},
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------- Invoices
|
||||
|
||||
const INVOICE_STATE_KEYS = { open: 'cloud-panel-invoice-open', paid: 'billing-status-paid', void: 'billing-status-void' };
|
||||
|
||||
Template.cloudPanelInvoices.onCreated(function () {
|
||||
this.invoices = new ReactiveVar([]);
|
||||
this.allDomains = new ReactiveVar([]);
|
||||
this.load = () => Meteor.callAsync('cloudPanelInvoices').then(invoices => this.invoices.set(invoices));
|
||||
this.load();
|
||||
if (Template.currentData().isCloudAdmin) {
|
||||
Meteor.callAsync('cloudPanelDomainsCount', '')
|
||||
.then(total => Promise.all(Array.from({ length: Math.ceil(total / TABLE_PAGE_ROWS_PER_PAGE) }, (_, i) =>
|
||||
Meteor.callAsync('cloudPanelDomainsPage', { page: i + 1 }))))
|
||||
.then(pages => this.allDomains.set(pages.flat()));
|
||||
}
|
||||
});
|
||||
|
||||
Template.cloudPanelInvoices.helpers({
|
||||
invoices: () => Template.instance().invoices.get(),
|
||||
allDomains: () => Template.instance().allDomains.get(),
|
||||
money: (minor, currency) => formatMoney(minor, currency, language()),
|
||||
statusLabel: status => TAPi18n.__(INVOICE_STATE_KEYS[status] || status),
|
||||
});
|
||||
|
||||
Template.cloudPanelInvoices.events({
|
||||
'submit .js-cloud-invoice'(event, tpl) {
|
||||
event.preventDefault();
|
||||
const form = event.currentTarget;
|
||||
const value = { number: field(form, 'number'), issueDate: field(form, 'issueDate'), amount: parseFloat(field(form, 'amount')),
|
||||
currency: field(form, 'currency'), status: field(form, 'status') };
|
||||
for (const name of ['dueDate', 'paidDate', 'description', 'link']) if (field(form, name)) value[name] = field(form, name);
|
||||
report(Meteor.callAsync('cloudPanelSaveInvoice', field(form, 'domainId'), null, value).then(() => { form.reset(); return tpl.load(); }));
|
||||
},
|
||||
'click .js-cloud-invoice-remove'(event, tpl) {
|
||||
event.preventDefault();
|
||||
report(Meteor.callAsync('cloudPanelRemoveInvoice', event.currentTarget.getAttribute('data-id')).then(() => tpl.load()));
|
||||
},
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------- Chat
|
||||
|
||||
Template.cloudPanelChat.onCreated(function () {
|
||||
this.domains = new ReactiveVar(Template.currentData().domains || []);
|
||||
this.domainId = new ReactiveVar((this.domains.get()[0] || {})._id || '');
|
||||
this.messages = new ReactiveVar([]);
|
||||
this.imported = new ReactiveVar(0);
|
||||
this.load = () => {
|
||||
const id = this.domainId.get();
|
||||
if (!id) return Promise.resolve();
|
||||
return Meteor.callAsync('cloudPanelChat', id).then(messages => this.messages.set(messages));
|
||||
};
|
||||
if (Template.currentData().isCloudAdmin) {
|
||||
Meteor.callAsync('cloudPanelDomainsCount', '')
|
||||
.then(total => Promise.all(Array.from({ length: Math.ceil(total / TABLE_PAGE_ROWS_PER_PAGE) }, (_, i) =>
|
||||
Meteor.callAsync('cloudPanelDomainsPage', { page: i + 1 }))))
|
||||
.then(pages => {
|
||||
this.domains.set(pages.flat());
|
||||
if (!this.domainId.get() && pages.flat()[0]) this.domainId.set(pages.flat()[0]._id);
|
||||
return this.load();
|
||||
});
|
||||
} else {
|
||||
this.load();
|
||||
}
|
||||
// The chat is read again every 15 seconds while the pane is open.
|
||||
this.poll = Meteor.setInterval(() => this.load(), 15000);
|
||||
});
|
||||
|
||||
Template.cloudPanelChat.onDestroyed(function () {
|
||||
Meteor.clearInterval(this.poll);
|
||||
});
|
||||
|
||||
Template.cloudPanelChat.helpers({
|
||||
chatDomains: () => Template.instance().domains.get(),
|
||||
domainId: () => Template.instance().domainId.get(),
|
||||
messages: () => Template.instance().messages.get(),
|
||||
imported: () => Template.instance().imported.get(),
|
||||
when: at => (at ? new Date(at).toLocaleString(language()) : ''),
|
||||
});
|
||||
|
||||
Template.cloudPanelChat.events({
|
||||
'change .js-cloud-chat-domain'(event, tpl) {
|
||||
tpl.domainId.set(event.currentTarget.value);
|
||||
tpl.load();
|
||||
},
|
||||
'submit .js-cloud-chat-send'(event, tpl) {
|
||||
event.preventDefault();
|
||||
const form = event.currentTarget;
|
||||
report(Meteor.callAsync('cloudPanelSendChat', tpl.domainId.get(), { text: form.elements.text.value })
|
||||
.then(() => { form.reset(); return tpl.load(); }));
|
||||
},
|
||||
'submit .js-cloud-chat-import'(event, tpl) {
|
||||
event.preventDefault();
|
||||
const form = event.currentTarget;
|
||||
const file = form.elements.file.files[0];
|
||||
if (!file) return;
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
const zipBase64 = String(reader.result).split(',')[1] || '';
|
||||
report(Meteor.callAsync('cloudPanelImportChat', tpl.domainId.get(), field(form, 'source'), { zipBase64 })
|
||||
.then(result => { tpl.imported.set(result.imported); form.reset(); return tpl.load(); }));
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
},
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------- Admin Panel
|
||||
|
||||
// Admin Panel / People / Cloud: the Cloud Panel Domain and its SuperAdmin.
|
||||
Template.cloudPanelSettings.onCreated(function () {
|
||||
this.settings = new ReactiveVar({ domain: '', superAdminUsername: '' });
|
||||
this.saved = new ReactiveVar(false);
|
||||
this.error = new ReactiveVar('');
|
||||
Meteor.callAsync('cloudPanelGetSettings').then(s => this.settings.set(s)).catch(e => this.error.set(errorText(e)));
|
||||
});
|
||||
|
||||
Template.cloudPanelSettings.helpers({
|
||||
settings: () => Template.instance().settings.get(),
|
||||
saved: () => Template.instance().saved.get(),
|
||||
error: () => Template.instance().error.get(),
|
||||
});
|
||||
|
||||
Template.cloudPanelSettings.events({
|
||||
'submit .js-cloud-panel-settings'(event, tpl) {
|
||||
event.preventDefault();
|
||||
const form = event.currentTarget;
|
||||
tpl.saved.set(false);
|
||||
Meteor.callAsync('cloudPanelSetSettings', { domain: field(form, 'domain'), superAdminUsername: field(form, 'superAdminUsername') })
|
||||
.then(s => { tpl.settings.set(s); tpl.saved.set(true); tpl.error.set(''); })
|
||||
.catch(e => tpl.error.set(errorText(e)));
|
||||
},
|
||||
});
|
||||
@@ -9,7 +9,7 @@
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
import { CSV_IMPORT_FIELDS, csvSeparatorOf, normalizeHeader } from '/models/lib/csvImportMapping';
|
||||
import { csvGetMembersToMap } from './csvMembersMapper';
|
||||
import { csvGetMembersToMap, csvMembersFromNames } from './csvMembersMapper';
|
||||
|
||||
const Papa = require('papaparse');
|
||||
|
||||
@@ -28,7 +28,7 @@ export function parseCsvImportText(text) {
|
||||
// `excelBase64` for a workbook (read on the server, which answers with the
|
||||
// first board sheet's header and the sheets it found). `membersStep`: the
|
||||
// "map members" step follows this one.
|
||||
export async function startCsvMapping(importTpl, { rows, excelBase64, membersStep = false }) {
|
||||
export async function startCsvMapping(importTpl, { rows, excelBase64, uploadId, membersStep = false }) {
|
||||
activeImportTpl = importTpl;
|
||||
if (!importTpl.csvMappingState) importTpl.csvMappingState = new ReactiveVar(null);
|
||||
importTpl.csvMapping = null;
|
||||
@@ -40,6 +40,9 @@ export async function startCsvMapping(importTpl, { rows, excelBase64, membersSte
|
||||
let preview;
|
||||
if (excelBase64) {
|
||||
preview = await Meteor.callAsync('excelImportPreview', excelBase64);
|
||||
} else if (uploadId) {
|
||||
// A file streamed to the server's disk (server/lib/importUpload.js).
|
||||
preview = await Meteor.callAsync('csvUploadPreview', uploadId);
|
||||
} else {
|
||||
const header = (rows && rows[0]) || [];
|
||||
preview = {
|
||||
@@ -52,7 +55,9 @@ export async function startCsvMapping(importTpl, { rows, excelBase64, membersSte
|
||||
}
|
||||
const mapping = {
|
||||
columns: { ...((preview.mapping && preview.mapping.columns) || {}) },
|
||||
customFieldColumns: [],
|
||||
// The guess ticks every column it has no field for, so nothing is left
|
||||
// behind unless the user unticks it.
|
||||
customFieldColumns: [...((preview.mapping && preview.mapping.customFieldColumns) || [])],
|
||||
listName: TAPi18n.__('scrum-category-todo'),
|
||||
};
|
||||
importTpl.csvMappingState.set({
|
||||
@@ -62,6 +67,7 @@ export async function startCsvMapping(importTpl, { rows, excelBase64, membersSte
|
||||
boards: preview.boards || [],
|
||||
skipped: preview.skipped || [],
|
||||
rows: rows || null,
|
||||
uploadId: uploadId || null,
|
||||
membersStep,
|
||||
mapping,
|
||||
});
|
||||
@@ -201,7 +207,15 @@ Template.importCsvMapping.events({
|
||||
...(chosen.columns.list === undefined ? { listName } : {}),
|
||||
};
|
||||
const state = tpl.state();
|
||||
// The people to map are the ones in the columns chosen for people.
|
||||
// The people to map are the ones in the columns chosen for people - read
|
||||
// by the server from an uploaded file.
|
||||
if (state.uploadId && state.membersStep) {
|
||||
Meteor.callAsync('csvUploadPeople', state.uploadId, chosen.columns).then(names => {
|
||||
importTpl.membersToMap.set(csvMembersFromNames(names || []));
|
||||
importTpl.nextStep();
|
||||
}, error => tpl.mappingError.set((error && error.error) || 'error-csv-schema'));
|
||||
return;
|
||||
}
|
||||
if (state.rows && state.membersStep) {
|
||||
importTpl.membersToMap.set(csvGetMembersToMap(state.rows, chosen.columns));
|
||||
}
|
||||
|
||||
@@ -1,54 +1,18 @@
|
||||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { splitByField, splitPeople } from '/models/lib/csvImportMapping';
|
||||
import { csvPeopleNames } from '/models/lib/csvPeople';
|
||||
|
||||
// The usernames to map. Without `columns`, the ones in a column named
|
||||
// "Members"; with the columns the mapping step chose, the ones in every
|
||||
// people column: owner, members, assignees, requested by and assigned by.
|
||||
export function csvGetMembersToMap(data, columns) {
|
||||
// we will work on the list itself (an ordered array of objects) when a
|
||||
// mapping is done, we add a 'wekan' field to the object representing the
|
||||
// imported member
|
||||
|
||||
const membersToMap = [];
|
||||
const importedMembers = [];
|
||||
const peopleColumns = [];
|
||||
|
||||
if (columns) {
|
||||
['owner', 'members', 'assignees'].forEach(field => {
|
||||
if (columns[field] !== undefined) peopleColumns.push({ index: columns[field], split: splitPeople });
|
||||
});
|
||||
['requestedBy', 'assignedBy'].forEach(field => {
|
||||
if (columns[field] !== undefined) peopleColumns.push({ index: columns[field], split: splitByField });
|
||||
});
|
||||
} else {
|
||||
for (let i = 0; i < data[0].length; i++) {
|
||||
if (String(data[0][i] || '').toLowerCase() === 'members') {
|
||||
peopleColumns.push({ index: i, split: cell => String(cell).split(' ') });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 1; i < data.length; i++) {
|
||||
for (const { index, split } of peopleColumns) {
|
||||
if (data[i][index]) {
|
||||
for (const importedMember of split(data[i][index])) {
|
||||
if (importedMember && importedMembers.indexOf(importedMember) === -1) {
|
||||
importedMembers.push(importedMember);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let importedMember of importedMembers) {
|
||||
importedMember = {
|
||||
username: importedMember,
|
||||
id: importedMember,
|
||||
};
|
||||
const wekanUser = ReactiveCache.getUser({ username: importedMember.username });
|
||||
if (wekanUser) importedMember.wekanId = wekanUser._id;
|
||||
membersToMap.push(importedMember);
|
||||
}
|
||||
|
||||
return membersToMap;
|
||||
// The people to map, each matched to a WeKan user of the same username when
|
||||
// there is one. `rows` are the file's rows, or `names` the usernames the
|
||||
// server read from an uploaded file (csvUploadPeople).
|
||||
export function csvMembersFromNames(names) {
|
||||
return names.map(username => {
|
||||
const member = { username, id: username };
|
||||
const wekanUser = ReactiveCache.getUser({ username });
|
||||
if (wekanUser) member.wekanId = wekanUser._id;
|
||||
return member;
|
||||
});
|
||||
}
|
||||
|
||||
export function csvGetMembersToMap(data, columns) {
|
||||
return csvMembersFromNames(csvPeopleNames(data, columns));
|
||||
}
|
||||
Vendored
+15
@@ -280,3 +280,18 @@ a.show-mapping {
|
||||
.import-report-row {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
/* The Import page's sources by kind (models/lib/toolGroups.js). */
|
||||
.import-source-list .import-source-group {
|
||||
margin-top: 0.8em;
|
||||
font-weight: bold;
|
||||
font-size: 0.85em;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
/* #505f79, not #6b778c: small bold text needs 4.5:1, and #6b778c on
|
||||
white is 4.48:1 - axe (45-axe-accessibility.e2e.js) failed it. */
|
||||
color: #505f79;
|
||||
}
|
||||
.import-source-list .import-source-group:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
@@ -39,6 +39,8 @@ template(name="import")
|
||||
h2 {{_ 'import-source-heading'}}
|
||||
ul.import-source-list
|
||||
each importSources
|
||||
if groupHeading
|
||||
li.import-source-group {{groupHeading}}
|
||||
li
|
||||
//- The same green tick every checkbox in the app uses
|
||||
(`.materialCheckBox`, forms.css) - the one Admin Panel /
|
||||
|
||||
@@ -3,7 +3,7 @@ import { trelloGetMembersToMap } from './trelloMembersMapper';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
import { wekanGetMembersToMap } from './wekanMembersMapper';
|
||||
import { csvGetMembersToMap } from './csvMembersMapper';
|
||||
import { jiraGetMembersToMap } from './jiraMembersMapper';
|
||||
import { jiraGetMembersToMap } from '/models/lib/jiraMembersMapper';
|
||||
import getSlug from 'limax';
|
||||
import { UserSearchIndex } from '/models/users';
|
||||
import { Utils } from '/client/lib/utils';
|
||||
@@ -49,6 +49,13 @@ function attachmentAuthData(importTpl) {
|
||||
return auth ? { attachmentAuth: auth } : {};
|
||||
}
|
||||
|
||||
// The file streamed to the server for this import (postImportUpload), by its
|
||||
// id; the preview of its people and the import itself both read it.
|
||||
function uploadData(importTpl) {
|
||||
return importTpl.upload && importTpl.upload.uploadId
|
||||
? { uploadId: importTpl.upload.uploadId, ...(importTpl.uploadExtras || {}) } : {};
|
||||
}
|
||||
|
||||
// Helper to find the closest ancestor template instance by name
|
||||
function findParentTemplateInstance(childTemplateInstance, parentTemplateName) {
|
||||
let view = childTemplateInstance.view;
|
||||
@@ -118,6 +125,33 @@ async function postTrelloImport(body, contentType) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// A chosen file of the generalized importer's sources, streamed to the server
|
||||
// a part at a time (server/routes/importUpload.js) rather than read here and
|
||||
// sent whole through the importBoard method: the server writes it to its disk,
|
||||
// checking the free space and the administrator's import limit, and importBoard
|
||||
// reads it by the id answered here. Returns { uploadId, size }.
|
||||
async function postImportUpload(source, file) {
|
||||
const token =
|
||||
(window.localStorage && window.localStorage.getItem('Meteor.loginToken')) || '';
|
||||
const resp = await fetch(`/api/import/upload/${encodeURIComponent(source)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
'Content-Type': 'application/octet-stream',
|
||||
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
||||
},
|
||||
body: file,
|
||||
});
|
||||
let result = {};
|
||||
try {
|
||||
result = await resp.json();
|
||||
} catch (e) {
|
||||
result = {};
|
||||
}
|
||||
if (!resp.ok || result.error || !result.uploadId) throw new Error(result.error || 'import-upload-failed');
|
||||
return result;
|
||||
}
|
||||
|
||||
// A WeKan .zip export (the document and its attachment files) imported as a
|
||||
// NEW board: posted as it is to /api/import/zip?newBoard=1 (models/importZip.js),
|
||||
// which opens it on the server under its limits. Returns the new board's id.
|
||||
@@ -313,7 +347,19 @@ Template.import.onCreated(function () {
|
||||
openOrReportImportedBoard(boardId, '');
|
||||
return;
|
||||
}
|
||||
if (file) {
|
||||
this.upload = null;
|
||||
this.uploadExtras = null;
|
||||
// Jira too: its people are read from the uploaded file by the server.
|
||||
if (file && (spec.creator === 'generalized' || dataSource === 'jira' || dataSource === 'csv')) {
|
||||
// Streamed to the server's disk, never read into this page whole.
|
||||
try {
|
||||
this.upload = await postImportUpload(dataSource, file);
|
||||
} catch (e) {
|
||||
this.setError((e && e.message) || 'import-upload-failed');
|
||||
return;
|
||||
}
|
||||
doc = {};
|
||||
} else if (file) {
|
||||
doc = documentForFile(dataSource, file.name || '', new Uint8Array(await file.arrayBuffer()));
|
||||
} else {
|
||||
const text = (this.find('.js-import-json') || {}).value || '';
|
||||
@@ -331,6 +377,13 @@ Template.import.onCreated(function () {
|
||||
// CSV/TSV and Excel: which column is which field comes first
|
||||
// (csvMapping.js), the people after it for CSV.
|
||||
if (dataSource === 'csv') {
|
||||
// An uploaded file: its header, rows and people are read on the server.
|
||||
if (this.upload) {
|
||||
this.importedData.set([]);
|
||||
this.membersToMap.set([]);
|
||||
await startCsvMapping(this, { uploadId: this.upload.uploadId, membersStep: !skipMapping });
|
||||
return;
|
||||
}
|
||||
if (!Array.isArray(doc) || !doc.length) {
|
||||
this.setError('error-csv-schema');
|
||||
return;
|
||||
@@ -356,6 +409,8 @@ Template.import.onCreated(function () {
|
||||
const estimateFieldId = this.find('.js-jira-estimate-field')?.value.trim();
|
||||
if (estimateFieldId) doc.wekanScrumMapping = { estimateFieldId,
|
||||
estimateUnit: this.find('.js-jira-estimate-unit')?.value.trim() };
|
||||
// An uploaded file is read on the server: the mapping goes with the call.
|
||||
if (this.upload && doc.wekanScrumMapping) this.uploadExtras = { wekanScrumMapping: doc.wekanScrumMapping };
|
||||
}
|
||||
// Trello: remember the target personal-workspace name for finishImport.
|
||||
this.workspaceName = '';
|
||||
@@ -373,6 +428,17 @@ Template.import.onCreated(function () {
|
||||
await this.mapPeopleOrImport(dataSource, skipMapping);
|
||||
return;
|
||||
}
|
||||
// An uploaded Jira file: its people from the server, read from the file.
|
||||
if (this.upload && dataSource === 'jira') {
|
||||
try {
|
||||
this.membersToMap.set(await Meteor.callAsync('importBoard', {}, { previewPeople: true, ...uploadData(this) }, 'jira', null));
|
||||
} catch (e) {
|
||||
this.setError((e && (e.reason || e.error)) || 'error-json-malformed');
|
||||
return;
|
||||
}
|
||||
await advance();
|
||||
return;
|
||||
}
|
||||
this.membersToMap.set(_prepareAdditionalData(doc));
|
||||
await advance();
|
||||
};
|
||||
@@ -393,7 +459,7 @@ Template.import.onCreated(function () {
|
||||
let people = [];
|
||||
try {
|
||||
people = await Meteor.callAsync('importBoard', pruneImportDocument(this.importedData.get(), selectedFields()),
|
||||
{ previewPeople: true, importFields: selectedFields() }, source, null);
|
||||
{ previewPeople: true, importFields: selectedFields(), ...uploadData(this) }, source, null);
|
||||
} catch (e) {
|
||||
this.setError((e && (e.reason || e.error)) || 'error-json-malformed');
|
||||
return;
|
||||
@@ -544,7 +610,10 @@ Template.import.onCreated(function () {
|
||||
this.membersToMap.set([]);
|
||||
let settled = false;
|
||||
const importDocument = pruneImportDocument(importedData, selectedFields());
|
||||
const timeoutMs = importDeadlineFor(parseInt(window.WEKAN_IMPORT_TIMEOUT_MS, 10) || 120000, importDocument);
|
||||
// An uploaded file is not in the document: its size gives it time, two
|
||||
// seconds a megabyte on top of the usual deadline.
|
||||
const uploadMs = this.upload ? Math.ceil((this.upload.size || 0) / (1024 * 1024)) * 2000 : 0;
|
||||
const timeoutMs = importDeadlineFor(parseInt(window.WEKAN_IMPORT_TIMEOUT_MS, 10) || 120000, importDocument) + uploadMs;
|
||||
const watchdog = Meteor.setTimeout(() => {
|
||||
if (settled) return;
|
||||
settled = true;
|
||||
@@ -560,7 +629,7 @@ Template.import.onCreated(function () {
|
||||
// The selection again, for the parts only a creator can leave out:
|
||||
// the Scrum planning external parsers find (models/kanboardCreator.js).
|
||||
{ membersMapping: mappingById, importFields: selectedFields(), membersMode: this.membersMode || 'map', ...csvMappingData(this),
|
||||
...attachmentAuthData(this),
|
||||
...attachmentAuthData(this), ...uploadData(this),
|
||||
...(splitByProject(this.importSource) ? { splitBy: 'swimlane' } : {}) },
|
||||
this.importSource,
|
||||
Session.get('fromBoard'),
|
||||
@@ -614,12 +683,21 @@ Template.import.helpers({
|
||||
const setting = ReactiveCache.getCurrentSetting();
|
||||
const product = productNameOrDefault(setting && setting.productName);
|
||||
const current = Session.get('importSource');
|
||||
return IMPORT_SOURCES.map(source => ({
|
||||
// Grouped by kind under headings (models/lib/toolGroups.js), the same
|
||||
// groups the Export menu uses; WeKan's own is headed by the product name,
|
||||
// and a company with several products by the company's name.
|
||||
const { groupTools } = require('/models/lib/toolGroups');
|
||||
return groupTools(IMPORT_SOURCES.map(source => ({
|
||||
key: source.key,
|
||||
// "a previous export of <Product name>", which for an unbranded WeKan is
|
||||
// "WeKan" and for a rebranded one is whatever it was rebranded to.
|
||||
name: source.product ? `${product} (JSON, .zip)` : source.name,
|
||||
selected: source.key === current,
|
||||
}))).map(source => ({
|
||||
...source,
|
||||
groupHeading: source.groupStart
|
||||
? (source.groupLabelKey ? TAPi18n.__(source.groupLabelKey) : source.groupLabel || product)
|
||||
: '',
|
||||
}));
|
||||
},
|
||||
hasImportSource() {
|
||||
@@ -713,6 +791,11 @@ Template.importTextarea.helpers({
|
||||
});
|
||||
}
|
||||
|
||||
// Sandstorm's apps share one instruction, naming the app (models/lib/importSources.js).
|
||||
const spec = importSourceSpec(importSource);
|
||||
if (spec && spec.instruction === 'sandstorm') {
|
||||
return TAPi18n.__('import-board-instruction-sandstorm', { app: spec.name.replace(/^Sandstorm /, '') });
|
||||
}
|
||||
return TAPi18n.__(`import-board-instruction-${importSource}`);
|
||||
},
|
||||
importPlaceHolder() {
|
||||
|
||||
@@ -4,7 +4,10 @@ export function trelloGetMembersToMap(data) {
|
||||
// we will work on the list itself (an ordered array of objects) when a
|
||||
// mapping is done, we add a 'wekan' field to the object representing the
|
||||
// imported member
|
||||
const membersToMap = data.members;
|
||||
// A Trello file may have no members (an export of a board nobody else is
|
||||
// on): there is then nobody to map, not an error. Without the fallback the
|
||||
// forEach below threw and the Import button silently did nothing.
|
||||
const membersToMap = Array.isArray(data.members) ? data.members : [];
|
||||
// auto-map based on username
|
||||
membersToMap.forEach(importedMember => {
|
||||
const wekanUser = ReactiveCache.getUser({ username: importedMember.username });
|
||||
|
||||
@@ -745,8 +745,7 @@ form.inlined-form .list-composer {
|
||||
display: flex;
|
||||
/* #5439: always show a scrollbar on the list body across desktop and mobile
|
||||
browsers (overlay scrollbars on macOS/iOS/Android/Firefox otherwise auto-
|
||||
hide it). Keep these declarations in sync with models/lib/scrollbarCss.js
|
||||
(alwaysVisibleScrollbarCss), which is unit tested. */
|
||||
hide it). tests/scrollbarCss.test.cjs reads these rules. */
|
||||
overflow-y: scroll;
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: rgba(0, 0, 0, 0.35) rgba(0, 0, 0, 0.08);
|
||||
|
||||
@@ -7,6 +7,7 @@ import { dueFromTitle, resetDueFromTitle } from '/client/components/forms/titleD
|
||||
import '/client/components/cards/similarCards';
|
||||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
import { displayDefaultTitle } from '/imports/lib/defaultTitle';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
import { getSpinnerName, getSpinnerTemplate } from '/client/lib/spinner';
|
||||
import getSlug from 'limax';
|
||||
@@ -665,6 +666,10 @@ Template.listBody.helpers({
|
||||
// just this list/swimlane window (grows with `limit` as the user scrolls)
|
||||
// plus its reactive total count. Default mode keeps everything in minimongo
|
||||
// already, so these subscriptions are skipped.
|
||||
// #6927: the board's archived swimlane ids, so the first swimlane does not
|
||||
// take their cards as orphans (models/lib/archivedSwimlaneIds.js). One
|
||||
// tiny document per board; identical subscriptions are shared.
|
||||
if (list.boardId) tpl.subscribe('boardArchivedSwimlaneIds', list.boardId);
|
||||
if (list.boardId && isLazyCards(list.boardId)) {
|
||||
tpl.subscribe('boardCardsWindow', list.boardId, mongoSelector, sortBy, limit);
|
||||
tpl.subscribe(
|
||||
@@ -1315,26 +1320,7 @@ Template.linkCardPopup.helpers({
|
||||
},
|
||||
|
||||
isTitleDefault(title) {
|
||||
// https://github.com/wekan/wekan/issues/4763
|
||||
// https://github.com/wekan/wekan/issues/4742
|
||||
// Translation text for "default" does not work, it returns an object.
|
||||
// When that happens, try use translation "defaultdefault" that has same content of default, or return text "Default".
|
||||
// This can happen, if swimlane does not have name.
|
||||
// Yes, this is fixing the symptom (Swimlane title does not have title)
|
||||
// instead of fixing the problem (Add Swimlane title when creating swimlane)
|
||||
// because there could be thousands of swimlanes, adding name Default to all of them
|
||||
// would be very slow.
|
||||
if (title.startsWith("key 'default") && title.endsWith('returned an object instead of string.')) {
|
||||
if (`${TAPi18n.__('defaultdefault')}`.startsWith("key 'default") && `${TAPi18n.__('defaultdefault')}`.endsWith('returned an object instead of string.')) {
|
||||
return 'Default';
|
||||
} else {
|
||||
return `${TAPi18n.__('defaultdefault')}`;
|
||||
}
|
||||
} else if (title === 'Default') {
|
||||
return `${TAPi18n.__('defaultdefault')}`;
|
||||
} else {
|
||||
return title;
|
||||
}
|
||||
return displayDefaultTitle(title, key => TAPi18n.__(key));
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/* The Kanban flow policies of the lists (docs/Features/Lists/Flow-Policies.md). */
|
||||
.list-policy-mark,
|
||||
.list-commitment-mark {
|
||||
display: inline-block;
|
||||
margin-inline-start: 4px;
|
||||
opacity: 0.75;
|
||||
}
|
||||
.list-policy-mark {
|
||||
cursor: pointer;
|
||||
}
|
||||
.list-commitment-mark {
|
||||
color: #27ae60;
|
||||
}
|
||||
.list-policy-popup textarea {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.list-policy-popup .list-policy-text {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.board-flow-list-settings .board-flow-setting {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.board-flow-list-settings .board-flow-setting input,
|
||||
.board-flow-list-settings .board-flow-setting select {
|
||||
max-width: 50%;
|
||||
}
|
||||
.card-person-wip-over {
|
||||
color: #c0392b;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
/* Split Doing / Done lists. */
|
||||
.list-split-counts {
|
||||
display: inline-block;
|
||||
margin-inline-start: 4px;
|
||||
font-size: 0.85em;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.minicard-split-toggle {
|
||||
float: inline-end;
|
||||
margin-inline-start: 4px;
|
||||
cursor: pointer;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.minicard-split-toggle.is-done {
|
||||
color: #27ae60;
|
||||
opacity: 1;
|
||||
}
|
||||
.minicard.minicard-split-done {
|
||||
opacity: 0.6;
|
||||
border-inline-start: 3px solid #27ae60;
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
//- The Kanban flow policies of the lists (models/lib/boardFlowPolicies.js,
|
||||
docs/Features/Lists/Flow-Policies.md). Each is shown only when Admin Panel /
|
||||
Features offers it; a board admin changes them, others see them disabled.
|
||||
template(name="boardFlowListSettings")
|
||||
form.board-flow-list-settings
|
||||
if allowFeature 'list-policies'
|
||||
div.check-div
|
||||
a.flex.js-toggle-list-policies(class="{{#if allowsListPolicies}}is-checked{{/if}}" title="{{_ 'show-list-policies'}}")
|
||||
i.fa(class="{{#if allowsListPolicies}}fa-check{{else}}fa-square-o{{/if}}")
|
||||
span
|
||||
i.fa.fa-gavel
|
||||
| {{_ 'show-list-policies'}}
|
||||
if allowFeature 'split-lists'
|
||||
div.check-div
|
||||
a.flex.js-toggle-split-lists(class="{{#if allowsSplitLists}}is-checked{{/if}}" title="{{_ 'show-split-lists'}}")
|
||||
i.fa(class="{{#if allowsSplitLists}}fa-check{{else}}fa-square-o{{/if}}")
|
||||
span
|
||||
i.fa.fa-columns
|
||||
| {{_ 'show-split-lists'}}
|
||||
if allowFeature 'commitment-point'
|
||||
label.board-flow-setting
|
||||
span
|
||||
i.fa.fa-flag-checkered
|
||||
| {{_ 'commitment-point'}}
|
||||
select.js-commitment-list(disabled=notBoardAdmin)
|
||||
each option in commitmentOptions
|
||||
option(value=option.value selected=option.selected) {{option.title}}
|
||||
p.quiet {{_ 'commitment-point-hint'}}
|
||||
if allowFeature 'person-wip-limit'
|
||||
label.board-flow-setting
|
||||
span
|
||||
i.fa.fa-user-times
|
||||
| {{_ 'person-wip-limit'}}
|
||||
input.js-person-wip-limit(type="number" min="1" max="99" value=personWipLimit disabled=notBoardAdmin)
|
||||
|
||||
//- At the list header: the policy as an icon whose tooltip is the text, and the
|
||||
commitment point's flag.
|
||||
template(name="listFlowMarks")
|
||||
if showPolicy
|
||||
a.list-policy-mark.js-open-list-policy(title=policy aria-label="{{_ 'list-policy'}}")
|
||||
i.fa.fa-gavel
|
||||
if splitCounts
|
||||
span.list-split-counts(title="{{_ 'list-split'}}") {{_ 'split-counts' doing=splitCounts.doing done=splitCounts.done}}
|
||||
if isCommitmentPoint
|
||||
span.list-commitment-mark(title="{{_ 'commitment-point'}}: {{_ 'commitment-point-hint'}}" aria-label="{{_ 'commitment-point'}}")
|
||||
i.fa.fa-flag-checkered
|
||||
|
||||
template(name="listPolicyPopup")
|
||||
.list-policy-popup
|
||||
if canEdit
|
||||
form.js-list-policy-form
|
||||
textarea.js-list-policy-text(rows="6" maxlength="2000" placeholder="{{_ 'list-policy-placeholder'}}")= policy
|
||||
input.primary(type="submit" value="{{_ 'save'}}")
|
||||
else
|
||||
if policy
|
||||
p.list-policy-text= policy
|
||||
else
|
||||
p.quiet {{_ 'list-policy-placeholder'}}
|
||||
|
||||
//- In the opened card's Members section: each of its people over the board's
|
||||
WIP limit per person.
|
||||
template(name="cardPersonWipWarnings")
|
||||
each warning in warnings
|
||||
.card-person-wip-over.js-card-person-wip-over
|
||||
i.fa.fa-user-times
|
||||
| {{_ 'person-wip-over' user=warning.name count=warning.count limit=warning.limit}}
|
||||
|
||||
//- On a minicard of a split list: whether it is Done here, and the toggle for
|
||||
whoever may change the card.
|
||||
template(name="minicardSplitDone")
|
||||
if inSplitList
|
||||
if canModifyCard
|
||||
a.minicard-split-toggle.js-minicard-split-done(class="{{#if splitDone}}is-done{{/if}}" title="{{#if splitDone}}{{_ 'split-done'}}{{else}}{{_ 'mark-split-done'}}{{/if}}" aria-pressed="{{#if splitDone}}true{{else}}false{{/if}}")
|
||||
i.fa(class="{{#if splitDone}}fa-check-circle{{else}}fa-circle-o{{/if}}")
|
||||
else
|
||||
if splitDone
|
||||
span.minicard-split-toggle.is-done(title="{{_ 'split-done'}}")
|
||||
i.fa.fa-check-circle
|
||||
@@ -0,0 +1,134 @@
|
||||
// The Kanban flow policies of the lists (models/lib/boardFlowPolicies.js,
|
||||
// docs/Features/Lists/Flow-Policies.md): Board Settings / List, the marks at
|
||||
// a list's header, the list's policy popup and the opened card's warning.
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Template } from 'meteor/templating';
|
||||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { allowFeature } from '/client/lib/instanceFeatures';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
import { Utils } from '/client/lib/utils';
|
||||
import Lists from '/models/lists';
|
||||
|
||||
const { normalizePolicy, overPersonWip, isSplitDone, splitCounts } = require('/models/lib/boardFlowPolicies');
|
||||
|
||||
// Whether a list of `board` is drawn split into Doing and Done.
|
||||
const splitShown = (board, list) => Boolean(board?.allowsSplitLists === true && list?.split === true && allowFeature('split-lists'));
|
||||
export { splitShown };
|
||||
|
||||
const board = () => Utils.getCurrentBoard();
|
||||
const isBoardAdmin = () => Boolean(ReactiveCache.getCurrentUser()?.isBoardAdmin?.());
|
||||
|
||||
Template.boardFlowListSettings.helpers({
|
||||
allowsListPolicies() { return board()?.allowsListPolicies === true; },
|
||||
allowsSplitLists() { return board()?.allowsSplitLists === true; },
|
||||
notBoardAdmin() { return !isBoardAdmin(); },
|
||||
personWipLimit() { return board()?.personWipLimit || ''; },
|
||||
commitmentOptions() {
|
||||
const current = board();
|
||||
if (!current) return [];
|
||||
const lists = ReactiveCache.getLists({ boardId: current._id, archived: false }, { sort: { sort: 1 } }) || [];
|
||||
const chosen = current.commitmentListId || '';
|
||||
return [{ value: '', title: '-', selected: !chosen },
|
||||
...lists.map(list => ({ value: list._id, title: list.title, selected: list._id === chosen }))];
|
||||
},
|
||||
});
|
||||
|
||||
Template.boardFlowListSettings.events({
|
||||
'click .js-toggle-list-policies'(event) {
|
||||
event.preventDefault();
|
||||
const current = board();
|
||||
if (current && isBoardAdmin()) current.setAllowsListPolicies(current.allowsListPolicies !== true);
|
||||
},
|
||||
'click .js-toggle-split-lists'(event) {
|
||||
event.preventDefault();
|
||||
const current = board();
|
||||
if (current && isBoardAdmin()) current.setAllowsSplitLists(current.allowsSplitLists !== true);
|
||||
},
|
||||
'change .js-commitment-list'(event) {
|
||||
const current = board();
|
||||
if (current && isBoardAdmin()) current.setCommitmentListId(event.currentTarget.value);
|
||||
},
|
||||
'change .js-person-wip-limit'(event) {
|
||||
const current = board();
|
||||
if (!current || !isBoardAdmin()) return;
|
||||
current.setPersonWipLimit(event.currentTarget.value.trim()).catch(() => {
|
||||
window.alert(TAPi18n.__('person-wip-limit'));
|
||||
});
|
||||
},
|
||||
'submit .board-flow-list-settings'(event) { event.preventDefault(); },
|
||||
});
|
||||
|
||||
// The list header's marks; the data context is the list.
|
||||
Template.listFlowMarks.helpers({
|
||||
showPolicy() {
|
||||
const current = ReactiveCache.getBoard(this.boardId);
|
||||
return Boolean(current?.allowsListPolicies === true && this.policy && allowFeature('list-policies'));
|
||||
},
|
||||
splitCounts() {
|
||||
const current = ReactiveCache.getBoard(this.boardId);
|
||||
if (!splitShown(current, this)) return null;
|
||||
return splitCounts(ReactiveCache.getCards({ listId: this._id, archived: false }, { fields: { listId: 1, flow: 1, archived: 1 } }) || []);
|
||||
},
|
||||
isCommitmentPoint() {
|
||||
const current = ReactiveCache.getBoard(this.boardId);
|
||||
return Boolean(current?.commitmentListId && current.commitmentListId === this._id && allowFeature('commitment-point'));
|
||||
},
|
||||
});
|
||||
Template.listFlowMarks.events({
|
||||
'click .js-open-list-policy': Popup.open('listPolicy'),
|
||||
});
|
||||
|
||||
Template.listPolicyPopup.helpers({
|
||||
// Whoever may write to the list's board (models/lib/boardRoleCapabilities.js),
|
||||
// the same as the server's Lists allow rule.
|
||||
canEdit() {
|
||||
return Utils.currentUserCan('write', ReactiveCache.getBoard(this.boardId));
|
||||
},
|
||||
});
|
||||
Template.listPolicyPopup.events({
|
||||
async 'submit .js-list-policy-form'(event, tpl) {
|
||||
event.preventDefault();
|
||||
let policy;
|
||||
try {
|
||||
policy = normalizePolicy(tpl.find('.js-list-policy-text').value);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
const modifier = policy ? { $set: { policy } } : { $unset: { policy: '' } };
|
||||
await Lists.updateAsync(this._id, modifier);
|
||||
Popup.back();
|
||||
},
|
||||
});
|
||||
|
||||
// The opened card's people over the WIP limit per person; the data is the card.
|
||||
Template.cardPersonWipWarnings.helpers({
|
||||
warnings() {
|
||||
const card = this.card;
|
||||
const current = card && ReactiveCache.getBoard(card.boardId);
|
||||
if (!current || !current.personWipLimit || !allowFeature('person-wip-limit')) return [];
|
||||
const cards = ReactiveCache.getCards({ boardId: card.boardId, archived: false },
|
||||
{ fields: { assignees: 1, members: 1, dueComplete: 1, archived: 1, type: 1 } }) || [];
|
||||
return overPersonWip(card, cards, current.personWipLimit).map(row => {
|
||||
const user = ReactiveCache.getUser(row.userId);
|
||||
return { ...row, name: (user && (user.profile?.fullname || user.username)) || row.userId };
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
// The minicard's Done here toggle; the data is the card.
|
||||
Template.minicardSplitDone.helpers({
|
||||
inSplitList() {
|
||||
const card = this;
|
||||
return splitShown(ReactiveCache.getBoard(card.boardId), ReactiveCache.getList(card.listId));
|
||||
},
|
||||
splitDone() { return isSplitDone(this); },
|
||||
canModifyCard() { return Utils.canModifyCard(this); },
|
||||
});
|
||||
Template.minicardSplitDone.events({
|
||||
'click .js-minicard-split-done'(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
Meteor.callAsync('setCardFlow', this._id, { splitDone: !isSplitDone(this) })
|
||||
.catch(error => window.alert((error && (error.reason || error.error)) || String(error)));
|
||||
},
|
||||
});
|
||||
@@ -35,6 +35,7 @@ template(name="listHeader")
|
||||
| (
|
||||
span(class="{{#if exceededWipLimit}}highlight{{/if}}") {{cardsCountWhole}}
|
||||
|/#{wipLimit.value})
|
||||
+listFlowMarks
|
||||
if showCardsCountForList cardsCountWhole
|
||||
span.cardCount {{cardsCount containerSwimlaneId}} {{cardsCountForListIsOne cardsCountWhole}}
|
||||
if hasNumberFieldsSum
|
||||
@@ -88,6 +89,8 @@ template(name="listHeader")
|
||||
span(class="{{#if exceededWipLimit}}highlight{{/if}}") {{cardsCountWhole}}
|
||||
|/#{wipLimit.value})
|
||||
unless collapsed
|
||||
//- List policy and commitment point (listFlowPolicies.jade).
|
||||
+listFlowMarks
|
||||
if showCardsCountForList cardsCountWhole
|
||||
span.cardCount {{cardsCount containerSwimlaneId}} {{cardsCountForListIsOne cardsCountWhole}}
|
||||
if hasNumberFieldsSum
|
||||
@@ -165,9 +168,13 @@ template(name="editListTitleForm")
|
||||
i.fa.fa-times-thin
|
||||
|
||||
template(name="listActionPopup")
|
||||
//- Grouped under headings by what the entries act on (2026-11-20); every
|
||||
entry keeps its own condition, and a heading sits inside the same condition
|
||||
as its group.
|
||||
//- Copy link, FIRST and above every permission check - see the swimlane
|
||||
popup: copying an address is reading, not editing.
|
||||
models/lib/boardItemUrl.js, docs/Features/General/Board-Item-Links.md
|
||||
h4.menu-group-heading {{_ 'menu-group-share'}}
|
||||
ul.pop-over-list
|
||||
li: a.js-copy-list-link
|
||||
i.fa.fa-link
|
||||
@@ -196,6 +203,7 @@ template(name="listActionPopup")
|
||||
Import WRITES, so it is offered only to somebody who may change the board;
|
||||
`canImportIntoBoard` is the same question the popup itself asks
|
||||
(client/components/boards/exportScope.js).
|
||||
h4.menu-group-heading {{_ 'menu-group-export'}}
|
||||
ul.pop-over-list
|
||||
li: a.js-export-list
|
||||
i.fa.fa-upload
|
||||
@@ -207,6 +215,7 @@ template(name="listActionPopup")
|
||||
hr
|
||||
unless currentUser.isReadOnly
|
||||
unless currentUser.isReadAssignedOnly
|
||||
h4.menu-group-heading {{_ 'add'}}
|
||||
ul.pop-over-list
|
||||
li
|
||||
a.js-add-card.list-header-plus-top
|
||||
@@ -229,6 +238,7 @@ template(name="listActionPopup")
|
||||
the fixed-width value it used to set is now a board-wide admin toggle
|
||||
there too - a menu entry for the same thing was a second place to look
|
||||
for it. client/components/sidebar/sidebar.jade
|
||||
h4.menu-group-heading {{_ 'watch'}}
|
||||
ul.pop-over-list
|
||||
li
|
||||
a.js-toggle-watch-list
|
||||
@@ -241,6 +251,7 @@ template(name="listActionPopup")
|
||||
unless currentUser.isCommentOnly
|
||||
unless currentUser.isReadOnly
|
||||
unless currentUser.isReadAssignedOnly
|
||||
h4.menu-group-heading {{_ 'edit'}}
|
||||
unless currentUser.isWorker
|
||||
ul.pop-over-list
|
||||
li
|
||||
@@ -253,10 +264,12 @@ template(name="listActionPopup")
|
||||
a.js-select-cards
|
||||
i.fa.fa-select-square
|
||||
| {{_ 'list-select-cards'}}
|
||||
li
|
||||
a.js-archive-list-cards
|
||||
i.fa.fa-archive
|
||||
| {{_ 'list-archive-cards'}}
|
||||
if mayWriteList
|
||||
li
|
||||
a.js-archive-list-cards
|
||||
i.fa.fa-archive
|
||||
| {{_ 'list-archive-cards'}}
|
||||
h4.menu-group-heading {{_ 'settings'}}
|
||||
if currentUser.isBoardAdmin
|
||||
ul.pop-over-list
|
||||
li
|
||||
@@ -267,6 +280,22 @@ template(name="listActionPopup")
|
||||
a.js-list-permissions
|
||||
i.fa.fa-lock
|
||||
| {{_ 'listPermissionsPopup-title'}}
|
||||
//- The list's policy, when the board shows list policies
|
||||
(listFlowPolicies.jade); every member who may edit the list.
|
||||
if showsListPolicies
|
||||
ul.pop-over-list
|
||||
li
|
||||
a.js-list-policy
|
||||
i.fa.fa-gavel
|
||||
| {{_ 'list-policy'}}
|
||||
//- Split into Doing and Done (listFlowPolicies.jade), when the board
|
||||
allows split lists.
|
||||
if showsSplitLists
|
||||
ul.pop-over-list
|
||||
li
|
||||
a.js-toggle-list-split
|
||||
i.fa(class="{{#if split}}fa-check-square-o{{else}}fa-square-o{{/if}}")
|
||||
| {{_ 'list-split'}}
|
||||
//- #3847: board-wide toggle, exposed here per the maintainer's
|
||||
instruction to reach it from the List hamburger menu. See
|
||||
models/boards.js's stickyListHeaders and list.css's use of the
|
||||
@@ -289,6 +318,7 @@ template(name="listActionPopup")
|
||||
|
|
||||
i.fa.fa-check-circle(class="{{#if syncSource.enabled}}list-sync-active{{else}}list-sync-paused{{/if}}")
|
||||
hr
|
||||
h4.menu-group-heading {{_ 'menu-group-move-copy'}}
|
||||
ul.pop-over-list
|
||||
unless currentUser.isWorker
|
||||
li
|
||||
@@ -301,13 +331,15 @@ template(name="listActionPopup")
|
||||
i.fa.fa-arrow-right
|
||||
| {{_ 'moveListPopup-title'}}
|
||||
unless currentUser.isWorker
|
||||
hr
|
||||
ul.pop-over-list
|
||||
li
|
||||
a.js-close-list
|
||||
i.fa.fa-arrow-right
|
||||
i.fa.fa-archive
|
||||
| {{_ 'archive-list'}}
|
||||
if mayWriteList
|
||||
hr
|
||||
h4.menu-group-heading {{_ 'archives'}}
|
||||
ul.pop-over-list
|
||||
li
|
||||
a.js-close-list
|
||||
i.fa.fa-arrow-right
|
||||
i.fa.fa-archive
|
||||
| {{_ 'archive-list'}}
|
||||
hr
|
||||
ul.pop-over-list
|
||||
li
|
||||
@@ -610,15 +642,15 @@ template(name="listDestinationPicker")
|
||||
label {{_ 'boards'}}:
|
||||
select.js-select-boards
|
||||
each boards
|
||||
option(value="{{_id}}" selected="{{#if isDialogOptionBoardId _id}}selected{{/if}}") {{add @index 1}}. {{title}}
|
||||
option(value="{{_id}}" selected="{{#if isDialogOptionBoardId _id}}selected{{/if}}") {{title}}
|
||||
label {{_ 'swimlanes'}}:
|
||||
select.js-select-swimlanes
|
||||
each swimlanes
|
||||
option(value="{{_id}}" selected="{{#if isDialogOptionSwimlaneId _id}}selected{{/if}}") {{add @index 1}}. {{isTitleDefault title}}
|
||||
option(value="{{_id}}" selected="{{#if isDialogOptionSwimlaneId _id}}selected{{/if}}") {{isTitleDefault title}}
|
||||
label {{_ 'lists'}}:
|
||||
select.js-select-lists
|
||||
each lists
|
||||
option(value="{{_id}}" selected="{{#if isDialogOptionListId _id}}selected{{/if}}") {{add @index 1}}. {{title}}
|
||||
option(value="{{_id}}" selected="{{#if isDialogOptionListId _id}}selected{{/if}}") {{title}}
|
||||
div
|
||||
input(type="radio" name="list-position" value="left" checked id="list-position-left" style="display: inline")
|
||||
label(for="list-position-left") {{_ 'left-of-list'}}
|
||||
@@ -647,13 +679,13 @@ template(name="addListPopup")
|
||||
label {{_ 'add-after-list'}}
|
||||
select.list-position-input.full-line
|
||||
each swimlaneLists
|
||||
option(value="{{_id}}" selected="{{$eq _id currentListIdValue}}") {{increment @index}} {{title}}
|
||||
option(value="{{_id}}" selected="{{$eq _id currentListIdValue}}") {{title}}
|
||||
else
|
||||
if currentBoard.lists.length
|
||||
label {{_ 'add-after-list'}}
|
||||
select.list-position-input.full-line
|
||||
each currentBoard.lists
|
||||
option(value="{{_id}}" selected="{{$eq _id currentListIdValue}}") {{increment @index}} {{title}}
|
||||
option(value="{{_id}}" selected="{{$eq _id currentListIdValue}}") {{title}}
|
||||
.edit-controls.clearfix
|
||||
button.primary.confirm.js-submit-add-list(type="submit") {{_ 'save'}}
|
||||
unless currentBoard.isTemplatesBoard
|
||||
|
||||
@@ -11,6 +11,7 @@ import { LIST_COLORS } from '/models/metadata/colors';
|
||||
import { isHexColor, toHex } from '/models/lib/contrastColor';
|
||||
import { MultiSelection } from '/client/lib/multiSelection';
|
||||
import { Utils } from '/client/lib/utils';
|
||||
import { listCan } from '/models/lib/listPermissions';
|
||||
import { lazyListCardCount } from '/client/lib/lazyCards';
|
||||
import { currentUserWith } from '/client/lib/currentUserWith';
|
||||
import {
|
||||
@@ -451,10 +452,30 @@ Template.listHeader.events({
|
||||
});
|
||||
|
||||
Template.listActionPopup.helpers({
|
||||
showsSplitLists() {
|
||||
const board = ReactiveCache.getBoard(this.boardId);
|
||||
return board?.allowsSplitLists === true
|
||||
&& require('/client/lib/instanceFeatures').allowFeature('split-lists');
|
||||
},
|
||||
showsListPolicies() {
|
||||
const board = ReactiveCache.getBoard(this.boardId);
|
||||
return board?.allowsListPolicies === true
|
||||
&& require('/client/lib/instanceFeatures').allowFeature('list-policies');
|
||||
},
|
||||
isBoardAdmin() {
|
||||
return ReactiveCache.getCurrentUser()?.isBoardAdmin();
|
||||
},
|
||||
|
||||
// Decided 2026-11-18 (TODO.md): a list that refuses the viewer's role a
|
||||
// write (#4527) also refuses archiving it and archiving its cards, so the
|
||||
// menu does not offer them (server/listPermissions.js refuses them anyway).
|
||||
mayWriteList() {
|
||||
const list = Template.currentData();
|
||||
if (!list || !list.roleExceptions) return true;
|
||||
const board = ReactiveCache.getBoard(list.boardId);
|
||||
return !!(board && listCan(board, list, Meteor.userId(), 'write'));
|
||||
},
|
||||
|
||||
isWipLimitEnabled() {
|
||||
return Template.currentData().getWipLimit('enabled');
|
||||
},
|
||||
@@ -600,6 +621,11 @@ Template.listActionPopup.events({
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-set-wip-limit': Popup.open('setWipLimit'),
|
||||
'click .js-list-policy': Popup.open('listPolicy'),
|
||||
async 'click .js-toggle-list-split'(event) {
|
||||
event.preventDefault();
|
||||
await Lists.updateAsync(this._id, this.split === true ? { $unset: { split: '' } } : { $set: { split: true } });
|
||||
},
|
||||
'click .js-list-permissions': Popup.open('listPermissions'),
|
||||
'click .js-copy-list': Popup.open('copyList'),
|
||||
'click .js-move-list': Popup.open('moveList'),
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
/* Budget and billing page (docs/Features/Billing/Billing.md). */
|
||||
.billing-page {
|
||||
padding: 1rem;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.billing-intro {
|
||||
max-width: 70ch;
|
||||
opacity: 0.85;
|
||||
}
|
||||
.billing-boards,
|
||||
.billing-invoice-table,
|
||||
.billing-print-lines {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
margin: 0.5rem 0 1rem;
|
||||
}
|
||||
.billing-boards th,
|
||||
.billing-boards td,
|
||||
.billing-invoice-table th,
|
||||
.billing-invoice-table td,
|
||||
.billing-print-lines th,
|
||||
.billing-print-lines td {
|
||||
border: 1px solid rgba(0, 0, 0, 0.12);
|
||||
padding: 0.35rem 0.5rem;
|
||||
text-align: start;
|
||||
vertical-align: top;
|
||||
}
|
||||
.billing-boards a {
|
||||
cursor: pointer;
|
||||
}
|
||||
.billing-board-row.is-selected {
|
||||
background: rgba(0, 121, 191, 0.08);
|
||||
}
|
||||
.billing-board-row.is-over,
|
||||
.billing-over {
|
||||
color: #c62828;
|
||||
}
|
||||
.billing-bar {
|
||||
height: 0.5rem;
|
||||
background: rgba(0, 0, 0, 0.08);
|
||||
border-radius: 3px;
|
||||
overflow: hidden;
|
||||
margin-bottom: 0.2rem;
|
||||
max-width: 12rem;
|
||||
}
|
||||
.billing-bar-fill {
|
||||
height: 100%;
|
||||
background: #3cb500;
|
||||
}
|
||||
.billing-board-row.is-over .billing-bar-fill {
|
||||
background: #e53935;
|
||||
}
|
||||
.billing-summary dl,
|
||||
.billing-print-meta dl {
|
||||
display: grid;
|
||||
grid-template-columns: max-content 1fr;
|
||||
gap: 0.2rem 1rem;
|
||||
}
|
||||
.billing-summary dt,
|
||||
.billing-print-meta dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
.billing-summary dd,
|
||||
.billing-print-meta dd {
|
||||
margin: 0;
|
||||
}
|
||||
.billing-sections {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
|
||||
gap: 1rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.billing-section {
|
||||
border: 1px solid rgba(0, 0, 0, 0.12);
|
||||
border-radius: 4px;
|
||||
padding: 0.75rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.billing-sections .billing-section {
|
||||
margin-top: 0;
|
||||
}
|
||||
.billing-section h3 {
|
||||
margin-top: 0;
|
||||
}
|
||||
.billing-section label {
|
||||
display: block;
|
||||
margin-top: 0.4rem;
|
||||
}
|
||||
.billing-list {
|
||||
padding-inline-start: 1.2rem;
|
||||
}
|
||||
.billing-list a {
|
||||
margin-inline-start: 0.5rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
.billing-invoice-table-wrapper,
|
||||
.billing-invoices {
|
||||
overflow-x: auto;
|
||||
}
|
||||
.billing-invoice-actions button {
|
||||
margin: 0 0.25rem 0.25rem 0;
|
||||
}
|
||||
.billing-status-void td {
|
||||
opacity: 0.55;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.billing-status-paid td:nth-child(6) {
|
||||
color: #2e7d32;
|
||||
font-weight: bold;
|
||||
}
|
||||
.billing-print {
|
||||
margin-top: 1rem;
|
||||
padding: 1rem;
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
.billing-print-customer {
|
||||
white-space: pre-wrap;
|
||||
font-family: inherit;
|
||||
}
|
||||
.billing-print-lines tfoot th {
|
||||
border-top: 2px solid #000;
|
||||
}
|
||||
/* Printing: only the invoice. */
|
||||
@media print {
|
||||
body * {
|
||||
visibility: hidden;
|
||||
}
|
||||
.billing-print,
|
||||
.billing-print * {
|
||||
visibility: visible;
|
||||
}
|
||||
.billing-print {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border: none;
|
||||
}
|
||||
.billing-print button {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 800px) {
|
||||
.billing-page { padding: 0.5rem; }
|
||||
}
|
||||
|
||||
/* Expenses, fees, time to approve and quotes (docs/Features/Billing/Billing.md). */
|
||||
.billing-hint {
|
||||
color: #555;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.billing-list li.is-invoiced {
|
||||
color: #555;
|
||||
}
|
||||
.billing-draft-lines li.billing-line-fee,
|
||||
.billing-draft-lines li.billing-line-expense {
|
||||
font-style: italic;
|
||||
}
|
||||
.billing-quote-accepted td:first-child {
|
||||
font-weight: bold;
|
||||
}
|
||||
.billing-quote-declined {
|
||||
color: #777;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.time-entry-approved {
|
||||
color: #2e7d32;
|
||||
margin-inline-start: 0.3em;
|
||||
}
|
||||
.time-entry-rejected {
|
||||
color: #b71c1c;
|
||||
margin-inline-start: 0.3em;
|
||||
}
|
||||
|
||||
/* Labelled native checkboxes: the app-wide material form rule
|
||||
(client/components/forms/forms.css) hides native checkboxes three ways -
|
||||
display, visibility, an offset - which left these with a label and no box
|
||||
to tick or see ticked. All three are undone, as in cardFlow.css. */
|
||||
.billing-page input[type="checkbox"] {
|
||||
display: inline-block;
|
||||
visibility: visible;
|
||||
position: static;
|
||||
inset-inline-start: auto;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
min-height: 0;
|
||||
margin: 0;
|
||||
margin-inline-end: 4px;
|
||||
flex: none;
|
||||
}
|
||||
@@ -0,0 +1,632 @@
|
||||
//- Budget and billing (docs/Features/Billing/Billing.md): the boards the user
|
||||
is an admin of, each with its budget, what its work has cost and will cost,
|
||||
the hourly rates, who invoices and how it is paid, and the invoices of the
|
||||
time spent. The numbers come from the server (server/billing.js,
|
||||
models/lib/billing.js); this page draws them.
|
||||
|
||||
template(name="billing")
|
||||
if currentUser
|
||||
.billing-page
|
||||
h1 {{_ 'billing-title'}}
|
||||
p.billing-intro {{_ 'billing-intro'}}
|
||||
if loading
|
||||
+spinner
|
||||
else if error
|
||||
.warning {{error}}
|
||||
else
|
||||
if isAdmin
|
||||
label.billing-all-boards
|
||||
input.js-billing-all-boards(type="checkbox" checked=allBoards)
|
||||
| {{_ 'workload-all-boards'}}
|
||||
if boards.length
|
||||
.billing-table-wrapper
|
||||
table.billing-boards
|
||||
thead
|
||||
tr
|
||||
th {{_ 'board'}}
|
||||
th {{_ 'billing-budget'}}
|
||||
th {{_ 'billing-spent'}}
|
||||
th {{_ 'billing-forecast'}}
|
||||
th {{_ 'billing-invoiced'}}
|
||||
tbody
|
||||
each board in boards
|
||||
tr.billing-board-row(class="{{#if board.finance.overBudget}}is-over{{/if}} {{#if $eq board._id selectedBoardId}}is-selected{{/if}}")
|
||||
td
|
||||
a.js-billing-board(data-id=board._id) {{board.title}}
|
||||
if board.overdueInvoices
|
||||
span.billing-over
|
||||
| · {{_ 'billing-overdue-count' count=board.overdueInvoices}}
|
||||
td {{budgetLabel board}}
|
||||
td
|
||||
.billing-bar
|
||||
.billing-bar-fill(style="width: {{barWidth board.finance.usedPercent}}%")
|
||||
span {{money board.finance.spentMinor board.finance.currency}}
|
||||
if board.finance.usedPercent
|
||||
| · {{board.finance.usedPercent}} %
|
||||
td
|
||||
span {{money board.finance.forecastMinor board.finance.currency}}
|
||||
if board.finance.forecastPercent
|
||||
| · {{board.finance.forecastPercent}} %
|
||||
if board.finance.overBudget
|
||||
span.billing-over
|
||||
i.fa.fa-exclamation-triangle
|
||||
| {{_ 'billing-over-budget'}}
|
||||
td {{money board.finance.invoicedMinor board.finance.currency}}
|
||||
else
|
||||
p {{_ 'billing-no-boards'}}
|
||||
|
||||
if detail
|
||||
+billingBoard(detail=detail reload=reload period=period setPeriod=setPeriod)
|
||||
|
||||
template(name="billingBoard")
|
||||
.billing-board
|
||||
h2 {{detail.board.title}}
|
||||
.billing-summary
|
||||
dl
|
||||
dt {{_ 'billing-spent'}}
|
||||
dd {{money detail.finance.spentMinor detail.finance.currency}} ({{hours detail.finance.spentHours}})
|
||||
dt {{_ 'billing-remaining'}}
|
||||
dd {{money detail.finance.remainingMinor detail.finance.currency}} ({{hours detail.finance.remainingHours}})
|
||||
dt {{_ 'billing-forecast'}}
|
||||
dd(class="{{#if detail.finance.overBudget}}billing-over{{/if}}") {{money detail.finance.forecastMinor detail.finance.currency}} ({{hours detail.finance.forecastHours}})
|
||||
if hasBudget
|
||||
dt {{_ 'billing-left'}}
|
||||
dd
|
||||
if detail.finance.leftMinor
|
||||
| {{money detail.finance.leftMinor detail.finance.currency}}
|
||||
if detail.finance.leftHours
|
||||
| {{hours detail.finance.leftHours}}
|
||||
dt {{_ 'billing-invoiced'}}
|
||||
dd {{money detail.finance.invoicedMinor detail.finance.currency}}
|
||||
dt {{_ 'billing-paid'}}
|
||||
dd {{money detail.finance.paidMinor detail.finance.currency}}
|
||||
dt {{_ 'billing-unbilled'}}
|
||||
dd.billing-unbilled {{money detail.finance.unbilledMinor detail.finance.currency}}
|
||||
if detail.finance.expenseMinor
|
||||
dt {{_ 'billing-expenses'}}
|
||||
dd {{money detail.finance.expenseMinor detail.finance.currency}}
|
||||
if detail.finance.hasCostRates
|
||||
dt {{_ 'billing-cost'}}
|
||||
dd {{money detail.finance.costMinor detail.finance.currency}}
|
||||
dt {{_ 'billing-margin'}}
|
||||
dd.billing-margin(class="{{#if isNegative detail.finance.marginMinor}}billing-over{{/if}}")
|
||||
| {{money detail.finance.marginMinor detail.finance.currency}}
|
||||
if detail.finance.marginPercent
|
||||
| · {{detail.finance.marginPercent}} %
|
||||
if detail.finance.unratedHours
|
||||
p.warning {{_ 'billing-unrated' hours=detail.finance.unratedHours}}
|
||||
if detail.finance.hasCostRates
|
||||
if detail.finance.uncostedHours
|
||||
p.warning {{_ 'billing-uncosted' hours=detail.finance.uncostedHours}}
|
||||
|
||||
.billing-sections
|
||||
section.billing-section
|
||||
h3 {{_ 'billing-budget'}}
|
||||
form.js-billing-budget
|
||||
label(for="billing-budget-amount") {{_ 'billing-amount'}}
|
||||
input#billing-budget-amount(type="number" name="amount" min="0" step="0.01" value=budgetAmount)
|
||||
label(for="billing-budget-currency") {{_ 'billing-currency'}}
|
||||
input#billing-budget-currency(type="text" name="currency" maxlength="3" value=budgetCurrency placeholder="EUR")
|
||||
label(for="billing-budget-hours") {{_ 'billing-budget-hours'}}
|
||||
input#billing-budget-hours(type="number" name="hours" min="0" step="0.5" value=detail.budget.hours)
|
||||
label(for="billing-budget-start") {{_ 'start'}}
|
||||
input#billing-budget-start(type="date" name="start" value=detail.budget.start)
|
||||
label(for="billing-budget-end") {{_ 'card-end'}}
|
||||
input#billing-budget-end(type="date" name="end" value=detail.budget.end)
|
||||
button.primary(type="submit") {{_ 'save'}}
|
||||
if detail.budget
|
||||
button.js-billing-remove-budget(type="button") {{_ 'delete'}}
|
||||
|
||||
section.billing-section
|
||||
h3 {{_ 'billing-rates'}}
|
||||
if detail.rates.length
|
||||
ul.billing-list
|
||||
each rate in detail.rates
|
||||
li
|
||||
if rate.userId
|
||||
| {{rate.name}}
|
||||
else
|
||||
| {{_ 'billing-default-rate'}}
|
||||
| · {{money rate.hourlyRateMinor rate.currency}} / {{_ 'workload-hours-short'}}
|
||||
if isNumber rate.costRateMinor
|
||||
| · {{_ 'billing-cost-rate'}} {{money rate.costRateMinor rate.currency}}
|
||||
a.js-billing-remove-rate(data-id=rate._id title="{{_ 'delete'}}" aria-label="{{_ 'delete'}}")
|
||||
i.fa.fa-trash
|
||||
form.js-billing-rate
|
||||
label(for="billing-rate-person") {{_ 'person'}}
|
||||
select#billing-rate-person(name="userId")
|
||||
option(value="") {{_ 'billing-default-rate'}}
|
||||
each member in detail.members
|
||||
option(value=member.userId) {{member.name}}
|
||||
label(for="billing-rate-amount") {{_ 'billing-hourly-rate'}}
|
||||
input#billing-rate-amount(type="number" name="hourlyRate" min="0" step="0.01" required)
|
||||
label(for="billing-rate-currency") {{_ 'billing-currency'}}
|
||||
input#billing-rate-currency(type="text" name="currency" maxlength="3" value=budgetCurrency placeholder="EUR" required)
|
||||
label(for="billing-rate-cost") {{_ 'billing-cost-rate'}}
|
||||
input#billing-rate-cost(type="number" name="costRate" min="0" step="0.01")
|
||||
button.primary(type="submit") {{_ 'save'}}
|
||||
|
||||
section.billing-section
|
||||
h3 {{_ 'billing-issuer'}}
|
||||
form.js-billing-profile
|
||||
label(for="billing-issuer-name") {{_ 'billing-issuer-name'}}
|
||||
input#billing-issuer-name(type="text" name="issuerName" maxlength="200" value=detail.profile.issuerName)
|
||||
label(for="billing-issuer-address") {{_ 'billing-address'}}
|
||||
textarea#billing-issuer-address(name="issuerAddress" maxlength="500" rows="3") {{detail.profile.issuerAddress}}
|
||||
label(for="billing-issuer-country") {{_ 'billing-country'}}
|
||||
input#billing-issuer-country(type="text" name="issuerCountry" maxlength="2" value=detail.profile.issuerCountry placeholder="FI")
|
||||
label(for="billing-business-id") {{_ 'billing-business-id'}}
|
||||
input#billing-business-id(type="text" name="businessId" maxlength="50" value=detail.profile.businessId)
|
||||
label(for="billing-vat-id") {{_ 'billing-vat-id'}}
|
||||
input#billing-vat-id(type="text" name="vatId" maxlength="50" value=detail.profile.vatId)
|
||||
label(for="billing-email") {{_ 'email'}}
|
||||
input#billing-email(type="text" name="email" maxlength="200" value=detail.profile.email)
|
||||
label(for="billing-phone") {{_ 'billing-phone'}}
|
||||
input#billing-phone(type="text" name="phone" maxlength="50" value=detail.profile.phone)
|
||||
label(for="billing-website") {{_ 'billing-website'}}
|
||||
input#billing-website(type="text" name="website" maxlength="200" value=detail.profile.website)
|
||||
label(for="billing-vat-percent") {{_ 'billing-vat'}} %
|
||||
input#billing-vat-percent(type="number" name="vatPercent" min="0" max="100" step="0.1" value=detail.profile.vatPercent)
|
||||
label.billing-checkbox
|
||||
input(type="checkbox" name="reverseCharge" checked=detail.profile.reverseCharge)
|
||||
| {{_ 'billing-reverse-charge'}}
|
||||
label(for="billing-terms") {{_ 'billing-payment-terms'}}
|
||||
input#billing-terms(type="number" name="paymentTermsDays" min="0" max="365" step="1" value=detail.profile.paymentTermsDays)
|
||||
label(for="billing-penalty") {{_ 'billing-penalty-interest'}} %
|
||||
input#billing-penalty(type="number" name="penaltyInterestPercent" min="0" max="100" step="0.1" value=detail.profile.penaltyInterestPercent)
|
||||
label(for="billing-reference-type") {{_ 'billing-payment-reference'}}
|
||||
select#billing-reference-type(name="referenceType")
|
||||
each type in referenceTypes
|
||||
option(value=type.value selected="{{#if $eq type.value detail.profile.referenceType}}selected{{/if}}") {{type.label}}
|
||||
label(for="billing-footer") {{_ 'billing-footer'}}
|
||||
textarea#billing-footer(name="footer" maxlength="1000" rows="2") {{detail.profile.footer}}
|
||||
label.billing-checkbox
|
||||
input(type="checkbox" name="billTime" checked=billsTime)
|
||||
| {{_ 'billing-bill-time'}}
|
||||
label.billing-checkbox
|
||||
input(type="checkbox" name="approveTime" checked=detail.profile.approveTime)
|
||||
| {{_ 'billing-approve-time'}}
|
||||
label(for="billing-default-customer") {{_ 'billing-default-customer'}}
|
||||
textarea#billing-default-customer(name="customer" maxlength="500" rows="3") {{detail.profile.customer}}
|
||||
label(for="billing-default-country") {{_ 'billing-country'}}
|
||||
input#billing-default-country(type="text" name="customerCountry" maxlength="2" value=detail.profile.customerCountry placeholder="FI")
|
||||
label(for="billing-default-vatid") {{_ 'billing-vat-id'}}
|
||||
input#billing-default-vatid(type="text" name="customerVatId" maxlength="50" value=detail.profile.customerVatId)
|
||||
label(for="billing-quote-days") {{_ 'billing-quote-valid-days'}}
|
||||
input#billing-quote-days(type="number" name="quoteValidDays" min="1" max="365" step="1" value=quoteValidDays)
|
||||
button.primary(type="submit") {{_ 'save'}}
|
||||
|
||||
section.billing-section
|
||||
h3 {{_ 'billing-payment-methods'}}
|
||||
if detail.profile.paymentMethods.length
|
||||
ul.billing-list
|
||||
each method in paymentMethods
|
||||
li
|
||||
| {{method.title}}
|
||||
if method.summary
|
||||
| · {{method.summary}}
|
||||
a.js-billing-remove-method(data-index=method.index title="{{_ 'delete'}}" aria-label="{{_ 'delete'}}")
|
||||
i.fa.fa-trash
|
||||
form.js-billing-method
|
||||
label(for="billing-method-type") {{_ 'billing-method'}}
|
||||
select#billing-method-type.js-billing-method-type(name="type")
|
||||
each type in methodTypes
|
||||
option(value=type.value selected="{{#if $eq type.value methodType}}selected{{/if}}") {{type.label}}
|
||||
each fieldName in methodFields
|
||||
label(for="billing-method-{{fieldName.name}}") {{fieldName.label}}
|
||||
if $eq fieldName.name 'details'
|
||||
textarea(id="billing-method-{{fieldName.name}}" name=fieldName.name rows="2" maxlength="2000")
|
||||
else
|
||||
input(id="billing-method-{{fieldName.name}}" type="text" name=fieldName.name maxlength="2000" placeholder=fieldName.placeholder)
|
||||
button.primary(type="submit") {{_ 'billing-add-method'}}
|
||||
|
||||
section.billing-section.billing-expenses
|
||||
h3 {{_ 'billing-expenses'}}
|
||||
if detail.expenses.length
|
||||
ul.billing-list
|
||||
each expense in detail.expenses
|
||||
li(class="{{#if expense.invoiced}}is-invoiced{{/if}}")
|
||||
| {{expense.date}} · {{expenseCategory expense.category}}
|
||||
if expense.description
|
||||
| · {{expense.description}}
|
||||
| · {{money expense.amountMinor expense.currency}}
|
||||
if expense.markupPercent
|
||||
| (+{{expense.markupPercent}} % = {{money expense.chargeMinor expense.currency}})
|
||||
unless expense.billable
|
||||
| · {{_ 'billing-not-billable'}}
|
||||
if expense.cardTitle
|
||||
| · {{expense.cardTitle}}
|
||||
if expense.name
|
||||
| · {{expense.name}}
|
||||
if expense.invoiced
|
||||
i.fa.fa-file-text-o(title="{{_ 'time-entry-invoiced'}}")
|
||||
else
|
||||
a.js-billing-remove-expense(data-id=expense._id title="{{_ 'delete'}}" aria-label="{{_ 'delete'}}")
|
||||
i.fa.fa-trash
|
||||
else
|
||||
p {{_ 'billing-no-expenses'}}
|
||||
form.js-billing-expense
|
||||
label(for="billing-expense-date") {{_ 'date'}}
|
||||
input#billing-expense-date(type="date" name="date" value=today required)
|
||||
label(for="billing-expense-amount") {{_ 'billing-amount'}}
|
||||
input#billing-expense-amount(type="number" name="amount" min="0.01" step="0.01" required)
|
||||
label(for="billing-expense-currency") {{_ 'billing-currency'}}
|
||||
input#billing-expense-currency(type="text" name="currency" maxlength="3" value=budgetCurrency placeholder="EUR" required)
|
||||
label(for="billing-expense-category") {{_ 'billing-expense-category'}}
|
||||
select#billing-expense-category(name="category")
|
||||
each category in expenseCategories
|
||||
option(value=category.value) {{category.label}}
|
||||
label(for="billing-expense-description") {{_ 'description'}}
|
||||
input#billing-expense-description(type="text" name="description" maxlength="200")
|
||||
label(for="billing-expense-markup") {{_ 'billing-markup'}} %
|
||||
input#billing-expense-markup(type="number" name="markupPercent" min="0" max="100" step="0.1")
|
||||
label(for="billing-expense-card") {{_ 'card'}}
|
||||
select#billing-expense-card(name="cardId")
|
||||
option(value="") —
|
||||
each card in detail.cards
|
||||
option(value=card._id) {{card.title}}
|
||||
label(for="billing-expense-person") {{_ 'person'}}
|
||||
select#billing-expense-person(name="userId")
|
||||
option(value="") —
|
||||
each member in detail.members
|
||||
option(value=member.userId) {{member.name}}
|
||||
label.billing-checkbox
|
||||
input(type="checkbox" name="billable" checked)
|
||||
| {{_ 'billing-billable'}}
|
||||
button.primary(type="submit") {{_ 'billing-add-expense'}}
|
||||
|
||||
section.billing-section.billing-fees
|
||||
h3 {{_ 'billing-fees'}}
|
||||
p.billing-hint {{_ 'billing-fees-intro'}}
|
||||
if detail.fees.length
|
||||
ul.billing-list
|
||||
each fee in detail.fees
|
||||
li
|
||||
| {{fee.title}} · {{money fee.amountMinor fee.currency}} · {{fee.date}}
|
||||
if $eq fee.recurring 'monthly'
|
||||
| · {{_ 'billing-recurring-monthly'}}
|
||||
if fee.end
|
||||
| – {{fee.end}}
|
||||
| · {{_ 'billing-fee-billed' billed=fee.billedCount due=fee.dueCount}}
|
||||
a.js-billing-remove-fee(data-id=fee._id title="{{_ 'delete'}}" aria-label="{{_ 'delete'}}")
|
||||
i.fa.fa-trash
|
||||
else
|
||||
p {{_ 'billing-no-fees'}}
|
||||
form.js-billing-fee
|
||||
label(for="billing-fee-title") {{_ 'title'}}
|
||||
input#billing-fee-title(type="text" name="title" maxlength="200" required)
|
||||
label(for="billing-fee-amount") {{_ 'billing-amount'}}
|
||||
input#billing-fee-amount(type="number" name="amount" min="0.01" step="0.01" required)
|
||||
label(for="billing-fee-currency") {{_ 'billing-currency'}}
|
||||
input#billing-fee-currency(type="text" name="currency" maxlength="3" value=budgetCurrency placeholder="EUR" required)
|
||||
label(for="billing-fee-date") {{_ 'date'}}
|
||||
input#billing-fee-date(type="date" name="date" value=today required)
|
||||
label(for="billing-fee-recurring") {{_ 'billing-recurring'}}
|
||||
select#billing-fee-recurring(name="recurring")
|
||||
option(value="none") {{_ 'billing-recurring-none'}}
|
||||
option(value="monthly") {{_ 'billing-recurring-monthly'}}
|
||||
label(for="billing-fee-end") {{_ 'card-end'}}
|
||||
input#billing-fee-end(type="date" name="end")
|
||||
button.primary(type="submit") {{_ 'billing-add-fee'}}
|
||||
|
||||
if detail.profile.approveTime
|
||||
section.billing-section.billing-approval
|
||||
h3 {{_ 'billing-time-to-approve'}}
|
||||
if detail.pendingTime.length
|
||||
form.js-billing-approval
|
||||
ul.billing-list
|
||||
each entry in detail.pendingTime
|
||||
li
|
||||
label.billing-checkbox
|
||||
input(type="checkbox" name="entry" value=entry._id checked)
|
||||
| {{entry.date}} · {{entry.title}} · {{entry.name}} · {{entry.hours}} {{_ 'workload-hours-short'}}
|
||||
if entry.note
|
||||
| · {{entry.note}}
|
||||
label(for="billing-approval-note") {{_ 'workload-note'}}
|
||||
input#billing-approval-note(type="text" name="note" maxlength="200")
|
||||
button.primary.js-billing-decide(type="button" data-decision="approved") {{_ 'billing-approve'}}
|
||||
button.js-billing-decide(type="button" data-decision="rejected") {{_ 'billing-reject'}}
|
||||
else
|
||||
p {{_ 'billing-nothing-to-approve'}}
|
||||
|
||||
section.billing-section
|
||||
h3 {{_ 'billing-new-invoice'}}
|
||||
form.js-billing-period
|
||||
label(for="billing-period-start") {{_ 'billing-period'}}
|
||||
.billing-period
|
||||
input#billing-period-start(type="date" name="periodStart" value=period.periodStart)
|
||||
| –
|
||||
input#billing-period-end(type="date" name="periodEnd" value=period.periodEnd aria-label="{{_ 'card-end'}}")
|
||||
label.billing-checkbox
|
||||
input.js-billing-undated(type="checkbox" name="includeUndated" checked=period.includeUndated)
|
||||
| {{_ 'billing-include-undated'}}
|
||||
if detail.draft
|
||||
if detail.draft.lines.length
|
||||
p {{_ 'billing-draft-summary' hours=detail.draft.totalHours amount=draftTotal}}
|
||||
ul.billing-draft-lines
|
||||
each line in detail.draft.lines
|
||||
li(class="billing-line-{{lineKind line}}")
|
||||
if line.kind
|
||||
| {{lineKindLabel line}}: {{line.title}} · {{line.firstDate}} · {{money line.amountMinor detail.draft.currency}}
|
||||
else
|
||||
| {{line.title}} · {{line.name}} · {{line.hours}} {{_ 'workload-hours-short'}} · {{money line.amountMinor detail.draft.currency}}
|
||||
else
|
||||
p {{_ 'billing-nothing-to-invoice'}}
|
||||
if detail.draft.undatedHours
|
||||
p {{_ 'billing-undated-included' hours=detail.draft.undatedHours}}
|
||||
if detail.draft.unratedHours
|
||||
p.warning {{_ 'billing-unrated' hours=detail.draft.unratedHours}}
|
||||
if detail.draft.unapprovedHours
|
||||
p.warning {{_ 'billing-unapproved' hours=detail.draft.unapprovedHours}}
|
||||
else
|
||||
p {{_ 'billing-set-rate-first'}}
|
||||
form.js-billing-invoice
|
||||
label(for="billing-invoice-customer") {{_ 'billing-customer'}}
|
||||
textarea#billing-invoice-customer(name="customer" maxlength="500" rows="3" placeholder=detail.profile.customer)
|
||||
label(for="billing-invoice-country") {{_ 'billing-country'}}
|
||||
input#billing-invoice-country(type="text" name="customerCountry" maxlength="2" placeholder="FI")
|
||||
label(for="billing-invoice-vatid") {{_ 'billing-vat-id'}}
|
||||
input#billing-invoice-vatid(type="text" name="customerVatId" maxlength="50")
|
||||
label(for="billing-invoice-reference") {{_ 'billing-reference'}}
|
||||
input#billing-invoice-reference(type="text" name="reference" maxlength="100")
|
||||
label(for="billing-invoice-issue") {{_ 'billing-issue-date'}}
|
||||
input#billing-invoice-issue(type="date" name="issueDate" value=today)
|
||||
label(for="billing-invoice-due") {{_ 'billing-due-date'}}
|
||||
input#billing-invoice-due(type="date" name="dueDate")
|
||||
label(for="billing-invoice-vat") {{_ 'billing-vat'}} %
|
||||
input#billing-invoice-vat(type="number" name="vatPercent" min="0" max="100" step="0.1" placeholder=detail.profile.vatPercent)
|
||||
label(for="billing-invoice-notes") {{_ 'workload-note'}}
|
||||
textarea#billing-invoice-notes(name="notes" maxlength="2000" rows="2")
|
||||
button.primary(type="submit" disabled=cannotInvoice) {{_ 'billing-create-invoice'}}
|
||||
|
||||
section.billing-section.billing-invoices
|
||||
h3 {{_ 'billing-invoices'}}
|
||||
if detail.invoices.length
|
||||
.billing-table-wrapper
|
||||
table.billing-invoice-table
|
||||
thead
|
||||
tr
|
||||
th {{_ 'billing-number'}}
|
||||
th {{_ 'billing-issue-date'}}
|
||||
th {{_ 'billing-due-date'}}
|
||||
th {{_ 'billing-customer'}}
|
||||
th {{_ 'hours'}}
|
||||
th {{_ 'billing-total'}}
|
||||
th {{_ 'billing-amount-due'}}
|
||||
th {{_ 'billing-status'}}
|
||||
th
|
||||
tbody
|
||||
each invoice in detail.invoices
|
||||
tr(class="billing-status-{{invoice.status}} billing-state-{{invoice.state}}")
|
||||
td {{invoice.number}}
|
||||
td {{invoice.issueDate}}
|
||||
td {{invoice.dueDate}}
|
||||
td {{invoice.customer}}
|
||||
td {{invoice.totalHours}}
|
||||
td {{signedMoney invoice invoice.totalMinor}}
|
||||
td
|
||||
if invoice.dueMinor
|
||||
| {{money invoice.dueMinor invoice.currency}}
|
||||
if invoice.interestMinor
|
||||
span.billing-over
|
||||
| + {{money invoice.interestMinor invoice.currency}}
|
||||
td
|
||||
| {{statusLabel invoice.state}}
|
||||
if invoice.daysOverdue
|
||||
span.billing-over
|
||||
| ({{_ 'billing-days-overdue' days=invoice.daysOverdue}})
|
||||
td.billing-invoice-actions
|
||||
each next in nextStatuses invoice
|
||||
button.js-billing-status(type="button" data-id=invoice._id data-status=next.value) {{next.label}}
|
||||
if canCredit invoice
|
||||
button.js-billing-credit(type="button" data-id=invoice._id) {{_ 'billing-credit'}}
|
||||
button.js-billing-open(type="button" data-id=invoice._id)
|
||||
i.fa.fa-eye
|
||||
| {{_ 'billing-open'}}
|
||||
each format in fileFormats
|
||||
button.js-billing-file(type="button" data-id=invoice._id data-format=format.value)
|
||||
i.fa(class=format.icon)
|
||||
| {{format.label}}
|
||||
else
|
||||
p {{_ 'billing-no-invoices'}}
|
||||
|
||||
section.billing-section.billing-quotes
|
||||
h3 {{_ 'billing-quotes'}}
|
||||
p.billing-hint {{_ 'billing-quotes-intro'}}
|
||||
form.js-billing-quote
|
||||
label(for="billing-quote-customer") {{_ 'billing-customer'}}
|
||||
textarea#billing-quote-customer(name="customer" maxlength="500" rows="2" placeholder=detail.profile.customer)
|
||||
label(for="billing-quote-issue") {{_ 'billing-issue-date'}}
|
||||
input#billing-quote-issue(type="date" name="issueDate" value=today)
|
||||
label(for="billing-quote-valid") {{_ 'billing-valid-until'}}
|
||||
input#billing-quote-valid(type="date" name="validUntil")
|
||||
label(for="billing-quote-notes") {{_ 'workload-note'}}
|
||||
textarea#billing-quote-notes(name="notes" maxlength="2000" rows="2")
|
||||
button.primary(type="submit") {{_ 'billing-create-quote'}}
|
||||
if detail.quotes.length
|
||||
.billing-table-wrapper
|
||||
table.billing-quote-table
|
||||
thead
|
||||
tr
|
||||
th {{_ 'billing-number'}}
|
||||
th {{_ 'billing-issue-date'}}
|
||||
th {{_ 'billing-valid-until'}}
|
||||
th {{_ 'billing-customer'}}
|
||||
th {{_ 'hours'}}
|
||||
th {{_ 'billing-total'}}
|
||||
th {{_ 'billing-status'}}
|
||||
th
|
||||
tbody
|
||||
each quote in detail.quotes
|
||||
tr(class="billing-quote-{{quote.status}}")
|
||||
td {{quote.number}}
|
||||
td {{quote.issueDate}}
|
||||
td
|
||||
| {{quote.validUntil}}
|
||||
if quote.expired
|
||||
span.billing-over
|
||||
| ({{_ 'billing-quote-expired'}})
|
||||
td {{quote.customer}}
|
||||
td {{quote.totalHours}}
|
||||
td {{money quote.totalMinor quote.currency}}
|
||||
td {{quoteStatusLabel quote.status}}
|
||||
td.billing-invoice-actions
|
||||
each next in nextQuoteStatuses quote
|
||||
button.js-billing-quote-status(type="button" data-id=quote._id data-status=next.value) {{next.label}}
|
||||
button.js-billing-quote-open(type="button" data-id=quote._id)
|
||||
i.fa.fa-eye
|
||||
| {{_ 'billing-open'}}
|
||||
each format in quoteFormats
|
||||
button.js-billing-quote-file(type="button" data-id=quote._id data-format=format.value)
|
||||
i.fa(class=format.icon)
|
||||
| {{format.label}}
|
||||
label.billing-checkbox
|
||||
input.js-billing-accept-budget(type="checkbox" checked)
|
||||
| {{_ 'billing-accept-sets-budget'}}
|
||||
else
|
||||
p {{_ 'billing-no-quotes'}}
|
||||
|
||||
if printed
|
||||
+billingInvoicePrint(invoice=printed reload=reloadFn setPrinted=setPrinted)
|
||||
|
||||
if actionError
|
||||
.warning {{actionError}}
|
||||
|
||||
template(name="billingInvoicePrint")
|
||||
.billing-print
|
||||
.billing-print-header
|
||||
h2
|
||||
if $eq invoice.kind 'credit'
|
||||
| {{_ 'billing-credit-note'}} {{invoice.number}}
|
||||
else if $eq invoice.kind 'quote'
|
||||
| {{_ 'billing-quote'}} {{invoice.number}}
|
||||
else
|
||||
| {{_ 'billing-invoice'}} {{invoice.number}}
|
||||
.billing-print-issuer
|
||||
strong {{invoice.profile.issuerName}}
|
||||
pre {{invoice.profile.issuerAddress}}
|
||||
if invoice.profile.businessId
|
||||
div {{_ 'billing-business-id'}}: {{invoice.profile.businessId}}
|
||||
if invoice.profile.vatId
|
||||
div {{_ 'billing-vat-id'}}: {{invoice.profile.vatId}}
|
||||
.billing-print-meta
|
||||
if invoice.customer
|
||||
pre.billing-print-customer {{invoice.customer}}
|
||||
dl
|
||||
dt {{_ 'billing-issue-date'}}
|
||||
dd {{invoice.issueDate}}
|
||||
if invoice.dueDate
|
||||
if $eq invoice.kind 'quote'
|
||||
dt {{_ 'billing-valid-until'}}
|
||||
else
|
||||
dt {{_ 'billing-due-date'}}
|
||||
dd {{invoice.dueDate}}
|
||||
if invoice.creditOfNumber
|
||||
dt {{_ 'billing-credit-of'}}
|
||||
dd {{invoice.creditOfNumber}}
|
||||
if invoice.paymentReference
|
||||
dt {{_ 'billing-payment-reference'}}
|
||||
dd {{formattedReference}}
|
||||
if invoice.reference
|
||||
dt {{_ 'billing-reference'}}
|
||||
dd {{invoice.reference}}
|
||||
if invoice.periodStart
|
||||
dt {{_ 'billing-period'}}
|
||||
dd {{invoice.periodStart}} – {{invoice.periodEnd}}
|
||||
dt {{_ 'billing-status'}}
|
||||
dd {{statusLabel invoice.state invoice.kind}}
|
||||
.billing-table-wrapper
|
||||
table.billing-print-lines
|
||||
thead
|
||||
tr
|
||||
th {{_ 'card'}}
|
||||
th {{_ 'person'}}
|
||||
th {{_ 'hours'}}
|
||||
th {{_ 'billing-hourly-rate'}}
|
||||
th {{_ 'billing-amount'}}
|
||||
tbody
|
||||
each line in invoice.lines
|
||||
tr
|
||||
td
|
||||
| {{line.title}}
|
||||
if line.firstDate
|
||||
.billing-line-dates {{line.firstDate}} – {{line.lastDate}}
|
||||
td {{line.name}}
|
||||
if line.kind
|
||||
td
|
||||
td
|
||||
else
|
||||
td {{line.hours}}
|
||||
td {{money line.rateMinor invoice.currency}}
|
||||
td {{signedMoney invoice line.amountMinor}}
|
||||
tfoot
|
||||
tr
|
||||
th(colspan="4") {{_ 'billing-net'}}
|
||||
th {{signedMoney invoice invoice.netMinor}}
|
||||
tr
|
||||
th(colspan="4") {{_ 'billing-vat'}} {{invoice.vatPercent}} %
|
||||
th {{signedMoney invoice invoice.vatMinor}}
|
||||
tr
|
||||
th(colspan="4") {{_ 'billing-total'}}
|
||||
th {{signedMoney invoice invoice.totalMinor}}
|
||||
if invoice.paidMinor
|
||||
tr
|
||||
th(colspan="4") {{_ 'billing-paid'}}
|
||||
th {{money invoice.paidMinor invoice.currency}}
|
||||
tr
|
||||
th(colspan="4") {{_ 'billing-amount-due'}}
|
||||
th {{money invoice.dueMinor invoice.currency}}
|
||||
if invoice.reverseCharge
|
||||
p {{_ 'billing-reverse-charge'}}
|
||||
if invoice.notes
|
||||
p.billing-print-notes {{invoice.notes}}
|
||||
|
||||
if isInvoice invoice
|
||||
if invoice.instructions.length
|
||||
h3 {{_ 'billing-payment-methods'}}
|
||||
.billing-pay
|
||||
each item in invoice.instructions
|
||||
.billing-pay-method
|
||||
strong {{methodTitle item}}
|
||||
each l in item.lines
|
||||
div {{l}}
|
||||
if item.link
|
||||
div
|
||||
a(href=item.link target="_blank" rel="noopener noreferrer") {{item.link}}
|
||||
if item.error
|
||||
div.warning {{item.error}}
|
||||
if item.qr
|
||||
.billing-qr
|
||||
| {{{qrSvg item}}}
|
||||
small {{_ 'billing-pay-by-scanning'}}
|
||||
if item.barcode
|
||||
.billing-barcode
|
||||
| {{{barcodeSvg item.barcode}}}
|
||||
small {{item.barcode}}
|
||||
|
||||
unless $eq invoice.status 'draft'
|
||||
.billing-payments.no-print
|
||||
h3 {{_ 'billing-payments'}}
|
||||
if invoice.payments.length
|
||||
ul.billing-list
|
||||
each payment in invoice.payments
|
||||
li
|
||||
| {{payment.date}} · {{money payment.amountMinor invoice.currency}}
|
||||
if payment.method
|
||||
| · {{payment.method}}
|
||||
a.js-billing-remove-payment(data-id=payment.id title="{{_ 'delete'}}" aria-label="{{_ 'delete'}}")
|
||||
i.fa.fa-trash
|
||||
if invoice.dueMinor
|
||||
form.js-billing-payment
|
||||
input(type="date" name="date" value=today aria-label="{{_ 'date'}}" required)
|
||||
input(type="number" name="amount" min="0.01" step="0.01" value=dueAmount aria-label="{{_ 'billing-amount'}}" required)
|
||||
input(type="text" name="method" maxlength="50" placeholder="{{_ 'billing-method'}}" aria-label="{{_ 'billing-method'}}")
|
||||
button.primary(type="submit") {{_ 'billing-add-payment'}}
|
||||
|
||||
if invoice.profile.footer
|
||||
p.billing-print-footer {{invoice.profile.footer}}
|
||||
.no-print
|
||||
button.js-billing-print-now(type="button")
|
||||
i.fa.fa-print
|
||||
| {{_ 'billing-print'}}
|
||||
button.js-billing-print-close(type="button") {{_ 'close'}}
|
||||
@@ -0,0 +1,555 @@
|
||||
// Budget and billing page (docs/Features/Billing/Billing.md). It asks the
|
||||
// server for the numbers (billingBoards / billingBoard, server/billing.js) and
|
||||
// writes through the other billing* methods.
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Template } from 'meteor/templating';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import qrcode from 'qrcode-generator';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
const { formatMoney, EXPENSE_CATEGORIES } = require('/models/lib/billing');
|
||||
const { minorToText } = require('/models/lib/currencies');
|
||||
const { PAYMENT_METHODS, code128CModules, formatReference, formatIban } = require('/models/lib/paymentCodes');
|
||||
|
||||
function t(key, options) {
|
||||
return TAPi18n.__(key, options);
|
||||
}
|
||||
|
||||
function errorText(error) {
|
||||
return error ? (error.reason || error.message || String(error)) : '';
|
||||
}
|
||||
|
||||
function language() {
|
||||
try { return TAPi18n.getLanguage ? TAPi18n.getLanguage() : undefined; } catch (e) { return undefined; }
|
||||
}
|
||||
|
||||
function money(minor, currency) {
|
||||
return formatMoney(minor, currency, language());
|
||||
}
|
||||
|
||||
const STATE_KEYS = {
|
||||
draft: 'billing-status-draft', sent: 'billing-status-sent', paid: 'billing-status-paid', void: 'billing-status-void',
|
||||
credited: 'billing-status-credited', partial: 'billing-status-partial', overdue: 'billing-status-overdue',
|
||||
};
|
||||
const NEXT = { draft: ['sent', 'void'], sent: ['paid', 'draft', 'void'], paid: [], void: [], credited: [] };
|
||||
const ACTION_KEYS = { sent: 'billing-mark-sent', paid: 'billing-mark-paid', void: 'billing-void', draft: 'billing-back-to-draft' };
|
||||
// A quote's statuses, and what each may become (models/lib/billing.js).
|
||||
const QUOTE_STATE_KEYS = { draft: 'billing-status-draft', sent: 'billing-status-sent', accepted: 'billing-quote-accepted', declined: 'billing-quote-declined' };
|
||||
const QUOTE_NEXT = { draft: ['sent', 'declined'], sent: ['accepted', 'declined', 'draft'], accepted: [], declined: [] };
|
||||
const QUOTE_ACTION_KEYS = { sent: 'billing-mark-sent', accepted: 'accept', declined: 'decline', draft: 'billing-back-to-draft' };
|
||||
const METHOD_KEYS = {
|
||||
sepa: 'billing-method-sepa', 'fi-bank': 'billing-method-fi-bank', 'swiss-qr': 'billing-method-swiss-qr',
|
||||
'bank-transfer': 'billing-method-bank-transfer', swish: 'billing-method-swish', pix: 'billing-method-pix',
|
||||
upi: 'billing-method-upi', bitcoin: 'billing-method-bitcoin', paypal: 'billing-method-paypal', link: 'billing-method-link',
|
||||
cash: 'billing-method-cash', cheque: 'billing-method-cheque', other: 'billing-method-other',
|
||||
promptpay: 'billing-method-promptpay', paynow: 'billing-method-paynow', vietqr: 'billing-method-vietqr', fps: 'billing-method-fps',
|
||||
spayd: 'billing-method-spayd', zbp: 'billing-method-zbp', mnb: 'billing-method-mnb', ips: 'billing-method-ips',
|
||||
'dk-fik': 'billing-method-dk-fik', ethereum: 'billing-method-ethereum', litecoin: 'billing-method-litecoin',
|
||||
};
|
||||
const FIELD_KEYS = {
|
||||
name: 'billing-field-name', iban: 'billing-field-iban', bic: 'billing-field-bic', street: 'billing-field-street',
|
||||
building: 'billing-field-building', postcode: 'billing-field-postcode', town: 'billing-field-town', country: 'billing-country',
|
||||
details: 'billing-field-details', payee: 'billing-field-payee', key: 'billing-field-pix-key', city: 'billing-field-town',
|
||||
vpa: 'billing-field-vpa', address: 'billing-field-crypto-address', user: 'billing-field-paypal-user', label: 'billing-field-label',
|
||||
url: 'billing-field-url', target: 'billing-field-promptpay-target', proxy: 'billing-field-proxy', bin: 'billing-field-bank-bin',
|
||||
account: 'billing-field-account', nip: 'billing-field-nip', creditor: 'billing-field-creditor',
|
||||
};
|
||||
const PLACEHOLDERS = {
|
||||
iban: 'FI21 1234 5600 0007 85', bic: 'NDEAFIHH', country: 'CH', url: '…?amount={amount}&reference={reference}', vpa: 'shop@bank',
|
||||
target: '081 234 5678', proxy: '+65 9123 4567', bin: '970436', creditor: '12345678', nip: '5260250274',
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------- codes as SVG
|
||||
|
||||
// The QR code of a payment, drawn from its matrix: the SVG carries modules
|
||||
// only, never the payload's text.
|
||||
function qrSvg(payload, swissCross) {
|
||||
qrcode.stringToBytes = qrcode.stringToBytesFuncs['UTF-8'];
|
||||
const qr = qrcode(0, 'M');
|
||||
qr.addData(payload, 'Byte');
|
||||
qr.make();
|
||||
const n = qr.getModuleCount();
|
||||
const m = 4;
|
||||
let path = '';
|
||||
for (let r = 0; r < n; r += 1) for (let c = 0; c < n; c += 1) if (qr.isDark(r, c)) path += `M${c + m} ${r + m}h1v1h-1z`;
|
||||
const size = n + 2 * m;
|
||||
let cross = '';
|
||||
if (swissCross) {
|
||||
const s = n * 7 / 46;
|
||||
const x = m + n / 2 - s / 2;
|
||||
cross = `<rect x="${x}" y="${x}" width="${s}" height="${s}" fill="#fff"/><rect x="${x + s * 0.06}" y="${x + s * 0.06}" width="${s * 0.88}" height="${s * 0.88}" fill="#000"/>`
|
||||
+ `<rect x="${x + s * 0.4}" y="${x + s * 0.2}" width="${s * 0.2}" height="${s * 0.6}" fill="#fff"/><rect x="${x + s * 0.2}" y="${x + s * 0.4}" width="${s * 0.6}" height="${s * 0.2}" fill="#fff"/>`;
|
||||
}
|
||||
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${size} ${size}" width="160" height="160" shape-rendering="crispEdges" role="img">`
|
||||
+ `<rect width="${size}" height="${size}" fill="#fff"/><path d="${path}" fill="#000"/>${cross}</svg>`;
|
||||
}
|
||||
|
||||
// The Finnish bank barcode: digits only, as bars.
|
||||
function barcodeSvg(digits) {
|
||||
if (!/^\d{54}$/.test(String(digits))) return '';
|
||||
const modules = code128CModules(digits, 10);
|
||||
let path = '';
|
||||
for (let i = 0; i < modules.length; i += 1) if (modules[i] === '1') path += `M${i} 0h1v40h-1z`;
|
||||
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${modules.length} 40" width="100%" height="60" preserveAspectRatio="none" shape-rendering="crispEdges" role="img">`
|
||||
+ `<rect width="${modules.length}" height="40" fill="#fff"/><path d="${path}" fill="#000"/></svg>`;
|
||||
}
|
||||
|
||||
function download(name, mime, { text, base64 }) {
|
||||
let blob;
|
||||
if (base64) {
|
||||
const bin = atob(base64);
|
||||
const bytes = new Uint8Array(bin.length);
|
||||
for (let i = 0; i < bin.length; i += 1) bytes[i] = bin.charCodeAt(i);
|
||||
blob = new Blob([bytes], { type: mime });
|
||||
} else {
|
||||
blob = new Blob([text], { type: mime });
|
||||
}
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = name;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- the page
|
||||
|
||||
Template.billing.onCreated(function () {
|
||||
this.loading = new ReactiveVar(true);
|
||||
this.error = new ReactiveVar('');
|
||||
this.boards = new ReactiveVar([]);
|
||||
this.isAdmin = new ReactiveVar(false);
|
||||
this.allBoards = new ReactiveVar(false);
|
||||
this.selected = new ReactiveVar(null);
|
||||
this.detail = new ReactiveVar(null);
|
||||
this.period = new ReactiveVar({ periodStart: '', periodEnd: '', includeUndated: false });
|
||||
// The spinner of this load takes the board pane down with it, so a save
|
||||
// refreshes through reload below, never through this.
|
||||
this.loadBoards = () => {
|
||||
this.loading.set(true);
|
||||
return Meteor.callAsync('billingBoards', { allBoards: this.allBoards.get() })
|
||||
.then(result => {
|
||||
this.boards.set(result.boards);
|
||||
this.isAdmin.set(result.isAdmin === true);
|
||||
this.error.set('');
|
||||
})
|
||||
.catch(error => this.error.set(errorText(error)))
|
||||
.finally(() => this.loading.set(false));
|
||||
};
|
||||
this.loadDetail = () => {
|
||||
const boardId = this.selected.get();
|
||||
if (!boardId) { this.detail.set(null); return Promise.resolve(); }
|
||||
const p = this.period.get();
|
||||
const period = {};
|
||||
if (p.periodStart) period.periodStart = p.periodStart;
|
||||
if (p.periodEnd) period.periodEnd = p.periodEnd;
|
||||
if (p.includeUndated) period.includeUndated = true;
|
||||
return Meteor.callAsync('billingBoard', boardId, period).then(detail => this.detail.set(detail))
|
||||
.catch(error => this.error.set(errorText(error)));
|
||||
};
|
||||
// After a save only the open board is read again, and its row in the list
|
||||
// takes the numbers from that answer: reading every board after each save
|
||||
// ran into billingBoards' rate limit (server/billing.js) within a minute of
|
||||
// filling in a few forms.
|
||||
this.reload = () => this.loadDetail().then(() => {
|
||||
const detail = this.detail.get();
|
||||
if (!detail) return;
|
||||
this.boards.set(this.boards.get().map(b => (b._id === detail.board._id
|
||||
? { ...b, budget: detail.budget, finance: detail.finance } : b)));
|
||||
});
|
||||
this.loadBoards();
|
||||
});
|
||||
|
||||
Template.billing.helpers({
|
||||
loading: () => Template.instance().loading.get(),
|
||||
error: () => Template.instance().error.get(),
|
||||
boards: () => Template.instance().boards.get(),
|
||||
isAdmin: () => Template.instance().isAdmin.get(),
|
||||
allBoards: () => Template.instance().allBoards.get(),
|
||||
selectedBoardId: () => Template.instance().selected.get(),
|
||||
detail: () => Template.instance().detail.get(),
|
||||
period: () => Template.instance().period.get(),
|
||||
reload() {
|
||||
const tpl = Template.instance();
|
||||
return () => tpl.reload();
|
||||
},
|
||||
setPeriod() {
|
||||
const tpl = Template.instance();
|
||||
return period => { tpl.period.set(period); tpl.loadDetail(); };
|
||||
},
|
||||
money,
|
||||
budgetLabel(board) {
|
||||
const b = board.budget;
|
||||
if (!b) return '—';
|
||||
const parts = [];
|
||||
if (typeof b.amountMinor === 'number') parts.push(money(b.amountMinor, b.currency));
|
||||
if (typeof b.hours === 'number') parts.push(`${b.hours} ${t('workload-hours-short')}`);
|
||||
return parts.join(' · ');
|
||||
},
|
||||
barWidth(percent) {
|
||||
return Math.max(0, Math.min(100, Number(percent) || 0));
|
||||
},
|
||||
});
|
||||
|
||||
Template.billing.events({
|
||||
'click .js-billing-board'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
tpl.selected.set(evt.currentTarget.getAttribute('data-id'));
|
||||
tpl.loadDetail();
|
||||
},
|
||||
'change .js-billing-all-boards'(evt, tpl) {
|
||||
tpl.allBoards.set(evt.currentTarget.checked === true);
|
||||
tpl.loadBoards();
|
||||
},
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------- one board
|
||||
|
||||
Template.billingBoard.onCreated(function () {
|
||||
this.printed = new ReactiveVar(null);
|
||||
this.actionError = new ReactiveVar('');
|
||||
this.methodType = new ReactiveVar('sepa');
|
||||
this.done = promise => promise.then(result => {
|
||||
this.actionError.set('');
|
||||
// The instance's own data context: inside a promise there is no current
|
||||
// template, and the current-data lookup is null there - which left the
|
||||
// page unrefreshed after every save.
|
||||
const { reload } = this.data || {};
|
||||
if (typeof reload === 'function') reload();
|
||||
return result;
|
||||
}).catch(error => this.actionError.set(errorText(error)));
|
||||
});
|
||||
|
||||
function detail() {
|
||||
return Template.currentData().detail;
|
||||
}
|
||||
|
||||
function methodTitle(type) {
|
||||
return t(METHOD_KEYS[type] || type);
|
||||
}
|
||||
|
||||
function signedMoney(invoice, minor) {
|
||||
return money(invoice.kind === 'credit' ? -minor : minor, invoice.currency);
|
||||
}
|
||||
|
||||
function stateLabel(state, kind) {
|
||||
if (kind === 'quote') return t(QUOTE_STATE_KEYS[state] || state);
|
||||
return t(STATE_KEYS[state] || state);
|
||||
}
|
||||
|
||||
Template.billingBoard.helpers({
|
||||
money,
|
||||
signedMoney,
|
||||
hours: value => `${Math.round((Number(value) || 0) * 100) / 100} ${t('workload-hours-short')}`,
|
||||
hasBudget: () => !!detail().budget,
|
||||
budgetAmount() {
|
||||
const b = detail().budget;
|
||||
return b && typeof b.amountMinor === 'number' ? minorToText(b.amountMinor, b.currency) : '';
|
||||
},
|
||||
budgetCurrency() {
|
||||
const d = detail();
|
||||
return (d.budget && d.budget.currency) || d.finance.currency || '';
|
||||
},
|
||||
draftTotal() {
|
||||
const d = detail();
|
||||
return d.draft ? money(d.draft.netMinor, d.draft.currency) : '';
|
||||
},
|
||||
cannotInvoice() {
|
||||
const d = detail();
|
||||
return !(d.draft && d.draft.lines.length);
|
||||
},
|
||||
today: () => new Date().toISOString().slice(0, 10),
|
||||
referenceTypes: () => [
|
||||
{ value: 'rf', label: t('billing-reference-rf') }, { value: 'fi', label: t('billing-reference-fi') },
|
||||
{ value: 'be', label: t('billing-reference-be') }, { value: 'no', label: t('billing-reference-no') },
|
||||
{ value: 'se', label: t('billing-reference-se') }, { value: 'none', label: t('billing-reference-none') },
|
||||
],
|
||||
methodTypes: () => Object.keys(PAYMENT_METHODS).map(value => ({ value, label: methodTitle(value) })),
|
||||
methodType: () => Template.instance().methodType.get(),
|
||||
methodFields() {
|
||||
const spec = PAYMENT_METHODS[Template.instance().methodType.get()];
|
||||
return (spec ? spec.fields : []).map(name => ({ name, label: t(FIELD_KEYS[name] || name), placeholder: PLACEHOLDERS[name] || '' }));
|
||||
},
|
||||
paymentMethods() {
|
||||
return (detail().profile.paymentMethods || []).map((m, index) => ({
|
||||
index, title: m.label || methodTitle(m.type),
|
||||
summary: m.iban ? formatIban(m.iban) : (m.payee || m.key || m.vpa || m.address || m.user || m.url || m.details || ''),
|
||||
}));
|
||||
},
|
||||
statusLabel: state => t(STATE_KEYS[state] || state),
|
||||
nextStatuses: invoice => (invoice.kind === 'credit' ? [] : (NEXT[invoice.status] || [])).map(value => ({ value, label: t(ACTION_KEYS[value]) })),
|
||||
canCredit: invoice => invoice.kind !== 'credit' && ['sent', 'paid'].includes(invoice.status),
|
||||
fileFormats: () => [
|
||||
{ value: 'pdf', label: 'PDF', icon: 'fa-file-pdf-o' }, { value: 'svg', label: 'SVG', icon: 'fa-file-image-o' },
|
||||
{ value: 'xlsx', label: 'Excel', icon: 'fa-file-excel-o' },
|
||||
{ value: 'csv', label: 'CSV', icon: 'fa-file-text-o' }, { value: 'ubl', label: t('billing-e-invoice'), icon: 'fa-file-code-o' },
|
||||
],
|
||||
printed: () => Template.instance().printed.get(),
|
||||
// The parent's reload, handed on by a helper: written `reload=reload`,
|
||||
// Spacebars would call the function it finds in this data context instead
|
||||
// of passing it on.
|
||||
reloadFn: () => Template.currentData().reload,
|
||||
setPrinted() {
|
||||
const tpl = Template.instance();
|
||||
return invoice => tpl.printed.set(invoice);
|
||||
},
|
||||
actionError: () => Template.instance().actionError.get(),
|
||||
isNegative: value => typeof value === 'number' && value < 0,
|
||||
isNumber: value => typeof value === 'number',
|
||||
billsTime: () => detail().profile.billTime !== false,
|
||||
quoteValidDays: () => detail().profile.quoteValidDays || 30,
|
||||
expenseCategories: () => EXPENSE_CATEGORIES.map(value => ({ value, label: t(`billing-expense-${value}`) })),
|
||||
expenseCategory: value => t(`billing-expense-${value}`),
|
||||
lineKind: line => line.kind || 'time',
|
||||
lineKindLabel: line => t(line.kind === 'fee' ? 'billing-line-fee' : 'billing-line-expense'),
|
||||
quoteStatusLabel: status => stateLabel(status, 'quote'),
|
||||
nextQuoteStatuses: quote => (QUOTE_NEXT[quote.status] || []).map(value => ({ value, label: t(QUOTE_ACTION_KEYS[value]) })),
|
||||
quoteFormats: () => [
|
||||
{ value: 'pdf', label: 'PDF', icon: 'fa-file-pdf-o' }, { value: 'svg', label: 'SVG', icon: 'fa-file-image-o' },
|
||||
{ value: 'xlsx', label: 'Excel', icon: 'fa-file-excel-o' }, { value: 'csv', label: 'CSV', icon: 'fa-file-text-o' },
|
||||
],
|
||||
});
|
||||
|
||||
function field(form, name) {
|
||||
const el = form.elements[name];
|
||||
return el ? String(el.value).trim() : '';
|
||||
}
|
||||
|
||||
function numberOrUndefined(value) {
|
||||
return value === '' ? undefined : parseFloat(value);
|
||||
}
|
||||
|
||||
function saveProfile(tpl, changes) {
|
||||
const current = detail().profile || {};
|
||||
return tpl.done(Meteor.callAsync('billingSetProfile', detail().board._id, { ...current, ...changes }));
|
||||
}
|
||||
|
||||
function openQuote(tpl, id) {
|
||||
return Meteor.callAsync('billingQuote', id)
|
||||
.then(quote => tpl.printed.set(quote))
|
||||
.catch(error => tpl.actionError.set(errorText(error)));
|
||||
}
|
||||
|
||||
function openInvoice(tpl, id) {
|
||||
return Meteor.callAsync('billingInvoice', id)
|
||||
.then(invoice => tpl.printed.set(invoice))
|
||||
.catch(error => tpl.actionError.set(errorText(error)));
|
||||
}
|
||||
|
||||
Template.billingBoard.events({
|
||||
'submit .js-billing-budget'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget;
|
||||
const budget = {
|
||||
amount: numberOrUndefined(field(form, 'amount')),
|
||||
currency: field(form, 'currency') || undefined,
|
||||
hours: numberOrUndefined(field(form, 'hours')),
|
||||
start: field(form, 'start') || undefined,
|
||||
end: field(form, 'end') || undefined,
|
||||
};
|
||||
for (const key of Object.keys(budget)) if (budget[key] === undefined) delete budget[key];
|
||||
tpl.done(Meteor.callAsync('billingSetBudget', detail().board._id, budget));
|
||||
},
|
||||
'click .js-billing-remove-budget'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
tpl.done(Meteor.callAsync('billingSetBudget', detail().board._id, null));
|
||||
},
|
||||
'submit .js-billing-rate'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget;
|
||||
const rate = { hourlyRate: parseFloat(field(form, 'hourlyRate')), currency: field(form, 'currency') };
|
||||
if (field(form, 'userId')) rate.userId = field(form, 'userId');
|
||||
if (field(form, 'costRate')) rate.costRate = parseFloat(field(form, 'costRate'));
|
||||
tpl.done(Meteor.callAsync('billingSetRate', detail().board._id, rate).then(() => form.reset()));
|
||||
},
|
||||
'click .js-billing-remove-rate'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
tpl.done(Meteor.callAsync('billingRemoveRate', evt.currentTarget.getAttribute('data-id')));
|
||||
},
|
||||
'submit .js-billing-profile'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget;
|
||||
const changes = {};
|
||||
for (const name of ['issuerName', 'issuerAddress', 'issuerCountry', 'businessId', 'vatId', 'email', 'phone', 'website', 'referenceType', 'footer',
|
||||
'customer', 'customerCountry', 'customerVatId']) {
|
||||
changes[name] = field(form, name);
|
||||
}
|
||||
changes.vatPercent = numberOrUndefined(field(form, 'vatPercent')) || 0;
|
||||
changes.paymentTermsDays = parseInt(field(form, 'paymentTermsDays'), 10);
|
||||
if (!Number.isInteger(changes.paymentTermsDays)) changes.paymentTermsDays = 14;
|
||||
changes.penaltyInterestPercent = numberOrUndefined(field(form, 'penaltyInterestPercent')) || 0;
|
||||
changes.reverseCharge = form.elements.reverseCharge.checked === true;
|
||||
changes.billTime = form.elements.billTime.checked === true;
|
||||
changes.approveTime = form.elements.approveTime.checked === true;
|
||||
changes.quoteValidDays = parseInt(field(form, 'quoteValidDays'), 10);
|
||||
if (!Number.isInteger(changes.quoteValidDays)) changes.quoteValidDays = 30;
|
||||
saveProfile(tpl, changes);
|
||||
},
|
||||
'submit .js-billing-expense'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget;
|
||||
const expense = { date: field(form, 'date'), amount: parseFloat(field(form, 'amount')), currency: field(form, 'currency'),
|
||||
category: field(form, 'category'), description: field(form, 'description'), billable: form.elements.billable.checked === true };
|
||||
if (field(form, 'markupPercent')) expense.markupPercent = parseFloat(field(form, 'markupPercent'));
|
||||
for (const name of ['cardId', 'userId']) if (field(form, name)) expense[name] = field(form, name);
|
||||
tpl.done(Meteor.callAsync('billingAddExpense', detail().board._id, expense).then(() => form.reset()));
|
||||
},
|
||||
'click .js-billing-remove-expense'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
tpl.done(Meteor.callAsync('billingRemoveExpense', evt.currentTarget.getAttribute('data-id')));
|
||||
},
|
||||
'submit .js-billing-fee'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget;
|
||||
const fee = { title: field(form, 'title'), amount: parseFloat(field(form, 'amount')), currency: field(form, 'currency'),
|
||||
date: field(form, 'date'), recurring: field(form, 'recurring') };
|
||||
if (fee.recurring === 'monthly' && field(form, 'end')) fee.end = field(form, 'end');
|
||||
tpl.done(Meteor.callAsync('billingAddFee', detail().board._id, fee).then(() => form.reset()));
|
||||
},
|
||||
'click .js-billing-remove-fee'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
tpl.done(Meteor.callAsync('billingRemoveFee', evt.currentTarget.getAttribute('data-id')));
|
||||
},
|
||||
'click .js-billing-decide'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget.closest('form');
|
||||
const entryIds = [...form.querySelectorAll('input[name=entry]:checked')].map(el => el.value);
|
||||
if (!entryIds.length) return;
|
||||
const approval = { entryIds, decision: evt.currentTarget.getAttribute('data-decision') };
|
||||
if (field(form, 'note')) approval.note = field(form, 'note');
|
||||
tpl.done(Meteor.callAsync('billingApproveTime', detail().board._id, approval));
|
||||
},
|
||||
'submit .js-billing-quote'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget;
|
||||
const request = {};
|
||||
for (const name of ['customer', 'issueDate', 'validUntil', 'notes']) if (field(form, name)) request[name] = field(form, name);
|
||||
tpl.done(Meteor.callAsync('billingCreateQuote', detail().board._id, request).then(id => { form.reset(); return openQuote(tpl, id); }));
|
||||
},
|
||||
'click .js-billing-quote-status'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const el = evt.currentTarget;
|
||||
const status = el.getAttribute('data-status');
|
||||
const box = tpl.find('.js-billing-accept-budget');
|
||||
const options = status === 'accepted' && box && box.checked ? { setBudget: true } : undefined;
|
||||
tpl.done(Meteor.callAsync('billingSetQuoteStatus', el.getAttribute('data-id'), status, options));
|
||||
},
|
||||
'click .js-billing-quote-open'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
openQuote(tpl, evt.currentTarget.getAttribute('data-id'));
|
||||
},
|
||||
'click .js-billing-quote-file'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const el = evt.currentTarget;
|
||||
Meteor.callAsync('billingQuoteFile', el.getAttribute('data-id'), el.getAttribute('data-format'))
|
||||
.then(file => download(file.name, file.mime, file))
|
||||
.catch(error => tpl.actionError.set(errorText(error)));
|
||||
},
|
||||
'change .js-billing-method-type'(evt, tpl) {
|
||||
tpl.methodType.set(evt.currentTarget.value);
|
||||
},
|
||||
'submit .js-billing-method'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget;
|
||||
const type = field(form, 'type');
|
||||
const method = { type };
|
||||
for (const name of PAYMENT_METHODS[type].fields) method[name] = field(form, name);
|
||||
const methods = [...(detail().profile.paymentMethods || []), method];
|
||||
saveProfile(tpl, { paymentMethods: methods }).then(() => form.reset());
|
||||
},
|
||||
'click .js-billing-remove-method'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const index = parseInt(evt.currentTarget.getAttribute('data-index'), 10);
|
||||
saveProfile(tpl, { paymentMethods: (detail().profile.paymentMethods || []).filter((m, i) => i !== index) });
|
||||
},
|
||||
'change .js-billing-period'(evt) {
|
||||
const form = evt.currentTarget;
|
||||
const { setPeriod } = Template.currentData();
|
||||
setPeriod({ periodStart: field(form, 'periodStart'), periodEnd: field(form, 'periodEnd'), includeUndated: form.elements.includeUndated.checked === true });
|
||||
},
|
||||
'submit .js-billing-invoice'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget;
|
||||
const request = {};
|
||||
for (const name of ['customer', 'customerCountry', 'customerVatId', 'reference', 'notes', 'issueDate', 'dueDate']) {
|
||||
if (field(form, name)) request[name] = field(form, name);
|
||||
}
|
||||
if (field(form, 'vatPercent')) request.vatPercent = parseFloat(field(form, 'vatPercent'));
|
||||
const p = Template.currentData().period || {};
|
||||
if (p.periodStart) request.periodStart = p.periodStart;
|
||||
if (p.periodEnd) request.periodEnd = p.periodEnd;
|
||||
if (p.includeUndated) request.includeUndated = true;
|
||||
tpl.done(Meteor.callAsync('billingCreateInvoice', detail().board._id, request).then(id => { form.reset(); return openInvoice(tpl, id); }));
|
||||
},
|
||||
'click .js-billing-status'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const el = evt.currentTarget;
|
||||
tpl.done(Meteor.callAsync('billingSetInvoiceStatus', el.getAttribute('data-id'), el.getAttribute('data-status')));
|
||||
},
|
||||
'click .js-billing-credit'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
tpl.done(Meteor.callAsync('billingCreditInvoice', evt.currentTarget.getAttribute('data-id'), {}).then(id => openInvoice(tpl, id)));
|
||||
},
|
||||
'click .js-billing-open'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
openInvoice(tpl, evt.currentTarget.getAttribute('data-id'));
|
||||
},
|
||||
'click .js-billing-file'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const el = evt.currentTarget;
|
||||
Meteor.callAsync('billingInvoiceFile', el.getAttribute('data-id'), el.getAttribute('data-format'))
|
||||
.then(file => download(file.name, file.mime, file))
|
||||
.catch(error => tpl.actionError.set(errorText(error)));
|
||||
},
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------- the invoice
|
||||
|
||||
Template.billingInvoicePrint.helpers({
|
||||
money,
|
||||
signedMoney,
|
||||
statusLabel: (state, kind) => stateLabel(state, typeof kind === 'string' ? kind : ''),
|
||||
isInvoice: invoice => (invoice.kind || 'invoice') === 'invoice',
|
||||
methodTitle: item => item.label || methodTitle(item.type),
|
||||
formattedReference() {
|
||||
return formatReference(Template.currentData().invoice.paymentReference);
|
||||
},
|
||||
qrSvg: item => qrSvg(item.qr, item.swissCross),
|
||||
barcodeSvg,
|
||||
today: () => new Date().toISOString().slice(0, 10),
|
||||
dueAmount() {
|
||||
const inv = Template.currentData().invoice;
|
||||
return minorToText(inv.dueMinor, inv.currency);
|
||||
},
|
||||
});
|
||||
|
||||
// The board template keeps the open invoice; it hands down setPrinted.
|
||||
function reloadInvoice() {
|
||||
const data = Template.currentData();
|
||||
if (typeof data.reload === 'function') data.reload();
|
||||
return Meteor.callAsync('billingInvoice', data.invoice._id).then(invoice => data.setPrinted(invoice));
|
||||
}
|
||||
|
||||
Template.billingInvoicePrint.events({
|
||||
'submit .js-billing-payment'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget;
|
||||
const payment = { date: form.elements.date.value, amount: parseFloat(form.elements.amount.value) };
|
||||
if (form.elements.method.value.trim()) payment.method = form.elements.method.value.trim();
|
||||
Meteor.callAsync('billingAddPayment', Template.currentData().invoice._id, payment).then(() => reloadInvoice())
|
||||
.catch(error => { form.querySelector('[name=amount]').setCustomValidity(errorText(error)); form.reportValidity(); });
|
||||
},
|
||||
'click .js-billing-remove-payment'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
Meteor.callAsync('billingRemovePayment', Template.currentData().invoice._id, evt.currentTarget.getAttribute('data-id')).then(() => reloadInvoice());
|
||||
},
|
||||
'click .js-billing-print-now'(evt) {
|
||||
evt.preventDefault();
|
||||
window.print();
|
||||
},
|
||||
'click .js-billing-print-close'(evt) {
|
||||
evt.preventDefault();
|
||||
Template.currentData().setPrinted(null);
|
||||
},
|
||||
});
|
||||
@@ -1409,12 +1409,15 @@ body.mobile-mode .pop-over .content-wrapper {
|
||||
@media screen and (min-width: 801px) {
|
||||
.pop-over.pop-over--menu-columns {
|
||||
position: fixed;
|
||||
width: min(960px, calc(100vw - 24px)) !important;
|
||||
/* 1200px: four 240px columns on a 1280px screen. At 960px the Board View
|
||||
menu, grouped under headings, needed a fourth column's worth of height
|
||||
and ran below a 720px-high window (popup-menu-columns.e2e.js). */
|
||||
width: min(1200px, calc(100vw - 24px)) !important;
|
||||
max-width: calc(100vw - 24px) !important;
|
||||
/* Logical, so RTL mirrors it; the value is symmetric, so both centre.
|
||||
inset-inline-end: auto is `right` in LTR and `left` in RTL, so it also
|
||||
overrides the inline left the popup placement code sets. */
|
||||
inset-inline-start: max(12px, calc((100vw - 960px) / 2)) !important;
|
||||
inset-inline-start: max(12px, calc((100vw - 1200px) / 2)) !important;
|
||||
inset-inline-end: auto !important;
|
||||
top: 12px !important;
|
||||
margin-top: 0;
|
||||
@@ -1543,3 +1546,17 @@ body.mobile-mode .pop-over .content-wrapper {
|
||||
.pop-over[data-popup='boardCardSettingsPopup'] .content-container > .clearfix {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* A heading over a group of a menu's entries (the list, card and swimlane
|
||||
menus, 2026-11-20): not an entry - nothing to click. */
|
||||
.pop-over .menu-group-heading {
|
||||
margin: 0;
|
||||
padding: 8px 10px 2px;
|
||||
font-size: 0.8em;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: #6b778c;
|
||||
cursor: default;
|
||||
pointer-events: none;
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
/* Workload page (docs/Features/Workload/Workload.md). */
|
||||
.workload-page {
|
||||
padding: 1rem;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.workload-intro {
|
||||
max-width: 70ch;
|
||||
opacity: 0.85;
|
||||
}
|
||||
.workload-controls {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.4rem 0.8rem;
|
||||
align-items: center;
|
||||
}
|
||||
.workload-controls input,
|
||||
.workload-controls select {
|
||||
width: auto;
|
||||
margin: 0;
|
||||
}
|
||||
.workload-legend {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.3rem 1rem;
|
||||
align-items: center;
|
||||
margin: 0.5rem 0 1rem;
|
||||
}
|
||||
.workload-swatch {
|
||||
display: inline-block;
|
||||
width: 1rem;
|
||||
height: 0.6rem;
|
||||
border-radius: 2px;
|
||||
margin-inline-end: 0.3rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
/* The three states, the colours also used by the bars below. Over 100 % is
|
||||
red; under half full is grey-blue; in between green. */
|
||||
.workload-swatch.is-ok,
|
||||
.workload-cell.is-ok .workload-bar-fill { background: #3cb500; }
|
||||
.workload-swatch.is-under,
|
||||
.workload-cell.is-under .workload-bar-fill { background: #8ea6c0; }
|
||||
.workload-swatch.is-over,
|
||||
.workload-cell.is-over .workload-bar-fill { background: #e53935; }
|
||||
|
||||
.workload-table-wrapper {
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.workload-table {
|
||||
border-collapse: collapse;
|
||||
min-width: 100%;
|
||||
}
|
||||
.workload-table th,
|
||||
.workload-table td {
|
||||
border: 1px solid rgba(0, 0, 0, 0.12);
|
||||
padding: 0.35rem 0.45rem;
|
||||
vertical-align: top;
|
||||
text-align: start;
|
||||
}
|
||||
.workload-week-header span {
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.workload-week-date {
|
||||
font-weight: normal;
|
||||
font-size: 0.85em;
|
||||
opacity: 0.75;
|
||||
}
|
||||
.workload-person {
|
||||
min-width: 10rem;
|
||||
}
|
||||
.workload-person-name {
|
||||
display: block;
|
||||
}
|
||||
.workload-person-capacity {
|
||||
display: block;
|
||||
font-weight: normal;
|
||||
font-size: 0.8em;
|
||||
opacity: 0.75;
|
||||
}
|
||||
.workload-cell {
|
||||
min-width: 7rem;
|
||||
}
|
||||
.workload-cell a {
|
||||
display: block;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.workload-cell.is-over {
|
||||
background: rgba(229, 57, 53, 0.1);
|
||||
}
|
||||
.workload-bar {
|
||||
height: 0.5rem;
|
||||
background: rgba(0, 0, 0, 0.08);
|
||||
border-radius: 3px;
|
||||
overflow: hidden;
|
||||
margin-bottom: 0.2rem;
|
||||
}
|
||||
.workload-bar-fill {
|
||||
height: 100%;
|
||||
}
|
||||
.workload-cell-value,
|
||||
.workload-cell-percent,
|
||||
.workload-cell-allocation,
|
||||
.workload-cell-absent,
|
||||
.workload-cell-holiday {
|
||||
display: block;
|
||||
font-size: 0.85em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.workload-cell.is-over .workload-cell-percent {
|
||||
color: #c62828;
|
||||
font-weight: bold;
|
||||
}
|
||||
.workload-cell.is-placeholder {
|
||||
background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.03) 6px, transparent 6px, transparent 12px);
|
||||
}
|
||||
.workload-unassigned th,
|
||||
.workload-placeholder th {
|
||||
font-style: italic;
|
||||
}
|
||||
.workload-overdue { color: #c62828; }
|
||||
.workload-card-list {
|
||||
margin: 0;
|
||||
padding-inline-start: 1.2rem;
|
||||
}
|
||||
.workload-card-hours {
|
||||
margin-inline-start: 0.5rem;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.workload-planning {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
|
||||
gap: 1rem;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
.workload-section {
|
||||
border: 1px solid rgba(0, 0, 0, 0.12);
|
||||
border-radius: 4px;
|
||||
padding: 0.75rem;
|
||||
}
|
||||
.workload-section h2 {
|
||||
margin-top: 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
.workload-section label {
|
||||
display: block;
|
||||
margin-top: 0.4rem;
|
||||
}
|
||||
.workload-days {
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
.workload-days label {
|
||||
display: inline-block;
|
||||
margin-inline-end: 0.6rem;
|
||||
}
|
||||
.workload-list {
|
||||
padding-inline-start: 1.2rem;
|
||||
}
|
||||
.workload-list a {
|
||||
margin-inline-start: 0.5rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
.workload-saved {
|
||||
margin-inline-start: 0.5rem;
|
||||
color: #2e7d32;
|
||||
}
|
||||
@media screen and (max-width: 800px) {
|
||||
.workload-page { padding: 0.5rem; }
|
||||
.workload-person { min-width: 7rem; }
|
||||
.workload-cell { min-width: 5.5rem; }
|
||||
}
|
||||
|
||||
/* Utilization and skills (docs/Features/Workload/Workload.md). */
|
||||
.workload-person-utilization,
|
||||
.workload-placeholder-skill,
|
||||
.workload-candidates {
|
||||
display: block;
|
||||
font-size: 0.8em;
|
||||
color: #555;
|
||||
}
|
||||
.workload-person-utilization.is-below {
|
||||
color: #b71c1c;
|
||||
}
|
||||
|
||||
/* Labelled native checkboxes: the app-wide material form rule
|
||||
(client/components/forms/forms.css) hides native checkboxes three ways -
|
||||
display, visibility, an offset - which left these with a label and no box
|
||||
to tick or see ticked. All three are undone, as in cardFlow.css. */
|
||||
.workload-page input[type="checkbox"] {
|
||||
display: inline-block;
|
||||
visibility: visible;
|
||||
position: static;
|
||||
inset-inline-start: auto;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
min-height: 0;
|
||||
margin: 0;
|
||||
margin-inline-end: 4px;
|
||||
flex: none;
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
//- Workload (docs/Features/Workload/Workload.md): week by week, how much work
|
||||
the people of the viewer's boards have against the hours they have, with
|
||||
their absences, the public holidays, allocations to boards and the roles a
|
||||
board will need before anybody is named. The numbers come from the server
|
||||
(server/workload.js, models/lib/workload.js); this page only draws them.
|
||||
|
||||
template(name="workloadControls")
|
||||
//- The controls of this page, a view of the shared page sidebar
|
||||
(models/lib/pageSidebar.js), like the Due Cards controls.
|
||||
.workload-controls
|
||||
label(for="workload-from") {{_ 'workload-from'}}
|
||||
input.js-workload-from#workload-from(type="date" value=fromDay)
|
||||
label(for="workload-weeks") {{_ 'workload-weeks'}}
|
||||
select.js-workload-weeks#workload-weeks
|
||||
each weekChoice in weekChoices
|
||||
option(value=weekChoice selected="{{#if $eq weekChoice weeks}}selected{{/if}}") {{weekChoice}}
|
||||
label(for="workload-unit") {{_ 'workload-show'}}
|
||||
select.js-workload-unit#workload-unit
|
||||
option(value="hours" selected="{{#if $eq unit 'hours'}}selected{{/if}}") {{_ 'hours'}}
|
||||
option(value="points" selected="{{#if $eq unit 'points'}}selected{{/if}}") {{_ 'workload-story-points'}}
|
||||
if reportIsAdmin
|
||||
label.workload-all-boards
|
||||
input.js-workload-all-boards(type="checkbox" checked=allBoards)
|
||||
| {{_ 'workload-all-boards'}}
|
||||
|
||||
template(name="workload")
|
||||
if currentUser
|
||||
.workload-page
|
||||
h1 {{_ 'workload-title'}}
|
||||
p.workload-intro {{_ 'workload-intro'}}
|
||||
if loading
|
||||
+spinner
|
||||
else if error
|
||||
.warning {{error}}
|
||||
else
|
||||
if truncated
|
||||
p.warning {{_ 'workload-truncated'}}
|
||||
.workload-legend
|
||||
span.workload-swatch.is-ok
|
||||
| {{_ 'workload-legend-ok'}}
|
||||
span.workload-swatch.is-under
|
||||
| {{_ 'workload-legend-under'}}
|
||||
span.workload-swatch.is-over
|
||||
| {{_ 'workload-legend-over'}}
|
||||
.workload-table-wrapper
|
||||
table.workload-table
|
||||
thead
|
||||
tr
|
||||
th {{_ 'person'}}
|
||||
each week in weekHeaders
|
||||
th.workload-week-header
|
||||
span.workload-week-number {{_ 'workload-week-short' number=week.number}}
|
||||
span.workload-week-date {{week.label}}
|
||||
th {{_ 'workload-unscheduled'}}
|
||||
tbody
|
||||
each person in people
|
||||
tr.workload-row
|
||||
th.workload-person(scope="row")
|
||||
span.workload-person-name {{person.name}}
|
||||
span.workload-person-capacity {{capacityLabel person}}
|
||||
span.workload-person-utilization(class="{{#if person.belowTarget}}is-below{{/if}}" title="{{_ 'workload-utilization-title'}}")
|
||||
| {{_ 'workload-utilization' percent=(utilizationPercent person) hours=person.billableHours}}
|
||||
if isNumber person.capacity.utilizationTarget
|
||||
| / {{person.capacity.utilizationTarget}} %
|
||||
each cell in cells person
|
||||
td.workload-cell(class="{{cell.state}}")
|
||||
a.js-workload-cell(data-user=person.userId data-week=cell.index title=cell.title)
|
||||
.workload-bar
|
||||
.workload-bar-fill(style="width: {{cell.barWidth}}%")
|
||||
span.workload-cell-value {{cell.value}}
|
||||
if cell.percentLabel
|
||||
span.workload-cell-percent {{cell.percentLabel}}
|
||||
if cell.allocationPercent
|
||||
span.workload-cell-allocation(title="{{_ 'workload-allocated'}}")
|
||||
i.fa.fa-thumb-tack
|
||||
| {{cell.allocationPercent}} %
|
||||
if cell.absentDays
|
||||
span.workload-cell-absent(title="{{_ 'workload-absent-days'}}")
|
||||
i.fa.fa-plane
|
||||
| {{cell.absentDays}}
|
||||
if cell.holidayDays
|
||||
span.workload-cell-holiday(title="{{_ 'workload-holiday-days'}}")
|
||||
i.fa.fa-flag
|
||||
| {{cell.holidayDays}}
|
||||
td.workload-unscheduled-cell
|
||||
if person.unscheduledHours
|
||||
span {{hoursLabel person.unscheduledHours}}
|
||||
if person.unestimatedCards
|
||||
span.workload-unestimated(title="{{_ 'workload-unestimated'}}")
|
||||
i.fa.fa-question-circle
|
||||
| {{person.unestimatedCards}}
|
||||
if person.overdueCards
|
||||
span.workload-overdue(title="{{_ 'filter-overdue'}}")
|
||||
i.fa.fa-exclamation-triangle
|
||||
| {{person.overdueCards}}
|
||||
if isOpen person.userId
|
||||
tr.workload-details-row
|
||||
td(colspan=columnCount)
|
||||
+workloadCellCards(cards=openCards)
|
||||
if hasUnassigned
|
||||
tr.workload-row.workload-unassigned
|
||||
th(scope="row") {{_ 'workload-unassigned'}}
|
||||
each cell in unassignedCells
|
||||
td.workload-cell
|
||||
span.workload-cell-value {{cell.value}}
|
||||
td.workload-unscheduled-cell
|
||||
if unassignedUnscheduled
|
||||
span {{unassignedUnscheduled}}
|
||||
each holder in placeholders
|
||||
tr.workload-row.workload-placeholder
|
||||
th(scope="row")
|
||||
span.workload-person-name
|
||||
i.fa.fa-user-o
|
||||
| {{holder.roleName}} × {{holder.headcount}}
|
||||
span.workload-person-capacity {{holder.boardTitle}}
|
||||
if holder.skill
|
||||
span.workload-placeholder-skill
|
||||
i.fa.fa-graduation-cap
|
||||
| {{holder.skill}} ≥ {{holder.skillLevel}}
|
||||
if holder.candidates.length
|
||||
span.workload-candidates {{_ 'workload-candidates'}}: {{candidatesLabel holder}}
|
||||
else
|
||||
span.workload-candidates {{_ 'workload-no-candidates'}}
|
||||
each week in holder.weeks
|
||||
td.workload-cell.is-placeholder
|
||||
if week.allocationPercent
|
||||
span.workload-cell-value {{hoursLabel week.demandHours}}
|
||||
span.workload-cell-percent {{week.allocationPercent}} %
|
||||
td
|
||||
|
||||
+workloadPlanning(report=report)
|
||||
|
||||
template(name="workloadCellCards")
|
||||
if cards.length
|
||||
ul.workload-card-list
|
||||
each card in cards
|
||||
li
|
||||
a(href=card.url) {{card.title}}
|
||||
span.workload-card-hours {{card.label}}
|
||||
if card.overdue
|
||||
span.workload-overdue
|
||||
i.fa.fa-exclamation-triangle
|
||||
else
|
||||
p {{_ 'workload-no-cards'}}
|
||||
|
||||
template(name="workloadPlanning")
|
||||
.workload-planning
|
||||
section.workload-section
|
||||
h2 {{_ 'workload-my-capacity'}}
|
||||
form.js-workload-capacity
|
||||
label(for="workload-hours") {{_ 'workload-hours-per-week'}}
|
||||
input#workload-hours(type="number" name="hoursPerWeek" min="0" max="168" step="0.5" value=capacity.hoursPerWeek)
|
||||
label(for="workload-percent") {{_ 'workload-work-percent'}}
|
||||
input#workload-percent(type="number" name="workPercent" min="0" max="100" step="1" value=capacity.workPercent)
|
||||
fieldset.workload-days
|
||||
legend {{_ 'workload-working-days'}}
|
||||
each day in weekdays
|
||||
label
|
||||
input(type="checkbox" name="workingDays" value=day.value checked=day.checked)
|
||||
| {{day.label}}
|
||||
label(for="workload-skills") {{_ 'workload-skills'}}
|
||||
input#workload-skills(type="text" name="skills" maxlength="2000" value=skillsText placeholder="{{_ 'workload-skills-example'}}")
|
||||
label(for="workload-target") {{_ 'workload-utilization-target'}} %
|
||||
input#workload-target(type="number" name="utilizationTarget" min="0" max="100" step="1" value=capacity.utilizationTarget)
|
||||
button.primary(type="submit") {{_ 'save'}}
|
||||
if capacitySaved
|
||||
span.workload-saved {{_ 'feature-saved'}}
|
||||
|
||||
section.workload-section
|
||||
h2 {{_ 'workload-my-absences'}}
|
||||
if myAbsences.length
|
||||
ul.workload-list
|
||||
each absence in myAbsences
|
||||
li
|
||||
| {{absence.start}} – {{absence.end}} · {{absenceTypeLabel absence.type}}
|
||||
if absence.note
|
||||
| · {{absence.note}}
|
||||
a.js-workload-remove-absence(data-id=absence._id title="{{_ 'delete'}}" aria-label="{{_ 'delete'}}")
|
||||
i.fa.fa-trash
|
||||
form.js-workload-absence
|
||||
label(for="workload-absence-start") {{_ 'start'}}
|
||||
input#workload-absence-start(type="date" name="start" required)
|
||||
label(for="workload-absence-end") {{_ 'card-end'}}
|
||||
input#workload-absence-end(type="date" name="end" required)
|
||||
label(for="workload-absence-type") {{_ 'workload-absence-type'}}
|
||||
select#workload-absence-type(name="type")
|
||||
each type in absenceTypes
|
||||
option(value=type.value) {{type.label}}
|
||||
label(for="workload-absence-note") {{_ 'workload-note'}}
|
||||
input#workload-absence-note(type="text" name="note" maxlength="200")
|
||||
button.primary(type="submit") {{_ 'workload-add-absence'}}
|
||||
|
||||
if managedBoards.length
|
||||
section.workload-section
|
||||
h2 {{_ 'workload-allocations'}}
|
||||
p {{_ 'workload-allocations-intro'}}
|
||||
if allocations.length
|
||||
ul.workload-list
|
||||
each allocation in allocations
|
||||
li
|
||||
| {{allocation.boardTitle}} · {{allocationWho allocation}} · {{allocation.percent}} % · {{allocation.start}} – {{allocation.end}}
|
||||
if allocation.mayRemove
|
||||
a.js-workload-remove-allocation(data-id=allocation._id title="{{_ 'delete'}}" aria-label="{{_ 'delete'}}")
|
||||
i.fa.fa-trash
|
||||
form.js-workload-allocation
|
||||
label(for="workload-allocation-board") {{_ 'board'}}
|
||||
select#workload-allocation-board.js-workload-allocation-board(name="boardId")
|
||||
each board in managedBoards
|
||||
option(value=board._id) {{board.title}}
|
||||
label(for="workload-allocation-person") {{_ 'person'}}
|
||||
select#workload-allocation-person(name="userId")
|
||||
option(value="") {{_ 'workload-role-placeholder'}}
|
||||
each member in allocationMembers
|
||||
option(value=member.userId) {{member.name}}
|
||||
label(for="workload-allocation-role") {{_ 'workload-role'}}
|
||||
input#workload-allocation-role(type="text" name="roleName" maxlength="100" placeholder="{{_ 'workload-role-example'}}")
|
||||
label(for="workload-allocation-headcount") {{_ 'workload-headcount'}}
|
||||
input#workload-allocation-headcount(type="number" name="headcount" min="1" max="100" value="1")
|
||||
label(for="workload-allocation-skill") {{_ 'workload-skill'}}
|
||||
input#workload-allocation-skill(type="text" name="skill" maxlength="50")
|
||||
label(for="workload-allocation-level") {{_ 'workload-skill-level'}}
|
||||
input#workload-allocation-level(type="number" name="skillLevel" min="1" max="5" value="1")
|
||||
label(for="workload-allocation-percent") {{_ 'workload-allocation-percent'}}
|
||||
input#workload-allocation-percent(type="number" name="percent" min="1" max="100" value="50" required)
|
||||
label(for="workload-allocation-start") {{_ 'start'}}
|
||||
input#workload-allocation-start(type="date" name="start" required)
|
||||
label(for="workload-allocation-end") {{_ 'card-end'}}
|
||||
input#workload-allocation-end(type="date" name="end" required)
|
||||
button.primary(type="submit") {{_ 'workload-add-allocation'}}
|
||||
|
||||
section.workload-section
|
||||
h2 {{_ 'workload-holidays'}}
|
||||
if holidays.length
|
||||
ul.workload-list
|
||||
each holiday in holidays
|
||||
li
|
||||
| {{holiday.date}}
|
||||
if holiday.name
|
||||
| · {{holiday.name}}
|
||||
if isAdmin
|
||||
a.js-workload-remove-holiday(data-id=holiday._id title="{{_ 'delete'}}" aria-label="{{_ 'delete'}}")
|
||||
i.fa.fa-trash
|
||||
else
|
||||
p {{_ 'workload-no-holidays'}}
|
||||
if isAdmin
|
||||
form.js-workload-holiday
|
||||
label(for="workload-holiday-date") {{_ 'date'}}
|
||||
input#workload-holiday-date(type="date" name="date" required)
|
||||
label(for="workload-holiday-name") {{_ 'workload-holiday-name'}}
|
||||
input#workload-holiday-name(type="text" name="name" maxlength="100")
|
||||
button.primary(type="submit") {{_ 'workload-add-holiday'}}
|
||||
|
||||
if planningError
|
||||
.warning {{planningError}}
|
||||
@@ -0,0 +1,336 @@
|
||||
// Workload page (docs/Features/Workload/Workload.md). It asks the server for a
|
||||
// report (Meteor method workloadReport, server/workload.js) and draws it; the
|
||||
// planning forms below the table write through the other workload* methods.
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Template } from 'meteor/templating';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import { ReactiveDict } from 'meteor/reactive-dict';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
const { workloadCell, hoursLabel, isoWeekNumber } = require('/models/lib/workloadView');
|
||||
const { weekStart, dayKey, ABSENCE_TYPES, parseSkills, skillsText } = require('/models/lib/workload');
|
||||
|
||||
// The page state, shared by the sidebar controls and the page itself.
|
||||
const state = new ReactiveDict('workload');
|
||||
state.setDefault({
|
||||
from: weekStart(dayKey(new Date())),
|
||||
weeks: 8,
|
||||
unit: 'hours',
|
||||
allBoards: false,
|
||||
reloadAt: 0,
|
||||
});
|
||||
|
||||
const WEEK_CHOICES = [4, 8, 12, 26];
|
||||
|
||||
function t(key, options) {
|
||||
return TAPi18n.__(key, options);
|
||||
}
|
||||
|
||||
function errorText(error) {
|
||||
if (!error) return '';
|
||||
return (error.reason || error.message || String(error));
|
||||
}
|
||||
|
||||
function reload() {
|
||||
state.set('reloadAt', Date.now());
|
||||
}
|
||||
|
||||
Template.workloadControls.helpers({
|
||||
fromDay: () => state.get('from'),
|
||||
weeks: () => state.get('weeks'),
|
||||
weekChoices: () => WEEK_CHOICES,
|
||||
unit: () => state.get('unit'),
|
||||
allBoards: () => state.get('allBoards'),
|
||||
reportIsAdmin: () => state.get('isAdmin') === true,
|
||||
});
|
||||
|
||||
Template.workloadControls.events({
|
||||
'change .js-workload-from'(evt) {
|
||||
const value = evt.currentTarget.value;
|
||||
if (/^\d{4}-\d\d-\d\d$/.test(value)) state.set('from', weekStart(value));
|
||||
},
|
||||
'change .js-workload-weeks'(evt) {
|
||||
const value = parseInt(evt.currentTarget.value, 10);
|
||||
if (WEEK_CHOICES.includes(value)) state.set('weeks', value);
|
||||
},
|
||||
'change .js-workload-unit'(evt) {
|
||||
state.set('unit', evt.currentTarget.value === 'points' ? 'points' : 'hours');
|
||||
},
|
||||
'change .js-workload-all-boards'(evt) {
|
||||
state.set('allBoards', evt.currentTarget.checked === true);
|
||||
},
|
||||
});
|
||||
|
||||
Template.workload.onCreated(function () {
|
||||
this.report = new ReactiveVar(null);
|
||||
this.loading = new ReactiveVar(true);
|
||||
this.error = new ReactiveVar('');
|
||||
this.open = new ReactiveVar(null); // { userId, week }
|
||||
this.autorun(() => {
|
||||
const params = {
|
||||
from: state.get('from'),
|
||||
weeks: state.get('weeks'),
|
||||
allBoards: state.get('allBoards') === true,
|
||||
};
|
||||
state.get('reloadAt');
|
||||
this.loading.set(true);
|
||||
Meteor.callAsync('workloadReport', params).then(report => {
|
||||
this.report.set(report);
|
||||
state.set('isAdmin', report && report.isAdmin === true);
|
||||
this.error.set('');
|
||||
}).catch(error => {
|
||||
this.error.set(errorText(error));
|
||||
}).finally(() => this.loading.set(false));
|
||||
});
|
||||
});
|
||||
|
||||
function report() {
|
||||
return Template.instance().report.get();
|
||||
}
|
||||
|
||||
function boardOf(boardId) {
|
||||
const r = report();
|
||||
return (r && r.boards || []).find(b => b._id === boardId);
|
||||
}
|
||||
|
||||
function cardUrl(card) {
|
||||
const board = boardOf(card.boardId);
|
||||
return FlowRouter.path('card', { boardId: card.boardId, slug: (board && board.slug) || 'board', cardId: card.cardId });
|
||||
}
|
||||
|
||||
Template.workload.helpers({
|
||||
// The spinner only until the first report: a refresh after a save keeps the
|
||||
// page, because the spinner replaces the planning form under it - which
|
||||
// lost its "saved" note and anything still typed there.
|
||||
loading() {
|
||||
const tpl = Template.instance();
|
||||
return tpl.loading.get() && !tpl.report.get();
|
||||
},
|
||||
error: () => Template.instance().error.get(),
|
||||
report: () => report(),
|
||||
truncated: () => !!(report() && report().truncated),
|
||||
people: () => (report() ? report().people : []),
|
||||
placeholders() {
|
||||
const r = report();
|
||||
if (!r) return [];
|
||||
return r.placeholders.map(p => ({ ...p, boardTitle: (boardOf(p.boardId) || {}).title || '' }));
|
||||
},
|
||||
weekHeaders() {
|
||||
const r = report();
|
||||
if (!r) return [];
|
||||
return r.weeks.map(day => ({ number: isoWeekNumber(day), label: day.slice(5).split('-').reverse().join('.') }));
|
||||
},
|
||||
columnCount() {
|
||||
const r = report();
|
||||
return r ? r.weeks.length + 2 : 2;
|
||||
},
|
||||
isNumber: value => typeof value === 'number',
|
||||
utilizationPercent: person => (typeof person.billablePercent === 'number' ? person.billablePercent : 0),
|
||||
candidatesLabel(holder) {
|
||||
const r = report();
|
||||
const names = new Map((r ? r.people : []).map(p => [p.userId, p.name || p.username || p.userId]));
|
||||
return holder.candidates.map(c => `${names.get(c.userId) || c.userId} (${c.level}, ${hoursLabel(c.freeHours, t('workload-hours-short'))})`).join(', ');
|
||||
},
|
||||
capacityLabel(person) {
|
||||
const c = person.capacity;
|
||||
return t('workload-capacity-label', { hours: c.hoursPerWeek, percent: c.workPercent });
|
||||
},
|
||||
hoursLabel(hours) {
|
||||
return hoursLabel(hours, t('workload-hours-short'));
|
||||
},
|
||||
cells(person) {
|
||||
const unit = state.get('unit');
|
||||
const words = { hours: t('workload-hours-short'), points: t('workload-points-short') };
|
||||
return person.weeks.map((week, index) => {
|
||||
const cell = workloadCell(week, unit, words);
|
||||
const parts = [cell.value];
|
||||
if (cell.percentLabel) parts.push(cell.percentLabel);
|
||||
if (week.overloaded) parts.push(t('workload-overloaded'));
|
||||
return { ...cell, index, title: parts.join(' · ') };
|
||||
});
|
||||
},
|
||||
isOpen(userId) {
|
||||
const open = Template.instance().open.get();
|
||||
return !!(open && open.userId === userId);
|
||||
},
|
||||
openCards() {
|
||||
const open = Template.instance().open.get();
|
||||
const person = open && (report() ? report().people : []).find(p => p.userId === open.userId);
|
||||
const week = person && person.weeks[open.week];
|
||||
if (!week) return [];
|
||||
const unit = state.get('unit');
|
||||
return week.cards.map(card => ({
|
||||
...card,
|
||||
url: cardUrl(card),
|
||||
label: unit === 'points' ? `${card.points} ${t('workload-points-short')}` : hoursLabel(card.hours, t('workload-hours-short')),
|
||||
}));
|
||||
},
|
||||
hasUnassigned() {
|
||||
const r = report();
|
||||
return !!(r && (r.unassigned.unscheduledHours || r.unassigned.weeks.some(w => w.loadHours || w.loadPoints)));
|
||||
},
|
||||
unassignedCells() {
|
||||
const r = report();
|
||||
const unit = state.get('unit');
|
||||
if (!r) return [];
|
||||
return r.unassigned.weeks.map(w => ({
|
||||
value: unit === 'points' ? `${w.loadPoints} ${t('workload-points-short')}` : hoursLabel(w.loadHours, t('workload-hours-short')),
|
||||
}));
|
||||
},
|
||||
unassignedUnscheduled() {
|
||||
const r = report();
|
||||
return r && r.unassigned.unscheduledHours ? hoursLabel(r.unassigned.unscheduledHours, t('workload-hours-short')) : '';
|
||||
},
|
||||
});
|
||||
|
||||
Template.workload.events({
|
||||
'click .js-workload-cell'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const userId = evt.currentTarget.getAttribute('data-user');
|
||||
const week = parseInt(evt.currentTarget.getAttribute('data-week'), 10);
|
||||
const open = tpl.open.get();
|
||||
tpl.open.set(open && open.userId === userId && open.week === week ? null : { userId, week });
|
||||
},
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------- planning
|
||||
|
||||
Template.workloadPlanning.onCreated(function () {
|
||||
this.mine = new ReactiveVar(null);
|
||||
this.saved = new ReactiveVar(false);
|
||||
this.error = new ReactiveVar('');
|
||||
this.allocationBoard = new ReactiveVar(null);
|
||||
this.loadMine = () => Meteor.callAsync('workloadMine').then(mine => this.mine.set(mine))
|
||||
.catch(error => this.error.set(errorText(error)));
|
||||
this.loadMine();
|
||||
this.done = promise => promise.then(() => {
|
||||
this.error.set('');
|
||||
this.loadMine();
|
||||
reload();
|
||||
}).catch(error => this.error.set(errorText(error)));
|
||||
});
|
||||
|
||||
function mine() {
|
||||
return Template.instance().mine.get();
|
||||
}
|
||||
|
||||
Template.workloadPlanning.helpers({
|
||||
capacity: () => (mine() ? mine().capacity : { hoursPerWeek: 37.5, workPercent: 100, workingDays: [1, 2, 3, 4, 5] }),
|
||||
skillsText: () => skillsText(mine() ? mine().capacity.skills : []),
|
||||
capacitySaved: () => Template.instance().saved.get(),
|
||||
weekdays() {
|
||||
const days = mine() ? mine().capacity.workingDays : [1, 2, 3, 4, 5];
|
||||
// 2024-01-01 was a Monday: the names come from the browser, in its language.
|
||||
const lang = TAPi18n.getLanguage ? TAPi18n.getLanguage() : undefined;
|
||||
return [1, 2, 3, 4, 5, 6, 7].map(value => {
|
||||
let label = String(value);
|
||||
try { label = new Date(Date.UTC(2024, 0, value)).toLocaleDateString(lang, { weekday: 'short', timeZone: 'UTC' }); } catch (e) { /* keep the number */ }
|
||||
return { value, label, checked: days.includes(value) };
|
||||
});
|
||||
},
|
||||
myAbsences: () => (mine() ? mine().absences : []),
|
||||
absenceTypes: () => ABSENCE_TYPES.map(value => ({ value, label: t(`workload-absence-${value}`) })),
|
||||
absenceTypeLabel: type => t(`workload-absence-${type}`),
|
||||
holidays: () => (mine() ? mine().holidays : []),
|
||||
isAdmin: () => !!(mine() && mine().isAdmin),
|
||||
managedBoards() {
|
||||
const r = Template.currentData().report;
|
||||
return r ? r.boards.filter(b => b.mayManage) : [];
|
||||
},
|
||||
allocations() {
|
||||
const r = Template.currentData().report;
|
||||
return r ? r.allocations : [];
|
||||
},
|
||||
allocationMembers() {
|
||||
const r = Template.currentData().report;
|
||||
if (!r) return [];
|
||||
const boards = r.boards.filter(b => b.mayManage);
|
||||
const chosen = Template.instance().allocationBoard.get();
|
||||
const board = boards.find(b => b._id === chosen) || boards[0];
|
||||
if (!board) return [];
|
||||
const names = new Map(r.people.map(p => [p.userId, p.name || p.username || p.userId]));
|
||||
return board.members.map(userId => ({ userId, name: names.get(userId) || userId }));
|
||||
},
|
||||
allocationWho(allocation) {
|
||||
if (allocation.userId) {
|
||||
const r = Template.currentData().report;
|
||||
const person = r && r.people.find(p => p.userId === allocation.userId);
|
||||
return person ? (person.name || person.username) : allocation.userId;
|
||||
}
|
||||
return `${allocation.roleName} × ${allocation.headcount}`;
|
||||
},
|
||||
planningError: () => Template.instance().error.get(),
|
||||
});
|
||||
|
||||
function formValue(form, name) {
|
||||
const field = form.elements[name];
|
||||
return field ? String(field.value).trim() : '';
|
||||
}
|
||||
|
||||
Template.workloadPlanning.events({
|
||||
'submit .js-workload-capacity'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget;
|
||||
const workingDays = [...form.querySelectorAll('input[name="workingDays"]:checked')].map(i => parseInt(i.value, 10));
|
||||
tpl.saved.set(false);
|
||||
const capacity = {
|
||||
hoursPerWeek: parseFloat(formValue(form, 'hoursPerWeek')),
|
||||
workPercent: parseFloat(formValue(form, 'workPercent')),
|
||||
workingDays,
|
||||
skills: parseSkills(formValue(form, 'skills')),
|
||||
};
|
||||
if (formValue(form, 'utilizationTarget')) capacity.utilizationTarget = parseFloat(formValue(form, 'utilizationTarget'));
|
||||
tpl.done(Meteor.callAsync('workloadSetCapacity', capacity).then(() => tpl.saved.set(true)));
|
||||
},
|
||||
'submit .js-workload-absence'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget;
|
||||
tpl.done(Meteor.callAsync('workloadAddAbsence', {
|
||||
start: formValue(form, 'start'),
|
||||
end: formValue(form, 'end') || formValue(form, 'start'),
|
||||
type: formValue(form, 'type'),
|
||||
note: formValue(form, 'note'),
|
||||
}).then(() => form.reset()));
|
||||
},
|
||||
'click .js-workload-remove-absence'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
tpl.done(Meteor.callAsync('workloadRemoveAbsence', evt.currentTarget.getAttribute('data-id')));
|
||||
},
|
||||
'change .js-workload-allocation-board'(evt, tpl) {
|
||||
tpl.allocationBoard.set(evt.currentTarget.value);
|
||||
},
|
||||
'submit .js-workload-allocation'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget;
|
||||
const userId = formValue(form, 'userId');
|
||||
const allocation = {
|
||||
start: formValue(form, 'start'),
|
||||
end: formValue(form, 'end'),
|
||||
percent: parseFloat(formValue(form, 'percent')),
|
||||
};
|
||||
if (userId) allocation.userId = userId;
|
||||
else {
|
||||
allocation.roleName = formValue(form, 'roleName');
|
||||
allocation.headcount = parseInt(formValue(form, 'headcount'), 10) || 1;
|
||||
}
|
||||
if (formValue(form, 'skill')) {
|
||||
allocation.skill = formValue(form, 'skill');
|
||||
allocation.skillLevel = parseInt(formValue(form, 'skillLevel'), 10) || 1;
|
||||
}
|
||||
tpl.done(Meteor.callAsync('workloadAddAllocation', formValue(form, 'boardId'), allocation));
|
||||
},
|
||||
'click .js-workload-remove-allocation'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
tpl.done(Meteor.callAsync('workloadRemoveAllocation', evt.currentTarget.getAttribute('data-id')));
|
||||
},
|
||||
'submit .js-workload-holiday'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
const form = evt.currentTarget;
|
||||
tpl.done(Meteor.callAsync('workloadAddHoliday', { date: formValue(form, 'date'), name: formValue(form, 'name') })
|
||||
.then(() => form.reset()));
|
||||
},
|
||||
'click .js-workload-remove-holiday'(evt, tpl) {
|
||||
evt.preventDefault();
|
||||
tpl.done(Meteor.callAsync('workloadRemoveHoliday', evt.currentTarget.getAttribute('data-id')));
|
||||
},
|
||||
});
|
||||
@@ -26,12 +26,6 @@ template(name="adminProblems")
|
||||
+problemsSummary
|
||||
else if isPane 'features-performance'
|
||||
+featuresPerformance
|
||||
else if isPane 'features-security'
|
||||
+featuresSecurity
|
||||
else if isPane 'features-delete'
|
||||
+featuresDelete
|
||||
else if isPane 'features-notifications'
|
||||
+featuresNotifications
|
||||
else if isPane 'features-backup'
|
||||
+backupRunsStatus(settingsLink=true)
|
||||
else if isPane 'report-security'
|
||||
@@ -148,7 +142,7 @@ template(name="featuresPerformance")
|
||||
.title {{_ 'cards-loading'}}
|
||||
p.description {{_ 'cards-loading-description'}}
|
||||
|
||||
//- Admin Panel / Problems / Security.
|
||||
//- Admin Panel / Settings / Security (moved from Problems on 2026-11-19).
|
||||
template(name="featuresSecurity")
|
||||
ul.setting-detail
|
||||
li
|
||||
@@ -166,6 +160,13 @@ template(name="featuresSecurity")
|
||||
.materialCheckBox(class="{{#if disableAllImport}}is-checked{{/if}}")
|
||||
span {{_ 'disable-all-import'}}
|
||||
p.description {{_ 'disable-all-import-description'}}
|
||||
//- The largest import upload (server/lib/importDiskSpace.js); empty is no
|
||||
limit, only the free disk space.
|
||||
li
|
||||
label.flex
|
||||
span {{_ 'import-max-megabytes'}}
|
||||
input.js-import-max-megabytes(type="number" min="0" step="1" value="{{importMaxMegabytes}}" placeholder="{{_ 'import-max-megabytes-none'}}")
|
||||
p.description {{_ 'import-max-megabytes-description'}}
|
||||
li
|
||||
a.flex.js-toggle-disable-all-export
|
||||
.materialCheckBox(class="{{#if disableAllExport}}is-checked{{/if}}")
|
||||
@@ -192,7 +193,7 @@ template(name="featuresSecurity")
|
||||
span {{_ 'anonymize-export-users'}}
|
||||
p.description {{_ 'anonymize-export-users-description'}}
|
||||
|
||||
//- Admin Panel / Problems / Delete.
|
||||
//- Admin Panel / Settings / Delete (moved from Problems on 2026-11-19).
|
||||
template(name="featuresDelete")
|
||||
ul.setting-detail
|
||||
li
|
||||
@@ -202,7 +203,7 @@ template(name="featuresDelete")
|
||||
p.description {{_ 'enable-permanent-delete-description'}}
|
||||
p.description {{permanentDeleteRecoveryDescription}}
|
||||
|
||||
//- Admin Panel / Problems / Notifications.
|
||||
//- Admin Panel / Settings / Activities and notifications (moved from Problems on 2026-11-19).
|
||||
template(name="featuresNotifications")
|
||||
ul.setting-detail
|
||||
li
|
||||
|
||||
@@ -298,19 +298,10 @@ Template.adminProblems.onDestroyed(function () {
|
||||
// are now the single .js-left-menu-item one below.
|
||||
const PROBLEMS_MENU = [
|
||||
{ id: 'report-summary', icon: 'fa-list', labelKey: 'summary' },
|
||||
{ separator: true },
|
||||
// Two groups, each named by a heading rather than by another entry: there is
|
||||
// nothing to click on a group title (docs/Features/All-Boards/Left-Menu.md). Both use an
|
||||
// i18n key the app already has.
|
||||
{ heading: true, labelKey: 'settings' },
|
||||
// Moved here from Admin Panel / Features. They are settings rather than reports -
|
||||
// which is what this heading says - but they are what an admin reaches for when
|
||||
// something is unsafe or noisy, which is what this page is about. Performance
|
||||
// sits with the reports below, beside the Speed / Tests / CPU usage streams it is
|
||||
// about.
|
||||
{ id: 'features-security', icon: 'fa-shield', labelKey: 'features-security', emoji: true },
|
||||
{ id: 'features-delete', icon: 'fa-trash', labelKey: 'delete' },
|
||||
{ id: 'features-notifications', icon: 'fa-bell', labelKey: 'features-notifications', emoji: true },
|
||||
// Security, Delete and Notifications were a "Settings" group here; they are
|
||||
// settings, not problems, and moved to Admin Panel / Settings on 2026-11-19
|
||||
// (Security, Activities and notifications, Delete). Their old addresses
|
||||
// redirect there (models/lib/adminUrls.js MOVED_PANES).
|
||||
// Did last night's backup work? The status and history of the Admin Panel
|
||||
// backup (backupRunsStatus.jade), with a link to its settings in Attachments /
|
||||
// Backup. A failed or overdue backup is also listed on Summary.
|
||||
@@ -535,7 +526,7 @@ function switchMenu(event, tmpl) {
|
||||
// nothing to fetch. Everything else falls through to loadReport().
|
||||
const SELF_LOADING_PANES = [
|
||||
'report-summary',
|
||||
'features-performance', 'features-security', 'features-delete', 'features-notifications',
|
||||
'features-performance',
|
||||
// backupRunsStatus.jade loads its own data (the backupHistory method).
|
||||
'features-backup',
|
||||
'report-security', 'report-speed', 'report-tests', 'report-cpu', 'report-ram', 'report-disk',
|
||||
@@ -1270,6 +1261,10 @@ const featurePaneHelpers = {
|
||||
disableAllExport() {
|
||||
return (ReactiveCache.getCurrentSetting() || {}).disableAllExport;
|
||||
},
|
||||
importMaxMegabytes() {
|
||||
const mb = (ReactiveCache.getCurrentSetting() || {}).importMaxMegabytes;
|
||||
return mb > 0 ? mb : '';
|
||||
},
|
||||
disableImportAvatars() {
|
||||
return (ReactiveCache.getCurrentSetting() || {}).disableImportAvatars;
|
||||
},
|
||||
@@ -1311,6 +1306,14 @@ const featurePaneEvents = {
|
||||
'click .js-toggle-disable-all-export'() {
|
||||
toggleSettingField('disableAllExport');
|
||||
},
|
||||
// Empty or 0 is no limit; anything else a whole number of megabytes.
|
||||
'change .js-import-max-megabytes'(event) {
|
||||
const setting = ReactiveCache.getCurrentSetting();
|
||||
if (!setting) return;
|
||||
const mb = Math.floor(Number(event.currentTarget.value));
|
||||
Settings.update(setting._id, Number.isFinite(mb) && mb > 0
|
||||
? { $set: { importMaxMegabytes: mb } } : { $unset: { importMaxMegabytes: '' } });
|
||||
},
|
||||
'click .js-toggle-disable-import-avatars'() {
|
||||
toggleSettingField('disableImportAvatars');
|
||||
},
|
||||
|
||||
@@ -66,6 +66,8 @@ template(name="people")
|
||||
+templatesGeneral
|
||||
else if domainSetting.get
|
||||
+domainGeneral
|
||||
else if cloudSetting.get
|
||||
+cloudPanelSettings
|
||||
|
||||
|
||||
template(name="orgGeneral")
|
||||
@@ -187,6 +189,7 @@ template(name="orgRow")
|
||||
| {{_ 'yes'}}
|
||||
else
|
||||
| {{_ 'no'}}
|
||||
td.org-feature-profile {{featureProfileNames}}
|
||||
td.text-center
|
||||
input.js-toggle-org-feature(type="checkbox", data-feature="orgSharedTemplates", checked=orgData.orgSharedTemplates)
|
||||
td.text-center
|
||||
@@ -227,6 +230,7 @@ template(name="teamRow")
|
||||
| {{_ 'yes'}}
|
||||
else
|
||||
| {{_ 'no'}}
|
||||
td.team-feature-profile {{featureProfileNames}}
|
||||
td.text-center
|
||||
input.js-toggle-team-feature(type="checkbox", data-feature="teamSharedTemplates", checked=teamData.teamSharedTemplates)
|
||||
td.text-center
|
||||
@@ -285,6 +289,7 @@ template(name="peopleRow")
|
||||
| {{_ 'yes'}}
|
||||
else
|
||||
| {{_ 'no'}}
|
||||
td.people-feature-profile {{featureProfileName}}
|
||||
td.account-active-status
|
||||
if userData.loginDisabled
|
||||
span.text-red.js-toggle-active-status(data-user-id=userData._id, data-is-active="false", title="{{_ 'admin-people-user-inactive'}}")
|
||||
|
||||
@@ -148,6 +148,7 @@ Template.people.onCreated(function () {
|
||||
// #5850: Admin Panel > People > Domains tab. The domains table itself
|
||||
// (domainGeneral) now owns its data via getDomainsWithUserCountsPage.
|
||||
this.domainSetting = new ReactiveVar(false);
|
||||
this.cloudSetting = new ReactiveVar(false);
|
||||
this.subscribe('inviteToBoardRolesSettings');
|
||||
this.findOrgsOptions = new ReactiveVar({});
|
||||
this.findTeamsOptions = new ReactiveVar({});
|
||||
@@ -439,6 +440,7 @@ Template.people.onCreated(function () {
|
||||
this.rolesSetting.set('roles-setting' === targetID);
|
||||
this.templatesSetting.set('templates-setting' === targetID);
|
||||
this.domainSetting.set('domains-setting' === targetID);
|
||||
this.cloudSetting.set('cloud-setting' === targetID);
|
||||
|
||||
// The Domains table (domainGeneral) now fetches its own single page from
|
||||
// getDomainsWithUserCountsPage (server-side search / sort / pagination), so
|
||||
@@ -549,6 +551,9 @@ function peopleMenu(user) {
|
||||
// with, so it belongs beside the e-mail settings rather than at the end of
|
||||
// the menu, after the roles and template checkbox lists.
|
||||
{ id: 'domains-setting', icon: 'fa-at', labelKey: 'domains' },
|
||||
// The Cloud Panel's domain and SuperAdmin, as Weddy has them at the same
|
||||
// place (docs/Features/Admin-Panel/Cloud-Panel.md). Site admins only.
|
||||
{ id: 'cloud-setting', icon: 'fa-cloud', labelKey: 'cloud' },
|
||||
{ id: 'org-setting', icon: 'fa-globe', labelKey: 'organizations' },
|
||||
{ id: 'team-setting', icon: 'fa-users', labelKey: 'teams' },
|
||||
{ id: 'people-setting', icon: 'fa-user', labelKey: 'people' },
|
||||
@@ -661,6 +666,10 @@ function peopleDocs(tpl) {
|
||||
// that had no date and showed "-", although the people publication
|
||||
// sends it.
|
||||
lastConnectionDate: 1,
|
||||
// #6837: the Feature profiles column decides from these three.
|
||||
featureProfileId: 1,
|
||||
teams: 1,
|
||||
orgs: 1,
|
||||
},
|
||||
}).fetch();
|
||||
// The server's order, not minimongo's: `$in` does not preserve it.
|
||||
@@ -672,6 +681,9 @@ const PEOPLE_COLUMNS = [
|
||||
{ labelKey: 'username' },
|
||||
{ labelKey: 'email' },
|
||||
{ labelKey: 'admin' },
|
||||
// #6837: which feature profile applies to the person - edited in Admin Panel
|
||||
// / Settings / Feature profiles, shown here so it can be found from People.
|
||||
{ labelKey: 'feature-profiles' },
|
||||
{ labelKey: 'active-person' },
|
||||
{ labelKey: 'location' },
|
||||
{ labelKey: 'accounts-lockout-status' },
|
||||
@@ -697,6 +709,8 @@ const TEAM_COLUMNS = [
|
||||
{ labelKey: 'website' },
|
||||
{ labelKey: 'createdAt' },
|
||||
{ labelKey: 'active-team' },
|
||||
// #6837: the feature profiles assigned to this team (Settings / Feature profiles).
|
||||
{ labelKey: 'feature-profiles' },
|
||||
{ headerTemplate: 'teamFeatureHeader',
|
||||
headerData: { labelKey: 'team-shared-templates', feature: 'teamSharedTemplates' } },
|
||||
{ headerTemplate: 'teamFeatureHeader',
|
||||
@@ -713,6 +727,8 @@ const ORG_COLUMNS = [
|
||||
{ labelKey: 'website' },
|
||||
{ labelKey: 'createdAt' },
|
||||
{ labelKey: 'active-org' },
|
||||
// #6837: the feature profiles assigned to this organization.
|
||||
{ labelKey: 'feature-profiles' },
|
||||
{ headerTemplate: 'orgFeatureHeader',
|
||||
headerData: { labelKey: 'org-shared-templates', feature: 'orgSharedTemplates' } },
|
||||
{ headerTemplate: 'orgFeatureHeader',
|
||||
@@ -955,6 +971,9 @@ Template.people.helpers({
|
||||
domainSetting() {
|
||||
return Template.instance().domainSetting;
|
||||
},
|
||||
cloudSetting() {
|
||||
return Template.instance().cloudSetting;
|
||||
},
|
||||
orgList() {
|
||||
const tpl = Template.instance();
|
||||
// The 'org' publication already returns only the current page (server-side
|
||||
@@ -1464,34 +1483,47 @@ Template.rolesGeneral.events({
|
||||
|
||||
// Feature #3313 "Shared templates": admin view of users' shareable template
|
||||
// boards, grouped by Organization / Team / email Domain. The three checkboxes
|
||||
// are LIVE view filters (no Save button) — each toggles a grouping dimension and
|
||||
// the selection is remembered (persisted in localStorage) so it survives reload.
|
||||
const SHARED_TEMPLATES_SCOPE_KEY = 'sharedTemplatesScopes';
|
||||
const SHARED_TEMPLATES_VALID_SCOPES = ['organizations', 'teams', 'domains'];
|
||||
// write the instance setting Settings.sharedTemplatesScopes at once (no Save
|
||||
// button, like every checkbox here): it is both which groupings this view lists
|
||||
// and which group kinds every user may share a template board with
|
||||
// (models/lib/sharedTemplatesScopes.js). It used to live in this browser's
|
||||
// localStorage, so it differed per browser and was empty for everyone else.
|
||||
const sharedScopes = require('/models/lib/sharedTemplatesScopes');
|
||||
|
||||
function loadSharedTemplatesScopes() {
|
||||
try {
|
||||
const raw = window.localStorage.getItem(SHARED_TEMPLATES_SCOPE_KEY);
|
||||
const arr = raw ? JSON.parse(raw) : [];
|
||||
return Array.isArray(arr)
|
||||
? arr.filter(s => SHARED_TEMPLATES_VALID_SCOPES.includes(s))
|
||||
: [];
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
return sharedScopes.sharedTemplatesScopes(ReactiveCache.getCurrentSetting());
|
||||
}
|
||||
|
||||
function saveSharedTemplatesScopes(scopes) {
|
||||
const setting = ReactiveCache.getCurrentSetting();
|
||||
if (!setting) return;
|
||||
Settings.update(setting._id, {
|
||||
$set: { sharedTemplatesScopes: sharedScopes.normalizeScopes(scopes) },
|
||||
});
|
||||
}
|
||||
|
||||
// An install that has never stored the setting takes over the ticks an admin
|
||||
// made in this browser while it was localStorage, once; the old key is then
|
||||
// dropped so it cannot come back.
|
||||
function carryOverLegacyScopes() {
|
||||
let legacy = [];
|
||||
try {
|
||||
window.localStorage.setItem(SHARED_TEMPLATES_SCOPE_KEY, JSON.stringify(scopes));
|
||||
const raw = window.localStorage.getItem(sharedScopes.LEGACY_STORAGE_KEY);
|
||||
legacy = sharedScopes.normalizeScopes(raw ? JSON.parse(raw) : []);
|
||||
window.localStorage.removeItem(sharedScopes.LEGACY_STORAGE_KEY);
|
||||
} catch (e) {
|
||||
// ignore storage errors (e.g. private mode)
|
||||
return;
|
||||
}
|
||||
const setting = ReactiveCache.getCurrentSetting();
|
||||
if (legacy.length && setting && setting.sharedTemplatesScopes === undefined) {
|
||||
saveSharedTemplatesScopes(legacy);
|
||||
}
|
||||
}
|
||||
|
||||
Template.templatesGeneral.onCreated(function () {
|
||||
// Restore the previously-checked scopes (empty by default → nothing shown).
|
||||
this.selectedScopes = new ReactiveVar(loadSharedTemplatesScopes());
|
||||
carryOverLegacyScopes();
|
||||
// The instance setting, reactively: another admin's change shows here too.
|
||||
this.selectedScopes = { get: loadSharedTemplatesScopes };
|
||||
// Raw rows returned by the admin-only method (one entry per user whose
|
||||
// Templates board is non-empty).
|
||||
this.sharedTemplates = new ReactiveVar([]);
|
||||
@@ -1587,31 +1619,48 @@ Template.templatesGeneral.events({
|
||||
'click a.js-toggle-template-scope'(event, tpl) {
|
||||
event.preventDefault();
|
||||
const scope = $(event.currentTarget).data('scope');
|
||||
const current = tpl.selectedScopes.get().slice();
|
||||
const idx = current.indexOf(scope);
|
||||
if (idx >= 0) {
|
||||
current.splice(idx, 1);
|
||||
} else {
|
||||
current.push(scope);
|
||||
}
|
||||
tpl.selectedScopes.set(current);
|
||||
saveSharedTemplatesScopes(current);
|
||||
saveSharedTemplatesScopes(sharedScopes.toggleScope(tpl.selectedScopes.get(), scope));
|
||||
},
|
||||
});
|
||||
|
||||
// #6837: the names of the feature profiles a team or organization is named in,
|
||||
// in the page's order (the first applies to a member without their own), or '-'.
|
||||
function groupProfileNames(field, id) {
|
||||
const { storedProfiles } = require('/models/lib/featureProfiles');
|
||||
const names = storedProfiles(ReactiveCache.getCurrentSetting())
|
||||
.filter(profile => id && (profile[field] || []).includes(id)).map(profile => profile.name);
|
||||
return names.length ? names.join(', ') : '-';
|
||||
}
|
||||
|
||||
Template.orgRow.helpers({
|
||||
orgData() {
|
||||
return this.org || ReactiveCache.getOrg(this.orgId);
|
||||
},
|
||||
featureProfileNames() {
|
||||
const org = this.org || ReactiveCache.getOrg(this.orgId);
|
||||
return groupProfileNames('orgIds', org && org._id);
|
||||
},
|
||||
});
|
||||
|
||||
Template.teamRow.helpers({
|
||||
teamData() {
|
||||
return this.team || ReactiveCache.getTeam(this.teamId);
|
||||
},
|
||||
featureProfileNames() {
|
||||
const team = this.team || ReactiveCache.getTeam(this.teamId);
|
||||
return groupProfileNames('teamIds', team && team._id);
|
||||
},
|
||||
});
|
||||
|
||||
Template.peopleRow.helpers({
|
||||
// #6837: the feature profile that applies to this person, or '-'.
|
||||
featureProfileName() {
|
||||
// The row's user, found the way userData below finds it.
|
||||
const id = this._id || (this.user && this.user._id);
|
||||
const doc = (id && ReactiveCache.getUser(id)) || this.user || null;
|
||||
const profile = require('/models/lib/featureProfiles').profileForUser(ReactiveCache.getCurrentSetting(), doc);
|
||||
return profile ? profile.name : '-';
|
||||
},
|
||||
loginCountries() {
|
||||
const userId = this.user && this.user._id;
|
||||
return (this.countries || []).map(country => ({ ...country, userId }));
|
||||
|
||||
@@ -97,7 +97,7 @@ template(name="problemsSummary")
|
||||
input.js-problem-check(type="checkbox" data-stream="{{area.stream}}")
|
||||
i.fa.fa-exclamation-triangle
|
||||
span.admin-problem-path {{_ 'admin-panel'}} → {{_ 'problems'}} → {{areaLabel area.stream}}
|
||||
span.admin-problem-count {{area.count}} {{_ 'new-problems'}}
|
||||
span.admin-problem-count {{_ 'new-problems-count' count=area.count}}
|
||||
.admin-problem-actions
|
||||
button.js-ack-checked.primary {{_ 'acknowledge'}}
|
||||
button.js-clear-checked {{_ 'clear-problems'}}
|
||||
|
||||
@@ -104,9 +104,11 @@ Template.problemsSummary.helpers({
|
||||
// A key of its own: List Sync's "never synced" may be translated as
|
||||
// "never synced", which reads wrong beside "Last Run".
|
||||
if (!d || !d.at) return TAPi18n.__('data-health-never-run');
|
||||
// "<when> - <checks that found something>/<checks>"
|
||||
// "<when> - Checks with findings: <found> / <checks>". A bare "8/31"
|
||||
// left the admin guessing what was counted.
|
||||
const at = new Date(d.at).toISOString().replace('T', ' ').slice(0, 16) + ' UTC';
|
||||
const text = `${at} - ${d.found}/${d.checks}`;
|
||||
const found = TAPi18n.__('data-health-checks-found', { found: d.found, checks: d.checks });
|
||||
const text = `${at} - ${found}`;
|
||||
return d.error ? `${text} - ${d.error}` : text;
|
||||
},
|
||||
repairRunning() {
|
||||
|
||||
@@ -26,7 +26,20 @@ template(name="setting")
|
||||
//- templates are global, so the pane renders here.
|
||||
+statistics
|
||||
else if isTableVisibilityModeSetting
|
||||
+tableVisibilityModeSettings
|
||||
//- Security, Activities and notifications and Delete below moved
|
||||
here from Admin Panel / Problems (2026-11-19); their templates and
|
||||
handlers stay in adminProblems.jade / adminProblems.js.
|
||||
+tableVisibilityModeSettings(part="appearance")
|
||||
else if isFeaturesSetting
|
||||
+tableVisibilityModeSettings(part="features")
|
||||
else if isFeatureProfilesSetting
|
||||
+tableVisibilityModeSettings(part="profiles")
|
||||
else if isPrivacySecuritySetting
|
||||
+featuresSecurity
|
||||
else if isActivitiesSetting
|
||||
+featuresNotifications
|
||||
else if isDeleteSetting
|
||||
+featuresDelete
|
||||
else if isAnnouncementSetting
|
||||
+announcementSettings
|
||||
else if isAccessibilitySetting
|
||||
@@ -322,335 +335,371 @@ template(name='email')
|
||||
//- groups under it rather than as several pages.
|
||||
template(name='tableVisibilityModeSettings')
|
||||
ul#tableVisibilityMode-setting.setting-detail
|
||||
//- Every group here writes the INSTANCE settings, so it is site-admin only.
|
||||
//- The one exception is "Change color" below, which an Organization's own
|
||||
//- admin sets for their Organization (models/lib/tenantAdmin.js themeTarget).
|
||||
if isSiteAdmin
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'all-boards-hide'}}
|
||||
//- One checkbox per setting instead of a Yes/No pair: each of these is on or
|
||||
//- off, and the group's own title already says what ticking one means (All
|
||||
//- Boards: Hide …). Same checkbox as everywhere else in the Admin Panel -
|
||||
//- Announcement's "Active System-Wide Announcement" - so it has the plain
|
||||
//- square when off, the green tick when on, and the animation between.
|
||||
//- The Save button below reads the ticks, as it read the radios.
|
||||
li.tableVisibilityMode-form
|
||||
//- "Public boards", under the "All Boards: Hide" title above: ticked hides
|
||||
//- them, which is what allowPrivateOnly does. The setting's own key keeps its
|
||||
//- sentence - boardBody.jade shows it as the message on a board you may not
|
||||
//- open, where a two-word label would say nothing.
|
||||
a.flex.js-toggle-all-boards-hide
|
||||
.materialCheckBox#accounts-allowPrivateOnly(class="{{#if allowPrivateOnly}}is-checked{{/if}}")
|
||||
span {{_ 'public-boards'}}
|
||||
li.tableVisibilityMode-form
|
||||
//- #4475: ticked forbids anyone who is not a site admin from creating
|
||||
//- new boards. Same Save button and same collection as the setting
|
||||
//- above - only the checked key differs.
|
||||
a.flex.js-toggle-all-boards-hide
|
||||
.materialCheckBox#accounts-boardCreationAdminOnly(class="{{#if boardCreationAdminOnly}}is-checked{{/if}}")
|
||||
span {{_ 'board-creation-admin-only'}}
|
||||
li.tableVisibilityMode-form
|
||||
//- #4575: ticked lets a board admin open an Instance or Public board
|
||||
//- to editing by every signed-in user. Off: no board can.
|
||||
a.flex.js-toggle-all-boards-hide
|
||||
.materialCheckBox#accounts-allowInstanceEditing(class="{{#if allowInstanceEditing}}is-checked{{/if}}")
|
||||
span {{_ 'instance-editing-allowed'}}
|
||||
li.hideBoardActivities-form
|
||||
a.flex.js-toggle-all-boards-hide
|
||||
.materialCheckBox#hide-board-activities(class="{{#if currentSetting.hideBoardActivitiesOnAllBoards}}is-checked{{/if}}")
|
||||
span {{_ 'board-activities'}}
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-all-boards-hide
|
||||
.materialCheckBox#hide-card-counter-list(class="{{#if currentSetting.hideCardCounterList}}is-checked{{/if}}")
|
||||
span {{_ 'card-counter-list'}}
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-all-boards-hide
|
||||
.materialCheckBox#hide-board-member-list(class="{{#if currentSetting.hideBoardMemberList}}is-checked{{/if}}")
|
||||
span {{_ 'board-member-list'}}
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'wait-spinner'}}
|
||||
+selectSpinnerName(spinnerName=currentSetting.spinnerName)
|
||||
//- #4421: an org whose "Public" means "public within our organization"
|
||||
//- rather than public on the internet can replace the wording shown
|
||||
//- under Private/Public in the board visibility popup and the
|
||||
//- create-board popup. Empty = unchanged i18n default text
|
||||
//- (imports/i18n/lib/visibilityDesc.js).
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-private-desc'}}
|
||||
.form-group
|
||||
textarea.wekan-form-control#custom-private-board-desc(data-editor-submit=".js-visibility-all-boards-save" rows="2" placeholder="{{_ 'custom-private-desc-placeholder'}}")= currentSetting.customPrivateBoardDesc
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-public-desc'}}
|
||||
.form-group
|
||||
textarea.wekan-form-control#custom-public-board-desc(data-editor-submit=".js-visibility-all-boards-save" rows="2" placeholder="{{_ 'custom-public-desc-placeholder'}}")= currentSetting.customPublicBoardDesc
|
||||
li
|
||||
//- One Save per section, at its end, above the rule that closes it. It writes
|
||||
//- this section's fields and nothing else, so saving one group can never
|
||||
//- overwrite what you were editing in another.
|
||||
button.js-visibility-all-boards-save.primary {{_ 'save'}}
|
||||
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
//- #6736: which optional features this WeKan offers. A ticked feature is
|
||||
//- on for everyone; an unticked one is hidden from the interface (not
|
||||
//- greyed out), keeps its data, and changes no permission. The rows come
|
||||
//- from models/lib/instanceFeatures.js, so the page and the places that
|
||||
//- hide a feature read the same catalog.
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'features'}}
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'features-desc'}}
|
||||
each featureRows
|
||||
li.tableVisibilityMode-form.js-feature-row(data-feature=key)
|
||||
a.flex.js-toggle-feature
|
||||
.materialCheckBox.js-feature-enabled(class="{{#if enabled}}is-checked{{/if}}")
|
||||
span {{_ labelKey}}
|
||||
if awaitingApproval
|
||||
span.feature-awaiting-approval {{_ 'feature-awaiting-approval'}}
|
||||
.feature-desc {{_ descKey}}
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-feature
|
||||
.materialCheckBox#feature-approval-required(class="{{#if currentSetting.featureApprovalRequired}}is-checked{{/if}}")
|
||||
span {{_ 'feature-approval-required'}}
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-feature
|
||||
.materialCheckBox#feature-preview-admins(class="{{#if currentSetting.featurePreviewAdmins}}is-checked{{/if}}")
|
||||
span {{_ 'feature-preview-admins'}}
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'feature-pilot-users'}}
|
||||
.form-group
|
||||
textarea.wekan-form-control#feature-pilot-users(data-editor-submit=".js-visibility-features-save" rows="2" placeholder="{{_ 'feature-pilot-users-placeholder'}}")= featurePilotUsernames
|
||||
//- The card fields every board shows: one tick per field type of Board
|
||||
//- Settings / Card, all ticked by default. Unticked hides it on every
|
||||
//- card, minicard and Board Settings / Card - visibility only, no data or
|
||||
//- board setting changes. No ordering here: the order is each board's own.
|
||||
//- models/lib/cardFieldVisibility.js
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'card-field-visibility'}}
|
||||
.feature-desc {{_ 'card-field-visibility-desc'}}
|
||||
each cardFieldRows
|
||||
li.tableVisibilityMode-form.js-card-field-row(data-card-field=key)
|
||||
a.flex.js-toggle-feature
|
||||
.materialCheckBox.js-card-field-enabled(class="{{#if enabled}}is-checked{{/if}}")
|
||||
span.card-field-visibility-label
|
||||
each icon in icons
|
||||
i.fa(class=icon)
|
||||
| {{title}}
|
||||
li
|
||||
button.js-visibility-features-save.primary {{_ 'save'}}
|
||||
span.js-visibility-features-status
|
||||
|
||||
//- #2460: SQRL sign-in, and #4198: public boards on the fediverse
|
||||
(ActivityPub) - optional features this WeKan offers, each off by
|
||||
default and saved as soon as it is switched.
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-sqrl
|
||||
.materialCheckBox#sqrl-enabled(class="{{#if currentSetting.sqrlEnabled}}is-checked{{/if}}")
|
||||
span {{_ 'sqrl-enabled'}}
|
||||
.feature-desc {{_ 'sqrl-desc'}}
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-activity-pub
|
||||
.materialCheckBox#activity-pub-enabled(class="{{#if currentSetting.activityPubEnabled}}is-checked{{/if}}")
|
||||
span {{_ 'activity-pub-enabled'}}
|
||||
.feature-desc {{_ 'activity-pub-desc'}}
|
||||
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
//- #2217: boards may show their Rules to members, read-only. Off by
|
||||
default; each board admin then decides on the board's Rules page.
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'rules'}}
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-rules-read-only
|
||||
.materialCheckBox#rules-read-only-for-members(class="{{#if currentSetting.rulesReadOnlyForMembers}}is-checked{{/if}}")
|
||||
span {{_ 'rules-read-only-for-members'}}
|
||||
.feature-desc {{_ 'rules-read-only-for-members-desc'}}
|
||||
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
//- Optional APIs (models/lib/optionalApis.js): REST APIs in the shape of
|
||||
Trello's, Jira's, GitHub's and Gitea's, so their clients can use WeKan
|
||||
as their backend. Each is off until ticked, and has no rights of its
|
||||
own: it is WeKan's REST API, with the caller's own permissions.
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'optional-apis'}}
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'optional-apis-desc'}}
|
||||
each optionalApiRows
|
||||
li.tableVisibilityMode-form.js-optional-api-row(data-api=key)
|
||||
a.flex.js-toggle-feature
|
||||
.materialCheckBox.js-optional-api-enabled(class="{{#if enabled}}is-checked{{/if}}")
|
||||
span {{_ labelKey}}
|
||||
.feature-desc {{_ descKey}}
|
||||
.feature-desc
|
||||
code {{base}}
|
||||
li
|
||||
button.js-optional-apis-save.primary {{_ 'save'}}
|
||||
span.js-optional-apis-status
|
||||
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'date'}}
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-date-format
|
||||
.materialCheckBox#global-date-format-enabled(class="{{#if currentSetting.hideDateFormat}}is-checked{{/if}}")
|
||||
span {{_ 'date-format'}}:
|
||||
select.wekan-form-control#global-date-format(aria-label="{{_ 'date-format'}}")
|
||||
option(value="YYYY-MM-DD" selected="{{#if isGlobalDateFormat 'YYYY-MM-DD'}}selected{{/if}}") {{_ 'date-format-yyyy-mm-dd'}} · {{_ 'time'}}
|
||||
option(value="DD-MM-YYYY" selected="{{#if isGlobalDateFormat 'DD-MM-YYYY'}}selected{{/if}}") {{_ 'date-format-dd-mm-yyyy'}} · {{_ 'time'}}
|
||||
option(value="MM-DD-YYYY" selected="{{#if isGlobalDateFormat 'MM-DD-YYYY'}}selected{{/if}}") {{_ 'date-format-mm-dd-yyyy'}} · {{_ 'time'}}
|
||||
option(value="YYYY-MM-DD-date-only" selected="{{#if isGlobalDateFormat 'YYYY-MM-DD-date-only'}}selected{{/if}}") {{_ 'date'}}: {{_ 'date-format-yyyy-mm-dd'}}
|
||||
option(value="DD-MM-YYYY-date-only" selected="{{#if isGlobalDateFormat 'DD-MM-YYYY-date-only'}}selected{{/if}}") {{_ 'date'}}: {{_ 'date-format-dd-mm-yyyy'}}
|
||||
option(value="MM-DD-YYYY-date-only" selected="{{#if isGlobalDateFormat 'MM-DD-YYYY-date-only'}}selected{{/if}}") {{_ 'date'}}: {{_ 'date-format-mm-dd-yyyy'}}
|
||||
li
|
||||
button.js-visibility-date-save.primary {{_ 'save'}}
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'settings-group-url'}}
|
||||
li
|
||||
a(href="/support" style="text-decoration: underline; color: blue;") {{_ 'support'}}
|
||||
li
|
||||
a.flex.js-toggle-support
|
||||
.materialCheckBox(class="{{#if currentSetting.supportPageEnabled}}is-checked{{/if}}")
|
||||
|
||||
span {{_ 'support-page-enabled'}}
|
||||
li
|
||||
.support-content(class="{{#if currentSetting.supportPageEnabled}}{{else}}hide{{/if}}")
|
||||
ul
|
||||
li
|
||||
a.flex.js-toggle-support-public
|
||||
.materialCheckBox(class="{{#if currentSetting.supportPagePublic}}is-checked{{/if}}")
|
||||
|
||||
span {{_ 'public'}}
|
||||
li
|
||||
.title {{_ 'support-title'}}
|
||||
textarea#support-title.wekan-form-control(data-editor-submit=".js-visibility-url-save")= currentSetting.supportTitle
|
||||
li
|
||||
.title {{_ 'support-content'}}
|
||||
textarea#support-page-text.wekan-form-control(data-editor-submit=".js-visibility-url-save")= currentSetting.supportPageText
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-help-link-url'}}
|
||||
.form-group
|
||||
input.wekan-form-control#custom-help-link-url(type="text", placeholder="" value="{{currentSetting.customHelpLinkUrl}}")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-legal-notice-link-url'}}
|
||||
.form-group
|
||||
input.wekan-form-control#legalNoticevalue(type="text", placeholder="" value="{{currentSetting.legalNotice}}")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'automatic-linked-url-schemes'}}
|
||||
.description {{_ 'automatic-linked-url-schemes-hint'}}
|
||||
.form-group
|
||||
textarea#automatic-linked-url-schemes.wekan-form-control(data-editor-submit=".js-visibility-url-save")= currentSetting.automaticLinkedUrlSchemes
|
||||
li
|
||||
button.js-visibility-url-save.primary {{_ 'save'}}
|
||||
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
li
|
||||
//- wekan/wekan#3069: autolink bare "<prefix>NNNN" tokens (e.g. "#1234")
|
||||
//- found in card descriptions/comments to an external issue tracker.
|
||||
//- Leaving either field empty keeps this feature off (no-op).
|
||||
h2.admin-pane-group-title {{_ 'external-link-pattern'}}
|
||||
p.description {{_ 'external-link-pattern-description'}}
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'external-link-pattern-prefix'}}
|
||||
.form-group
|
||||
input.wekan-form-control#external-link-pattern-prefix(type="text", placeholder="#" value="{{currentSetting.externalLinkPatternPrefix}}")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'external-link-pattern-url'}}
|
||||
.form-group
|
||||
input.wekan-form-control#external-link-pattern-url(type="text", placeholder="https://issues.example.com/browse/PROJ-{number}" value="{{currentSetting.externalLinkPatternUrl}}")
|
||||
//- #1463: more rules, with {identifier}, and abbreviations for it.
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'external-link-rules'}}
|
||||
p.description {{_ 'external-link-rules-description'}}
|
||||
.form-group
|
||||
textarea.wekan-form-control#external-link-rules(rows="4" placeholder="[{identifier}:{number}] = https://spirateam.example.com/SpiraTeam/{identifier}/{number}.aspx")= currentSetting.externalLinkRules
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'external-link-identifier-aliases'}}
|
||||
.form-group
|
||||
input.wekan-form-control#external-link-identifier-aliases(type="text", placeholder="TK=Task, IN=Incident" value="{{currentSetting.externalLinkIdentifierAliases}}")
|
||||
li
|
||||
button.js-visibility-external-link-pattern-save.primary {{_ 'save'}}
|
||||
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
li
|
||||
//- The group title IS the field's label here: the group holds one field, so a
|
||||
//- title above a label that says the same thing said it twice. The group title
|
||||
//- keeps its size and takes the field's existing translation.
|
||||
h2.admin-pane-group-title {{_ 'custom-product-name'}}
|
||||
li.tableVisibilityMode-form
|
||||
.form-group
|
||||
textarea.wekan-form-control#product-name(data-editor-submit=".js-visibility-product-name-save" rows="2" placeholder="")= currentSetting.productName
|
||||
li
|
||||
button.js-visibility-product-name-save.primary {{_ 'save'}}
|
||||
|
||||
//- The site theme. Same picker as the per-user "Change color", one layer
|
||||
//- below it: whoever has not chosen a theme of their own sees this one
|
||||
//- (docs/Theme/Theme.md). It applies immediately - the picker has no Save
|
||||
//- button, like the per-user one.
|
||||
if isSiteAdmin
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'change-color'}}
|
||||
//- The site admin's colour is the one every Organization that has not set
|
||||
//- its own inherits, so their pane says so; an Organization's own admin is
|
||||
//- setting only their own and needs no such line.
|
||||
//- Three panes of Admin Panel / Settings share this template and its
|
||||
//- handlers (2026-11-19): Appearance, Features and Feature profiles. `part`
|
||||
//- says which groups this pane shows; every field keeps its id and its Save.
|
||||
if isPart 'features'
|
||||
if isSiteAdmin
|
||||
h3.admin-pane-subgroup-title {{_ 'theme-override-all-tenants'}}
|
||||
li.tableVisibilityMode-form
|
||||
+themeColorPicker(scope="admin")
|
||||
//- #6736: which optional features this WeKan offers. A ticked feature is
|
||||
//- on for everyone; an unticked one is hidden from the interface (not
|
||||
//- greyed out), keeps its data, and changes no permission. The rows come
|
||||
//- from models/lib/instanceFeatures.js, so the page and the places that
|
||||
//- hide a feature read the same catalog.
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'features'}}
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'features-desc'}}
|
||||
each featureRows
|
||||
li.tableVisibilityMode-form.js-feature-row(data-feature=key)
|
||||
a.flex.js-toggle-feature
|
||||
.materialCheckBox.js-feature-enabled(class="{{#if enabled}}is-checked{{/if}}")
|
||||
span {{_ labelKey}}
|
||||
if awaitingApproval
|
||||
span.feature-awaiting-approval {{_ 'feature-awaiting-approval'}}
|
||||
.feature-desc {{_ descKey}}
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-feature
|
||||
.materialCheckBox#feature-approval-required(class="{{#if currentSetting.featureApprovalRequired}}is-checked{{/if}}")
|
||||
span {{_ 'feature-approval-required'}}
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-feature
|
||||
.materialCheckBox#feature-preview-admins(class="{{#if currentSetting.featurePreviewAdmins}}is-checked{{/if}}")
|
||||
span {{_ 'feature-preview-admins'}}
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'feature-pilot-users'}}
|
||||
.form-group
|
||||
textarea.wekan-form-control#feature-pilot-users(data-editor-submit=".js-visibility-features-save" rows="2" placeholder="{{_ 'feature-pilot-users-placeholder'}}")= featurePilotUsernames
|
||||
//- The card fields every board shows: one tick per field type of Board
|
||||
//- Settings / Card, all ticked by default. Unticked hides it on every
|
||||
//- card, minicard and Board Settings / Card - visibility only, no data or
|
||||
//- board setting changes. No ordering here: the order is each board's own.
|
||||
//- models/lib/cardFieldVisibility.js
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'card-field-visibility'}}
|
||||
.feature-desc {{_ 'card-field-visibility-desc'}}
|
||||
each cardFieldRows
|
||||
li.tableVisibilityMode-form.js-card-field-row(data-card-field=key)
|
||||
a.flex.js-toggle-feature
|
||||
.materialCheckBox.js-card-field-enabled(class="{{#if enabled}}is-checked{{/if}}")
|
||||
span.card-field-visibility-label
|
||||
each icon in icons
|
||||
i.fa(class=icon)
|
||||
| {{title}}
|
||||
li
|
||||
button.js-visibility-features-save.primary {{_ 'save'}}
|
||||
span.js-visibility-features-status
|
||||
|
||||
if isSiteAdmin
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
//- #2460: SQRL sign-in, and #4198: public boards on the fediverse
|
||||
(ActivityPub) - optional features this WeKan offers, each off by
|
||||
default and saved as soon as it is switched.
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-sqrl
|
||||
.materialCheckBox#sqrl-enabled(class="{{#if currentSetting.sqrlEnabled}}is-checked{{/if}}")
|
||||
span {{_ 'sqrl-enabled'}}
|
||||
.feature-desc {{_ 'sqrl-desc'}}
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-activity-pub
|
||||
.materialCheckBox#activity-pub-enabled(class="{{#if currentSetting.activityPubEnabled}}is-checked{{/if}}")
|
||||
span {{_ 'activity-pub-enabled'}}
|
||||
.feature-desc {{_ 'activity-pub-desc'}}
|
||||
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
//- #2217: boards may show their Rules to members, read-only. Off by
|
||||
default; each board admin then decides on the board's Rules page.
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'rules'}}
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-rules-read-only
|
||||
.materialCheckBox#rules-read-only-for-members(class="{{#if currentSetting.rulesReadOnlyForMembers}}is-checked{{/if}}")
|
||||
span {{_ 'rules-read-only-for-members'}}
|
||||
.feature-desc {{_ 'rules-read-only-for-members-desc'}}
|
||||
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
//- Optional APIs (models/lib/optionalApis.js): REST APIs in the shape of
|
||||
Trello's, Jira's, GitHub's and Gitea's, so their clients can use WeKan
|
||||
as their backend. Each is off until ticked, and has no rights of its
|
||||
own: it is WeKan's REST API, with the caller's own permissions.
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'optional-apis'}}
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'optional-apis-desc'}}
|
||||
each optionalApiRows
|
||||
li.tableVisibilityMode-form.js-optional-api-row(data-api=key)
|
||||
a.flex.js-toggle-feature
|
||||
.materialCheckBox.js-optional-api-enabled(class="{{#if enabled}}is-checked{{/if}}")
|
||||
span {{_ labelKey}}
|
||||
.feature-desc {{_ descKey}}
|
||||
.feature-desc
|
||||
code {{base}}
|
||||
li
|
||||
button.js-optional-apis-save.primary {{_ 'save'}}
|
||||
span.js-optional-apis-status
|
||||
else if isPart 'profiles'
|
||||
if isSiteAdmin
|
||||
//- #6837: feature profiles - named sets of the features above that their
|
||||
users do not see, assigned to users, teams or organizations. Opt-in: a
|
||||
user with no profile sees everything, and a user with one is told so
|
||||
(models/lib/featureProfiles.js). Visibility only, like the ticks above.
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'feature-profiles'}}
|
||||
.feature-desc {{_ 'feature-profiles-desc'}}
|
||||
each profile in featureProfileRows
|
||||
li.tableVisibilityMode-form.js-feature-profile(data-profile-id=profile._id)
|
||||
.form-group
|
||||
label {{_ 'feature-profile-name'}}
|
||||
input.wekan-form-control.js-feature-profile-name(type="text" value=profile.name maxlength="100")
|
||||
.title {{_ 'feature-profile-hides'}}
|
||||
each row in profile.rows
|
||||
a.flex.js-toggle-feature.js-feature-profile-hide(data-feature=row.key)
|
||||
.materialCheckBox(class="{{#if row.hidden}}is-checked{{/if}}")
|
||||
span {{_ row.labelKey}}
|
||||
.form-group
|
||||
label {{_ 'feature-profile-users'}}
|
||||
textarea.wekan-form-control.js-feature-profile-users(rows="2" placeholder="{{_ 'feature-pilot-users-placeholder'}}")= profile.usernames
|
||||
.form-group
|
||||
label {{_ 'feature-profile-teams'}}
|
||||
textarea.wekan-form-control.js-feature-profile-teams(rows="2")= profile.teams
|
||||
.form-group
|
||||
label {{_ 'feature-profile-orgs'}}
|
||||
textarea.wekan-form-control.js-feature-profile-orgs(rows="2")= profile.orgs
|
||||
button.js-feature-profile-remove(type="button") {{_ 'feature-profile-remove'}}
|
||||
li
|
||||
button.js-feature-profile-add(type="button") {{_ 'feature-profile-add'}}
|
||||
button.js-feature-profiles-save.primary(type="button") {{_ 'save'}}
|
||||
span.js-feature-profiles-status
|
||||
else
|
||||
//- Every group here writes the INSTANCE settings, so it is site-admin only.
|
||||
//- The one exception is "Change color" below, which an Organization's own
|
||||
//- admin sets for their Organization (models/lib/tenantAdmin.js themeTarget).
|
||||
if isSiteAdmin
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'all-boards-hide'}}
|
||||
//- One checkbox per setting instead of a Yes/No pair: each of these is on or
|
||||
//- off, and the group's own title already says what ticking one means (All
|
||||
//- Boards: Hide …). Same checkbox as everywhere else in the Admin Panel -
|
||||
//- Announcement's "Active System-Wide Announcement" - so it has the plain
|
||||
//- square when off, the green tick when on, and the animation between.
|
||||
//- The Save button below reads the ticks, as it read the radios.
|
||||
li.tableVisibilityMode-form
|
||||
//- "Public boards", under the "All Boards: Hide" title above: ticked hides
|
||||
//- them, which is what allowPrivateOnly does. The setting's own key keeps its
|
||||
//- sentence - boardBody.jade shows it as the message on a board you may not
|
||||
//- open, where a two-word label would say nothing.
|
||||
a.flex.js-toggle-all-boards-hide
|
||||
.materialCheckBox#accounts-allowPrivateOnly(class="{{#if allowPrivateOnly}}is-checked{{/if}}")
|
||||
span {{_ 'public-boards'}}
|
||||
li.tableVisibilityMode-form
|
||||
//- #4475: ticked forbids anyone who is not a site admin from creating
|
||||
//- new boards. Same Save button and same collection as the setting
|
||||
//- above - only the checked key differs.
|
||||
a.flex.js-toggle-all-boards-hide
|
||||
.materialCheckBox#accounts-boardCreationAdminOnly(class="{{#if boardCreationAdminOnly}}is-checked{{/if}}")
|
||||
span {{_ 'board-creation-admin-only'}}
|
||||
li.tableVisibilityMode-form
|
||||
//- #4575: ticked lets a board admin open an Instance or Public board
|
||||
//- to editing by every signed-in user. Off: no board can.
|
||||
a.flex.js-toggle-all-boards-hide
|
||||
.materialCheckBox#accounts-allowInstanceEditing(class="{{#if allowInstanceEditing}}is-checked{{/if}}")
|
||||
span {{_ 'instance-editing-allowed'}}
|
||||
li.hideBoardActivities-form
|
||||
a.flex.js-toggle-all-boards-hide
|
||||
.materialCheckBox#hide-board-activities(class="{{#if currentSetting.hideBoardActivitiesOnAllBoards}}is-checked{{/if}}")
|
||||
span {{_ 'board-activities'}}
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-all-boards-hide
|
||||
.materialCheckBox#hide-card-counter-list(class="{{#if currentSetting.hideCardCounterList}}is-checked{{/if}}")
|
||||
span {{_ 'card-counter-list'}}
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-all-boards-hide
|
||||
.materialCheckBox#hide-board-member-list(class="{{#if currentSetting.hideBoardMemberList}}is-checked{{/if}}")
|
||||
span {{_ 'board-member-list'}}
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'wait-spinner'}}
|
||||
+selectSpinnerName(spinnerName=currentSetting.spinnerName)
|
||||
//- #4421: an org whose "Public" means "public within our organization"
|
||||
//- rather than public on the internet can replace the wording shown
|
||||
//- under Private/Public in the board visibility popup and the
|
||||
//- create-board popup. Empty = unchanged i18n default text
|
||||
//- (imports/i18n/lib/visibilityDesc.js).
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-private-desc'}}
|
||||
.form-group
|
||||
textarea.wekan-form-control#custom-private-board-desc(data-editor-submit=".js-visibility-all-boards-save" rows="2" placeholder="{{_ 'custom-private-desc-placeholder'}}")= currentSetting.customPrivateBoardDesc
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-public-desc'}}
|
||||
.form-group
|
||||
textarea.wekan-form-control#custom-public-board-desc(data-editor-submit=".js-visibility-all-boards-save" rows="2" placeholder="{{_ 'custom-public-desc-placeholder'}}")= currentSetting.customPublicBoardDesc
|
||||
li
|
||||
//- One Save per section, at its end, above the rule that closes it. It writes
|
||||
//- this section's fields and nothing else, so saving one group can never
|
||||
//- overwrite what you were editing in another.
|
||||
button.js-visibility-all-boards-save.primary {{_ 'save'}}
|
||||
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'date'}}
|
||||
li.tableVisibilityMode-form
|
||||
a.flex.js-toggle-date-format
|
||||
.materialCheckBox#global-date-format-enabled(class="{{#if currentSetting.hideDateFormat}}is-checked{{/if}}")
|
||||
span {{_ 'date-format'}}:
|
||||
select.wekan-form-control#global-date-format(aria-label="{{_ 'date-format'}}")
|
||||
option(value="YYYY-MM-DD" selected="{{#if isGlobalDateFormat 'YYYY-MM-DD'}}selected{{/if}}") {{_ 'date-format-yyyy-mm-dd'}} · {{_ 'time'}}
|
||||
option(value="DD-MM-YYYY" selected="{{#if isGlobalDateFormat 'DD-MM-YYYY'}}selected{{/if}}") {{_ 'date-format-dd-mm-yyyy'}} · {{_ 'time'}}
|
||||
option(value="MM-DD-YYYY" selected="{{#if isGlobalDateFormat 'MM-DD-YYYY'}}selected{{/if}}") {{_ 'date-format-mm-dd-yyyy'}} · {{_ 'time'}}
|
||||
option(value="YYYY-MM-DD-date-only" selected="{{#if isGlobalDateFormat 'YYYY-MM-DD-date-only'}}selected{{/if}}") {{_ 'date'}}: {{_ 'date-format-yyyy-mm-dd'}}
|
||||
option(value="DD-MM-YYYY-date-only" selected="{{#if isGlobalDateFormat 'DD-MM-YYYY-date-only'}}selected{{/if}}") {{_ 'date'}}: {{_ 'date-format-dd-mm-yyyy'}}
|
||||
option(value="MM-DD-YYYY-date-only" selected="{{#if isGlobalDateFormat 'MM-DD-YYYY-date-only'}}selected{{/if}}") {{_ 'date'}}: {{_ 'date-format-mm-dd-yyyy'}}
|
||||
li
|
||||
button.js-visibility-date-save.primary {{_ 'save'}}
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'settings-group-url'}}
|
||||
li
|
||||
a(href="/support" style="text-decoration: underline; color: blue;") {{_ 'support'}}
|
||||
li
|
||||
a.flex.js-toggle-support
|
||||
.materialCheckBox(class="{{#if currentSetting.supportPageEnabled}}is-checked{{/if}}")
|
||||
|
||||
span {{_ 'support-page-enabled'}}
|
||||
li
|
||||
.support-content(class="{{#if currentSetting.supportPageEnabled}}{{else}}hide{{/if}}")
|
||||
ul
|
||||
li
|
||||
a.flex.js-toggle-support-public
|
||||
.materialCheckBox(class="{{#if currentSetting.supportPagePublic}}is-checked{{/if}}")
|
||||
|
||||
span {{_ 'public'}}
|
||||
li
|
||||
.title {{_ 'support-title'}}
|
||||
textarea#support-title.wekan-form-control(data-editor-submit=".js-visibility-url-save")= currentSetting.supportTitle
|
||||
li
|
||||
.title {{_ 'support-content'}}
|
||||
textarea#support-page-text.wekan-form-control(data-editor-submit=".js-visibility-url-save")= currentSetting.supportPageText
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-help-link-url'}}
|
||||
.form-group
|
||||
input.wekan-form-control#custom-help-link-url(type="text", placeholder="" value="{{currentSetting.customHelpLinkUrl}}")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-legal-notice-link-url'}}
|
||||
.form-group
|
||||
input.wekan-form-control#legalNoticevalue(type="text", placeholder="" value="{{currentSetting.legalNotice}}")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'automatic-linked-url-schemes'}}
|
||||
.description {{_ 'automatic-linked-url-schemes-hint'}}
|
||||
.form-group
|
||||
textarea#automatic-linked-url-schemes.wekan-form-control(data-editor-submit=".js-visibility-url-save")= currentSetting.automaticLinkedUrlSchemes
|
||||
li
|
||||
button.js-visibility-url-save.primary {{_ 'save'}}
|
||||
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
li
|
||||
//- wekan/wekan#3069: autolink bare "<prefix>NNNN" tokens (e.g. "#1234")
|
||||
//- found in card descriptions/comments to an external issue tracker.
|
||||
//- Leaving either field empty keeps this feature off (no-op).
|
||||
h2.admin-pane-group-title {{_ 'external-link-pattern'}}
|
||||
p.description {{_ 'external-link-pattern-description'}}
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'external-link-pattern-prefix'}}
|
||||
.form-group
|
||||
input.wekan-form-control#external-link-pattern-prefix(type="text", placeholder="#" value="{{currentSetting.externalLinkPatternPrefix}}")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'external-link-pattern-url'}}
|
||||
.form-group
|
||||
input.wekan-form-control#external-link-pattern-url(type="text", placeholder="https://issues.example.com/browse/PROJ-{number}" value="{{currentSetting.externalLinkPatternUrl}}")
|
||||
//- #1463: more rules, with {identifier}, and abbreviations for it.
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'external-link-rules'}}
|
||||
p.description {{_ 'external-link-rules-description'}}
|
||||
.form-group
|
||||
textarea.wekan-form-control#external-link-rules(rows="4" placeholder="[{identifier}:{number}] = https://spirateam.example.com/SpiraTeam/{identifier}/{number}.aspx")= currentSetting.externalLinkRules
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'external-link-identifier-aliases'}}
|
||||
.form-group
|
||||
input.wekan-form-control#external-link-identifier-aliases(type="text", placeholder="TK=Task, IN=Incident" value="{{currentSetting.externalLinkIdentifierAliases}}")
|
||||
li
|
||||
button.js-visibility-external-link-pattern-save.primary {{_ 'save'}}
|
||||
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
li
|
||||
//- The group title IS the field's label here: the group holds one field, so a
|
||||
//- title above a label that says the same thing said it twice. The group title
|
||||
//- keeps its size and takes the field's existing translation.
|
||||
h2.admin-pane-group-title {{_ 'custom-product-name'}}
|
||||
li.tableVisibilityMode-form
|
||||
.form-group
|
||||
textarea.wekan-form-control#product-name(data-editor-submit=".js-visibility-product-name-save" rows="2" placeholder="")= currentSetting.productName
|
||||
li
|
||||
button.js-visibility-product-name-save.primary {{_ 'save'}}
|
||||
|
||||
//- The site theme. Same picker as the per-user "Change color", one layer
|
||||
//- below it: whoever has not chosen a theme of their own sees this one
|
||||
//- (docs/Theme/Theme.md). It applies immediately - the picker has no Save
|
||||
//- button, like the per-user one.
|
||||
if isSiteAdmin
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'settings-group-logo'}}
|
||||
h2.admin-pane-group-title {{_ 'change-color'}}
|
||||
//- The site admin's colour is the one every Organization that has not set
|
||||
//- its own inherits, so their pane says so; an Organization's own admin is
|
||||
//- setting only their own and needs no such line.
|
||||
if isSiteAdmin
|
||||
h3.admin-pane-subgroup-title {{_ 'theme-override-all-tenants'}}
|
||||
li.tableVisibilityMode-form
|
||||
//- One checkbox, like the All Boards group above and like Announcement's
|
||||
//- "Active System-Wide Announcement": ticked = the logo is hidden. The
|
||||
//- group's Save below writes it, as it wrote the Yes/No pair.
|
||||
a.flex.js-toggle-hide-logo
|
||||
.materialCheckBox#hide-logo(class="{{#if currentSetting.hideLogo}}is-checked{{/if}}")
|
||||
span {{_ 'hide-logo'}}
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-login-logo-image-url'}}
|
||||
.form-group
|
||||
input.wekan-form-control#custom-login-logo-image-url(type="text", placeholder="" value="{{currentSetting.customLoginLogoImageUrl}}")
|
||||
input.js-site-logo-upload(type="file" data-kind="login" accept="image/png,image/jpeg,image/gif,image/webp" aria-label="{{_ 'upload'}} {{_ 'custom-login-logo-image-url'}}")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-login-logo-link-url'}}
|
||||
.form-group
|
||||
input.wekan-form-control#custom-login-logo-link-url(type="text", placeholder="" value="{{currentSetting.customLoginLogoLinkUrl}}")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'text-below-custom-login-logo'}}
|
||||
.form-group
|
||||
textarea#text-below-custom-login-logo.wekan-form-control(data-editor-submit=".js-visibility-logo-save")= currentSetting.textBelowCustomLoginLogo
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'login-background-color'}}
|
||||
.form-group
|
||||
input.wekan-form-control#login-background-color(type="text", placeholder="#1b365d" value="{{currentSetting.loginBackgroundColor}}")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-top-left-corner-logo-image-url'}}
|
||||
.form-group
|
||||
input.wekan-form-control#custom-top-left-corner-logo-image-url(type="text", placeholder="" value="{{currentSetting.customTopLeftCornerLogoImageUrl}}")
|
||||
input.js-site-logo-upload(type="file" data-kind="header" accept="image/png,image/jpeg,image/gif,image/webp" aria-label="{{_ 'upload'}} {{_ 'custom-top-left-corner-logo-image-url'}}")
|
||||
li.tableVisibilityMode-form
|
||||
span.js-site-logo-upload-status(role="status" aria-live="polite")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-top-left-corner-logo-link-url'}}
|
||||
.form-group
|
||||
input.wekan-form-control#custom-top-left-corner-logo-link-url(type="text", placeholder="" value="{{currentSetting.customTopLeftCornerLogoLinkUrl}}")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-top-left-corner-logo-height'}}
|
||||
.form-group
|
||||
input.wekan-form-control#custom-top-left-corner-logo-height(type="text", placeholder="" value="{{currentSetting.customTopLeftCornerLogoHeight}}")
|
||||
li
|
||||
button.js-visibility-logo-save.primary {{_ 'save'}}
|
||||
+themeColorPicker(scope="admin")
|
||||
|
||||
if isSiteAdmin
|
||||
li.admin-pane-group-separator
|
||||
hr
|
||||
li
|
||||
h2.admin-pane-group-title {{_ 'settings-group-logo'}}
|
||||
li.tableVisibilityMode-form
|
||||
//- One checkbox, like the All Boards group above and like Announcement's
|
||||
//- "Active System-Wide Announcement": ticked = the logo is hidden. The
|
||||
//- group's Save below writes it, as it wrote the Yes/No pair.
|
||||
a.flex.js-toggle-hide-logo
|
||||
.materialCheckBox#hide-logo(class="{{#if currentSetting.hideLogo}}is-checked{{/if}}")
|
||||
span {{_ 'hide-logo'}}
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-login-logo-image-url'}}
|
||||
.form-group
|
||||
input.wekan-form-control#custom-login-logo-image-url(type="text", placeholder="" value="{{currentSetting.customLoginLogoImageUrl}}")
|
||||
input.js-site-logo-upload(type="file" data-kind="login" accept="image/png,image/jpeg,image/gif,image/webp" aria-label="{{_ 'upload'}} {{_ 'custom-login-logo-image-url'}}")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-login-logo-link-url'}}
|
||||
.form-group
|
||||
input.wekan-form-control#custom-login-logo-link-url(type="text", placeholder="" value="{{currentSetting.customLoginLogoLinkUrl}}")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'text-below-custom-login-logo'}}
|
||||
.form-group
|
||||
textarea#text-below-custom-login-logo.wekan-form-control(data-editor-submit=".js-visibility-logo-save")= currentSetting.textBelowCustomLoginLogo
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'login-background-color'}}
|
||||
.form-group
|
||||
input.wekan-form-control#login-background-color(type="text", placeholder="#1b365d" value="{{currentSetting.loginBackgroundColor}}")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-top-left-corner-logo-image-url'}}
|
||||
.form-group
|
||||
input.wekan-form-control#custom-top-left-corner-logo-image-url(type="text", placeholder="" value="{{currentSetting.customTopLeftCornerLogoImageUrl}}")
|
||||
input.js-site-logo-upload(type="file" data-kind="header" accept="image/png,image/jpeg,image/gif,image/webp" aria-label="{{_ 'upload'}} {{_ 'custom-top-left-corner-logo-image-url'}}")
|
||||
li.tableVisibilityMode-form
|
||||
span.js-site-logo-upload-status(role="status" aria-live="polite")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-top-left-corner-logo-link-url'}}
|
||||
.form-group
|
||||
input.wekan-form-control#custom-top-left-corner-logo-link-url(type="text", placeholder="" value="{{currentSetting.customTopLeftCornerLogoLinkUrl}}")
|
||||
li.tableVisibilityMode-form
|
||||
.title {{_ 'custom-top-left-corner-logo-height'}}
|
||||
.form-group
|
||||
input.wekan-form-control#custom-top-left-corner-logo-height(type="text", placeholder="" value="{{currentSetting.customTopLeftCornerLogoHeight}}")
|
||||
li
|
||||
button.js-visibility-logo-save.primary {{_ 'save'}}
|
||||
|
||||
template(name='announcementSettings')
|
||||
ul#announcement-setting.setting-detail
|
||||
|
||||
@@ -147,6 +147,15 @@ Template.setting.onCreated(function () {
|
||||
this.layoutSetting = new ReactiveVar(false);
|
||||
this.webhookSetting = new ReactiveVar(false);
|
||||
this.sharedLabelsSetting = new ReactiveVar(false);
|
||||
// 2026-11-19: what WeKan offers and who sees it, in one place - Features and
|
||||
// Feature profiles split out of Visibility (now Appearance), and Security,
|
||||
// Activities and notifications and Delete moved here from Admin Panel /
|
||||
// Problems, where settings sat among the reports.
|
||||
this.featuresSetting = new ReactiveVar(false);
|
||||
this.featureProfilesSetting = new ReactiveVar(false);
|
||||
this.privacySecuritySetting = new ReactiveVar(false);
|
||||
this.activitiesSetting = new ReactiveVar(false);
|
||||
this.deleteSetting = new ReactiveVar(false);
|
||||
// The pane the URL asks for. `/settings/global-webhooks` opens Global
|
||||
// Webhooks; the bare `/settings` opens the default, which the route resolved
|
||||
// for us, so this is always a real pane id. Reactive, so following a link to
|
||||
@@ -186,6 +195,11 @@ Template.setting.onDestroyed(function () {
|
||||
const SETTINGS_PANE_VARS = {
|
||||
'version-setting': 'versionSetting',
|
||||
'tableVisibilityMode-setting': 'tableVisibilityModeSetting',
|
||||
'features-setting': 'featuresSetting',
|
||||
'feature-profiles-setting': 'featureProfilesSetting',
|
||||
'privacy-security-setting': 'privacySecuritySetting',
|
||||
'activities-setting': 'activitiesSetting',
|
||||
'delete-setting': 'deleteSetting',
|
||||
'announcement-setting': 'announcementSetting',
|
||||
'accessibility-setting': 'accessibilitySetting',
|
||||
'translation-setting': 'translationSetting',
|
||||
@@ -214,10 +228,19 @@ function settingsMenu(user) {
|
||||
const items = [
|
||||
// First, and open by default - see Template.setting.onCreated.
|
||||
{ id: 'version-setting', icon: 'fa-info-circle', labelKey: 'info', emoji: true },
|
||||
// Labelled just 'Visibility' now. The pane id and the tableVisibilityMode
|
||||
// key are unchanged, so the 141 translations of the pane's own contents are
|
||||
// untouched; only the menu label points at the new key.
|
||||
{ id: 'tableVisibilityMode-setting', icon: 'fa-eye', labelKey: 'visibility', emoji: true },
|
||||
// Appearance (2026-11-19; it was Visibility): how this WeKan looks - what
|
||||
// All Boards shows, dates, URLs, the product name, colours and logos. The
|
||||
// pane id is unchanged, so an Organization admin's one pane (Change color)
|
||||
// is still this one.
|
||||
{ id: 'tableVisibilityMode-setting', icon: 'fa-paint-brush', labelKey: 'appearance', emoji: true },
|
||||
// What this WeKan offers and who sees it: the optional features, then the
|
||||
// profiles that hide some of them from chosen people.
|
||||
{ id: 'features-setting', icon: 'fa-toggle-on', labelKey: 'features', emoji: true },
|
||||
{ id: 'feature-profiles-setting', icon: 'fa-eye-slash', labelKey: 'feature-profiles', emoji: true },
|
||||
// Moved from Admin Panel / Problems: settings, not reports.
|
||||
{ id: 'privacy-security-setting', icon: 'fa-shield', labelKey: 'features-security', emoji: true },
|
||||
{ id: 'activities-setting', icon: 'fa-bell', labelKey: 'activities-and-notifications', emoji: true },
|
||||
{ id: 'delete-setting', icon: 'fa-trash', labelKey: 'delete', emoji: true },
|
||||
{ id: 'announcement-setting', icon: 'fa-bullhorn', labelKey: 'admin-announcement', emoji: true },
|
||||
{ id: 'accessibility-setting', icon: 'fa-universal-access', labelKey: 'accessibility', emoji: true },
|
||||
// PWA is an acronym, not a translated string - a literal label, like the
|
||||
@@ -245,6 +268,11 @@ function activeSettingId(inst) {
|
||||
const panes = [
|
||||
['versionSetting', 'version-setting'],
|
||||
['tableVisibilityModeSetting', 'tableVisibilityMode-setting'],
|
||||
['featuresSetting', 'features-setting'],
|
||||
['featureProfilesSetting', 'feature-profiles-setting'],
|
||||
['privacySecuritySetting', 'privacy-security-setting'],
|
||||
['activitiesSetting', 'activities-setting'],
|
||||
['deleteSetting', 'delete-setting'],
|
||||
['announcementSetting', 'announcement-setting'],
|
||||
['accessibilitySetting', 'accessibility-setting'],
|
||||
['translationSetting', 'translation-setting'],
|
||||
@@ -306,6 +334,26 @@ Template.setting.helpers({
|
||||
const inst = Template.instance();
|
||||
return inst.sharedLabelsSetting && inst.sharedLabelsSetting.get();
|
||||
},
|
||||
isFeaturesSetting() {
|
||||
const inst = Template.instance();
|
||||
return inst.featuresSetting && inst.featuresSetting.get();
|
||||
},
|
||||
isFeatureProfilesSetting() {
|
||||
const inst = Template.instance();
|
||||
return inst.featureProfilesSetting && inst.featureProfilesSetting.get();
|
||||
},
|
||||
isPrivacySecuritySetting() {
|
||||
const inst = Template.instance();
|
||||
return inst.privacySecuritySetting && inst.privacySecuritySetting.get();
|
||||
},
|
||||
isActivitiesSetting() {
|
||||
const inst = Template.instance();
|
||||
return inst.activitiesSetting && inst.activitiesSetting.get();
|
||||
},
|
||||
isDeleteSetting() {
|
||||
const inst = Template.instance();
|
||||
return inst.deleteSetting && inst.deleteSetting.get();
|
||||
},
|
||||
isLoading() {
|
||||
const inst = Template.instance();
|
||||
return inst.loading && inst.loading.get();
|
||||
@@ -524,14 +572,43 @@ Template.setting.events({
|
||||
// user, visible only to that user), so the site admin's page asks for them.
|
||||
Template.tableVisibilityModeSettings.onCreated(function () {
|
||||
this.featurePilotUsernames = new ReactiveVar('');
|
||||
// #6837: the feature profiles, with the names of what they apply to. The
|
||||
// page edits these rows; Save sends them all (saveFeatureProfiles).
|
||||
this.featureProfiles = new ReactiveVar([]);
|
||||
if (tenantAdmin.isSiteAdmin(ReactiveCache.getCurrentUser())) {
|
||||
Meteor.callAsync('getFeaturePilotUsernames')
|
||||
.then(names => this.featurePilotUsernames.set(names.join(', ')))
|
||||
.catch(() => {});
|
||||
Meteor.callAsync('getFeatureProfiles')
|
||||
.then(profiles => this.featureProfiles.set(profiles.map(p => ({ ...p,
|
||||
teams: p.teams.join('\n'), orgs: p.orgs.join('\n'), usernames: p.usernames.join(', ') }))))
|
||||
.catch(() => {});
|
||||
}
|
||||
});
|
||||
|
||||
// #6837: the profile rows as the page shows them now, edits included.
|
||||
function readFeatureProfiles(instance) {
|
||||
return instance.$('.js-feature-profile').toArray().map(row => {
|
||||
const $row = $(row);
|
||||
return {
|
||||
_id: row.dataset.profileId || undefined,
|
||||
name: $row.find('.js-feature-profile-name').val() || '',
|
||||
hidden: $row.find('.js-feature-profile-hide').toArray()
|
||||
.filter(a => $(a).find('.materialCheckBox').hasClass('is-checked')).map(a => a.dataset.feature),
|
||||
usernames: $row.find('.js-feature-profile-users').val() || '',
|
||||
teams: $row.find('.js-feature-profile-teams').val() || '',
|
||||
orgs: $row.find('.js-feature-profile-orgs').val() || '',
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Template.tableVisibilityModeSettings.helpers({
|
||||
// Which of the three panes this is: 'appearance' (the default), 'features'
|
||||
// or 'profiles' (Template.setting renders it once per pane).
|
||||
isPart(part) {
|
||||
const data = Template.currentData() || {};
|
||||
return (data.part || 'appearance') === part;
|
||||
},
|
||||
featureRows() {
|
||||
return instanceFeatures.featureRows(ReactiveCache.getCurrentSetting());
|
||||
},
|
||||
@@ -551,6 +628,13 @@ Template.tableVisibilityModeSettings.helpers({
|
||||
featurePilotUsernames() {
|
||||
return Template.instance().featurePilotUsernames.get();
|
||||
},
|
||||
featureProfileRows() {
|
||||
return Template.instance().featureProfiles.get().map(profile => ({
|
||||
...profile,
|
||||
rows: instanceFeatures.FEATURES.map(feature => ({ key: feature.key, labelKey: feature.labelKey,
|
||||
hidden: (profile.hidden || []).includes(feature.key) })),
|
||||
}));
|
||||
},
|
||||
isGlobalDateFormat(format) {
|
||||
return (ReactiveCache.getCurrentSetting()?.globalDateFormat || 'YYYY-MM-DD') === format;
|
||||
},
|
||||
@@ -692,6 +776,33 @@ Template.tableVisibilityModeSettings.events({
|
||||
status.text(error.reason || error.message);
|
||||
}
|
||||
},
|
||||
// #6837: add a profile, remove one, and save them all.
|
||||
'click button.js-feature-profile-add'(event, instance) {
|
||||
event.preventDefault();
|
||||
instance.featureProfiles.set([...readFeatureProfiles(instance),
|
||||
{ name: '', hidden: [], usernames: '', teams: '', orgs: '' }]);
|
||||
},
|
||||
'click button.js-feature-profile-remove'(event, instance) {
|
||||
event.preventDefault();
|
||||
const index = instance.$('.js-feature-profile').index($(event.currentTarget).closest('.js-feature-profile'));
|
||||
instance.featureProfiles.set(readFeatureProfiles(instance).filter((p, i) => i !== index));
|
||||
},
|
||||
async 'click button.js-feature-profiles-save'(event, instance) {
|
||||
event.preventDefault();
|
||||
const status = instance.$('.js-feature-profiles-status');
|
||||
try {
|
||||
const result = await Meteor.callAsync('saveFeatureProfiles', readFeatureProfiles(instance)
|
||||
.map(({ _id, ...rest }) => (_id ? { _id, ...rest } : rest)));
|
||||
const profiles = await Meteor.callAsync('getFeatureProfiles');
|
||||
instance.featureProfiles.set(profiles.map(p => ({ ...p,
|
||||
teams: p.teams.join('\n'), orgs: p.orgs.join('\n'), usernames: p.usernames.join(', ') })));
|
||||
const unknown = [...result.unknown.usernames, ...result.unknown.teams, ...result.unknown.orgs];
|
||||
status.text(unknown.length ? `${TAPi18n.__('feature-profile-unknown')} ${unknown.join(', ')}` : TAPi18n.__('feature-saved'));
|
||||
} catch (error) {
|
||||
status.text(error.reason || error.error || error.message);
|
||||
}
|
||||
},
|
||||
|
||||
async 'click button.js-visibility-features-save'(event, instance) {
|
||||
event.preventDefault();
|
||||
const states = {};
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/* The Scrum meeting helpers (docs/Features/Scrum/Meetings.md). */
|
||||
.daily-standup {
|
||||
min-width: 220px;
|
||||
}
|
||||
.daily-standup-speaker {
|
||||
font-size: 1.4em;
|
||||
margin: 4px 0;
|
||||
}
|
||||
.daily-standup-clock {
|
||||
font-size: 2em;
|
||||
font-variant-numeric: tabular-nums;
|
||||
margin: 4px 0;
|
||||
}
|
||||
.daily-standup-clock.is-overtime {
|
||||
color: #c0392b;
|
||||
}
|
||||
.daily-standup-order {
|
||||
margin-block: 4px;
|
||||
padding-inline-start: 20px;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
//- The Scrum meeting helpers of the board menu (models/lib/scrumMeetings.js,
|
||||
docs/Features/Scrum/Meetings.md).
|
||||
template(name="dailyStandupPopup")
|
||||
.daily-standup.js-daily-standup
|
||||
if running
|
||||
with view
|
||||
if done
|
||||
p.daily-standup-done {{_ 'standup-done' time=(clockOf elapsedSeconds)}}
|
||||
button.js-standup-reset(type="button") {{_ 'start'}}
|
||||
else
|
||||
p.daily-standup-position {{position}} / {{count}}
|
||||
h3.daily-standup-speaker= speakerName
|
||||
p.daily-standup-clock(class="{{#if overtime}}is-overtime{{/if}}") {{clockOf remainingSeconds}}
|
||||
p.quiet {{_ 'standup-total' time=(clockOf elapsedSeconds)}}
|
||||
button.primary.js-standup-next(type="button") {{_ 'next'}}
|
||||
button.js-standup-reset(type="button") {{_ 'stop'}}
|
||||
else
|
||||
ol.daily-standup-order
|
||||
each person in order
|
||||
li= person.name
|
||||
p
|
||||
button.js-standup-shuffle(type="button")
|
||||
i.fa.fa-random
|
||||
| {{_ 'standup-shuffle'}}
|
||||
p.quiet {{_ 'standup-minutes'}}: {{minutes}}
|
||||
button.primary.js-standup-start(type="button" disabled=noPeople) {{_ 'start'}}
|
||||
@@ -0,0 +1,92 @@
|
||||
// The Scrum meeting helpers of the board menu (models/lib/scrumMeetings.js,
|
||||
// docs/Features/Scrum/Meetings.md): the daily standup timer, kept in this
|
||||
// browser only, and the button that makes a retrospective board.
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Template } from 'meteor/templating';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
import getSlug from 'limax';
|
||||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
import { Utils } from '/client/lib/utils';
|
||||
import { allowFeature } from '/client/lib/instanceFeatures';
|
||||
import Lists from '/models/lists';
|
||||
|
||||
const meetings = require('/models/lib/scrumMeetings');
|
||||
const { DEFAULT_SCRUM_SETTINGS } = require('/models/lib/scrum');
|
||||
|
||||
const settingsOf = board => ({ ...DEFAULT_SCRUM_SETTINGS, ...(board && board.scrum) });
|
||||
|
||||
// Whether the board menu offers each: the instance's feature AND the board's
|
||||
// Scrum setting.
|
||||
export function showsStandupTimer(board) {
|
||||
return Boolean(board) && allowFeature('standup-timer') && settingsOf(board).standupTimer !== false;
|
||||
}
|
||||
export function showsRetrospectiveBoard(board) {
|
||||
return Boolean(board) && allowFeature('retrospective-board') && settingsOf(board).retrospectiveBoard !== false;
|
||||
}
|
||||
|
||||
const nameOf = userId => {
|
||||
const user = ReactiveCache.getUser(userId);
|
||||
return (user && (user.profile?.fullname || user.username)) || userId;
|
||||
};
|
||||
|
||||
Template.dailyStandupPopup.onCreated(function () {
|
||||
const board = Utils.getCurrentBoard();
|
||||
const people = (board?.activeMembers?.() || board?.members || []).filter(m => m.isActive !== false).map(m => m.userId);
|
||||
this.order = new ReactiveVar(meetings.shuffle(people));
|
||||
this.state = new ReactiveVar(null);
|
||||
this.now = new ReactiveVar(Date.now());
|
||||
this.minutes = meetings.standupMinutes(settingsOf(board).standupMinutes);
|
||||
this.timer = Meteor.setInterval(() => this.now.set(Date.now()), 1000);
|
||||
});
|
||||
Template.dailyStandupPopup.onDestroyed(function () {
|
||||
Meteor.clearInterval(this.timer);
|
||||
});
|
||||
|
||||
Template.dailyStandupPopup.helpers({
|
||||
order() { return Template.instance().order.get().map(userId => ({ userId, name: nameOf(userId) })); },
|
||||
noPeople() { return !Template.instance().order.get().length; },
|
||||
minutes() { return Template.instance().minutes; },
|
||||
running() { return Boolean(Template.instance().state.get()); },
|
||||
view() {
|
||||
const tpl = Template.instance();
|
||||
const view = meetings.standupView(tpl.state.get(), tpl.now.get());
|
||||
return view && { ...view, speakerName: view.speaker ? nameOf(view.speaker) : '' };
|
||||
},
|
||||
clockOf(seconds) { return meetings.clock(seconds); },
|
||||
});
|
||||
|
||||
Template.dailyStandupPopup.events({
|
||||
'click .js-standup-shuffle'(event, tpl) { tpl.order.set(meetings.shuffle(tpl.order.get())); },
|
||||
'click .js-standup-start'(event, tpl) {
|
||||
tpl.now.set(Date.now());
|
||||
tpl.state.set(meetings.startStandup(tpl.order.get(), tpl.minutes, Date.now()));
|
||||
},
|
||||
'click .js-standup-next'(event, tpl) {
|
||||
tpl.now.set(Date.now());
|
||||
tpl.state.set(meetings.nextSpeaker(tpl.state.get(), Date.now()));
|
||||
},
|
||||
'click .js-standup-reset'(event, tpl) { tpl.state.set(null); },
|
||||
});
|
||||
|
||||
// A new private board of the reader's for one retrospective: its lists Start
|
||||
// doing, Stop doing, Keep doing and Action items. Board creation is the
|
||||
// server's (createBoardWithInitialSwimlanes, with its "who may create
|
||||
// boards" check); the lists are the new board admin's own inserts.
|
||||
export async function createRetrospectiveBoard(board) {
|
||||
const plan = meetings.retrospectivePlan(board.title, new Date(), (key, fallback, options) => {
|
||||
const text = TAPi18n.__(key, options);
|
||||
return text && text !== key ? text : fallback;
|
||||
});
|
||||
const slug = getSlug(plan.title) || 'board';
|
||||
const boardId = await Meteor.callAsync('createBoardWithInitialSwimlanes', {
|
||||
title: plan.title, slug, permission: 'private', type: 'board', migrationVersion: 1,
|
||||
swimlanes: [{ title: TAPi18n.__('default'), sort: 0 }],
|
||||
});
|
||||
for (const [sort, title] of plan.lists.entries()) {
|
||||
await Lists.insertAsync({ title, boardId, sort, swimlaneId: '' });
|
||||
}
|
||||
FlowRouter.go('board', { id: boardId, slug });
|
||||
return boardId;
|
||||
}
|
||||
@@ -785,3 +785,18 @@ body.sidebar-resizing-active {
|
||||
background: var(--wekan-popup-background, #fff);
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
/* Board Settings / Board View: the heading over each group of views, as in
|
||||
the Board View menu (models/lib/boardViewSettings.js BOARD_VIEW_GROUPS). */
|
||||
.board-view-settings .board-view-settings-group-heading {
|
||||
padding: 8px 4px 2px;
|
||||
font-size: 0.8em;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: #6b778c;
|
||||
border-top: 1px solid #dfe1e6;
|
||||
}
|
||||
.board-view-settings .board-view-settings-group-heading:first-child {
|
||||
border-top: 0;
|
||||
}
|
||||
@@ -755,24 +755,20 @@ template(name="boardMenuPopup")
|
||||
a.js-open-board-date-settings(title="{{_ 'date'}}")
|
||||
i.fa.fa-calendar
|
||||
| {{_ 'date'}}
|
||||
//- All Boards Settings: what the All Boards page shows of this board
|
||||
(card counters, member avatars), card aging, auto-archive and personal
|
||||
list widths. It was commented out for the #4214 "icons random dance";
|
||||
the All Boards tiles now read one fetch of getAllBoardsTileData, not
|
||||
reactive cursors, so the loop it caused cannot return. The popup hides
|
||||
its own counter and avatar rows when Admin Panel turns those off.
|
||||
li
|
||||
a.js-board-info-on-my-boards(title="{{_ 'board-info-on-my-boards'}}")
|
||||
i.fa.fa-id-card-o
|
||||
| {{_ 'board-info-on-my-boards'}}
|
||||
//- "Board backgrounds" was here. It was the list of pictures uploaded to
|
||||
this board, and that list is drawn inside Change Background Image now -
|
||||
under the upload that adds to it - so a second entry to the same list
|
||||
was a second place to look for one thing.
|
||||
//Bug Board icons random dance https://github.com/wekan/wekan/issues/4214
|
||||
//if currentUser.isBoardAdmin
|
||||
//
|
||||
unless currentSetting.hideBoardMemberList
|
||||
//
|
||||
unless currentSetting.hideCardCounterList
|
||||
//
|
||||
li
|
||||
//
|
||||
a.js-board-info-on-my-boards(title="{{_ 'board-info-on-my-boards'}}")
|
||||
//
|
||||
i.fa.fa-id-card-o
|
||||
//
|
||||
| {{_ 'board-info-on-my-boards'}}
|
||||
hr
|
||||
else if rulesReadable
|
||||
//- #2217: a member of a board that shows its Rules reads them here; the
|
||||
@@ -875,6 +871,18 @@ template(name="boardMenuPopup")
|
||||
| {{_ 'since-last-visit-count' count=sinceVisitCount}}
|
||||
else
|
||||
| {{_ 'since-last-visit'}}
|
||||
//- The Scrum meeting helpers (client/components/boards/scrum/scrumMeetings.jade),
|
||||
each hidden by its Admin Panel feature and by the board's Scrum settings.
|
||||
if showsStandupTimer
|
||||
li
|
||||
a.js-open-daily-standup
|
||||
i.fa.fa-hourglass-half
|
||||
| {{_ 'daily-standup'}}
|
||||
if showsRetrospectiveBoard
|
||||
li
|
||||
a.js-create-retrospective-board
|
||||
i.fa.fa-refresh
|
||||
| {{_ 'retrospective-board'}}
|
||||
unless currentBoard.isTemplatesBoard
|
||||
if currentUser.isBoardAdmin
|
||||
// li
|
||||
@@ -920,6 +928,9 @@ template(name="boardViewSettingsPopup")
|
||||
h4 {{_ 'description'}}
|
||||
.board-view-settings-rows.js-board-view-sortable
|
||||
each boardViewRows
|
||||
//- The same groups as the Board View menu; only rows are dragged.
|
||||
if groupLabelKey
|
||||
.board-view-settings-group-heading {{_ groupLabelKey}}
|
||||
.board-view-settings-row.js-board-view-row(data-view="{{view}}")
|
||||
unless ../publicBoardsHidden
|
||||
.board-view-settings-column
|
||||
@@ -1001,6 +1012,7 @@ template(name="boardListSettingsPopup")
|
||||
span
|
||||
i.fa.fa-columns
|
||||
| {{_ 'same-width-for-all-lists'}}
|
||||
+boardFlowListSettings
|
||||
|
||||
//- #2489: Board Settings / WIP Limit Groups - a shared WIP limit across two or
|
||||
more of this board's lists together, on top of the existing per-list
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Template } from 'meteor/templating';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import { ReactiveDict } from 'meteor/reactive-dict';
|
||||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { isSelectedSubtaskBoard, isSelectedSubtaskList } from '/models/lib/subtaskSettings';
|
||||
import { liveAttachments } from '/models/lib/attachmentSoftDelete';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
@@ -547,6 +548,17 @@ function openRulesViewFromBoardMenu(mode) {
|
||||
}
|
||||
|
||||
Template.boardMenuPopup.events({
|
||||
'click .js-open-daily-standup': Popup.open('dailyStandup'),
|
||||
async 'click .js-create-retrospective-board'() {
|
||||
const board = Utils.getCurrentBoard();
|
||||
if (!board) return;
|
||||
Popup.close();
|
||||
try {
|
||||
await require('/client/components/sidebar/scrumMeetings').createRetrospectiveBoard(board);
|
||||
} catch (error) {
|
||||
window.alert((error && (error.reason || error.error)) || String(error));
|
||||
}
|
||||
},
|
||||
'click .js-open-rules-list-view'(event) { event.preventDefault(); openRulesViewFromBoardMenu('list'); },
|
||||
'click .js-open-rules-workflow-view'(event) { event.preventDefault(); openRulesViewFromBoardMenu('workflow'); },
|
||||
'click .js-open-rules-bots-view'(event) { event.preventDefault(); openRulesViewFromBoardMenu('bots'); },
|
||||
@@ -780,8 +792,13 @@ Template.boardViewSettingsPopup.helpers({
|
||||
boardViewRows() {
|
||||
const board = Utils.getCurrentBoard();
|
||||
// #6736: views the instance disabled are not rows; their board settings stay.
|
||||
const ordered = boardViewSettings.orderedBoardViews(board).filter(v => allowBoardView(v.view));
|
||||
return ordered.map(v => ({
|
||||
// Grouped as the Board View menu is (BOARD_VIEW_GROUPS): a heading over
|
||||
// each group, the board's order inside it.
|
||||
const ordered = boardViewSettings.groupedBoardViews(
|
||||
boardViewSettings.orderedBoardViews(board).filter(v => allowBoardView(v.view)));
|
||||
const headingOf = group => (boardViewSettings.BOARD_VIEW_GROUPS.find(g => g.group === group) || {}).labelKey;
|
||||
return ordered.map((v, i) => ({
|
||||
groupLabelKey: i === 0 || ordered[i - 1].group !== v.group ? headingOf(v.group) : null,
|
||||
view: v.view,
|
||||
labelKey: v.labelKey,
|
||||
icon: `fa ${v.icon}`,
|
||||
@@ -993,6 +1010,11 @@ Template.wipLimitGroupsPopup.events({
|
||||
});
|
||||
|
||||
Template.boardMenuPopup.helpers({
|
||||
// The Scrum meeting helpers (scrumMeetings.js).
|
||||
showsStandupTimer() { return require('/client/components/sidebar/scrumMeetings').showsStandupTimer(Utils.getCurrentBoard()); },
|
||||
showsRetrospectiveBoard() {
|
||||
return require('/client/components/sidebar/scrumMeetings').showsRetrospectiveBoard(Utils.getCurrentBoard());
|
||||
},
|
||||
sinceVisitCount() {
|
||||
return Template.instance().sinceVisitCount.get();
|
||||
},
|
||||
@@ -1885,7 +1907,7 @@ Template.boardSubtaskSettingsBody.helpers({
|
||||
},
|
||||
isBoardSelected() {
|
||||
const tpl = Template.instance();
|
||||
return tpl.currentBoard.subtasksDefaultBoardId === Template.currentData()._id;
|
||||
return isSelectedSubtaskBoard(tpl.currentBoard, Template.currentData()._id);
|
||||
},
|
||||
isNullBoardSelected() {
|
||||
const tpl = Template.instance();
|
||||
@@ -1960,7 +1982,7 @@ Template.boardSubtaskSettingsBody.helpers({
|
||||
// #3876 / #4947: the selected landing list must be compared against
|
||||
// subtasksDefaultListId (the stored list id), NOT subtasksDefaultBoardId.
|
||||
const tpl = Template.instance();
|
||||
return tpl.currentBoard.subtasksDefaultListId === Template.currentData()._id;
|
||||
return isSelectedSubtaskList(tpl.currentBoard, Template.currentData()._id);
|
||||
},
|
||||
presentParentTask() {
|
||||
// Get the current board reactively using board ID from Session
|
||||
|
||||
@@ -119,7 +119,7 @@ template(name="restoreArchivedCardToListPopup")
|
||||
if availableLists.length
|
||||
select.js-select-restore-target-list(autofocus)
|
||||
each availableLists
|
||||
option(value="{{_id}}" selected="{{#if isSelectedList _id}}selected{{/if}}") {{add @index 1}}. {{title}}
|
||||
option(value="{{_id}}" selected="{{#if isSelectedList _id}}selected{{/if}}") {{title}}
|
||||
|
||||
.edit-controls.clearfix
|
||||
button.primary.confirm.js-restore-card-to-list {{_ 'restore'}}
|
||||
@@ -134,7 +134,7 @@ template(name="restoreArchivedListToSwimlanePopup")
|
||||
p {{_ 'no-results'}}, {{_ 'wip-limit-group-select-swimlane'}}:
|
||||
select.js-select-restore-target-swimlane(autofocus)
|
||||
each availableSwimlanes
|
||||
option(value="{{_id}}" selected="{{#if isSelectedSwimlane _id}}selected{{/if}}") {{add @index 1}}. {{isTitleDefault title}}
|
||||
option(value="{{_id}}" selected="{{#if isSelectedSwimlane _id}}selected{{/if}}") {{isTitleDefault title}}
|
||||
|
||||
.edit-controls.clearfix
|
||||
button.primary.confirm.js-restore-list-to-swimlane {{_ 'restore'}}
|
||||
@@ -386,22 +386,22 @@ template(name="selectionDestinationPicker")
|
||||
label {{_ 'boards'}}:
|
||||
select.js-select-boards
|
||||
each boards
|
||||
option(value="{{_id}}" selected="{{#if isDialogOptionBoardId _id}}selected{{/if}}") {{add @index 1}}. {{title}}
|
||||
option(value="{{_id}}" selected="{{#if isDialogOptionBoardId _id}}selected{{/if}}") {{title}}
|
||||
|
||||
label {{_ 'swimlanes'}}:
|
||||
select.js-select-swimlanes
|
||||
each swimlanes
|
||||
option(value="{{_id}}" selected="{{#if isDialogOptionSwimlaneId _id}}selected{{/if}}") {{add @index 1}}. {{isTitleDefault title}}
|
||||
option(value="{{_id}}" selected="{{#if isDialogOptionSwimlaneId _id}}selected{{/if}}") {{isTitleDefault title}}
|
||||
|
||||
label {{_ 'lists'}}:
|
||||
select.js-select-lists
|
||||
each lists
|
||||
option(value="{{_id}}" selected="{{#if isDialogOptionListId _id}}selected{{/if}}") {{add @index 1}}. {{title}}
|
||||
option(value="{{_id}}" selected="{{#if isDialogOptionListId _id}}selected{{/if}}") {{title}}
|
||||
|
||||
label {{_ 'cards'}}:
|
||||
select.js-select-cards
|
||||
each cards
|
||||
option(value="{{_id}}") {{add @index 1}}. {{title}}
|
||||
option(value="{{_id}}") {{title}}
|
||||
|
||||
div
|
||||
input(type="radio" name="position" value="above" checked id="position-above-{{idSuffix}}" style="display: inline")
|
||||
|
||||
@@ -5,6 +5,7 @@ import { SavedCardFilters } from '/client/lib/savedCardFilters';
|
||||
import { captureFilterPreset, applyFilterPreset } from '/client/lib/filterPresetState';
|
||||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
import { displayDefaultTitle } from '/imports/lib/defaultTitle';
|
||||
import { Filter } from '/client/lib/filter';
|
||||
import { EscapeActions } from '/client/lib/escapeActions';
|
||||
import { MultiSelection } from '/client/lib/multiSelection';
|
||||
@@ -617,23 +618,7 @@ Template.selectionDestinationPicker.helpers({
|
||||
return Template.instance().dialog.selectedListId.get() === listId;
|
||||
},
|
||||
isTitleDefault(title) {
|
||||
if (
|
||||
title.startsWith("key 'default") &&
|
||||
title.endsWith('returned an object instead of string.')
|
||||
) {
|
||||
const translated = `${TAPi18n.__('defaultdefault')}`;
|
||||
if (
|
||||
translated.startsWith("key 'default") &&
|
||||
translated.endsWith('returned an object instead of string.')
|
||||
) {
|
||||
return 'Default';
|
||||
}
|
||||
return translated;
|
||||
}
|
||||
if (title === 'Default') {
|
||||
return `${TAPi18n.__('defaultdefault')}`;
|
||||
}
|
||||
return title;
|
||||
return displayDefaultTitle(title, key => TAPi18n.__(key));
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -52,6 +52,8 @@ template(name="editSwimlaneTitleForm")
|
||||
i.fa.fa-times-thin
|
||||
|
||||
template(name="swimlaneActionPopup")
|
||||
//- Grouped under headings (2026-11-20), as the list and card menus are; every
|
||||
entry keeps its own condition.
|
||||
if currentUser
|
||||
//- Copy link, FIRST and above every permission check: a swimlane has an
|
||||
address now, and copying it is reading, not editing - somebody who may
|
||||
@@ -59,6 +61,7 @@ template(name="swimlaneActionPopup")
|
||||
The rows below are all guarded because they change the board.
|
||||
models/lib/boardItemUrl.js, docs/Features/General/Board-Item-Links.md
|
||||
ul.pop-over-list
|
||||
li.menu-group-heading {{_ 'menu-group-share'}}
|
||||
li: a.js-copy-swimlane-link
|
||||
i.fa.fa-link
|
||||
span
|
||||
@@ -83,6 +86,7 @@ template(name="swimlaneActionPopup")
|
||||
like copying a link it is READING - so it sits above the rows that change
|
||||
the board and is not guarded by them.
|
||||
ul.pop-over-list
|
||||
li.menu-group-heading {{_ 'menu-group-export'}}
|
||||
li: a.js-export-swimlane
|
||||
i.fa.fa-upload
|
||||
span {{_ 'export'}}
|
||||
@@ -95,6 +99,7 @@ template(name="swimlaneActionPopup")
|
||||
unless currentUser.isReadOnly
|
||||
unless currentUser.isReadAssignedOnly
|
||||
ul.pop-over-list
|
||||
li.menu-group-heading {{_ 'add'}}
|
||||
li: a.js-add-swimlane
|
||||
i.fa.fa-plus
|
||||
span
|
||||
@@ -115,12 +120,14 @@ template(name="swimlaneActionPopup")
|
||||
if currentUser.isBoardAdmin
|
||||
hr
|
||||
ul.pop-over-list
|
||||
li.menu-group-heading {{_ 'appearance'}}
|
||||
li: a.js-set-swimlane-color
|
||||
i.fa.fa-paint-brush
|
||||
| {{_ 'select-color'}}
|
||||
unless this.isTemplateContainer
|
||||
hr
|
||||
ul.pop-over-list
|
||||
li.menu-group-heading {{_ 'menu-group-move-copy'}}
|
||||
li: a.js-copy-swimlane
|
||||
i.fa.fa-clipboard
|
||||
| {{_ 'copy-swimlane'}}
|
||||
@@ -130,6 +137,7 @@ template(name="swimlaneActionPopup")
|
||||
| {{_ 'move-swimlane'}}
|
||||
hr
|
||||
ul.pop-over-list
|
||||
li.menu-group-heading {{_ 'archives'}}
|
||||
li: a.js-close-swimlane
|
||||
i.fa.fa-archive
|
||||
| {{_ 'archive-swimlane'}}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { titleSortIndexes } from '/models/lib/multilineTitles';
|
||||
import { titlesFromComposer } from '/client/components/forms/multilineTitleChoice';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
import { displayDefaultTitle } from '/imports/lib/defaultTitle';
|
||||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { SWIMLANE_COLORS } from '/models/metadata/colors';
|
||||
import { isHexColor, toHex } from '/models/lib/contrastColor';
|
||||
@@ -51,51 +52,13 @@ Template.swimlaneFixedHeader.helpers({
|
||||
return Utils.getSwimlaneCollapseState(swimlane);
|
||||
},
|
||||
isTitleDefault(title) {
|
||||
// https://github.com/wekan/wekan/issues/4763
|
||||
// https://github.com/wekan/wekan/issues/4742
|
||||
// Translation text for "default" does not work, it returns an object.
|
||||
// When that happens, try use translation "defaultdefault" that has same content of default, or return text "Default".
|
||||
// This can happen, if swimlane does not have name.
|
||||
// Yes, this is fixing the symptom (Swimlane title does not have title)
|
||||
// instead of fixing the problem (Add Swimlane title when creating swimlane)
|
||||
// because there could be thousands of swimlanes, adding name Default to all of them
|
||||
// would be very slow.
|
||||
if (title.startsWith("key 'default") && title.endsWith('returned an object instead of string.')) {
|
||||
if (`${TAPi18n.__('defaultdefault')}`.startsWith("key 'default") && `${TAPi18n.__('defaultdefault')}`.endsWith('returned an object instead of string.')) {
|
||||
return 'Default';
|
||||
} else {
|
||||
return `${TAPi18n.__('defaultdefault')}`;
|
||||
}
|
||||
} else if (title === 'Default') {
|
||||
return `${TAPi18n.__('defaultdefault')}`;
|
||||
} else {
|
||||
return title;
|
||||
}
|
||||
return displayDefaultTitle(title, key => TAPi18n.__(key));
|
||||
},
|
||||
});
|
||||
|
||||
Template.editSwimlaneTitleForm.helpers({
|
||||
isTitleDefault(title) {
|
||||
// https://github.com/wekan/wekan/issues/4763
|
||||
// https://github.com/wekan/wekan/issues/4742
|
||||
// Translation text for "default" does not work, it returns an object.
|
||||
// When that happens, try use translation "defaultdefault" that has same content of default, or return text "Default".
|
||||
// This can happen, if swimlane does not have name.
|
||||
// Yes, this is fixing the symptom (Swimlane title does not have title)
|
||||
// instead of fixing the problem (Add Swimlane title when creating swimlane)
|
||||
// because there could be thousands of swimlanes, adding name Default to all of them
|
||||
// would be very slow.
|
||||
if (title.startsWith("key 'default") && title.endsWith('returned an object instead of string.')) {
|
||||
if (`${TAPi18n.__('defaultdefault')}`.startsWith("key 'default") && `${TAPi18n.__('defaultdefault')}`.endsWith('returned an object instead of string.')) {
|
||||
return 'Default';
|
||||
} else {
|
||||
return `${TAPi18n.__('defaultdefault')}`;
|
||||
}
|
||||
} else if (title === 'Default') {
|
||||
return `${TAPi18n.__('defaultdefault')}`;
|
||||
} else {
|
||||
return title;
|
||||
}
|
||||
return displayDefaultTitle(title, key => TAPi18n.__(key));
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -463,7 +463,13 @@ body.swimlane-resizing-active * {
|
||||
/* #2805: one shared list header row for all swimlanes (Board Settings /
|
||||
Swimlane). The other swimlanes do not repeat the first swimlane's list
|
||||
headers; those stay at the top through the same sticky rule as Sticky list
|
||||
headers (#3847, lists/list.css), which the setting turns on. */
|
||||
headers (#3847, lists/list.css), which the setting turns on.
|
||||
!important: the desktop list header layout sets `display: block !important`
|
||||
(lists/list.css `.list:not(.list-collapsed):not(.mobile-view) .list-header`,
|
||||
boardHeader.css `.desktop-mode .list-header`), and a plain `display: none`
|
||||
loses to any !important one, so every swimlane kept its headers. Between
|
||||
!important declarations specificity decides, and this selector (0,5,0)
|
||||
outranks those (0,4,0 at most). tests/sharedListRow6902.test.cjs. */
|
||||
.board-canvas.shared-list-headers .js-swimlane:not(.is-first-swimlane) .list-header {
|
||||
display: none;
|
||||
display: none !important;
|
||||
}
|
||||
@@ -13,6 +13,12 @@ template(name="headerUserBar")
|
||||
= currentUser.username
|
||||
|
||||
template(name="memberMenuPopup")
|
||||
//- #6837: a feature profile hides features on purpose, and says so, so a
|
||||
hidden feature is never taken for a missing one (models/lib/featureProfiles.js).
|
||||
with featureProfileNotice
|
||||
p.feature-profile-notice.quiet(role="note")
|
||||
i.fa.fa-eye-slash(aria-hidden="true")
|
||||
| {{_ 'feature-profile-notice' name=name count=hiddenCount}}
|
||||
ul.pop-over-list
|
||||
with currentUser
|
||||
//- #6732: at the top - Show My / Show Board Dependencies, Import, Export.
|
||||
@@ -26,6 +32,16 @@ template(name="memberMenuPopup")
|
||||
a.js-due-cards(href="{{pathFor 'due-cards'}}")
|
||||
i.fa.fa-calendar
|
||||
| {{_ 'dueCards-title'}}
|
||||
if allowFeature 'workload'
|
||||
li
|
||||
a.js-workload(href="{{pathFor 'workload'}}")
|
||||
i.fa.fa-tachometer
|
||||
| {{_ 'workload-title'}}
|
||||
if allowFeature 'billing'
|
||||
li
|
||||
a.js-billing(href="{{pathFor 'billing'}}")
|
||||
i.fa.fa-money
|
||||
| {{_ 'billing-title'}}
|
||||
li
|
||||
a.js-my-attachments(href="{{pathFor 'my-attachments'}}")
|
||||
i.fa.fa-paperclip
|
||||
@@ -231,12 +247,6 @@ template(name="editProfilePopup")
|
||||
input#anonymizeButton.primary.wide(type="button" value="{{_ 'anonymize-account'}}")
|
||||
|
||||
|
||||
template(name="supportPopup")
|
||||
ul.pop-over-list
|
||||
li
|
||||
+viewer
|
||||
= currentSetting.supportPopupText
|
||||
|
||||
template(name="changePasswordPopup")
|
||||
+atForm(state='changePwd')
|
||||
|
||||
|
||||
@@ -89,6 +89,12 @@ Template.memberMenuPopup.events({
|
||||
'click .js-due-cards'() {
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-workload'() {
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-billing'() {
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-my-attachments'() {
|
||||
Popup.back();
|
||||
},
|
||||
@@ -121,7 +127,6 @@ Template.memberMenuPopup.events({
|
||||
'click .js-sqrl': Popup.open('sqrl'),
|
||||
'click .js-hidden-boards': Popup.open('hiddenBoards'),
|
||||
'click .js-change-language': Popup.open('changeLanguage'),
|
||||
'click .js-support': Popup.open('support'),
|
||||
async 'click .js-logout'(event) {
|
||||
event.preventDefault();
|
||||
if (Meteor.user()?.authenticationMethod === 'saml') {
|
||||
|
||||
@@ -177,10 +177,6 @@ Blaze.registerHelper('canCheckChecklistItem', function canCheckChecklistItem() {
|
||||
|
||||
Blaze.registerHelper('canModifyBoard', () => Utils.canModifyBoard());
|
||||
|
||||
Blaze.registerHelper('add', (a, b) => a + b);
|
||||
|
||||
Blaze.registerHelper('increment', (n) => (n || 0) + 1);
|
||||
|
||||
// Operator helpers (replacement for raix:handlebar-helpers)
|
||||
Blaze.registerHelper('$eq', (a, b) => a === b);
|
||||
Blaze.registerHelper('$neq', (a, b) => a !== b);
|
||||
|
||||
@@ -23,6 +23,7 @@ import '/client/components/boards/bigboardView.jade';
|
||||
import '/client/components/boards/mapView.jade';
|
||||
import '/client/components/boards/emailView.jade';
|
||||
import '/client/components/boards/chatView.jade';
|
||||
import '/client/components/boards/websiteView.jade';
|
||||
import '/client/components/boards/versionControlView.jade';
|
||||
import '/client/components/boards/columnSetsView.jade';
|
||||
import '/client/components/boards/calendarModeView.jade';
|
||||
@@ -51,6 +52,7 @@ import '/client/components/boards/bigboardView.js';
|
||||
import '/client/components/boards/mapView.js';
|
||||
import '/client/components/boards/emailView.js';
|
||||
import '/client/components/boards/chatView.js';
|
||||
import '/client/components/boards/websiteView.js';
|
||||
import '/client/components/boards/versionControlView.js';
|
||||
import '/client/components/boards/columnSetsView.js';
|
||||
import '/client/components/boards/calendarModeView.js';
|
||||
@@ -72,6 +74,7 @@ import '/client/components/boards/bigboardView.css';
|
||||
import '/client/components/boards/mapView.css';
|
||||
import '/client/components/boards/emailView.css';
|
||||
import '/client/components/boards/chatView.css';
|
||||
import '/client/components/boards/websiteView.css';
|
||||
import '/client/components/boards/versionControlView.css';
|
||||
import '/client/components/boards/columnSetsView.css';
|
||||
import '/client/components/boards/calendarModeView.css';
|
||||
|
||||
@@ -4,6 +4,7 @@ import '/client/components/cards/cardDate.jade';
|
||||
import '/client/components/cards/cardDescription.jade';
|
||||
import '/client/components/cards/cardDetails.jade';
|
||||
import '/client/components/cards/cardFlowtime.jade';
|
||||
import '/client/components/cards/cardFlow.jade';
|
||||
import '/client/components/cards/cardPomodoro.jade';
|
||||
import '/client/components/cards/cardStickers.jade';
|
||||
import '/client/components/cards/cardTextNotes.jade';
|
||||
@@ -23,6 +24,7 @@ import '/client/components/cards/cardDetails.js';
|
||||
import '/client/components/cards/cardAddFields.js';
|
||||
import '/client/components/cards/cardDrawing.js';
|
||||
import '/client/components/cards/cardFlowtime.js';
|
||||
import '/client/components/cards/cardFlow.js';
|
||||
import '/client/components/cards/cardPomodoro.js';
|
||||
import '/client/components/cards/cardStickers.js';
|
||||
import '/client/components/cards/cardTextNotes.js';
|
||||
@@ -44,6 +46,7 @@ import '/client/components/cards/cardDetails.css';
|
||||
import '/client/components/cards/cardAddFields.css';
|
||||
import '/client/components/cards/cardDrawing.css';
|
||||
import '/client/components/cards/cardFlowtime.css';
|
||||
import '/client/components/cards/cardFlow.css';
|
||||
import '/client/components/cards/cardPomodoro.css';
|
||||
import '/client/components/cards/cardTime.css';
|
||||
import '/client/components/cards/checklists.css';
|
||||
|
||||
@@ -2,12 +2,15 @@ import '/client/components/lists/list.jade';
|
||||
import '/client/components/lists/listBody.jade';
|
||||
import '/client/components/lists/listHeader.jade';
|
||||
import '/client/components/lists/listPermissions.jade';
|
||||
import '/client/components/lists/listFlowPolicies.jade';
|
||||
import '/client/components/lists/minilist.jade';
|
||||
|
||||
import '/client/components/lists/list.js';
|
||||
import '/client/components/lists/listBody.js';
|
||||
import '/client/components/lists/listHeader.js';
|
||||
import '/client/components/lists/listPermissions.js';
|
||||
import '/client/components/lists/listFlowPolicies.js';
|
||||
|
||||
import '/client/components/lists/list.css';
|
||||
import '/client/components/lists/listFlowPolicies.css';
|
||||
|
||||
@@ -34,6 +34,15 @@ import '/client/components/main/shareTarget.jade';
|
||||
// #2026 / #1377: the all-boards activity feed.
|
||||
import '/client/components/main/activityFeed.jade';
|
||||
import '/client/components/main/activityFeed.css';
|
||||
// Workload and capacity (docs/Features/Workload/Workload.md).
|
||||
import '/client/components/main/workload.jade';
|
||||
import '/client/components/main/workload.css';
|
||||
// Budget and billing (docs/Features/Billing/Billing.md).
|
||||
import '/client/components/main/billing.jade';
|
||||
import '/client/components/main/billing.css';
|
||||
// Cloud Panel (docs/Features/Admin-Panel/Cloud-Panel.md).
|
||||
import '/client/components/cloud/cloudPanel.jade';
|
||||
import '/client/components/cloud/cloudPanel.css';
|
||||
|
||||
import '/client/lib/keyboard';
|
||||
import '/client/lib/popup';
|
||||
@@ -62,6 +71,9 @@ import '/client/components/main/spinner.js';
|
||||
import '/client/components/main/support.js';
|
||||
import '/client/components/main/shareTarget.js';
|
||||
import '/client/components/main/activityFeed.js';
|
||||
import '/client/components/main/workload.js';
|
||||
import '/client/components/main/billing.js';
|
||||
import '/client/components/cloud/cloudPanel.js';
|
||||
|
||||
import '/client/components/main/mapProvider.css';
|
||||
import '/client/components/main/accessibility.css';
|
||||
|
||||
@@ -4,6 +4,7 @@ import '/client/components/sidebar/sidebarOriginalPositions.jade';
|
||||
import '/client/components/sidebar/sidebarCustomFields.jade';
|
||||
import '/client/components/sidebar/sidebarFilters.jade';
|
||||
import '/client/components/sidebar/sidebarSearches.jade';
|
||||
import '/client/components/sidebar/scrumMeetings.jade';
|
||||
|
||||
import '/client/components/sidebar/sidebar.js';
|
||||
import '/client/components/sidebar/sidebarArchives.js';
|
||||
@@ -13,7 +14,9 @@ import '/client/components/sidebar/sidebarSinceLastVisit.js';
|
||||
import '/client/components/sidebar/sidebarCustomFields.js';
|
||||
import '/client/components/sidebar/sidebarFilters.js';
|
||||
import '/client/components/sidebar/sidebarSearches.js';
|
||||
import '/client/components/sidebar/scrumMeetings.js';
|
||||
|
||||
import '/client/components/sidebar/sidebar.css';
|
||||
import '/client/components/sidebar/sidebarSearches.css';
|
||||
import '/client/components/sidebar/scrumMeetings.css';
|
||||
|
||||
@@ -66,7 +66,6 @@ import '/client/lib/localStorageValidator';
|
||||
import '/client/lib/modal';
|
||||
import '/client/lib/multiSelection';
|
||||
import '/client/lib/pasteImage';
|
||||
import '/client/lib/secureDOMPurify';
|
||||
import '/client/lib/spinner';
|
||||
import '/client/lib/textComplete';
|
||||
import '/client/lib/unsavedEdits';
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
// #6924: the card shortcuts open ONLY their popup. `d` (Due date), Shift+M
|
||||
// (Move card) and Shift+C (Copy card) on a hovered or selected minicard used
|
||||
// to open the card first, and Shift+M / Shift+C went through the card's
|
||||
// hamburger menu too - three things for one key. Now the popup opens by
|
||||
// itself, next to the minicard, as a click on a minicard's due date or label
|
||||
// opens only its popup; on an opened card, Move / Copy open next to the card's
|
||||
// hamburger without showing the menu first.
|
||||
//
|
||||
// The popup is opened directly, so these are the rules a click would meet.
|
||||
// Each one is the condition the opened card renders that control under, and
|
||||
// tests/cardShortcutPopup.test.cjs ties every rule to that template:
|
||||
// due cardDetails.jade: `if currentBoard.allowsDueDate`, then the date
|
||||
// badge (`if canModifyCard`) when the card has a due date, or the add
|
||||
// `+` (`if canModifyCard` / `unless currentUser.isWorker`) when not;
|
||||
// move cardDetailsActionsPopup: `if cardMenuWrites` / `if currentUser.isBoardAdmin`;
|
||||
// copy cardDetailsActionsPopup: `if cardMenuWrites` / `unless currentUser.isWorker`.
|
||||
// cardMenuWrites (cardDetails.js) is: may modify the card, or is a member who
|
||||
// is neither read-only nor read-assigned-only.
|
||||
//
|
||||
// Pure, no Meteor imports, so the test drives it without a browser.
|
||||
|
||||
export const CARD_SHORTCUT_POPUPS = Object.freeze({
|
||||
due: 'editCardDueDate',
|
||||
move: 'moveCard',
|
||||
copy: 'copyCard',
|
||||
});
|
||||
|
||||
// facts: { canModifyCard, isBoardAdmin, isWorker, isReadOnly,
|
||||
// isReadAssignedOnly, allowsDueDate, hasDue } - booleans.
|
||||
// Returns the popup name to open, or null when a click could not open it.
|
||||
export function cardShortcutPopup(action, facts = {}) {
|
||||
const f = facts || {};
|
||||
const cardMenuWrites = Boolean(f.canModifyCard) || !(f.isReadOnly || f.isReadAssignedOnly);
|
||||
switch (action) {
|
||||
case 'due':
|
||||
if (f.allowsDueDate === false || !f.canModifyCard) return null;
|
||||
if (!f.hasDue && f.isWorker) return null;
|
||||
return CARD_SHORTCUT_POPUPS.due;
|
||||
case 'move':
|
||||
return cardMenuWrites && f.isBoardAdmin ? CARD_SHORTCUT_POPUPS.move : null;
|
||||
case 'copy':
|
||||
return cardMenuWrites && !f.isWorker ? CARD_SHORTCUT_POPUPS.copy : null;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
const SAFE_ID = /^[A-Za-z0-9_-]+$/;
|
||||
|
||||
// The minicard element of a card, to anchor its popup: the hovered one when it
|
||||
// is that card (a card can be on the board more than once), else the first.
|
||||
// null for an id that is not a plain id, so it never reaches a selector.
|
||||
export function findMinicard(root, cardId, hovered = null) {
|
||||
if (!root || typeof cardId !== 'string' || !SAFE_ID.test(cardId)) return null;
|
||||
if (hovered && hovered.getAttribute && hovered.getAttribute('data-card-id') === cardId) return hovered;
|
||||
return root.querySelector(`.js-minicard[data-card-id="${cardId}"]`) || null;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
import { displayDefaultTitle } from '/imports/lib/defaultTitle';
|
||||
import { Utils } from '/client/lib/utils';
|
||||
import Boards from '/models/boards';
|
||||
import Swimlanes from '/models/swimlanes';
|
||||
@@ -224,25 +225,7 @@ export class BoardSwimlaneListDialog {
|
||||
|
||||
/** Fix swimlane title translation issue for "Default" swimlane */
|
||||
isTitleDefault(title) {
|
||||
if (
|
||||
title.startsWith("key 'default") &&
|
||||
title.endsWith('returned an object instead of string.')
|
||||
) {
|
||||
if (
|
||||
`${TAPi18n.__('defaultdefault')}`.startsWith("key 'default") &&
|
||||
`${TAPi18n.__('defaultdefault')}`.endsWith(
|
||||
'returned an object instead of string.',
|
||||
)
|
||||
) {
|
||||
return 'Default';
|
||||
} else {
|
||||
return `${TAPi18n.__('defaultdefault')}`;
|
||||
}
|
||||
} else if (title === 'Default') {
|
||||
return `${TAPi18n.__('defaultdefault')}`;
|
||||
} else {
|
||||
return title;
|
||||
}
|
||||
return displayDefaultTitle(title, key => TAPi18n.__(key));
|
||||
}
|
||||
|
||||
/** get the board data from the server */
|
||||
|
||||
@@ -11,7 +11,8 @@ const { isBoardViewAvailable, isFeatureAvailable } = require('/models/lib/instan
|
||||
// calls this, and every list's card loop reads boardView(): with the whole user
|
||||
// document here, a card open (a user write) re-ran every list and Blaze then
|
||||
// re-evaluated every minicard.
|
||||
const PREVIEW_USER_FIELDS = ['featurePreview', 'isAdmin'];
|
||||
// #6837: and the three that pick the user's feature profile.
|
||||
const PREVIEW_USER_FIELDS = ['featurePreview', 'isAdmin', 'featureProfileId', 'teams', 'orgs'];
|
||||
|
||||
export function allowBoardView(view) {
|
||||
return isBoardViewAvailable(ReactiveCache.getCurrentSetting(), currentUserWith(PREVIEW_USER_FIELDS), view);
|
||||
@@ -25,3 +26,11 @@ export function allowFeature(key) {
|
||||
|
||||
// {{#if allowFeature 'board-summary'}} in a template.
|
||||
Template.registerHelper('allowFeature', key => allowFeature(key));
|
||||
|
||||
// #6837: the profile that hides features for the signed-in user, so the
|
||||
// interface can say so - a hidden feature must never look like a missing one.
|
||||
export function featureProfileNotice() {
|
||||
return require('/models/lib/featureProfiles').featureProfileNotice(
|
||||
ReactiveCache.getCurrentSetting(), currentUserWith(PREVIEW_USER_FIELDS));
|
||||
}
|
||||
Template.registerHelper('featureProfileNotice', () => featureProfileNotice());
|
||||
Loaded 100 of 1129 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user