diff --git a/src/app/metamodel/action/attribute.action.ts b/src/app/metamodel/action/attribute.action.ts index d3896eab13fe0db3bacdad5aacd5b2de50cbf8c2..c275449909449003c99466002128c1e3dfe4bdd2 100644 --- a/src/app/metamodel/action/attribute.action.ts +++ b/src/app/metamodel/action/attribute.action.ts @@ -11,6 +11,7 @@ import { Action } from '@ngrx/store'; import { Attribute, AttributesByDataset } from '../model'; + export const LOAD_ATTRIBUTE_LIST = '[Attribute] Load Attribute List'; export const LOAD_ATTRIBUTE_LIST_SUCCESS = '[Attribute] Load Attribute List Success'; export const LOAD_ATTRIBUTE_LIST_FAIL = '[Attribute] Load Attribute List Fail'; @@ -18,36 +19,66 @@ export const LOAD_MULTIPLE_ATTRIBUTE_LISTS = '[Attribute] Load Multiple Attribut export const LOAD_MULTIPLE_ATTRIBUTE_LISTS_SUCCESS = '[Attribute] Load Multiple Attribute Lists Success'; export const LOAD_MULTIPLE_ATTRIBUTE_LISTS_FAIL = '[Attribute] Load Multiple Attribute Lists Fail'; +/** + * @class + * @classdesc LoadAttributeListAction action. + * @readonly + */ export class LoadAttributeListAction implements Action { readonly type = LOAD_ATTRIBUTE_LIST; constructor(public payload: string) { } } +/** + * @class + * @classdesc LoadAttributeListSuccessAction action. + * @readonly + */ export class LoadAttributeListSuccessAction implements Action { readonly type = LOAD_ATTRIBUTE_LIST_SUCCESS; constructor(public payload: { datasetName: string, attributeList: Attribute[] }) { } } +/** + * @class + * @classdesc LoadAttributeListFailAction action. + * @readonly + */ export class LoadAttributeListFailAction implements Action { readonly type = LOAD_ATTRIBUTE_LIST_FAIL; constructor(public payload: string) { } } +/** + * @class + * @classdesc LoadMultipleAttributeListsAction action. + * @readonly + */ export class LoadMultipleAttributeListsAction implements Action { readonly type = LOAD_MULTIPLE_ATTRIBUTE_LISTS; constructor(public payload: string[]) { } } +/** + * @class + * @classdesc LoadMultipleAttributeListsSuccessAction action. + * @readonly + */ export class LoadMultipleAttributeListsSuccessAction implements Action { readonly type = LOAD_MULTIPLE_ATTRIBUTE_LISTS_SUCCESS; constructor(public payload: AttributesByDataset[]) { } } +/** + * @class + * @classdesc LoadMultipleAttributeListsFailAction action. + * @readonly + */ export class LoadMultipleAttributeListsFailAction implements Action { readonly type = LOAD_MULTIPLE_ATTRIBUTE_LISTS_FAIL; diff --git a/src/app/metamodel/action/criteria.action.ts b/src/app/metamodel/action/criteria.action.ts index 828e337d20ec4fc7ec66d39b2e9be837b1443cd4..a11c5c24c63c603dd9ced311b27e34ec0c6dd619 100644 --- a/src/app/metamodel/action/criteria.action.ts +++ b/src/app/metamodel/action/criteria.action.ts @@ -11,29 +11,50 @@ import { Action } from '@ngrx/store'; import { Family } from '../model'; + export const LOAD_CRITERIA_SEARCH_META = '[Criteria] Load Criteria Search Meta'; export const LOAD_CRITERIA_SEARCH_META_WIP = '[Criteria] Load Criteria Search Meta WIP'; export const LOAD_CRITERIA_SEARCH_META_SUCCESS = '[Criteria] Load Criteria Search Meta Success'; export const LOAD_CRITERIA_SEARCH_META_FAIL = '[Criteria] Load Criteria Search Meta Fail'; +/** + * @class + * @classdesc LoadCriteriaSearchMetaAction action. + * @readonly + */ export class LoadCriteriaSearchMetaAction implements Action { readonly type = LOAD_CRITERIA_SEARCH_META; constructor(public payload: string) { } } +/** + * @class + * @classdesc LoadCriteriaSearchMetaWipAction action. + * @readonly + */ export class LoadCriteriaSearchMetaWipAction implements Action { readonly type = LOAD_CRITERIA_SEARCH_META_WIP; constructor(public payload: string) { } } +/** + * @class + * @classdesc LoadCriteriaSearchMetaSuccessAction action. + * @readonly + */ export class LoadCriteriaSearchMetaSuccessAction implements Action { readonly type = LOAD_CRITERIA_SEARCH_META_SUCCESS; constructor(public payload: Family[]) { } } +/** + * @class + * @classdesc LoadCriteriaSearchMetaFailAction action. + * @readonly + */ export class LoadCriteriaSearchMetaFailAction implements Action { readonly type = LOAD_CRITERIA_SEARCH_META_FAIL; diff --git a/src/app/metamodel/action/dataset.action.ts b/src/app/metamodel/action/dataset.action.ts index 9098f4b258c56b7142a64fdff9545618c09310b9..52df955c3685a06c4d7dbd54856ef8bc1eda5e6d 100644 --- a/src/app/metamodel/action/dataset.action.ts +++ b/src/app/metamodel/action/dataset.action.ts @@ -16,24 +16,44 @@ export const LOAD_DATASET_SEARCH_META_WIP = '[Dataset] Load Dataset Search Meta export const LOAD_DATASET_SEARCH_META_SUCCESS = '[Dataset] Load Dataset Search Meta Success'; export const LOAD_DATASET_SEARCH_META_FAIL = '[Dataset] Load Dataset Search Meta Fail'; +/** + * @class + * @classdesc LoadDatasetSearchMetaAction action. + * @readonly + */ export class LoadDatasetSearchMetaAction implements Action { readonly type = LOAD_DATASET_SEARCH_META; constructor(public payload: {} = null) { } } +/** + * @class + * @classdesc LoadDatasetSearchMetaWipAction action. + * @readonly + */ export class LoadDatasetSearchMetaWipAction implements Action { readonly type = LOAD_DATASET_SEARCH_META_WIP; constructor(public payload: {} = null) { } } +/** + * @class + * @classdesc LoadDatasetSearchMetaSuccessAction action. + * @readonly + */ export class LoadDatasetSearchMetaSuccessAction implements Action { readonly type = LOAD_DATASET_SEARCH_META_SUCCESS; constructor(public payload: [Project[], Dataset[], Family[]]) { } } +/** + * @class + * @classdesc LoadDatasetSearchMetaFailAction action. + * @readonly + */ export class LoadDatasetSearchMetaFailAction implements Action { readonly type = LOAD_DATASET_SEARCH_META_FAIL; diff --git a/src/app/metamodel/action/instance.action.ts b/src/app/metamodel/action/instance.action.ts index cc6b6aa341331195d76f419f24a813b3083d620b..454b340131519814dcd7459b20df2e6493366a50 100644 --- a/src/app/metamodel/action/instance.action.ts +++ b/src/app/metamodel/action/instance.action.ts @@ -11,22 +11,38 @@ import { Action } from '@ngrx/store'; import { Instance } from '../model'; + export const LOAD_INSTANCE_META = '[Instance] Load Instance Meta'; export const LOAD_INSTANCE_META_SUCCESS = '[Instance] Load Instance Meta Success'; export const LOAD_INSTANCE_META_FAIL = '[Instance] Load Instance Meta Fail'; +/** + * @class + * @classdesc LoadInstanceMetaAction action. + * @readonly + */ export class LoadInstanceMetaAction implements Action { readonly type = LOAD_INSTANCE_META; constructor(public payload: {} = null) { } } +/** + * @class + * @classdesc LoadInstanceMetaSuccessAction action. + * @readonly + */ export class LoadInstanceMetaSuccessAction implements Action { readonly type = LOAD_INSTANCE_META_SUCCESS; constructor(public payload: Instance) { } } +/** + * @class + * @classdesc LoadInstanceMetaFailAction action. + * @readonly + */ export class LoadInstanceMetaFailAction implements Action { readonly type = LOAD_INSTANCE_META_FAIL; diff --git a/src/app/metamodel/action/output.action.ts b/src/app/metamodel/action/output.action.ts index fd570a4bcf1b8eb2ffc987ce604296b880200ca3..863ea9ac68a2172a250b96273662c8beb5c335b3 100644 --- a/src/app/metamodel/action/output.action.ts +++ b/src/app/metamodel/action/output.action.ts @@ -11,29 +11,50 @@ import { Action } from '@ngrx/store'; import { Family, Category } from '../model'; + export const LOAD_OUTPUT_SEARCH_META = '[Output] Load Output Search Meta'; export const LOAD_OUTPUT_SEARCH_META_WIP = '[Output] Load Output Search Meta WIP'; export const LOAD_OUTPUT_SEARCH_META_SUCCESS = '[Output] Load Output Search Meta Success'; export const LOAD_OUTPUT_SEARCH_META_FAIL = '[Output] Load Output Search Meta Fail'; +/** + * @class + * @classdesc LoadOutputSearchMetaAction action. + * @readonly + */ export class LoadOutputSearchMetaAction implements Action { readonly type = LOAD_OUTPUT_SEARCH_META; constructor(public payload: string) { } } +/** + * @class + * @classdesc LoadOutputSearchMetaWipAction action. + * @readonly + */ export class LoadOutputSearchMetaWipAction implements Action { readonly type = LOAD_OUTPUT_SEARCH_META_WIP; constructor(public payload: string) { } } +/** + * @class + * @classdesc LoadOutputSearchMetaSuccessAction action. + * @readonly + */ export class LoadOutputSearchMetaSuccessAction implements Action { readonly type = LOAD_OUTPUT_SEARCH_META_SUCCESS; constructor(public payload: [Family[], Category[]]) { } } +/** + * @class + * @classdesc LoadOutputSearchMetaFailAction action. + * @readonly + */ export class LoadOutputSearchMetaFailAction implements Action { readonly type = LOAD_OUTPUT_SEARCH_META_FAIL; diff --git a/src/app/metamodel/effects/attribute.effects.ts b/src/app/metamodel/effects/attribute.effects.ts index 99877f4575c47d821cf7be271be57a59d1bf69bf..9bdad898bb280feae7de08bcba50b572305b5863 100644 --- a/src/app/metamodel/effects/attribute.effects.ts +++ b/src/app/metamodel/effects/attribute.effects.ts @@ -19,6 +19,10 @@ import { AttributeService } from '../services/attribute.service'; import { Attribute, AttributesByDataset } from '../model'; @Injectable() +/** + * @class + * @classdesc Attribute effects. + */ export class AttributeEffects { constructor( private actions$: Actions, @@ -26,6 +30,9 @@ export class AttributeEffects { private toastr: ToastrService ) { } + /** + * Retrieves attribute list for a given dataset name. + */ @Effect() loadAttributeListAction$ = this.actions$.pipe( ofType(attributeActions.LOAD_ATTRIBUTE_LIST), @@ -40,12 +47,18 @@ export class AttributeEffects { ) ); + /** + * Displays retrieve attribute list error notification. + */ @Effect({ dispatch: false }) loadAttributeListFailAction$ = this.actions$.pipe( ofType(attributeActions.LOAD_ATTRIBUTE_LIST_FAIL), tap(_ => this.toastr.error('Loading Failed!', 'Attribute list loading failed')) ); + /** + * Retrieves attribute lists for a given datasets name. + */ @Effect() loadMultipleAttributeListsAction$ = this.actions$.pipe( ofType(attributeActions.LOAD_MULTIPLE_ATTRIBUTE_LISTS), @@ -74,6 +87,9 @@ export class AttributeEffects { }) ); + /** + * Displays retrieve attribute lists error notification. + */ @Effect({ dispatch: false }) loadAttributeListsFailedAction$ = this.actions$.pipe( ofType(attributeActions.LOAD_MULTIPLE_ATTRIBUTE_LISTS_FAIL), diff --git a/src/app/metamodel/effects/criteria.effects.ts b/src/app/metamodel/effects/criteria.effects.ts index c23f2dad8109748becd3b7dbd58f1cde44bc6494..aa1bbfdcebf908444db7973e2a6e7250857c8fa3 100644 --- a/src/app/metamodel/effects/criteria.effects.ts +++ b/src/app/metamodel/effects/criteria.effects.ts @@ -19,6 +19,10 @@ import * as criteriaActions from '../action/criteria.action'; import { CriteriaService } from '../services/criteria.service'; @Injectable() +/** + * @class + * @classdesc Criteria effects. + */ export class CriteriaEffects { constructor( private actions$: Actions, @@ -26,6 +30,9 @@ export class CriteriaEffects { private toastr: ToastrService ) { } + /** + * Calls action to retrieve criteria metadata. + */ @Effect() loadCriteriaSearchMetaAction$ = this.actions$.pipe( ofType(criteriaActions.LOAD_CRITERIA_SEARCH_META), @@ -34,6 +41,9 @@ export class CriteriaEffects { }) ); + /** + * Retrieves criteria metadata. + */ @Effect() loadCriteriaSearchMetaWipAction$ = this.actions$.pipe( ofType(criteriaActions.LOAD_CRITERIA_SEARCH_META_WIP), @@ -46,6 +56,9 @@ export class CriteriaEffects { }) ); + /** + * Displays retrieve criteria metadata error notification. + */ @Effect({ dispatch: false }) loadCriteriaSearchMetaFailedAction$ = this.actions$.pipe( ofType(criteriaActions.LOAD_CRITERIA_SEARCH_META_FAIL), diff --git a/src/app/metamodel/effects/dataset.effects.ts b/src/app/metamodel/effects/dataset.effects.ts index 0217a81456b6c41bc056992d84a87f443951ab01..f0da8b7c63311473368c72a9c6207f694b39f8e4 100644 --- a/src/app/metamodel/effects/dataset.effects.ts +++ b/src/app/metamodel/effects/dataset.effects.ts @@ -21,6 +21,10 @@ import * as fromMetamodel from '../reducers'; import { DatasetService } from '../services/dataset.service'; @Injectable() +/** + * @class + * @classdesc Dataset effects. + */ export class DatasetEffects { constructor( private actions$: Actions, @@ -29,6 +33,9 @@ export class DatasetEffects { private store$: Store<{ metamodel: fromMetamodel.State }> ) { } + /** + * Calls action to retrieve datasets metadata. + */ @Effect() loadDatasetSearchMetaAction$ = this.actions$.pipe( ofType(datasetActions.LOAD_DATASET_SEARCH_META), @@ -42,6 +49,9 @@ export class DatasetEffects { }) ); + /** + * Retrieves datasets metadata. + */ @Effect() loadDatasetSearchMetaWipAction$ = this.actions$.pipe( ofType(datasetActions.LOAD_DATASET_SEARCH_META_WIP), @@ -54,6 +64,9 @@ export class DatasetEffects { ) ); + /** + * Displays retrieve datasets metadata error notification. + */ @Effect({ dispatch: false }) loadDatasetSearchMetaFailedAction$ = this.actions$.pipe( ofType(datasetActions.LOAD_DATASET_SEARCH_META_FAIL), diff --git a/src/app/metamodel/effects/instance.effects.ts b/src/app/metamodel/effects/instance.effects.ts index 4b7050cad5fc69baefeb89364d5154f00a56c74b..2e8b3fb7e53b4524d6f246c6317ac917dfe2aaac 100644 --- a/src/app/metamodel/effects/instance.effects.ts +++ b/src/app/metamodel/effects/instance.effects.ts @@ -19,6 +19,10 @@ import * as instanceActions from '../action/instance.action'; import { InstanceService } from '../services/instance.service'; @Injectable() +/** + * @class + * @classdesc Instance effects. + */ export class InstanceEffects { constructor( private actions$: Actions, @@ -26,6 +30,9 @@ export class InstanceEffects { private toastr: ToastrService ) { } + /** + * Retrieves instance metadata. + */ @Effect() loadInstanceMetaAction$ = this.actions$.pipe( ofType(instanceActions.LOAD_INSTANCE_META), @@ -38,6 +45,9 @@ export class InstanceEffects { ) ); + /** + * Displays retrieve instance metadata error notification. + */ @Effect({ dispatch: false }) loadInstanceMetaFailedAction$ = this.actions$.pipe( ofType(instanceActions.LOAD_INSTANCE_META_FAIL), diff --git a/src/app/metamodel/effects/output.effects.ts b/src/app/metamodel/effects/output.effects.ts index 2e589c8a234d7b8eb6ddd5daf8f27a19fa9c8bc4..4be27c61ebe7a67c2434996359eea94ec24ab755 100644 --- a/src/app/metamodel/effects/output.effects.ts +++ b/src/app/metamodel/effects/output.effects.ts @@ -9,16 +9,20 @@ import { Injectable } from '@angular/core'; -import { ToastrService } from 'ngx-toastr'; import { Effect, Actions, ofType } from '@ngrx/effects'; import { of } from 'rxjs'; import { switchMap, map, catchError, tap } from 'rxjs/operators'; +import { ToastrService } from 'ngx-toastr'; import { Family, Category } from '../model'; import * as outputActions from '../action/output.action'; import { OutputService } from '../services/output.service'; @Injectable() +/** + * @class + * @classdesc Output effects. + */ export class OutputEffects { constructor( private actions$: Actions, @@ -26,6 +30,9 @@ export class OutputEffects { private toastr: ToastrService ) { } + /** + * Calls action to retrieve output metadata. + */ @Effect() loadOutputSearchMetaAction$ = this.actions$.pipe( ofType(outputActions.LOAD_OUTPUT_SEARCH_META), @@ -34,6 +41,9 @@ export class OutputEffects { }) ); + /** + * Retrieves output metadata. + */ @Effect() loadOutputSearchMetaWipAction$ = this.actions$.pipe( ofType(outputActions.LOAD_OUTPUT_SEARCH_META_WIP), @@ -46,6 +56,9 @@ export class OutputEffects { }) ); + /** + * Displays retrieve output metadata error notification. + */ @Effect({ dispatch: false }) loadOutputSearchMetaFailedAction$ = this.actions$.pipe( ofType(outputActions.LOAD_OUTPUT_SEARCH_META_FAIL), diff --git a/src/app/metamodel/metamodel.module.ts b/src/app/metamodel/metamodel.module.ts index d7f91a74fde2f13cc18322262efbc01b5cfe03ae..56d5efb57a39600afe950adac80c374bbac6d1b4 100644 --- a/src/app/metamodel/metamodel.module.ts +++ b/src/app/metamodel/metamodel.module.ts @@ -25,4 +25,8 @@ import { reducer } from './reducers'; services ] }) +/** + * @class + * @classdesc Metamodel module. + */ export class MetamodelModule { } diff --git a/src/app/metamodel/model/attribute.model.ts b/src/app/metamodel/model/attribute.model.ts index 230813f1161c2f31b1017ba6dbfc2a8f195ab9a7..5fee3cae154152e8eb5ea4f5898449cf99c10463 100644 --- a/src/app/metamodel/model/attribute.model.ts +++ b/src/app/metamodel/model/attribute.model.ts @@ -10,6 +10,11 @@ import { Option } from './option.model'; import { RendererConfig } from './renderer-config.model'; +/** + * Interface for attribute. + * + * @interface Attribute + */ export interface Attribute { id: number; name: string; @@ -44,5 +49,4 @@ export interface Attribute { vo_size: number; id_criteria_family: number; id_output_category: number; - } diff --git a/src/app/metamodel/model/attributes-by-dataset.model.ts b/src/app/metamodel/model/attributes-by-dataset.model.ts index 8f860b75618ac39d0f28480b32310c3d5277704b..0be1b2fc060f10332a1cf50be6feaa4bb367be71 100644 --- a/src/app/metamodel/model/attributes-by-dataset.model.ts +++ b/src/app/metamodel/model/attributes-by-dataset.model.ts @@ -9,6 +9,11 @@ import { Attribute } from './attribute.model'; +/** + * Interface for attributes by dataset. + * + * @interface AttributesByDataset + */ export interface AttributesByDataset { datasetName: string; isLoading: boolean; diff --git a/src/app/metamodel/model/category.model.ts b/src/app/metamodel/model/category.model.ts index 9e9f515f40e49bb61b9640a9dacd0a6af69958eb..c79ae5b714b026b1749d635ef6b7f02d41999ada 100644 --- a/src/app/metamodel/model/category.model.ts +++ b/src/app/metamodel/model/category.model.ts @@ -7,6 +7,11 @@ * file that was distributed with this source code. */ +/** + * Interface for category. + * + * @interface Category + */ export interface Category { id: number; label: string; diff --git a/src/app/metamodel/model/dataset.model.ts b/src/app/metamodel/model/dataset.model.ts index d3264d34c75242e565baae5f21c835210cefb4eb..0b09218101d1c6ea7f66f8501da773907f757457 100644 --- a/src/app/metamodel/model/dataset.model.ts +++ b/src/app/metamodel/model/dataset.model.ts @@ -7,6 +7,11 @@ * file that was distributed with this source code. */ +/** + * Interface for dataset. + * + * @interface Dataset + */ export interface Dataset { name: string; table_ref: string; diff --git a/src/app/metamodel/model/family.model.ts b/src/app/metamodel/model/family.model.ts index fc8376cf2691490fb244f9dfbe4db6e57777fe7c..f832af32dfadb5a5f0c3e9bd4e62602178feb849 100644 --- a/src/app/metamodel/model/family.model.ts +++ b/src/app/metamodel/model/family.model.ts @@ -7,6 +7,11 @@ * file that was distributed with this source code. */ +/** + * Interface for family. + * + * @interface Family + */ export interface Family { id: number; type: string; diff --git a/src/app/metamodel/model/instance.model.ts b/src/app/metamodel/model/instance.model.ts index a7ab3ca88439f8ec92dc3ec721e285a0d875fd38..17f967b57ffcb81b8cb743c2e942ef625b3105d2 100644 --- a/src/app/metamodel/model/instance.model.ts +++ b/src/app/metamodel/model/instance.model.ts @@ -7,6 +7,11 @@ * file that was distributed with this source code. */ +/** + * Interface for instance. + * + * @interface Instance + */ export interface Instance { name: string; label: string; diff --git a/src/app/metamodel/model/option.model.ts b/src/app/metamodel/model/option.model.ts index 6c57043002cb878fdfb1f817c90fe121b461f646..239e53dd7ca2b27852c3d697b985fe0aa9a2224f 100644 --- a/src/app/metamodel/model/option.model.ts +++ b/src/app/metamodel/model/option.model.ts @@ -7,6 +7,10 @@ * file that was distributed with this source code. */ +/** + * @class + * @classdesc Option class. + */ export class Option { label: string; value: string; diff --git a/src/app/metamodel/model/project.model.ts b/src/app/metamodel/model/project.model.ts index e37a6761ff1c4e769813a0a6d800a77ffac4bec1..498667df38b8e86cbe8a69ef8918dd62ed85544f 100644 --- a/src/app/metamodel/model/project.model.ts +++ b/src/app/metamodel/model/project.model.ts @@ -7,6 +7,11 @@ * file that was distributed with this source code. */ +/** + * Interface for project. + * + * @interface Project + */ export interface Project { name: string; label: string; diff --git a/src/app/metamodel/model/renderer-config.model.ts b/src/app/metamodel/model/renderer-config.model.ts index d510492ab18feafec9c948a12cfcc537361e4ae6..c27e7b4d4ad5dfb013afccd483d39073d1247daa 100644 --- a/src/app/metamodel/model/renderer-config.model.ts +++ b/src/app/metamodel/model/renderer-config.model.ts @@ -7,4 +7,9 @@ * file that was distributed with this source code. */ +/** + * Interface for renderer configuration. + * + * @interface RendererConfig + */ export interface RendererConfig { } \ No newline at end of file diff --git a/src/app/metamodel/reducers/attribute.reducer.ts b/src/app/metamodel/reducers/attribute.reducer.ts index 01d32154fda3695fbb744d13bb29d743e14356f7..4c84c51a202397bb298b1a1880719f01a8789446 100644 --- a/src/app/metamodel/reducers/attribute.reducer.ts +++ b/src/app/metamodel/reducers/attribute.reducer.ts @@ -12,8 +12,21 @@ import { createEntityAdapter, EntityAdapter, EntityState, Update } from '@ngrx/e import * as actions from '../action/attribute.action'; import { AttributesByDataset } from '../model'; +/** + * Interface for attribute state. + * + * @interface State + * @extends EntityState<AttributesByDataset> + */ export interface State extends EntityState<AttributesByDataset> { } +/** + * Returns datasetName from AttributesByDataset object. + * + * @param {AttributesByDataset} a - The attributes by dataset. + * + * @return string + */ export function selectAttributesByDatasetId(a: AttributesByDataset): string { return a.datasetName; } @@ -25,6 +38,14 @@ export const adapter : EntityAdapter<AttributesByDataset> = export const initialState: State = adapter.getInitialState(); +/** + * Reduces state. + * + * @param {State} state - The state. + * @param {actions} action - The action. + * + * @return State + */ export function reducer(state: State = initialState, action: actions.Actions): State { switch (action.type) { case actions.LOAD_ATTRIBUTE_LIST: diff --git a/src/app/metamodel/reducers/criteria.reducer.ts b/src/app/metamodel/reducers/criteria.reducer.ts index 491083c5e544a2e5a429f89335339282bce8c881..98c8af17968e8ebe44318340b2b6be984cb9d169 100644 --- a/src/app/metamodel/reducers/criteria.reducer.ts +++ b/src/app/metamodel/reducers/criteria.reducer.ts @@ -10,6 +10,11 @@ import * as actions from '../action/criteria.action'; import { Family } from '../model'; +/** + * Interface for criteria state. + * + * @interface State + */ export interface State { criteriaSearchMetaIsLoading: boolean; criteriaSearchMetaIsLoaded: boolean; @@ -22,6 +27,14 @@ export const initialState: State = { criteriaFamilyList: [] }; +/** + * Reduces state. + * + * @param {State} state - The state. + * @param {actions} action - The action. + * + * @return State + */ export function reducer(state: State = initialState, action: actions.Actions): State { switch (action.type) { case actions.LOAD_CRITERIA_SEARCH_META_WIP: diff --git a/src/app/metamodel/reducers/dataset.reducer.ts b/src/app/metamodel/reducers/dataset.reducer.ts index e780f2af58d0be7f0b5394c08c30586bf7ec688b..dc648b7aada8a5f5501df1e93ed40f89263c77f0 100644 --- a/src/app/metamodel/reducers/dataset.reducer.ts +++ b/src/app/metamodel/reducers/dataset.reducer.ts @@ -10,6 +10,11 @@ import * as actions from '../action/dataset.action'; import { Project, Dataset, Family } from '../model'; +/** + * Interface for dataset state. + * + * @interface State + */ export interface State { datasetSearchMetaIsLoading: boolean; datasetSearchMetaIsLoaded: boolean; @@ -26,6 +31,14 @@ export const initialState: State = { datasetFamilyList: [] }; +/** + * Reduces state. + * + * @param {State} state - The state. + * @param {actions} action - The action. + * + * @return State + */ export function reducer(state: State = initialState, action: actions.Actions): State { switch (action.type) { case actions.LOAD_DATASET_SEARCH_META_WIP: diff --git a/src/app/metamodel/reducers/instance.reducer.ts b/src/app/metamodel/reducers/instance.reducer.ts index 56b70199b77e1f2d453f746ce9a4d8f49d491402..9acf274cc36bcb6750767e4768b40d8adbf386ab 100644 --- a/src/app/metamodel/reducers/instance.reducer.ts +++ b/src/app/metamodel/reducers/instance.reducer.ts @@ -10,6 +10,11 @@ import * as actions from '../action/instance.action'; import { Instance } from '../model'; +/** + * Interface for instance state. + * + * @interface State + */ export interface State { instance: Instance; } @@ -18,6 +23,14 @@ export const initialState: State = { instance: null }; +/** + * Reduces state. + * + * @param {State} state - The state. + * @param {actions} action - The action. + * + * @return State + */ export function reducer(state: State = initialState, action: actions.Actions): State { switch (action.type) { case actions.LOAD_INSTANCE_META_SUCCESS: diff --git a/src/app/metamodel/reducers/output.reducer.ts b/src/app/metamodel/reducers/output.reducer.ts index ae629f972dd87c35526109d0b65b403374fbb9df..dacfff14a49aebe5569da6a3b4f178a1e1775e1d 100644 --- a/src/app/metamodel/reducers/output.reducer.ts +++ b/src/app/metamodel/reducers/output.reducer.ts @@ -10,6 +10,11 @@ import * as actions from '../action/output.action'; import { Family, Category } from '../model'; +/** + * Interface for output state. + * + * @interface State + */ export interface State { outputSearchMetaIsLoading: boolean; outputSearchMetaIsLoaded: boolean; @@ -24,6 +29,14 @@ export const initialState: State = { categoryList: [] }; +/** + * Reduces state. + * + * @param {State} state - The state. + * @param {actions} action - The action. + * + * @return State + */ export function reducer(state: State = initialState, action: actions.Actions): State { switch (action.type) { case actions.LOAD_OUTPUT_SEARCH_META_WIP: diff --git a/src/app/metamodel/services/attribute.service.ts b/src/app/metamodel/services/attribute.service.ts index 451912a0440216e93e47713e2ad7049c69b072a7..6e4e2d194f358493c177a5971d2434acf45728de 100644 --- a/src/app/metamodel/services/attribute.service.ts +++ b/src/app/metamodel/services/attribute.service.ts @@ -17,18 +17,29 @@ import { Attribute } from '../model'; import { environment } from '../../../environments/environment'; @Injectable() +/** + * @class + * @classdesc Attribute service. + */ export class AttributeService { private API_PATH: string = environment.apiUrl; constructor(private http: HttpClient) { } - retrieveAttributeList(datasetName: string): Observable<{ datasetName: string, attributeList: Attribute[] }> { - return this.http.get<Attribute[]>(this.API_PATH + '/dataset/' + datasetName + '/attribute').pipe( + /** + * Retrieves attributes metadata for the given dataset name. + * + * @param {string} dname - The dataset name. + * + * @return Observable<{ datasetName: string, attributeList: Attribute[] }> + */ + retrieveAttributeList(dname: string): Observable<{ datasetName: string, attributeList: Attribute[] }> { + return this.http.get<Attribute[]>(this.API_PATH + '/dataset/' + dname + '/attribute').pipe( map(res => { - return { datasetName: datasetName, attributeList: res }; + return { datasetName: dname, attributeList: res }; }), catchError(error => { - error.datasetName = datasetName; + error.datasetName = dname; return throwError(error); }) ); diff --git a/src/app/metamodel/services/criteria.service.ts b/src/app/metamodel/services/criteria.service.ts index d8f865c170f65e09560a2d2b1038ee1a328d66ad..9bb4a87492577ab8b014a016c82a7ddbbde8a7ec 100644 --- a/src/app/metamodel/services/criteria.service.ts +++ b/src/app/metamodel/services/criteria.service.ts @@ -10,23 +10,42 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { sortByDisplay } from '../../shared/utils'; import { Family } from '../model'; +import { sortByDisplay } from '../../shared/utils'; import { environment } from '../../../environments/environment'; @Injectable() +/** + * @class + * @classdesc Criteria service. + */ export class CriteriaService { private API_PATH: string = environment.apiUrl; constructor(private http: HttpClient) { } - retrieveCriteriaSearchMeta(dname: string) { + /** + * Retrieves criteria metadata for the given dataset name. + * + * @param {string} dname - The dataset name. + * + * @return Observable<Family[]> + */ + retrieveCriteriaSearchMeta(dname: string): Observable<Family[]> { return this.retrieveCriteriaFamilyList(dname); } - retrieveCriteriaFamilyList(dname: string) { + /** + * Retrieves criteria families metadata for the given dataset name. + * + * @param {string} dname - The dataset name. + * + * @return Observable<Family[]> + */ + retrieveCriteriaFamilyList(dname: string): Observable<Family[]> { return this.http.get<Family[]>(this.API_PATH + '/dataset/' + dname + '/criteria-family').pipe( map(criteriaFamilyList => [...criteriaFamilyList].sort(sortByDisplay)) ); diff --git a/src/app/metamodel/services/dataset.service.ts b/src/app/metamodel/services/dataset.service.ts index 7cac70b92b0336e079209eac5be10834df72033b..4a1b5a82e634b8393a167cb9faa6a875cde00b91 100644 --- a/src/app/metamodel/services/dataset.service.ts +++ b/src/app/metamodel/services/dataset.service.ts @@ -10,7 +10,7 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; -import { forkJoin } from 'rxjs'; +import { forkJoin, Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { sortByDisplay } from '../../shared/utils'; @@ -18,13 +18,22 @@ import { Project, Dataset, Family } from '../model'; import { environment } from '../../../environments/environment'; @Injectable() +/** + * @class + * @classdesc Dataset service. + */ export class DatasetService { private API_PATH: string = environment.apiUrl; private instanceName: string = environment.instanceName; constructor(private http: HttpClient) { } - retrieveDatasetSearchMeta() { + /** + * Retrieves projects, datasets and dataset families metadata. + * + * @return Observable<[Project[], Dataset[], Family[]]> + */ + retrieveDatasetSearchMeta(): Observable<[Project[], Dataset[], Family[]]> { const projectList = this.retrieveProjectList(); const datasetList = this.retrieveDatasetList(); const datasetFamilyList = this.retrieveDatasetFamilyList(); @@ -32,15 +41,30 @@ export class DatasetService { return forkJoin([projectList, datasetList, datasetFamilyList]); } - retrieveProjectList() { + /** + * Retrieves projects metadata. + * + * @return Observable<Project[]> + */ + retrieveProjectList(): Observable<Project[]> { return this.http.get<Project[]>(this.API_PATH + '/project'); } - retrieveDatasetList() { + /** + * Retrieves datasets metadata. + * + * @return Observable<Dataset[]> + */ + retrieveDatasetList(): Observable<Dataset[]> { return this.http.get<Dataset[]>(this.API_PATH + '/instance/' + this.instanceName + '/dataset'); } - retrieveDatasetFamilyList() { + /** + * Retrieves dataset families metadata. + * + * @return Observable<Family[]> + */ + retrieveDatasetFamilyList(): Observable<Family[]> { return this.http.get<Family[]>(this.API_PATH + '/instance/' + this.instanceName + '/dataset-family').pipe( map(datasetFamilyList => [...datasetFamilyList].sort(sortByDisplay)) ); diff --git a/src/app/metamodel/services/instance.service.ts b/src/app/metamodel/services/instance.service.ts index af8c9cde68b1a536ce792d4be0cd5550fa05644b..e4569b4a0cf9d5f3f1a0e02006b204075997ec27 100644 --- a/src/app/metamodel/services/instance.service.ts +++ b/src/app/metamodel/services/instance.service.ts @@ -10,17 +10,28 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; + import { Instance } from '../model'; import { environment } from '../../../environments/environment'; @Injectable() +/** + * @class + * @classdesc Instance service. + */ export class InstanceService { private API_PATH: string = environment.apiUrl; private instanceName: string = environment.instanceName; constructor(private http: HttpClient) { } - retrieveInstanceMeta() { + /** + * Retrieves instance metadata. + * + * @return Observable<Instance> + */ + retrieveInstanceMeta(): Observable<Instance> { return this.http.get<Instance>(this.API_PATH + '/instance/' + this.instanceName); } } diff --git a/src/app/metamodel/services/output.service.ts b/src/app/metamodel/services/output.service.ts index 65bba32156aaa0bf7ffd320673de2d275dae073d..9c097e7ed5bca6b5662d49a421da0780e52e0da6 100644 --- a/src/app/metamodel/services/output.service.ts +++ b/src/app/metamodel/services/output.service.ts @@ -10,7 +10,7 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; -import { forkJoin } from 'rxjs'; +import { forkJoin, Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { sortByDisplay } from '../../shared/utils'; @@ -18,25 +18,50 @@ import { Family, Category } from '../model'; import { environment } from '../../../environments/environment'; @Injectable() +/** + * @class + * @classdesc Output service. + */ export class OutputService { private API_PATH: string = environment.apiUrl; constructor(private http: HttpClient) { } - retrieveOutputSearchMeta(dname: string) { + /** + * Retrieves output metadata for the given dataset name. + * + * @param {string} dname - The dataset name. + * + * @return Observable<[Family[], Category[]]> + */ + retrieveOutputSearchMeta(dname: string): Observable<[Family[], Category[]]> { const outputFamilyList = this.retrieveOutputFamilyList(dname); const categoryList = this.retrieveCategoryList(dname); return forkJoin([outputFamilyList, categoryList]); } - retrieveOutputFamilyList(dname: string) { + /** + * Retrieves output families for the given dataset name. + * + * @param {string} dname - The dataset name. + * + * @return Observable<Family[]> + */ + retrieveOutputFamilyList(dname: string): Observable<Family[]> { return this.http.get<Family[]>(this.API_PATH + '/dataset/' + dname + '/output-family').pipe( map(outputFamilyList => [...outputFamilyList].sort(sortByDisplay)) ); } - retrieveCategoryList(dname: string) { + /** + * Retrieves output categories for the given dataset name. + * + * @param {string} dname - The dataset name. + * + * @return Observable<Category[]> + */ + retrieveCategoryList(dname: string): Observable<Category[]> { return this.http.get<Category[]>(this.API_PATH + '/dataset/' + dname + '/output-category').pipe( map(outputCategoryList => [...outputCategoryList].sort(sortByDisplay)) );