Skip to content

Commit

Permalink
Feature enhancement and issue fix (#440)
Browse files Browse the repository at this point in the history
* remove empty followUps && historyBack validation && references display more clear && clear unnecessary console && init new qa data

* init filter

* init enable qachat create with or without csv

* init qachat append csv

* fix some issue
  • Loading branch information
rekeyz authored Apr 8, 2024
1 parent 3984a45 commit 7b0c444
Show file tree
Hide file tree
Showing 26 changed files with 1,010 additions and 239 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>
<cds-icon shape="close"></cds-icon>
</button>
<h3 class="modal-title">Create New Dataset</h3>
<h3 class="modal-title">Upload New Dataset</h3>
</div>
<div class="modal-body">
<app-create-new-dataset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="container">
<div class="clr-row">
<div class="clr-col-8">
<h2 class="h2Title">Create New Dataset</h2>
<h2 class="h2Title">Upload New Dataset</h2>
<app-create-new-dataset
[msg]="msg"
(outFormData)="receiveOutFormData($event)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2019-2023 VMware, Inc.
Copyright 2019-2024 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -156,56 +156,6 @@ export class CreateNewDatasetComponent implements OnInit, OnChanges {
}
}

// papaParse() {
// const previewData = [];
// const hasHeader = this.uploadGroup.get('hasHeader').value === 'yes' ? true : false;
// if (this.uploadGroup.get('localFile').value) {
// this.unZipService.parseCSVChunk(this.uploadGroup.get('localFile').value, hasHeader, false).then((res) => {
// console.log(151, res);
// this.previewHeadDatas = res.previewHeadDatas;
// this.previewContentDatas = res.topReview;
// });
// // return new Promise((resolve, reject) => {
// // this.papa.parse(this.uploadGroup.get('localFile').value, {
// // header: false,
// // // preview: 20,
// // dynamicTyping: true,
// // skipEmptyLines: true,
// // error: (error) => {
// // console.log('parse_error: ', error);
// // },
// // step: (results, parser) => {
// // // check csv headers is empty.
// // if (hasHeader === 'yes') {
// // const data = results.data.map((item) => item && String(item).trim());
// // if (_.sortedUniq(data).includes(null) || _.sortedUniq(data).includes('')) {
// // reject(false);
// // }
// // }
// // if (!(_.sortedUniq(results.data).length == 1 && _.sortedUniq(results.data)[0] == null)) {
// // previewData.push(results.data);
// // }
// // if (previewData.length < 7) {
// // this.previewHeadDatas = [];
// // if (hasHeader == 'yes') {
// // this.previewHeadDatas = previewData[0];
// // this.previewContentDatas = previewData.slice(1, 6);
// // // resolve(null);
// // } else {
// // for (let i = 0; i < previewData[0].length; i++) {
// // this.previewHeadDatas.push('Header' + i);
// // }
// // this.previewContentDatas = previewData.slice(0, 5);
// // // resolve(null);
// // }
// // }
// // },

// // });
// // });
// }
// }

toPostDatasets(uploadFormat, formData, params): void {
let postData;
if (this.env.config.enableAWSS3) {
Expand Down Expand Up @@ -435,21 +385,6 @@ export class CreateNewDatasetComponent implements OnInit, OnChanges {
return;
});
}

// this.papaParse()
// .then((e) => {
// if (this.env.config.enableAWSS3) {
// this.uploadToS3(inputFile);
// } else {
// this.updateDatasets('data');
// }
// })
// .catch((err) => {
// console.log(err);
// this.errorMessage = JSON.stringify(err);
// this.outUploadDoneEmitter.emit('no');
// return;
// });
}
if (this.uploadGroup.get('fileFormat').value == 'image') {
if (this.env.config.enableAWSS3) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,20 @@ <h6>Creating a labeling Task</h6>
*ngIf="dataset.format === 'csv' || dataset.format === 'tabular'"
class="dropdown-item"
(click)="createLabelingTask('qa')"
>Question Answer</a
>Question Answer Extraction</a
>
<a *ngIf="dataset.format === 'image'" class="dropdown-item" (click)="createLabelingTask('image')"
>Image Classification</a
>
<a *ngIf="dataset.format === 'txt'" class="dropdown-item" (click)="createLabelingTask('log')"
>Log Classification</a
>
<a
*ngIf="dataset.format === 'csv' || dataset.format === 'tabular'"
class="dropdown-item"
(click)="createLabelingTask('qaChat')"
>Question Answer Conversational</a
>
</clr-dropdown-menu>
</clr-dropdown>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ <h2 class="h2Title">Datasets List</h2>
<div title="Refresh Table" class="refreshBtn" (click)="reload()">
<cds-icon shape="refresh"></cds-icon> &nbsp;REFRESH
</div>
<button class="btn btn-primary" (click)="onAddingDataset()">Create New Dataset</button>
<button class="btn btn-primary" (click)="onAddingDataset()">Upload New Dataset</button>
</div>
</div>
<clr-tabs>
<clr-tab>
<button clrTabLink id="link1" (click)="clickTab(1)">My Datasets ({{ totalItems }})</button>
<clr-tab-content id="content1" *clrIfActive="currentTab == 1 ">
<clr-tab-content id="content1" *clrIfActive="currentTab == 1">
<clr-datagrid [clrDgLoading]="loading" class="gridHeight">
<clr-dg-placeholder>We couldn't find any dataset for you!</clr-dg-placeholder>
<clr-dg-column [clrDgField]="'dataSetName'" class="ellipsis-datagrid">Dataset Name </clr-dg-column>
Expand Down Expand Up @@ -119,7 +119,7 @@ <h2 class="h2Title">Datasets List</h2>
<ng-container *clrDgHideableColumn="{ hidden: true }">Project Creator</ng-container>
</clr-dg-column>
<clr-dg-column [clrDgField]="'shareDescription'" class="ellipsis-datagrid">Description </clr-dg-column>
<clr-dg-column [clrDgField]="'updatedDate'" class="ellipsis-datagrid">
<clr-dg-column [clrDgField]="'updatedDate'" class="ellipsis-datagrid">
<ng-container *clrDgHideableColumn="{ hidden: true }">Updated Date </ng-container
><clr-dg-string-filter [clrDgStringFilter]="updateTimeFilter"></clr-dg-string-filter>
</clr-dg-column>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ <h5>Annotator Review Progress</h5>
<label class="clr-col-3 keepAllWord" title="{{ item.fullName }}">{{ item.fullName }}</label>
<div class="clr-col">
<clr-progress-bar
*ngIf="msg?.projectInfo.projectType != 'qaChat'"
title="Annotation progress: (annotated tickets / assigned tickets)%"
clrValue="{{ (item.completeCase / (item.assignedCase == 0 ? 1 : item.assignedCase)) * 100 }}"
clrLabeled
Expand Down
Loading

0 comments on commit 7b0c444

Please sign in to comment.