Skip to content
Snippets Groups Projects
Commit ee2d14d3 authored by stevereis's avatar stevereis
Browse files

Simplify group data needed from engines

parent 66081a79
No related branches found
No related tags found
No related merge requests found
......@@ -14,38 +14,66 @@ export default class DataShieldService implements IEngineService {
getAlgorithms(): Algorithm[] | Promise<Algorithm[]> {
throw new Error('Method not implemented.');
}
createExperiment(
data: ExperimentCreateInput,
isTransient: boolean,
): Experiment | Promise<Experiment> {
throw new Error('Method not implemented.');
}
listExperiments(
page: number,
name: string,
): ListExperiments | Promise<ListExperiments> {
throw new Error('Method not implemented.');
}
getExperiment(uuid: string): Experiment | Promise<Experiment> {
throw new Error('Method not implemented.');
}
removeExperiment(
uuid: string,
): PartialExperiment | Promise<PartialExperiment> {
throw new Error('Method not implemented.');
}
editExperient(
uuid: string,
expriment: ExperimentEditInput,
): Experiment | Promise<Experiment> {
throw new Error('Method not implemented.');
}
getDomains(): Domain[] {
throw new Error('Method not implemented.');
return [
{
id: 'Dummy',
label: 'Dummy',
datasets: [{ id: 'DummyDataSet' }],
groups: [
{
id: 'DummyGroup',
variables: ['DummyVar'],
groups: [],
},
],
rootGroup: { id: 'DummyGroup', variables: [], groups: [] },
variables: [{ id: 'DummyVar', type: 'string' }],
},
];
}
getActiveUser(): Observable<string> {
throw new Error('Method not implemented.');
getActiveUser(): string {
const dummyUser = {
username: 'anonymous',
subjectId: 'anonymousId',
fullname: 'anonymous',
email: 'anonymous@anonymous.com',
agreeNDA: true,
};
return JSON.stringify(dummyUser);
}
editActiveUser(): Observable<string> {
......@@ -72,11 +100,11 @@ export default class DataShieldService implements IEngineService {
throw new Error('Method not implemented.');
}
getExperiments(): Observable<string> {
throw new Error('Method not implemented.');
getExperiments(): string {
return '[]';
}
getAlgorithmsREST(): Observable<string> {
throw new Error('Method not implemented.');
getAlgorithmsREST(): string {
return '[]';
}
}
......@@ -28,7 +28,9 @@ export const dataToGroup = (data: Hierarchy): Group => {
id: data.code,
label: data.label,
groups: data.groups ? data.groups.map(dataToGroup) : [],
variables: data.variables ? data.variables.map(dataToVariable) : [],
variables: data.variables
? data.variables.map((data: VariableEntity) => data.code)
: [],
};
};
......
import { Field, ObjectType } from '@nestjs/graphql';
import { Category } from './category.model';
import { Entity } from './entity.model';
import { Group } from './group.model';
import { Variable } from './variable.model';
@ObjectType()
export class Domain extends Group {
export class Domain extends Entity {
@Field({ nullable: true })
description?: string;
@Field(() => [Group])
groups: Group[];
@Field(() => [Variable])
variables: Variable[];
@Field(() => [Category])
datasets: Category[];
......
import { Field, ObjectType } from '@nestjs/graphql';
import { Entity } from './entity.model';
import { Variable } from './variable.model';
@ObjectType()
export class Group extends Entity {
......@@ -10,6 +9,6 @@ export class Group extends Entity {
@Field(() => [Group])
groups: Group[];
@Field(() => [Variable])
variables: Variable[];
@Field(() => [String], { description: "List of variable's ids" })
variables: string[];
}
......@@ -11,9 +11,9 @@ export class Variable extends Entity {
@Field({ nullable: true })
description?: string;
@Field(() => [Category])
enumerations: Category[];
@Field(() => [Category], { nullable: true, defaultValue: [] })
enumerations?: Category[];
@Field(() => [Group])
groups: Group[];
@Field(() => [Group], { nullable: true, defaultValue: [] })
groups?: Group[];
}
......@@ -7,21 +7,23 @@ type Category {
label: String
}
type Variable {
type Group {
id: String!
label: String
type: String!
description: String
enumerations: [Category!]!
groups: [Group!]!
"""List of variable's ids"""
variables: [String!]!
}
type Group {
type Variable {
id: String!
label: String
type: String!
description: String
groups: [Group!]!
variables: [Variable!]!
enumerations: [Category!]
groups: [Group!]
}
type Domain {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment