diff --git a/BUILD.md b/BUILD.md index e2ea1f6f..69bf6fce 100644 --- a/BUILD.md +++ b/BUILD.md @@ -2,7 +2,7 @@ The project includes three components: -- [**_annotation-app_**](./annotation-app): Angular application built with [Angular 8.x](https://angular.io/guide/router-tutorial) +- [**_annotation-app_**](./annotation-app): Angular application built with [Angular v11](https://angular.io/docs) - [**_annotation-service_**](./annotation-service): Backend services built with [Node](https://nodejs.org/en/), [mongodb](https://www.mongodb.com/download-center/community), [express](https://www.npmjs.com/package/express) - [**_active-learning-service_**](./active-learning-service): Django application providing active learning api built with [Python](https://www.python.org/downloads/) and [Django](https://www.djangoproject.com/) and [modAL](https://modal-python.readthedocs.io/en/latest/#) library for pool-based uncertainty sampling to rank the unlabelled data diff --git a/annotation-app/Dockerfile b/annotation-app/Dockerfile index 7625c179..baa42670 100644 --- a/annotation-app/Dockerfile +++ b/annotation-app/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2019-2021 VMware, Inc. +# Copyright 2019-2022 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 ### STAGE 1: Build ### diff --git a/annotation-app/docker-entrypoint.sh b/annotation-app/docker-entrypoint.sh index 804b92c3..34f6f6af 100644 --- a/annotation-app/docker-entrypoint.sh +++ b/annotation-app/docker-entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2019-2021 VMware, Inc. +# Copyright 2019-2022 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 ## Substitutes env variables in main.*.js bundle diff --git a/annotation-app/package-lock.json b/annotation-app/package-lock.json index ed39b945..1a83b364 100644 --- a/annotation-app/package-lock.json +++ b/annotation-app/package-lock.json @@ -34,7 +34,7 @@ "lodash": "4.17.21", "marked": "2.1.3", "mutationobserver-shim": "0.3.2", - "ngx-papaparse": "^5.1.0", + "ngx-papaparse": "~5.1.0", "pako": "~2.0.3", "rxjs": "6.6.7", "tslib": "^2.0.0", diff --git a/annotation-app/src/app/app.component.html b/annotation-app/src/app/app.component.html index 954d3518..1e90acf4 100644 --- a/annotation-app/src/app/app.component.html +++ b/annotation-app/src/app/app.component.html @@ -1,4 +1,4 @@ - diff --git a/annotation-app/src/app/app.component.scss b/annotation-app/src/app/app.component.scss index d85f74f5..7cf53622 100644 --- a/annotation-app/src/app/app.component.scss +++ b/annotation-app/src/app/app.component.scss @@ -1,4 +1,4 @@ /* -Copyright 2019-2021 VMware, Inc. +Copyright 2019-2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0 */ diff --git a/annotation-app/src/app/app.component.ts b/annotation-app/src/app/app.component.ts index bc181956..4ba00382 100644 --- a/annotation-app/src/app/app.component.ts +++ b/annotation-app/src/app/app.component.ts @@ -1,5 +1,5 @@ /* -Copyright 2019-2021 VMware, Inc. +Copyright 2019-2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0 */ diff --git a/annotation-app/src/app/app.module.ts b/annotation-app/src/app/app.module.ts index df57cab0..7b337e94 100644 --- a/annotation-app/src/app/app.module.ts +++ b/annotation-app/src/app/app.module.ts @@ -1,5 +1,5 @@ /* -Copyright 2019-2021 VMware, Inc. +Copyright 2019-2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0 */ diff --git a/annotation-app/src/app/app.routing.ts b/annotation-app/src/app/app.routing.ts index baeb9bfe..e1bbcd37 100644 --- a/annotation-app/src/app/app.routing.ts +++ b/annotation-app/src/app/app.routing.ts @@ -1,5 +1,5 @@ /* -Copyright 2019-2021 VMware, Inc. +Copyright 2019-2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0 */ diff --git a/annotation-app/src/app/components/admin/admin.component.html b/annotation-app/src/app/components/admin/admin.component.html index 26ebe6d6..11de0be2 100644 --- a/annotation-app/src/app/components/admin/admin.component.html +++ b/annotation-app/src/app/components/admin/admin.component.html @@ -1,4 +1,4 @@ -
diff --git a/annotation-app/src/app/components/admin/admin.component.scss b/annotation-app/src/app/components/admin/admin.component.scss index da1016f4..40f01fda 100644 --- a/annotation-app/src/app/components/admin/admin.component.scss +++ b/annotation-app/src/app/components/admin/admin.component.scss @@ -1,5 +1,5 @@ /* -Copyright 2019-2021 VMware, Inc. +Copyright 2019-2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0 */ diff --git a/annotation-app/src/app/components/admin/admin.component.ts b/annotation-app/src/app/components/admin/admin.component.ts index cefa81ab..16c4d903 100644 --- a/annotation-app/src/app/components/admin/admin.component.ts +++ b/annotation-app/src/app/components/admin/admin.component.ts @@ -1,5 +1,5 @@ /* -Copyright 2019-2021 VMware, Inc. +Copyright 2019-2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0 */ @@ -350,7 +350,7 @@ export class AdminComponent implements OnInit { generateDoneTime: res.updateTime, format: res.format, downloadUrl: this.env.config.enableAWSS3 - ? new Buffer(res.file, 'base64').toString() + ? Buffer.from(res.file, 'base64').toString() : res.file, datasets: this.datasets, id: e.id, @@ -542,7 +542,7 @@ export class AdminComponent implements OnInit { this.infoMessage = 'Dataset with annotations is already been generated. Please refresh the page.'; this.downloadUrl = this.env.config.enableAWSS3 - ? new Buffer(e.Body.file, 'base64').toString() + ? Buffer.from(e.Body.file, 'base64').toString() : e.Body.file; this.downloadProject(); this.getProjects(); diff --git a/annotation-app/src/app/components/authentication/authentication.component.html b/annotation-app/src/app/components/authentication/authentication.component.html index 95bb7cf6..3cb3e9fc 100644 --- a/annotation-app/src/app/components/authentication/authentication.component.html +++ b/annotation-app/src/app/components/authentication/authentication.component.html @@ -1,4 +1,4 @@ -
diff --git a/annotation-app/src/app/components/authentication/authentication.component.ts b/annotation-app/src/app/components/authentication/authentication.component.ts index 0e0e9d10..7963ac20 100644 --- a/annotation-app/src/app/components/authentication/authentication.component.ts +++ b/annotation-app/src/app/components/authentication/authentication.component.ts @@ -1,5 +1,5 @@ /* -Copyright 2019-2021 VMware, Inc. +Copyright 2019-2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0 */ diff --git a/annotation-app/src/app/components/datasets-sharing/datasets-sharing.component.html b/annotation-app/src/app/components/datasets-sharing/datasets-sharing.component.html index 5c99006d..6a3cb380 100644 --- a/annotation-app/src/app/components/datasets-sharing/datasets-sharing.component.html +++ b/annotation-app/src/app/components/datasets-sharing/datasets-sharing.component.html @@ -1,4 +1,4 @@ -
diff --git a/annotation-app/src/app/components/datasets-sharing/datasets-sharing.component.scss b/annotation-app/src/app/components/datasets-sharing/datasets-sharing.component.scss index fb056e85..e2e12ee1 100644 --- a/annotation-app/src/app/components/datasets-sharing/datasets-sharing.component.scss +++ b/annotation-app/src/app/components/datasets-sharing/datasets-sharing.component.scss @@ -1,5 +1,5 @@ /* -Copyright 2019-2021 VMware, Inc. +Copyright 2019-2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0 */ diff --git a/annotation-app/src/app/components/datasets-sharing/datasets-sharing.component.ts b/annotation-app/src/app/components/datasets-sharing/datasets-sharing.component.ts index d3567fa8..29bc3df0 100644 --- a/annotation-app/src/app/components/datasets-sharing/datasets-sharing.component.ts +++ b/annotation-app/src/app/components/datasets-sharing/datasets-sharing.component.ts @@ -1,5 +1,5 @@ /* -Copyright 2019-2021 VMware, Inc. +Copyright 2019-2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0 */ @@ -137,7 +137,7 @@ export class DatasetsSharingComponent implements OnInit { latestAnnotationTime: e.updatedDate, generateDoneTime: res.updateTime, downloadUrl: this.env.config.enableAWSS3 - ? new Buffer(res.file, 'base64').toString() + ? Buffer.from(res.file, 'base64').toString() : res.file, datasets: this.datasets, id: e.id, @@ -187,7 +187,7 @@ export class DatasetsSharingComponent implements OnInit { this.infoMessage = 'Dataset with annotations is already been generated. Please refresh the page.'; this.downloadUrl = this.env.config.enableAWSS3 - ? new Buffer(e.Body.file, 'base64').toString() + ? Buffer.from(e.Body.file, 'base64').toString() : e.Body.file; this.downloadProject(); this.getProjects(); diff --git a/annotation-app/src/app/components/edit-project/edit-project.component.html b/annotation-app/src/app/components/edit-project/edit-project.component.html index 55f7ba93..bcd9dcbb 100644 --- a/annotation-app/src/app/components/edit-project/edit-project.component.html +++ b/annotation-app/src/app/components/edit-project/edit-project.component.html @@ -1,4 +1,4 @@ -
+ + + + + {{inputLabelErrMsg}} + + 0) { + if (this.msg.assignSlackChannels && this.msg.assignSlackChannels.length > 0) { this.slackList = this.msg.assignSlackChannels; this.msg.assignSlackChannels.forEach((element) => { this.inputSlackChannels.push(element.slackName); @@ -541,8 +542,15 @@ export class EditProjectComponent implements OnInit { } onEnterLabel(e) { - if (e && this.inputLabelValidation == false) { - const flag = { status: 'new', originalLabel: e, editLabel: e }; + // to check format comma + if (/[,,]/g.test(e.trim())) { + this.inputLabelErrMsg = 'Wrong format! Not allow comma.'; + return; + } else { + this.inputLabelErrMsg = ''; + } + if (e && this.inputLabelValidation == false && !this.inputLabelErrMsg) { + const flag = { status: 'new', originalLabel: e.trim(), editLabel: e.trim() }; this.categoryList.push(flag); this.inputNewLabel = null; } @@ -554,7 +562,7 @@ export class EditProjectComponent implements OnInit { onLabelKeyUp(e) { for (let i = 0; i < this.categoryList.length; i++) { - if (this.categoryList[i].editLabel == e.target.value) { + if (this.categoryList[i].editLabel == e.target.value.trim()) { this.inputLabelValidation = true; return; } else { @@ -578,9 +586,10 @@ export class EditProjectComponent implements OnInit { this.activeClickInput = null; } - if (e.editLabel == '' || this.inputLabelValidation == true) { + if (e.editLabel == '' || this.inputLabelValidation == true || this.inputLabelErrMsg) { this.activeClickInput = null; e.editLabel = e.originalLabel; + this.inputLabelErrMsg = ''; } } @@ -595,7 +604,7 @@ export class EditProjectComponent implements OnInit { }); let i = 0; flag.forEach((element) => { - if (element == e) { + if (element == e.trim()) { i = i + 1; } }); @@ -604,6 +613,13 @@ export class EditProjectComponent implements OnInit { } else { this.inputLabelValidation = false; } + // to check format comma + if (/[,,]/g.test(e.trim())) { + this.inputLabelErrMsg = 'Wrong format! Not allow comma.'; + return; + } else { + this.inputLabelErrMsg = ''; + } } minUpdate(e) { diff --git a/annotation-app/src/app/components/faq/faq.component.html b/annotation-app/src/app/components/faq/faq.component.html index 2d6d5920..1f08ed1e 100644 --- a/annotation-app/src/app/components/faq/faq.component.html +++ b/annotation-app/src/app/components/faq/faq.component.html @@ -1,4 +1,4 @@ -
diff --git a/annotation-app/src/app/components/faq/faq.component.scss b/annotation-app/src/app/components/faq/faq.component.scss index 5d971ab8..ed421ff0 100644 --- a/annotation-app/src/app/components/faq/faq.component.scss +++ b/annotation-app/src/app/components/faq/faq.component.scss @@ -1,5 +1,5 @@ /* -Copyright 2019-2021 VMware, Inc. +Copyright 2019-2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0 */ diff --git a/annotation-app/src/app/components/faq/faq.component.ts b/annotation-app/src/app/components/faq/faq.component.ts index 07c18157..4809d413 100644 --- a/annotation-app/src/app/components/faq/faq.component.ts +++ b/annotation-app/src/app/components/faq/faq.component.ts @@ -1,5 +1,5 @@ /* -Copyright 2019-2021 VMware, Inc. +Copyright 2019-2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0 */ diff --git a/annotation-app/src/app/components/footer/footer.component.html b/annotation-app/src/app/components/footer/footer.component.html index 84d63607..7d38a41e 100644 --- a/annotation-app/src/app/components/footer/footer.component.html +++ b/annotation-app/src/app/components/footer/footer.component.html @@ -1,4 +1,4 @@ -