mirror of
https://github.com/stalwartlabs/webui.git
synced 2026-12-06 16:04:38 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b8ad61b57 | ||
|
|
0e31addbbb | ||
|
|
e777b81fb8 |
No files matched your search
@@ -2,6 +2,12 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [2.0.6] - 2026-11-13
|
||||
|
||||
### Fixed
|
||||
- OIDC sign-in keeps a query already present in the provider's `authorization_endpoint` (for example Casdoor's `?organization=`) and appends its own parameters with `&`.
|
||||
- Clicking or hovering a list row in Safari now targets that row instead of the last row of the table.
|
||||
|
||||
## [2.0.5] - 2026-11-05
|
||||
|
||||
### Added
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "stalwart-webui",
|
||||
"private": true,
|
||||
"version": "2.0.5",
|
||||
"version": "2.0.6",
|
||||
"stalwart": {
|
||||
"minServerVersion": "1.0.0"
|
||||
},
|
||||
@@ -78,4 +78,4 @@
|
||||
"typescript-eslint": "^8.71.2",
|
||||
"vite": "^8.3.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
||||
*/
|
||||
|
||||
import type { ReactNode } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import type { MouseEvent, ReactNode } from 'react';
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { Checkbox } from '@/components/ui/checkbox';
|
||||
@@ -39,8 +39,26 @@ interface ListTableProps {
|
||||
|
||||
const BODY_CELL = 'px-3.5 py-2.5 first:pl-5 last:pr-5 align-middle';
|
||||
|
||||
const STRETCHED_LINK =
|
||||
"font-semibold text-foreground hover:underline focus-visible:outline-none after:absolute after:inset-0 after:content-[''] focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-ring";
|
||||
const ROW_LINK =
|
||||
'rounded-sm font-semibold text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring';
|
||||
|
||||
const INTERACTIVE = 'a, button, input, label, select, textarea, [role="checkbox"], [data-row-controls]';
|
||||
|
||||
function isRowClick(event: MouseEvent<HTMLTableRowElement>): boolean {
|
||||
const target = event.target;
|
||||
return (
|
||||
event.button === 0 &&
|
||||
!event.defaultPrevented &&
|
||||
!event.metaKey &&
|
||||
!event.ctrlKey &&
|
||||
!event.shiftKey &&
|
||||
!event.altKey &&
|
||||
target instanceof Element &&
|
||||
event.currentTarget.contains(target) &&
|
||||
target.closest(INTERACTIVE) === null &&
|
||||
window.getSelection()?.isCollapsed !== false
|
||||
);
|
||||
}
|
||||
|
||||
export function ListTable({
|
||||
caption,
|
||||
@@ -60,6 +78,7 @@ export function ListTable({
|
||||
busy,
|
||||
}: ListTableProps) {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const colSpan = columns.length + (selection ? 1 : 0) + (renderRowActions ? 1 : 0);
|
||||
const rows = items.flatMap((item) => {
|
||||
const id = itemId(item);
|
||||
@@ -111,12 +130,20 @@ export function ListTable({
|
||||
<tr
|
||||
key={id}
|
||||
className={cn(
|
||||
'relative border-t border-border transition-colors duration-150',
|
||||
'border-t border-border transition-colors duration-150',
|
||||
href && 'cursor-pointer',
|
||||
selection?.isSelected(id) ? 'bg-highlight/70' : 'hover:bg-muted/55',
|
||||
)}
|
||||
onClick={
|
||||
href
|
||||
? (event) => {
|
||||
if (isRowClick(event)) void navigate(href);
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{selection && (
|
||||
<td className="relative z-10 w-10 py-2.5 pl-5 pr-2 align-middle">
|
||||
<td data-row-controls className="w-10 py-2.5 pl-5 pr-2 align-middle">
|
||||
<Checkbox
|
||||
checked={selection.isSelected(id)}
|
||||
onCheckedChange={() => selection.toggle(id)}
|
||||
@@ -139,11 +166,7 @@ export function ListTable({
|
||||
return (
|
||||
<th key={col.name} scope="row" className={cn(BODY_CELL, 'text-left font-normal')}>
|
||||
{href ? (
|
||||
<Link
|
||||
to={href}
|
||||
className={STRETCHED_LINK}
|
||||
aria-label={isEmptyValue(value) ? label : undefined}
|
||||
>
|
||||
<Link to={href} className={ROW_LINK} aria-label={isEmptyValue(value) ? label : undefined}>
|
||||
{content}
|
||||
</Link>
|
||||
) : (
|
||||
@@ -159,7 +182,7 @@ export function ListTable({
|
||||
);
|
||||
})}
|
||||
{renderRowActions && (
|
||||
<td className="relative z-10 py-1.5 pl-2 pr-3 text-right align-middle">
|
||||
<td data-row-controls className="py-1.5 pl-2 pr-3 text-right align-middle">
|
||||
{renderRowActions(item, id, label)}
|
||||
</td>
|
||||
)}
|
||||
|
||||
@@ -235,7 +235,7 @@ export async function startAuthFlow(username: string, returnUrl?: string | null)
|
||||
params.set('resource', resource);
|
||||
}
|
||||
|
||||
window.location.href = `${authorization_endpoint}?${params.toString()}`;
|
||||
window.location.href = appendQuery(authorization_endpoint, params);
|
||||
}
|
||||
|
||||
export function getStoredOAuthData() {
|
||||
@@ -276,6 +276,10 @@ export function buildEndSessionUrl(endSessionEndpoint: string, postLogoutRedirec
|
||||
client_id: clientId,
|
||||
post_logout_redirect_uri: postLogoutRedirectUri,
|
||||
});
|
||||
const sep = endSessionEndpoint.includes('?') ? '&' : '?';
|
||||
return `${endSessionEndpoint}${sep}${params.toString()}`;
|
||||
return appendQuery(endSessionEndpoint, params);
|
||||
}
|
||||
|
||||
function appendQuery(endpoint: string, params: URLSearchParams): string {
|
||||
const sep = endpoint.includes('?') ? '&' : '?';
|
||||
return `${endpoint}${sep}${params.toString()}`;
|
||||
}
|
||||
Reference in new issue
Block a user