Skip to content

Commit

Permalink
Merge pull request #1220 from qoretechnologies/develop
Browse files Browse the repository at this point in the history
v4.3.2
  • Loading branch information
Foxhoundn authored Oct 4, 2023
2 parents 7b44ec5 + eacd8c1 commit 6551335
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Version 4.3.2

#### Bug fixes

- Fixed a bug where duplicated config items would be shown in the WebView & saved in YAML

## Version 4.3.1

#### Bug fixes
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ Qorus developer tools for the [Qorus Integration Engine](https://qoretechnologie
This extension makes it possible to easily create, deploy, and test Qorus interfaces directly from the Visual Studio Code editor.
It is a perfect tool for creating no-code solutions for the Qorus Integration Engine. The Qorus Developer Tools extension enables creating, editing, and extending reusable IT and AI building blocks for advanced automation challenges.

## Version 4.3.2

#### Bug fixes

- Fixed a bug where duplicated config items would be shown in the WebView & saved in YAML

## Version 4.3.1

#### Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "4.3.1",
"version": "4.3.2",
"private": false,
"dependencies": {
"@andrewhead/python-program-analysis": "^0.4.8",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "qorus-vscode",
"displayName": "Qorus Developer Tools",
"description": "Qorus Integration Engine developer tools",
"version": "4.3.1",
"version": "4.3.2",
"publisher": "qoretechnologies",
"author": {
"name": "Qore Technologies",
Expand Down
20 changes: 19 additions & 1 deletion src/QorusProjectInterfaceInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,18 @@ export class QorusProjectInterfaceInfo {
this.code_info.waitForPending(['yaml'], 500).then(() => this.getConfigItemsImpl(params));
};

public static removeDuplicateConfigItems(items) {
return items.reduce((newItems, item) => {
const itemIndex = newItems.findIndex((existingItem) => existingItem.name === item.name);

if (itemIndex === -1) {
return [...newItems, item];
} else {
return newItems;
}
}, []);
}

private getConfigItemsImpl = ({
'base-class-name': base_class_name,
classes,
Expand Down Expand Up @@ -1110,9 +1122,15 @@ export class QorusProjectInterfaceInfo {
)
);

// #issue #1218
// remove config items with the same name
local_items = QorusProjectInterfaceInfo.removeDuplicateConfigItems(local_items);
global_items = QorusProjectInterfaceInfo.removeDuplicateConfigItems(global_items);

let message: any;
if (iface_kind === 'workflow') {
const workflow_items = local_items.map((item) => checkValueLevel({ ...item }, 'workflow'));
let workflow_items = local_items.map((item) => checkValueLevel({ ...item }, 'workflow'));
workflow_items = QorusProjectInterfaceInfo.removeDuplicateConfigItems(workflow_items);

message = {
action: 'return-config-items',
Expand Down
6 changes: 5 additions & 1 deletion src/interface_creator/InterfaceCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { t } from 'ttag';
import { Position } from 'vscode';
import { projects } from '../QorusProject';
import { QorusProjectCodeInfo } from '../QorusProjectCodeInfo';
import { QorusProjectInterfaceInfo } from '../QorusProjectInterfaceInfo';
import { qorus_webview } from '../QorusWebview';
import * as globals from '../global_config_item_values';
import { isLangClientAvailable } from '../qore_vscode';
Expand Down Expand Up @@ -615,7 +616,7 @@ export abstract class InterfaceCreator {
): string => {
let result: string = `${indent.repeat(indent_level)}config-items:\n`;

items = items.filter(
items = [...items].filter(
(item) =>
!item.parent ||
InterfaceCreator.checkParentConfigItem(
Expand All @@ -626,6 +627,9 @@ export abstract class InterfaceCreator {
)
);

// Issue #1218: remove duplicate config items
items = QorusProjectInterfaceInfo.removeDuplicateConfigItems(items);

for (const item of [...items]) {
result += `${indent.repeat(indent_level)}${list_indent}name: ${item.name}\n`;

Expand Down

0 comments on commit 6551335

Please sign in to comment.