const removeTrailingSlashes = (config: ClusterConfigJSON): ClusterConfigJSON => {
const svcs: any = {};
- Object.keys(config.Services).map((s) => {
+ Object.keys(config.Services).forEach((s) => {
svcs[s] = config.Services[s];
if (svcs[s].hasOwnProperty('ExternalURL')) {
svcs[s].ExternalURL = svcs[s].ExternalURL.replace(/\/+$/, '');
// Using the POST special case to avoid URI length 414 errors.
const formData = new FormData();
formData.append("_method", "GET");
- Object.keys(params).map(key => {
+ Object.keys(params).forEach(key => {
if (params[key] !== undefined) {
formData.append(key, params[key]);
}
.getFilters(),
count: "none"
});
- responseUsers.items.map(it => {
+ responseUsers.items.forEach(it => {
api.dispatch<any>(ownerNameActions.SET_OWNER_NAME({
name: it.uuid === userUuid
? 'User: Me'
uuid: it.uuid
}));
});
- responseGroups.items.map(it => {
+ responseGroups.items.forEach(it => {
api.dispatch<any>(ownerNameActions.SET_OWNER_NAME({ name: `Project: ${it.name}`, uuid: it.uuid }));
});
api.dispatch<any>(setBreadcrumbs([{ label: 'Projects', uuid: userUuid }]));
if (fileExistsInSelectedCollection) {
return path;
} else {
- return;
+ return null;
}
});
const diffPathToRemove = difference(paths, pathsToRemove);
.getFilters()
});
const response = groupItems;
- collectionItems.items.map((it: any) => {
+ collectionItems.items.forEach((it: any) => {
response.itemsAvailable++;
response.items.push(it);
});
- processItems.items.map((it: any) => {
+ processItems.items.forEach((it: any) => {
response.itemsAvailable++;
response.items.push(it);
});
.getFilters()
});
const response = groupItems;
- collectionItems.items.map((it: any) => {
+ collectionItems.items.forEach((it: any) => {
response.itemsAvailable++;
response.items.push(it);
});
- processItems.items.map((it: any) => {
+ processItems.items.forEach((it: any) => {
response.itemsAvailable++;
response.items.push(it);
});
api.dispatch(setItems(initial));
}
- sessions.map(session => {
+ sessions.forEach(session => {
const params = getParams(dataExplorer, searchValue, session.apiRevision);
this.services.groupsService.contents('', params, session)
.then((response) => {
return letter !== '/';
});
- filteredFileUrls
- .map((href: string) => {
- axios.get(href).then(response => response).then(({ data }: any) => {
- const splittedByDot = href.split('.');
- if (splittedByDot[splittedByDot.length - 1] !== 'json') {
- if (filteredFileUrls.length === id) {
- zip.file(download[id - 1], data);
- zip.generateAsync({ type: 'blob' }).then((content) => {
- FileSaver.saveAs(content, `download-${props.currentCollectionUuid}.zip`);
- });
- } else {
- zip.file(download[id - 1], data);
- zip.generateAsync({ type: 'blob' });
- }
+ filteredFileUrls.forEach((href: string) => {
+ axios.get(href).then(response => response).then(({ data }: any) => {
+ const splittedByDot = href.split('.');
+ if (splittedByDot[splittedByDot.length - 1] !== 'json') {
+ if (filteredFileUrls.length === id) {
+ zip.file(download[id - 1], data);
+ zip.generateAsync({ type: 'blob' }).then((content) => {
+ FileSaver.saveAs(content, `download-${props.currentCollectionUuid}.zip`);
+ });
} else {
- zip.file(download[id - 1], JSON.stringify(data));
+ zip.file(download[id - 1], data);
zip.generateAsync({ type: 'blob' });
}
- id++;
- });
+ } else {
+ zip.file(download[id - 1], JSON.stringify(data));
+ zip.generateAsync({ type: 'blob' });
+ }
+ id++;
});
+ });
};
return props.href || props.kind === 'files'
</TableCell>}
</TableRow>;
}
- return;
+ return null;
}
))}
</TableBody>
{Object.keys(remoteHostsConfig)
.map((k) => {
if (k === localCluster) {
- return;
+ return null;
}
if (!remoteHostsConfig[k].workbench2Url) {
console.log(`Cluster ${k} does not define workbench2Url. Federated login / cross-site linking to ${k} is unavailable. Tell the admin of ${k} to set Services->Workbench2->ExternalURL in config.yml.`);
- return;
+ return null;
}
const fedtoken = (remoteHostsConfig[k].loginCluster === localCluster)
? apiToken : getSaltedToken(k, apiToken);