Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
anis
anis-client
Commits
aa3d8af4
Commit
aa3d8af4
authored
Nov 13, 2020
by
Tifenn Guillas
Browse files
Add comments for documentation module => DONE
parent
bdf3035b
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/app/documentation/containers/documentation.component.ts
View file @
aa3d8af4
...
...
@@ -26,6 +26,12 @@ import { ScrollTopService } from '../../shared/service/sroll-top.service';
templateUrl
:
'
documentation.component.html
'
,
styleUrls
:
[
'
documentation.component.css
'
]
})
/**
* @class
* @classdesc Documentation container.
*
* @implements OnInit
*/
export
class
DocumentationComponent
implements
OnInit
{
public
datasetListIsLoading
:
Observable
<
boolean
>
;
public
datasetListIsLoaded
:
Observable
<
boolean
>
;
...
...
@@ -48,10 +54,23 @@ export class DocumentationComponent implements OnInit {
this
.
scrollTopService
.
setScrollTop
();
}
/**
* Returns host URL.
*
* @return string
*/
getHost
():
string
{
return
host
();
}
/**
* Returns attribute list sorted by ID, for the given dataset name.
*
* @param {string} dname - The dataset name.
* @param {Dictionary<AttributesByDataset>} attributesLists - Attribute list by dataset dictionary.
*
* @return Attribute[]
*/
getAttributeList
(
dname
:
string
,
attributesLists
:
Dictionary
<
AttributesByDataset
>
):
Attribute
[]
{
return
[...
attributesLists
[
dname
].
attributeList
].
sort
((
a
,
b
)
=>
a
.
id
-
b
.
id
);
}
...
...
src/app/documentation/documentation-routing.module.ts
View file @
aa3d8af4
...
...
@@ -18,6 +18,10 @@ const routes: Routes = [{ path: '', component: DocumentationComponent }];
imports
:
[
RouterModule
.
forChild
(
routes
)
],
exports
:
[
RouterModule
]
})
/**
* @class
* @classdesc Documentation routing module.
*/
export
class
DocumentationRoutingModule
{
}
export
const
routedComponents
=
[
...
...
src/app/documentation/documentation.module.ts
View file @
aa3d8af4
...
...
@@ -28,4 +28,8 @@ import { DocumentationEffects } from './store/documentation.effects';
routedComponents
]
})
/**
* @class
* @classdesc Documentation module.
*/
export
class
DocumentationModule
{
}
src/app/documentation/store/documentation.action.ts
View file @
aa3d8af4
...
...
@@ -9,23 +9,38 @@
import
{
Action
}
from
'
@ngrx/store
'
;
export
const
RETRIEVE_ATTRIBUTE_LISTS
=
'
[Documentation] Retrieve Attribute Lists
'
;
export
const
ATTRIBUTE_LISTS_IS_LOADING
=
'
[Documentation] Attribute Lists Is Loading
'
;
export
const
ATTRIBUTE_LISTS_IS_LOADED
=
'
[Documentation] Attribute Lists Is Loaded
'
;
/**
* @class
* @classdesc RetrieveAttributeListsAction action.
* @readonly
*/
export
class
RetrieveAttributeListsAction
implements
Action
{
readonly
type
=
RETRIEVE_ATTRIBUTE_LISTS
;
constructor
(
public
payload
:
{}
=
null
)
{
}
}
/**
* @class
* @classdesc AttributeListsIsLoadingAction action.
* @readonly
*/
export
class
AttributeListsIsLoadingAction
implements
Action
{
readonly
type
=
ATTRIBUTE_LISTS_IS_LOADING
;
constructor
(
public
payload
:
boolean
)
{
}
}
/**
* @class
* @classdesc AttributeListsIsLoadedAction action.
* @readonly
*/
export
class
AttributeListsIsLoadedAction
implements
Action
{
readonly
type
=
ATTRIBUTE_LISTS_IS_LOADED
;
...
...
src/app/documentation/store/documentation.effects.ts
View file @
aa3d8af4
...
...
@@ -22,6 +22,10 @@ import * as attributeActions from '../../metamodel/action/attribute.action';
import
*
as
utils
from
'
../../shared/utils
'
;
@
Injectable
()
/**
* @class
* @classdesc Documentation effects.
*/
export
class
DocumentationEffects
{
constructor
(
private
actions$
:
Actions
,
...
...
@@ -31,6 +35,9 @@ export class DocumentationEffects {
}
>
)
{
}
/**
* Retrieves attribute lists for datasets instance.
*/
@
Effect
()
retrieveAttributeListsAction$
=
this
.
actions$
.
pipe
(
ofType
(
documentationActions
.
RETRIEVE_ATTRIBUTE_LISTS
),
...
...
@@ -49,6 +56,9 @@ export class DocumentationEffects {
})
);
/**
* Retrieves attribute lists for datasets instance.
*/
@
Effect
()
loadDatasetSearchMetaSuccessAction$
=
this
.
actions$
.
pipe
(
ofType
(
datasetActions
.
LOAD_DATASET_SEARCH_META_SUCCESS
),
...
...
@@ -67,6 +77,9 @@ export class DocumentationEffects {
})
);
/**
* Calls actions to store that attribute lists loading is done.
*/
@
Effect
()
loadAttributeListsSuccessAction$
=
this
.
actions$
.
pipe
(
ofType
(
attributeActions
.
LOAD_MULTIPLE_ATTRIBUTE_LISTS_SUCCESS
),
...
...
@@ -79,6 +92,9 @@ export class DocumentationEffects {
})
);
/**
* Displays retrieve attribute lists error notification.
*/
@
Effect
()
loadAttributeListsFailAction$
=
this
.
actions$
.
pipe
(
ofType
(
attributeActions
.
LOAD_MULTIPLE_ATTRIBUTE_LISTS_FAIL
),
...
...
src/app/documentation/store/documentation.reducer.ts
View file @
aa3d8af4
...
...
@@ -9,6 +9,11 @@
import
*
as
actions
from
'
./documentation.action
'
;
/**
* Interface for documentation state.
*
* @interface State
*/
export
interface
State
{
attributeListsIsLoading
:
boolean
;
attributeListsIsLoaded
:
boolean
;
...
...
@@ -19,6 +24,14 @@ export const initialState: State = {
attributeListsIsLoaded
:
false
};
/**
* 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
.
ATTRIBUTE_LISTS_IS_LOADING
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment