Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload Pathways data in workshop session #735

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
26 changes: 17 additions & 9 deletions dbux-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@
"commands": [
{
"command": "dbux.doActivate",
"title": "Dbux: Start Dbux"
"title": "Dbux: Start Dbux (no workshop)"
},
{
"command": "dbux.doWorkshopActivate",
"title": "Dbux: Start Workshop Session"
},
{
"command": "dbux.diagnostics",
Expand Down Expand Up @@ -478,15 +482,15 @@
}
},
{
"command": "dbuxDataFlowView.setSearchMode.ByAccessId",
"command": "dbuxDataFlowView.nextSearchMode.ByAccessId",
"title": "Search by: accessId",
"icon": {
"light": "resources/light/variable.svg",
"dark": "resources/dark/variable.svg"
}
},
{
"command": "dbuxDataFlowView.setSearchMode.ByValueId",
"command": "dbuxDataFlowView.nextSearchMode.ByValueId",
"title": "Search by: valueId",
"icon": {
"light": "resources/light/brackets.svg",
Expand Down Expand Up @@ -646,7 +650,7 @@
}
},
{
"command": "dbux.deleteUserEvents",
"command": "dbux.deleteUserActions",
"title": "Dbux Dev: Delete all user events"
},
{
Expand Down Expand Up @@ -976,12 +980,12 @@
"group": "navigation@20"
},
{
"command": "dbuxDataFlowView.setSearchMode.ByAccessId",
"command": "dbuxDataFlowView.nextSearchMode.ByAccessId",
"when": "view == dbuxDataFlowView && dbuxDataFlowView.context.searchModeName == ByAccessId",
"group": "navigation@1"
},
{
"command": "dbuxDataFlowView.setSearchMode.ByValueId",
"command": "dbuxDataFlowView.nextSearchMode.ByValueId",
"when": "view == dbuxDataFlowView && dbuxDataFlowView.context.searchModeName == ByValueId",
"group": "navigation@1"
},
Expand Down Expand Up @@ -1076,6 +1080,10 @@
"command": "dbux.doActivate",
"when": "!dbux.context.activated"
},
{
"command": "dbux.doWorkshopActivate",
"when": "!dbux.context.activated"
},
{
"command": "dbux.backendLogin",
"when": "dbux.context.activated"
Expand Down Expand Up @@ -1253,7 +1261,7 @@
"when": "dbux.context.activated"
},
{
"command": "dbux.deleteUserEvents",
"command": "dbux.deleteUserActions",
"when": "dbux.context.activated && dbux.context.nodeEnv == development"
},
{
Expand Down Expand Up @@ -1333,11 +1341,11 @@
"when": "false"
},
{
"command": "dbuxDataFlowView.setSearchMode.ByAccessId",
"command": "dbuxDataFlowView.nextSearchMode.ByAccessId",
"when": "false"
},
{
"command": "dbuxDataFlowView.setSearchMode.ByValueId",
"command": "dbuxDataFlowView.nextSearchMode.ByValueId",
"when": "false"
},
{
Expand Down
6 changes: 5 additions & 1 deletion dbux-code/src/activate.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { initDialogController } from './dialogs/dialogController';
import DialogNodeKind from './dialogs/DialogNodeKind';
import { showInformationMessage } from './codeUtil/codeModals';
import { translate } from './lang';
import { getWorkshopSessionController } from './workshop/WorkshopSessionController';
// import { initPlugins } from './PluginMgr';

// eslint-disable-next-line no-unused-vars
Expand All @@ -34,7 +35,10 @@ export default async function activate(context) {
log(`Starting Dbux v${process.env.DBUX_VERSION} (mode=${process.env.NODE_ENV}${dbuxRoot})...`);

// make sure, projectManager is available
createProjectManager(context);
const projectsManager = createProjectManager(context);

const workshopSessionController = getWorkshopSessionController();
workshopSessionController.initWorkshopSession(projectsManager);

// install dependencies (and show progress bar) right away
await installDbuxDependencies();
Expand Down
2 changes: 1 addition & 1 deletion dbux-code/src/codeDeco/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { renderTraceDecorations, clearTraceDecorations } from './traceDecorator'
import { initTraceDecorators } from './traceDecoConfig';
import { initEditedWarning } from './editedWarning';
import { set as mementoSet, get as mementoGet } from '../memento';
import { emitShowHideDecorationAction } from '../userEvents';
import { emitShowHideDecorationAction } from '../userActions';
// import DataProvider from '@dbux/data/src/DataProvider';
// import StaticContextType from '@dbux/common/src/types/constants/StaticContextType';

Expand Down
8 changes: 3 additions & 5 deletions dbux-code/src/codeUtil/treeView/BaseTreeViewNodeProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import NestedError from '@dbux/common/src/NestedError';
import { throttle } from '@dbux/common/src/util/scheduling';
import { getThemeResourcePath } from '../codePath';
import { registerCommand } from '../../commands/commandUtil';
import { emitTreeViewAction, emitTreeViewCollapseChangeAction } from '../../userEvents';
import { emitTreeViewAction, emitTreeViewCollapseChangeAction } from '../../userActions';
import BaseTreeViewNode from './BaseTreeViewNode';

/** @typedef { import("./BaseTreeViewNode").default } BaseTreeViewNode */
Expand Down Expand Up @@ -184,7 +184,6 @@ export default class BaseTreeViewNodeProvider {

// record user action
const { treeViewName } = this;
const action = ''; // not a button click
const nodeId = node.id;
const args = {
description: node.description,
Expand All @@ -195,7 +194,7 @@ export default class BaseTreeViewNodeProvider {
// trigger event handlers
evtHandler.call(this, node);
this.handleNodeCollapsibleStateChanged(node);
emitTreeViewCollapseChangeAction(treeViewName, action, nodeId, node.label, node.collapseChangeUserActionType, args);
emitTreeViewCollapseChangeAction(treeViewName, nodeId, node.label, node.collapseChangeUserActionType, args);
}

handleExpanded(node) {
Expand Down Expand Up @@ -225,7 +224,6 @@ export default class BaseTreeViewNodeProvider {
*/
handleClick = async (node) => {
const { treeViewName } = this;
const action = ''; // not a button click
const nodeId = node.id;
const args = {
description: node.description,
Expand All @@ -237,7 +235,7 @@ export default class BaseTreeViewNodeProvider {
await node.handleClick?.();
const { clickUserActionType } = node;
if (clickUserActionType !== false) {
emitTreeViewAction(treeViewName, action, nodeId, node.label, clickUserActionType, args);
emitTreeViewAction(treeViewName, nodeId, node.label, clickUserActionType, args);
}
}
catch (err) {
Expand Down
8 changes: 4 additions & 4 deletions dbux-code/src/codeUtil/treeView/TraceContainerNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { TreeItemCollapsibleState } from 'vscode';
import allApplications from '@dbux/data/src/applications/allApplications';
import { makeContextLabel, makeTraceLabel } from '@dbux/data/src/helpers/makeLabels';
import traceSelection from '@dbux/data/src/traceSelection';
import { emitTDExecutionGroupModeChangedAction } from '../../userEvents';
import { emitTDExecutionGroupModeChangedAction } from '../../userActions';
import BaseTreeViewNode from './BaseTreeViewNode';
import TraceNode from './TraceNode';

Expand All @@ -12,7 +12,6 @@ import TraceNode from './TraceNode';

export class GroupNode extends BaseTreeViewNode {
static labelSuffix = '';
static TraceNodeClass = TraceNode;

/**
* @abstract
Expand Down Expand Up @@ -104,7 +103,7 @@ export class GroupNode extends BaseTreeViewNode {
}

buildChildren() {
const { TraceNodeClass } = this.constructor;
const { TraceNodeClass } = this.parent.constructor;
return this.childTraces.map(trace => {
return this.treeNodeProvider.buildNode(TraceNodeClass, trace, this);
});
Expand All @@ -121,7 +120,8 @@ export class UngroupedNode extends GroupNode {
}

static build(rootNode, trace) {
return rootNode.treeNodeProvider.buildNode(this.TraceNodeClass, trace, rootNode);
const { TraceNodeClass } = rootNode.constructor;
return rootNode.treeNodeProvider.buildNode(TraceNodeClass, trace, rootNode);
}
}

Expand Down
9 changes: 5 additions & 4 deletions dbux-code/src/commands/applicationsViewCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import allApplications from '@dbux/data/src/applications/allApplications';
import { confirm } from '../codeUtil/codeModals';
import { showTextDocument } from '../codeUtil/codeNav';
import { initRuntimeServer, stopRuntimeServer } from '../net/SocketServer';
import { emitShowApplicationEntryFileAction } from '../userEvents';
import { emitShowApplicationEntryFileAction } from '../userActions';
import { getProjectManager } from '../projectViews/projectControl';
import { registerCommand } from './commandUtil';

Expand Down Expand Up @@ -35,9 +35,10 @@ export function initApplicationsViewCommands(context) {
registerCommand(context,
'dbuxApplicationsView.showEntryPoint',
async (node) => {
const filePath = node.application.entryPointPath;
await showTextDocument(filePath);
emitShowApplicationEntryFileAction(filePath);
const { application } = node;
const { entryPointPath } = application;
await showTextDocument(entryPointPath);
emitShowApplicationEntryFileAction(application, entryPointPath);
}
);
}
10 changes: 5 additions & 5 deletions dbux-code/src/commands/dataFlowViewCommands.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { emitDataFlowViewFilterModeChangedAction, emitDataFlowViewSearchModeChangedAction } from '../userEvents';
import { emitDataFlowViewFilterModeChangedAction, emitDataFlowViewSearchModeChangedAction } from '../userActions';
import DataFlowFilterModeType from '../dataFlowView/DataFlowFilterModeType';
import DataFlowSearchModeType from '../dataFlowView/DataFlowSearchModeType';
import { registerCommand } from './commandUtil';
Expand All @@ -10,18 +10,18 @@ import { registerCommand } from './commandUtil';
*/
export function initDataFlowViewCommands(context, dataFlowViewController) {
registerCommand(context,
'dbuxDataFlowView.setSearchMode.ByAccessId',
'dbuxDataFlowView.nextSearchMode.ByAccessId',
(/* node */) => {
dataFlowViewController.setSearchMode(DataFlowSearchModeType.nextValue(DataFlowSearchModeType.ByAccessId));
emitDataFlowViewSearchModeChangedAction(DataFlowSearchModeType.ByAccessId);
emitDataFlowViewSearchModeChangedAction(dataFlowViewController.searchMode);
}
);

registerCommand(context,
'dbuxDataFlowView.setSearchMode.ByValueId',
'dbuxDataFlowView.nextSearchMode.ByValueId',
(/* node */) => {
dataFlowViewController.setSearchMode(DataFlowSearchModeType.nextValue(DataFlowSearchModeType.ByValueId));
emitDataFlowViewSearchModeChangedAction(DataFlowSearchModeType.ByValueId);
emitDataFlowViewSearchModeChangedAction(dataFlowViewController.searchMode);
}
);

Expand Down
4 changes: 2 additions & 2 deletions dbux-code/src/commands/globalAnalysisViewCommands.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { nextMode } from '../globalAnalysisView/nodes/GlobalModulesNode';
import { showInformationMessage } from '../codeUtil/codeModals';
import searchController from '../search/searchController';
import { emitShowErrorAction } from '../userEvents';
import { emitTraceUserAction } from '../userActions';
import { registerCommand } from './commandUtil';

/** @typedef {import('../globalAnalysisView/GlobalAnalysisViewController').default} GlobalAnalysisViewController */
Expand All @@ -15,7 +15,7 @@ export function initGlobalAnalysisViewCommands(context, globalAnalysisViewContro
async () => {
const selectedNode = await globalAnalysisViewController.showError();
if (selectedNode) {
emitShowErrorAction(selectedNode.trace);
emitTraceUserAction(selectedNode.trace);
}
}
);
Expand Down
2 changes: 1 addition & 1 deletion dbux-code/src/commands/projectCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { registerCommand } from './commandUtil';
import { chooseFile, showInformationMessage, showWarningMessage } from '../codeUtil/codeModals';
import { getCurrentResearch } from '../research/Research';
import { translate } from '../lang';
import { emitAnnotateTraceAction, emitStopRunnerAction } from '../userEvents';
import { emitAnnotateTraceAction, emitStopRunnerAction } from '../userActions';
import { addProjectFolderToWorkspace } from '../codeUtil/workspaceUtil';

/** @typedef {import('../projectViews/projectViewsController').ProjectViewController} ProjectViewController */
Expand Down
2 changes: 1 addition & 1 deletion dbux-code/src/commands/runCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { initRuntimeServer } from '../net/SocketServer';
import { installDbuxDependencies } from '../codeUtil/installUtil';
import { initProjectView } from '../projectViews/projectViewsController';
import { getNodePath } from '../codeUtil/codePath';
import { emitRunFileAction } from '../userEvents';
import { emitRunFileAction } from '../userActions';

// eslint-disable-next-line no-unused-vars
const { log, debug, warn, error: logError } = newLogger('DBUX run file');
Expand Down
8 changes: 4 additions & 4 deletions dbux-code/src/commands/userCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { translate } from '../lang';
import { getDefaultExportDirectory, getLogsDirectory } from '../codeUtil/codePath';
import { runTaskWithProgressBar } from '../codeUtil/runTaskWithProgressBar';
import searchController from '../search/searchController';
import { emitSelectTraceAction, emitShowOutputChannelAction } from '../userEvents';
import { emitTraceUserAction, emitShowOutputChannelAction } from '../userActions';
import { runFile } from './runCommands';

// eslint-disable-next-line no-unused-vars
Expand Down Expand Up @@ -218,7 +218,7 @@ export function initUserCommands(extensionContext) {
}
else {
traceSelection.selectTrace(trace);
emitSelectTraceAction(trace, UserActionType.SelectTraceById, { userInput });
emitTraceUserAction(UserActionType.SelectTraceById, trace, { userInput });
}
}

Expand Down Expand Up @@ -249,11 +249,11 @@ export function initUserCommands(extensionContext) {
return backend.containers.survey1.storeSurveyResult(data);
});

registerCommand(extensionContext, 'dbux.deleteUserEvents', async () => {
registerCommand(extensionContext, 'dbux.deleteUserActions', async () => {
if (process.env.NODE_ENV === 'production') {
throw new Error('This command is currently disabled in Production mode.');
}
await getProjectManager().deleteUserEvents();
await getProjectManager().deleteUserActions();
});

// ###########################################################################
Expand Down
4 changes: 2 additions & 2 deletions dbux-code/src/dialogs/survey1.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable max-len */
import { env, Uri, window } from 'vscode';
import ExerciseStatus from '@dbux/projects/src/dataLib/ExerciseStatus';
import { upload } from '@dbux/projects/src/firestore/upload';
import { uploadSurvey } from '@dbux/projects/src/firestore/upload';
import { newLogger } from '@dbux/common/src/log/logger';
import { showHelp } from '../help';
import DialogNodeKind from './DialogNodeKind';
Expand Down Expand Up @@ -458,7 +458,7 @@ ${data.email || ''}`;
log('survey result', data);

// store to backend
await upload('survey1', data);
await uploadSurvey(data);
// const backend = await getProjectManager().getAndInitBackend();
// return backend.containers.survey1.storeSurveyResult(data);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import traceSelection from '@dbux/data/src/traceSelection';
import { pathRelative } from '@dbux/common-node/src/util/pathUtil';
import BaseTreeViewNode from '../../codeUtil/treeView/BaseTreeViewNode';
import TraceNode from '../../codeUtil/treeView/TraceNode';
import { emitGlobalPackageSortModeChangedAction } from '../../userEvents';
import { emitGlobalPackageSortModeChangedAction } from '../../userActions';
import PackageNodeSortMode from './PackageNodeSortMode';


Expand Down
2 changes: 1 addition & 1 deletion dbux-code/src/help.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Uri, env } from 'vscode';
import { showInformationMessage } from './codeUtil/codeModals';
import { translate } from './lang';
import { emitShowHelpAction } from './userEvents';
import { emitShowHelpAction } from './userActions';

let dialogController;

Expand Down
2 changes: 1 addition & 1 deletion dbux-code/src/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { showOutputChannel } from './projectViews/projectViewsController';
import { showInformationMessage, showErrorMessage } from './codeUtil/codeModals';
import { showHelp } from './help';
import { translate } from './lang';
import { emitShowHideErrorLogNotificationAction } from './userEvents';
import { emitShowHideErrorLogNotificationAction } from './userActions';

let isShowingAllError = true;

Expand Down
2 changes: 1 addition & 1 deletion dbux-code/src/net/SocketServer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import NanoEvents from 'nanoevents';
import { newLogger } from '@dbux/common/src/log/logger';
import { emitRuntimeServerStatusChangedAction } from '../userEvents';
import { emitRuntimeServerStatusChangedAction } from '../userActions';
import RuntimeClient from './RuntimeClient';
import { makeListenSocket } from './serverUtil';

Expand Down
Loading