@orchestrator-ui/orchestrator-ui-components 5.9.0 → 6.0.0
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.
- package/.turbo/turbo-build.log +8 -8
- package/.turbo/turbo-lint.log +10 -1
- package/.turbo/turbo-test.log +8 -8
- package/CHANGELOG.md +6 -0
- package/__mocks__/@copilotkit/react-core.js +9 -0
- package/__mocks__/@copilotkit/react-ui.js +11 -0
- package/dist/index.d.ts +1429 -2
- package/dist/index.js +2977 -19
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
- package/src/components/WfoAgent/FilterDisplay/FilterDisplay.tsx +182 -0
- package/src/components/WfoAgent/FilterDisplay/index.ts +1 -0
- package/src/components/WfoAgent/FilterDisplay/styles.ts +62 -0
- package/src/components/WfoAgent/WfoAgent/WfoAgent.tsx +100 -0
- package/src/components/WfoAgent/WfoAgent/index.ts +1 -0
- package/src/components/WfoAgent/index.ts +2 -0
- package/src/components/WfoSearchPage/WfoConditionRow/WfoConditionRow.tsx +388 -0
- package/src/components/WfoSearchPage/WfoConditionRow/WfoFieldSelector.tsx +43 -0
- package/src/components/WfoSearchPage/WfoConditionRow/WfoOperatorSelector.tsx +100 -0
- package/src/components/WfoSearchPage/WfoConditionRow/WfoPathChips.tsx +193 -0
- package/src/components/WfoSearchPage/WfoConditionRow/WfoPathSelector.tsx +54 -0
- package/src/components/WfoSearchPage/WfoConditionRow/WfoRenderFunctions.tsx +107 -0
- package/src/components/WfoSearchPage/WfoConditionRow/WfoSelectedPathDisplay.tsx +75 -0
- package/src/components/WfoSearchPage/WfoConditionRow/index.ts +11 -0
- package/src/components/WfoSearchPage/WfoConditionRow/types.ts +84 -0
- package/src/components/WfoSearchPage/WfoConditionRow/utils.ts +63 -0
- package/src/components/WfoSearchPage/WfoFilterGroup/WfoFilterGroup.tsx +238 -0
- package/src/components/WfoSearchPage/WfoFilterGroup/index.ts +1 -0
- package/src/components/WfoSearchPage/WfoSearch/WfoSearch.tsx +453 -0
- package/src/components/WfoSearchPage/WfoSearch/index.ts +1 -0
- package/src/components/WfoSearchPage/WfoSearchResults/WfoHighlightedText.tsx +63 -0
- package/src/components/WfoSearchPage/WfoSearchResults/WfoPathBreadcrumb.tsx +80 -0
- package/src/components/WfoSearchPage/WfoSearchResults/WfoSearchEmptyState.tsx +24 -0
- package/src/components/WfoSearchPage/WfoSearchResults/WfoSearchLoadingState.tsx +24 -0
- package/src/components/WfoSearchPage/WfoSearchResults/WfoSearchMetadataHeader.tsx +24 -0
- package/src/components/WfoSearchPage/WfoSearchResults/WfoSearchPaginationInfo.tsx +107 -0
- package/src/components/WfoSearchPage/WfoSearchResults/WfoSearchResultItem.tsx +157 -0
- package/src/components/WfoSearchPage/WfoSearchResults/WfoSearchResults.tsx +65 -0
- package/src/components/WfoSearchPage/WfoSearchResults/WfoSubscriptionDetailModal.tsx +55 -0
- package/src/components/WfoSearchPage/WfoSearchResults/index.ts +10 -0
- package/src/components/WfoSearchPage/WfoValueControl/WfoValueControl.tsx +247 -0
- package/src/components/WfoSearchPage/WfoValueControl/index.ts +1 -0
- package/src/components/WfoSearchPage/constants.ts +17 -0
- package/src/components/WfoSearchPage/index.ts +6 -0
- package/src/components/WfoSearchPage/utils.ts +271 -0
- package/src/components/index.ts +2 -0
- package/src/configuration/version.ts +1 -1
- package/src/hooks/useDebounce.ts +21 -0
- package/src/hooks/usePathAutoComplete.ts +133 -0
- package/src/hooks/useSearch.ts +83 -0
- package/src/hooks/useSearchPagination.ts +148 -0
- package/src/hooks/useUrlParams.ts +120 -0
- package/src/messages/en-GB.json +77 -0
- package/src/rtk/endpoints/index.ts +1 -0
- package/src/rtk/endpoints/search.ts +90 -0
- package/src/types/index.ts +1 -0
- package/src/types/search.ts +215 -0
package/dist/index.js
CHANGED
|
@@ -4922,10 +4922,10 @@ var require_markup = __commonJS({
|
|
|
4922
4922
|
var require_css = __commonJS({
|
|
4923
4923
|
"../../node_modules/refractor/lang/css.js"(exports, module) {
|
|
4924
4924
|
"use strict";
|
|
4925
|
-
module.exports =
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
function
|
|
4925
|
+
module.exports = css54;
|
|
4926
|
+
css54.displayName = "css";
|
|
4927
|
+
css54.aliases = [];
|
|
4928
|
+
function css54(Prism) {
|
|
4929
4929
|
;
|
|
4930
4930
|
(function(Prism2) {
|
|
4931
4931
|
var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
@@ -5192,7 +5192,7 @@ var require_core = __commonJS({
|
|
|
5192
5192
|
var decode = require_parse_entities();
|
|
5193
5193
|
var Prism = require_prism_core();
|
|
5194
5194
|
var markup = require_markup();
|
|
5195
|
-
var
|
|
5195
|
+
var css54 = require_css();
|
|
5196
5196
|
var clike = require_clike();
|
|
5197
5197
|
var js = require_javascript();
|
|
5198
5198
|
restore();
|
|
@@ -5208,7 +5208,7 @@ var require_core = __commonJS({
|
|
|
5208
5208
|
refract.registered = registered;
|
|
5209
5209
|
refract.listLanguages = listLanguages;
|
|
5210
5210
|
register(markup);
|
|
5211
|
-
register(
|
|
5211
|
+
register(css54);
|
|
5212
5212
|
register(clike);
|
|
5213
5213
|
register(js);
|
|
5214
5214
|
refract.util.encode = encode;
|
|
@@ -15304,10 +15304,10 @@ var require_jsstacktrace = __commonJS({
|
|
|
15304
15304
|
var require_jsx = __commonJS({
|
|
15305
15305
|
"../../node_modules/refractor/lang/jsx.js"(exports, module) {
|
|
15306
15306
|
"use strict";
|
|
15307
|
-
module.exports =
|
|
15308
|
-
|
|
15309
|
-
|
|
15310
|
-
function
|
|
15307
|
+
module.exports = jsx292;
|
|
15308
|
+
jsx292.displayName = "jsx";
|
|
15309
|
+
jsx292.aliases = [];
|
|
15310
|
+
function jsx292(Prism) {
|
|
15311
15311
|
;
|
|
15312
15312
|
(function(Prism2) {
|
|
15313
15313
|
var javascript = Prism2.util.clone(Prism2.languages.javascript);
|
|
@@ -26801,7 +26801,7 @@ var PolicyResource = /* @__PURE__ */ ((PolicyResource2) => {
|
|
|
26801
26801
|
})(PolicyResource || {});
|
|
26802
26802
|
|
|
26803
26803
|
// src/configuration/version.ts
|
|
26804
|
-
var ORCHESTRATOR_UI_LIBRARY_VERSION = "
|
|
26804
|
+
var ORCHESTRATOR_UI_LIBRARY_VERSION = "6.0.0";
|
|
26805
26805
|
|
|
26806
26806
|
// src/types/types.ts
|
|
26807
26807
|
var EngineStatus = /* @__PURE__ */ ((EngineStatus3) => {
|
|
@@ -27166,10 +27166,10 @@ function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, une
|
|
|
27166
27166
|
function assertReducerShape(reducers) {
|
|
27167
27167
|
Object.keys(reducers).forEach((key) => {
|
|
27168
27168
|
const reducer = reducers[key];
|
|
27169
|
-
const
|
|
27169
|
+
const initialState4 = reducer(void 0, {
|
|
27170
27170
|
type: actionTypes_default.INIT
|
|
27171
27171
|
});
|
|
27172
|
-
if (typeof
|
|
27172
|
+
if (typeof initialState4 === "undefined") {
|
|
27173
27173
|
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(12) : `The slice reducer for key "${key}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);
|
|
27174
27174
|
}
|
|
27175
27175
|
if (typeof reducer(void 0, {
|
|
@@ -29109,7 +29109,7 @@ function executeReducerBuilderCallback(builderCallback) {
|
|
|
29109
29109
|
function isStateFunction(x) {
|
|
29110
29110
|
return typeof x === "function";
|
|
29111
29111
|
}
|
|
29112
|
-
function createReducer(
|
|
29112
|
+
function createReducer(initialState4, mapOrBuilderCallback) {
|
|
29113
29113
|
if (process.env.NODE_ENV !== "production") {
|
|
29114
29114
|
if (typeof mapOrBuilderCallback === "object") {
|
|
29115
29115
|
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(8) : "The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");
|
|
@@ -29117,10 +29117,10 @@ function createReducer(initialState3, mapOrBuilderCallback) {
|
|
|
29117
29117
|
}
|
|
29118
29118
|
let [actionsMap, finalActionMatchers, finalDefaultCaseReducer] = executeReducerBuilderCallback(mapOrBuilderCallback);
|
|
29119
29119
|
let getInitialState;
|
|
29120
|
-
if (isStateFunction(
|
|
29121
|
-
getInitialState = () => freezeDraftable(
|
|
29120
|
+
if (isStateFunction(initialState4)) {
|
|
29121
|
+
getInitialState = () => freezeDraftable(initialState4());
|
|
29122
29122
|
} else {
|
|
29123
|
-
const frozenInitialState = freezeDraftable(
|
|
29123
|
+
const frozenInitialState = freezeDraftable(initialState4);
|
|
29124
29124
|
getInitialState = () => frozenInitialState;
|
|
29125
29125
|
}
|
|
29126
29126
|
function reducer(state = getInitialState(), action) {
|
|
@@ -35499,6 +35499,234 @@ var fileUploadApi = orchestratorApi.injectEndpoints({
|
|
|
35499
35499
|
});
|
|
35500
35500
|
var { useUploadFileMutation } = fileUploadApi;
|
|
35501
35501
|
|
|
35502
|
+
// src/components/WfoSearchPage/utils.ts
|
|
35503
|
+
function isSubscriptionSearchResult(item) {
|
|
35504
|
+
return "subscription" in item && typeof item.subscription === "object";
|
|
35505
|
+
}
|
|
35506
|
+
function isProcessSearchResult(item) {
|
|
35507
|
+
return "process" in item && typeof item.process === "object";
|
|
35508
|
+
}
|
|
35509
|
+
function isProductSearchResult(item) {
|
|
35510
|
+
return "product" in item && typeof item.product === "object";
|
|
35511
|
+
}
|
|
35512
|
+
function isWorkflowSearchResult(item) {
|
|
35513
|
+
return "workflow" in item && typeof item.workflow === "object";
|
|
35514
|
+
}
|
|
35515
|
+
var isCondition = (item) => {
|
|
35516
|
+
return "path" in item && "condition" in item;
|
|
35517
|
+
};
|
|
35518
|
+
var ENDPOINT_PATHS = {
|
|
35519
|
+
PROCESS: "processes",
|
|
35520
|
+
PRODUCT: "products",
|
|
35521
|
+
WORKFLOW: "workflows",
|
|
35522
|
+
SUBSCRIPTION: "subscriptions"
|
|
35523
|
+
};
|
|
35524
|
+
var getEndpointPath = (entityType) => {
|
|
35525
|
+
return ENDPOINT_PATHS[entityType] || ENDPOINT_PATHS.SUBSCRIPTION;
|
|
35526
|
+
};
|
|
35527
|
+
var getDisplayText = (item) => {
|
|
35528
|
+
if (isSubscriptionSearchResult(item)) {
|
|
35529
|
+
return item.subscription.description || "Subscription";
|
|
35530
|
+
}
|
|
35531
|
+
if (isProcessSearchResult(item)) {
|
|
35532
|
+
return item.process.workflowName;
|
|
35533
|
+
}
|
|
35534
|
+
if (isProductSearchResult(item)) {
|
|
35535
|
+
return item.product.name;
|
|
35536
|
+
}
|
|
35537
|
+
if (isWorkflowSearchResult(item)) {
|
|
35538
|
+
return item.workflow.name;
|
|
35539
|
+
}
|
|
35540
|
+
return "Unknown result type";
|
|
35541
|
+
};
|
|
35542
|
+
var getRecordId = (result) => {
|
|
35543
|
+
if (isSubscriptionSearchResult(result)) {
|
|
35544
|
+
return result.subscription.subscription_id;
|
|
35545
|
+
}
|
|
35546
|
+
if (isProductSearchResult(result)) {
|
|
35547
|
+
return result.product.product_id;
|
|
35548
|
+
}
|
|
35549
|
+
if (isProcessSearchResult(result)) {
|
|
35550
|
+
return result.process.processId;
|
|
35551
|
+
}
|
|
35552
|
+
if (isWorkflowSearchResult(result)) {
|
|
35553
|
+
return result.workflow.name;
|
|
35554
|
+
}
|
|
35555
|
+
return "";
|
|
35556
|
+
};
|
|
35557
|
+
var findResultIndexById = (results, recordId) => {
|
|
35558
|
+
return results.findIndex((result) => {
|
|
35559
|
+
if (isSubscriptionSearchResult(result)) {
|
|
35560
|
+
return result.subscription.subscription_id === recordId;
|
|
35561
|
+
}
|
|
35562
|
+
if (isProductSearchResult(result)) {
|
|
35563
|
+
return result.product.product_id === recordId;
|
|
35564
|
+
}
|
|
35565
|
+
if (isProcessSearchResult(result)) {
|
|
35566
|
+
return result.process.processId === recordId;
|
|
35567
|
+
}
|
|
35568
|
+
if (isWorkflowSearchResult(result)) {
|
|
35569
|
+
return result.workflow.name === recordId;
|
|
35570
|
+
}
|
|
35571
|
+
return false;
|
|
35572
|
+
});
|
|
35573
|
+
};
|
|
35574
|
+
var getDetailUrl = (result, baseUrl) => {
|
|
35575
|
+
if (isSubscriptionSearchResult(result)) {
|
|
35576
|
+
return `${baseUrl}/subscriptions/${result.subscription.subscription_id}`;
|
|
35577
|
+
}
|
|
35578
|
+
if (isProductSearchResult(result)) {
|
|
35579
|
+
return `${baseUrl}/products/${result.product.product_id}`;
|
|
35580
|
+
}
|
|
35581
|
+
if (isProcessSearchResult(result)) {
|
|
35582
|
+
return `${baseUrl}/processes/${result.process.processId}`;
|
|
35583
|
+
}
|
|
35584
|
+
if (isWorkflowSearchResult(result)) {
|
|
35585
|
+
return `${baseUrl}/workflows/${result.workflow.name}`;
|
|
35586
|
+
}
|
|
35587
|
+
return "#";
|
|
35588
|
+
};
|
|
35589
|
+
var getDescription = (result) => {
|
|
35590
|
+
if (isSubscriptionSearchResult(result)) {
|
|
35591
|
+
return result.subscription.description;
|
|
35592
|
+
}
|
|
35593
|
+
if (isProductSearchResult(result)) {
|
|
35594
|
+
return result.product.description || result.product.name;
|
|
35595
|
+
}
|
|
35596
|
+
if (isWorkflowSearchResult(result)) {
|
|
35597
|
+
return result.workflow.description || result.workflow.name;
|
|
35598
|
+
}
|
|
35599
|
+
if (isProcessSearchResult(result)) {
|
|
35600
|
+
return result.process.workflowName;
|
|
35601
|
+
}
|
|
35602
|
+
return "Unknown";
|
|
35603
|
+
};
|
|
35604
|
+
var ENTITY_TABS = [
|
|
35605
|
+
{ id: "SUBSCRIPTION", label: "Subscriptions" },
|
|
35606
|
+
{ id: "PRODUCT", label: "Products" },
|
|
35607
|
+
{ id: "WORKFLOW", label: "Workflows" },
|
|
35608
|
+
{ id: "PROCESS", label: "Processes" }
|
|
35609
|
+
];
|
|
35610
|
+
var TYPE_COLOR_MAP = {
|
|
35611
|
+
string: "success",
|
|
35612
|
+
number: "primary",
|
|
35613
|
+
boolean: "warning",
|
|
35614
|
+
datetime: "accent",
|
|
35615
|
+
component: "primary"
|
|
35616
|
+
};
|
|
35617
|
+
var getTypeColor = (type, theme) => {
|
|
35618
|
+
const colorKey = TYPE_COLOR_MAP[type.toLowerCase()];
|
|
35619
|
+
return colorKey ? theme.colors[colorKey] : theme.colors.textSubdued;
|
|
35620
|
+
};
|
|
35621
|
+
var OPERATOR_MAP = {
|
|
35622
|
+
eq: { symbol: "=", description: "equals" },
|
|
35623
|
+
neq: { symbol: "\u2260", description: "not equals" },
|
|
35624
|
+
lt: { symbol: "<", description: "less than" },
|
|
35625
|
+
lte: { symbol: "\u2264", description: "less than or equal to" },
|
|
35626
|
+
gt: { symbol: ">", description: "greater than" },
|
|
35627
|
+
gte: { symbol: "\u2265", description: "greater than or equal to" },
|
|
35628
|
+
between: { symbol: "\u27F7", description: "between (range)" },
|
|
35629
|
+
has_component: { symbol: "\u2713", description: "has component" },
|
|
35630
|
+
not_has_component: { symbol: "\u2717", description: "does not have component" }
|
|
35631
|
+
};
|
|
35632
|
+
var BOOLEAN_OPERATOR_MAP = {
|
|
35633
|
+
eq: { symbol: "\u2713", description: "is true" },
|
|
35634
|
+
neq: { symbol: "\u2717", description: "is false" }
|
|
35635
|
+
};
|
|
35636
|
+
var getOperatorDisplay = (op, selectedPathInfo) => {
|
|
35637
|
+
if (selectedPathInfo?.type === "boolean" && BOOLEAN_OPERATOR_MAP[op]) {
|
|
35638
|
+
return BOOLEAN_OPERATOR_MAP[op];
|
|
35639
|
+
}
|
|
35640
|
+
return OPERATOR_MAP[op] || { symbol: op, description: op };
|
|
35641
|
+
};
|
|
35642
|
+
var getButtonColor = (op, pathInfo, condition) => {
|
|
35643
|
+
if (pathInfo?.type === "boolean") {
|
|
35644
|
+
const isSelected = op === "eq" ? condition.condition.value === true : condition.condition.value === false;
|
|
35645
|
+
return isSelected ? "primary" : "text";
|
|
35646
|
+
}
|
|
35647
|
+
return condition.condition.op === op ? "primary" : "text";
|
|
35648
|
+
};
|
|
35649
|
+
var getButtonFill = (op, pathInfo, condition) => {
|
|
35650
|
+
if (pathInfo?.type === "boolean") {
|
|
35651
|
+
return op === "eq" ? condition.condition.value === true : condition.condition.value === false;
|
|
35652
|
+
}
|
|
35653
|
+
return condition.condition.op === op;
|
|
35654
|
+
};
|
|
35655
|
+
var isFilterValid = (group) => {
|
|
35656
|
+
return group.children.every((child) => {
|
|
35657
|
+
if (isCondition(child)) {
|
|
35658
|
+
return child.path && child.condition.op && child.condition.value !== void 0;
|
|
35659
|
+
}
|
|
35660
|
+
return isFilterValid(child);
|
|
35661
|
+
});
|
|
35662
|
+
};
|
|
35663
|
+
var buildSearchParams = (debouncedQuery, selectedEntityTab, filterGroup, pageSize) => {
|
|
35664
|
+
const queryText = typeof debouncedQuery === "string" ? debouncedQuery : debouncedQuery?.text?.trim() || "";
|
|
35665
|
+
return {
|
|
35666
|
+
action: "select",
|
|
35667
|
+
entity_type: selectedEntityTab,
|
|
35668
|
+
query: queryText || "",
|
|
35669
|
+
filters: filterGroup?.children.length > 0 ? filterGroup : void 0,
|
|
35670
|
+
limit: pageSize
|
|
35671
|
+
};
|
|
35672
|
+
};
|
|
35673
|
+
|
|
35674
|
+
// src/rtk/endpoints/search.ts
|
|
35675
|
+
var searchApi = orchestratorApi.injectEndpoints({
|
|
35676
|
+
endpoints: (build) => ({
|
|
35677
|
+
search: build.mutation({
|
|
35678
|
+
query: (payload) => ({
|
|
35679
|
+
url: `search/${getEndpointPath(payload.entity_type)}`,
|
|
35680
|
+
method: "POST",
|
|
35681
|
+
body: payload,
|
|
35682
|
+
headers: {
|
|
35683
|
+
"Content-Type": "application/json"
|
|
35684
|
+
}
|
|
35685
|
+
}),
|
|
35686
|
+
extraOptions: {
|
|
35687
|
+
baseQueryType: "fetch" /* fetch */
|
|
35688
|
+
}
|
|
35689
|
+
}),
|
|
35690
|
+
searchWithPagination: build.mutation({
|
|
35691
|
+
query: ({ cursor, ...payload }) => ({
|
|
35692
|
+
url: `search/${getEndpointPath(payload.entity_type)}?cursor=${cursor}`,
|
|
35693
|
+
method: "POST",
|
|
35694
|
+
body: payload,
|
|
35695
|
+
headers: {
|
|
35696
|
+
"Content-Type": "application/json"
|
|
35697
|
+
}
|
|
35698
|
+
}),
|
|
35699
|
+
extraOptions: {
|
|
35700
|
+
baseQueryType: "fetch" /* fetch */
|
|
35701
|
+
}
|
|
35702
|
+
}),
|
|
35703
|
+
searchPaths: build.query({
|
|
35704
|
+
query: ({ q, entity_type }) => ({
|
|
35705
|
+
url: `search/paths?q=${encodeURIComponent(q)}&entity_type=${entity_type}`,
|
|
35706
|
+
method: "GET"
|
|
35707
|
+
}),
|
|
35708
|
+
extraOptions: {
|
|
35709
|
+
baseQueryType: "fetch" /* fetch */
|
|
35710
|
+
}
|
|
35711
|
+
}),
|
|
35712
|
+
searchDefinitions: build.query({
|
|
35713
|
+
query: () => ({
|
|
35714
|
+
url: "search/definitions",
|
|
35715
|
+
method: "GET"
|
|
35716
|
+
}),
|
|
35717
|
+
extraOptions: {
|
|
35718
|
+
baseQueryType: "fetch" /* fetch */
|
|
35719
|
+
}
|
|
35720
|
+
})
|
|
35721
|
+
})
|
|
35722
|
+
});
|
|
35723
|
+
var {
|
|
35724
|
+
useSearchMutation,
|
|
35725
|
+
useSearchWithPaginationMutation,
|
|
35726
|
+
useSearchPathsQuery,
|
|
35727
|
+
useSearchDefinitionsQuery
|
|
35728
|
+
} = searchApi;
|
|
35729
|
+
|
|
35502
35730
|
// src/hooks/useCheckEngineStatus.ts
|
|
35503
35731
|
var useCheckEngineStatus = () => {
|
|
35504
35732
|
const { data, isLoading, refetch } = useGetEngineStatusQuery();
|
|
@@ -39108,7 +39336,7 @@ var WfoHeaderBadge = ({
|
|
|
39108
39336
|
children,
|
|
39109
39337
|
...restProps
|
|
39110
39338
|
}) => {
|
|
39111
|
-
const
|
|
39339
|
+
const css54 = restProps.iconType ? {
|
|
39112
39340
|
height: 24,
|
|
39113
39341
|
display: "flex",
|
|
39114
39342
|
paddingLeft: 0
|
|
@@ -39116,7 +39344,7 @@ var WfoHeaderBadge = ({
|
|
|
39116
39344
|
height: 24,
|
|
39117
39345
|
display: "flex"
|
|
39118
39346
|
};
|
|
39119
|
-
return /* @__PURE__ */ jsx73(WfoBadge, { ...restProps, css:
|
|
39347
|
+
return /* @__PURE__ */ jsx73(WfoBadge, { ...restProps, css: css54, children });
|
|
39120
39348
|
};
|
|
39121
39349
|
|
|
39122
39350
|
// src/components/WfoBadges/WfoEnvironmentBadge/WfoEnvironmentBadge.tsx
|
|
@@ -55961,6 +56189,2610 @@ var WfoTableCodeBlock = ({
|
|
|
55961
56189
|
) });
|
|
55962
56190
|
};
|
|
55963
56191
|
|
|
56192
|
+
// src/components/WfoSearchPage/WfoSearch/WfoSearch.tsx
|
|
56193
|
+
import { useEffect as useEffect43, useState as useState64 } from "react";
|
|
56194
|
+
import { useTranslations as useTranslations104 } from "next-intl";
|
|
56195
|
+
import {
|
|
56196
|
+
EuiButton as EuiButton24,
|
|
56197
|
+
EuiCallOut as EuiCallOut3,
|
|
56198
|
+
EuiFieldSearch as EuiFieldSearch3,
|
|
56199
|
+
EuiFlexGroup as EuiFlexGroup45,
|
|
56200
|
+
EuiFlexItem as EuiFlexItem52,
|
|
56201
|
+
EuiPanel as EuiPanel20,
|
|
56202
|
+
EuiSpacer as EuiSpacer32,
|
|
56203
|
+
EuiTab as EuiTab4,
|
|
56204
|
+
EuiTabs as EuiTabs4,
|
|
56205
|
+
EuiText as EuiText60
|
|
56206
|
+
} from "@elastic/eui";
|
|
56207
|
+
|
|
56208
|
+
// src/hooks/useDebounce.ts
|
|
56209
|
+
import { useEffect as useEffect38, useState as useState57 } from "react";
|
|
56210
|
+
function useDebounce(value, delay) {
|
|
56211
|
+
const [debouncedValue, setDebouncedValue] = useState57(value);
|
|
56212
|
+
useEffect38(() => {
|
|
56213
|
+
if (delay <= 0) {
|
|
56214
|
+
setDebouncedValue(value);
|
|
56215
|
+
return;
|
|
56216
|
+
}
|
|
56217
|
+
const handler = setTimeout(() => {
|
|
56218
|
+
setDebouncedValue(value);
|
|
56219
|
+
}, delay);
|
|
56220
|
+
return () => {
|
|
56221
|
+
clearTimeout(handler);
|
|
56222
|
+
};
|
|
56223
|
+
}, [value, delay]);
|
|
56224
|
+
return debouncedValue;
|
|
56225
|
+
}
|
|
56226
|
+
|
|
56227
|
+
// src/hooks/useSearch.ts
|
|
56228
|
+
import { useEffect as useEffect39, useState as useState58 } from "react";
|
|
56229
|
+
var useSearch = (query, entityType, filterGroup, limit) => {
|
|
56230
|
+
const [results, setResults] = useState58({
|
|
56231
|
+
data: [],
|
|
56232
|
+
page_info: { has_next_page: false, next_page_cursor: null },
|
|
56233
|
+
search_metadata: { search_type: null, description: null }
|
|
56234
|
+
});
|
|
56235
|
+
const [triggerSearch, { isLoading, isError: isError2 }] = useSearchMutation();
|
|
56236
|
+
useEffect39(() => {
|
|
56237
|
+
const queryText = typeof query === "string" ? query : query.text?.trim() || "";
|
|
56238
|
+
const hasFilters = filterGroup && filterGroup.children.length > 0;
|
|
56239
|
+
if (queryText.length < 2 && !hasFilters) {
|
|
56240
|
+
setResults({
|
|
56241
|
+
data: [],
|
|
56242
|
+
page_info: { has_next_page: false, next_page_cursor: null },
|
|
56243
|
+
search_metadata: { search_type: null, description: null }
|
|
56244
|
+
});
|
|
56245
|
+
return;
|
|
56246
|
+
}
|
|
56247
|
+
const performSearch = async () => {
|
|
56248
|
+
try {
|
|
56249
|
+
const result = await triggerSearch({
|
|
56250
|
+
action: "select",
|
|
56251
|
+
entity_type: entityType,
|
|
56252
|
+
query: queryText,
|
|
56253
|
+
filters: filterGroup && filterGroup.children.length > 0 ? filterGroup : void 0,
|
|
56254
|
+
limit
|
|
56255
|
+
}).unwrap();
|
|
56256
|
+
setResults({
|
|
56257
|
+
data: result.data || [],
|
|
56258
|
+
page_info: {
|
|
56259
|
+
has_next_page: result.page_info?.has_next_page || false,
|
|
56260
|
+
next_page_cursor: result.page_info?.next_page_cursor || null
|
|
56261
|
+
},
|
|
56262
|
+
search_metadata: {
|
|
56263
|
+
search_type: result.search_metadata?.search_type || null,
|
|
56264
|
+
description: result.search_metadata?.description || null
|
|
56265
|
+
}
|
|
56266
|
+
});
|
|
56267
|
+
} catch (error) {
|
|
56268
|
+
console.error("Search error:", error);
|
|
56269
|
+
setResults({
|
|
56270
|
+
data: [],
|
|
56271
|
+
page_info: { has_next_page: false, next_page_cursor: null },
|
|
56272
|
+
search_metadata: { search_type: null, description: null }
|
|
56273
|
+
});
|
|
56274
|
+
}
|
|
56275
|
+
};
|
|
56276
|
+
performSearch();
|
|
56277
|
+
}, [query, entityType, filterGroup, limit, triggerSearch]);
|
|
56278
|
+
return {
|
|
56279
|
+
results,
|
|
56280
|
+
loading: isLoading,
|
|
56281
|
+
error: isError2 ? "Search failed" : null,
|
|
56282
|
+
setResults
|
|
56283
|
+
};
|
|
56284
|
+
};
|
|
56285
|
+
|
|
56286
|
+
// src/hooks/useSearchPagination.ts
|
|
56287
|
+
import { useCallback as useCallback10, useState as useState59 } from "react";
|
|
56288
|
+
var useSearchPagination = (debouncedQuery, selectedEntityTab, filterGroup, pageSize, results, setResults) => {
|
|
56289
|
+
const [currentPage, setCurrentPage] = useState59(1);
|
|
56290
|
+
const [pageHistory, setPageHistory] = useState59([]);
|
|
56291
|
+
const [error, setError] = useState59(null);
|
|
56292
|
+
const [isLoadingMore, setIsLoadingMore] = useState59(false);
|
|
56293
|
+
const [triggerSearchPagination] = useSearchWithPaginationMutation();
|
|
56294
|
+
const handleNextPage = useCallback10(
|
|
56295
|
+
async (nextPageCursor) => {
|
|
56296
|
+
if (!nextPageCursor || isLoadingMore) return;
|
|
56297
|
+
setIsLoadingMore(true);
|
|
56298
|
+
setPageHistory((prev) => [
|
|
56299
|
+
...prev.filter((p) => p.page !== currentPage),
|
|
56300
|
+
{
|
|
56301
|
+
page: currentPage,
|
|
56302
|
+
results: results.data,
|
|
56303
|
+
cursor: results.page_info.next_page_cursor
|
|
56304
|
+
}
|
|
56305
|
+
]);
|
|
56306
|
+
try {
|
|
56307
|
+
setError(null);
|
|
56308
|
+
const searchParams = buildSearchParams(
|
|
56309
|
+
debouncedQuery,
|
|
56310
|
+
selectedEntityTab,
|
|
56311
|
+
filterGroup,
|
|
56312
|
+
pageSize
|
|
56313
|
+
);
|
|
56314
|
+
const res = await triggerSearchPagination({
|
|
56315
|
+
...searchParams,
|
|
56316
|
+
cursor: nextPageCursor
|
|
56317
|
+
}).unwrap();
|
|
56318
|
+
setResults({
|
|
56319
|
+
data: res.data || [],
|
|
56320
|
+
page_info: {
|
|
56321
|
+
has_next_page: res.page_info.has_next_page,
|
|
56322
|
+
next_page_cursor: res.page_info.next_page_cursor
|
|
56323
|
+
},
|
|
56324
|
+
search_metadata: {
|
|
56325
|
+
search_type: res.search_metadata.search_type,
|
|
56326
|
+
description: res.search_metadata.description
|
|
56327
|
+
}
|
|
56328
|
+
});
|
|
56329
|
+
setCurrentPage((prev) => prev + 1);
|
|
56330
|
+
} catch (error2) {
|
|
56331
|
+
const errorMessage = error2 instanceof Error ? error2.message : "An unexpected error occurred while loading the next page";
|
|
56332
|
+
setError(errorMessage);
|
|
56333
|
+
console.error("Load next page error:", error2);
|
|
56334
|
+
} finally {
|
|
56335
|
+
setIsLoadingMore(false);
|
|
56336
|
+
}
|
|
56337
|
+
},
|
|
56338
|
+
[
|
|
56339
|
+
currentPage,
|
|
56340
|
+
results.data,
|
|
56341
|
+
results.page_info.next_page_cursor,
|
|
56342
|
+
isLoadingMore,
|
|
56343
|
+
debouncedQuery,
|
|
56344
|
+
selectedEntityTab,
|
|
56345
|
+
filterGroup,
|
|
56346
|
+
pageSize,
|
|
56347
|
+
setResults,
|
|
56348
|
+
triggerSearchPagination
|
|
56349
|
+
]
|
|
56350
|
+
);
|
|
56351
|
+
const handlePrevPage = useCallback10(() => {
|
|
56352
|
+
const previousPage = pageHistory.find(
|
|
56353
|
+
(p) => p.page === currentPage - 1
|
|
56354
|
+
);
|
|
56355
|
+
if (previousPage) {
|
|
56356
|
+
setResults({
|
|
56357
|
+
data: previousPage.results,
|
|
56358
|
+
page_info: {
|
|
56359
|
+
has_next_page: true,
|
|
56360
|
+
next_page_cursor: previousPage.cursor
|
|
56361
|
+
},
|
|
56362
|
+
search_metadata: results.search_metadata
|
|
56363
|
+
});
|
|
56364
|
+
setCurrentPage((prev) => prev - 1);
|
|
56365
|
+
setPageHistory((prev) => prev.filter((p) => p.page < currentPage));
|
|
56366
|
+
}
|
|
56367
|
+
}, [currentPage, pageHistory, results.search_metadata, setResults]);
|
|
56368
|
+
const resetPagination = useCallback10(() => {
|
|
56369
|
+
setCurrentPage(1);
|
|
56370
|
+
setPageHistory([]);
|
|
56371
|
+
}, []);
|
|
56372
|
+
return {
|
|
56373
|
+
currentPage,
|
|
56374
|
+
pageHistory,
|
|
56375
|
+
error,
|
|
56376
|
+
isLoadingMore,
|
|
56377
|
+
handleNextPage,
|
|
56378
|
+
handlePrevPage,
|
|
56379
|
+
resetPagination,
|
|
56380
|
+
setError
|
|
56381
|
+
};
|
|
56382
|
+
};
|
|
56383
|
+
|
|
56384
|
+
// src/hooks/useUrlParams.ts
|
|
56385
|
+
import { useCallback as useCallback11, useEffect as useEffect40, useState as useState60 } from "react";
|
|
56386
|
+
|
|
56387
|
+
// src/components/WfoSearchPage/constants.ts
|
|
56388
|
+
var DEFAULT_PAGE_SIZE2 = 5;
|
|
56389
|
+
var DEFAULT_DEBOUNCE_DELAY = 300;
|
|
56390
|
+
var SMALL_RESULT_THRESHOLD = 10;
|
|
56391
|
+
var LAYOUT_RATIOS = {
|
|
56392
|
+
RESULTS_GROW: 2,
|
|
56393
|
+
DETAIL_GROW: 3
|
|
56394
|
+
};
|
|
56395
|
+
var VALID_ENTITY_TYPES = [
|
|
56396
|
+
"SUBSCRIPTION",
|
|
56397
|
+
"PRODUCT",
|
|
56398
|
+
"WORKFLOW",
|
|
56399
|
+
"PROCESS"
|
|
56400
|
+
];
|
|
56401
|
+
var DEFAULT_ENTITY_TAB = "SUBSCRIPTION";
|
|
56402
|
+
|
|
56403
|
+
// src/hooks/useUrlParams.ts
|
|
56404
|
+
var useUrlParams = () => {
|
|
56405
|
+
const [urlParams, setUrlParams] = useState60(() => {
|
|
56406
|
+
if (typeof window !== "undefined") {
|
|
56407
|
+
return new URLSearchParams(window.location.search);
|
|
56408
|
+
}
|
|
56409
|
+
return new URLSearchParams();
|
|
56410
|
+
});
|
|
56411
|
+
const [query, setQuery] = useState60(() => {
|
|
56412
|
+
const queryParam = urlParams.get("q");
|
|
56413
|
+
return queryParam || "";
|
|
56414
|
+
});
|
|
56415
|
+
const [selectedEntityTab, setSelectedEntityTab] = useState60(
|
|
56416
|
+
() => {
|
|
56417
|
+
const tabParam = urlParams.get("tab");
|
|
56418
|
+
return tabParam && VALID_ENTITY_TYPES.includes(tabParam) ? tabParam : DEFAULT_ENTITY_TAB;
|
|
56419
|
+
}
|
|
56420
|
+
);
|
|
56421
|
+
const [showFilters, setShowFilters] = useState60(() => {
|
|
56422
|
+
return urlParams.get("filters") === "true";
|
|
56423
|
+
});
|
|
56424
|
+
const [selectedRecordIndex, setSelectedRecordIndex] = useState60(
|
|
56425
|
+
() => {
|
|
56426
|
+
const indexParam = urlParams.get("selected");
|
|
56427
|
+
return indexParam ? parseInt(indexParam, 10) || 0 : 0;
|
|
56428
|
+
}
|
|
56429
|
+
);
|
|
56430
|
+
const [selectedRecordId, setSelectedRecordId] = useState60(
|
|
56431
|
+
() => {
|
|
56432
|
+
return urlParams.get("id") || null;
|
|
56433
|
+
}
|
|
56434
|
+
);
|
|
56435
|
+
const updateUrl = useCallback11(() => {
|
|
56436
|
+
const newParams = new URLSearchParams();
|
|
56437
|
+
const queryText = typeof query === "string" ? query : query.text || "";
|
|
56438
|
+
if (queryText && queryText !== "*") {
|
|
56439
|
+
newParams.set("q", queryText);
|
|
56440
|
+
}
|
|
56441
|
+
if (selectedEntityTab !== DEFAULT_ENTITY_TAB) {
|
|
56442
|
+
newParams.set("tab", selectedEntityTab);
|
|
56443
|
+
}
|
|
56444
|
+
if (showFilters) {
|
|
56445
|
+
newParams.set("filters", "true");
|
|
56446
|
+
}
|
|
56447
|
+
if (selectedRecordIndex > 0) {
|
|
56448
|
+
newParams.set("selected", selectedRecordIndex.toString());
|
|
56449
|
+
}
|
|
56450
|
+
if (selectedRecordId) {
|
|
56451
|
+
newParams.set("id", selectedRecordId);
|
|
56452
|
+
}
|
|
56453
|
+
const newUrl = newParams.toString() ? `${window.location.pathname}?${newParams.toString()}` : window.location.pathname;
|
|
56454
|
+
window.history.replaceState({}, "", newUrl);
|
|
56455
|
+
setUrlParams(newParams);
|
|
56456
|
+
}, [
|
|
56457
|
+
query,
|
|
56458
|
+
selectedEntityTab,
|
|
56459
|
+
showFilters,
|
|
56460
|
+
selectedRecordIndex,
|
|
56461
|
+
selectedRecordId
|
|
56462
|
+
]);
|
|
56463
|
+
useEffect40(() => {
|
|
56464
|
+
updateUrl();
|
|
56465
|
+
}, [updateUrl]);
|
|
56466
|
+
return {
|
|
56467
|
+
urlParams,
|
|
56468
|
+
query,
|
|
56469
|
+
selectedEntityTab,
|
|
56470
|
+
showFilters,
|
|
56471
|
+
selectedRecordIndex,
|
|
56472
|
+
selectedRecordId,
|
|
56473
|
+
setQuery,
|
|
56474
|
+
setSelectedEntityTab,
|
|
56475
|
+
setShowFilters,
|
|
56476
|
+
setSelectedRecordIndex,
|
|
56477
|
+
setSelectedRecordId
|
|
56478
|
+
};
|
|
56479
|
+
};
|
|
56480
|
+
|
|
56481
|
+
// src/components/WfoSearchPage/WfoFilterGroup/WfoFilterGroup.tsx
|
|
56482
|
+
import { useTranslations as useTranslations98 } from "next-intl";
|
|
56483
|
+
import {
|
|
56484
|
+
EuiButton as EuiButton22,
|
|
56485
|
+
EuiButtonIcon as EuiButtonIcon16,
|
|
56486
|
+
EuiCallOut as EuiCallOut2,
|
|
56487
|
+
EuiCode,
|
|
56488
|
+
EuiFlexGroup as EuiFlexGroup38,
|
|
56489
|
+
EuiFlexItem as EuiFlexItem46,
|
|
56490
|
+
EuiPanel as EuiPanel15,
|
|
56491
|
+
EuiSpacer as EuiSpacer30,
|
|
56492
|
+
EuiText as EuiText55
|
|
56493
|
+
} from "@elastic/eui";
|
|
56494
|
+
|
|
56495
|
+
// src/components/WfoSearchPage/WfoConditionRow/WfoConditionRow.tsx
|
|
56496
|
+
import { useState as useState62 } from "react";
|
|
56497
|
+
import { useTranslations as useTranslations97 } from "next-intl";
|
|
56498
|
+
import {
|
|
56499
|
+
EuiButtonIcon as EuiButtonIcon15,
|
|
56500
|
+
EuiFlexGroup as EuiFlexGroup37,
|
|
56501
|
+
EuiFlexItem as EuiFlexItem45,
|
|
56502
|
+
EuiFormRow as EuiFormRow25,
|
|
56503
|
+
EuiPanel as EuiPanel14
|
|
56504
|
+
} from "@elastic/eui";
|
|
56505
|
+
|
|
56506
|
+
// src/hooks/usePathAutoComplete.ts
|
|
56507
|
+
import { useEffect as useEffect41, useState as useState61 } from "react";
|
|
56508
|
+
var FALLBACK_DEFINITIONS = {
|
|
56509
|
+
string: {
|
|
56510
|
+
operators: ["eq", "neq"],
|
|
56511
|
+
value_schema: {
|
|
56512
|
+
eq: { kind: "string" },
|
|
56513
|
+
neq: { kind: "string" }
|
|
56514
|
+
}
|
|
56515
|
+
},
|
|
56516
|
+
number: {
|
|
56517
|
+
operators: ["eq", "neq", "lt", "lte", "gt", "gte"],
|
|
56518
|
+
value_schema: {
|
|
56519
|
+
eq: { kind: "number" },
|
|
56520
|
+
neq: { kind: "number" },
|
|
56521
|
+
lt: { kind: "number" },
|
|
56522
|
+
lte: { kind: "number" },
|
|
56523
|
+
gt: { kind: "number" },
|
|
56524
|
+
gte: { kind: "number" }
|
|
56525
|
+
}
|
|
56526
|
+
},
|
|
56527
|
+
boolean: {
|
|
56528
|
+
operators: ["eq", "neq"],
|
|
56529
|
+
value_schema: {
|
|
56530
|
+
eq: { kind: "boolean" },
|
|
56531
|
+
neq: { kind: "boolean" }
|
|
56532
|
+
}
|
|
56533
|
+
},
|
|
56534
|
+
datetime: {
|
|
56535
|
+
operators: ["eq", "neq", "lt", "lte", "gt", "gte"],
|
|
56536
|
+
value_schema: {
|
|
56537
|
+
eq: { kind: "datetime" },
|
|
56538
|
+
neq: { kind: "datetime" },
|
|
56539
|
+
lt: { kind: "datetime" },
|
|
56540
|
+
lte: { kind: "datetime" },
|
|
56541
|
+
gt: { kind: "datetime" },
|
|
56542
|
+
gte: { kind: "datetime" }
|
|
56543
|
+
}
|
|
56544
|
+
}
|
|
56545
|
+
};
|
|
56546
|
+
var usePathAutocomplete = (prefix, entityType) => {
|
|
56547
|
+
const [paths, setPaths] = useState61([]);
|
|
56548
|
+
const debouncedPrefix = useDebounce(prefix, 300);
|
|
56549
|
+
const { data: definitions = FALLBACK_DEFINITIONS, isError: defError } = useSearchDefinitionsQuery();
|
|
56550
|
+
const {
|
|
56551
|
+
data: pathData,
|
|
56552
|
+
isLoading,
|
|
56553
|
+
isError: isError2
|
|
56554
|
+
} = useSearchPathsQuery(
|
|
56555
|
+
{ q: debouncedPrefix, entity_type: entityType },
|
|
56556
|
+
{ skip: debouncedPrefix.length < 1 }
|
|
56557
|
+
);
|
|
56558
|
+
useEffect41(() => {
|
|
56559
|
+
if (debouncedPrefix.length < 1) {
|
|
56560
|
+
setPaths([]);
|
|
56561
|
+
return;
|
|
56562
|
+
}
|
|
56563
|
+
if (!pathData) {
|
|
56564
|
+
return;
|
|
56565
|
+
}
|
|
56566
|
+
const enrichedPaths = [];
|
|
56567
|
+
(pathData.leaves || []).forEach((leaf) => {
|
|
56568
|
+
const primaryType = leaf.ui_types[0] || "string";
|
|
56569
|
+
const typeDefinition = definitions[primaryType];
|
|
56570
|
+
enrichedPaths.push({
|
|
56571
|
+
path: leaf.name,
|
|
56572
|
+
type: primaryType,
|
|
56573
|
+
operators: typeDefinition?.operators || [],
|
|
56574
|
+
value_schema: typeDefinition?.value_schema || {},
|
|
56575
|
+
group: "leaf",
|
|
56576
|
+
displayLabel: leaf.name,
|
|
56577
|
+
ui_types: leaf.ui_types,
|
|
56578
|
+
availablePaths: leaf.paths || [],
|
|
56579
|
+
pathCount: leaf.paths ? leaf.paths.length : 0
|
|
56580
|
+
});
|
|
56581
|
+
});
|
|
56582
|
+
(pathData.components || []).forEach((component) => {
|
|
56583
|
+
const primaryType = component.ui_types[0] || "string";
|
|
56584
|
+
const typeDefinition = definitions[primaryType];
|
|
56585
|
+
enrichedPaths.push({
|
|
56586
|
+
path: component.name,
|
|
56587
|
+
type: "component",
|
|
56588
|
+
operators: typeDefinition?.operators || [],
|
|
56589
|
+
value_schema: typeDefinition?.value_schema || {},
|
|
56590
|
+
group: "component",
|
|
56591
|
+
displayLabel: component.name,
|
|
56592
|
+
ui_types: component.ui_types,
|
|
56593
|
+
availablePaths: component.paths || [],
|
|
56594
|
+
pathCount: component.paths ? component.paths.length : 0
|
|
56595
|
+
});
|
|
56596
|
+
});
|
|
56597
|
+
setPaths(enrichedPaths);
|
|
56598
|
+
}, [pathData, definitions]);
|
|
56599
|
+
const errorMessage = isError2 ? "Failed to load paths" : defError ? "Failed to load definitions" : null;
|
|
56600
|
+
return { paths, loading: isLoading, error: errorMessage };
|
|
56601
|
+
};
|
|
56602
|
+
|
|
56603
|
+
// src/components/WfoSearchPage/WfoValueControl/WfoValueControl.tsx
|
|
56604
|
+
import moment2 from "moment";
|
|
56605
|
+
import { useTranslations as useTranslations92 } from "next-intl";
|
|
56606
|
+
import {
|
|
56607
|
+
EuiComboBox as EuiComboBox2,
|
|
56608
|
+
EuiDatePicker as EuiDatePicker2,
|
|
56609
|
+
EuiFieldNumber as EuiFieldNumber3,
|
|
56610
|
+
EuiFieldText as EuiFieldText5,
|
|
56611
|
+
EuiFlexGroup as EuiFlexGroup33,
|
|
56612
|
+
EuiFlexItem as EuiFlexItem41,
|
|
56613
|
+
EuiFormHelpText,
|
|
56614
|
+
EuiIcon as EuiIcon7,
|
|
56615
|
+
EuiText as EuiText51
|
|
56616
|
+
} from "@elastic/eui";
|
|
56617
|
+
import { Fragment as Fragment63, jsx as jsx271, jsxs as jsxs143 } from "@emotion/react/jsx-runtime";
|
|
56618
|
+
var ValueControl = ({
|
|
56619
|
+
pathInfo,
|
|
56620
|
+
operator,
|
|
56621
|
+
value,
|
|
56622
|
+
onChange
|
|
56623
|
+
}) => {
|
|
56624
|
+
const t = useTranslations92("search.page");
|
|
56625
|
+
const { theme } = useOrchestratorTheme();
|
|
56626
|
+
if (!pathInfo || !operator) return null;
|
|
56627
|
+
const schema = pathInfo.value_schema[operator];
|
|
56628
|
+
if (!schema || schema.kind === "none") return null;
|
|
56629
|
+
if (pathInfo.type === "string") {
|
|
56630
|
+
if (operator === "like") {
|
|
56631
|
+
const handleLikeChange = (newValue) => {
|
|
56632
|
+
onChange(newValue);
|
|
56633
|
+
};
|
|
56634
|
+
const ensureWildcards = (inputValue) => {
|
|
56635
|
+
if (!inputValue) return inputValue;
|
|
56636
|
+
if (!inputValue.includes("%") && !inputValue.includes("_")) {
|
|
56637
|
+
return `%${inputValue}%`;
|
|
56638
|
+
}
|
|
56639
|
+
return inputValue;
|
|
56640
|
+
};
|
|
56641
|
+
const currentValue = String(value || "");
|
|
56642
|
+
const hasWildcards = currentValue.includes("%") || currentValue.includes("_");
|
|
56643
|
+
return /* @__PURE__ */ jsxs143(Fragment63, { children: [
|
|
56644
|
+
/* @__PURE__ */ jsx271(
|
|
56645
|
+
EuiFieldText5,
|
|
56646
|
+
{
|
|
56647
|
+
placeholder: "Enter pattern (% = any chars, _ = single char)",
|
|
56648
|
+
value: currentValue,
|
|
56649
|
+
onChange: (event) => handleLikeChange(event.target.value),
|
|
56650
|
+
onBlur: (event) => {
|
|
56651
|
+
const finalValue = ensureWildcards(
|
|
56652
|
+
event.target.value
|
|
56653
|
+
);
|
|
56654
|
+
if (finalValue !== event.target.value) {
|
|
56655
|
+
handleLikeChange(finalValue);
|
|
56656
|
+
}
|
|
56657
|
+
},
|
|
56658
|
+
prepend: /* @__PURE__ */ jsx271(EuiIcon7, { type: "search" })
|
|
56659
|
+
}
|
|
56660
|
+
),
|
|
56661
|
+
/* @__PURE__ */ jsx271(EuiFormHelpText, { children: hasWildcards ? /* @__PURE__ */ jsxs143("span", { children: [
|
|
56662
|
+
/* @__PURE__ */ jsx271(
|
|
56663
|
+
EuiIcon7,
|
|
56664
|
+
{
|
|
56665
|
+
type: "checkInCircleFilled",
|
|
56666
|
+
color: "success",
|
|
56667
|
+
size: "s"
|
|
56668
|
+
}
|
|
56669
|
+
),
|
|
56670
|
+
" ",
|
|
56671
|
+
"Pattern with wildcards:",
|
|
56672
|
+
" ",
|
|
56673
|
+
/* @__PURE__ */ jsx271("strong", { children: currentValue })
|
|
56674
|
+
] }) : /* @__PURE__ */ jsxs143("span", { children: [
|
|
56675
|
+
"Will search for:",
|
|
56676
|
+
" ",
|
|
56677
|
+
/* @__PURE__ */ jsxs143("strong", { children: [
|
|
56678
|
+
"%",
|
|
56679
|
+
currentValue || "your-text",
|
|
56680
|
+
"%"
|
|
56681
|
+
] }),
|
|
56682
|
+
" ",
|
|
56683
|
+
"(auto-wrapped with wildcards)"
|
|
56684
|
+
] }) })
|
|
56685
|
+
] });
|
|
56686
|
+
}
|
|
56687
|
+
if (pathInfo.example_values && pathInfo.example_values.length > 0) {
|
|
56688
|
+
const options = pathInfo.example_values.map((val) => ({
|
|
56689
|
+
label: val,
|
|
56690
|
+
value: val
|
|
56691
|
+
}));
|
|
56692
|
+
return /* @__PURE__ */ jsx271(
|
|
56693
|
+
EuiComboBox2,
|
|
56694
|
+
{
|
|
56695
|
+
placeholder: t("selectOrEnterValue"),
|
|
56696
|
+
options,
|
|
56697
|
+
selectedOptions: value ? [{ label: String(value), value: String(value) }] : [],
|
|
56698
|
+
onChange: (selected) => onChange(selected[0]?.value || ""),
|
|
56699
|
+
singleSelection: { asPlainText: true },
|
|
56700
|
+
isClearable: true
|
|
56701
|
+
}
|
|
56702
|
+
);
|
|
56703
|
+
}
|
|
56704
|
+
return /* @__PURE__ */ jsx271(
|
|
56705
|
+
EuiFieldText5,
|
|
56706
|
+
{
|
|
56707
|
+
placeholder: t("enterValue"),
|
|
56708
|
+
value: String(value || ""),
|
|
56709
|
+
onChange: (event) => onChange(event.target.value)
|
|
56710
|
+
}
|
|
56711
|
+
);
|
|
56712
|
+
}
|
|
56713
|
+
if (pathInfo.type === "number") {
|
|
56714
|
+
if (operator === "between") {
|
|
56715
|
+
const betweenValue = value || { start: "", end: "" };
|
|
56716
|
+
return /* @__PURE__ */ jsxs143(EuiFlexGroup33, { gutterSize: "s", alignItems: "center", children: [
|
|
56717
|
+
/* @__PURE__ */ jsx271(EuiFlexItem41, { children: /* @__PURE__ */ jsx271(
|
|
56718
|
+
EuiFieldNumber3,
|
|
56719
|
+
{
|
|
56720
|
+
placeholder: t("fromNumber"),
|
|
56721
|
+
value: betweenValue.start,
|
|
56722
|
+
onChange: (event) => onChange({
|
|
56723
|
+
...betweenValue,
|
|
56724
|
+
start: parseFloat(event.target.value) || ""
|
|
56725
|
+
})
|
|
56726
|
+
}
|
|
56727
|
+
) }),
|
|
56728
|
+
/* @__PURE__ */ jsx271(EuiFlexItem41, { grow: false, children: /* @__PURE__ */ jsx271(EuiText51, { size: "s", color: theme.colors.textSubdued, children: "to" }) }),
|
|
56729
|
+
/* @__PURE__ */ jsx271(EuiFlexItem41, { children: /* @__PURE__ */ jsx271(
|
|
56730
|
+
EuiFieldNumber3,
|
|
56731
|
+
{
|
|
56732
|
+
placeholder: t("toNumber"),
|
|
56733
|
+
value: betweenValue.end,
|
|
56734
|
+
onChange: (event) => onChange({
|
|
56735
|
+
...betweenValue,
|
|
56736
|
+
end: parseFloat(event.target.value) || ""
|
|
56737
|
+
})
|
|
56738
|
+
}
|
|
56739
|
+
) })
|
|
56740
|
+
] });
|
|
56741
|
+
}
|
|
56742
|
+
return /* @__PURE__ */ jsx271(
|
|
56743
|
+
EuiFieldNumber3,
|
|
56744
|
+
{
|
|
56745
|
+
placeholder: t("enterNumber"),
|
|
56746
|
+
value: value !== void 0 && value !== null ? Number(value) : "",
|
|
56747
|
+
onChange: (event) => onChange(parseFloat(event.target.value) || "")
|
|
56748
|
+
}
|
|
56749
|
+
);
|
|
56750
|
+
}
|
|
56751
|
+
if (pathInfo.type === "datetime") {
|
|
56752
|
+
if (operator === "between") {
|
|
56753
|
+
const betweenValue = value || { start: null, end: null };
|
|
56754
|
+
return /* @__PURE__ */ jsxs143(EuiFlexGroup33, { gutterSize: "s", alignItems: "center", children: [
|
|
56755
|
+
/* @__PURE__ */ jsx271(EuiFlexItem41, { children: /* @__PURE__ */ jsx271(
|
|
56756
|
+
EuiDatePicker2,
|
|
56757
|
+
{
|
|
56758
|
+
selected: betweenValue.start ? moment2(betweenValue.start) : null,
|
|
56759
|
+
onChange: (date) => onChange({
|
|
56760
|
+
...betweenValue,
|
|
56761
|
+
start: date?.toISOString()
|
|
56762
|
+
}),
|
|
56763
|
+
showTimeSelect: true,
|
|
56764
|
+
dateFormat: "yyyy-MM-dd HH:mm",
|
|
56765
|
+
placeholderText: t("fromDate")
|
|
56766
|
+
}
|
|
56767
|
+
) }),
|
|
56768
|
+
/* @__PURE__ */ jsx271(EuiFlexItem41, { grow: false, children: /* @__PURE__ */ jsx271(EuiText51, { size: "s", color: theme.colors.textSubdued, children: t("valueControlTo") }) }),
|
|
56769
|
+
/* @__PURE__ */ jsx271(EuiFlexItem41, { children: /* @__PURE__ */ jsx271(
|
|
56770
|
+
EuiDatePicker2,
|
|
56771
|
+
{
|
|
56772
|
+
selected: betweenValue.end ? moment2(betweenValue.end) : null,
|
|
56773
|
+
onChange: (date) => onChange({
|
|
56774
|
+
...betweenValue,
|
|
56775
|
+
end: date?.toISOString()
|
|
56776
|
+
}),
|
|
56777
|
+
showTimeSelect: true,
|
|
56778
|
+
dateFormat: "yyyy-MM-dd HH:mm",
|
|
56779
|
+
placeholderText: t("toDate")
|
|
56780
|
+
}
|
|
56781
|
+
) })
|
|
56782
|
+
] });
|
|
56783
|
+
}
|
|
56784
|
+
return /* @__PURE__ */ jsx271(
|
|
56785
|
+
EuiDatePicker2,
|
|
56786
|
+
{
|
|
56787
|
+
selected: value ? moment2(String(value)) : null,
|
|
56788
|
+
onChange: (date) => onChange(date?.toISOString()),
|
|
56789
|
+
showTimeSelect: true,
|
|
56790
|
+
dateFormat: "yyyy-MM-dd HH:mm",
|
|
56791
|
+
placeholderText: t("selectDateAndTime")
|
|
56792
|
+
}
|
|
56793
|
+
);
|
|
56794
|
+
}
|
|
56795
|
+
return null;
|
|
56796
|
+
};
|
|
56797
|
+
|
|
56798
|
+
// src/components/WfoSearchPage/WfoConditionRow/WfoFieldSelector.tsx
|
|
56799
|
+
import { useTranslations as useTranslations93 } from "next-intl";
|
|
56800
|
+
import { EuiComboBox as EuiComboBox3 } from "@elastic/eui";
|
|
56801
|
+
import { jsx as jsx272 } from "@emotion/react/jsx-runtime";
|
|
56802
|
+
var WfoFieldSelector = ({
|
|
56803
|
+
pathOptions,
|
|
56804
|
+
loading,
|
|
56805
|
+
error,
|
|
56806
|
+
onFieldSelection,
|
|
56807
|
+
onSearchChange,
|
|
56808
|
+
onClear,
|
|
56809
|
+
renderPathOption
|
|
56810
|
+
}) => {
|
|
56811
|
+
const t = useTranslations93("search.page");
|
|
56812
|
+
const handleSelectionChange = (selected) => {
|
|
56813
|
+
if (selected[0]?.value) {
|
|
56814
|
+
onFieldSelection(selected[0].value);
|
|
56815
|
+
} else {
|
|
56816
|
+
onClear();
|
|
56817
|
+
}
|
|
56818
|
+
};
|
|
56819
|
+
return /* @__PURE__ */ jsx272(
|
|
56820
|
+
EuiComboBox3,
|
|
56821
|
+
{
|
|
56822
|
+
placeholder: t("searchFieldsPlaceholder"),
|
|
56823
|
+
options: pathOptions,
|
|
56824
|
+
selectedOptions: [],
|
|
56825
|
+
onChange: handleSelectionChange,
|
|
56826
|
+
onSearchChange,
|
|
56827
|
+
singleSelection: { asPlainText: true },
|
|
56828
|
+
isLoading: loading,
|
|
56829
|
+
isClearable: true,
|
|
56830
|
+
isInvalid: !!error,
|
|
56831
|
+
renderOption: renderPathOption,
|
|
56832
|
+
rowHeight: 30
|
|
56833
|
+
}
|
|
56834
|
+
);
|
|
56835
|
+
};
|
|
56836
|
+
|
|
56837
|
+
// src/components/WfoSearchPage/WfoConditionRow/WfoOperatorSelector.tsx
|
|
56838
|
+
import { useTranslations as useTranslations94 } from "next-intl";
|
|
56839
|
+
import {
|
|
56840
|
+
EuiButton as EuiButton21,
|
|
56841
|
+
EuiFlexGroup as EuiFlexGroup34,
|
|
56842
|
+
EuiFlexItem as EuiFlexItem42,
|
|
56843
|
+
EuiFormRow as EuiFormRow24,
|
|
56844
|
+
EuiText as EuiText52
|
|
56845
|
+
} from "@elastic/eui";
|
|
56846
|
+
import { jsx as jsx273, jsxs as jsxs144 } from "@emotion/react/jsx-runtime";
|
|
56847
|
+
var WfoOperatorSelector = ({
|
|
56848
|
+
selectedPathInfo,
|
|
56849
|
+
condition,
|
|
56850
|
+
onOperatorChange
|
|
56851
|
+
}) => {
|
|
56852
|
+
const t = useTranslations94("search.page");
|
|
56853
|
+
const { theme } = useOrchestratorTheme();
|
|
56854
|
+
return /* @__PURE__ */ jsx273(EuiFormRow24, { label: t("operatorLabel"), children: /* @__PURE__ */ jsxs144(EuiFlexGroup34, { gutterSize: "xs", wrap: true, children: [
|
|
56855
|
+
selectedPathInfo?.operators?.map((operator) => {
|
|
56856
|
+
const { symbol, description } = getOperatorDisplay(
|
|
56857
|
+
operator,
|
|
56858
|
+
selectedPathInfo
|
|
56859
|
+
);
|
|
56860
|
+
const tooltipContent = operator === "like" ? /* @__PURE__ */ jsxs144("div", { children: [
|
|
56861
|
+
/* @__PURE__ */ jsx273("strong", { children: description }),
|
|
56862
|
+
/* @__PURE__ */ jsx273("br", {}),
|
|
56863
|
+
/* @__PURE__ */ jsx273("br", {}),
|
|
56864
|
+
/* @__PURE__ */ jsx273("strong", { children: "Wildcards:" }),
|
|
56865
|
+
/* @__PURE__ */ jsx273("br", {}),
|
|
56866
|
+
"\u2022 ",
|
|
56867
|
+
/* @__PURE__ */ jsx273("code", { children: "%" }),
|
|
56868
|
+
" matches any number of characters",
|
|
56869
|
+
/* @__PURE__ */ jsx273("br", {}),
|
|
56870
|
+
"\u2022 ",
|
|
56871
|
+
/* @__PURE__ */ jsx273("code", { children: "_" }),
|
|
56872
|
+
" matches exactly one character",
|
|
56873
|
+
/* @__PURE__ */ jsx273("br", {}),
|
|
56874
|
+
/* @__PURE__ */ jsx273("br", {}),
|
|
56875
|
+
/* @__PURE__ */ jsx273("strong", { children: "Examples:" }),
|
|
56876
|
+
/* @__PURE__ */ jsx273("br", {}),
|
|
56877
|
+
"\u2022 ",
|
|
56878
|
+
/* @__PURE__ */ jsx273("code", { children: "%test%" }),
|
|
56879
|
+
' finds anything containing "test"',
|
|
56880
|
+
/* @__PURE__ */ jsx273("br", {}),
|
|
56881
|
+
"\u2022 ",
|
|
56882
|
+
/* @__PURE__ */ jsx273("code", { children: "test%" }),
|
|
56883
|
+
' finds anything starting with "test"',
|
|
56884
|
+
/* @__PURE__ */ jsx273("br", {}),
|
|
56885
|
+
"\u2022 ",
|
|
56886
|
+
/* @__PURE__ */ jsx273("code", { children: "test_" }),
|
|
56887
|
+
' finds "test" + one character'
|
|
56888
|
+
] }) : description;
|
|
56889
|
+
return /* @__PURE__ */ jsx273(EuiFlexItem42, { grow: false, children: /* @__PURE__ */ jsx273(WfoToolTip, { tooltipContent, children: /* @__PURE__ */ jsx273(
|
|
56890
|
+
EuiButton21,
|
|
56891
|
+
{
|
|
56892
|
+
size: "s",
|
|
56893
|
+
color: getButtonColor(
|
|
56894
|
+
operator,
|
|
56895
|
+
selectedPathInfo,
|
|
56896
|
+
condition
|
|
56897
|
+
),
|
|
56898
|
+
fill: getButtonFill(
|
|
56899
|
+
operator,
|
|
56900
|
+
selectedPathInfo,
|
|
56901
|
+
condition
|
|
56902
|
+
),
|
|
56903
|
+
onClick: () => onOperatorChange(operator),
|
|
56904
|
+
style: {
|
|
56905
|
+
minWidth: theme.size.xxl,
|
|
56906
|
+
fontSize: theme.size.base,
|
|
56907
|
+
fontWeight: theme.font.weight.bold
|
|
56908
|
+
},
|
|
56909
|
+
children: symbol
|
|
56910
|
+
}
|
|
56911
|
+
) }) }, operator);
|
|
56912
|
+
}),
|
|
56913
|
+
(!selectedPathInfo || selectedPathInfo.operators.length === 0) && /* @__PURE__ */ jsx273(EuiFlexItem42, { grow: false, children: /* @__PURE__ */ jsx273(EuiText52, { size: "s", color: theme.colors.textSubdued, children: t("selectFieldFirst") }) })
|
|
56914
|
+
] }) });
|
|
56915
|
+
};
|
|
56916
|
+
|
|
56917
|
+
// src/components/WfoSearchPage/WfoConditionRow/WfoPathChips.tsx
|
|
56918
|
+
import { EuiIcon as EuiIcon8 } from "@elastic/eui";
|
|
56919
|
+
import { jsx as jsx274, jsxs as jsxs145 } from "@emotion/react/jsx-runtime";
|
|
56920
|
+
var WfoPathChips = ({
|
|
56921
|
+
fullPath,
|
|
56922
|
+
label,
|
|
56923
|
+
fieldType,
|
|
56924
|
+
isAnyPath = false
|
|
56925
|
+
}) => {
|
|
56926
|
+
const { theme } = useOrchestratorTheme();
|
|
56927
|
+
if (isAnyPath) {
|
|
56928
|
+
return /* @__PURE__ */ jsx274(WfoToolTip, { tooltipContent: label, children: /* @__PURE__ */ jsxs145(
|
|
56929
|
+
"div",
|
|
56930
|
+
{
|
|
56931
|
+
style: {
|
|
56932
|
+
display: "flex",
|
|
56933
|
+
justifyContent: "space-between",
|
|
56934
|
+
alignItems: "center",
|
|
56935
|
+
padding: `${theme.size.xs} ${theme.size.s} ${theme.size.xs} 0`,
|
|
56936
|
+
textDecoration: "none",
|
|
56937
|
+
width: "100%",
|
|
56938
|
+
boxSizing: "border-box",
|
|
56939
|
+
minHeight: theme.size.xl
|
|
56940
|
+
},
|
|
56941
|
+
children: [
|
|
56942
|
+
/* @__PURE__ */ jsx274(
|
|
56943
|
+
"div",
|
|
56944
|
+
{
|
|
56945
|
+
style: {
|
|
56946
|
+
display: "flex",
|
|
56947
|
+
gap: theme.size.xs,
|
|
56948
|
+
alignItems: "center",
|
|
56949
|
+
flexWrap: "nowrap",
|
|
56950
|
+
textDecoration: "none",
|
|
56951
|
+
marginRight: theme.size.s,
|
|
56952
|
+
flex: 1,
|
|
56953
|
+
overflow: "visible"
|
|
56954
|
+
},
|
|
56955
|
+
children: /* @__PURE__ */ jsx274(
|
|
56956
|
+
"div",
|
|
56957
|
+
{
|
|
56958
|
+
style: {
|
|
56959
|
+
textDecoration: "none",
|
|
56960
|
+
borderBottom: "none"
|
|
56961
|
+
},
|
|
56962
|
+
children: /* @__PURE__ */ jsx274(
|
|
56963
|
+
WfoBadge,
|
|
56964
|
+
{
|
|
56965
|
+
color: "primary",
|
|
56966
|
+
textColor: theme.colors.ghost,
|
|
56967
|
+
size: "xs",
|
|
56968
|
+
children: /* @__PURE__ */ jsx274(
|
|
56969
|
+
"span",
|
|
56970
|
+
{
|
|
56971
|
+
style: {
|
|
56972
|
+
textDecoration: "none",
|
|
56973
|
+
borderBottom: "none",
|
|
56974
|
+
outline: "none",
|
|
56975
|
+
textDecorationLine: "none",
|
|
56976
|
+
textDecorationColor: "transparent"
|
|
56977
|
+
},
|
|
56978
|
+
children: label
|
|
56979
|
+
}
|
|
56980
|
+
)
|
|
56981
|
+
}
|
|
56982
|
+
)
|
|
56983
|
+
}
|
|
56984
|
+
)
|
|
56985
|
+
}
|
|
56986
|
+
),
|
|
56987
|
+
fieldType && /* @__PURE__ */ jsx274("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx274(
|
|
56988
|
+
WfoBadge,
|
|
56989
|
+
{
|
|
56990
|
+
color: getTypeColor(fieldType, theme),
|
|
56991
|
+
textColor: theme.colors.ink,
|
|
56992
|
+
size: "xs",
|
|
56993
|
+
children: /* @__PURE__ */ jsx274("span", { style: { textDecoration: "none" }, children: fieldType })
|
|
56994
|
+
}
|
|
56995
|
+
) })
|
|
56996
|
+
]
|
|
56997
|
+
}
|
|
56998
|
+
) });
|
|
56999
|
+
}
|
|
57000
|
+
const completePath = fullPath || label;
|
|
57001
|
+
const allSegments = completePath.split(".").filter(
|
|
57002
|
+
(segment) => segment && !segment.match(/^\d+$/) && !segment.includes("(")
|
|
57003
|
+
);
|
|
57004
|
+
const pathSegments = allSegments.slice(-2);
|
|
57005
|
+
return /* @__PURE__ */ jsx274(WfoToolTip, { tooltipContent: completePath, children: /* @__PURE__ */ jsxs145(
|
|
57006
|
+
"div",
|
|
57007
|
+
{
|
|
57008
|
+
style: {
|
|
57009
|
+
display: "flex",
|
|
57010
|
+
justifyContent: "space-between",
|
|
57011
|
+
alignItems: "center",
|
|
57012
|
+
padding: `${theme.size.xs} ${theme.size.s} ${theme.size.xs} 0`,
|
|
57013
|
+
textDecoration: "none",
|
|
57014
|
+
width: "100%",
|
|
57015
|
+
boxSizing: "border-box",
|
|
57016
|
+
minHeight: theme.size.xl
|
|
57017
|
+
},
|
|
57018
|
+
children: [
|
|
57019
|
+
/* @__PURE__ */ jsx274(
|
|
57020
|
+
"div",
|
|
57021
|
+
{
|
|
57022
|
+
style: {
|
|
57023
|
+
display: "flex",
|
|
57024
|
+
gap: theme.size.xs,
|
|
57025
|
+
alignItems: "center",
|
|
57026
|
+
flexWrap: "nowrap",
|
|
57027
|
+
textDecoration: "none",
|
|
57028
|
+
marginRight: theme.size.s,
|
|
57029
|
+
flex: 1,
|
|
57030
|
+
overflow: "visible"
|
|
57031
|
+
},
|
|
57032
|
+
children: pathSegments.map(
|
|
57033
|
+
(segment, index) => [
|
|
57034
|
+
/* @__PURE__ */ jsx274(
|
|
57035
|
+
"div",
|
|
57036
|
+
{
|
|
57037
|
+
style: {
|
|
57038
|
+
textDecoration: "none",
|
|
57039
|
+
borderBottom: "none"
|
|
57040
|
+
},
|
|
57041
|
+
children: /* @__PURE__ */ jsx274(
|
|
57042
|
+
WfoBadge,
|
|
57043
|
+
{
|
|
57044
|
+
color: "primary",
|
|
57045
|
+
textColor: theme.colors.ghost,
|
|
57046
|
+
size: "xs",
|
|
57047
|
+
children: /* @__PURE__ */ jsx274(
|
|
57048
|
+
"span",
|
|
57049
|
+
{
|
|
57050
|
+
style: {
|
|
57051
|
+
textDecoration: "none",
|
|
57052
|
+
borderBottom: "none",
|
|
57053
|
+
outline: "none",
|
|
57054
|
+
textDecorationLine: "none",
|
|
57055
|
+
textDecorationColor: "transparent"
|
|
57056
|
+
},
|
|
57057
|
+
children: segment
|
|
57058
|
+
}
|
|
57059
|
+
)
|
|
57060
|
+
}
|
|
57061
|
+
)
|
|
57062
|
+
},
|
|
57063
|
+
`segment-${index}`
|
|
57064
|
+
),
|
|
57065
|
+
index < pathSegments.length - 1 && /* @__PURE__ */ jsx274(
|
|
57066
|
+
EuiIcon8,
|
|
57067
|
+
{
|
|
57068
|
+
type: "arrowRight",
|
|
57069
|
+
size: "s",
|
|
57070
|
+
color: theme.colors.mediumShade,
|
|
57071
|
+
title: "",
|
|
57072
|
+
style: {
|
|
57073
|
+
flexShrink: 0,
|
|
57074
|
+
marginTop: "1px"
|
|
57075
|
+
}
|
|
57076
|
+
},
|
|
57077
|
+
`arrow-${index}`
|
|
57078
|
+
)
|
|
57079
|
+
].filter(Boolean)
|
|
57080
|
+
)
|
|
57081
|
+
}
|
|
57082
|
+
),
|
|
57083
|
+
fieldType && /* @__PURE__ */ jsx274("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx274(
|
|
57084
|
+
WfoBadge,
|
|
57085
|
+
{
|
|
57086
|
+
color: getTypeColor(fieldType, theme),
|
|
57087
|
+
textColor: theme.colors.ink,
|
|
57088
|
+
size: "xs",
|
|
57089
|
+
children: /* @__PURE__ */ jsx274("span", { style: { textDecoration: "none" }, children: fieldType })
|
|
57090
|
+
}
|
|
57091
|
+
) })
|
|
57092
|
+
]
|
|
57093
|
+
}
|
|
57094
|
+
) });
|
|
57095
|
+
};
|
|
57096
|
+
|
|
57097
|
+
// src/components/WfoSearchPage/WfoConditionRow/WfoPathSelector.tsx
|
|
57098
|
+
import { useTranslations as useTranslations95 } from "next-intl";
|
|
57099
|
+
import { EuiComboBox as EuiComboBox4 } from "@elastic/eui";
|
|
57100
|
+
import { jsx as jsx275 } from "@emotion/react/jsx-runtime";
|
|
57101
|
+
var WfoPathSelector = ({
|
|
57102
|
+
selectedFieldName,
|
|
57103
|
+
pathOptions,
|
|
57104
|
+
onPathSelection,
|
|
57105
|
+
onClear,
|
|
57106
|
+
renderOption
|
|
57107
|
+
}) => {
|
|
57108
|
+
const t = useTranslations95("search.page");
|
|
57109
|
+
return /* @__PURE__ */ jsx275(
|
|
57110
|
+
EuiComboBox4,
|
|
57111
|
+
{
|
|
57112
|
+
placeholder: t("selectSpecificPathPlaceholder"),
|
|
57113
|
+
options: pathOptions,
|
|
57114
|
+
selectedOptions: [
|
|
57115
|
+
{
|
|
57116
|
+
label: `${selectedFieldName}:`,
|
|
57117
|
+
value: selectedFieldName
|
|
57118
|
+
}
|
|
57119
|
+
],
|
|
57120
|
+
onChange: (selected) => {
|
|
57121
|
+
if (selected[0]?.value) {
|
|
57122
|
+
const selectedOption = pathOptions.find(
|
|
57123
|
+
(option) => option.value === selected[0].value
|
|
57124
|
+
);
|
|
57125
|
+
if (selectedOption) {
|
|
57126
|
+
onPathSelection(selectedOption);
|
|
57127
|
+
}
|
|
57128
|
+
} else if (selected.length === 0) {
|
|
57129
|
+
onClear();
|
|
57130
|
+
}
|
|
57131
|
+
},
|
|
57132
|
+
singleSelection: { asPlainText: true },
|
|
57133
|
+
isClearable: true,
|
|
57134
|
+
renderOption,
|
|
57135
|
+
rowHeight: 40,
|
|
57136
|
+
autoFocus: true,
|
|
57137
|
+
fullWidth: true,
|
|
57138
|
+
style: {
|
|
57139
|
+
minWidth: "500px",
|
|
57140
|
+
maxWidth: "100%",
|
|
57141
|
+
textDecoration: "none"
|
|
57142
|
+
},
|
|
57143
|
+
className: "wfo-path-selector"
|
|
57144
|
+
}
|
|
57145
|
+
);
|
|
57146
|
+
};
|
|
57147
|
+
|
|
57148
|
+
// src/components/WfoSearchPage/WfoConditionRow/WfoRenderFunctions.tsx
|
|
57149
|
+
import { useTranslations as useTranslations96 } from "next-intl";
|
|
57150
|
+
import { EuiFlexGroup as EuiFlexGroup35, EuiFlexItem as EuiFlexItem43, EuiText as EuiText53 } from "@elastic/eui";
|
|
57151
|
+
import { Fragment as Fragment64, jsx as jsx276, jsxs as jsxs146 } from "@emotion/react/jsx-runtime";
|
|
57152
|
+
var WfoRenderPathOption = ({
|
|
57153
|
+
option,
|
|
57154
|
+
contentClassName,
|
|
57155
|
+
paths
|
|
57156
|
+
}) => {
|
|
57157
|
+
const t = useTranslations96("search.page");
|
|
57158
|
+
const { theme } = useOrchestratorTheme();
|
|
57159
|
+
const pathInfo = option.value ? paths.find(({ path }) => path === option.value) : null;
|
|
57160
|
+
if (!pathInfo) return /* @__PURE__ */ jsx276(Fragment64, { children: option.label });
|
|
57161
|
+
return /* @__PURE__ */ jsxs146(
|
|
57162
|
+
EuiFlexGroup35,
|
|
57163
|
+
{
|
|
57164
|
+
alignItems: "center",
|
|
57165
|
+
gutterSize: "s",
|
|
57166
|
+
responsive: false,
|
|
57167
|
+
className: contentClassName,
|
|
57168
|
+
title: "",
|
|
57169
|
+
children: [
|
|
57170
|
+
/* @__PURE__ */ jsx276(EuiFlexItem43, { grow: true, children: /* @__PURE__ */ jsx276(EuiText53, { size: "s", children: pathInfo.displayLabel || pathInfo.path }) }),
|
|
57171
|
+
/* @__PURE__ */ jsx276(EuiFlexItem43, { grow: false, children: /* @__PURE__ */ jsxs146(
|
|
57172
|
+
EuiFlexGroup35,
|
|
57173
|
+
{
|
|
57174
|
+
gutterSize: "xs",
|
|
57175
|
+
alignItems: "center",
|
|
57176
|
+
responsive: false,
|
|
57177
|
+
children: [
|
|
57178
|
+
pathInfo.group === "leaf" && pathInfo.pathCount && pathInfo.pathCount > 1 && /* @__PURE__ */ jsx276(EuiFlexItem43, { grow: false, children: /* @__PURE__ */ jsx276(
|
|
57179
|
+
WfoBadge,
|
|
57180
|
+
{
|
|
57181
|
+
color: "default",
|
|
57182
|
+
textColor: theme.colors.ink,
|
|
57183
|
+
size: "xs",
|
|
57184
|
+
children: t("pathsCount", {
|
|
57185
|
+
count: pathInfo.pathCount
|
|
57186
|
+
})
|
|
57187
|
+
}
|
|
57188
|
+
) }),
|
|
57189
|
+
(!pathInfo.pathCount || pathInfo.pathCount <= 1) && pathInfo.ui_types?.map((type, index) => /* @__PURE__ */ jsx276(EuiFlexItem43, { grow: false, children: /* @__PURE__ */ jsx276(
|
|
57190
|
+
WfoBadge,
|
|
57191
|
+
{
|
|
57192
|
+
color: getTypeColor(type, theme),
|
|
57193
|
+
textColor: theme.colors.ink,
|
|
57194
|
+
size: "xs",
|
|
57195
|
+
children: type
|
|
57196
|
+
}
|
|
57197
|
+
) }, index))
|
|
57198
|
+
]
|
|
57199
|
+
}
|
|
57200
|
+
) })
|
|
57201
|
+
]
|
|
57202
|
+
}
|
|
57203
|
+
);
|
|
57204
|
+
};
|
|
57205
|
+
var WfoRenderPathSelectionOption = ({ option, contentClassName, fieldType }) => {
|
|
57206
|
+
const { theme } = useOrchestratorTheme();
|
|
57207
|
+
return /* @__PURE__ */ jsx276(WfoToolTip, { tooltipContent: option.fullPath || option.label, children: /* @__PURE__ */ jsxs146(
|
|
57208
|
+
EuiFlexGroup35,
|
|
57209
|
+
{
|
|
57210
|
+
alignItems: "center",
|
|
57211
|
+
gutterSize: "s",
|
|
57212
|
+
responsive: false,
|
|
57213
|
+
className: contentClassName,
|
|
57214
|
+
title: "",
|
|
57215
|
+
children: [
|
|
57216
|
+
/* @__PURE__ */ jsx276(EuiFlexItem43, { grow: true, children: /* @__PURE__ */ jsx276(EuiText53, { size: "s", children: option.label }) }),
|
|
57217
|
+
/* @__PURE__ */ jsx276(EuiFlexItem43, { grow: false, children: /* @__PURE__ */ jsx276(
|
|
57218
|
+
WfoBadge,
|
|
57219
|
+
{
|
|
57220
|
+
color: getTypeColor(fieldType, theme),
|
|
57221
|
+
textColor: theme.colors.ink,
|
|
57222
|
+
size: "xs",
|
|
57223
|
+
children: fieldType
|
|
57224
|
+
}
|
|
57225
|
+
) })
|
|
57226
|
+
]
|
|
57227
|
+
}
|
|
57228
|
+
) });
|
|
57229
|
+
};
|
|
57230
|
+
|
|
57231
|
+
// src/components/WfoSearchPage/WfoConditionRow/WfoSelectedPathDisplay.tsx
|
|
57232
|
+
import { EuiFlexGroup as EuiFlexGroup36, EuiFlexItem as EuiFlexItem44, EuiText as EuiText54 } from "@elastic/eui";
|
|
57233
|
+
|
|
57234
|
+
// src/components/WfoSearchPage/WfoConditionRow/utils.ts
|
|
57235
|
+
var createOptionsFromPaths = (paths, group) => paths.filter(({ group: pathGroup }) => pathGroup === group).map(({ displayLabel, path, type, operators }) => ({
|
|
57236
|
+
label: displayLabel || path,
|
|
57237
|
+
value: path,
|
|
57238
|
+
"data-type": type,
|
|
57239
|
+
"data-operators": operators?.join(", ") || ""
|
|
57240
|
+
}));
|
|
57241
|
+
var shouldHideValueInput = (selectedPathInfo, operatorSelected) => {
|
|
57242
|
+
if (!selectedPathInfo || !operatorSelected) return true;
|
|
57243
|
+
if (selectedPathInfo.group === "component") return true;
|
|
57244
|
+
if (selectedPathInfo.type === "boolean") return true;
|
|
57245
|
+
return false;
|
|
57246
|
+
};
|
|
57247
|
+
var isFullPathSelected = (path, selectedPathInfo) => {
|
|
57248
|
+
return !!(path && (path.includes(".") || selectedPathInfo && selectedPathInfo.group === "component" || !path.includes(".") && selectedPathInfo));
|
|
57249
|
+
};
|
|
57250
|
+
var getFieldNameFromPath = (path, isComponent) => {
|
|
57251
|
+
return isComponent ? path : path.split(".").pop() || path;
|
|
57252
|
+
};
|
|
57253
|
+
var getFieldNameFromFullPath = (fullPath) => {
|
|
57254
|
+
const parts = fullPath.split(".");
|
|
57255
|
+
return parts[parts.length - 1] || fullPath;
|
|
57256
|
+
};
|
|
57257
|
+
var getPathSelectionOptions = (selectedFieldName, paths) => {
|
|
57258
|
+
if (!selectedFieldName) return [];
|
|
57259
|
+
const fieldInfo = paths.find(({ path }) => path === selectedFieldName);
|
|
57260
|
+
if (!fieldInfo || !fieldInfo.availablePaths) return [];
|
|
57261
|
+
return fieldInfo.availablePaths.map((fullPath) => ({
|
|
57262
|
+
label: fullPath,
|
|
57263
|
+
value: fullPath,
|
|
57264
|
+
fullPath
|
|
57265
|
+
}));
|
|
57266
|
+
};
|
|
57267
|
+
|
|
57268
|
+
// src/components/WfoSearchPage/WfoConditionRow/WfoSelectedPathDisplay.tsx
|
|
57269
|
+
import { jsx as jsx277, jsxs as jsxs147 } from "@emotion/react/jsx-runtime";
|
|
57270
|
+
var WfoSelectedPathDisplay = ({
|
|
57271
|
+
condition,
|
|
57272
|
+
onEdit
|
|
57273
|
+
}) => {
|
|
57274
|
+
const { theme } = useOrchestratorTheme();
|
|
57275
|
+
const isFullPath = condition.path.includes(".");
|
|
57276
|
+
return /* @__PURE__ */ jsx277(
|
|
57277
|
+
"div",
|
|
57278
|
+
{
|
|
57279
|
+
onClick: onEdit,
|
|
57280
|
+
style: {
|
|
57281
|
+
cursor: "pointer",
|
|
57282
|
+
border: `1px solid ${theme.colors.lightShade}`,
|
|
57283
|
+
borderRadius: theme.border.radius.medium,
|
|
57284
|
+
padding: `${theme.size.s} ${theme.size.m}`,
|
|
57285
|
+
backgroundColor: theme.colors.emptyShade,
|
|
57286
|
+
minHeight: "40px",
|
|
57287
|
+
display: "flex",
|
|
57288
|
+
alignItems: "center"
|
|
57289
|
+
},
|
|
57290
|
+
children: /* @__PURE__ */ jsx277(
|
|
57291
|
+
EuiFlexGroup36,
|
|
57292
|
+
{
|
|
57293
|
+
alignItems: "center",
|
|
57294
|
+
gutterSize: "s",
|
|
57295
|
+
responsive: false,
|
|
57296
|
+
justifyContent: "spaceBetween",
|
|
57297
|
+
children: /* @__PURE__ */ jsx277(EuiFlexItem44, { grow: true, children: isFullPath ? /* @__PURE__ */ jsxs147(
|
|
57298
|
+
EuiFlexGroup36,
|
|
57299
|
+
{
|
|
57300
|
+
gutterSize: "none",
|
|
57301
|
+
alignItems: "center",
|
|
57302
|
+
responsive: false,
|
|
57303
|
+
children: [
|
|
57304
|
+
/* @__PURE__ */ jsx277(EuiFlexItem44, { grow: false, children: /* @__PURE__ */ jsxs147(EuiText54, { size: "s", color: theme.colors.text, children: [
|
|
57305
|
+
getFieldNameFromFullPath(condition.path),
|
|
57306
|
+
":"
|
|
57307
|
+
] }) }),
|
|
57308
|
+
/* @__PURE__ */ jsx277(EuiFlexItem44, { grow: false, children: /* @__PURE__ */ jsx277(
|
|
57309
|
+
EuiText54,
|
|
57310
|
+
{
|
|
57311
|
+
size: "s",
|
|
57312
|
+
style: {
|
|
57313
|
+
backgroundColor: theme.colors.lightestShade,
|
|
57314
|
+
color: theme.colors.primary,
|
|
57315
|
+
padding: `${theme.size.xxs} ${theme.size.xs}`,
|
|
57316
|
+
borderRadius: theme.border.radius.small,
|
|
57317
|
+
marginLeft: theme.size.xs
|
|
57318
|
+
},
|
|
57319
|
+
children: condition.path
|
|
57320
|
+
}
|
|
57321
|
+
) })
|
|
57322
|
+
]
|
|
57323
|
+
}
|
|
57324
|
+
) : /* @__PURE__ */ jsx277(EuiText54, { size: "s", color: theme.colors.text, children: condition.path }) })
|
|
57325
|
+
}
|
|
57326
|
+
)
|
|
57327
|
+
}
|
|
57328
|
+
);
|
|
57329
|
+
};
|
|
57330
|
+
|
|
57331
|
+
// src/components/WfoSearchPage/WfoConditionRow/WfoConditionRow.tsx
|
|
57332
|
+
import { jsx as jsx278, jsxs as jsxs148 } from "@emotion/react/jsx-runtime";
|
|
57333
|
+
var ConditionRow = ({
|
|
57334
|
+
condition,
|
|
57335
|
+
entityType,
|
|
57336
|
+
onChange,
|
|
57337
|
+
onRemove
|
|
57338
|
+
}) => {
|
|
57339
|
+
const t = useTranslations97("search.page");
|
|
57340
|
+
const { theme } = useOrchestratorTheme();
|
|
57341
|
+
const [searchValue, setSearchValue] = useState62(condition.path);
|
|
57342
|
+
const [showPathSelection, setShowPathSelection] = useState62(false);
|
|
57343
|
+
const [selectedFieldName, setSelectedFieldName] = useState62("");
|
|
57344
|
+
const { paths, loading, error } = usePathAutocomplete(
|
|
57345
|
+
searchValue,
|
|
57346
|
+
entityType
|
|
57347
|
+
);
|
|
57348
|
+
const selectedPathInfo = (() => {
|
|
57349
|
+
if (!condition.path) return null;
|
|
57350
|
+
const exactMatch = paths.find(
|
|
57351
|
+
({ path, fullPath }) => fullPath ? fullPath === condition.path : path === condition.path
|
|
57352
|
+
);
|
|
57353
|
+
if (exactMatch) return exactMatch;
|
|
57354
|
+
if (condition.path.includes(".")) {
|
|
57355
|
+
const fieldName = condition.path.split(".").pop();
|
|
57356
|
+
if (fieldName) {
|
|
57357
|
+
const fieldMatch = paths.find(
|
|
57358
|
+
({ path, availablePaths }) => path === fieldName && availablePaths && availablePaths.includes(condition.path)
|
|
57359
|
+
);
|
|
57360
|
+
if (fieldMatch) return fieldMatch;
|
|
57361
|
+
}
|
|
57362
|
+
} else {
|
|
57363
|
+
const fieldMatch = paths.find(
|
|
57364
|
+
({ path }) => path === condition.path
|
|
57365
|
+
);
|
|
57366
|
+
if (fieldMatch) return fieldMatch;
|
|
57367
|
+
}
|
|
57368
|
+
return null;
|
|
57369
|
+
})();
|
|
57370
|
+
const handleFieldSelection = (fieldName) => {
|
|
57371
|
+
const fieldInfo = paths.find(({ path }) => path === fieldName);
|
|
57372
|
+
if (fieldInfo && fieldInfo.group === "component") {
|
|
57373
|
+
onChange({
|
|
57374
|
+
path: fieldName,
|
|
57375
|
+
value_kind: fieldInfo.type,
|
|
57376
|
+
condition: { op: "", value: void 0 }
|
|
57377
|
+
});
|
|
57378
|
+
return;
|
|
57379
|
+
}
|
|
57380
|
+
if (fieldInfo && fieldInfo.availablePaths && fieldInfo.availablePaths.length === 1) {
|
|
57381
|
+
const singlePath = fieldInfo.availablePaths[0];
|
|
57382
|
+
onChange({
|
|
57383
|
+
path: singlePath,
|
|
57384
|
+
value_kind: fieldInfo.type,
|
|
57385
|
+
condition: { op: "", value: void 0 }
|
|
57386
|
+
});
|
|
57387
|
+
return;
|
|
57388
|
+
}
|
|
57389
|
+
setSelectedFieldName(fieldName);
|
|
57390
|
+
setShowPathSelection(true);
|
|
57391
|
+
};
|
|
57392
|
+
const handlePathSelection = (selectedOption) => {
|
|
57393
|
+
const fieldInfo = paths.find(({ path }) => path === selectedFieldName);
|
|
57394
|
+
if (fieldInfo) {
|
|
57395
|
+
if (selectedOption.isAnyPath) {
|
|
57396
|
+
onChange({
|
|
57397
|
+
path: selectedFieldName,
|
|
57398
|
+
value_kind: fieldInfo.type,
|
|
57399
|
+
condition: { op: "", value: void 0 }
|
|
57400
|
+
});
|
|
57401
|
+
} else {
|
|
57402
|
+
onChange({
|
|
57403
|
+
path: selectedOption.value,
|
|
57404
|
+
value_kind: fieldInfo.type,
|
|
57405
|
+
condition: { op: "", value: void 0 }
|
|
57406
|
+
});
|
|
57407
|
+
}
|
|
57408
|
+
}
|
|
57409
|
+
setShowPathSelection(false);
|
|
57410
|
+
setSelectedFieldName("");
|
|
57411
|
+
};
|
|
57412
|
+
const handleOperatorChange = (op) => {
|
|
57413
|
+
const value = void 0;
|
|
57414
|
+
if (selectedPathInfo?.type === "boolean") {
|
|
57415
|
+
const actualOp = "eq";
|
|
57416
|
+
const booleanValue = op === "eq" ? true : false;
|
|
57417
|
+
onChange({
|
|
57418
|
+
...condition,
|
|
57419
|
+
value_kind: selectedPathInfo?.type,
|
|
57420
|
+
condition: { op: actualOp, value: booleanValue }
|
|
57421
|
+
});
|
|
57422
|
+
return;
|
|
57423
|
+
}
|
|
57424
|
+
onChange({
|
|
57425
|
+
...condition,
|
|
57426
|
+
value_kind: selectedPathInfo?.type,
|
|
57427
|
+
condition: { op, value }
|
|
57428
|
+
});
|
|
57429
|
+
};
|
|
57430
|
+
const handleValueChange = (value) => {
|
|
57431
|
+
onChange({
|
|
57432
|
+
...condition,
|
|
57433
|
+
value_kind: selectedPathInfo?.type,
|
|
57434
|
+
condition: { ...condition.condition, value }
|
|
57435
|
+
});
|
|
57436
|
+
};
|
|
57437
|
+
const leavesOptions = createOptionsFromPaths(paths, "leaf");
|
|
57438
|
+
const componentsOptions = createOptionsFromPaths(paths, "component");
|
|
57439
|
+
const pathOptions = [
|
|
57440
|
+
...leavesOptions.length > 0 ? [
|
|
57441
|
+
{
|
|
57442
|
+
label: t("fieldsGroupLabel"),
|
|
57443
|
+
options: leavesOptions
|
|
57444
|
+
}
|
|
57445
|
+
] : [],
|
|
57446
|
+
...componentsOptions.length > 0 ? [
|
|
57447
|
+
{
|
|
57448
|
+
label: t("componentsGroupLabel"),
|
|
57449
|
+
options: componentsOptions
|
|
57450
|
+
}
|
|
57451
|
+
] : []
|
|
57452
|
+
];
|
|
57453
|
+
const hideValueInput = shouldHideValueInput(
|
|
57454
|
+
selectedPathInfo,
|
|
57455
|
+
!!condition.condition.op
|
|
57456
|
+
);
|
|
57457
|
+
const fullPathSelected = isFullPathSelected(
|
|
57458
|
+
condition.path,
|
|
57459
|
+
selectedPathInfo
|
|
57460
|
+
);
|
|
57461
|
+
const pathSelectionOptions = (() => {
|
|
57462
|
+
const baseOptions = getPathSelectionOptions(selectedFieldName, paths);
|
|
57463
|
+
const fieldInfo = paths.find(({ path }) => path === selectedFieldName);
|
|
57464
|
+
if (fieldInfo?.availablePaths && fieldInfo.availablePaths.length > 1) {
|
|
57465
|
+
return [
|
|
57466
|
+
{
|
|
57467
|
+
label: t("anyPathOption"),
|
|
57468
|
+
value: selectedFieldName,
|
|
57469
|
+
fullPath: selectedFieldName,
|
|
57470
|
+
isAnyPath: true
|
|
57471
|
+
},
|
|
57472
|
+
...baseOptions
|
|
57473
|
+
];
|
|
57474
|
+
}
|
|
57475
|
+
return baseOptions;
|
|
57476
|
+
})();
|
|
57477
|
+
const renderPathOption = (option, searchValue2, contentClassName) => /* @__PURE__ */ jsx278(
|
|
57478
|
+
WfoRenderPathOption,
|
|
57479
|
+
{
|
|
57480
|
+
option,
|
|
57481
|
+
searchValue: searchValue2,
|
|
57482
|
+
contentClassName,
|
|
57483
|
+
paths
|
|
57484
|
+
}
|
|
57485
|
+
);
|
|
57486
|
+
const renderPathSelectionOption = (option) => {
|
|
57487
|
+
const fieldInfo = paths.find(({ path }) => path === selectedFieldName);
|
|
57488
|
+
const fieldType = fieldInfo?.type || "string";
|
|
57489
|
+
return /* @__PURE__ */ jsx278(
|
|
57490
|
+
WfoPathChips,
|
|
57491
|
+
{
|
|
57492
|
+
fullPath: option.fullPath || "",
|
|
57493
|
+
label: option.label,
|
|
57494
|
+
fieldType,
|
|
57495
|
+
isAnyPath: option.isAnyPath
|
|
57496
|
+
}
|
|
57497
|
+
);
|
|
57498
|
+
};
|
|
57499
|
+
return /* @__PURE__ */ jsx278(EuiPanel14, { paddingSize: "m", color: "subdued", children: /* @__PURE__ */ jsxs148(EuiFlexGroup37, { direction: "column", gutterSize: "m", children: [
|
|
57500
|
+
/* @__PURE__ */ jsx278(EuiFlexItem45, { children: /* @__PURE__ */ jsx278(
|
|
57501
|
+
EuiFormRow25,
|
|
57502
|
+
{
|
|
57503
|
+
label: t("fieldLabel"),
|
|
57504
|
+
error,
|
|
57505
|
+
isInvalid: !!error,
|
|
57506
|
+
children: /* @__PURE__ */ jsxs148(EuiFlexGroup37, { gutterSize: "s", alignItems: "center", children: [
|
|
57507
|
+
/* @__PURE__ */ jsx278(EuiFlexItem45, { children: showPathSelection ? /* @__PURE__ */ jsx278(
|
|
57508
|
+
WfoPathSelector,
|
|
57509
|
+
{
|
|
57510
|
+
selectedFieldName,
|
|
57511
|
+
pathOptions: pathSelectionOptions,
|
|
57512
|
+
onPathSelection: handlePathSelection,
|
|
57513
|
+
onClear: () => {
|
|
57514
|
+
setShowPathSelection(false);
|
|
57515
|
+
setSelectedFieldName("");
|
|
57516
|
+
},
|
|
57517
|
+
renderOption: renderPathSelectionOption
|
|
57518
|
+
}
|
|
57519
|
+
) : condition.path && fullPathSelected ? /* @__PURE__ */ jsx278(
|
|
57520
|
+
WfoSelectedPathDisplay,
|
|
57521
|
+
{
|
|
57522
|
+
condition,
|
|
57523
|
+
selectedPathInfo,
|
|
57524
|
+
onEdit: () => {
|
|
57525
|
+
onChange({
|
|
57526
|
+
path: "",
|
|
57527
|
+
value_kind: void 0,
|
|
57528
|
+
condition: {
|
|
57529
|
+
op: "",
|
|
57530
|
+
value: void 0
|
|
57531
|
+
}
|
|
57532
|
+
});
|
|
57533
|
+
}
|
|
57534
|
+
}
|
|
57535
|
+
) : /* @__PURE__ */ jsx278(
|
|
57536
|
+
WfoFieldSelector,
|
|
57537
|
+
{
|
|
57538
|
+
pathOptions,
|
|
57539
|
+
loading,
|
|
57540
|
+
error,
|
|
57541
|
+
searchValue,
|
|
57542
|
+
onFieldSelection: handleFieldSelection,
|
|
57543
|
+
onSearchChange: setSearchValue,
|
|
57544
|
+
onClear: () => {
|
|
57545
|
+
onChange({
|
|
57546
|
+
path: "",
|
|
57547
|
+
value_kind: void 0,
|
|
57548
|
+
condition: {
|
|
57549
|
+
op: "",
|
|
57550
|
+
value: void 0
|
|
57551
|
+
}
|
|
57552
|
+
});
|
|
57553
|
+
},
|
|
57554
|
+
renderPathOption
|
|
57555
|
+
}
|
|
57556
|
+
) }),
|
|
57557
|
+
condition.path && selectedPathInfo?.ui_types && selectedPathInfo.ui_types.length > 0 && /* @__PURE__ */ jsx278(EuiFlexItem45, { grow: false, children: /* @__PURE__ */ jsx278(
|
|
57558
|
+
EuiFlexGroup37,
|
|
57559
|
+
{
|
|
57560
|
+
gutterSize: "xs",
|
|
57561
|
+
alignItems: "center",
|
|
57562
|
+
responsive: false,
|
|
57563
|
+
children: selectedPathInfo.ui_types.map(
|
|
57564
|
+
(type, index) => /* @__PURE__ */ jsx278(
|
|
57565
|
+
EuiFlexItem45,
|
|
57566
|
+
{
|
|
57567
|
+
grow: false,
|
|
57568
|
+
children: /* @__PURE__ */ jsx278(
|
|
57569
|
+
WfoBadge,
|
|
57570
|
+
{
|
|
57571
|
+
color: getTypeColor(
|
|
57572
|
+
type,
|
|
57573
|
+
theme
|
|
57574
|
+
),
|
|
57575
|
+
textColor: theme.colors.ink,
|
|
57576
|
+
size: "s",
|
|
57577
|
+
children: type
|
|
57578
|
+
}
|
|
57579
|
+
)
|
|
57580
|
+
},
|
|
57581
|
+
index
|
|
57582
|
+
)
|
|
57583
|
+
)
|
|
57584
|
+
}
|
|
57585
|
+
) })
|
|
57586
|
+
] })
|
|
57587
|
+
}
|
|
57588
|
+
) }),
|
|
57589
|
+
/* @__PURE__ */ jsx278(EuiFlexItem45, { children: /* @__PURE__ */ jsxs148(EuiFlexGroup37, { gutterSize: "s", alignItems: "flexEnd", children: [
|
|
57590
|
+
/* @__PURE__ */ jsx278(EuiFlexItem45, { children: /* @__PURE__ */ jsx278(
|
|
57591
|
+
WfoOperatorSelector,
|
|
57592
|
+
{
|
|
57593
|
+
selectedPathInfo,
|
|
57594
|
+
condition,
|
|
57595
|
+
onOperatorChange: handleOperatorChange
|
|
57596
|
+
}
|
|
57597
|
+
) }),
|
|
57598
|
+
!hideValueInput && /* @__PURE__ */ jsx278(EuiFlexItem45, { children: /* @__PURE__ */ jsx278(EuiFormRow25, { label: t("valueLabel"), children: /* @__PURE__ */ jsx278(
|
|
57599
|
+
ValueControl,
|
|
57600
|
+
{
|
|
57601
|
+
pathInfo: selectedPathInfo,
|
|
57602
|
+
operator: condition.condition.op,
|
|
57603
|
+
value: condition.condition.value,
|
|
57604
|
+
onChange: handleValueChange
|
|
57605
|
+
}
|
|
57606
|
+
) }) }),
|
|
57607
|
+
/* @__PURE__ */ jsx278(EuiFlexItem45, { grow: false, children: /* @__PURE__ */ jsx278(
|
|
57608
|
+
EuiButtonIcon15,
|
|
57609
|
+
{
|
|
57610
|
+
iconType: "trash",
|
|
57611
|
+
color: "danger",
|
|
57612
|
+
onClick: onRemove,
|
|
57613
|
+
"aria-label": t("removeConditionAriaLabel"),
|
|
57614
|
+
size: "m"
|
|
57615
|
+
}
|
|
57616
|
+
) })
|
|
57617
|
+
] }) })
|
|
57618
|
+
] }) });
|
|
57619
|
+
};
|
|
57620
|
+
|
|
57621
|
+
// src/components/WfoSearchPage/WfoFilterGroup/WfoFilterGroup.tsx
|
|
57622
|
+
import { Fragment as Fragment65, jsx as jsx279, jsxs as jsxs149 } from "@emotion/react/jsx-runtime";
|
|
57623
|
+
var FilterGroup = ({
|
|
57624
|
+
group,
|
|
57625
|
+
entityType,
|
|
57626
|
+
onChange,
|
|
57627
|
+
onRemove,
|
|
57628
|
+
depth = 0,
|
|
57629
|
+
isRoot = false
|
|
57630
|
+
}) => {
|
|
57631
|
+
const t = useTranslations98("search.page");
|
|
57632
|
+
const { theme } = useOrchestratorTheme();
|
|
57633
|
+
const MAX_DEPTH = 5;
|
|
57634
|
+
const canAddGroup = depth < MAX_DEPTH;
|
|
57635
|
+
const addCondition = () => {
|
|
57636
|
+
const newCondition = {
|
|
57637
|
+
path: "",
|
|
57638
|
+
condition: { op: "", value: void 0 }
|
|
57639
|
+
};
|
|
57640
|
+
onChange({
|
|
57641
|
+
...group,
|
|
57642
|
+
children: [...group.children, newCondition]
|
|
57643
|
+
});
|
|
57644
|
+
};
|
|
57645
|
+
const addGroup = () => {
|
|
57646
|
+
if (!canAddGroup) return;
|
|
57647
|
+
const newGroup = {
|
|
57648
|
+
op: "AND",
|
|
57649
|
+
children: []
|
|
57650
|
+
};
|
|
57651
|
+
onChange({
|
|
57652
|
+
...group,
|
|
57653
|
+
children: [...group.children, newGroup]
|
|
57654
|
+
});
|
|
57655
|
+
};
|
|
57656
|
+
const updateChild = (index, child) => {
|
|
57657
|
+
const newChildren = [...group.children];
|
|
57658
|
+
newChildren[index] = child;
|
|
57659
|
+
onChange({
|
|
57660
|
+
...group,
|
|
57661
|
+
children: newChildren
|
|
57662
|
+
});
|
|
57663
|
+
};
|
|
57664
|
+
const removeChild = (index) => {
|
|
57665
|
+
onChange({
|
|
57666
|
+
...group,
|
|
57667
|
+
children: group.children.filter((_5, i) => i !== index)
|
|
57668
|
+
});
|
|
57669
|
+
};
|
|
57670
|
+
const toggleOperator = () => {
|
|
57671
|
+
onChange({
|
|
57672
|
+
...group,
|
|
57673
|
+
op: group.op === "AND" ? "OR" : "AND"
|
|
57674
|
+
});
|
|
57675
|
+
};
|
|
57676
|
+
return /* @__PURE__ */ jsxs149(
|
|
57677
|
+
EuiPanel15,
|
|
57678
|
+
{
|
|
57679
|
+
paddingSize: "m",
|
|
57680
|
+
color: depth % 2 === 0 ? "primary" : "plain",
|
|
57681
|
+
hasBorder: true,
|
|
57682
|
+
children: [
|
|
57683
|
+
/* @__PURE__ */ jsxs149(
|
|
57684
|
+
EuiFlexGroup38,
|
|
57685
|
+
{
|
|
57686
|
+
gutterSize: "s",
|
|
57687
|
+
alignItems: "center",
|
|
57688
|
+
justifyContent: "spaceBetween",
|
|
57689
|
+
children: [
|
|
57690
|
+
/* @__PURE__ */ jsx279(EuiFlexItem46, { grow: false, children: /* @__PURE__ */ jsxs149(EuiFlexGroup38, { gutterSize: "s", alignItems: "center", children: [
|
|
57691
|
+
/* @__PURE__ */ jsx279(EuiFlexItem46, { grow: false, children: /* @__PURE__ */ jsx279(EuiText55, { size: "s", children: /* @__PURE__ */ jsx279("strong", { children: t("groupLabel") }) }) }),
|
|
57692
|
+
/* @__PURE__ */ jsx279(EuiFlexItem46, { grow: false, children: /* @__PURE__ */ jsx279(
|
|
57693
|
+
EuiButton22,
|
|
57694
|
+
{
|
|
57695
|
+
size: "s",
|
|
57696
|
+
fill: true,
|
|
57697
|
+
color: "primary",
|
|
57698
|
+
onClick: toggleOperator,
|
|
57699
|
+
children: group.op
|
|
57700
|
+
}
|
|
57701
|
+
) })
|
|
57702
|
+
] }) }),
|
|
57703
|
+
/* @__PURE__ */ jsx279(EuiFlexItem46, { grow: false, children: /* @__PURE__ */ jsxs149(EuiFlexGroup38, { gutterSize: "s", alignItems: "center", children: [
|
|
57704
|
+
/* @__PURE__ */ jsx279(EuiFlexItem46, { grow: false, children: /* @__PURE__ */ jsx279(
|
|
57705
|
+
EuiButton22,
|
|
57706
|
+
{
|
|
57707
|
+
size: "s",
|
|
57708
|
+
iconType: "plusInCircle",
|
|
57709
|
+
onClick: addCondition,
|
|
57710
|
+
children: t("addCondition")
|
|
57711
|
+
}
|
|
57712
|
+
) }),
|
|
57713
|
+
/* @__PURE__ */ jsx279(EuiFlexItem46, { grow: false, children: /* @__PURE__ */ jsx279(
|
|
57714
|
+
WfoToolTip,
|
|
57715
|
+
{
|
|
57716
|
+
tooltipContent: !canAddGroup ? t("maxNestingDepth") : t("addNestedGroup"),
|
|
57717
|
+
children: /* @__PURE__ */ jsx279(
|
|
57718
|
+
EuiButton22,
|
|
57719
|
+
{
|
|
57720
|
+
size: "s",
|
|
57721
|
+
iconType: "nested",
|
|
57722
|
+
onClick: addGroup,
|
|
57723
|
+
disabled: !canAddGroup,
|
|
57724
|
+
children: t("addGroup")
|
|
57725
|
+
}
|
|
57726
|
+
)
|
|
57727
|
+
}
|
|
57728
|
+
) }),
|
|
57729
|
+
!isRoot && onRemove && /* @__PURE__ */ jsx279(EuiFlexItem46, { grow: false, children: /* @__PURE__ */ jsx279(
|
|
57730
|
+
EuiButtonIcon16,
|
|
57731
|
+
{
|
|
57732
|
+
iconType: "trash",
|
|
57733
|
+
color: "danger",
|
|
57734
|
+
onClick: onRemove,
|
|
57735
|
+
"aria-label": t("removeGroup")
|
|
57736
|
+
}
|
|
57737
|
+
) })
|
|
57738
|
+
] }) })
|
|
57739
|
+
]
|
|
57740
|
+
}
|
|
57741
|
+
),
|
|
57742
|
+
group.children.length > 0 && /* @__PURE__ */ jsxs149(Fragment65, { children: [
|
|
57743
|
+
/* @__PURE__ */ jsx279(EuiSpacer30, { size: "m" }),
|
|
57744
|
+
/* @__PURE__ */ jsx279(
|
|
57745
|
+
EuiPanel15,
|
|
57746
|
+
{
|
|
57747
|
+
paddingSize: isRoot ? "none" : "s",
|
|
57748
|
+
color: "transparent",
|
|
57749
|
+
hasShadow: false,
|
|
57750
|
+
children: group.children.map((child, index) => /* @__PURE__ */ jsxs149("div", { children: [
|
|
57751
|
+
index > 0 && /* @__PURE__ */ jsx279(
|
|
57752
|
+
EuiFlexGroup38,
|
|
57753
|
+
{
|
|
57754
|
+
gutterSize: "none",
|
|
57755
|
+
alignItems: "center",
|
|
57756
|
+
justifyContent: "center",
|
|
57757
|
+
children: /* @__PURE__ */ jsx279(EuiFlexItem46, { grow: false, children: /* @__PURE__ */ jsx279(
|
|
57758
|
+
EuiText55,
|
|
57759
|
+
{
|
|
57760
|
+
size: "s",
|
|
57761
|
+
color: theme.colors.textSubdued,
|
|
57762
|
+
textAlign: "center",
|
|
57763
|
+
children: /* @__PURE__ */ jsx279(EuiCode, { children: group.op })
|
|
57764
|
+
}
|
|
57765
|
+
) })
|
|
57766
|
+
}
|
|
57767
|
+
),
|
|
57768
|
+
/* @__PURE__ */ jsx279(EuiSpacer30, { size: "s" }),
|
|
57769
|
+
isCondition(child) ? /* @__PURE__ */ jsx279(
|
|
57770
|
+
ConditionRow,
|
|
57771
|
+
{
|
|
57772
|
+
condition: child,
|
|
57773
|
+
entityType,
|
|
57774
|
+
onChange: (newCondition) => updateChild(index, newCondition),
|
|
57775
|
+
onRemove: () => removeChild(index)
|
|
57776
|
+
}
|
|
57777
|
+
) : /* @__PURE__ */ jsx279(
|
|
57778
|
+
FilterGroup,
|
|
57779
|
+
{
|
|
57780
|
+
group: child,
|
|
57781
|
+
entityType,
|
|
57782
|
+
onChange: (newGroup) => updateChild(index, newGroup),
|
|
57783
|
+
onRemove: () => removeChild(index),
|
|
57784
|
+
depth: depth + 1
|
|
57785
|
+
}
|
|
57786
|
+
),
|
|
57787
|
+
/* @__PURE__ */ jsx279(EuiSpacer30, { size: "s" })
|
|
57788
|
+
] }, index))
|
|
57789
|
+
}
|
|
57790
|
+
)
|
|
57791
|
+
] }),
|
|
57792
|
+
group.children.length === 0 && /* @__PURE__ */ jsxs149(Fragment65, { children: [
|
|
57793
|
+
/* @__PURE__ */ jsx279(EuiSpacer30, { size: "s" }),
|
|
57794
|
+
/* @__PURE__ */ jsx279(
|
|
57795
|
+
EuiCallOut2,
|
|
57796
|
+
{
|
|
57797
|
+
title: t("emptyGroupTitle"),
|
|
57798
|
+
color: "primary",
|
|
57799
|
+
iconType: "iInCircle",
|
|
57800
|
+
size: "s",
|
|
57801
|
+
children: /* @__PURE__ */ jsx279("p", { children: t("emptyGroupDescription") })
|
|
57802
|
+
}
|
|
57803
|
+
)
|
|
57804
|
+
] })
|
|
57805
|
+
]
|
|
57806
|
+
}
|
|
57807
|
+
);
|
|
57808
|
+
};
|
|
57809
|
+
|
|
57810
|
+
// src/components/WfoSearchPage/WfoSearchResults/WfoSearchResults.tsx
|
|
57811
|
+
import { useState as useState63 } from "react";
|
|
57812
|
+
import { EuiFlexGroup as EuiFlexGroup43, EuiPanel as EuiPanel19 } from "@elastic/eui";
|
|
57813
|
+
|
|
57814
|
+
// src/components/WfoSearchPage/WfoSearchResults/WfoSearchEmptyState.tsx
|
|
57815
|
+
import { useTranslations as useTranslations99 } from "next-intl";
|
|
57816
|
+
import { EuiFlexGroup as EuiFlexGroup39, EuiFlexItem as EuiFlexItem47, EuiPanel as EuiPanel16, EuiText as EuiText56 } from "@elastic/eui";
|
|
57817
|
+
import { jsx as jsx280 } from "@emotion/react/jsx-runtime";
|
|
57818
|
+
var WfoSearchEmptyState = () => {
|
|
57819
|
+
const t = useTranslations99("search.page");
|
|
57820
|
+
const { theme } = useOrchestratorTheme();
|
|
57821
|
+
return /* @__PURE__ */ jsx280(EuiPanel16, { paddingSize: "l", color: "transparent", hasShadow: false, children: /* @__PURE__ */ jsx280(EuiFlexGroup39, { justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx280(EuiFlexItem47, { grow: false, children: /* @__PURE__ */ jsx280(EuiText56, { size: "m", color: theme.colors.textSubdued, children: t("noResultsFound") }) }) }) });
|
|
57822
|
+
};
|
|
57823
|
+
|
|
57824
|
+
// src/components/WfoSearchPage/WfoSearchResults/WfoSearchLoadingState.tsx
|
|
57825
|
+
import { useTranslations as useTranslations100 } from "next-intl";
|
|
57826
|
+
import { EuiFlexGroup as EuiFlexGroup40, EuiFlexItem as EuiFlexItem48, EuiPanel as EuiPanel17, EuiText as EuiText57 } from "@elastic/eui";
|
|
57827
|
+
import { jsx as jsx281 } from "@emotion/react/jsx-runtime";
|
|
57828
|
+
var WfoSearchLoadingState = () => {
|
|
57829
|
+
const t = useTranslations100("search.page");
|
|
57830
|
+
const { theme } = useOrchestratorTheme();
|
|
57831
|
+
return /* @__PURE__ */ jsx281(EuiPanel17, { paddingSize: "l", color: "transparent", hasShadow: false, children: /* @__PURE__ */ jsx281(EuiFlexGroup40, { justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx281(EuiFlexItem48, { grow: false, children: /* @__PURE__ */ jsx281(EuiText57, { size: "m", color: theme.colors.textSubdued, children: t("loadingSearchResults") }) }) }) });
|
|
57832
|
+
};
|
|
57833
|
+
|
|
57834
|
+
// src/components/WfoSearchPage/WfoSearchResults/WfoSearchResultItem.tsx
|
|
57835
|
+
import { useEffect as useEffect42, useRef as useRef13 } from "react";
|
|
57836
|
+
import { useTranslations as useTranslations101 } from "next-intl";
|
|
57837
|
+
import {
|
|
57838
|
+
EuiButtonIcon as EuiButtonIcon17,
|
|
57839
|
+
EuiFlexGroup as EuiFlexGroup42,
|
|
57840
|
+
EuiFlexItem as EuiFlexItem50,
|
|
57841
|
+
EuiPanel as EuiPanel18,
|
|
57842
|
+
EuiSpacer as EuiSpacer31,
|
|
57843
|
+
EuiText as EuiText58
|
|
57844
|
+
} from "@elastic/eui";
|
|
57845
|
+
|
|
57846
|
+
// src/components/WfoSearchPage/WfoSearchResults/WfoHighlightedText.tsx
|
|
57847
|
+
import { useMemo as useMemo9 } from "react";
|
|
57848
|
+
import { css as css52 } from "@emotion/react";
|
|
57849
|
+
import { Fragment as Fragment66, jsx as jsx282 } from "@emotion/react/jsx-runtime";
|
|
57850
|
+
var WfoHighlightedText = ({
|
|
57851
|
+
text,
|
|
57852
|
+
highlight_indices
|
|
57853
|
+
}) => {
|
|
57854
|
+
const { theme } = useOrchestratorTheme();
|
|
57855
|
+
const highlightStyles = css52`
|
|
57856
|
+
background-color: ${theme.colors.warning};
|
|
57857
|
+
color: ${theme.colors.plainDark};
|
|
57858
|
+
padding: 0 ${theme.size.xs};
|
|
57859
|
+
font-family: ${theme.font.family};
|
|
57860
|
+
font-weight: ${theme.font.weight.bold};
|
|
57861
|
+
border-radius: ${theme.size.xs};
|
|
57862
|
+
`;
|
|
57863
|
+
const highlightedParts = useMemo9(() => {
|
|
57864
|
+
if (!highlight_indices || highlight_indices.length === 0) {
|
|
57865
|
+
return text;
|
|
57866
|
+
}
|
|
57867
|
+
const sorted = [...highlight_indices].sort((a, b) => a[0] - b[0]);
|
|
57868
|
+
const parts = [];
|
|
57869
|
+
let lastIndex = 0;
|
|
57870
|
+
sorted.forEach(([start, end], idx) => {
|
|
57871
|
+
if (start > lastIndex) {
|
|
57872
|
+
parts.push(
|
|
57873
|
+
/* @__PURE__ */ jsx282("span", { children: text.slice(lastIndex, start) }, `plain-${idx}`)
|
|
57874
|
+
);
|
|
57875
|
+
}
|
|
57876
|
+
parts.push(
|
|
57877
|
+
/* @__PURE__ */ jsx282("span", { css: highlightStyles, children: text.slice(start, end) }, `hl-${idx}`)
|
|
57878
|
+
);
|
|
57879
|
+
lastIndex = end;
|
|
57880
|
+
});
|
|
57881
|
+
if (lastIndex < text.length) {
|
|
57882
|
+
parts.push(/* @__PURE__ */ jsx282("span", { children: text.slice(lastIndex) }, "plain-last"));
|
|
57883
|
+
}
|
|
57884
|
+
return parts;
|
|
57885
|
+
}, [text, highlight_indices, highlightStyles]);
|
|
57886
|
+
return /* @__PURE__ */ jsx282(Fragment66, { children: highlightedParts });
|
|
57887
|
+
};
|
|
57888
|
+
|
|
57889
|
+
// src/components/WfoSearchPage/WfoSearchResults/WfoPathBreadcrumb.tsx
|
|
57890
|
+
import { Fragment as Fragment67 } from "react";
|
|
57891
|
+
import { EuiFlexGroup as EuiFlexGroup41, EuiFlexItem as EuiFlexItem49, EuiIcon as EuiIcon9 } from "@elastic/eui";
|
|
57892
|
+
import { jsx as jsx283, jsxs as jsxs150 } from "@emotion/react/jsx-runtime";
|
|
57893
|
+
var WfoPathBreadcrumb = ({
|
|
57894
|
+
path,
|
|
57895
|
+
size = "m",
|
|
57896
|
+
maxSegments,
|
|
57897
|
+
showArrows = true,
|
|
57898
|
+
color,
|
|
57899
|
+
stripFirstSegment = false
|
|
57900
|
+
}) => {
|
|
57901
|
+
const { theme } = useOrchestratorTheme();
|
|
57902
|
+
if (!path) {
|
|
57903
|
+
return null;
|
|
57904
|
+
}
|
|
57905
|
+
let segments = path.split(".").filter((segment) => !/^\d+$/.test(segment));
|
|
57906
|
+
if (stripFirstSegment && segments.length > 1) {
|
|
57907
|
+
segments = segments.slice(1);
|
|
57908
|
+
}
|
|
57909
|
+
const displaySegments = maxSegments && segments.length > maxSegments ? [
|
|
57910
|
+
...segments.slice(0, maxSegments - 1),
|
|
57911
|
+
"...",
|
|
57912
|
+
segments[segments.length - 1]
|
|
57913
|
+
] : segments;
|
|
57914
|
+
const badgeColor = color || theme.colors.primary;
|
|
57915
|
+
return /* @__PURE__ */ jsx283(
|
|
57916
|
+
EuiFlexGroup41,
|
|
57917
|
+
{
|
|
57918
|
+
gutterSize: size,
|
|
57919
|
+
alignItems: "center",
|
|
57920
|
+
wrap: false,
|
|
57921
|
+
responsive: false,
|
|
57922
|
+
children: displaySegments.map((segment, index) => /* @__PURE__ */ jsxs150(Fragment67, { children: [
|
|
57923
|
+
/* @__PURE__ */ jsx283(EuiFlexItem49, { grow: false, children: /* @__PURE__ */ jsx283(
|
|
57924
|
+
WfoBadge,
|
|
57925
|
+
{
|
|
57926
|
+
color: badgeColor,
|
|
57927
|
+
textColor: theme.colors.ghost,
|
|
57928
|
+
size,
|
|
57929
|
+
children: segment
|
|
57930
|
+
}
|
|
57931
|
+
) }),
|
|
57932
|
+
showArrows && index < displaySegments.length - 1 && /* @__PURE__ */ jsx283(EuiFlexItem49, { grow: false, children: /* @__PURE__ */ jsx283(
|
|
57933
|
+
EuiIcon9,
|
|
57934
|
+
{
|
|
57935
|
+
type: "arrowRight",
|
|
57936
|
+
size,
|
|
57937
|
+
color: theme.colors.link
|
|
57938
|
+
}
|
|
57939
|
+
) })
|
|
57940
|
+
] }, index))
|
|
57941
|
+
}
|
|
57942
|
+
);
|
|
57943
|
+
};
|
|
57944
|
+
|
|
57945
|
+
// src/components/WfoSearchPage/WfoSearchResults/WfoSearchResultItem.tsx
|
|
57946
|
+
import { Fragment as Fragment68, jsx as jsx284, jsxs as jsxs151 } from "@emotion/react/jsx-runtime";
|
|
57947
|
+
var WfoSearchResultItem = ({
|
|
57948
|
+
result,
|
|
57949
|
+
isSelected = false,
|
|
57950
|
+
onSelect,
|
|
57951
|
+
onPositionChange,
|
|
57952
|
+
index
|
|
57953
|
+
}) => {
|
|
57954
|
+
const t = useTranslations101("search.page");
|
|
57955
|
+
const matchingField = result.matching_field;
|
|
57956
|
+
const { theme } = useOrchestratorTheme();
|
|
57957
|
+
const baseUrl = `${window.location.protocol}//${window.location.host}`;
|
|
57958
|
+
const detailUrl = getDetailUrl(result, baseUrl);
|
|
57959
|
+
const itemRef = useRef13(null);
|
|
57960
|
+
useEffect42(() => {
|
|
57961
|
+
if (isSelected && onPositionChange && itemRef.current) {
|
|
57962
|
+
onPositionChange(index, itemRef.current);
|
|
57963
|
+
}
|
|
57964
|
+
}, [isSelected, index, onPositionChange]);
|
|
57965
|
+
return /* @__PURE__ */ jsx284(EuiFlexItem50, { children: /* @__PURE__ */ jsx284(
|
|
57966
|
+
EuiPanel18,
|
|
57967
|
+
{
|
|
57968
|
+
panelRef: itemRef,
|
|
57969
|
+
color: isSelected ? "primary" : "transparent",
|
|
57970
|
+
paddingSize: "m",
|
|
57971
|
+
"data-record-index": index,
|
|
57972
|
+
onClick: () => {
|
|
57973
|
+
onSelect?.();
|
|
57974
|
+
},
|
|
57975
|
+
style: isSelected ? {
|
|
57976
|
+
borderTop: theme.border.thick,
|
|
57977
|
+
borderBottom: theme.border.thick,
|
|
57978
|
+
borderLeft: "none",
|
|
57979
|
+
borderRight: "none",
|
|
57980
|
+
borderColor: theme.colors.primary
|
|
57981
|
+
} : void 0,
|
|
57982
|
+
children: /* @__PURE__ */ jsxs151(EuiFlexGroup42, { alignItems: "flexStart", gutterSize: "m", children: [
|
|
57983
|
+
/* @__PURE__ */ jsx284(EuiFlexItem50, { children: /* @__PURE__ */ jsxs151(EuiFlexGroup42, { direction: "column", gutterSize: "xs", children: [
|
|
57984
|
+
/* @__PURE__ */ jsx284(EuiFlexItem50, { children: /* @__PURE__ */ jsx284(
|
|
57985
|
+
EuiText58,
|
|
57986
|
+
{
|
|
57987
|
+
size: "m",
|
|
57988
|
+
style: {
|
|
57989
|
+
fontWeight: theme.font.weight.semiBold
|
|
57990
|
+
},
|
|
57991
|
+
children: getDescription(result)
|
|
57992
|
+
}
|
|
57993
|
+
) }),
|
|
57994
|
+
matchingField && /* @__PURE__ */ jsxs151(Fragment68, { children: [
|
|
57995
|
+
matchingField.path && /* @__PURE__ */ jsx284(EuiFlexItem50, { children: /* @__PURE__ */ jsx284(
|
|
57996
|
+
WfoPathBreadcrumb,
|
|
57997
|
+
{
|
|
57998
|
+
path: matchingField.path,
|
|
57999
|
+
size: "s",
|
|
58000
|
+
maxSegments: 4,
|
|
58001
|
+
color: theme.colors.primary
|
|
58002
|
+
}
|
|
58003
|
+
) }),
|
|
58004
|
+
/* @__PURE__ */ jsx284(EuiFlexItem50, { children: /* @__PURE__ */ jsx284(
|
|
58005
|
+
EuiText58,
|
|
58006
|
+
{
|
|
58007
|
+
style: {
|
|
58008
|
+
backgroundColor: "transparent",
|
|
58009
|
+
borderRadius: theme.border.radius.medium,
|
|
58010
|
+
fontSize: theme.size.base
|
|
58011
|
+
},
|
|
58012
|
+
children: /* @__PURE__ */ jsx284(
|
|
58013
|
+
WfoHighlightedText,
|
|
58014
|
+
{
|
|
58015
|
+
text: matchingField.text,
|
|
58016
|
+
highlight_indices: matchingField.highlight_indices
|
|
58017
|
+
}
|
|
58018
|
+
)
|
|
58019
|
+
}
|
|
58020
|
+
) }),
|
|
58021
|
+
/* @__PURE__ */ jsx284(EuiSpacer31, { size: "xs" })
|
|
58022
|
+
] })
|
|
58023
|
+
] }) }),
|
|
58024
|
+
/* @__PURE__ */ jsx284(EuiFlexItem50, { grow: false, children: /* @__PURE__ */ jsxs151(
|
|
58025
|
+
EuiFlexGroup42,
|
|
58026
|
+
{
|
|
58027
|
+
direction: "column",
|
|
58028
|
+
alignItems: "flexEnd",
|
|
58029
|
+
gutterSize: "xs",
|
|
58030
|
+
children: [
|
|
58031
|
+
/* @__PURE__ */ jsx284(EuiFlexItem50, { children: /* @__PURE__ */ jsx284(
|
|
58032
|
+
WfoBadge,
|
|
58033
|
+
{
|
|
58034
|
+
color: theme.colors.primary,
|
|
58035
|
+
textColor: theme.colors.ghost,
|
|
58036
|
+
children: "score" in result && result.score ? result.score.toFixed(4) : "N/A"
|
|
58037
|
+
}
|
|
58038
|
+
) }),
|
|
58039
|
+
/* @__PURE__ */ jsx284(EuiFlexItem50, { children: /* @__PURE__ */ jsx284(
|
|
58040
|
+
EuiButtonIcon17,
|
|
58041
|
+
{
|
|
58042
|
+
iconType: "popout",
|
|
58043
|
+
"aria-label": t("viewDetails"),
|
|
58044
|
+
onClick: (e) => {
|
|
58045
|
+
e.stopPropagation();
|
|
58046
|
+
window.open(detailUrl, "_blank");
|
|
58047
|
+
},
|
|
58048
|
+
color: "text",
|
|
58049
|
+
size: "m"
|
|
58050
|
+
}
|
|
58051
|
+
) })
|
|
58052
|
+
]
|
|
58053
|
+
}
|
|
58054
|
+
) })
|
|
58055
|
+
] })
|
|
58056
|
+
}
|
|
58057
|
+
) });
|
|
58058
|
+
};
|
|
58059
|
+
|
|
58060
|
+
// src/components/WfoSearchPage/WfoSearchResults/WfoSubscriptionDetailModal.tsx
|
|
58061
|
+
import { useTranslations as useTranslations102 } from "next-intl";
|
|
58062
|
+
import {
|
|
58063
|
+
EuiButton as EuiButton23,
|
|
58064
|
+
EuiModal as EuiModal5,
|
|
58065
|
+
EuiModalBody as EuiModalBody5,
|
|
58066
|
+
EuiModalFooter as EuiModalFooter5,
|
|
58067
|
+
EuiModalHeader as EuiModalHeader5,
|
|
58068
|
+
EuiModalHeaderTitle as EuiModalHeaderTitle5
|
|
58069
|
+
} from "@elastic/eui";
|
|
58070
|
+
import { jsx as jsx285, jsxs as jsxs152 } from "@emotion/react/jsx-runtime";
|
|
58071
|
+
var WfoSubscriptionDetailModal = ({ isVisible, onClose, subscriptionData }) => {
|
|
58072
|
+
const t = useTranslations102("search.page");
|
|
58073
|
+
if (!isVisible || !subscriptionData) return null;
|
|
58074
|
+
const subscriptionId = subscriptionData && subscriptionData.subscription_id;
|
|
58075
|
+
return /* @__PURE__ */ jsxs152(EuiModal5, { onClose, maxWidth: 800, children: [
|
|
58076
|
+
/* @__PURE__ */ jsx285(EuiModalHeader5, { children: /* @__PURE__ */ jsx285(EuiModalHeaderTitle5, { children: t("subscriptionDetails") }) }),
|
|
58077
|
+
/* @__PURE__ */ jsx285(EuiModalBody5, { children: /* @__PURE__ */ jsx285(TreeProvider, { children: /* @__PURE__ */ jsx285(WfoSubscription, { subscriptionId }) }) }),
|
|
58078
|
+
/* @__PURE__ */ jsx285(EuiModalFooter5, { children: /* @__PURE__ */ jsx285(EuiButton23, { onClick: onClose, fill: true, children: t("closeButton") }) })
|
|
58079
|
+
] });
|
|
58080
|
+
};
|
|
58081
|
+
|
|
58082
|
+
// src/components/WfoSearchPage/WfoSearchResults/WfoSearchResults.tsx
|
|
58083
|
+
import { Fragment as Fragment69, jsx as jsx286, jsxs as jsxs153 } from "@emotion/react/jsx-runtime";
|
|
58084
|
+
var WfoSearchResults = ({
|
|
58085
|
+
results,
|
|
58086
|
+
loading,
|
|
58087
|
+
selectedRecordIndex = 0,
|
|
58088
|
+
onRecordSelect
|
|
58089
|
+
}) => {
|
|
58090
|
+
const [modalData, setModalData] = useState63(null);
|
|
58091
|
+
const handleCloseModal = () => {
|
|
58092
|
+
setModalData(null);
|
|
58093
|
+
};
|
|
58094
|
+
if (loading) {
|
|
58095
|
+
return /* @__PURE__ */ jsx286(WfoSearchLoadingState, {});
|
|
58096
|
+
}
|
|
58097
|
+
if (!results || results.length === 0) {
|
|
58098
|
+
return /* @__PURE__ */ jsx286(WfoSearchEmptyState, {});
|
|
58099
|
+
}
|
|
58100
|
+
return /* @__PURE__ */ jsxs153(Fragment69, { children: [
|
|
58101
|
+
/* @__PURE__ */ jsx286(EuiPanel19, { paddingSize: "m", hasShadow: false, children: /* @__PURE__ */ jsx286(EuiFlexGroup43, { direction: "column", gutterSize: "s", children: results.map((result, idx) => /* @__PURE__ */ jsx286(
|
|
58102
|
+
WfoSearchResultItem,
|
|
58103
|
+
{
|
|
58104
|
+
result,
|
|
58105
|
+
index: idx,
|
|
58106
|
+
isSelected: idx === selectedRecordIndex,
|
|
58107
|
+
onSelect: () => onRecordSelect?.(idx)
|
|
58108
|
+
},
|
|
58109
|
+
idx
|
|
58110
|
+
)) }) }),
|
|
58111
|
+
/* @__PURE__ */ jsx286(
|
|
58112
|
+
WfoSubscriptionDetailModal,
|
|
58113
|
+
{
|
|
58114
|
+
isVisible: !!modalData,
|
|
58115
|
+
onClose: handleCloseModal,
|
|
58116
|
+
subscriptionData: modalData?.subscription,
|
|
58117
|
+
matchingField: modalData?.matchingField
|
|
58118
|
+
}
|
|
58119
|
+
)
|
|
58120
|
+
] });
|
|
58121
|
+
};
|
|
58122
|
+
|
|
58123
|
+
// src/components/WfoSearchPage/WfoSearchResults/WfoSearchMetadataHeader.tsx
|
|
58124
|
+
import { jsx as jsx287 } from "@emotion/react/jsx-runtime";
|
|
58125
|
+
var WfoSearchMetadataHeader = ({
|
|
58126
|
+
search_metadata
|
|
58127
|
+
}) => {
|
|
58128
|
+
if (!search_metadata.search_type) return null;
|
|
58129
|
+
return /* @__PURE__ */ jsx287(WfoToolTip, { tooltipContent: search_metadata.description || "", children: /* @__PURE__ */ jsx287(WfoBadge, { color: "hollow", iconType: "search", textColor: "default", children: search_metadata.search_type }) });
|
|
58130
|
+
};
|
|
58131
|
+
|
|
58132
|
+
// src/components/WfoSearchPage/WfoSearchResults/WfoSearchPaginationInfo.tsx
|
|
58133
|
+
import { useTranslations as useTranslations103 } from "next-intl";
|
|
58134
|
+
import {
|
|
58135
|
+
EuiButtonIcon as EuiButtonIcon18,
|
|
58136
|
+
EuiFlexGroup as EuiFlexGroup44,
|
|
58137
|
+
EuiFlexItem as EuiFlexItem51,
|
|
58138
|
+
EuiText as EuiText59
|
|
58139
|
+
} from "@elastic/eui";
|
|
58140
|
+
import { jsx as jsx288, jsxs as jsxs154 } from "@emotion/react/jsx-runtime";
|
|
58141
|
+
var WfoSearchPaginationInfo = ({
|
|
58142
|
+
has_next_page,
|
|
58143
|
+
next_page_cursor,
|
|
58144
|
+
onNextPage,
|
|
58145
|
+
onPrevPage,
|
|
58146
|
+
isLoading = false,
|
|
58147
|
+
currentPage = 1,
|
|
58148
|
+
hasPrevPage = false,
|
|
58149
|
+
resultCount
|
|
58150
|
+
}) => {
|
|
58151
|
+
const t = useTranslations103("search.page");
|
|
58152
|
+
const { theme } = useOrchestratorTheme();
|
|
58153
|
+
const handleNextPage = () => {
|
|
58154
|
+
if (!isLoading && next_page_cursor && onNextPage)
|
|
58155
|
+
onNextPage(next_page_cursor);
|
|
58156
|
+
};
|
|
58157
|
+
const handlePrevPage = () => {
|
|
58158
|
+
if (!isLoading && onPrevPage) onPrevPage();
|
|
58159
|
+
};
|
|
58160
|
+
if (!has_next_page && !hasPrevPage) return null;
|
|
58161
|
+
return /* @__PURE__ */ jsxs154(
|
|
58162
|
+
EuiFlexGroup44,
|
|
58163
|
+
{
|
|
58164
|
+
justifyContent: "flexEnd",
|
|
58165
|
+
alignItems: "center",
|
|
58166
|
+
gutterSize: "xs",
|
|
58167
|
+
responsive: false,
|
|
58168
|
+
style: {
|
|
58169
|
+
whiteSpace: "nowrap",
|
|
58170
|
+
padding: 0,
|
|
58171
|
+
background: "transparent",
|
|
58172
|
+
border: "none"
|
|
58173
|
+
},
|
|
58174
|
+
role: "navigation",
|
|
58175
|
+
"aria-label": t("searchResultsPagination"),
|
|
58176
|
+
children: [
|
|
58177
|
+
/* @__PURE__ */ jsx288(EuiFlexItem51, { grow: false, children: /* @__PURE__ */ jsx288(
|
|
58178
|
+
EuiButtonIcon18,
|
|
58179
|
+
{
|
|
58180
|
+
iconType: "arrowLeft",
|
|
58181
|
+
"aria-label": t("previousPage"),
|
|
58182
|
+
onClick: handlePrevPage,
|
|
58183
|
+
disabled: !hasPrevPage || isLoading,
|
|
58184
|
+
color: "text",
|
|
58185
|
+
size: "s"
|
|
58186
|
+
}
|
|
58187
|
+
) }),
|
|
58188
|
+
/* @__PURE__ */ jsx288(EuiFlexItem51, { grow: false, children: /* @__PURE__ */ jsxs154(EuiText59, { size: "xs", color: theme.colors.textSubdued, children: [
|
|
58189
|
+
t("page"),
|
|
58190
|
+
" ",
|
|
58191
|
+
currentPage
|
|
58192
|
+
] }) }),
|
|
58193
|
+
/* @__PURE__ */ jsx288(EuiFlexItem51, { grow: false, children: /* @__PURE__ */ jsx288(
|
|
58194
|
+
EuiButtonIcon18,
|
|
58195
|
+
{
|
|
58196
|
+
iconType: "arrowRight",
|
|
58197
|
+
"aria-label": t("nextPage"),
|
|
58198
|
+
onClick: handleNextPage,
|
|
58199
|
+
disabled: !has_next_page || isLoading,
|
|
58200
|
+
color: "text",
|
|
58201
|
+
size: "s",
|
|
58202
|
+
isLoading
|
|
58203
|
+
}
|
|
58204
|
+
) }),
|
|
58205
|
+
resultCount && resultCount > 0 && /* @__PURE__ */ jsx288(EuiFlexItem51, { grow: false, children: /* @__PURE__ */ jsx288(
|
|
58206
|
+
WfoBadge,
|
|
58207
|
+
{
|
|
58208
|
+
className: "wfoPagination__badge",
|
|
58209
|
+
color: "hollow",
|
|
58210
|
+
textColor: "default",
|
|
58211
|
+
children: t("resultsOnPage", { resultCount })
|
|
58212
|
+
}
|
|
58213
|
+
) })
|
|
58214
|
+
]
|
|
58215
|
+
}
|
|
58216
|
+
);
|
|
58217
|
+
};
|
|
58218
|
+
|
|
58219
|
+
// src/components/WfoSearchPage/WfoSearch/WfoSearch.tsx
|
|
58220
|
+
import { Fragment as Fragment70, jsx as jsx289, jsxs as jsxs155 } from "@emotion/react/jsx-runtime";
|
|
58221
|
+
var WfoSearch = () => {
|
|
58222
|
+
const t = useTranslations104("search.page");
|
|
58223
|
+
const { theme } = useOrchestratorTheme();
|
|
58224
|
+
const {
|
|
58225
|
+
urlParams,
|
|
58226
|
+
query,
|
|
58227
|
+
selectedEntityTab,
|
|
58228
|
+
showFilters,
|
|
58229
|
+
selectedRecordIndex,
|
|
58230
|
+
selectedRecordId,
|
|
58231
|
+
setQuery,
|
|
58232
|
+
setSelectedEntityTab,
|
|
58233
|
+
setShowFilters,
|
|
58234
|
+
setSelectedRecordIndex,
|
|
58235
|
+
setSelectedRecordId
|
|
58236
|
+
} = useUrlParams();
|
|
58237
|
+
const pageSize = DEFAULT_PAGE_SIZE2;
|
|
58238
|
+
const [filterGroup, setFilterGroup] = useState64({
|
|
58239
|
+
op: "AND",
|
|
58240
|
+
children: []
|
|
58241
|
+
});
|
|
58242
|
+
const [showDetailPanel, setShowDetailPanel] = useState64(false);
|
|
58243
|
+
const debouncedQuery = useDebounce(query, DEFAULT_DEBOUNCE_DELAY);
|
|
58244
|
+
const { results, loading, setResults } = useSearch(
|
|
58245
|
+
debouncedQuery,
|
|
58246
|
+
selectedEntityTab,
|
|
58247
|
+
filterGroup,
|
|
58248
|
+
pageSize
|
|
58249
|
+
);
|
|
58250
|
+
const [hasSearchBeenAttempted, setHasSearchBeenAttempted] = useState64(false);
|
|
58251
|
+
useEffect43(() => {
|
|
58252
|
+
const queryText = typeof debouncedQuery === "string" ? debouncedQuery : debouncedQuery?.text?.trim() || "";
|
|
58253
|
+
const hasFilters = filterGroup && filterGroup.children.length > 0;
|
|
58254
|
+
if (queryText.length >= 2 || hasFilters) {
|
|
58255
|
+
setHasSearchBeenAttempted(true);
|
|
58256
|
+
} else if (queryText === "" || queryText === "*") {
|
|
58257
|
+
setHasSearchBeenAttempted(false);
|
|
58258
|
+
}
|
|
58259
|
+
}, [debouncedQuery, filterGroup]);
|
|
58260
|
+
const {
|
|
58261
|
+
currentPage,
|
|
58262
|
+
error,
|
|
58263
|
+
isLoadingMore,
|
|
58264
|
+
handleNextPage,
|
|
58265
|
+
handlePrevPage,
|
|
58266
|
+
resetPagination,
|
|
58267
|
+
setError
|
|
58268
|
+
} = useSearchPagination(
|
|
58269
|
+
debouncedQuery,
|
|
58270
|
+
selectedEntityTab,
|
|
58271
|
+
filterGroup,
|
|
58272
|
+
pageSize,
|
|
58273
|
+
results,
|
|
58274
|
+
setResults
|
|
58275
|
+
);
|
|
58276
|
+
const [searchValue, setSearchValue] = useState64(() => {
|
|
58277
|
+
if (typeof query === "string") {
|
|
58278
|
+
return query;
|
|
58279
|
+
}
|
|
58280
|
+
const queryText = query.text || "";
|
|
58281
|
+
return queryText;
|
|
58282
|
+
});
|
|
58283
|
+
const handleTabChange = (tabId) => {
|
|
58284
|
+
setSelectedEntityTab(tabId);
|
|
58285
|
+
setQuery("");
|
|
58286
|
+
setSearchValue("");
|
|
58287
|
+
setFilterGroup({
|
|
58288
|
+
op: "AND",
|
|
58289
|
+
children: []
|
|
58290
|
+
});
|
|
58291
|
+
setResults({
|
|
58292
|
+
data: [],
|
|
58293
|
+
page_info: {
|
|
58294
|
+
has_next_page: false,
|
|
58295
|
+
next_page_cursor: null
|
|
58296
|
+
},
|
|
58297
|
+
search_metadata: {
|
|
58298
|
+
search_type: null,
|
|
58299
|
+
description: null
|
|
58300
|
+
}
|
|
58301
|
+
});
|
|
58302
|
+
setSelectedRecordIndex(0);
|
|
58303
|
+
setShowDetailPanel(false);
|
|
58304
|
+
resetPagination();
|
|
58305
|
+
};
|
|
58306
|
+
const onSearchChange = (searchText) => {
|
|
58307
|
+
const cleanedText = searchText.replace(/[=><[\]{}\\/#$%^&+]/g, "");
|
|
58308
|
+
setSearchValue(cleanedText);
|
|
58309
|
+
setQuery(cleanedText.trim() || "");
|
|
58310
|
+
};
|
|
58311
|
+
useEffect43(() => {
|
|
58312
|
+
if (typeof query === "string") {
|
|
58313
|
+
if (query !== searchValue) {
|
|
58314
|
+
setSearchValue(query);
|
|
58315
|
+
}
|
|
58316
|
+
} else {
|
|
58317
|
+
const queryText = query.text || "";
|
|
58318
|
+
if (queryText !== searchValue) {
|
|
58319
|
+
setSearchValue(queryText);
|
|
58320
|
+
}
|
|
58321
|
+
}
|
|
58322
|
+
}, [query, searchValue]);
|
|
58323
|
+
const currentTab = ENTITY_TABS.find((tab) => tab.id === selectedEntityTab);
|
|
58324
|
+
const isSearchActive = results.data.length > 0 || loading;
|
|
58325
|
+
const shouldShowNoResults = (() => {
|
|
58326
|
+
return hasSearchBeenAttempted && !loading && results.data.length === 0;
|
|
58327
|
+
})();
|
|
58328
|
+
useEffect43(() => {
|
|
58329
|
+
if (results.data.length > 0) {
|
|
58330
|
+
if (selectedRecordId) {
|
|
58331
|
+
const foundIndex = findResultIndexById(
|
|
58332
|
+
results.data,
|
|
58333
|
+
selectedRecordId
|
|
58334
|
+
);
|
|
58335
|
+
if (foundIndex !== -1) {
|
|
58336
|
+
setSelectedRecordIndex(foundIndex);
|
|
58337
|
+
} else if (results.data.length <= SMALL_RESULT_THRESHOLD) {
|
|
58338
|
+
setSelectedRecordIndex(0);
|
|
58339
|
+
setSelectedRecordId(null);
|
|
58340
|
+
}
|
|
58341
|
+
} else if (results.data.length <= SMALL_RESULT_THRESHOLD) {
|
|
58342
|
+
const indexFromUrl = urlParams.get("selected");
|
|
58343
|
+
if (!indexFromUrl) {
|
|
58344
|
+
setSelectedRecordIndex(0);
|
|
58345
|
+
}
|
|
58346
|
+
}
|
|
58347
|
+
}
|
|
58348
|
+
}, [results.data, selectedRecordId, urlParams]);
|
|
58349
|
+
useEffect43(() => {
|
|
58350
|
+
setShowDetailPanel(
|
|
58351
|
+
results?.data?.length > 0 && selectedRecordIndex >= 0
|
|
58352
|
+
);
|
|
58353
|
+
}, [results?.data?.length, selectedRecordIndex]);
|
|
58354
|
+
useEffect43(() => {
|
|
58355
|
+
resetPagination();
|
|
58356
|
+
}, [debouncedQuery, selectedEntityTab, filterGroup, resetPagination]);
|
|
58357
|
+
const { RESULTS_GROW, DETAIL_GROW } = LAYOUT_RATIOS;
|
|
58358
|
+
return /* @__PURE__ */ jsxs155(Fragment70, { children: [
|
|
58359
|
+
/* @__PURE__ */ jsx289(EuiTabs4, { children: ENTITY_TABS.map((tab) => /* @__PURE__ */ jsx289(
|
|
58360
|
+
EuiTab4,
|
|
58361
|
+
{
|
|
58362
|
+
onClick: () => handleTabChange(tab.id),
|
|
58363
|
+
isSelected: selectedEntityTab === tab.id,
|
|
58364
|
+
children: tab.label
|
|
58365
|
+
},
|
|
58366
|
+
tab.id
|
|
58367
|
+
)) }),
|
|
58368
|
+
/* @__PURE__ */ jsx289(EuiSpacer32, { size: "m" }),
|
|
58369
|
+
/* @__PURE__ */ jsx289(
|
|
58370
|
+
EuiFieldSearch3,
|
|
58371
|
+
{
|
|
58372
|
+
placeholder: t("searchPlaceholder", {
|
|
58373
|
+
entityType: currentTab?.label.toLowerCase()
|
|
58374
|
+
}),
|
|
58375
|
+
value: searchValue || "",
|
|
58376
|
+
onChange: (event) => {
|
|
58377
|
+
onSearchChange(event.target.value);
|
|
58378
|
+
},
|
|
58379
|
+
onSearch: (value) => {
|
|
58380
|
+
onSearchChange(value);
|
|
58381
|
+
},
|
|
58382
|
+
incremental: true,
|
|
58383
|
+
fullWidth: true
|
|
58384
|
+
}
|
|
58385
|
+
),
|
|
58386
|
+
/* @__PURE__ */ jsx289(EuiSpacer32, { size: "s" }),
|
|
58387
|
+
/* @__PURE__ */ jsx289(EuiFlexGroup45, { gutterSize: "s", alignItems: "center", children: /* @__PURE__ */ jsx289(EuiFlexItem52, { grow: false, children: /* @__PURE__ */ jsx289(
|
|
58388
|
+
EuiButton24,
|
|
58389
|
+
{
|
|
58390
|
+
iconType: showFilters ? "eyeClosed" : "eye",
|
|
58391
|
+
size: "s",
|
|
58392
|
+
onClick: () => setShowFilters(!showFilters),
|
|
58393
|
+
children: showFilters ? t("hideFilters") : t("showFilters")
|
|
58394
|
+
}
|
|
58395
|
+
) }) }),
|
|
58396
|
+
showFilters && /* @__PURE__ */ jsxs155(Fragment70, { children: [
|
|
58397
|
+
/* @__PURE__ */ jsx289(EuiSpacer32, { size: "m" }),
|
|
58398
|
+
/* @__PURE__ */ jsxs155(EuiPanel20, { hasBorder: true, paddingSize: "m", children: [
|
|
58399
|
+
/* @__PURE__ */ jsx289(EuiText60, { children: /* @__PURE__ */ jsx289("h4", { children: t("structuredFilters") }) }),
|
|
58400
|
+
/* @__PURE__ */ jsx289(EuiSpacer32, { size: "s" }),
|
|
58401
|
+
/* @__PURE__ */ jsx289(
|
|
58402
|
+
FilterGroup,
|
|
58403
|
+
{
|
|
58404
|
+
group: filterGroup,
|
|
58405
|
+
entityType: selectedEntityTab,
|
|
58406
|
+
onChange: setFilterGroup,
|
|
58407
|
+
isRoot: true
|
|
58408
|
+
}
|
|
58409
|
+
)
|
|
58410
|
+
] })
|
|
58411
|
+
] }),
|
|
58412
|
+
/* @__PURE__ */ jsx289(EuiSpacer32, { size: "m" }),
|
|
58413
|
+
error && /* @__PURE__ */ jsxs155(Fragment70, { children: [
|
|
58414
|
+
/* @__PURE__ */ jsxs155(
|
|
58415
|
+
EuiCallOut3,
|
|
58416
|
+
{
|
|
58417
|
+
title: t("searchError"),
|
|
58418
|
+
color: "danger",
|
|
58419
|
+
iconType: "alert",
|
|
58420
|
+
size: "s",
|
|
58421
|
+
children: [
|
|
58422
|
+
/* @__PURE__ */ jsx289("p", { children: error }),
|
|
58423
|
+
/* @__PURE__ */ jsx289(
|
|
58424
|
+
EuiButton24,
|
|
58425
|
+
{
|
|
58426
|
+
size: "s",
|
|
58427
|
+
color: "danger",
|
|
58428
|
+
onClick: () => setError(null),
|
|
58429
|
+
children: t("dismiss")
|
|
58430
|
+
}
|
|
58431
|
+
)
|
|
58432
|
+
]
|
|
58433
|
+
}
|
|
58434
|
+
),
|
|
58435
|
+
/* @__PURE__ */ jsx289(EuiSpacer32, { size: "m" })
|
|
58436
|
+
] }),
|
|
58437
|
+
shouldShowNoResults && /* @__PURE__ */ jsxs155(Fragment70, { children: [
|
|
58438
|
+
/* @__PURE__ */ jsx289(EuiSpacer32, { size: "l" }),
|
|
58439
|
+
/* @__PURE__ */ jsxs155(
|
|
58440
|
+
EuiCallOut3,
|
|
58441
|
+
{
|
|
58442
|
+
title: t("noResults"),
|
|
58443
|
+
color: "primary",
|
|
58444
|
+
iconType: "search",
|
|
58445
|
+
size: "m",
|
|
58446
|
+
children: [
|
|
58447
|
+
/* @__PURE__ */ jsx289("p", { children: t("noResultsMessage", {
|
|
58448
|
+
entityType: currentTab?.label.toLowerCase()
|
|
58449
|
+
}) }),
|
|
58450
|
+
/* @__PURE__ */ jsx289(EuiSpacer32, { size: "s" }),
|
|
58451
|
+
/* @__PURE__ */ jsx289(EuiText60, { size: "s", color: "subdued", children: /* @__PURE__ */ jsx289("p", { children: t("noResultsSuggestions") }) })
|
|
58452
|
+
]
|
|
58453
|
+
}
|
|
58454
|
+
),
|
|
58455
|
+
/* @__PURE__ */ jsx289(EuiSpacer32, { size: "l" })
|
|
58456
|
+
] }),
|
|
58457
|
+
isSearchActive && /* @__PURE__ */ jsxs155(Fragment70, { children: [
|
|
58458
|
+
/* @__PURE__ */ jsx289(EuiSpacer32, { size: "m" }),
|
|
58459
|
+
/* @__PURE__ */ jsxs155(EuiFlexGroup45, { gutterSize: "s", alignItems: "center", children: [
|
|
58460
|
+
/* @__PURE__ */ jsx289(EuiFlexItem52, { grow: showDetailPanel ? RESULTS_GROW : 1, children: /* @__PURE__ */ jsxs155(
|
|
58461
|
+
EuiFlexGroup45,
|
|
58462
|
+
{
|
|
58463
|
+
gutterSize: "s",
|
|
58464
|
+
alignItems: "center",
|
|
58465
|
+
justifyContent: "spaceBetween",
|
|
58466
|
+
responsive: false,
|
|
58467
|
+
style: { width: "100%" },
|
|
58468
|
+
children: [
|
|
58469
|
+
/* @__PURE__ */ jsx289(EuiFlexItem52, { grow: false, children: /* @__PURE__ */ jsx289(
|
|
58470
|
+
WfoSearchMetadataHeader,
|
|
58471
|
+
{
|
|
58472
|
+
search_metadata: results.search_metadata
|
|
58473
|
+
}
|
|
58474
|
+
) }),
|
|
58475
|
+
/* @__PURE__ */ jsx289(EuiFlexItem52, { grow: false, children: /* @__PURE__ */ jsx289(
|
|
58476
|
+
WfoSearchPaginationInfo,
|
|
58477
|
+
{
|
|
58478
|
+
has_next_page: results.page_info.has_next_page,
|
|
58479
|
+
next_page_cursor: results.page_info.next_page_cursor,
|
|
58480
|
+
onNextPage: handleNextPage,
|
|
58481
|
+
onPrevPage: handlePrevPage,
|
|
58482
|
+
isLoading: isLoadingMore,
|
|
58483
|
+
currentPage,
|
|
58484
|
+
hasPrevPage: currentPage > 1,
|
|
58485
|
+
resultCount: results?.data?.length || 0
|
|
58486
|
+
}
|
|
58487
|
+
) })
|
|
58488
|
+
]
|
|
58489
|
+
}
|
|
58490
|
+
) }),
|
|
58491
|
+
showDetailPanel && /* @__PURE__ */ jsx289(EuiFlexItem52, { grow: DETAIL_GROW })
|
|
58492
|
+
] }),
|
|
58493
|
+
/* @__PURE__ */ jsx289(EuiSpacer32, { size: "s" }),
|
|
58494
|
+
/* @__PURE__ */ jsxs155(EuiFlexGroup45, { gutterSize: "s", alignItems: "flexStart", children: [
|
|
58495
|
+
/* @__PURE__ */ jsx289(EuiFlexItem52, { grow: showDetailPanel ? RESULTS_GROW : 1, children: /* @__PURE__ */ jsx289(EuiPanel20, { paddingSize: "none", hasBorder: true, children: /* @__PURE__ */ jsx289(
|
|
58496
|
+
WfoSearchResults,
|
|
58497
|
+
{
|
|
58498
|
+
results: results.data,
|
|
58499
|
+
loading,
|
|
58500
|
+
selectedRecordIndex,
|
|
58501
|
+
onRecordSelect: (index) => {
|
|
58502
|
+
setSelectedRecordIndex(index);
|
|
58503
|
+
const record = results.data[index];
|
|
58504
|
+
if (record) {
|
|
58505
|
+
const recordId = getRecordId(record);
|
|
58506
|
+
setSelectedRecordId(recordId);
|
|
58507
|
+
}
|
|
58508
|
+
}
|
|
58509
|
+
}
|
|
58510
|
+
) }) }),
|
|
58511
|
+
showDetailPanel && /* @__PURE__ */ jsx289(EuiFlexItem52, { grow: DETAIL_GROW, children: /* @__PURE__ */ jsx289(
|
|
58512
|
+
EuiPanel20,
|
|
58513
|
+
{
|
|
58514
|
+
paddingSize: "m",
|
|
58515
|
+
hasBorder: true,
|
|
58516
|
+
hasShadow: false,
|
|
58517
|
+
color: "transparent",
|
|
58518
|
+
children: selectedEntityTab === "SUBSCRIPTION" && results.data[selectedRecordIndex] && isSubscriptionSearchResult(
|
|
58519
|
+
results.data[selectedRecordIndex]
|
|
58520
|
+
) ? /* @__PURE__ */ jsx289(TreeProvider, { children: /* @__PURE__ */ jsx289(
|
|
58521
|
+
WfoSubscription,
|
|
58522
|
+
{
|
|
58523
|
+
subscriptionId: results.data[selectedRecordIndex].subscription.subscription_id
|
|
58524
|
+
}
|
|
58525
|
+
) }) : /* @__PURE__ */ jsxs155(Fragment70, { children: [
|
|
58526
|
+
/* @__PURE__ */ jsx289(EuiText60, { children: /* @__PURE__ */ jsx289("h4", { children: t("details") }) }),
|
|
58527
|
+
/* @__PURE__ */ jsx289(EuiSpacer32, { size: "m" }),
|
|
58528
|
+
/* @__PURE__ */ jsxs155(
|
|
58529
|
+
EuiText60,
|
|
58530
|
+
{
|
|
58531
|
+
color: theme.colors.textSubdued,
|
|
58532
|
+
children: [
|
|
58533
|
+
/* @__PURE__ */ jsx289("p", { children: t(
|
|
58534
|
+
"showingDetailsForResult",
|
|
58535
|
+
{
|
|
58536
|
+
resultNumber: selectedRecordIndex + 1
|
|
58537
|
+
}
|
|
58538
|
+
) }),
|
|
58539
|
+
/* @__PURE__ */ jsx289(EuiSpacer32, { size: "s" }),
|
|
58540
|
+
/* @__PURE__ */ jsxs155(
|
|
58541
|
+
WfoBadge,
|
|
58542
|
+
{
|
|
58543
|
+
color: theme.colors.primary,
|
|
58544
|
+
textColor: theme.colors.ghost,
|
|
58545
|
+
children: [
|
|
58546
|
+
selectedEntityTab,
|
|
58547
|
+
" #",
|
|
58548
|
+
selectedRecordIndex + 1
|
|
58549
|
+
]
|
|
58550
|
+
}
|
|
58551
|
+
),
|
|
58552
|
+
/* @__PURE__ */ jsx289(EuiSpacer32, { size: "m" }),
|
|
58553
|
+
/* @__PURE__ */ jsx289("p", { children: /* @__PURE__ */ jsx289("em", { children: t(
|
|
58554
|
+
"selectResultInstruction"
|
|
58555
|
+
) }) })
|
|
58556
|
+
]
|
|
58557
|
+
}
|
|
58558
|
+
)
|
|
58559
|
+
] })
|
|
58560
|
+
}
|
|
58561
|
+
) })
|
|
58562
|
+
] })
|
|
58563
|
+
] })
|
|
58564
|
+
] });
|
|
58565
|
+
};
|
|
58566
|
+
|
|
58567
|
+
// src/components/WfoAgent/WfoAgent/WfoAgent.tsx
|
|
58568
|
+
import { useTranslations as useTranslations106 } from "next-intl";
|
|
58569
|
+
import { useCoAgent } from "@copilotkit/react-core";
|
|
58570
|
+
import { CopilotSidebar } from "@copilotkit/react-ui";
|
|
58571
|
+
import { EuiFlexGroup as EuiFlexGroup47, EuiFlexItem as EuiFlexItem54, EuiSpacer as EuiSpacer34, EuiText as EuiText62 } from "@elastic/eui";
|
|
58572
|
+
|
|
58573
|
+
// src/components/WfoAgent/FilterDisplay/FilterDisplay.tsx
|
|
58574
|
+
import { useTranslations as useTranslations105 } from "next-intl";
|
|
58575
|
+
import {
|
|
58576
|
+
EuiFlexGroup as EuiFlexGroup46,
|
|
58577
|
+
EuiFlexItem as EuiFlexItem53,
|
|
58578
|
+
EuiPanel as EuiPanel21,
|
|
58579
|
+
EuiSpacer as EuiSpacer33,
|
|
58580
|
+
EuiText as EuiText61
|
|
58581
|
+
} from "@elastic/eui";
|
|
58582
|
+
|
|
58583
|
+
// src/components/WfoAgent/FilterDisplay/styles.ts
|
|
58584
|
+
import { css as css53 } from "@emotion/react";
|
|
58585
|
+
var getFilterDisplayStyles = ({ theme }) => {
|
|
58586
|
+
const wrapStyle = css53({
|
|
58587
|
+
display: "flex",
|
|
58588
|
+
flexWrap: "wrap",
|
|
58589
|
+
gap: theme.size.s
|
|
58590
|
+
});
|
|
58591
|
+
const columnGroupWrapStyle = css53({
|
|
58592
|
+
display: "flex",
|
|
58593
|
+
flexDirection: "column",
|
|
58594
|
+
gap: theme.size.s,
|
|
58595
|
+
alignItems: "flex-start"
|
|
58596
|
+
});
|
|
58597
|
+
const chipStyle = css53({
|
|
58598
|
+
display: "inline-flex",
|
|
58599
|
+
alignItems: "center",
|
|
58600
|
+
borderRadius: theme.size.xl,
|
|
58601
|
+
border: `1px solid ${theme.border.color}`,
|
|
58602
|
+
backgroundColor: theme.colors.body,
|
|
58603
|
+
padding: `${theme.size.s} ${theme.size.m}`,
|
|
58604
|
+
lineHeight: 1.1,
|
|
58605
|
+
gap: theme.size.s
|
|
58606
|
+
});
|
|
58607
|
+
const groupStyle = css53({
|
|
58608
|
+
border: `1px solid ${theme.colors.lightShade}`,
|
|
58609
|
+
borderRadius: theme.border.radius.medium,
|
|
58610
|
+
padding: theme.size.s,
|
|
58611
|
+
margin: theme.size.xs,
|
|
58612
|
+
backgroundColor: theme.colors.body
|
|
58613
|
+
});
|
|
58614
|
+
const operatorStyle = css53({
|
|
58615
|
+
fontFamily: theme.font.familyCode,
|
|
58616
|
+
padding: `${theme.size.xs}px ${theme.size.s}px`,
|
|
58617
|
+
borderRadius: theme.size.s,
|
|
58618
|
+
backgroundColor: theme.colors.primary,
|
|
58619
|
+
color: theme.colors.ghost,
|
|
58620
|
+
fontSize: theme.size.m,
|
|
58621
|
+
fontWeight: theme.font.weight.bold,
|
|
58622
|
+
margin: `${theme.size.xs} 0`
|
|
58623
|
+
});
|
|
58624
|
+
const valueStyle = css53({
|
|
58625
|
+
fontWeight: theme.font.weight.semiBold,
|
|
58626
|
+
color: theme.colors.warning
|
|
58627
|
+
});
|
|
58628
|
+
return {
|
|
58629
|
+
wrapStyle,
|
|
58630
|
+
columnGroupWrapStyle,
|
|
58631
|
+
chipStyle,
|
|
58632
|
+
groupStyle,
|
|
58633
|
+
operatorStyle,
|
|
58634
|
+
valueStyle
|
|
58635
|
+
};
|
|
58636
|
+
};
|
|
58637
|
+
|
|
58638
|
+
// src/components/WfoAgent/FilterDisplay/FilterDisplay.tsx
|
|
58639
|
+
import { jsx as jsx290, jsxs as jsxs156 } from "@emotion/react/jsx-runtime";
|
|
58640
|
+
var DEPTH_INDENT = 16;
|
|
58641
|
+
function FilterDisplay({ parameters }) {
|
|
58642
|
+
const t = useTranslations105("agent.page");
|
|
58643
|
+
const {
|
|
58644
|
+
wrapStyle,
|
|
58645
|
+
columnGroupWrapStyle,
|
|
58646
|
+
chipStyle,
|
|
58647
|
+
groupStyle,
|
|
58648
|
+
operatorStyle,
|
|
58649
|
+
valueStyle
|
|
58650
|
+
} = useWithOrchestratorTheme(getFilterDisplayStyles);
|
|
58651
|
+
const { action, entity_type, filters, query } = parameters ?? {};
|
|
58652
|
+
if (!parameters || Object.keys(parameters).length === 0) return null;
|
|
58653
|
+
const sectionTitle = (text) => /* @__PURE__ */ jsx290(EuiText61, { size: "xs", color: "subdued", children: /* @__PURE__ */ jsx290("strong", { children: text }) });
|
|
58654
|
+
const formatFilterValue = (condition) => {
|
|
58655
|
+
if ("value" in condition && condition.value !== void 0) {
|
|
58656
|
+
if (condition.op === "between" && condition.value && typeof condition.value === "object") {
|
|
58657
|
+
const { start, end, from, to } = condition.value;
|
|
58658
|
+
const fromVal = start || from;
|
|
58659
|
+
const toVal = end || to;
|
|
58660
|
+
return `${fromVal} \u2026 ${toVal}`;
|
|
58661
|
+
}
|
|
58662
|
+
return String(condition.value);
|
|
58663
|
+
}
|
|
58664
|
+
return "\u2014";
|
|
58665
|
+
};
|
|
58666
|
+
const renderFilterGroup = (group, depth = 0) => {
|
|
58667
|
+
if (!group.children || group.children.length === 0) {
|
|
58668
|
+
return /* @__PURE__ */ jsx290(EuiText61, { size: "s", color: "subdued", children: /* @__PURE__ */ jsx290("em", { children: t("emptyGroup") }) });
|
|
58669
|
+
}
|
|
58670
|
+
const areChildrenGroups = group.children.length > 0 && !isCondition(group.children[0]);
|
|
58671
|
+
return /* @__PURE__ */ jsxs156("div", { css: groupStyle, style: { marginLeft: depth * DEPTH_INDENT }, children: [
|
|
58672
|
+
/* @__PURE__ */ jsx290("div", { css: operatorStyle, children: group.op }),
|
|
58673
|
+
/* @__PURE__ */ jsx290("div", { css: areChildrenGroups ? columnGroupWrapStyle : wrapStyle, children: group.children.map((child, i) => /* @__PURE__ */ jsx290("div", { children: isCondition(child) ? /* @__PURE__ */ jsxs156("div", { css: chipStyle, children: [
|
|
58674
|
+
/* @__PURE__ */ jsx290(
|
|
58675
|
+
WfoPathBreadcrumb,
|
|
58676
|
+
{
|
|
58677
|
+
path: child.path,
|
|
58678
|
+
size: "s",
|
|
58679
|
+
showArrows: true
|
|
58680
|
+
}
|
|
58681
|
+
),
|
|
58682
|
+
/* @__PURE__ */ jsx290(
|
|
58683
|
+
WfoBadge,
|
|
58684
|
+
{
|
|
58685
|
+
textColor: "default",
|
|
58686
|
+
color: "hollow",
|
|
58687
|
+
children: getOperatorDisplay(
|
|
58688
|
+
child.condition.op,
|
|
58689
|
+
child.value_kind ? {
|
|
58690
|
+
path: child.path,
|
|
58691
|
+
type: child.value_kind,
|
|
58692
|
+
operators: [],
|
|
58693
|
+
value_schema: {},
|
|
58694
|
+
group: "leaf"
|
|
58695
|
+
} : void 0
|
|
58696
|
+
).symbol
|
|
58697
|
+
}
|
|
58698
|
+
),
|
|
58699
|
+
/* @__PURE__ */ jsx290("span", { css: valueStyle, children: formatFilterValue(child.condition) })
|
|
58700
|
+
] }) : renderFilterGroup(child, depth + 1) }, i)) })
|
|
58701
|
+
] });
|
|
58702
|
+
};
|
|
58703
|
+
return /* @__PURE__ */ jsxs156(EuiPanel21, { hasBorder: true, paddingSize: "m", children: [
|
|
58704
|
+
/* @__PURE__ */ jsxs156(EuiFlexGroup46, { gutterSize: "m", wrap: true, responsive: true, children: [
|
|
58705
|
+
/* @__PURE__ */ jsxs156(EuiFlexItem53, { grow: false, children: [
|
|
58706
|
+
sectionTitle(t("action")),
|
|
58707
|
+
/* @__PURE__ */ jsx290(EuiSpacer33, { size: "xs" }),
|
|
58708
|
+
/* @__PURE__ */ jsx290(WfoBadge, { textColor: "default", color: "hollow", children: action || "N/A" })
|
|
58709
|
+
] }),
|
|
58710
|
+
/* @__PURE__ */ jsxs156(EuiFlexItem53, { grow: false, children: [
|
|
58711
|
+
sectionTitle(t("entityType")),
|
|
58712
|
+
/* @__PURE__ */ jsx290(EuiSpacer33, { size: "xs" }),
|
|
58713
|
+
/* @__PURE__ */ jsx290(WfoBadge, { textColor: "default", color: "hollow", children: entity_type || "N/A" })
|
|
58714
|
+
] }),
|
|
58715
|
+
query ? /* @__PURE__ */ jsxs156(EuiFlexItem53, { grow: false, children: [
|
|
58716
|
+
sectionTitle(t("searchQuery")),
|
|
58717
|
+
/* @__PURE__ */ jsx290(EuiSpacer33, { size: "xs" }),
|
|
58718
|
+
/* @__PURE__ */ jsx290(EuiText61, { size: "s", children: /* @__PURE__ */ jsxs156("em", { children: [
|
|
58719
|
+
'"',
|
|
58720
|
+
query,
|
|
58721
|
+
'"'
|
|
58722
|
+
] }) })
|
|
58723
|
+
] }) : null
|
|
58724
|
+
] }),
|
|
58725
|
+
/* @__PURE__ */ jsx290(EuiSpacer33, { size: "m" }),
|
|
58726
|
+
sectionTitle(t("activeFilters")),
|
|
58727
|
+
/* @__PURE__ */ jsx290(EuiSpacer33, { size: "s" }),
|
|
58728
|
+
filters && filters.children && filters.children.length > 0 ? renderFilterGroup(filters) : /* @__PURE__ */ jsx290(EuiText61, { size: "s", color: "subdued", children: /* @__PURE__ */ jsx290("em", { children: t("noFiltersApplied") }) })
|
|
58729
|
+
] });
|
|
58730
|
+
}
|
|
58731
|
+
|
|
58732
|
+
// src/components/WfoAgent/WfoAgent/WfoAgent.tsx
|
|
58733
|
+
import { jsx as jsx291, jsxs as jsxs157 } from "@emotion/react/jsx-runtime";
|
|
58734
|
+
var initialState3 = {
|
|
58735
|
+
parameters: {
|
|
58736
|
+
action: "select",
|
|
58737
|
+
entity_type: "SUBSCRIPTION",
|
|
58738
|
+
filters: [],
|
|
58739
|
+
query: null
|
|
58740
|
+
},
|
|
58741
|
+
results: []
|
|
58742
|
+
};
|
|
58743
|
+
function WfoAgent() {
|
|
58744
|
+
const t = useTranslations106("agent");
|
|
58745
|
+
const tPage = useTranslations106("agent.page");
|
|
58746
|
+
const { state } = useCoAgent({
|
|
58747
|
+
name: "query_agent",
|
|
58748
|
+
initialState: initialState3
|
|
58749
|
+
});
|
|
58750
|
+
const { parameters, results } = state;
|
|
58751
|
+
const hasStarted = !!(state.parameters && Array.isArray(state.parameters.filters) && state.parameters.filters.length > 0);
|
|
58752
|
+
const isLoadingResults = hasStarted && (!state.results || state.results.length === 0);
|
|
58753
|
+
const displayParameters = parameters && {
|
|
58754
|
+
...parameters,
|
|
58755
|
+
filters: Array.isArray(parameters.filters) ? { op: "AND", children: parameters.filters } : parameters.filters
|
|
58756
|
+
};
|
|
58757
|
+
return /* @__PURE__ */ jsxs157(EuiFlexGroup47, { gutterSize: "l", alignItems: "stretch", children: [
|
|
58758
|
+
/* @__PURE__ */ jsxs157(EuiFlexItem54, { grow: 2, children: [
|
|
58759
|
+
/* @__PURE__ */ jsx291(EuiText62, { children: /* @__PURE__ */ jsx291("h1", { children: t("title") }) }),
|
|
58760
|
+
/* @__PURE__ */ jsx291(EuiSpacer34, { size: "m" }),
|
|
58761
|
+
/* @__PURE__ */ jsx291(EuiText62, { size: "s", children: /* @__PURE__ */ jsx291("h2", { children: tPage("filledParameters") }) }),
|
|
58762
|
+
/* @__PURE__ */ jsx291(EuiSpacer34, { size: "s" }),
|
|
58763
|
+
displayParameters && /* @__PURE__ */ jsx291(FilterDisplay, { parameters: displayParameters }),
|
|
58764
|
+
/* @__PURE__ */ jsx291(EuiSpacer34, { size: "m" }),
|
|
58765
|
+
/* @__PURE__ */ jsx291(EuiText62, { size: "s", children: /* @__PURE__ */ jsxs157("h2", { children: [
|
|
58766
|
+
tPage("results"),
|
|
58767
|
+
" ",
|
|
58768
|
+
results ? `(${results.length})` : ""
|
|
58769
|
+
] }) }),
|
|
58770
|
+
/* @__PURE__ */ jsx291(EuiSpacer34, { size: "s" }),
|
|
58771
|
+
/* @__PURE__ */ jsx291(
|
|
58772
|
+
WfoSearchResults,
|
|
58773
|
+
{
|
|
58774
|
+
results: results ?? [],
|
|
58775
|
+
loading: isLoadingResults,
|
|
58776
|
+
selectedRecordIndex: -1,
|
|
58777
|
+
onRecordSelect: () => {
|
|
58778
|
+
}
|
|
58779
|
+
}
|
|
58780
|
+
)
|
|
58781
|
+
] }),
|
|
58782
|
+
/* @__PURE__ */ jsx291(EuiFlexItem54, { grow: 1, children: /* @__PURE__ */ jsx291(
|
|
58783
|
+
CopilotSidebar,
|
|
58784
|
+
{
|
|
58785
|
+
defaultOpen: true,
|
|
58786
|
+
clickOutsideToClose: false,
|
|
58787
|
+
labels: {
|
|
58788
|
+
title: tPage("copilot.title"),
|
|
58789
|
+
initial: tPage("copilot.initial")
|
|
58790
|
+
}
|
|
58791
|
+
}
|
|
58792
|
+
) })
|
|
58793
|
+
] });
|
|
58794
|
+
}
|
|
58795
|
+
|
|
55964
58796
|
// src/rtk/endpoints/translations.ts
|
|
55965
58797
|
var TRANSLATIONS_URL = "translations";
|
|
55966
58798
|
var translationsApi = orchestratorApi.injectEndpoints({
|
|
@@ -56449,6 +59281,83 @@ var en_GB_default = {
|
|
|
56449
59281
|
softwareVersions: "Software Versions",
|
|
56450
59282
|
logout: "Logout",
|
|
56451
59283
|
aoStatusPage: "A&O application status page"
|
|
59284
|
+
},
|
|
59285
|
+
agent: {
|
|
59286
|
+
title: "Search results",
|
|
59287
|
+
page: {
|
|
59288
|
+
filledParameters: "Filled parameters",
|
|
59289
|
+
results: "Results",
|
|
59290
|
+
emptyGroup: "Empty group",
|
|
59291
|
+
searchQuery: "Search query",
|
|
59292
|
+
activeFilters: "Active filters",
|
|
59293
|
+
noFiltersApplied: "No filters applied",
|
|
59294
|
+
entityType: "Entity type",
|
|
59295
|
+
action: "Action",
|
|
59296
|
+
copilot: {
|
|
59297
|
+
title: "Database assistant",
|
|
59298
|
+
initial: "Ask me things such as:\n\u2022 *Find active subscriptions for Surf*\n\u2022 *Show terminated workflows\u201D*\n\nThe filled template and results will appear on the left."
|
|
59299
|
+
}
|
|
59300
|
+
}
|
|
59301
|
+
},
|
|
59302
|
+
search: {
|
|
59303
|
+
page: {
|
|
59304
|
+
selectFieldFirst: "Select a field first",
|
|
59305
|
+
maxNestingDepth: "Maximum nesting depth reached",
|
|
59306
|
+
addNestedGroup: "Add nested group",
|
|
59307
|
+
addCondition: "Add condition",
|
|
59308
|
+
addGroup: "Add group",
|
|
59309
|
+
removeGroup: "Remove group",
|
|
59310
|
+
emptyGroupDescription: "Add conditions or nested groups to build your filter.",
|
|
59311
|
+
emptyGroupTitle: "Empty group",
|
|
59312
|
+
fieldSearchPlaceholder: "Type to search fields...",
|
|
59313
|
+
removeConditionAriaLabel: "Remove condition",
|
|
59314
|
+
groupLabel: "Group",
|
|
59315
|
+
hideFilters: "Hide filters",
|
|
59316
|
+
showFilters: "Show filters",
|
|
59317
|
+
structuredFilters: "Structured filters",
|
|
59318
|
+
searchError: "Error",
|
|
59319
|
+
selectResultInstruction: "Detail content will be implemented here...",
|
|
59320
|
+
showingDetailsForResult: "Showing details for result #{resultNumber}",
|
|
59321
|
+
details: "Details",
|
|
59322
|
+
dismiss: "Dismiss",
|
|
59323
|
+
searchPlaceholder: "Search for {entityType}\u2026",
|
|
59324
|
+
noResults: "No Results",
|
|
59325
|
+
noResultsMessage: "No {entityType} found matching your search criteria.",
|
|
59326
|
+
noResultsSuggestions: "Try adjusting your search terms, removing filters, or searching for different keywords.",
|
|
59327
|
+
noResultsFound: "No results found for your search.",
|
|
59328
|
+
loadingSearchResults: "Loading search results...",
|
|
59329
|
+
previousPage: "Previous page",
|
|
59330
|
+
page: "Page",
|
|
59331
|
+
nextPage: "Next page",
|
|
59332
|
+
resultsOnPage: "{resultCount} result(s) on this page",
|
|
59333
|
+
searchResultsPagination: "Search results pagination",
|
|
59334
|
+
viewDetails: "View details",
|
|
59335
|
+
closeButton: "Close",
|
|
59336
|
+
selectOrEnterValue: "Select or type value",
|
|
59337
|
+
enterValue: "Enter value",
|
|
59338
|
+
fromNumber: "From",
|
|
59339
|
+
toNumber: "To",
|
|
59340
|
+
fromDate: "From date",
|
|
59341
|
+
toDate: "To date",
|
|
59342
|
+
enterNumber: "Enter number",
|
|
59343
|
+
selectDateAndTime: "Select date",
|
|
59344
|
+
valueControlTo: "to",
|
|
59345
|
+
searchFieldsPlaceholder: "Search fields...",
|
|
59346
|
+
selectSpecificPathPlaceholder: "Select a specific path...",
|
|
59347
|
+
anyPathOption: "Any path",
|
|
59348
|
+
operatorLabel: "Operator",
|
|
59349
|
+
fieldLabel: "Field",
|
|
59350
|
+
valueLabel: "Value",
|
|
59351
|
+
fieldsGroupLabel: "Fields",
|
|
59352
|
+
componentsGroupLabel: "Components",
|
|
59353
|
+
pathsCount: "{count} paths"
|
|
59354
|
+
},
|
|
59355
|
+
tabs: {
|
|
59356
|
+
subscriptions: "Subscriptions",
|
|
59357
|
+
products: "Products",
|
|
59358
|
+
workflows: "Workflows",
|
|
59359
|
+
processes: "Processes"
|
|
59360
|
+
}
|
|
56452
59361
|
}
|
|
56453
59362
|
};
|
|
56454
59363
|
|
|
@@ -56955,6 +59864,7 @@ export {
|
|
|
56955
59864
|
CacheTagType,
|
|
56956
59865
|
ColorModes,
|
|
56957
59866
|
ColumnType,
|
|
59867
|
+
ConditionRow,
|
|
56958
59868
|
ConfirmationDialogContext,
|
|
56959
59869
|
ConfirmationDialogContextWrapper,
|
|
56960
59870
|
ConfirmationDialogProvider,
|
|
@@ -56971,11 +59881,14 @@ export {
|
|
|
56971
59881
|
DEFAULT_PAGE_SIZES,
|
|
56972
59882
|
DateField,
|
|
56973
59883
|
DividerField,
|
|
59884
|
+
ENTITY_TABS,
|
|
56974
59885
|
EngineStatus,
|
|
56975
59886
|
Environment,
|
|
56976
59887
|
ErrorField,
|
|
56977
59888
|
ErrorsField,
|
|
56978
59889
|
FileUploadField,
|
|
59890
|
+
FilterDisplay,
|
|
59891
|
+
FilterGroup,
|
|
56979
59892
|
Footer,
|
|
56980
59893
|
HIDDEN_KEYS,
|
|
56981
59894
|
Header,
|
|
@@ -57083,12 +59996,14 @@ export {
|
|
|
57083
59996
|
UnconnectedSelectField,
|
|
57084
59997
|
UserInputFormWizard,
|
|
57085
59998
|
VALUE_CELL_CLASS_NAME,
|
|
59999
|
+
ValueControl,
|
|
57086
60000
|
VlanField,
|
|
57087
60001
|
WFO_STATUS_COLOR_FIELD,
|
|
57088
60002
|
WfoActionSettings,
|
|
57089
60003
|
WfoActiveWorkflowsSummaryCard,
|
|
57090
60004
|
WfoActualWork,
|
|
57091
60005
|
WfoAdvancedTable,
|
|
60006
|
+
WfoAgent,
|
|
57092
60007
|
WfoArrayField,
|
|
57093
60008
|
WfoArrowDown,
|
|
57094
60009
|
WfoArrowDownSvg,
|
|
@@ -57135,12 +60050,14 @@ export {
|
|
|
57135
60050
|
WfoEyeFill,
|
|
57136
60051
|
WfoFailedTasksBadge,
|
|
57137
60052
|
WfoFailedTasksSummaryCard,
|
|
60053
|
+
WfoFieldSelector,
|
|
57138
60054
|
WfoFilterTabs,
|
|
57139
60055
|
WfoFirstPartUUID,
|
|
57140
60056
|
WfoFlushSettings,
|
|
57141
60057
|
WfoGroupedTable,
|
|
57142
60058
|
WfoHeaderBadge,
|
|
57143
60059
|
WfoHeroIconsWrapper,
|
|
60060
|
+
WfoHighlightedText,
|
|
57144
60061
|
WfoInSyncField,
|
|
57145
60062
|
WfoInformationModal,
|
|
57146
60063
|
WfoInlineEdit,
|
|
@@ -57167,9 +60084,12 @@ export {
|
|
|
57167
60084
|
WfoMyWorkflowsSummaryCard,
|
|
57168
60085
|
WfoNoResults,
|
|
57169
60086
|
WfoObjectField,
|
|
60087
|
+
WfoOperatorSelector,
|
|
57170
60088
|
WfoPageHeader,
|
|
57171
60089
|
WfoPageTemplate,
|
|
57172
60090
|
WfoPageUnauthorized,
|
|
60091
|
+
WfoPathBreadcrumb,
|
|
60092
|
+
WfoPathSelector,
|
|
57173
60093
|
WfoPencil,
|
|
57174
60094
|
WfoPencilAlt,
|
|
57175
60095
|
WfoPlannedWork,
|
|
@@ -57201,11 +60121,21 @@ export {
|
|
|
57201
60121
|
WfoRefresh,
|
|
57202
60122
|
WfoRelatedSubscriptions,
|
|
57203
60123
|
WfoRenderElementOrString,
|
|
60124
|
+
WfoRenderPathOption,
|
|
60125
|
+
WfoRenderPathSelectionOption,
|
|
57204
60126
|
WfoResetTextSearchIndexButton,
|
|
57205
60127
|
WfoResourceTypesPage,
|
|
57206
60128
|
WfoRowContextMenu,
|
|
60129
|
+
WfoSearch,
|
|
60130
|
+
WfoSearchEmptyState,
|
|
57207
60131
|
WfoSearchField,
|
|
60132
|
+
WfoSearchLoadingState,
|
|
60133
|
+
WfoSearchMetadataHeader,
|
|
60134
|
+
WfoSearchPaginationInfo,
|
|
60135
|
+
WfoSearchResultItem,
|
|
60136
|
+
WfoSearchResults,
|
|
57208
60137
|
WfoSearchStrikethrough,
|
|
60138
|
+
WfoSelectedPathDisplay,
|
|
57209
60139
|
WfoSettingsModal,
|
|
57210
60140
|
WfoSettingsPage,
|
|
57211
60141
|
WfoSettingsTab,
|
|
@@ -57232,6 +60162,7 @@ export {
|
|
|
57232
60162
|
WfoSubmitModal,
|
|
57233
60163
|
WfoSubscription,
|
|
57234
60164
|
WfoSubscriptionActions,
|
|
60165
|
+
WfoSubscriptionDetailModal,
|
|
57235
60166
|
WfoSubscriptionDetailNoteEdit,
|
|
57236
60167
|
WfoSubscriptionDetailPage,
|
|
57237
60168
|
WfoSubscriptionDetailSection,
|
|
@@ -57287,10 +60218,12 @@ export {
|
|
|
57287
60218
|
WorkerTypes,
|
|
57288
60219
|
WorkflowTarget,
|
|
57289
60220
|
addToastMessage,
|
|
60221
|
+
buildSearchParams,
|
|
57290
60222
|
calculateTimeDifference,
|
|
57291
60223
|
camelToHuman,
|
|
57292
60224
|
catchErrorResponse,
|
|
57293
60225
|
clearTableConfigFromLocalStorage,
|
|
60226
|
+
createOptionsFromPaths,
|
|
57294
60227
|
createSideNavDivider,
|
|
57295
60228
|
csvDownloadHandler,
|
|
57296
60229
|
defaultOrchestratorTheme,
|
|
@@ -57301,10 +60234,13 @@ export {
|
|
|
57301
60234
|
emptyOrchestratorConfig,
|
|
57302
60235
|
emptyWfoErrorMonitoring,
|
|
57303
60236
|
filterDataByCriteria,
|
|
60237
|
+
findResultIndexById,
|
|
57304
60238
|
flattenArrayProps,
|
|
57305
60239
|
formatDate,
|
|
57306
60240
|
formatDateCetWithUtc,
|
|
57307
60241
|
getAcceptFieldStyles,
|
|
60242
|
+
getButtonColor,
|
|
60243
|
+
getButtonFill,
|
|
57308
60244
|
getCacheTag,
|
|
57309
60245
|
getCommonFormFieldStyles,
|
|
57310
60246
|
getConcatenatedPagedResult,
|
|
@@ -57317,8 +60253,14 @@ export {
|
|
|
57317
60253
|
getDataTestId,
|
|
57318
60254
|
getDate,
|
|
57319
60255
|
getDefaultTableConfig,
|
|
60256
|
+
getDescription,
|
|
60257
|
+
getDetailUrl,
|
|
60258
|
+
getDisplayText,
|
|
60259
|
+
getEndpointPath,
|
|
57320
60260
|
getEnvironmentVariables,
|
|
57321
60261
|
getFieldFromProductBlockInstanceValues,
|
|
60262
|
+
getFieldNameFromFullPath,
|
|
60263
|
+
getFieldNameFromPath,
|
|
57322
60264
|
getFirstUuidPart,
|
|
57323
60265
|
getFormFieldsBaseStyle,
|
|
57324
60266
|
getLastUncompletedProcess,
|
|
@@ -57327,6 +60269,7 @@ export {
|
|
|
57327
60269
|
getNumberOfColumns,
|
|
57328
60270
|
getNumberValueFromEnvironmentVariable,
|
|
57329
60271
|
getObjectKeys,
|
|
60272
|
+
getOperatorDisplay,
|
|
57330
60273
|
getOrchestratorComponentOverrideSlice,
|
|
57331
60274
|
getOrchestratorConfigSlice,
|
|
57332
60275
|
getOrchestratorStore,
|
|
@@ -57334,11 +60277,13 @@ export {
|
|
|
57334
60277
|
getPageIndexChangeHandler,
|
|
57335
60278
|
getPageInfoForSyncExport,
|
|
57336
60279
|
getPageSizeChangeHandler,
|
|
60280
|
+
getPathSelectionOptions,
|
|
57337
60281
|
getProductBlockTitle,
|
|
57338
60282
|
getProductNamesFromProcess,
|
|
57339
60283
|
getQueryStringHandler,
|
|
57340
60284
|
getQueryUrl,
|
|
57341
60285
|
getQueryVariablesForExport,
|
|
60286
|
+
getRecordId,
|
|
57342
60287
|
getRowDetailData,
|
|
57343
60288
|
getSortDirectionFromString,
|
|
57344
60289
|
getStatusBadgeColor,
|
|
@@ -57346,6 +60291,7 @@ export {
|
|
|
57346
60291
|
getTableConfigFromLocalStorage,
|
|
57347
60292
|
getTasksListTabTypeFromString,
|
|
57348
60293
|
getTotalNumberOfRows,
|
|
60294
|
+
getTypeColor,
|
|
57349
60295
|
getTypedFieldFromObject,
|
|
57350
60296
|
getUrlWithQueryParams,
|
|
57351
60297
|
getUsedPrefixMin,
|
|
@@ -57369,12 +60315,19 @@ export {
|
|
|
57369
60315
|
ipPrefixTableFieldStyling,
|
|
57370
60316
|
ipamStates,
|
|
57371
60317
|
isAllUpperCase,
|
|
60318
|
+
isCondition,
|
|
57372
60319
|
isFetchBaseQueryError,
|
|
60320
|
+
isFilterValid,
|
|
60321
|
+
isFullPathSelected,
|
|
57373
60322
|
isNullOrEmpty,
|
|
60323
|
+
isProcessSearchResult,
|
|
60324
|
+
isProductSearchResult,
|
|
57374
60325
|
isRecord,
|
|
60326
|
+
isSubscriptionSearchResult,
|
|
57375
60327
|
isToday,
|
|
57376
60328
|
isUuid4,
|
|
57377
60329
|
isValidLocalStorageTableConfig,
|
|
60330
|
+
isWorkflowSearchResult,
|
|
57378
60331
|
localMomentToUtcTimestamp,
|
|
57379
60332
|
mapGraphQlSubscriptionsResultToPageInfo,
|
|
57380
60333
|
mapGraphQlSubscriptionsResultToSubscriptionListItems,
|
|
@@ -57410,6 +60363,7 @@ export {
|
|
|
57410
60363
|
selectOrchestratorConfig,
|
|
57411
60364
|
setTableConfigToLocalStorage,
|
|
57412
60365
|
settingsTabs,
|
|
60366
|
+
shouldHideValueInput,
|
|
57413
60367
|
snakeToHuman,
|
|
57414
60368
|
snakeToKebab,
|
|
57415
60369
|
sortProcessesByDate,
|
|
@@ -57494,6 +60448,10 @@ export {
|
|
|
57494
60448
|
useResumeProcessMutation,
|
|
57495
60449
|
useRetryAllProcessesMutation,
|
|
57496
60450
|
useRetryProcessMutation,
|
|
60451
|
+
useSearchDefinitionsQuery,
|
|
60452
|
+
useSearchMutation,
|
|
60453
|
+
useSearchPathsQuery,
|
|
60454
|
+
useSearchWithPaginationMutation,
|
|
57497
60455
|
useSetEngineStatusMutation,
|
|
57498
60456
|
useSetSubscriptionInSyncMutation,
|
|
57499
60457
|
useShowToastMessage,
|