@kumologica/sdk 3.4.0-beta16 → 3.4.0-beta18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,11 @@ RED.palette.explorer = (function () {
3
3
  let path = window.__kumologica.libs.path;
4
4
 
5
5
  const openProject = (projectLocation) => {
6
+ if (projectLocation === RED.projectInfo.getWorkspaceInfo()[0].path) {
7
+ RED.notify(`<strong>Warning</strong>: "${path.basename(projectLocation)}" project is already opened.`, 'warning');
8
+ return;
9
+ }
10
+
6
11
  window.__kumologica.main.dispatch('modal-home:open-project-in-editor', {
7
12
  payload: {
8
13
  projectLocation
@@ -314,6 +319,12 @@ RED.palette.explorer = (function () {
314
319
  }
315
320
 
316
321
  $('#exp-open-project').tree('loadData', data);
322
+ // Add a tooltip to the current project name with the path that is located.
323
+ RED.popover.tooltip(
324
+ $('#exp-open-project').find('div').first(),
325
+ RED.projectInfo.getWorkspaceInfo()[0].path
326
+ );
327
+
317
328
  }
318
329
 
319
330
  const refreshWorkspaceProjects = () => {
@@ -334,7 +345,14 @@ RED.palette.explorer = (function () {
334
345
  let projectsAZ = projects.sort((a, b) => path.basename(a).localeCompare(path.basename(b)));
335
346
  projectsAZ.forEach((project, index) => {
336
347
  let projectName = path.basename(project);
337
- data[0].children.push({ id: name, name: projectName, path: project });
348
+
349
+ // Do not include in the list of workspaces the current project
350
+ if (project === RED.projectInfo.getWorkspaceInfo()[0].path){
351
+ data[0].children.push({ id: name, name: `${projectName} (current)`, path: project });
352
+ } else {
353
+ data[0].children.push({ id: name, name: projectName, path: project });
354
+ }
355
+
338
356
  })
339
357
  }
340
358