Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@ export const config = {
description: 'An address of server which will be used in order to send code and analyse it',
order: 1,
},
sessionToken: {
type: 'string',
default: '',
title: 'Session token',
description: 'Clear this session token to make re-login',
order: 2,
},
analyseOnChange: {
type: 'boolean',
default: true,
title: 'Analyse on change',
description: 'Allows perform analysis on every time files are changed (with custom delay). Default: true',
order: 2,
},
analyseOnChangeDelay: {
type: 'integer',
default: 10,
minimum: 1,
maximum: 3600,
title: 'Delay for analyse on change',
description: 'Delay in seconds between starting analysis for changed files. From 1 sec to 1 hour (3600 sec). Default: 10 sec',
order: 3,
},
reScanOnStart: {
Expand All @@ -33,18 +31,20 @@ export const config = {
description: 'Allows performing full scanning project on start. Otherwise: only analysis with stored bundle',
order: 4,
},
analyseOnChangeDelay: {
type: 'integer',
default: 10,
minimum: 1,
maximum: 3600,
title: 'Delay for analyse on change',
description: 'Delay in seconds between starting analysis for changed files. From 1 sec to 1 hour (3600 sec). Default: 10 sec',
order: 5,
},
debugLog: {
type: 'boolean',
default: false,
title: 'Use debug log',
description: 'Allows output debug messages to console. Default: false',
order: 5,
},
sessionToken: {
type: 'string',
default: '',
title: 'Session token',
description: 'Clear this session token to make re-login',
order: 6,
},
};
6 changes: 4 additions & 2 deletions lib/modules/PluginManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ class PluginManager {

const onClickLogin = async () => {
Store.set(STORE_KEYS.loginInProcess, true);
this.loginDialog.dismiss();
this.loginDialog = null;
if (this.loginDialog) {
this.loginDialog.dismiss();
this.loginDialog = null;
}

await AuthModule.login();
};
Expand Down
19 changes: 11 additions & 8 deletions spec/deepcode-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,23 @@ describe('Deepcode Plugin tests', () => {
waitsForPromise(activationPromise);
});

const checkFiltersPromise = new Promise(resolve => {
dcPackage.checkFilters();
setTimeout(() => {
it('fetched filters from server', () => {

dcPackage.setPluginState({
[STORE_KEYS.allowedFiles]: {},
});

const checkFiltersPromise = new Promise(resolve => {
dcPackage.checkFilters();
resolve();
}, 1000);
});
});

it('fetched filters from server', () => {
waitsForPromise(checkFiltersPromise);
waitsForPromise(() => checkFiltersPromise);

const state = dcPackage.getPluginState();
console.log('deepcode-spec.js, [75]: ', { state });

expect(true).toEqual(true);
expect(state[STORE_KEYS.allowedFiles]).toEqual(mockState[STORE_KEYS.allowedFiles]);
})
})
});