Commit 56f034df authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Merge branch '138-documentation-shorten-and-order-output-list' into 'develop'

Resolve "[Documentation] Shorten and order output list"

Closes #138

See merge request !150
parents 18c881a8 db328cbc
Pipeline #3217 passed with stages
in 8 minutes and 37 seconds
......@@ -12,3 +12,10 @@ table, th, td {
border-collapse: collapse;
margin-bottom: 1em;
}
.attributes-table {
display: inline-block;
max-height : 500px;
overflow-y : auto;
overflow-x: hidden;
}
......@@ -50,18 +50,18 @@
<span class="sr-only">Loading...</span>
</div>
<div *ngIf="attributeListsIsLoaded | async" class="row">
<div *ngFor="let dataset of datasetList | async" class="col-auto">
<div *ngFor="let dataset of datasetList | async" class="col-auto mb-5">
<h6>{{ dataset.label }} output list</h6>
<table id="table">
<tr>
<th>id</th>
<th>attribute</th>
</tr>
<tr *ngFor="let attribute of getAttributeList(dataset.name, attributeList | async)">
<td>{{ attribute.id }}</td>
<td>{{ attribute.name }}</td>
</tr>
</table>
<table id="table" class="attributes-table p-0">
<tr>
<th>id</th>
<th>attribute</th>
</tr>
<tr *ngFor="let attribute of getAttributeList(dataset.name, attributeList | async)">
<td>{{ attribute.id }}</td>
<td>{{ attribute.name }}</td>
</tr>
</table>
</div>
</div>
......@@ -200,4 +200,4 @@
</div>
</div>
</div>
</div>
\ No newline at end of file
</div>
......@@ -50,10 +50,13 @@ describe('[Documentation] Component: DocumentationComponent', () => {
expect(component.getHost()).toEqual(environment.apiUrl);
});
it('#getAttributeList() should return attributes for selected dataset', () => {
it('#getAttributeList() should return attributes for selected dataset, sorted by id', () => {
const attributeLists: Dictionary<AttributesByDataset> = {
'toto': { datasetName: 'toto', isLoading: false, isLoaded: true, attributeList: ATTRIBUTE_LIST }
};
expect(component.getAttributeList('toto', attributeLists)).toEqual(ATTRIBUTE_LIST);
const attributeList = component.getAttributeList('toto', attributeLists);
expect(attributeList.length).toEqual(2);
expect(attributeList[0].id).toEqual(1);
expect(attributeList[1].id).toEqual(2);
});
});
......@@ -44,6 +44,6 @@ export class DocumentationComponent implements OnInit {
}
getAttributeList(dname: string, attributesLists: Dictionary<AttributesByDataset>): Attribute[] {
return attributesLists[dname].attributeList;
return [...attributesLists[dname].attributeList].sort((a, b) => a.id - b.id);
}
}
import * as loginActions from './login.action';
import { LoginToken, Login, ChangePassword } from './model';
import { AnisServerError } from 'src/app/shared/model';
import { AnisServerError } from '../../shared/model';
describe('[Login] Action', () => {
it('should LoginLocalStorageAction', () => {
......
import * as criteriaActions from './criteria.action';
import { CRITERIA_FAMILY_LIST } from 'src/settings/test-data';
import { CRITERIA_FAMILY_LIST } from '../../../settings/test-data';
import { Family } from '../model';
describe('[Metamodel] Criteria action', () => {
......
import * as datasetActions from './dataset.action';
import { PROJECT_LIST, DATASET_LIST, DATASET_FAMILY_LIST } from 'src/settings/test-data';
import { PROJECT_LIST, DATASET_LIST, DATASET_FAMILY_LIST } from '../../../settings/test-data';
import { Project, Dataset, Family } from '../model';
describe('[Metamodel] Dataset action', () => {
......
import * as outputActions from './output.action';
import { OUTPUT_FAMILY_LIST, CATEGORY_LIST } from 'src/settings/test-data';
import { OUTPUT_FAMILY_LIST, CATEGORY_LIST } from '../../../settings/test-data';
import { Family, Category } from '../model';
describe('[Metamodel] Output action', () => {
......
import * as fromCriteria from './criteria.reducer';
import * as criteriaActions from '../action/criteria.action';
import { Dataset, Family } from '../model';
import { DATASET_LIST, CRITERIA_FAMILY_LIST } from 'src/settings/test-data';
import { DATASET_LIST, CRITERIA_FAMILY_LIST } from '../../../settings/test-data';
describe('[Metamodel] Criteria reducer', () => {
it('should return init state', () => {
......
import * as fromDataset from './dataset.reducer';
import * as datasetActions from '../action/dataset.action';
import { Project, Dataset, Family } from '../model';
import { PROJECT_LIST, DATASET_LIST, DATASET_FAMILY_LIST } from 'src/settings/test-data';
import { PROJECT_LIST, DATASET_LIST, DATASET_FAMILY_LIST } from '../../../settings/test-data';
describe('[Metamodel] Dataset reducer', () => {
it('should return init state', () => {
......
import * as fromOutput from './output.reducer';
import * as outputActions from '../action/output.action';
import { Dataset, Family, Category } from '../model';
import { DATASET_LIST, OUTPUT_FAMILY_LIST, CATEGORY_LIST } from 'src/settings/test-data';
import { DATASET_LIST, OUTPUT_FAMILY_LIST, CATEGORY_LIST } from '../../../settings/test-data';
describe('[Metamodel] Output reducer', () => {
it('should return init state', () => {
......
......@@ -2,7 +2,7 @@ import * as searchSelector from './search.selector';
import * as fromSearch from './search.reducer';
import * as fromConeSearch from '../../shared/cone-search/store/cone-search.reducer';
import { Criterion } from './model';
import { CRITERIA_LIST } from 'src/settings/test-data';
import { CRITERIA_LIST } from '../../../settings/test-data';
import { ConeSearch } from '../../shared/cone-search/store/model';
describe('[Search] Selector', () => {
......
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core';
import { FormControl } from '@angular/forms';
import { rangeValidator } from 'src/app/shared/validator';
import { rangeValidator } from '../../validator';
import { ConeSearch } from '../store/model';
@Component({
......
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Attribute, Dataset } from 'src/app/metamodel/model';
import { Attribute, Dataset } from '../../metamodel/model';
import { Pagination, PaginationOrder } from './model';
......
import { Attribute, Option } from '../../app/metamodel/model';
export const ATTRIBUTE_LIST: Attribute[] = [
{
id: 2,
name: 'name_two',
table_name: 'table_2',
label: 'label_two',
form_label: 'form_label_two',
description: 'description_two',
output_display: 1,
criteria_display: 1,
search_flag: 'SPECTRUM_1D',
search_type: 'field',
operator: '=',
type: '',
min: null,
max: null,
placeholder_min: '',
placeholder_max: '',
renderer: '',
renderer_config: null,
display_detail: 1,
selected: true,
order_by: true,
order_display: 1,
detail: true,
renderer_detail: 'spectra_graph',
options: null,
vo_utype: '',
vo_ucd: '',
vo_unit: '',
vo_description: '',
vo_datatype: '',
vo_size: 1,
id_criteria_family: 2,
id_output_category: 2
},
{
id: 1,
name: 'name_one',
......@@ -39,40 +74,5 @@ export const ATTRIBUTE_LIST: Attribute[] = [
vo_size: 1,
id_criteria_family: 1,
id_output_category: 1
},
{
id: 2,
name: 'name_two',
table_name: 'table_2',
label: 'label_two',
form_label: 'form_label_two',
description: 'description_two',
output_display: 1,
criteria_display: 1,
search_flag: 'SPECTRUM_1D',
search_type: 'field',
operator: '=',
type: '',
min: null,
max: null,
placeholder_min: '',
placeholder_max: '',
renderer: '',
renderer_config: null,
display_detail: 1,
selected: true,
order_by: true,
order_display: 1,
detail: true,
renderer_detail: 'spectra_graph',
options: null,
vo_utype: '',
vo_ucd: '',
vo_unit: '',
vo_description: '',
vo_datatype: '',
vo_size: 1,
id_criteria_family: 2,
id_output_category: 2
}
];
import { Family } from 'src/app/metamodel/model';
import { Family } from '../../app/metamodel/model';
export const CRITERIA_FAMILY_LIST: Family[] = [
{
......
import { Criterion, FieldCriterion } from 'src/app/search/store/model';
import { Criterion, FieldCriterion } from '../../app/search/store/model';
export const CRITERIA_LIST: Criterion[] = [
{id: 1, type: 'field', operator: 'eq', value: 'fd_crit_1'} as FieldCriterion,
......
import { Family } from 'src/app/metamodel/model';
import { Family } from '../../app/metamodel/model';
export const DATASET_FAMILY_LIST: Family[] = [
{
......
import { Dataset } from 'src/app/metamodel/model';
import { Dataset } from '../../app/metamodel/model';
export const DATASET_LIST: Dataset[] = [
{
......
import { Dataset } from 'src/app/metamodel/model';
import { Dataset } from '../../app/metamodel/model';
export const DATASET: Dataset = {
name: 'cat_1',
......
Supports Markdown
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