fix(widgets): restore compact v1 surfaces (#6710)
This commit is contained in:
1 parent
1b2f1bd720
commit
643ecf3df7
105 files changed
+1603
-1285
No files matched your search
@@ -39,8 +39,8 @@ describe("Traefik source ownership", () => {
|
||||
});
|
||||
|
||||
describe("Traefik advanced disclosure", () => {
|
||||
test("shows every protocol regardless of compact toggles and height", () => {
|
||||
expect(getTraefikProtocolKeys({ showTcp: false, showUdp: false }, 100, true)).toEqual(["http", "tcp", "udp"]);
|
||||
test("shows every protocol in advanced mode regardless of compact toggles", () => {
|
||||
expect(getTraefikProtocolKeys({ showTcp: false, showUdp: false }, true)).toEqual(["http", "tcp", "udp"]);
|
||||
});
|
||||
|
||||
test("shows every unique entry point regardless of compact width limits", () => {
|
||||
|
||||
@@ -79,12 +79,11 @@ export const getTraefikSourceDetails = (sources: readonly TraefikDashboardSource
|
||||
|
||||
export function getTraefikProtocolKeys(
|
||||
options: Pick<WidgetComponentProps<"traefik">["options"], "showTcp" | "showUdp">,
|
||||
height: number,
|
||||
isAdvanced: boolean,
|
||||
): ProtocolKey[] {
|
||||
const protocols: ProtocolKey[] = ["http"];
|
||||
if (isAdvanced || (options.showTcp && height >= 220)) protocols.push("tcp");
|
||||
if (isAdvanced || (options.showUdp && height >= 300)) protocols.push("udp");
|
||||
if (isAdvanced || options.showTcp) protocols.push("tcp");
|
||||
if (isAdvanced || options.showUdp) protocols.push("udp");
|
||||
return protocols;
|
||||
}
|
||||
|
||||
@@ -105,7 +104,6 @@ function TraefikWidgetContent({
|
||||
integrationIds,
|
||||
options,
|
||||
width,
|
||||
height,
|
||||
displayMode = "compact",
|
||||
}: WidgetComponentProps<"traefik">) {
|
||||
const t = useI18n("widget.traefik");
|
||||
@@ -143,7 +141,7 @@ function TraefikWidgetContent({
|
||||
combined.failedEndpoints.length;
|
||||
const totalWarnings =
|
||||
getProtocolWarnings(combined.http) + getProtocolWarnings(combined.tcp) + getUdpWarnings(combined.udp);
|
||||
const protocolKeys = getTraefikProtocolKeys(options, height, isAdvanced);
|
||||
const protocolKeys = getTraefikProtocolKeys(options, isAdvanced);
|
||||
const entryPoints = getVisibleTraefikEntryPoints(combined.entryPoints, width, isAdvanced);
|
||||
const displayedVersion = successfulData.length === 1 ? successfulData[0]?.dashboard.version : null;
|
||||
|
||||
@@ -194,7 +192,7 @@ function TraefikWidgetContent({
|
||||
))}
|
||||
</div>
|
||||
|
||||
{(isAdvanced || options.showEntryPoints) && entryPoints.length > 0 && (isAdvanced || height >= 340) && (
|
||||
{(isAdvanced || options.showEntryPoints) && entryPoints.length > 0 && (
|
||||
<div className={classes.entryPoints}>
|
||||
{entryPoints.map((entryPoint) => (
|
||||
<Badge key={entryPoint} variant="light" size="sm" radius="sm">
|
||||
|
||||
Reference in new issue
Block a user