pingsutw commented on a change in pull request #779:
URL: https://github.com/apache/submarine/pull/779#discussion_r729939537



##########
File path: 
submarine-workbench/workbench-web/src/app/pages/workbench/model/model-home/model-home.component.ts
##########
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Component, OnInit, ViewChild } from '@angular/core';
+// import { ExperimentTemplate } from 
'@submarine/interfaces/experiment-template';
+import { ModelInfo } from '@submarine/interfaces/model-info';
+import { ExperimentService } from '@submarine/services/experiment.service';
+// import { TemplateFormComponent } from 
'./template-form/template-form.component';

Review comment:
       Remove?

##########
File path: 
submarine-workbench/workbench-web/src/app/pages/workbench/model/model-home/model-cards/model-card/model-card.component.ts
##########
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Component, Input, OnInit } from '@angular/core';
+import { ModelInfo } from '@submarine/interfaces/model-info';
+// import { ExperimentTemplate } from 
'@submarine/interfaces/experiment-template';

Review comment:
       Remove?

##########
File path: 
submarine-workbench/workbench-web/src/app/pages/workbench/model/model-home/model-home.component.ts
##########
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Component, OnInit, ViewChild } from '@angular/core';
+// import { ExperimentTemplate } from 
'@submarine/interfaces/experiment-template';
+import { ModelInfo } from '@submarine/interfaces/model-info';
+import { ExperimentService } from '@submarine/services/experiment.service';
+// import { TemplateFormComponent } from 
'./template-form/template-form.component';
+
+@Component({
+  selector: 'submarine-model-home',
+  templateUrl: './model-home.component.html',
+  styleUrls: ['./model-home.component.scss'],
+})
+export class ModelHomeComponent implements OnInit {
+  constructor(private experimentService: ExperimentService) {}
+
+  modelCards: ModelInfo[];
+
+  onDisplayModelCards = [];
+  
+  nameForFilter = "";
+  listOfTagsOption: Array<{ label: string; value: string }> = [];
+  listOfChosenTags = [];
+
+//   @ViewChild('form', { static: true }) form: TemplateFormComponent;
+
+  ngOnInit() {
+    this.modelCards = [
+      {
+        'name': "Model One",
+        'createTime': "2021-10-12",
+        'updatedTime': "2021-10-13", 
+        'tags': ["image", 'text'],
+        'description': "first model",
+      }, 
+      {
+        'name': "Model Two",
+        'createTime': "2021-10-12",
+        'updatedTime': "2021-10-13", 
+        'tags': ["speech"],
+        'description': "second model",
+      },
+      {
+        'name': "Model Three",
+        'createTime': "2021-10-12",
+        'updatedTime': "2021-10-13", 
+        'tags': ["speech"],
+        'description': "The third model has very long description for 
description shorten testing, 1234567890 A recurrent neural network (RNN) is a 
class of artificial neural networks where connections between nodes form a 
directed graph along a temporal sequence. This allows it to exhibit temporal 
dynamic behavior. Derived from feedforward neural networks, RNNs can use their 
internal state (memory) to process variable length sequences of inputs",
+      },
+    ];
+    
+    this.onDisplayModelCards = this.modelCards.map(card => card);
+    let tags = [];
+    this.modelCards.map((card) => {
+      Array.prototype.push.apply(tags, card.tags);
+    })
+    let tags_set = new Set(tags);
+    tags = Array.from(tags_set);
+    this.listOfTagsOption = tags.map((tag) => ({ "label": String(tag), 
"value": String(tag)}))
+    // this.fetchTemplateList();
+  }
+
+  searchModel(event: any) {
+    this.nameForFilter = event.target.value;
+    this.changeDisplayModelCards();
+  }
+  
+  filterByTags() {
+    this.changeDisplayModelCards();
+  }
+
+  changeDisplayModelCards() {
+    this.onDisplayModelCards = this.modelCards.filter((card) => 
card.name.toLowerCase().includes(this.nameForFilter.toLowerCase()));
+    this.onDisplayModelCards = this.onDisplayModelCards.filter((card) => {
+      for (let chosenTag of this.listOfChosenTags) {
+        if (!card.tags.includes(chosenTag)) return false;
+      }
+      return true;
+    })
+  }
+
+
+//   fetchTemplateList() {
+//     this.experimentService.fetchExperimentTemplateList().subscribe((res) => 
{
+//       this.templateList = res;
+//     });
+//   }
+
+//   updateTemplateList(msg: string) {
+//     this.fetchTemplateList();
+//   }
+}

Review comment:
       Remove?

##########
File path: 
submarine-workbench/workbench-web/src/app/pages/workbench/model/model-home/model-cards/model-cards.component.ts
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Component, Input, OnInit } from '@angular/core';
+import { ModelInfo } from '@submarine/interfaces/model-info';
+// import { ExperimentTemplate } from 
'@submarine/interfaces/experiment-template';

Review comment:
       Remove?

##########
File path: 
submarine-workbench/workbench-web/src/app/pages/workbench/model/model-home/model-cards/model-cards.component.html
##########
@@ -0,0 +1,36 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<!-- <nz-list-item>
+  <nz-card style="width:300px;" nzTitle={{card.name}} 
[nzExtra]="extraTemplate">
+    <p>Created: {{card.createTime}}</p>
+    <p>Updated: {{card.updatedTime}}</p>
+    <p>Tags: 
+      <nz-tag *ngFor="let tag of card.tags">{{tag}}</nz-tag>
+    </p>
+    <p >Description: {{card.description}}</p>
+  </nz-card>
+</nz-list-item> -->

Review comment:
       Remove?

##########
File path: 
submarine-workbench/workbench-web/src/app/pages/workbench/model/model-home/model-home.component.ts
##########
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Component, OnInit, ViewChild } from '@angular/core';
+// import { ExperimentTemplate } from 
'@submarine/interfaces/experiment-template';
+import { ModelInfo } from '@submarine/interfaces/model-info';
+import { ExperimentService } from '@submarine/services/experiment.service';
+// import { TemplateFormComponent } from 
'./template-form/template-form.component';
+
+@Component({
+  selector: 'submarine-model-home',
+  templateUrl: './model-home.component.html',
+  styleUrls: ['./model-home.component.scss'],
+})
+export class ModelHomeComponent implements OnInit {
+  constructor(private experimentService: ExperimentService) {}
+
+  modelCards: ModelInfo[];
+
+  onDisplayModelCards = [];
+  
+  nameForFilter = "";
+  listOfTagsOption: Array<{ label: string; value: string }> = [];
+  listOfChosenTags = [];
+
+//   @ViewChild('form', { static: true }) form: TemplateFormComponent;
+
+  ngOnInit() {
+    this.modelCards = [
+      {
+        'name': "Model One",
+        'createTime': "2021-10-12",
+        'updatedTime': "2021-10-13", 
+        'tags': ["image", 'text'],
+        'description': "first model",
+      }, 
+      {
+        'name': "Model Two",
+        'createTime': "2021-10-12",
+        'updatedTime': "2021-10-13", 
+        'tags': ["speech"],
+        'description': "second model",
+      },
+      {
+        'name': "Model Three",
+        'createTime': "2021-10-12",
+        'updatedTime': "2021-10-13", 
+        'tags': ["speech"],
+        'description': "The third model has very long description for 
description shorten testing, 1234567890 A recurrent neural network (RNN) is a 
class of artificial neural networks where connections between nodes form a 
directed graph along a temporal sequence. This allows it to exhibit temporal 
dynamic behavior. Derived from feedforward neural networks, RNNs can use their 
internal state (memory) to process variable length sequences of inputs",
+      },
+    ];
+    
+    this.onDisplayModelCards = this.modelCards.map(card => card);
+    let tags = [];
+    this.modelCards.map((card) => {
+      Array.prototype.push.apply(tags, card.tags);
+    })
+    let tags_set = new Set(tags);
+    tags = Array.from(tags_set);
+    this.listOfTagsOption = tags.map((tag) => ({ "label": String(tag), 
"value": String(tag)}))
+    // this.fetchTemplateList();

Review comment:
       Remove?

##########
File path: 
submarine-workbench/workbench-web/src/app/pages/workbench/model/model-home/model-home.component.ts
##########
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Component, OnInit, ViewChild } from '@angular/core';
+// import { ExperimentTemplate } from 
'@submarine/interfaces/experiment-template';

Review comment:
       Remove?

##########
File path: 
submarine-workbench/workbench-web/src/app/pages/workbench/model/model-home/model-home.component.html
##########
@@ -0,0 +1,46 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<div style="margin: 15px; padding: 15px; background-color: white">
+  <div align="right">
+    <button
+      nz-button
+      id="btn-newModel"
+      nzType="primary"
+      style="margin: 10px 4px 10px 4px"
+    >
+      <i nz-icon nzType="plus"></i>
+      New Model
+    </button>
+  </div>
+  <div align='left'>
+    <nz-input-group nzSearch style="width: 265px; margin: 10px 4px 10px 4px" 
[nzAddOnAfter]="suffixIconButton">
+      <input type="text" nz-input placeholder="Search by model name..." 
(keyup)="searchModel($event)" />
+    </nz-input-group>
+    <ng-template #suffixIconButton>
+      <button nz-button nzType="primary" nzSearch><i nz-icon 
nzType="search"></i></button>
+    </ng-template>
+    <nz-select nzMode="tags" style="width: 265px; margin: 10px 4px 10px 12px" 
nzPlaceHolder="Search by tags" [(ngModel)]="listOfChosenTags" 
(ngModelChange)="filterByTags()">
+      <nz-option *ngFor="let option of listOfTagsOption" 
[nzLabel]="option.label" [nzValue]="option.value"></nz-option>
+    </nz-select>
+  </div>
+  <submarine-model-cards 
[modelCards]="onDisplayModelCards"></submarine-model-cards>
+  <!-- <submarine-template-form #form 
(updater)="updateTemplateList($event)"></submarine-template-form> -->

Review comment:
       Remove?

##########
File path: 
submarine-workbench/workbench-web/src/app/pages/workbench/model/model-home/model-home.component.ts
##########
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Component, OnInit, ViewChild } from '@angular/core';
+// import { ExperimentTemplate } from 
'@submarine/interfaces/experiment-template';
+import { ModelInfo } from '@submarine/interfaces/model-info';
+import { ExperimentService } from '@submarine/services/experiment.service';
+// import { TemplateFormComponent } from 
'./template-form/template-form.component';
+
+@Component({
+  selector: 'submarine-model-home',
+  templateUrl: './model-home.component.html',
+  styleUrls: ['./model-home.component.scss'],
+})
+export class ModelHomeComponent implements OnInit {
+  constructor(private experimentService: ExperimentService) {}
+
+  modelCards: ModelInfo[];
+
+  onDisplayModelCards = [];
+  
+  nameForFilter = "";
+  listOfTagsOption: Array<{ label: string; value: string }> = [];
+  listOfChosenTags = [];
+
+//   @ViewChild('form', { static: true }) form: TemplateFormComponent;

Review comment:
       Remove?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to