-
Notifications
You must be signed in to change notification settings - Fork 217
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
Feature/roles #1709
Feature/roles #1709
Conversation
# Conflicts: # hermes-console-vue/src/api/hermes-client/index.ts # hermes-console-vue/src/mocks/handlers.ts
@@ -74,7 +77,7 @@ | |||
</v-col> | |||
</v-row> | |||
|
|||
<v-row justify="center"> | |||
<v-row justify="center" v-if="roles?.roles.value?.includes(Roles.ADMIN)"> |
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 think that top roles
is not nullable?
<v-row justify="center" v-if="roles?.roles.value?.includes(Roles.ADMIN)"> | |
<v-row justify="center" v-if="roles.roles.value?.includes(Roles.ADMIN)"> |
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.
also wondering whether fetching roles error should not result in banner with sth like:
could not fetch roles, some options may not be visible
right now we are silently ignoring roles errors which may be confusing for users (admins, topics owners and subscription owners)
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.
Actually I changed it, I am using function isAdmin
from utils. I added TODO to send notification when fetching roles fails.
@@ -95,7 +97,9 @@ | |||
:subscription-metrics="subscriptionMetrics" | |||
/> | |||
<service-response-metrics /> | |||
<manage-messages-card /> | |||
<manage-messages-card | |||
v-if="isSubscriptionOwnerOrAdmin(roles?.roles.value)" |
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.
- is
?
needed in allisSubscriptionOwnerOrAdmin(roles?.roles.value)
?
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.
It is, otherwise some tests for this views are failing because some components cannot be rendered because of type error
hermes-console-vue/src/api/roles.ts
Outdated
@@ -0,0 +1,6 @@ | |||
export const enum Roles { |
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.
Role*
@@ -10,6 +12,7 @@ | |||
|
|||
const theme = useTheme(); | |||
const configStore = useAppConfigStore(); | |||
const roles = useRoles(null, null); |
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.
U can extract roles value
@GET | ||
@Path("/console") | ||
@Produces("application/javascript") | ||
@ApiOperation(value = "Hermes console configuration", httpMethod = HttpMethod.GET) |
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.
As this is open source project i would leave this and annotate it with @deprecated for some time I think
No description provided.