Skip to content

Commit

Permalink
Merge pull request #3060 from kbase/develop
Browse files Browse the repository at this point in the history
Release version 5.1.1
  • Loading branch information
ialarmedalien committed Aug 5, 2022
2 parents 5cfaac3 + fcbe55a commit f72944d
Show file tree
Hide file tree
Showing 34 changed files with 693 additions and 293 deletions.
13 changes: 13 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ The Narrative Interface allows users to craft KBase Narratives using a combinati

This is built on the Jupyter Notebook v6.0.2 (more notes will follow).

### Version 5.1.1
- PTV-1798 - fixed issue where invalid component ID was causing data list not to load properly
- DATAUP-762 - fixed bug where previously run cells were showing errors in the View Configure tab
- DATAUP-763 - fixed an issue where data type icons in the bulk import cell during a run would always show an error, saying that the cell is not ready to run, when it is clearly running.

Dependency Changes
- Python dependency updates
- cryptography: 36.0.2 -> 37.0.4
- markupsafe: 2.1.1 -> 2.0.1
- plotly: 5.7.0 -> 5.9.0
- rsa: 4.8 -> 4.9
- semantic_version: 2.9.0 -> 2.10.0

### Version 5.1.0
- PTV-1783 - fixed issue where the previous object revert option was unavailable
- DATAUP-639 - fix problems with dynamic dropdown app cell input
Expand Down
4 changes: 2 additions & 2 deletions docs/testing/HeadlessTesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ job = AppManager().run_app(
import time
import pprint
import json
while job.state()['job_state'] not in ['completed', 'suspend']:
while job.refresh_state()['job_state'] not in ['completed', 'suspend']:
time.sleep(5)
job_result = job.state()
job_result = job.refresh_state()
if job_result['job_state'] != 'completed':
print "Failed - job did not complete: " + ",".join(job_result['status'][0:3])
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,13 @@ define([
}

function syncDataModel() {
// map structure of data into an array of parameter objects
const dataValues = dataModel.rowOrder.map((rowId) => dataModel.rows[rowId].values);
paramsBus.emit('sync-data-model', {
values: dataValues,
});
if (!viewOnly) {
// map structure of data into an array of parameter objects
const dataValues = dataModel.rowOrder.map((rowId) => dataModel.rows[rowId].values);
paramsBus.emit('sync-data-model', {
values: dataValues,
});
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ define([
'util/string',
'util/display',
'util/timeFormat',
'util/icon',
'kbase-client-api',
'kb_service/client/workspace',
'kb_common/jsonRpc/genericClient',
Expand All @@ -39,7 +38,6 @@ define([
StringUtil,
DisplayUtil,
TimeFormat,
Icon,
kbase_client_api,
Workspace,
GenericClient,
Expand Down Expand Up @@ -80,7 +78,6 @@ define([
maxWsObjId: null,
n_objs_rendered: 0,
real_name_lookup: {},
$searchInput: null,
$filterTypeSelect: null,
availableTypes: {},
$searchDiv: null,
Expand Down Expand Up @@ -479,10 +476,6 @@ define([
.then(() => {
this.showLoading('Rendering data...');
const numObj = Object.keys(this.dataObjects).length;
if (numObj > this.options.maxObjsToPreventFilterAsYouTypeInSearch) {
this.$searchInput.off('input');
}

if (numObj <= this.options.max_objs_to_prevent_initial_sort) {
this.viewOrder.sort((a, b) => {
const idA = a.objId,
Expand Down Expand Up @@ -2009,7 +2002,7 @@ define([
},

pluralize(word, count) {
if (count > 0) {
if (count !== 1) {
return `${word}s`;
}
return word;
Expand Down
2 changes: 1 addition & 1 deletion nbextensions/appCell2/widgets/appCellWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ define(
widget = AppParamsViewWidget.make({
bus: widgetBus,
initialParams: model.getItem('params'),
initialDisplay: model.getItem('paramDisplay'),
initialDisplay: model.getItem('paramDisplay') || {},
});

widgetBus.on('sync-params', (message) => {
Expand Down
79 changes: 40 additions & 39 deletions nbextensions/appCell2/widgets/appParamsViewWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ define([
const runtime = Runtime.make(),
paramsBus = config.bus,
initialParams = config.initialParams,
initialDisplay = config.initialDisplay,
initialDisplay = config.initialDisplay || {},
model = Props.make(),
paramResolver = ParamResolver.make(),
settings = {
Expand Down Expand Up @@ -584,51 +584,52 @@ define([
}

function start(arg) {
return Promise.try(() => {
// send parent the ready message

paramsBus.request({}, { key: { type: 'get-batch-mode' } }).then((batchMode) => {
doAttach(arg.node, batchMode);

model.setItem('appSpec', arg.appSpec);
model.setItem('parameters', arg.parameters);

paramsBus.on('parameter-changed', (message) => {
// Also, tell each of our inputs that a param has changed.
// TODO: use the new key address and subscription
// mechanism to make this more efficient.
widgets.forEach((widget) => {
widget.bus.send(message, {
key: {
type: 'parameter-changed',
parameter: message.parameter,
},
});
// send parent the ready message

return paramsBus.request({}, { key: { type: 'get-batch-mode' } }).then((batchMode) => {
doAttach(arg.node, batchMode);

model.setItem('appSpec', arg.appSpec);
model.setItem('parameters', arg.parameters);

paramsBus.on('parameter-changed', (message) => {
// Also, tell each of our inputs that a param has changed.
// TODO: use the new key address and subscription
// mechanism to make this more efficient.
widgets.forEach((widget) => {
widget.bus.send(message, {
key: {
type: 'parameter-changed',
parameter: message.parameter,
},
});
});
// we then create our widgets
let retPromise;
if (batchMode) {
retPromise = Promise.resolve();
} else {
retPromise = renderParameters();
}
return retPromise
.then(() => {
// do something after success
attachEvents();
})
.catch((err) => {
// do somethig with the error.
console.error('ERROR in start', err);
});
});
// we then create our widgets
let retPromise;
if (batchMode) {
retPromise = Promise.resolve();
} else {
retPromise = renderParameters();
}
return retPromise
.then(() => {
// do something after success
attachEvents();
})
.catch((err) => {
// do something with the error.
console.error('ERROR in start', err);
});
});
}

function stop() {
return Promise.try(() => {
// really unhook things here.
const stopPromises = widgets.map((widget) => widget.stop());
return Promise.all(stopPromises).then(() => {
if (container) {
container.innerHTML = '';
}
});
}

Expand Down
2 changes: 1 addition & 1 deletion nbextensions/appCell2/widgets/appParamsWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ define([
const runtime = Runtime.make(),
paramsBus = config.bus,
initialParams = config.initialParams,
initialDisplay = config.initialDisplay,
initialDisplay = config.initialDisplay || {},
bus = runtime.bus().makeChannelBus({ description: 'A app params widget' }),
model = Props.make(),
paramResolver = ParamResolver.make(),
Expand Down
39 changes: 27 additions & 12 deletions nbextensions/bulkImportCell/bulkImportCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,19 +739,33 @@ define([
expectedFiles.add(f);
}
});
return BulkImportUtil.getMissingFiles(Array.from(expectedFiles)).catch(
(error) => {
// if the missing files call fails, just continue.
console.error(
'Unable to fetch missing files from the Staging Service',
error
return expectedFiles;
})
.then((expectedFiles) => {
if (
['editingIncomplete', 'editingComplete'].includes(
model.getItem('state.state')
)
) {
return BulkImportUtil.getMissingFiles(Array.from(expectedFiles))
.catch((error) => {
// if the missing files call fails, just continue.
console.error(
'Unable to fetch missing files from the Staging Service',
error
);
})
.then((missingFiles = []) =>
BulkImportUtil.evaluateConfigReadyState(
model,
specs,
new Set(missingFiles)
)
);
}
);
} else {
return Promise.resolve(model.getItem('state.params'));
}
})
.then((missingFiles = []) =>
BulkImportUtil.evaluateConfigReadyState(model, specs, new Set(missingFiles))
)
.then((readyState) => {
jobManager.runHandler('modelUpdate');

Expand All @@ -763,10 +777,11 @@ define([
if (updatedReadyState) {
model.setItem(['state', 'params'], readyState);
}
if (curState.state === 'launching') {
if (curState.state === 'launching' && !developerMode) {
// TODO: if the cell has got stuck in 'launching' mode,
// we should get jobs by cell_id
// for now, reset the cell to 'editingComplete'
// if we're in devMode, leave it as is for debugging.
newState = 'editingComplete';
}

Expand Down
50 changes: 32 additions & 18 deletions nbextensions/bulkImportCell/tabs/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,27 @@ define([
configNode.classList.add('hidden');
container.appendChild(configNode);

return Util.getMissingFiles(Array.from(allFiles))
.catch((error) => {
// if the missing files call fails, just continue and let the cell render.
console.error('Unable to get missing files from the Staging Service', error);
})
.then((missingFiles = []) => {
unavailableFiles = new Set(missingFiles);
// Do a validation for all input parameters on all file types
// This is then sent to the fileTypePanel to initialize properly with
// pass or fail for each side, to properly render pass or fail icons.
return Util.evaluateConfigReadyState(model, specs, unavailableFiles);
})
let startupPromise;
if (!viewOnly) {
startupPromise = Util.getMissingFiles(Array.from(allFiles))
.catch((error) => {
// if the missing files call fails, just continue and let the cell render.
console.error(
'Unable to get missing files from the Staging Service',
error
);
})
.then((missingFiles = []) => {
unavailableFiles = new Set(missingFiles);
// Do a validation for all input parameters on all file types
// This is then sent to the fileTypePanel to initialize properly with
// pass or fail for each side, to properly render pass or fail icons.
return Util.evaluateConfigReadyState(model, specs, unavailableFiles);
});
} else {
startupPromise = Promise.resolve({});
}
return startupPromise
.then((readyState) => {
ui = UI.make({ node: container });

Expand Down Expand Up @@ -326,6 +335,7 @@ define([
},
fileTypes: fileTypesDisplay,
toggleAction: toggleFileType,
viewOnly,
});
const state = getFileTypeState(readyState);

Expand Down Expand Up @@ -407,9 +417,11 @@ define([
selectedFileType,
'Parent comm bus for parameters widget'
);
paramBus.on('parameter-changed', (message) => {
updateModelParameterValue(selectedFileType, PARAM_TYPE, message);
});
if (!viewOnly) {
paramBus.on('parameter-changed', (message) => {
updateModelParameterValue(selectedFileType, PARAM_TYPE, message);
});
}

const widget = ParamsWidget.make({
bus: paramBus,
Expand Down Expand Up @@ -449,9 +461,11 @@ define([
selectedFileType,
'Parent comm bus for filePath widget'
);
paramBus.on('parameter-changed', (message) => {
updateModelParameterValue(selectedFileType, FILE_PATH_TYPE, message);
});
if (!viewOnly) {
paramBus.on('parameter-changed', (message) => {
updateModelParameterValue(selectedFileType, FILE_PATH_TYPE, message);
});
}

paramBus.on('sync-data-model', (message) => {
if (message.values) {
Expand Down
27 changes: 15 additions & 12 deletions nbextensions/bulkImportCell/tabs/fileTypePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ define(['bluebird', 'common/ui', 'common/html', 'common/events'], (Promise, UI,
const bus = options.bus,
fileTypes = options.fileTypes,
header = options.header,
toggleFileType = options.toggleAction;
toggleFileType = options.toggleAction,
viewOnly = options.viewOnly;
let container = null,
ui = null,
/*
Expand Down Expand Up @@ -167,17 +168,19 @@ define(['bluebird', 'common/ui', 'common/html', 'common/events'], (Promise, UI,
ui.getElement(key).classList.remove(selected);
}
ui.getElement(`${key}.icon`).classList.remove(...completeIcon, ...incompleteIcon);
const icon = state.completed[key] ? completeIcon : incompleteIcon;
ui.getElement(`${key}.icon`).classList.add(...icon);
// if there's a warning, and the fileType doesn't already have a warning icon,
// make one and insert it.
const warningIconElem = ui.getElement(`${key}.warning-icon`);
if (state.warnings.has(key) && !warningIconElem) {
addWarningIcon(key);
}
// if the state has changed so that the warning icon shouldn't be there, remove it.
else if (!state.warnings.has(key) && warningIconElem) {
warningIconElem.remove();
if (!viewOnly) {
const icon = state.completed[key] ? completeIcon : incompleteIcon;
ui.getElement(`${key}.icon`).classList.add(...icon);
// if there's a warning, and the fileType doesn't already have a warning icon,
// make one and insert it.
const warningIconElem = ui.getElement(`${key}.warning-icon`);
if (state.warnings.has(key) && !warningIconElem) {
addWarningIcon(key);
}
// if the state has changed so that the warning icon shouldn't be there, remove it.
else if (!state.warnings.has(key) && warningIconElem) {
warningIconElem.remove();
}
}
});
// if the "selected" file type is real, select it
Expand Down
Loading

0 comments on commit f72944d

Please sign in to comment.