@@ -181,12 +177,12 @@
-
+
green
-
+
{{result.accessRoute}}
@@ -202,12 +198,26 @@
+
+ 0" class="uk-grid uk-grid-small uk-child-width-1-2@m uk-child-width-1-3@l uk-margin-top" uk-grid>
+
+
+ 0 && allIds.length == 0" class="uk-alert uk-alert-warning">
+ No valid DOIs extracted from the file. Please check the file format. The format should be one DOI per row.
+
+
+
-
+
{{foundIds.length}} results found
+ 0 && showFound">
Open Access {{stats['open']}} ({{getercentage(stats['open'])}}%)
@@ -225,11 +235,12 @@
Diamond OA {{stats['diamond']}} ({{getercentage(stats['diamond'])}}%)
+
-
- 0" class="uk-flex uk-flex-middle">
+
+
-
+
Valid
@@ -245,7 +256,7 @@
-->
0" class="uk-flex uk-flex-middle">
-
+
Duplicates
@@ -262,7 +273,7 @@
-
+
diff --git a/src/app/upload-dois/upload-dois.component.ts b/src/app/upload-dois/upload-dois.component.ts
index 031cd7d..cd180bc 100644
--- a/src/app/upload-dois/upload-dois.component.ts
+++ b/src/app/upload-dois/upload-dois.component.ts
@@ -135,22 +135,26 @@ export class UploadDoisComponent implements OnInit {
}
for (let i = 0; i < (rows.length); i++) {
if (rows[i] && rows[i] != null && rows[i] != "") {
- const values = rows[i].split(',');
+ try {
+ const values = rows[i].split(',');
- let id = this.removeDoubleQuotes(values[0]);
- if (DOI.isValidDOI(id)) {
- id = Identifier.getRawDOIValue(id);
- // console.log(id, id.split("\r")[0]);
- id = id.split("\r")[0]
- if (this.allIds.indexOf(id) > -1) {
- this.duplicateIds.push(id);
- this.duplicateIdsRow.push(i + 1);
+ let id = this.removeDoubleQuotes(values[0]);
+ if (DOI.isValidDOI(id)) {
+ id = Identifier.getRawDOIValue(id);
+ // console.log(id, id.split("\r")[0]);
+ id = id.split("\r")[0]
+ if (this.allIds.indexOf(id) > -1) {
+ this.duplicateIds.push(id);
+ this.duplicateIdsRow.push(i + 1);
+ } else {
+ this.allIds.push(id);
+ }
} else {
- this.allIds.push(id);
+ this.noValidIds.push(id);
+ this.noValidIdsRow.push(i + 1);
}
- } else {
- this.noValidIds.push(id);
- this.noValidIdsRow.push(i + 1);
+ }catch (e){
+ invalid_rows++;
}
} else {
invalid_rows++;
@@ -161,7 +165,11 @@ export class UploadDoisComponent implements OnInit {
if(properties.logServiceUrl) {
this.subscriptions.push(this._logService.logUploadDOIs(properties, this.allIds.length).subscribe(res => { }));
}
- this.fetchAllResults();
+ if(this.allIds.length > 0) {
+ this.fetchAllResults();
+ }else{
+ this.loading = false;
+ }
}, (error) => {
this.enableUpload = true;
this.errorMessage = "An error occured.";
@@ -251,7 +259,7 @@ export class UploadDoisComponent implements OnInit {
};
this.results.push(showRes)
this.addStatsPerResult(showRes)
- console.log(showRes, this.stats)
+ // console.log(showRes, this.stats)
}
if (data[0] < dois.length) {
for (let doi of dois) {
|