Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #339 from complexdatacollective/release/6.1.1
Browse files Browse the repository at this point in the history
bump version
  • Loading branch information
jthrilly committed Jan 28, 2022
2 parents 4c5d041 + 7bdd0a3 commit fc8ca0d
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 31 deletions.
28 changes: 17 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "network-canvas-server-6",
"version": "6.1.0",
"version": "6.1.1",
"productName": "Network Canvas Server",
"description": "A tool for storing, analyzing, and exporting Network Canvas interview data.",
"private": true,
Expand Down Expand Up @@ -120,6 +120,7 @@
"archiver": "^4.0.1",
"async": "^3.2.0",
"big-integer": "^1.6.43",
"caniuse-lite": "^1.0.30001302",
"classnames": "^2.2.6",
"compare-versions": "^3.6.0",
"detect-port": "^1.2.3",
Expand Down
16 changes: 15 additions & 1 deletion src/main/MainApp.js
Expand Up @@ -70,7 +70,21 @@ const createApp = () => {
dialog.showErrorBox('Session Import Error', err && err.message);
});

const correctSessionVariableTypes = () => protocolManager.correctSessionVariableTypes();
const correctSessionVariableTypes = () => dialog.showMessageBox(mainWindow.window, {
type: 'warning',
title: 'Correcting variable types',
message: 'This action will attempt to correct issues with sessions imported from graphml files that contain categorical data. If this scenario does not apply to you, click cancel. Please export or backup your data prior to proceeding as this process could result in data loss.',
buttons: ['Cancel', 'Continue'],
cancelId: 0,
defaultId: 0,
}).then(({ response }) => {
if (response === 1) {
protocolManager.correctSessionVariableTypes()
.catch((err) => {
dialog.showErrorBox('Correct Variable Types Error', err && err.message);
});
}
});

const generateTestSessions = (number) => {
protocolManager.allProtocols().then((allProtocols) => {
Expand Down
44 changes: 31 additions & 13 deletions src/main/data-managers/ProtocolManager.js
Expand Up @@ -679,15 +679,17 @@ class ProtocolManager {
}).catch((err) => Promise.reject(constructErrorObject(err.message, caseId)));
}

correctSessionVariableTypes() {
this.allProtocols().then((allProtocols) => {
allProtocols.forEach((protocol) => {
async correctSessionVariableTypes() {
let changesMade = false;

await this.allProtocols().then((allProtocols) => (
promiseWithStaleEmitter(Promise.allSettled(allProtocols.map((protocol) => {
const protocolId = get(protocol, '_id');
this.getProtocolSessions(protocolId)
.then((sessions) => {
sessions.forEach((session) => {
return this.getProtocolSessions(protocolId)
.then((sessions) => (
Promise.allSettled(sessions.map((session) => {
const sessionId = get(session, '_id');
this.getProtocolSession(protocolId, sessionId)
return this.getProtocolSession(protocolId, sessionId)
.then((sessionData) => {
const nodes = getCorrectEntityVariableTypes(sessionData.data.nodes,
protocol.codebook.node);
Expand All @@ -696,7 +698,8 @@ class ProtocolManager {
const ego = getCorrectEntityVariableTypes(sessionData.data.ego, protocol.codebook, 'ego');

if (nodes.altered || edges.altered || ego.altered) {
logger.log(`CORRECTING SESSION ${sessionId} FROM INVALID CATEGORICAL OPTIONS`);
changesMade = true;
logger.log(`CORRECTING INVALID CATEGORICAL OPTIONS FOUND IN SESSION ${sessionId} `);
const updatedSession = {
...sessionData,
data: {
Expand All @@ -706,15 +709,30 @@ class ProtocolManager {
ego: ego.correctedEntity,
},
};
return promiseWithStaleEmitter(this.sessionDb.update(protocolId,
updatedSession));
return this.sessionDb.update(protocolId, updatedSession);
}
return Promise.resolve;
});
});
});
}))
));
})))
));

if (changesMade) {
dialog.showMessageBox(null, {
type: 'info',
title: 'Session Variable Type Correction',
message: 'Some session variables had invalid options. These have been corrected.',
buttons: ['OK'],
});
});
} else {
dialog.showMessageBox(null, {
type: 'info',
title: 'Session Variable Type Correction',
message: 'No session variables had invalid options. No changes were made to your data.',
buttons: ['OK'],
});
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/package.json
@@ -1,6 +1,6 @@
{
"name": "network-canvas-server-6",
"version": "6.1.0",
"version": "6.1.1",
"productName": "Network Canvas Server",
"description": "A tool for storing, analyzing, and exporting Network Canvas interview data.",
"private": true,
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/containers/EntityResolverScreen/NewResolution.js
Expand Up @@ -9,6 +9,7 @@ import Tip from '../../components/Tip';
import BrowseInput from '../../components/BrowseInput';
import withValidation from './withValidation';
import { getNodeTypes } from './selectors';
import { ExternalLink } from '../../components/ExternalLink';

const ValidatedBrowseInput = withValidation(BrowseInput);

Expand Down Expand Up @@ -114,10 +115,9 @@ const NewResolution = ({
This should be the path of your custom resolver script. Please
read the documentation for more information on
{' '}
<a href="">
how
to create a resolver script
</a>
<ExternalLink href="https://github.com/complexdatacollective/entity-resolution-sample">
how to create a resolver script
</ExternalLink>
.
</p>
<ValidatedBrowseInput
Expand Down

0 comments on commit fc8ca0d

Please sign in to comment.