Skip to content

Commit

Permalink
Merge branch '1.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
Lomilar committed Dec 23, 2024
2 parents 6363be9 + a919da0 commit 18e9368
Show file tree
Hide file tree
Showing 7 changed files with 1,686 additions and 574 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ Development unit tests presume you have a CaSS Repository running on `localhost:

# Changelog

## 1.5.72
* Throws error when importing CTDL/ASN with blank competency text.

## 1.5.71
* Fixed issue by trimming spaces in some inputs.

## 1.5.70
* Fixed issue with L2 caching of data with mismatched index/permanent records.
* Lots of updates to tests.
Expand Down
2,145 changes: 1,604 additions & 541 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cassproject",
"version": "1.5.70",
"version": "1.5.72",
"description": "Competency and Skills Service",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -122,7 +122,7 @@
"dependencies": {
"base64-arraybuffer": "^1.0.2",
"forge": "^2.3.0",
"jsonld": "^8.3.2",
"jsonld": "^8.3.3",
"node-forge": "^1.3.1",
"papaparse": "^5.4.1",
"pem-jwk": "^2.0.0",
Expand Down Expand Up @@ -158,18 +158,18 @@
"chai": "4.5.0",
"concurrently": "^9.1.0",
"convert-hrtime": "^5.0.0",
"cypress": "^13.16.0",
"cypress": "^13.17.0",
"cypress-fail-fast": "^7.1.1",
"eslint": "^9.15.0",
"eslint": "^9.17.0",
"fake-indexeddb": "^6.0.0",
"mocha": "^10.8.2",
"node-polyfill-webpack-plugin": "^4.0.0",
"nodemon": "^3.1.7",
"node-polyfill-webpack-plugin": "^4.1.0",
"nodemon": "^3.1.9",
"nyc": "^17.1.0",
"sinon": "^19.0.2",
"url-polyfill": "^1.1.12",
"wait-on": "^8.0.1",
"webpack": "^5.96.1",
"webpack": "^5.97.1",
"webpack-cli": "^5.1.4"
}
}
18 changes: 18 additions & 0 deletions src/org/cass/importer/CTDLASNCSVConceptImport.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ module.exports = class CTDLASNCSVConceptImport {
encoding: "UTF-8",
complete: async function(results) {
let tabularData = results["data"];
try {
for (let data of tabularData) {
for (let [key, value] of Object.entries(data)) {
data[key] = value.trim();
}
}
} catch (e) {
console.error('Error trimming data', e);
}
const terms = JSON.parse(JSON.stringify((await EcRemote.getExpectingObject("https://schema.cassproject.org/0.4/jsonld1.1/ceasn2cassConceptsTerms"))));
let schemeArray = [];
let concepts = [];
Expand Down Expand Up @@ -324,6 +333,15 @@ module.exports = class CTDLASNCSVConceptImport {
encoding: "UTF-8",
complete: async function(results) {
let tabularData = results["data"];
try {
for (let data of tabularData) {
for (let [key, value] of Object.entries(data)) {
data[key] = value.trim();
}
}
} catch (e) {
console.error('Error trimming data', e);
}
const terms = JSON.parse(JSON.stringify((await EcRemote.getExpectingObject("https://schema.cassproject.org/0.4/jsonld1.1/ceasn2cassConceptsTerms"))));
let schemeArray = [];
let concepts = [];
Expand Down
69 changes: 47 additions & 22 deletions src/org/cass/importer/CTDLASNCSVImport.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,32 +64,37 @@ module.exports = class CTDLASNCSVImport {
}
duplicates.sort((a, b) => a.competencyText < b.competencyText ? -1 : 1);
}
}
for (let i = 0; i < tabularData.length; i++) {
if (i == 0) continue;
let col = tabularData[i];
if (
col[typeCol] != null &&
col[typeCol].trim() == "ceasn:CompetencyFramework"
)
frameworkCounter++;
else if (
for (let i = 0; i < tabularData.length; i++) {
if (i == 0) continue;
let col = tabularData[i];
if (
col[typeCol] != null &&
col[typeCol].trim() == "ceterms:Collection"
col[typeCol].trim() == "ceasn:CompetencyFramework"
)
collectionCounter++;
else if (
col[typeCol] != null &&
col[typeCol].trim() == "ceasn:Competency"
)
competencyCounter++;
else if (col[typeCol] == null || col[typeCol] == "" || col[typeCol].toLowerCase().startsWith('sample') || col[typeCol].toLowerCase().startsWith('instruction'))
continue;
else {
this.error("Found unknown type:" + col[typeCol]);
return;
frameworkCounter++;
else if (
col[typeCol] != null &&
col[typeCol].trim() == "ceterms:Collection"
)
collectionCounter++;
else if (
col[typeCol] != null &&
col[typeCol].trim() == "ceasn:Competency"
) {
competencyCounter++;
if (colCompetencyText && !col[colCompetencyText].trim()) {
this.error('CTDLASN Parse Error: Competency text is empty on line ' + (i+1));
return;
}
} else if (col[typeCol] == null || col[typeCol] == "" || col[typeCol].toLowerCase().startsWith('sample') || col[typeCol].toLowerCase().startsWith('instruction'))
continue;
else {
this.error("Found unknown type:" + col[typeCol]);
return;
}
}
}

success(frameworkCounter, competencyCounter, collectionCounter, duplicates);
},
error: failure
Expand Down Expand Up @@ -125,6 +130,16 @@ module.exports = class CTDLASNCSVImport {
encoding: "UTF-8",
complete: async function(results) {
let tabularData = results["data"];
try {
for (let data of tabularData) {
for (let [key, value] of Object.entries(data)) {
data[key] = value.trim();
}
}
} catch (e) {
console.error('Error trimming data', e);
}

const terms = JSON.parse(JSON.stringify((await EcRemote.getExpectingObject("https://schema.cassproject.org/0.4/jsonld1.1/ceasn2cassTerms"))));
let frameworks = {};
let frameworkArray = [];
Expand Down Expand Up @@ -606,6 +621,16 @@ module.exports = class CTDLASNCSVImport {
encoding: "UTF-8",
complete: async function(results) {
let tabularData = results["data"];
try {
for (let data of tabularData) {
for (let [key, value] of Object.entries(data)) {
data[key] = value.trim();
}
}
} catch (e) {
console.error('Error trimming data', e);
}

const terms = JSON.parse(JSON.stringify((await EcRemote.getExpectingObject("https://schema.cassproject.org/0.4/jsonld1.1/ceasn2cassTerms"))));
let frameworks = {};
let frameworkArray = [];
Expand Down
6 changes: 3 additions & 3 deletions src/test/skyId.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('SkyID Adapter', function() {
ident.displayName = name;
im.addIdentity(ident);
await rld.commit(null, null, im);
}).timeout(6000);
}).timeout(30000);

it('change password', async () => {
let rld = new EcRemoteIdentityManager();
Expand All @@ -42,7 +42,7 @@ describe('SkyID Adapter', function() {
assert.equal(im.ids[0].ppk.toPem(), ident.ppk.toPem());
rld.changePassword(username, password, newPassword);
await rld.commit(null, null, im);
}).timeout(6000);
}).timeout(30000);

it('load user', async () => {
let rld = new EcRemoteIdentityManager();
Expand All @@ -51,5 +51,5 @@ describe('SkyID Adapter', function() {
rld.startLogin(username, newPassword);
let im = await rld.fetch();
assert.equal(im.ids[0].ppk.toPem(), ident.ppk.toPem());
}).timeout(6000);
}).timeout(30000);
});
2 changes: 1 addition & 1 deletion yuidoc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "CaSS Library",
"description": "CaSS Library API: A library of tools for working with the Competency and Skills System (CaSS).",
"version": "1.5.70",
"version": "1.5.72",
"url": "http://devs.cassproject.org/",
"logo": "http://eduworks.com/img/eduworks-ring-e.png",
"options": {
Expand Down

0 comments on commit 18e9368

Please sign in to comment.