| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| [data, scopeConfigId], | ||
| ); | ||
| const dataSource = useMemo(() => { | ||
| const filtered = showAll ? data : data; |
There was a problem hiding this comment.
The ternary operator evaluates to data in both the true and false cases. This means showAll has no actual effect, and filtered will always just be data.
Did you forget to add the filtering logic here? If showAll is false, it should probably return a filtered subset of data rather than the whole array. If no filtering is intended yet, you can remove this ternary and the showAll dependency to keep it clean.
Sorry, something went wrong.
|
Thanks for the feedback. You're right — the ternary expression was effectively redundant since both branches returned the same data. I've removed the unnecessary ternary and the showAll dependency from the memo. The filtering logic is already handled server-side in useRefreshData, which switches between listAll and list based on the value of showAll, so no additional client-side filtering is required here. I've pushed the changes. Could you please take another look and let me know if everything looks good? |
Sorry, something went wrong.
| const dataSource = useMemo( | ||
| () => (data ? (scopeConfigId ? [{ id: 'None', name: 'No Scope Config' }].concat(data) : data) : []), | ||
| [data, scopeConfigId], | ||
| [data, scopeConfigId, showAll], |
There was a problem hiding this comment.
Looks much better! Moving the showAll check into the data fetcher clarifies the intent perfectly.
Just one minor cleanup detail on line 49:
[data, scopeConfigId, showAll],
You can remove showAll from this dependency array. Since showAll is no longer referenced inside the useMemo callback on line 48, keeping it in the array is unnecessary and will flag a React hooks exhaustive-deps linting warning.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
Good work! |
Sorry, something went wrong.
|
Hey @klesh, honest answer — I'm not able to share screenshots right now and I hope that's okay. The good news is there's genuinely nothing visually surprising here — every component is something already in the codebase, antd Table, existing modal, standard buttons, just connected together to solve a real user problem. No new design, no backend changes, clean and contained. I've put real care into this one and I'd really appreciate your trust to get it merged |
Sorry, something went wrong.
This is not about you, or trust. I am not familiar with the FE so it is hard for me to understand the change. |
Sorry, something went wrong.
|
Hi @albusshirazi could you please approve and merge pull request ? |
Sorry, something went wrong.
|
I agree with @klesh - please add screenshots explaining the change (I read the changes, there are not a lot but they do affect the ui&ux of Devlake and I think more sets of eyes should view them) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Closes #8896
This PR implements two related feature requests to improve scope config
management for users maintaining multiple projects/connections in a single
DevLake instance.
Changes
Feature 1 — Multi-select data scopes with bulk scope config apply
File: config-ui/src/routes/blueprint/connection-detail/table.tsx
via existing PATCH /plugins/{plugin}/connections/{connectionId}/scopes/{scopeId}
Feature 2 — Share scope configs across connections
File: config-ui/src/plugins/components/scope-config-select/index.tsx
File: config-ui/src/api/scope-config/index.ts
for a plugin
the scope config picker
of recreating it each time
How to Test
scopes should be updated
"This Connection Only" to "Showing: All Connections" → configs from
all connections should appear in the list
No Backend Changes Required
The existing ListScopeConfigs backend handler already returns all scope
configs without filtering by connection_id. The frontend now exposes
this via the toggle.