From 322f9152985c832a1b6762873a2a9cd45992e0cc Mon Sep 17 00:00:00 2001
From: Tifenn Guillas <tifenn.guillas@gmail.com>
Date: Mon, 26 Jul 2021 11:55:06 +0200
Subject: [PATCH] Displau outputs => DONE

---
 .../src/app/instance/doc/components/index.ts  |  4 +-
 .../doc/components/output-list.component.html | 12 ++++++
 .../doc/components/output-list.component.ts   | 35 ++++++++++++++++
 .../doc/containers/doc.component.html         | 42 ++-----------------
 4 files changed, 54 insertions(+), 39 deletions(-)
 create mode 100644 client/src/app/instance/doc/components/output-list.component.html
 create mode 100644 client/src/app/instance/doc/components/output-list.component.ts

diff --git a/client/src/app/instance/doc/components/index.ts b/client/src/app/instance/doc/components/index.ts
index 3da0e084..a4c97d3a 100644
--- a/client/src/app/instance/doc/components/index.ts
+++ b/client/src/app/instance/doc/components/index.ts
@@ -1,7 +1,9 @@
 import { DatasetByFamilyComponent } from './dataset-by-family.component';
 import { DatasetCardDocComponent } from './dataset-card-doc.component';
+import { OutputListComponent } from "./output-list.component";
 
 export const dummiesComponents = [
     DatasetByFamilyComponent,
-    DatasetCardDocComponent
+    DatasetCardDocComponent,
+    OutputListComponent
 ];
diff --git a/client/src/app/instance/doc/components/output-list.component.html b/client/src/app/instance/doc/components/output-list.component.html
new file mode 100644
index 00000000..14fa0ec4
--- /dev/null
+++ b/client/src/app/instance/doc/components/output-list.component.html
@@ -0,0 +1,12 @@
+<h4>Available outputs for {{ datasetSelected }}</h4>
+
+<table id="table" class="attributes-table p-0">
+    <tr>
+        <th>id</th>
+        <th>attribute</th>
+    </tr>
+    <tr *ngFor="let attribute of attributeList">
+        <td>{{ attribute.id }}</td>
+        <td>{{ attribute.name }}</td>
+    </tr>
+</table>
diff --git a/client/src/app/instance/doc/components/output-list.component.ts b/client/src/app/instance/doc/components/output-list.component.ts
new file mode 100644
index 00000000..9b32769d
--- /dev/null
+++ b/client/src/app/instance/doc/components/output-list.component.ts
@@ -0,0 +1,35 @@
+/**
+ * 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, Input, ChangeDetectionStrategy } from '@angular/core';
+import { Router } from '@angular/router';
+
+import {Survey, Dataset, Attribute} from 'src/app/metamodel/models';
+
+@Component({
+    selector: 'app-output-list',
+    templateUrl: 'output-list.component.html',
+    styleUrls: ['../doc.component.scss'],
+    changeDetection: ChangeDetectionStrategy.OnPush
+})
+/**
+ * @class
+ * @classdesc Documentation output list component.
+ */
+export class OutputListComponent {
+    @Input() datasetSelected: string;
+    @Input() attributeList: Attribute[];
+
+    // constructor(private router: Router) { }
+    //
+    // selectDataset(datasetName: string) {
+    //     this.router.routeReuseStrategy.shouldReuseRoute = () => false;
+    //     this.router.navigate([`/instance/${this.instanceSelected}/doc/${datasetName}`]);
+    // }
+}
diff --git a/client/src/app/instance/doc/containers/doc.component.html b/client/src/app/instance/doc/containers/doc.component.html
index d241add0..34896c68 100644
--- a/client/src/app/instance/doc/containers/doc.component.html
+++ b/client/src/app/instance/doc/containers/doc.component.html
@@ -28,44 +28,10 @@
                     <blockquote>c=3::eq::ping;2::eq::pong</blockquote>
                 </ul>
 
-                <h4>Available parameters</h4>
-
-<!--                <h5>Datasets</h5>-->
-<!--                <div *ngIf="datasetListIsLoading | async">-->
-<!--                    <span class="fas fa-circle-notch fa-spin fa-3x"></span>-->
-<!--                    <span class="sr-only">Loading...</span>-->
-<!--                </div>-->
-<!--                <table *ngIf="datasetListIsLoaded | async" id="table">-->
-<!--                    <tr>-->
-<!--                        <th>Dataset</th>-->
-<!--                        <th>Description</th>-->
-<!--                    </tr>-->
-<!--                    <tr *ngFor="let dataset of datasetList | async">-->
-<!--                        <td>{{ dataset.name }}</td>-->
-<!--                        <td>{{ dataset.description }}</td>-->
-<!--                    </tr>-->
-<!--                </table>-->
-
-                <!-- <h5>Outputs</h5>
-                <div *ngIf="attributeListsIsLoading | async">
-                    <span class="fas fa-circle-notch fa-spin fa-3x"></span>
-                    <span class="sr-only">Loading...</span>
-                </div>
-                <div *ngIf="attributeListsIsLoaded | async" class="row">
-                    <div *ngFor="let dataset of datasetList | async" class="col-auto mb-5">
-                        <h6>{{ dataset.label }} output list</h6>
-                            <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> -->
+                <app-output-list
+                    [datasetSelected]="datasetSelected | async"
+                    [attributeList]="attributeList | async"
+                ></app-output-list>
 
                 <h5>Operators</h5>
                 <table id="table">
-- 
GitLab