-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add more group permissions #1453
base: dev
Are you sure you want to change the base?
Conversation
Here's the code health analysis summary for commits Analysis Summary
|
9d85642
to
a960002
Compare
@@ -95,27 +98,32 @@ export default async function ManageLayout({ children }: PropsWithChildren) { | |||
{ | |||
label: t("items.tools.label"), | |||
icon: IconTool, | |||
hidden: !session?.user.permissions.includes("admin"), | |||
// As permissions always include there children permissions, we can check for the lowest permission |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand what you mean but "low" is in my opinion a poor word choice to describe it (eg. what is high?)
}; | ||
|
||
export const catchTrpcUnauthorized = (err: unknown) => { | ||
if (err instanceof TRPCError && err.code === "UNAUTHORIZED") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we log this? I'd say say as "info"
if (item.kind === "app") { | ||
const parsedOptions = SuperJSON.parse<WidgetComponentProps<"app">["options"]>(item.options); | ||
return [parsedOptions.appId]; | ||
} else if (item.kind === "bookmarks") { | ||
const parsedOptions = SuperJSON.parse<WidgetComponentProps<"bookmarks">["options"]>(item.options); | ||
return parsedOptions.items; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dislike non-generic special cases.
For the app it's fine but is there maybe a better option / more generic way for the bookmark? (eg. by checking type of options?)
return parsedOptions.items; | ||
} | ||
|
||
throw new Error("Invalid item kind"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not descriptive enough. It says what is wrong but not what happened.
Suggestion: Failed to get app ids from board. Invalid item kind: 'test'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Homarr
Thank you for your contribution. Please ensure that your pull request meets the following pull request:
pnpm buid
, autofix withpnpm format:fix
)dev
branchx
,y
,i
or any abbrevation)Closes #1240