diff --git a/app/common/public/locales/en/translation.json b/app/common/public/locales/en/translation.json index cec2c13229..36be5dfbca 100644 --- a/app/common/public/locales/en/translation.json +++ b/app/common/public/locales/en/translation.json @@ -283,5 +283,6 @@ "invalidCapType": "Invalid capability type: {{type}}", "whitespaceDetected": "Text Starts and/or Ends With Whitespace", "pcloudyCredentialsRequired": "pCloudy username and api key are required!", - "duplicateCapabilityNameError": "A capability set with the same name already exists" + "duplicateCapabilityNameError": "A capability set with the same name already exists", + "searchInPageSource": "Search in page source" } diff --git a/app/common/renderer/actions/Inspector.js b/app/common/renderer/actions/Inspector.js index 05b6a4095e..244262fb34 100644 --- a/app/common/renderer/actions/Inspector.js +++ b/app/common/renderer/actions/Inspector.js @@ -31,6 +31,7 @@ export const SET_EXPANDED_PATHS = 'SET_EXPANDED_PATHS'; export const SET_OPTIMAL_LOCATORS = 'SET_OPTIMAL_LOCATORS'; export const SELECT_HOVERED_ELEMENT = 'SELECT_HOVERED_ELEMENT'; export const UNSELECT_HOVERED_ELEMENT = 'UNSELECT_HOVERED_ELEMENT'; +export const SET_PAGE_SOURCE_SEARCH_TEXT = 'SET_PAGE_SOURCE_SEARCH_TEXT'; export const SELECT_HOVERED_CENTROID = 'SELECT_HOVERED_CENTROID'; export const UNSELECT_HOVERED_CENTROID = 'UNSELECT_HOVERED_CENTROID'; @@ -292,6 +293,12 @@ export function addAssignedVarCache(varName) { }; } +export function setPageSourceSearchText(text) { + return (dispatch) => { + dispatch({type: SET_PAGE_SOURCE_SEARCH_TEXT, text}); + }; +} + export function setExpandedPaths(paths) { return (dispatch) => { dispatch({type: SET_EXPANDED_PATHS, paths}); diff --git a/app/common/renderer/components/Inspector/Inspector.jsx b/app/common/renderer/components/Inspector/Inspector.jsx index ee4cd7696b..7a3058ebe0 100644 --- a/app/common/renderer/components/Inspector/Inspector.jsx +++ b/app/common/renderer/components/Inspector/Inspector.jsx @@ -11,8 +11,9 @@ import { SelectOutlined, TagOutlined, ThunderboltOutlined, + SearchOutlined, } from '@ant-design/icons'; -import {Button, Card, Modal, Space, Spin, Switch, Tabs, Tooltip} from 'antd'; +import {Button, Card, Modal, Row, Space, Spin, Switch, Tabs, Tooltip, Input} from 'antd'; import {debounce} from 'lodash'; import React, {useEffect, useRef, useState} from 'react'; import {useNavigate} from 'react-router-dom'; @@ -87,6 +88,7 @@ const Inspector = (props) => { toggleShowAttributes, isSourceRefreshOn, windowSize, + setPageSourceSearchText, t, } = props; @@ -322,7 +324,16 @@ const Inspector = (props) => { } extra={ - + +
+ setPageSourceSearchText(e.target.value)} + prefix={} + /> +