Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1e9f509
feat: add structured roles paginated result
ogzhanolguncu Jun 2, 2025
e784aef
feat: roles cleanup
ogzhanolguncu Jun 2, 2025
39beb8a
feat: add initial table
ogzhanolguncu Jun 2, 2025
2bcf464
feat: iterate on roles table
ogzhanolguncu Jun 2, 2025
a51786d
feat: add filters
ogzhanolguncu Jun 3, 2025
fdb3644
feat: add proper filter schema
ogzhanolguncu Jun 3, 2025
bc1380d
fix: colors
ogzhanolguncu Jun 3, 2025
8675df8
fix: skeletons
ogzhanolguncu Jun 3, 2025
576e27f
feta: add upsert
ogzhanolguncu Jun 3, 2025
423b38f
feat: add initial form elements
ogzhanolguncu Jun 3, 2025
54f9f1a
feat: add searcahable combobox for keys
ogzhanolguncu Jun 3, 2025
88d98ae
feat: add permissions field
ogzhanolguncu Jun 4, 2025
363d969
Merge branch 'main' of github.com:unkeyed/unkey into rbac-roles
ogzhanolguncu Jun 4, 2025
452fe90
chore: get rid of human_readable
ogzhanolguncu Jun 4, 2025
a74cc38
chore: rename
ogzhanolguncu Jun 4, 2025
8c6497c
feat: add submit
ogzhanolguncu Jun 4, 2025
d355bf2
chore: fix scoping of trpc
ogzhanolguncu Jun 4, 2025
34c0e8b
feat: add initial edit role
ogzhanolguncu Jun 4, 2025
56c442e
feat: finalize form
ogzhanolguncu Jun 4, 2025
7e6bc58
feat: add debounce to searches
ogzhanolguncu Jun 4, 2025
5d4af2e
feat: add delete role
ogzhanolguncu Jun 4, 2025
2137d9f
feat: add role deletion
ogzhanolguncu Jun 4, 2025
43b82c9
feat: add llm search
ogzhanolguncu Jun 4, 2025
3c017fc
refactor: schemas for key search
ogzhanolguncu Jun 4, 2025
4ff76ef
refactor: inconssitencies
ogzhanolguncu Jun 4, 2025
a4f4ed8
refactor: move table items into components
ogzhanolguncu Jun 4, 2025
f1a9c55
fix: coderabbit issues
ogzhanolguncu Jun 4, 2025
9081f1e
fix: linter and type issue
ogzhanolguncu Jun 5, 2025
fce081d
Merge branch 'main' of github.com:unkeyed/unkey into rbac-roles
ogzhanolguncu Jun 5, 2025
eb578e8
fix: keyboard hijack
ogzhanolguncu Jun 5, 2025
26e83b5
fix: null assertion
ogzhanolguncu Jun 5, 2025
c532f1e
fix: pr comments
ogzhanolguncu Jun 10, 2025
cf4621c
Merge branch 'main' of github.com:unkeyed/unkey into rbac-roles
ogzhanolguncu Jun 10, 2025
8486482
fix: import
ogzhanolguncu Jun 10, 2025
45bd728
fix: navigation href
ogzhanolguncu Jun 10, 2025
d7e0f03
Merge branch 'main' into rbac-roles
ogzhanolguncu Jun 11, 2025
149b077
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type MenuItem = {
disabled?: boolean;
divider?: boolean;
ActionComponent?: FC<ActionComponentProps>;
prefetch?: () => Promise<void>;
};

type BaseTableActionPopoverProps = PropsWithChildren<{
Expand All @@ -32,22 +33,46 @@ export const KeysTableActionPopover = ({
const [enabledItem, setEnabledItem] = useState<string>();
const [open, setOpen] = useState(false);
const [focusIndex, setFocusIndex] = useState(0);
const [prefetchedItems, setPrefetchedItems] = useState<Set<string>>(new Set());
const menuItems = useRef<HTMLDivElement[]>([]);

useEffect(() => {
if (open) {
// Prefetch all items that need prefetching and haven't been prefetched yet
items
.filter((item) => item.prefetch && !prefetchedItems.has(item.id))
.forEach(async (item) => {
try {
await item.prefetch?.();
setPrefetchedItems((prev) => new Set(prev).add(item.id));
} catch (error) {
console.error(`Failed to prefetch data for ${item.id}:`, error);
}
});

const firstEnabledIndex = items.findIndex((item) => !item.disabled);
setFocusIndex(firstEnabledIndex >= 0 ? firstEnabledIndex : 0);
if (firstEnabledIndex >= 0) {
menuItems.current[firstEnabledIndex]?.focus();
}
}
}, [open, items]);
}, [open, items, prefetchedItems]);

const handleActionSelection = (value: string) => {
setEnabledItem(value);
};

const handleItemHover = async (item: MenuItem) => {
if (item.prefetch && !prefetchedItems.has(item.id)) {
try {
await item.prefetch();
setPrefetchedItems((prev) => new Set([...prev, item.id]));
} catch (error) {
console.error(`Failed to prefetch data for ${item.id}:`, error);
}
}
};

return (
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger onClick={(e) => e.stopPropagation()}>
Expand Down Expand Up @@ -107,6 +132,7 @@ export const KeysTableActionPopover = ({
item.disabled && "cursor-not-allowed opacity-50",
item.className,
)}
onMouseEnter={() => handleItemHover(item)}
onClick={(e) => {
if (!item.disabled) {
item.onClick?.(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ const AnimatedDigit = ({ digit, index }: { digit: string; index: number }) => {
);
};

const AnimatedCounter = ({ value }: { value: number }) => {
export const AnimatedCounter = ({ value }: { value: number }) => {
const digits = value.toString().split("");

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ export const KeysList = ({
);
},
},

{
key: "action",
header: "",
Expand Down
23 changes: 0 additions & 23 deletions apps/dashboard/app/(app)/authorization/layout.tsx

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading