Skip to content

Commit

Permalink
Merge pull request #59 from idaholab/db_fixes
Browse files Browse the repository at this point in the history
Db fixes
  • Loading branch information
z-priest authored Jun 17, 2021
2 parents 4f9089a + aec115a commit 0e149a2
Show file tree
Hide file tree
Showing 81 changed files with 18,880 additions and 467 deletions.
18,162 changes: 18,162 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

139 changes: 70 additions & 69 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,73 +109,74 @@
"y18n": "^4.0.1",
"is-svg": "^4.2.2",
"xmldom": "^0.5.0"
},
"devDependencies": {
"@types/cytoscape": "^3.1.4",
"@types/electron-store": "^1.2.0",
"@types/file-saver": "^2.0.0",
"@types/jquery": "^3.2.15",
"@types/jqueryui": "^1.11.32",
"@types/json-editor": "^0.0.5",
"@types/lodash": "^4.14.74",
"@types/npm": "^2.0.29",
"@types/orientjs": "^3.0.3",
"@types/split.js": "^1.3.0",
"@types/uuid": "^3.4.2",
"electron-forge": "^5.2.3",
"electron-prebuilt-compile": "4.0.0",
"eslint": "^5.12.1",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.1.0",
"jshint": "^2.9.5",
"npm": "^6.14.6",
"tslint": "^5.9.1",
"typescript": "^3.2.4"
},
"dependencies": {
"@json-editor/json-editor": "^1.3.2",
"@types/electron-devtools-installer": "^2.0.2",
"console": "^0.7.0",
"cytoscape": "^3.2.5",
"cytoscape-cola": "^2.0.1",
"cytoscape-cose-bilkent": "^4.0.0",
"cytoscape-cxtmenu": "^3.0.0",
"cytoscape-dagre": "^2.1.0",
"cytoscape-edgehandles": "^3.2.0",
"cytoscape-euler": "^1.1.0",
"cytoscape-klay": "^3.0.0",
"cytoscape-ngraph.forcelayout": "^1.3.8",
"cytoscape-spread": "^3.0.0",
"cytoscape-view-utilities": "^2.0.7",
"electron": "^9.4.0",
"electron-compile": "^6.4.2",
"electron-devtools-installer": "^2.1.0",
"electron-squirrel-startup": "^1.0.0",
"electron-store": "^2.0.0",
"electron-unhandled": "^2.1.0",
"file-saver": "^2.0.0",
"flatpickr": "^4.5.2",
"font-awesome": "^4.7",
"fontawesome": "^4.7.2",
"foundation-sites": "^6.4.4-rc1",
"http-status-codes": "^1.3.0",
"jquery": "^3.5.0",
"jquery-ui-dist": "^1.12.1",
"jquery-ui-themes": "^1.12.0",
"jsondiffpatch": "^0.3.7",
"lodash": "^4.17.13",
"moment": "^2.21.0",
"normalize.css": "^8.0.1",
"orientjs": "^3.0.3",
"split.js": "^1.3.5",
"trace-error": "^0.0.7",
"tslib": "^1.4.0",
"uuid": "^3.1.0",
"what-input": ">=4.1.0"
},
"engines": {
"yarn": ">= 1.0.0"
}
},
"devDependencies": {
"@types/cytoscape": "^3.1.4",
"@types/electron-store": "^1.2.0",
"@types/file-saver": "^2.0.0",
"@types/jquery": "^3.2.15",
"@types/jqueryui": "^1.11.32",
"@types/jsoneditor": "^8.6.0",
"@types/lodash": "^4.14.74",
"@types/npm": "^2.0.29",
"@types/orientjs": "^3.0.3",
"@types/split.js": "^1.3.0",
"@types/uuid": "^3.4.2",
"electron-forge": "^5.2.3",
"electron-prebuilt-compile": "4.0.0",
"eslint": "^5.12.1",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.1.0",
"jshint": "^2.9.5",
"npm": "^6.14.6",
"tslint": "^5.9.1",
"typescript": "^3.2.4"
},
"dependencies": {
"@json-editor/json-editor": "^2.5.4",
"@types/electron-devtools-installer": "^2.0.2",
"@types/jsoneditor": "^8.6.0",
"console": "^0.7.0",
"cytoscape": "^3.2.5",
"cytoscape-cola": "^2.0.1",
"cytoscape-cose-bilkent": "^4.0.0",
"cytoscape-cxtmenu": "^3.0.0",
"cytoscape-dagre": "^2.1.0",
"cytoscape-edgehandles": "^3.2.0",
"cytoscape-euler": "^1.1.0",
"cytoscape-klay": "^3.0.0",
"cytoscape-ngraph.forcelayout": "^1.3.8",
"cytoscape-spread": "^3.0.0",
"cytoscape-view-utilities": "^2.0.7",
"electron": "^9.4.0",
"electron-compile": "^6.4.2",
"electron-devtools-installer": "^2.1.0",
"electron-squirrel-startup": "^1.0.0",
"electron-store": "^2.0.0",
"electron-unhandled": "^2.1.0",
"file-saver": "^2.0.0",
"flatpickr": "^4.5.2",
"font-awesome": "^4.7",
"fontawesome": "^4.7.2",
"foundation-sites": "^6.4.4-rc1",
"http-status-codes": "^1.3.0",
"jquery": "^3.5.0",
"jquery-ui-dist": "^1.12.1",
"jquery-ui-themes": "^1.12.0",
"jsondiffpatch": "^0.3.7",
"lodash": "^4.17.13",
"moment": "^2.21.0",
"normalize.css": "^8.0.1",
"orientjs": "^3.0.3",
"split.js": "^1.3.5",
"trace-error": "^0.0.7",
"tslib": "^1.4.0",
"uuid": "^3.1.0",
"what-input": ">=4.1.0"
},
"engines": {
"yarn": ">= 1.0.0"
}
}
7 changes: 7 additions & 0 deletions src/db/create-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ async function class_query(db: OrientDB.ODatabase, options: IOrientJSONClassOpti
if (idx > -1) {
alias = name;
const replaced = name.replace(/-/g, '');
console.log('found aliases: ', replaced);

name = replaced;
}
try {
Expand All @@ -70,14 +72,19 @@ async function class_query(db: OrientDB.ODatabase, options: IOrientJSONClassOpti
const query = `ALTER CLASS ${name} SHORTNAME ${alias}`;
await db.exec(query);
}
console.log('done with creating superclasses');
return cls;
}

async function create_classes(db: OrientDB.ODatabase) {

for (const cls of schema.classes) {
const c = await class_query(db, cls);
await create_properties(c, cls.properties);
}

console.log('done creating db');
//TODO give user some indication db is being created
}

async function create_properties(cls: OrientDB.Class, props: OrientDB.PropertyCreateConfig[]): Promise<OrientDB.Property[]> {
Expand Down
2 changes: 1 addition & 1 deletion src/db/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ export class StigDB {
}

/**
* @description
* @description Gets SDO or SCO from db.
* @param {Identifier} identifier
* @returns {Promise<SDO>}
* @memberof StigDB
Expand Down
Loading

0 comments on commit 0e149a2

Please sign in to comment.