Skip to content

Commit

Permalink
Merge branch 'mpox-rename' of https://github.com/cidgoh/DataHarmonizer
Browse files Browse the repository at this point in the history
…into mpox-rename
  • Loading branch information
kennethbruskiewicz committed Nov 9, 2023
2 parents fdddbe6 + 1008cad commit a59b629
Show file tree
Hide file tree
Showing 12 changed files with 528 additions and 504 deletions.
46 changes: 40 additions & 6 deletions lib/DataHarmonizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,11 @@ class DataHarmonizer {
rowHeaders: true,
copyPaste: true,
manualColumnResize: true,

//colWidths: [100], //Just fixes first column width
beforePaste: (data, coords) => {
//data is a 2d array of rows and columns
},
afterCopy: function (changes) {
self.clipboardCache = self.sheetclip.stringify(changes);
},
Expand All @@ -507,18 +511,48 @@ class DataHarmonizer {
key: 'paste',
name: 'Paste',
disabled: function () {
return self.clipboardCache.length === 0;
// For now always on, since we can't query whether something is
// in system cut/paste buffer without prompting user for ok.
return false;
},
callback: function () {
var plugin = this.getPlugin('copyPaste');

this.listen();
// BUG: It seems like extra lf is added by sheetclip, causing
// empty last row to be added and pasted. Exception is pasting
// of single empty cell
if (self.clipboardCache.length > 0)

// Due to asynchronous clipboard calls, this has to be in an
// immediate setTimeout()
setTimeout(async () => {
const text = await navigator.clipboard.readText();
if (text && text.length) {

// An odd issue that with handsontable Paste menu item,
// targeted paste area gets extended a row on each
// subsequent Paste request. This doesn't happen if one
// uses CTRL-V instead (but that doesn't work on
// FlatpickrEditor fields unless they are later in
// multi-column paste).
// See https://github.com/handsontable/handsontable/issues/1930
// Solution is to test for and clear out trailing newline.

if (text.substr(-1, 1) == '\n')
text = text.slice(0, -1);
//self.clipboardCache = text;
plugin.paste(text);
}

});

/*
if (
self.clipboardCache &&
self.clipboardCache.length &&
self.clipboardCache.substr(-1, 1) == '\n'
) {
self.clipboardCache = self.clipboardCache.slice(0, -1);
}
plugin.paste(self.clipboardCache);
*/
},
},
'remove_row',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-harmonizer",
"version": "1.6.0",
"version": "1.6.1",
"description": "A standardized spreadsheet editor and validator that can be run offline and locally",
"repository": "[email protected]:cidgoh/DataHarmonizer.git",
"license": "MIT",
Expand Down
8 changes: 7 additions & 1 deletion web/templates/canada_covid19/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "CanCOGeN_Covid-19",
"description": "",
"id": "https://example.com/CanCOGeN_Covid-19",
"version": "2.1.3",
"version": "2.2.3",
"prefixes": {
"linkml": {
"prefix_prefix": "linkml",
Expand Down Expand Up @@ -4128,6 +4128,9 @@
"Newfoundland and Labrador - Eastern Health": {
"text": "Newfoundland and Labrador - Eastern Health"
},
"Newfoundland and Labrador - Newfoundland and Labrador Health Services": {
"text": "Newfoundland and Labrador - Newfoundland and Labrador Health Services"
},
"Nova Scotia Health Authority": {
"text": "Nova Scotia Health Authority"
},
Expand Down Expand Up @@ -4220,6 +4223,9 @@
"Newfoundland and Labrador - Eastern Health": {
"text": "Newfoundland and Labrador - Eastern Health"
},
"Newfoundland and Labrador - Newfoundland and Labrador Health Services": {
"text": "Newfoundland and Labrador - Newfoundland and Labrador Health Services"
},
"Nova Scotia Health Authority": {
"text": "Nova Scotia Health Authority"
},
Expand Down
6 changes: 5 additions & 1 deletion web/templates/canada_covid19/schema.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id: https://example.com/CanCOGeN_Covid-19
name: CanCOGeN_Covid-19
description: ''
version: 2.1.3
version: 2.2.3
imports:
- linkml:types
prefixes:
Expand Down Expand Up @@ -5762,6 +5762,8 @@ enums:
text: "New Brunswick - Vitalit\xE9 Health Network"
Newfoundland and Labrador - Eastern Health:
text: Newfoundland and Labrador - Eastern Health
Newfoundland and Labrador - Newfoundland and Labrador Health Services:
text: Newfoundland and Labrador - Newfoundland and Labrador Health Services
Nova Scotia Health Authority:
text: Nova Scotia Health Authority
Ontario Institute for Cancer Research (OICR):
Expand Down Expand Up @@ -5823,6 +5825,8 @@ enums:
text: "New Brunswick - Vitalit\xE9 Health Network"
Newfoundland and Labrador - Eastern Health:
text: Newfoundland and Labrador - Eastern Health
Newfoundland and Labrador - Newfoundland and Labrador Health Services:
text: Newfoundland and Labrador - Newfoundland and Labrador Health Services
Nova Scotia Health Authority:
text: Nova Scotia Health Authority
Nunavut:
Expand Down
2 changes: 1 addition & 1 deletion web/templates/canada_covid19/schema_core.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id: https://example.com/CanCOGeN_Covid-19
name: CanCOGeN_Covid-19
description: ""
version: 2.1.3
version: 2.2.3
imports:
- 'linkml:types'
prefixes:
Expand Down
6 changes: 3 additions & 3 deletions web/templates/canada_covid19/schema_enums.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ sequence submitted by menu Alberta Precision Labs (APL)
National Microbiology Laboratory (NML)
New Brunswick - Vitalité Health Network
Newfoundland and Labrador - Eastern Health
Newfoundland and Labrador - Newfoundland and Labrador Health Services
Nova Scotia Health Authority
Ontario Institute for Cancer Research (OICR)
Prince Edward Island - Health PEI
Expand Down Expand Up @@ -917,6 +918,7 @@ sequence submitted by menu Alberta Precision Labs (APL)
National Microbiology Laboratory (NML)
New Brunswick - Vitalité Health Network
Newfoundland and Labrador - Eastern Health
Newfoundland and Labrador - Newfoundland and Labrador Health Services
Nova Scotia Health Authority
Nunavut
Ontario Institute for Cancer Research (OICR)
Expand Down Expand Up @@ -1202,6 +1204,4 @@ geo_loc_name (country) menu GAZ:00006882 Afghanistan
GAZ:00000564 Western Sahara
GAZ:00005284 Yemen
GAZ:00001107 Zambia
GAZ:00001106 Zimbabwe


GAZ:00001106 Zimbabwe
3 changes: 1 addition & 2 deletions web/templates/canada_covid19/schema_slots.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,4 @@ CanCOGeN Covid-19 GENEPIO:0001122 Database Identifiers

GENEPIO:0001516 Contributor acknowledgement
Contributor acknowledgement GENEPIO:0001517 authors WhitespaceMinimizedString TRUE Names of individuals contributing to the processes of sample collection, sequence generation, analysis, and data submission. Include the first and last names of all individuals that should be attributed, separated by a comma. Tejinder Singh, Fei Hu, Joe Blogs Authors Authors PH_CANCOGEN_AUTHORS
Contributor acknowledgement GENEPIO:0001518 DataHarmonizer provenance Provenance The DataHarmonizer software and template version provenance. The current software and template version information will be automatically generated in this field after the user utilizes the "validate" function. This information will be generated regardless as to whether the row is valid of not. DataHarmonizer v1.4.3, CanCOGeN Covid-19 v1.0.0 DataHarmonizer provenance Additional Comments HC_COMMENTS

Contributor acknowledgement GENEPIO:0001518 DataHarmonizer provenance Provenance The DataHarmonizer software and template version provenance. The current software and template version information will be automatically generated in this field after the user utilizes the "validate" function. This information will be generated regardless as to whether the row is valid of not. DataHarmonizer v1.4.3, CanCOGeN Covid-19 v1.0.0 DataHarmonizer provenance Additional Comments HC_COMMENTS
Loading

0 comments on commit a59b629

Please sign in to comment.