@gravitee/ui-policy-studio-angular 16.2.0 → 16.2.1-apim-11674-edit-ps-flows-for-llm-proxy-fe880ee
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.
|
@@ -7,7 +7,7 @@ import { DivHarness, SpanHarness } from '@gravitee/ui-particles-angular/testing'
|
|
|
7
7
|
import { MatMenuHarness } from '@angular/material/menu/testing';
|
|
8
8
|
import { MatInputHarness } from '@angular/material/input/testing';
|
|
9
9
|
import { MatSelectHarness } from '@angular/material/select/testing';
|
|
10
|
-
import { GioFormTagsInputHarness } from '@gravitee/ui-particles-angular';
|
|
10
|
+
import { GioFormTagsInputHarness, GioFormAutocompleteInputHarness } from '@gravitee/ui-particles-angular';
|
|
11
11
|
import { MatSlideToggleHarness } from '@angular/material/slide-toggle/testing';
|
|
12
12
|
import { MatTooltipHarness } from '@angular/material/tooltip/testing';
|
|
13
13
|
import { MatChipListboxHarness } from '@angular/material/chips/testing';
|
|
@@ -155,7 +155,7 @@ function fakeMcpFlow(modifier) {
|
|
|
155
155
|
function fakeLlmFlow(modifier) {
|
|
156
156
|
const httpSelector = {
|
|
157
157
|
type: 'HTTP',
|
|
158
|
-
path: '/
|
|
158
|
+
path: '/models',
|
|
159
159
|
pathOperator: 'EQUALS',
|
|
160
160
|
methods: ['GET'],
|
|
161
161
|
};
|
|
@@ -1786,7 +1786,7 @@ class GioPolicyStudioFlowLlmFormDialogHarness extends ComponentHarness {
|
|
|
1786
1786
|
this.getCancelBtn = this.locatorFor(MatButtonHarness.with({ selector: '.actions__cancelBtn' }));
|
|
1787
1787
|
this.nameInput = this.locatorFor(MatInputHarness.with({ selector: '[formControlName="name"]' }));
|
|
1788
1788
|
this.pathOperatorInput = this.locatorFor(MatSelectHarness.with({ selector: '[formControlName="pathOperator"]' }));
|
|
1789
|
-
this.pathInput = this.locatorFor(
|
|
1789
|
+
this.pathInput = this.locatorFor(GioFormAutocompleteInputHarness.with({ selector: '[formControlName="path"]' }));
|
|
1790
1790
|
this.methodsInput = this.locatorFor(GioFormTagsInputHarness.with({ selector: '[formControlName="methods"]' }));
|
|
1791
1791
|
this.conditionInput = this.locatorFor(MatInputHarness.with({ selector: '[formControlName="condition"]' }));
|
|
1792
1792
|
}
|
|
@@ -1807,13 +1807,29 @@ class GioPolicyStudioFlowLlmFormDialogHarness extends ComponentHarness {
|
|
|
1807
1807
|
}
|
|
1808
1808
|
await pathOperatorInput.clickOptions({ text: new RegExp(flow.pathOperator, 'i') });
|
|
1809
1809
|
}
|
|
1810
|
-
if (flow.path) {
|
|
1810
|
+
if (flow.path !== undefined) {
|
|
1811
|
+
const pathValue = flow.path.startsWith('/') ? flow.path.substring(1) : flow.path;
|
|
1811
1812
|
const input = await this.pathInput();
|
|
1812
|
-
|
|
1813
|
+
// Try to use autocomplete selection if the path matches an option
|
|
1814
|
+
try {
|
|
1815
|
+
await input.focus();
|
|
1816
|
+
await input.setValue(pathValue);
|
|
1817
|
+
const autocomplete = await input.getMatAutocompleteHarness();
|
|
1818
|
+
if (autocomplete && (await autocomplete.isOpen())) {
|
|
1819
|
+
const options = await input.getAutocompleteOptions();
|
|
1820
|
+
const matchingOption = options.find(opt => opt === `/${pathValue}` || opt === pathValue);
|
|
1821
|
+
if (matchingOption) {
|
|
1822
|
+
await input.selectOption(matchingOption);
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
catch {
|
|
1827
|
+
// Fallback to just setting the value
|
|
1828
|
+
await input.setValue(pathValue);
|
|
1829
|
+
}
|
|
1813
1830
|
}
|
|
1814
1831
|
if (flow.methods) {
|
|
1815
1832
|
const methodsInput = await this.methodsInput();
|
|
1816
|
-
await methodsInput.removeTag('ALL');
|
|
1817
1833
|
for (const method of flow.methods) {
|
|
1818
1834
|
await methodsInput.addTag(method);
|
|
1819
1835
|
}
|