Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): match the API key table breakpoint to its card layout

Yudhi Armyndharisef0bedda2f34
diff --git a/dashboard/src/pages/ApiKeys.test.ts b/dashboard/src/pages/ApiKeys.test.ts
index f336b7eb5..2aec65ef4 100644
--- a/dashboard/src/pages/ApiKeys.test.ts
+++ b/dashboard/src/pages/ApiKeys.test.ts
@@ -108,6 +108,19 @@ test('a key row shows its prefix masked and offers no show/hide toggle', async (
);
});
+// ApiKeys.css turns rows into cards at max-width: 768px, which has no slot for the Last Used cell.
+test('at 768px the table drops the columns the card layout has no place for', async () => {
+ const width = window.innerWidth;
+ window.innerWidth = 768;
+ try {
+ renderApiKeys();
+ await rtl.screen.findByText('owa_k1ab****');
+ assert.equal(rtl.screen.queryByText('Last Used') === null, true, 'the Last Used column is still shown');
+ } finally {
+ window.innerWidth = width;
+ }
+});
+
// An admin key restricted to sessions is refused here (the route needs an unscoped key), and a
// failed read is not an empty list: "No API keys created" would read as a gateway with no keys.
test('a refused read says so instead of showing the empty state', async () => {
diff --git a/dashboard/src/pages/ApiKeys.tsx b/dashboard/src/pages/ApiKeys.tsx
index 08769b1f2..6938c242c 100644
--- a/dashboard/src/pages/ApiKeys.tsx
+++ b/dashboard/src/pages/ApiKeys.tsx
@@ -229,7 +229,7 @@ export function ApiKeys() {
);
const windowWidth = useWindowSize();
- const isMobile = windowWidth < 768;
+ const isMobile = windowWidth <= 768;
const isSmall = windowWidth < 640;
const [columnVisibility, setColumnVisibility] = useState<ColumnVisibilityState>({});