Skip to content

Commit dd83164

Browse files
committed
Merge branch 'develop'
2 parents 96fe976 + 79da35c commit dd83164

File tree

159 files changed

+4966
-24495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+4966
-24495
lines changed

.github/workflows/backend-tests.yml

+16-2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ jobs:
6969
-
7070
name: Run the backend tests
7171
run: pnpm test
72+
- name: Run the new vitest tests
73+
working-directory: src
74+
run: pnpm run test:vitest
7275

7376
withpluginsLinux:
7477
# run on pushes to any branch
@@ -142,6 +145,9 @@ jobs:
142145
-
143146
name: Run the backend tests
144147
run: pnpm test
148+
- name: Run the new vitest tests
149+
working-directory: src
150+
run: pnpm run test:vitest
145151

146152
withoutpluginsWindows:
147153
# run on pushes to any branch
@@ -193,7 +199,11 @@ jobs:
193199
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
194200
-
195201
name: Run the backend tests
196-
run: cd src && pnpm test
202+
working-directory: src
203+
run: pnpm test
204+
- name: Run the new vitest tests
205+
working-directory: src
206+
run: pnpm run test:vitest
197207

198208
withpluginsWindows:
199209
# run on pushes to any branch
@@ -273,4 +283,8 @@ jobs:
273283
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
274284
-
275285
name: Run the backend tests
276-
run: cd src && pnpm test
286+
working-directory: src
287+
run: pnpm test
288+
- name: Run the new vitest tests
289+
working-directory: src
290+
run: pnpm run test:vitest

.github/workflows/frontend-admin-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
restore-keys: |
5151
${{ runner.os }}-pnpm-store-
5252
- name: Cache playwright binaries
53-
uses: actions/cache@v3
53+
uses: actions/cache@v4
5454
id: playwright-cache
5555
with:
5656
path: |

.github/workflows/frontend-tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
name: Create settings.json
5858
run: cp ./src/tests/settings.json settings.json
5959
- name: Cache playwright binaries
60-
uses: actions/cache@v3
60+
uses: actions/cache@v4
6161
id: playwright-cache
6262
with:
6363
path: |
@@ -127,7 +127,7 @@ jobs:
127127
- name: Create settings.json
128128
run: cp ./src/tests/settings.json settings.json
129129
- name: Cache playwright binaries
130-
uses: actions/cache@v3
130+
uses: actions/cache@v4
131131
id: playwright-cache
132132
with:
133133
path: |
@@ -175,7 +175,7 @@ jobs:
175175
with:
176176
node-version: 22
177177
- name: Cache playwright binaries
178-
uses: actions/cache@v3
178+
uses: actions/cache@v4
179179
id: playwright-cache
180180
with:
181181
path: |

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 2.2.3
2+
3+
### Notable enhancements and fixes
4+
5+
- Introduced a new in process database `rustydb` that represents a fast key value store written in Rust.
6+
- Readded window._ as a shortcut for getting text
7+
- Added support for migrating any ueberdb database to another. You can now switch as you please. See here: https://docs.etherpad.org/cli.html
8+
- Further Typescript movements
9+
- A lot of security issues fixed and reviewed in this release. Please update.
10+
11+
112
# 2.2.2
213

314
### Notable enhancements and fixes

Dockerfile

+13-6
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ ARG ETHERPAD_PLUGINS=
4949
# ETHERPAD_LOCAL_PLUGINS="../ep_my_plugin ../ep_another_plugin"
5050
ARG ETHERPAD_LOCAL_PLUGINS=
5151

52+
# github plugins to install while building the container. By default no plugins are
53+
# installed.
54+
# If given a value, it has to be a space-separated, quoted list of plugin names.
55+
#
56+
# EXAMPLE:
57+
# ETHERPAD_GITHUB_PLUGINS="ether/ep_plugin"
58+
ARG ETHERPAD_GITHUB_PLUGINS=
59+
5260
# Control whether abiword will be installed, enabling exports to DOC/PDF/ODT formats.
5361
# By default, it is not installed.
5462
# If given any value, abiword will be installed.
@@ -114,13 +122,13 @@ COPY --chown=etherpad:etherpad ./pnpm-workspace.yaml ./package.json ./
114122

115123
FROM build AS development
116124

117-
COPY --chown=etherpad:etherpad ./src/package.json .npmrc ./src/
125+
COPY --chown=etherpad:etherpad ./src/ ./src/
118126
COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/ templates/admin./src/templates/admin
119127
COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/static/oidc ./src/static/oidc
120128

121129
RUN bin/installDeps.sh && \
122-
if [ ! -z "${ETHERPAD_PLUGINS}" ] || [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ]; then \
123-
pnpm run plugins i ${ETHERPAD_PLUGINS} ${ETHERPAD_LOCAL_PLUGINS:+--path ${ETHERPAD_LOCAL_PLUGINS}}; \
130+
if [ ! -z "${ETHERPAD_PLUGINS}" ] || [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ] || [ ! -z "${ETHERPAD_GITHUB_PLUGINS}" ]; then \
131+
pnpm run plugins i ${ETHERPAD_PLUGINS} ${ETHERPAD_LOCAL_PLUGINS:+--path ${ETHERPAD_LOCAL_PLUGINS}} ${ETHERPAD_GITHUB_PLUGINS:+--github ${ETHERPAD_GITHUB_PLUGINS}}; \
124132
fi
125133

126134

@@ -134,11 +142,10 @@ COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/template
134142
COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/static/oidc ./src/static/oidc
135143

136144
RUN bin/installDeps.sh && rm -rf ~/.npm && rm -rf ~/.local && rm -rf ~/.cache && \
137-
if [ ! -z "${ETHERPAD_PLUGINS}" ] || [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ]; then \
138-
pnpm run plugins i ${ETHERPAD_PLUGINS} ${ETHERPAD_LOCAL_PLUGINS:+--path ${ETHERPAD_LOCAL_PLUGINS}}; \
145+
if [ ! -z "${ETHERPAD_PLUGINS}" ] || [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ] || [ ! -z "${ETHERPAD_GITHUB_PLUGINS}" ]; then \
146+
pnpm run plugins i ${ETHERPAD_PLUGINS} ${ETHERPAD_LOCAL_PLUGINS:+--path ${ETHERPAD_LOCAL_PLUGINS}} ${ETHERPAD_GITHUB_PLUGINS:+--github ${ETHERPAD_GITHUB_PLUGINS}}; \
139147
fi
140148

141-
142149
# Copy the configuration file.
143150
COPY --chown=etherpad:etherpad ${SETTINGS} "${EP_DIR}"/settings.json
144151

admin/package.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "admin",
33
"private": true,
4-
"version": "2.2.2",
4+
"version": "2.2.3",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
@@ -16,27 +16,27 @@
1616
"devDependencies": {
1717
"@radix-ui/react-dialog": "^1.1.1",
1818
"@radix-ui/react-toast": "^1.2.1",
19-
"@types/react": "^18.3.2",
19+
"@types/react": "^18.3.5",
2020
"@types/react-dom": "^18.2.25",
21-
"@typescript-eslint/eslint-plugin": "^8.0.1",
22-
"@typescript-eslint/parser": "^8.0.1",
21+
"@typescript-eslint/eslint-plugin": "^8.4.0",
22+
"@typescript-eslint/parser": "^8.4.0",
2323
"@vitejs/plugin-react-swc": "^3.5.0",
24-
"eslint": "^9.8.0",
24+
"eslint": "^9.9.1",
2525
"eslint-plugin-react-hooks": "^4.6.0",
26-
"eslint-plugin-react-refresh": "^0.4.9",
27-
"i18next": "^23.12.2",
26+
"eslint-plugin-react-refresh": "^0.4.11",
27+
"i18next": "^23.14.0",
2828
"i18next-browser-languagedetector": "^8.0.0",
29-
"lucide-react": "^0.426.0",
29+
"lucide-react": "^0.438.0",
3030
"react": "^18.2.0",
3131
"react-dom": "^18.2.0",
32-
"react-hook-form": "^7.52.2",
32+
"react-hook-form": "^7.53.0",
3333
"react-i18next": "^15.0.1",
34-
"react-router-dom": "^6.26.0",
34+
"react-router-dom": "^6.26.1",
3535
"socket.io-client": "^4.7.5",
3636
"typescript": "^5.5.4",
37-
"vite": "^5.4.0",
37+
"vite": "^5.4.3",
3838
"vite-plugin-static-copy": "^1.0.6",
3939
"vite-plugin-svgr": "^4.2.0",
40-
"zustand": "^4.5.4"
40+
"zustand": "^4.5.5"
4141
}
4242
}

admin/src/index.css

+9
Original file line numberDiff line numberDiff line change
@@ -802,3 +802,12 @@ input, button, select, optgroup, textarea {
802802
background-color: var(--etherpad-color);
803803
color: white
804804
}
805+
806+
.search-pads{
807+
text-align: center;
808+
}
809+
810+
.search-pads-body tr td:last-child {
811+
display: flex;
812+
justify-content: center;
813+
}

admin/src/pages/HomePage.tsx

+63-13
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,51 @@ import {Trans, useTranslation} from "react-i18next";
66
import {SearchField} from "../components/SearchField.tsx";
77
import {Download, Trash} from "lucide-react";
88
import {IconButton} from "../components/IconButton.tsx";
9+
import {determineSorting} from "../utils/sorting.ts";
910

1011

1112
export const HomePage = () => {
1213
const pluginsSocket = useStore(state=>state.pluginsSocket)
1314
const [plugins,setPlugins] = useState<PluginDef[]>([])
1415
const [installedPlugins, setInstalledPlugins] = useState<InstalledPlugin[]>([])
16+
const [searchParams, setSearchParams] = useState<SearchParams>({
17+
offset: 0,
18+
limit: 99999,
19+
sortBy: 'name',
20+
sortDir: 'asc',
21+
searchTerm: ''
22+
})
23+
24+
const filteredInstallablePlugins = useMemo(()=>{
25+
return plugins.sort((a, b)=>{
26+
if(searchParams.sortBy === "version"){
27+
if(searchParams.sortDir === "asc"){
28+
return a.version.localeCompare(b.version)
29+
}
30+
return b.version.localeCompare(a.version)
31+
}
32+
33+
if(searchParams.sortBy === "last-updated"){
34+
if(searchParams.sortDir === "asc"){
35+
return a.time.localeCompare(b.time)
36+
}
37+
return b.time.localeCompare(a.time)
38+
}
39+
40+
41+
if (searchParams.sortBy === "name") {
42+
if(searchParams.sortDir === "asc"){
43+
return a.name.localeCompare(b.name)
44+
}
45+
return b.name.localeCompare(a.name)
46+
}
47+
return 0
48+
})
49+
}, [plugins, searchParams])
50+
1551
const sortedInstalledPlugins = useMemo(()=>{
1652
return installedPlugins.sort((a, b)=>{
53+
1754
if(a.name < b.name){
1855
return -1
1956
}
@@ -23,14 +60,8 @@ export const HomePage = () => {
2360
return 0
2461
})
2562

26-
} ,[installedPlugins])
27-
const [searchParams, setSearchParams] = useState<SearchParams>({
28-
offset: 0,
29-
limit: 99999,
30-
sortBy: 'name',
31-
sortDir: 'asc',
32-
searchTerm: ''
33-
})
63+
} ,[installedPlugins, searchParams])
64+
3465
const [searchTerm, setSearchTerm] = useState<string>('')
3566
const {t} = useTranslation()
3667

@@ -165,16 +196,35 @@ export const HomePage = () => {
165196
<table id="available-plugins">
166197
<thead>
167198
<tr>
168-
<th><Trans i18nKey="admin_plugins.name"/></th>
199+
<th className={determineSorting(searchParams.sortBy, searchParams.sortDir == "asc", 'name')} onClick={()=>{
200+
setSearchParams({
201+
...searchParams,
202+
sortBy: 'name',
203+
sortDir: searchParams.sortDir === "asc"? "desc": "asc"
204+
})
205+
}}>
206+
<Trans i18nKey="admin_plugins.name" /></th>
169207
<th style={{width: '30%'}}><Trans i18nKey="admin_plugins.description"/></th>
170-
<th><Trans i18nKey="admin_plugins.version"/></th>
171-
<th><Trans i18nKey="admin_plugins.last-update"/></th>
208+
<th className={determineSorting(searchParams.sortBy, searchParams.sortDir == "asc", 'version')} onClick={()=>{
209+
setSearchParams({
210+
...searchParams,
211+
sortBy: 'version',
212+
sortDir: searchParams.sortDir === "asc"? "desc": "asc"
213+
})
214+
}}><Trans i18nKey="admin_plugins.version"/></th>
215+
<th className={determineSorting(searchParams.sortBy, searchParams.sortDir == "asc", 'last-updated')} onClick={()=>{
216+
setSearchParams({
217+
...searchParams,
218+
sortBy: 'last-updated',
219+
sortDir: searchParams.sortDir === "asc"? "desc": "asc"
220+
})
221+
}}><Trans i18nKey="admin_plugins.last-update"/></th>
172222
<th><Trans i18nKey="ep_admin_pads:ep_adminpads2_action"/></th>
173223
</tr>
174224
</thead>
175225
<tbody style={{overflow: 'auto'}}>
176-
{(plugins.length > 0) ?
177-
plugins.map((plugin) => {
226+
{(filteredInstallablePlugins.length > 0) ?
227+
filteredInstallablePlugins.map((plugin) => {
178228
return <tr key={plugin.name}>
179229
<td><a rel="noopener noreferrer" href={`https://npmjs.com/${plugin.name}`} target="_blank">{plugin.name}</a></td>
180230
<td>{plugin.description}</td>

admin/src/pages/PadPage.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const PadPage = ()=>{
104104
<SearchField value={searchTerm} onChange={v=>setSearchTerm(v.target.value)} placeholder={t('ep_admin_pads:ep_adminpads2_search-heading')}/>
105105
<table>
106106
<thead>
107-
<tr>
107+
<tr className="search-pads">
108108
<th className={determineSorting(searchParams.sortBy, searchParams.ascending, 'padName')} onClick={()=>{
109109
setSearchParams({
110110
...searchParams,
@@ -136,7 +136,7 @@ export const PadPage = ()=>{
136136
<th><Trans i18nKey="ep_admin_pads:ep_adminpads2_action"/></th>
137137
</tr>
138138
</thead>
139-
<tbody>
139+
<tbody className="search-pads-body">
140140
{
141141
pads?.results?.map((pad)=>{
142142
return <tr key={pad.padName}>

admin/src/pages/Plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export type SearchParams = {
2020
searchTerm: string,
2121
offset: number,
2222
limit: number,
23-
sortBy: 'name'|'version',
23+
sortBy: 'name'|'version'|'last-updated',
2424
sortDir: 'asc'|'desc'
2525
}
2626

0 commit comments

Comments
 (0)