Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/MrDoe/starlimsvscode
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/MrDoe/starlimsvscode:
  Fix for mariuspopovici#143
  updated changelog
  updated layerid
  Updated README.md
  • Loading branch information
MrDoe committed Feb 1, 2024
2 parents cf01dde + 1b476a8 commit 442d641
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 27 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- 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.2.81] - 2024-01-27

- Misc. fixes
- Enhancements to forms designer

## [1.2.82] - 2024-01-31

- Misc. fixes
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,20 @@ Features:
- Global, full text search in scripts / code with code item type selection
- Search code items by name
- Explore tables and view table schema
- HTML Form Designer (alpha version)

To Do:

- Create a HTML form designer
- Implement table support including a schema and ERD generator / viewer
- Form Designer:
- Add support for all controls (buttonlist, listview, etc.)
- implement root table designer
- implement group or column editor for button list
- add color picker
- snap controls to layout grid
- move controls via arrow keys
- VS Code extension:
- Add 'create event function' snippet
- Editable table definition, indices and foreign keys
- Browse code history and revert code to specific version

## Extension Settings

Expand All @@ -67,7 +76,6 @@ This extension contributes the following settings:
## How to Use

- Install the latest version of the extension from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=MariusPopovici.vscode-starlims&ssr=false#qna)
- Download the extension files attached to the [current release](https://github.com/mariuspopovici/starlimsvscode/releases) and import the SCM_API.sdp package into STARLIMS
- Add a local folder to the current VS Code workspace. This will serve as your local STARLIMS code repository.
- Activate the extension clicking the STARLIMS logo in the VS Code sidebar.
- Configure the extension settings (STARLIMS url, user and password, root folder). You will be prompted to set these upon attempting to activate the extension for the first time. The root folder should be set as the path to the folder selected in the previous step.
Expand Down Expand Up @@ -119,3 +127,4 @@ New features:
- 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
- Preliminary version of Form Designer (use with care)
2 changes: 1 addition & 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.80",
"version": "1.2.81",
"icon": "resources/extension/starlimsvscode.png",
"publisher": "MariusPopovici",
"author": {
Expand Down
4 changes: 2 additions & 2 deletions src/backend/SCM_API/manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
<ServerScriptCategory>
<ItemID>7C117241-417D-442D-80B6-BAD7797E8EF2</ItemID>
<ItemName>SCM_API</ItemName>
<LayerId>200</LayerId>
<LayerId>300</LayerId>
<ItemDescription />
<IsMandatory>false</IsMandatory>
<ItemBehaviour>merge</ItemBehaviour>
Expand Down Expand Up @@ -900,7 +900,7 @@
<TableCategory>
<ItemID>DICTIONARY</ItemID>
<ItemName>DICTIONARY</ItemName>
<LayerId>200</LayerId>
<LayerId>300</LayerId>
<ItemDescription>Connection to DICTIONARY</ItemDescription>
<IsMandatory>false</IsMandatory>
<ItemBehaviour>merge</ItemBehaviour>
Expand Down
59 changes: 39 additions & 20 deletions src/providers/checkedOutTreeDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE
* @param xmlDS XML dataset as string
* @param service EnterpriseService
* @returns CheckedOutTreeDataProvider
*/
*/
constructor(xmlDS: string, private service: EnterpriseService) {
this.data = this.getDataObject(xmlDS);
}
Expand All @@ -44,7 +44,7 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE
);
treeItem.iconPath = item.iconPath;
treeItem.contextValue = item.type;
let language = item.language? ", Language: " + item.language : "";
let language = item.language ? ", Language: " + item.language : "";
treeItem.label = item.checkedOutBy ? `${item.label} (Checked out by ${item.checkedOutBy}${language})` : item.label;
treeItem.resourceUri = this.getItemResource(item);
treeItem.tooltip = item.tooltip ?? item.label?.toString() ?? "";
Expand Down Expand Up @@ -78,10 +78,10 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE
}

/**
* Get the icon path for the tree view item.
* @param type Type of the tree view item.
* @returns Icon path.
*/
* Get the icon path for the tree view item.
* @param type Type of the tree view item.
* @returns Icon path.
*/
private getIconForType(type: EnterpriseItemType): any {
switch (type) {
case EnterpriseItemType.Application:
Expand Down Expand Up @@ -173,10 +173,20 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE
const checkedOutBy = pendingCheckins[i].getElementsByTagName("CHECKEDOUTBY")[0]?.childNodes[0].nodeValue?.trim();
const childType = pendingCheckins[i].getElementsByTagName("CHILDTYPE")[0]?.childNodes[0].nodeValue?.trim();
const parentID = pendingCheckins[i].getElementsByTagName("PARENTID")[0]?.childNodes[0].nodeValue?.trim();
const parentName = pendingCheckins[i].getElementsByTagName("ParentName")[0]?.childNodes[0].nodeValue?.trim();
let parentName = pendingCheckins[i].getElementsByTagName("ParentName")[0]?.childNodes[0].nodeValue?.trim();

if (!parentName) {
// issue #143: in this instance the dataset XML has PARENTNAME in all uppercase so added it here as a fallback
parentName = pendingCheckins[i].getElementsByTagName("PARENTNAME")[0]?.childNodes[0].nodeValue?.trim();
}

const parentType = pendingCheckins[i].getElementsByTagName("PARENTTYPE")[0]?.childNodes[0].nodeValue?.trim();
const checkedOutDate = pendingCheckins[i].getElementsByTagName("CHECKEDOUTDATE")[0]?.childNodes[0].nodeValue?.trim();
const scriptLanguage = pendingCheckins[i].getElementsByTagName("SCRIPTLANGUAGE")[0]?.childNodes[0].nodeValue?.trim();
const checkedOutDate = pendingCheckins[i]
.getElementsByTagName("CHECKEDOUTDATE")[0]
?.childNodes[0].nodeValue?.trim();
const scriptLanguage = pendingCheckins[i]
.getElementsByTagName("SCRIPTLANGUAGE")[0]
?.childNodes[0].nodeValue?.trim();
const appCatName = pendingCheckins[i].getElementsByTagName("APPCATNAME")[0]?.childNodes[0].nodeValue?.trim();
const isSystem = pendingCheckins[i].getElementsByTagName("ISSYSTEM")[0]?.childNodes[0].nodeValue?.trim();
const language = pendingCheckins[i].getElementsByTagName("LANGID")[0]?.childNodes[0].nodeValue?.trim();
Expand Down Expand Up @@ -270,7 +280,8 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE
if (scriptLanguage === "HTML") {
// create "HTML Forms" node
var htmlFormsCatNode: TreeEnterpriseItem | undefined = appNode.children?.find(
(item: TreeEnterpriseItem) => item.label === "HTML Forms" && item.type === EnterpriseItemType.HTMLFormCategory
(item: TreeEnterpriseItem) =>
item.label === "HTML Forms" && item.type === EnterpriseItemType.HTMLFormCategory
);

if (!htmlFormsCatNode) {
Expand Down Expand Up @@ -436,7 +447,7 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE

if (!xfdFormXmlNode) {
let uri = `/Applications/${appCatName}/${parentName}/XFDForms/XML/${childName}`;

xfdFormXmlNode = new TreeEnterpriseItem(
EnterpriseItemType.XFDFormXML,
childName + " [XML]",
Expand Down Expand Up @@ -517,7 +528,8 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE
if (childType === "AppServerScript") {
// create "Server Scripts" node
var appServerScriptsNode: TreeEnterpriseItem | undefined = appNode.children?.find(
(item: TreeEnterpriseItem) => item.label === "Server Scripts" && item.type === EnterpriseItemType.AppServerScriptCategory
(item: TreeEnterpriseItem) =>
item.label === "Server Scripts" && item.type === EnterpriseItemType.AppServerScriptCategory
);

if (!appServerScriptsNode) {
Expand Down Expand Up @@ -572,7 +584,8 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE
if (childType === "AppClientScript") {
// create "Client Scripts" node
var appClientScriptsNode: TreeEnterpriseItem | undefined = appNode.children?.find(
(item: TreeEnterpriseItem) => item.label === "Client Scripts" && item.type === EnterpriseItemType.AppClientScriptCategory
(item: TreeEnterpriseItem) =>
item.label === "Client Scripts" && item.type === EnterpriseItemType.AppClientScriptCategory
);

if (!appClientScriptsNode) {
Expand Down Expand Up @@ -627,7 +640,8 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE
if (childType === "AppDataSourceScript") {
// create "Data Sources" node
var appDataSourcesNode: TreeEnterpriseItem | undefined = appNode.children?.find(
(item: TreeEnterpriseItem) => item.label === "Data Sources" && item.type === EnterpriseItemType.AppDataSourceCategory
(item: TreeEnterpriseItem) =>
item.label === "Data Sources" && item.type === EnterpriseItemType.AppDataSourceCategory
);

if (!appDataSourcesNode) {
Expand Down Expand Up @@ -682,7 +696,8 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE
if (parentType === "SSC") {
// create "Server Scripts" root node
var serverScriptsNode: TreeEnterpriseItem | undefined = data.find(
(item: TreeEnterpriseItem) => item.label === "Server Scripts" && item.type === EnterpriseItemType.ServerScriptCategory
(item: TreeEnterpriseItem) =>
item.label === "Server Scripts" && item.type === EnterpriseItemType.ServerScriptCategory
);

if (!serverScriptsNode) {
Expand All @@ -707,7 +722,8 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE

// create server script category node
var serverScriptCatNode: TreeEnterpriseItem | undefined = serverScriptsNode.children?.find(
(item: TreeEnterpriseItem) => item.label === parentName && item.type === EnterpriseItemType.ServerScriptCategory
(item: TreeEnterpriseItem) =>
item.label === parentName && item.type === EnterpriseItemType.ServerScriptCategory
);

if (!serverScriptCatNode) {
Expand Down Expand Up @@ -762,7 +778,8 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE
if (parentType === "CSC") {
// create "Client Scripts" root node
var clientScriptsNode: TreeEnterpriseItem | undefined = data.find(
(item: TreeEnterpriseItem) => item.label === "Client Scripts" && item.type === EnterpriseItemType.ClientScriptCategory
(item: TreeEnterpriseItem) =>
item.label === "Client Scripts" && item.type === EnterpriseItemType.ClientScriptCategory
);

if (!clientScriptsNode) {
Expand All @@ -787,7 +804,8 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE

// create client script category node
var clientScriptCatNode: TreeEnterpriseItem | undefined = clientScriptsNode.children?.find(
(item: TreeEnterpriseItem) => item.label === parentName && item.type === EnterpriseItemType.ClientScriptCategory
(item: TreeEnterpriseItem) =>
item.label === parentName && item.type === EnterpriseItemType.ClientScriptCategory
);

if (!clientScriptCatNode) {
Expand Down Expand Up @@ -842,7 +860,8 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE
if (parentType === "DSC") {
// create "Data Sources" category node
var dataSourcesNode: TreeEnterpriseItem | undefined = data.find(
(item: TreeEnterpriseItem) => item.label === "Data Sources" && item.type === EnterpriseItemType.DataSourceCategory
(item: TreeEnterpriseItem) =>
item.label === "Data Sources" && item.type === EnterpriseItemType.DataSourceCategory
);

if (!dataSourcesNode) {
Expand All @@ -860,7 +879,7 @@ export class CheckedOutTreeDataProvider implements vscode.TreeDataProvider<TreeE
dataSourcesNode.guid = "";
dataSourcesNode.checkedOutBy = "";
dataSourcesNode.filePath = "";
dataSourcesNode.isSystem = isSystem ? true : false;;
dataSourcesNode.isSystem = isSystem ? true : false;

data.push(dataSourcesNode as TreeEnterpriseItem);
}
Expand Down

0 comments on commit 442d641

Please sign in to comment.