"src/git@gitlab.lam.fr:anis/anis-client.git" did not exist on "01e96a5c29f843189f90cf069c997a0f88e3c1d5"
Newer
Older
/**
* This file is part of Anis Client.
*
* @copyright Laboratoire d'Astrophysique de Marseille / CNRS
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { Component, OnInit } from '@angular/core';
import { Store } from '@ngrx/store';
import { Observable } from 'rxjs';
import * as documentationActions from 'src/app/instance/store/actions/documentation.actions';
import * as datasetSelector from 'src/app/metamodel/selectors/dataset.selector';
import { environment } from 'src/environments/environment';
import * as instanceSelector from "../../../metamodel/selectors/instance.selector";
import * as attributeSelector from "../../../metamodel/selectors/attribute.selector";
@Component({
selector: 'app-documentation',
templateUrl: 'documentation.component.html',
})
/**
* @class
* @classdesc Documentation container.
*
* @implements OnInit
*/
export class DocumentationComponent implements OnInit {
public instanceSelected: Observable<string>;
public datasetSelected: Observable<string>;
public attributeListIsLoading: Observable<boolean>;
public attributeListIsLoaded: Observable<boolean>;
public attributeList: Observable<Attribute[]>;
this.instanceSelected = store.select(instanceSelector.selectInstanceNameByRoute);
this.datasetSelected = store.select(datasetSelector.selectDatasetNameByRoute);
this.attributeListIsLoading = store.select(attributeSelector.selectAttributeListIsLoading);
this.attributeListIsLoaded = store.select(attributeSelector.selectAttributeListIsLoaded);
this.attributeList = store.select(attributeSelector.selectAllAttributes);
this.store.dispatch(documentationActions.loadAttributeList());
}
/**
* Returns strict url address.
*
* @return string
*/
getUrlServer(): string {
if (!environment.apiUrl.startsWith('http')) {
const url = window.location;
return url.protocol + '//' + url.host + environment.apiUrl;
}
return environment.apiUrl;
}
}