MCPcopy Create free account
hub / github.com/apache/devlake / handleAssociateScopeConfig

Function handleAssociateScopeConfig

config-ui/src/routes/connection/connection.tsx:252–278  ·  view source on GitHub ↗
(trId: ID)

Source from the content-addressed store, hash-verified

250 };
251
252 const handleAssociateScopeConfig = async (trId: ID) => {
253 const [success] = await operator(
254 () =>
255 Promise.all(
256 scopeIds.map(async (scopeId) => {
257 const scope = await API.scope.get(plugin, connectionId, scopeId);
258 return API.scope.update(plugin, connectionId, scopeId, {
259 ...scope,
260 scopeConfigId: trId !== 'None' ? +trId : null,
261 });
262 }),
263 ),
264 {
265 setOperating,
266 formatMessage: () =>
267 trId !== 'None' ? 'Associate scope config successful.' : 'Dis-associate scope config successful.',
268 },
269 );
270
271 if (success) {
272 handleHideDialog();
273 setVersion(version + 1);
274 message.success(
275 'Scope Config(s) have been updated. If you would like to re-transform or re-collect the data in the related project(s), please go to the Project page and do so.',
276 );
277 }
278 };
279
280 return (
281 <PageHeader

Callers

nothing calls this directly

Calls 3

operatorFunction · 0.90
getMethod · 0.80
handleHideDialogFunction · 0.70

Tested by

no test coverage detected