Skip to content

Commit

Permalink
Merge pull request mariuspopovici#140 from mariuspopovici/forms-desig…
Browse files Browse the repository at this point in the history
…er-01

Merge Form Designer PR, Reorganize .sdp package
  • Loading branch information
mariuspopovici authored Dec 2, 2023
2 parents 109cd74 + 37d767c commit b72f106
Show file tree
Hide file tree
Showing 128 changed files with 17,579 additions and 123 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ node_modules
*.http
apitest/*
packages/*
dist/*
dist/*.js
dist/*.js.map
dist/*.css
dist/*.sdp
.vscode/*
.DS_Store
.vs/*
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.2.74] - 2023-09-18

- Added move command

## [1.2.79] - 2023-11-29

- Added support for ESLint rules when editing Javascript form code behind with STARLIMS specific objects and types. Config file .eslintrc.json and package.json is automatically deployed in the root folder during activation
- Integrated proof-of-concept forms designer application in backend package
- Added urlSuffix setting for handling API calls on older STARLIMS runtime where HTTPServices web.config key is not recognized
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,4 @@ New features:
- Rename items and categories
- Move items
- Misc. bug fixes
- Support for ESLint in Javascript client scripts and form code behind with specific rules for STARLIMS objects and data types
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "STARLIMS VS Code Extension",
"description": "Unofficial dictionary explorer (and more) for STARLIMS.",
"license": "SEE LICENSE IN LICENSE.md",
"version": "1.2.77",
"version": "1.2.78",
"icon": "resources/extension/starlimsvscode.png",
"publisher": "MariusPopovici",
"author": {
Expand Down Expand Up @@ -576,6 +576,11 @@
],
"default": "chrome",
"description": "Browser to use for debugging STARLIMS forms. Possible values: chrome, msedge"
},
"STARLIMS.urlSuffix": {
"type": "string",
"default": "lims",
"description": "The web service request url suffix. Use lims2 with older versions of the STARLIMS Technology Platform which don't recognize the HTTPServices web.config setting key"
}
}
}
Expand Down
Binary file modified src/backend/SCM_API.sdp
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
/*
Description.. :
Author....... : DC
Date......... : 2023-10-27
*/
const DEFAULT = "";
const ADD_TAB_PAGE = "Add Tab Page|htmlruntime/images/0D66B508-7742-DE45-A2B8-C53380801516";

// extends a context menu with base functionality
function ApplyContextMenu(control)
{
if(control instanceof TabControl)
{
control.EnableContextMenu = true;
var oMenu = control.ContextMenu;
if(!oMenu)
{
oMenu = new Menu();
control.ContextMenu = oMenu;
__addItem(oMenu, form.Resources[ADD_TAB_PAGE], "__add_tab_page");
}
}

// handle events
if(control.OnContextMenuClick)
{
if(!control.OnContextMenuClick.name !== "_newOnContextMenuClick")
{
let aux = control.OnContextMenuClick;
control.OnContextMenuClick = function _newOnContextMenuClick(sender, eventArgs) {
if (!__base_menu_OnContextMenuClick(sender, eventArgs))
aux(sender, eventArgs);
};
}
}
else
control.OnContextMenuClick = __base_menu_OnContextMenuClick;

if (control.OnContextMenuPopup)
{
if (!control.OnContextMenuPopup.name !== "_newContextMenuPopup")
{
let aux = control.OnContextMenuPopup;
control.OnContextMenuPopup = function _newContextMenuPopup(sender, eventArgs) {
aux(sender, eventArgs);
__base_menu_OnContextMenuPopup(sender, eventArgs);
};
}
}
else
control.OnContextMenuPopup = "__base_menu_OnContextMenuPopup(sender, eventArgs)";
}

function __findByText(oMenu, sText, aAlternateTexts)
{
var aTexts = aAlternateTexts;
if(!aTexts)
aTexts = [];

aTexts.push(sText);
for(let i of oMenu.Items)
for(let j of aTexts)
if(i.Text == aTexts[j])
return i;

return null;
}

function __addItem(oMenu, sText, sFunction, bAllowDuplicates, aAlternateTexts, sGroup, enabled = true)
{
var sImage;
if(sText.includes("|"))
{
var aText = sText.split('|');
sText = aText[0];
sImage = aText[1];
}
else
sImage = form.Resources[DEFAULT];

if(!bAllowDuplicates && __findByText(oMenu, sText, aAlternateTexts))
return null;

var oParent = oMenu;
if(sGroup)
{
oParent = __findByText(oMenu, sGroup, []);
if(!oParent)
{
oParent = new MenuItem();
oParent.Id = sGroup;
oParent.Text = sGroup;
oMenu.Items.Add(oParent);
}
if(!bAllowDuplicates && __findByText(oParent, sText, aAlternateTexts))
return null;
}

if(!oParent)
oParent = oMenu;

var oItem = new MenuItem();
oItem.Id = sText;
oItem.Text = sText;
oItem.Tag = {sFunction: sFunction};
oItem.Enabled = enabled;
oItem.icon = sImage;
oParent.Items.Add(oItem);
return oItem;
}

function __add_separator(oMenu)
{
var oItem = new MenuSeparator();
oMenu.Items.Add(oItem);
return oItem;
}

function __add_header(oMenu, sText)
{
var oItem = new MenuHeader();
oItem.Text = sText;
oMenu.Items.Add(oItem);
return oItem;
}

function __base_menu_OnContextMenuClick(sender, eventArgs)
{
event.preventDefault();
var bHandled = false;
var oMenuItem = eventArgs["Menu"];

// differentiate from menu items from CreateAuditContextMenuEx
if(oMenuItem.Tag && oMenuItem.Tag.sFunction && !oMenuItem.Tag.IsBase)
{
try
{
form.DisplayWaitMessage(true, "Loading...");
form.ExecFunction(oMenuItem.Tag.sFunction, [sender, eventArgs]);
}
finally
{
form.DisplayWaitMessage(false);
}
return true;
}
return bHandled;
}

function __base_menu_OnContextMenuPopup(sender, eventArgs)
{
event.preventDefault();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
update limsSOURCECONTROL set REASONFORCHECKOUT = 'Import - Automated copy of the old version' where versionID = ?
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
update limsVERSIONS set MAJOR = 0, MINOR = 0, BUILD = 1, DMAJOR = 0, DMINOR = 0, DBUILD = 0, CMAJOR = 0, CMINOR = 0, CBUILD = 0 where versionID = ?
Loading

0 comments on commit b72f106

Please sign in to comment.