Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTV12345 committed Sep 5, 2024
2 parents 96fe976 + 79da35c commit dd83164
Show file tree
Hide file tree
Showing 159 changed files with 4,966 additions and 24,495 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/backend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ jobs:
-
name: Run the backend tests
run: pnpm test
- name: Run the new vitest tests
working-directory: src
run: pnpm run test:vitest

withpluginsLinux:
# run on pushes to any branch
Expand Down Expand Up @@ -142,6 +145,9 @@ jobs:
-
name: Run the backend tests
run: pnpm test
- name: Run the new vitest tests
working-directory: src
run: pnpm run test:vitest

withoutpluginsWindows:
# run on pushes to any branch
Expand Down Expand Up @@ -193,7 +199,11 @@ jobs:
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
-
name: Run the backend tests
run: cd src && pnpm test
working-directory: src
run: pnpm test
- name: Run the new vitest tests
working-directory: src
run: pnpm run test:vitest

withpluginsWindows:
# run on pushes to any branch
Expand Down Expand Up @@ -273,4 +283,8 @@ jobs:
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
-
name: Run the backend tests
run: cd src && pnpm test
working-directory: src
run: pnpm test
- name: Run the new vitest tests
working-directory: src
run: pnpm run test:vitest
2 changes: 1 addition & 1 deletion .github/workflows/frontend-admin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Cache playwright binaries
uses: actions/cache@v3
uses: actions/cache@v4
id: playwright-cache
with:
path: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/frontend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
name: Create settings.json
run: cp ./src/tests/settings.json settings.json
- name: Cache playwright binaries
uses: actions/cache@v3
uses: actions/cache@v4
id: playwright-cache
with:
path: |
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
- name: Create settings.json
run: cp ./src/tests/settings.json settings.json
- name: Cache playwright binaries
uses: actions/cache@v3
uses: actions/cache@v4
id: playwright-cache
with:
path: |
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
with:
node-version: 22
- name: Cache playwright binaries
uses: actions/cache@v3
uses: actions/cache@v4
id: playwright-cache
with:
path: |
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# 2.2.3

### Notable enhancements and fixes

- Introduced a new in process database `rustydb` that represents a fast key value store written in Rust.
- Readded window._ as a shortcut for getting text
- Added support for migrating any ueberdb database to another. You can now switch as you please. See here: https://docs.etherpad.org/cli.html
- Further Typescript movements
- A lot of security issues fixed and reviewed in this release. Please update.


# 2.2.2

### Notable enhancements and fixes
Expand Down
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ ARG ETHERPAD_PLUGINS=
# ETHERPAD_LOCAL_PLUGINS="../ep_my_plugin ../ep_another_plugin"
ARG ETHERPAD_LOCAL_PLUGINS=

# github plugins to install while building the container. By default no plugins are
# installed.
# If given a value, it has to be a space-separated, quoted list of plugin names.
#
# EXAMPLE:
# ETHERPAD_GITHUB_PLUGINS="ether/ep_plugin"
ARG ETHERPAD_GITHUB_PLUGINS=

# Control whether abiword will be installed, enabling exports to DOC/PDF/ODT formats.
# By default, it is not installed.
# If given any value, abiword will be installed.
Expand Down Expand Up @@ -114,13 +122,13 @@ COPY --chown=etherpad:etherpad ./pnpm-workspace.yaml ./package.json ./

FROM build AS development

COPY --chown=etherpad:etherpad ./src/package.json .npmrc ./src/
COPY --chown=etherpad:etherpad ./src/ ./src/
COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/ templates/admin./src/templates/admin
COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/static/oidc ./src/static/oidc

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


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

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


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

Expand Down
24 changes: 12 additions & 12 deletions admin/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "admin",
"private": true,
"version": "2.2.2",
"version": "2.2.3",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -16,27 +16,27 @@
"devDependencies": {
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-toast": "^1.2.1",
"@types/react": "^18.3.2",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.2.25",
"@typescript-eslint/eslint-plugin": "^8.0.1",
"@typescript-eslint/parser": "^8.0.1",
"@typescript-eslint/eslint-plugin": "^8.4.0",
"@typescript-eslint/parser": "^8.4.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^9.8.0",
"eslint": "^9.9.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.9",
"i18next": "^23.12.2",
"eslint-plugin-react-refresh": "^0.4.11",
"i18next": "^23.14.0",
"i18next-browser-languagedetector": "^8.0.0",
"lucide-react": "^0.426.0",
"lucide-react": "^0.438.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.52.2",
"react-hook-form": "^7.53.0",
"react-i18next": "^15.0.1",
"react-router-dom": "^6.26.0",
"react-router-dom": "^6.26.1",
"socket.io-client": "^4.7.5",
"typescript": "^5.5.4",
"vite": "^5.4.0",
"vite": "^5.4.3",
"vite-plugin-static-copy": "^1.0.6",
"vite-plugin-svgr": "^4.2.0",
"zustand": "^4.5.4"
"zustand": "^4.5.5"
}
}
9 changes: 9 additions & 0 deletions admin/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -802,3 +802,12 @@ input, button, select, optgroup, textarea {
background-color: var(--etherpad-color);
color: white
}

.search-pads{
text-align: center;
}

.search-pads-body tr td:last-child {
display: flex;
justify-content: center;
}
76 changes: 63 additions & 13 deletions admin/src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,51 @@ import {Trans, useTranslation} from "react-i18next";
import {SearchField} from "../components/SearchField.tsx";
import {Download, Trash} from "lucide-react";
import {IconButton} from "../components/IconButton.tsx";
import {determineSorting} from "../utils/sorting.ts";


export const HomePage = () => {
const pluginsSocket = useStore(state=>state.pluginsSocket)
const [plugins,setPlugins] = useState<PluginDef[]>([])
const [installedPlugins, setInstalledPlugins] = useState<InstalledPlugin[]>([])
const [searchParams, setSearchParams] = useState<SearchParams>({
offset: 0,
limit: 99999,
sortBy: 'name',
sortDir: 'asc',
searchTerm: ''
})

const filteredInstallablePlugins = useMemo(()=>{
return plugins.sort((a, b)=>{
if(searchParams.sortBy === "version"){
if(searchParams.sortDir === "asc"){
return a.version.localeCompare(b.version)
}
return b.version.localeCompare(a.version)
}

if(searchParams.sortBy === "last-updated"){
if(searchParams.sortDir === "asc"){
return a.time.localeCompare(b.time)
}
return b.time.localeCompare(a.time)
}


if (searchParams.sortBy === "name") {
if(searchParams.sortDir === "asc"){
return a.name.localeCompare(b.name)
}
return b.name.localeCompare(a.name)
}
return 0
})
}, [plugins, searchParams])

const sortedInstalledPlugins = useMemo(()=>{
return installedPlugins.sort((a, b)=>{

if(a.name < b.name){
return -1
}
Expand All @@ -23,14 +60,8 @@ export const HomePage = () => {
return 0
})

} ,[installedPlugins])
const [searchParams, setSearchParams] = useState<SearchParams>({
offset: 0,
limit: 99999,
sortBy: 'name',
sortDir: 'asc',
searchTerm: ''
})
} ,[installedPlugins, searchParams])

const [searchTerm, setSearchTerm] = useState<string>('')
const {t} = useTranslation()

Expand Down Expand Up @@ -165,16 +196,35 @@ export const HomePage = () => {
<table id="available-plugins">
<thead>
<tr>
<th><Trans i18nKey="admin_plugins.name"/></th>
<th className={determineSorting(searchParams.sortBy, searchParams.sortDir == "asc", 'name')} onClick={()=>{
setSearchParams({
...searchParams,
sortBy: 'name',
sortDir: searchParams.sortDir === "asc"? "desc": "asc"
})
}}>
<Trans i18nKey="admin_plugins.name" /></th>
<th style={{width: '30%'}}><Trans i18nKey="admin_plugins.description"/></th>
<th><Trans i18nKey="admin_plugins.version"/></th>
<th><Trans i18nKey="admin_plugins.last-update"/></th>
<th className={determineSorting(searchParams.sortBy, searchParams.sortDir == "asc", 'version')} onClick={()=>{
setSearchParams({
...searchParams,
sortBy: 'version',
sortDir: searchParams.sortDir === "asc"? "desc": "asc"
})
}}><Trans i18nKey="admin_plugins.version"/></th>
<th className={determineSorting(searchParams.sortBy, searchParams.sortDir == "asc", 'last-updated')} onClick={()=>{
setSearchParams({
...searchParams,
sortBy: 'last-updated',
sortDir: searchParams.sortDir === "asc"? "desc": "asc"
})
}}><Trans i18nKey="admin_plugins.last-update"/></th>
<th><Trans i18nKey="ep_admin_pads:ep_adminpads2_action"/></th>
</tr>
</thead>
<tbody style={{overflow: 'auto'}}>
{(plugins.length > 0) ?
plugins.map((plugin) => {
{(filteredInstallablePlugins.length > 0) ?
filteredInstallablePlugins.map((plugin) => {
return <tr key={plugin.name}>
<td><a rel="noopener noreferrer" href={`https://npmjs.com/${plugin.name}`} target="_blank">{plugin.name}</a></td>
<td>{plugin.description}</td>
Expand Down
4 changes: 2 additions & 2 deletions admin/src/pages/PadPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const PadPage = ()=>{
<SearchField value={searchTerm} onChange={v=>setSearchTerm(v.target.value)} placeholder={t('ep_admin_pads:ep_adminpads2_search-heading')}/>
<table>
<thead>
<tr>
<tr className="search-pads">
<th className={determineSorting(searchParams.sortBy, searchParams.ascending, 'padName')} onClick={()=>{
setSearchParams({
...searchParams,
Expand Down Expand Up @@ -136,7 +136,7 @@ export const PadPage = ()=>{
<th><Trans i18nKey="ep_admin_pads:ep_adminpads2_action"/></th>
</tr>
</thead>
<tbody>
<tbody className="search-pads-body">
{
pads?.results?.map((pad)=>{
return <tr key={pad.padName}>
Expand Down
2 changes: 1 addition & 1 deletion admin/src/pages/Plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type SearchParams = {
searchTerm: string,
offset: number,
limit: number,
sortBy: 'name'|'version',
sortBy: 'name'|'version'|'last-updated',
sortDir: 'asc'|'desc'
}

Expand Down
Loading

0 comments on commit dd83164

Please sign in to comment.