-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
UI Hide Secrets Sync from nav if not on license and/or no policy permissions #27262
Changes from 2 commits
64c2fd0
931a926
ac6b262
b1ad18f
09162c4
e67076e
e69075b
27df01a
7fc2fd7
36fbb78
1f2a88b
462d258
9f1ab09
e4e1080
3ec1646
628ea6b
dccc476
22ce68a
6fd9b21
51bf477
e6b9811
8f0fed0
0e598d8
e8bf2c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:improvement | ||
ui/secrets-sync: Hide Secrets Sync from the sidebar nav if user does not have access to the feature. | ||
``` |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The list here came from me scanning through the sync API. We should test lots of policies to make sure I've gotten all the options. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,9 @@ const API_PATHS = { | |
settings: { | ||
customMessages: 'sys/config/ui/custom-messages', | ||
}, | ||
sync: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm still learning out this service works...but do you know why just having sync: 'sys/sync/', which ends in a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nope! 🙃 This is what I pinged Chelsea about in the dev channel. The logic of comparison is backwards from what you'd think they be comparing. I'll ping you on that thread which has links, etc. But it's also something that I can more easily clarify in standup. |
||
sync: 'sys/sync', | ||
}, | ||
}; | ||
|
||
const API_PATHS_TO_ROUTE_PARAMS = { | ||
|
Monkeychip marked this conversation as resolved.
Show resolved
Hide resolved
|
Monkeychip marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,13 +13,8 @@ export default class SyncSecretsRoute extends Route { | |
@service declare readonly router: RouterService; | ||
@service declare readonly flags: FlagService; | ||
|
||
beforeModel() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commented in slack about refresh ramifications removing this fetch to only happen in the cluster.js route |
||
return this.flags.fetchActivatedFlags(); | ||
} | ||
|
||
model() { | ||
return { | ||
// TODO will modify when we use the persona service. | ||
activatedFeatures: this.flags.activatedFlags, | ||
}; | ||
} | ||
|
Monkeychip marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
Could you explain your reasoning for putting this getter here? Since it's compiling logic from flags, permissions and versions services for just secret sync, it feels a little arbitrary living in the flag service, which I understood to be just for returning info about cluster flags.
Though looking at the other getter here
canActivateSecretsSync
it seems like this flags service is also sort of a secrets sync permissions service 😅I realize we're limited on time for this PR, but want to suggest that a future improvement is maybe separating or clarifying concerns here. Perhaps that means having another service (auth service?) responsible for managing user state related logic
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.
Noelle and I chatted about this. Because we're using it in more than one places, and the concept is to keep access to this route consistent in both clients and sidebar nav we opted to leave it in the service.
But yes agree, flags (similar to what has happened to version service) is growing past it's original scope.