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

CTX-4651: Updating naming convention for project and task #6

Open
wants to merge 1 commit into
base: develop
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"default": "",
"description": "Your Node Storage Path"
},
"Space": {
"Project": {
"type": "integer",
"default": 0,
"description": "Your Current Coretex Space"
"description": "Your Current Coretex Project"
},
"NodeID": {
"type": "integer",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/convertToCoretexProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const convertToCoretexProject = vscode.commands.registerCommand(
{ label: 'Other', value: 8 },
],
{
placeHolder: 'Select the project task:',
placeHolder: 'Select the project type:',
}
);

Expand Down
40 changes: 20 additions & 20 deletions src/views/projectView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ export class ProjectView implements vscode.WebviewViewProvider {
this._view.webview.html = this.getWebviewContent(this._view.webview, text);
}

private getRunCommand(space: number, node: number, path: string): string {
private getRunCommand(project: number, node: number, path: string): string {
const platform = process.platform;
if (platform === 'darwin' || platform === 'linux') {
return `coretex run create ${node} -s ${space} -f ${path}`;
return `coretex run create ${node} -s ${project} -f ${path}`;
} else if (platform === 'win32') {
return `coretex.exe run create ${node} -s ${space} -f ${path}`;
return `coretex.exe run create ${node} -s ${project} -f ${path}`;
}

return '';
Expand All @@ -74,23 +74,23 @@ export class ProjectView implements vscode.WebviewViewProvider {
switch (data.type) {
case 'start':
{
const spaceConf = 'Space';
const projectConf = 'Project';
const nodeConf = 'NodeID';

const conf = vscode.workspace.getConfiguration();
const spaceID = conf.get<{}>(spaceConf);
const spaceDefaultValue = spaceID ? spaceID.toString() : '';

const space = await vscode.window.showInputBox({
prompt: 'Enter Space ID in which you wish to run the Job',
placeHolder: 'Space',
validateInput: (value) => (value ? null : 'Space is required'),
value: spaceDefaultValue, // Default value
const projectID = conf.get<{}>(projectConf);
const projectDefaultValue = projectID ? projectID.toString() : '';

const project = await vscode.window.showInputBox({
prompt: 'Enter Project ID in which you wish to run the Task',
placeHolder: 'Project',
validateInput: (value) => (value ? null : 'Project is required'),
value: projectDefaultValue, // Default value
});

if (!space) {
if (!project) {
vscode.window.showErrorMessage(
'Space is required to run a Job.'
'Project is required to run a Task.'
);
return;
}
Expand All @@ -99,15 +99,15 @@ export class ProjectView implements vscode.WebviewViewProvider {
const nodeDefaultValue = nodeID ? nodeID.toString() : '';

const node = await vscode.window.showInputBox({
prompt: 'Enter Node ID on which you wish to run the Job',
prompt: 'Enter Node ID on which you wish to run the Task',
placeHolder: 'Node',
validateInput: (value) => (value ? null : 'Node is required'),
value: nodeDefaultValue, // Default value
});

if (!node) {
vscode.window.showErrorMessage(
'Node is required to run a Job.'
'Node is required to run a Task.'
);
return;
}
Expand All @@ -118,7 +118,7 @@ export class ProjectView implements vscode.WebviewViewProvider {
currentWorkspacePath = vscode.workspace.workspaceFolders[0].uri.path;
}

const command = this.getRunCommand(Number(space), Number(node), currentWorkspacePath);
const command = this.getRunCommand(Number(project), Number(node), currentWorkspacePath);

vscode.window.terminals.forEach((terminal) => {
terminal.dispose();
Expand Down Expand Up @@ -182,9 +182,9 @@ export class ProjectView implements vscode.WebviewViewProvider {
<title>Project</title>
</head>
<body>
<p>Run a Job with the current workspace contents:</p>
<button class="${runStyle}">Run Job</button>
<p>List nodes available for Job execution (set default in global extension settings):</p>
<p>Run a Task with the current workspace contents:</p>
<button class="${runStyle}">Run Task</button>
<p>List nodes available for Task execution (set default in global extension settings):</p>
<button class="${nodesStyle}">List Nodes</button>
<p class="title">Storage path:</p>
<p class="subtitle">${text}</p>
Expand Down