Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • sibmip/gateway
1 result
Show changes
Commits on Source (4)
# [1.1.0-beta.4](https://gitlab.com/sibmip/gateway/compare/1.1.0-beta.3...1.1.0-beta.4) (2022-02-07)
### Bug Fixes
* Group id fix for csv connector ([01ccfbc](https://gitlab.com/sibmip/gateway/commit/01ccfbcc56f5e402d938bcb19f4db6c5c6e89e8b))
* Issue throwing connector's errors ([ebb7cf6](https://gitlab.com/sibmip/gateway/commit/ebb7cf6732882598e2cfa56b73bc2e358b662d7a))
# [1.1.0-beta.3](https://gitlab.com/sibmip/gateway/compare/1.1.0-beta.2...1.1.0-beta.3) (2022-02-01)
......
{
"name": "gateway",
"version": "1.1.0-beta.3",
"version": "1.1.0-beta.4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "gateway",
"version": "1.1.0-beta.3",
"version": "1.1.0-beta.4",
"license": "UNLICENSED",
"dependencies": {
"@nestjs/axios": "^0.0.1",
......
{
"name": "gateway",
"version": "1.1.0-beta.3",
"version": "1.1.0-beta.4",
"description": "",
"author": "",
"private": true,
......
......@@ -31,14 +31,29 @@ export default class CSVService implements IEngineService {
data: ExperimentCreateInput,
isTransient: boolean,
): Experiment | Promise<Experiment> {
throw new Error('Method not implemented.');
return {
id: '',
domain: '',
datasets: [],
algorithm: {
id: '',
description: '',
},
name: 'test',
variables: [],
};
}
listExperiments(
page: number,
name: string,
): ListExperiments | Promise<ListExperiments> {
throw new Error('Method not implemented.');
return {
experiments: [],
currentPage: 0,
totalExperiments: 0,
totalPages: 0,
};
}
getExperiment(id: string): Experiment | Promise<Experiment> {
......@@ -83,35 +98,40 @@ export default class CSVService implements IEngineService {
row.shift(); // get ride of the variable name, keep only groups
vars.push(variable);
if (!vars.find((v) => v.id === variable.id)) vars.push(variable); // avoid duplicate
row
.filter((group) => !groups[group.toLowerCase()])
.forEach((group, i) => {
const groupId = group.toLowerCase();
if (i === 0) rootGroup.groups.push(groupId);
groups[groupId] = {
id: groupId,
label: group,
variables: [],
groups: [],
};
});
let pathId = '';
row.forEach((group, i) => {
const groupId = `${pathId}/${group.toLowerCase()}`;
pathId = groupId;
if (groups[groupId]) return;
if (i === 0) {
rootGroup.groups.push(groupId);
}
groups[groupId] = {
id: groupId,
label: group,
variables: [],
groups: [],
};
});
const groupId = row[row.length - 1].toLowerCase(); // group's variable container
const groupId = pathId; // group's variable container
groups[groupId].variables.push(variable.id); // add variable
row
row // fill groups with childrens
.reverse()
.map((group) => group.toLowerCase())
.forEach((group, i) => {
const groupId = group.toLowerCase();
const id = pathId;
pathId = pathId.replace(`/${group}`, '');
if (i !== row.length - 1) {
const parentId = row[i + 1].toLowerCase();
if (groups[parentId].groups.indexOf(groupId) === -1)
groups[parentId].groups.push(groupId);
const parentId = pathId;
if (groups[parentId].groups.indexOf(id) === -1)
groups[parentId].groups.push(id);
}
});
});
......
......@@ -56,7 +56,7 @@ export class HeadersInterceptor implements NestInterceptor {
return next.handle().pipe(
catchError((e) => {
if (!e.response.data || !e.response.status) return e;
if (!e.response || !e.response.data || !e.response.status) throw e;
this.logger.log(e.message);
this.logger.verbose(
......