diff --git a/app/common/assets/locales/en/translation.json b/app/common/assets/locales/en/translation.json index 6bd28f3f73..bf6363a1ea 100644 --- a/app/common/assets/locales/en/translation.json +++ b/app/common/assets/locales/en/translation.json @@ -160,7 +160,6 @@ "boolean": "boolean", "number": "number", "JSON object": "JSON object", - "filepath": "filepath", "connectToExistingSessionInstructions": "If you have an already-running session of the above server type, you can attach an inspector to it directly.", "selectSessionIDInDropdown": "Select the Session ID in the dropdown below.", "allowUnauthorizedCerts": "Allow Unauthorized Certificates", diff --git a/app/common/components/Session/CapabilityControl.jsx b/app/common/components/Session/CapabilityControl.jsx index bdfc660d6d..06c151c850 100644 --- a/app/common/components/Session/CapabilityControl.jsx +++ b/app/common/components/Session/CapabilityControl.jsx @@ -1,24 +1,9 @@ -import {FileOutlined} from '@ant-design/icons'; import {Input, Switch} from 'antd'; -import _ from 'lodash'; import React from 'react'; import {INPUT} from '../../constants/antd-types'; -import {remote} from '../../shared/polyfills'; -import {log} from '../../utils/logger'; import SessionStyles from './Session.module.css'; -const getLocalFilePath = async () => { - try { - const {canceled, filePaths} = await remote.dialog.showOpenDialog({properties: ['openFile']}); - if (!canceled && !_.isEmpty(filePaths)) { - return filePaths[0]; - } - } catch (e) { - log.error(e); - } -}; - const CapabilityControl = ({ cap, onSetCapabilityParam, @@ -29,6 +14,7 @@ const CapabilityControl = ({ }) => { switch (cap.type) { case 'text': + case 'file': return ( ); - case 'file': - return ( -
- onSetCapabilityParam(e.target.value)} - onPressEnter={onPressEnter} - className={SessionStyles.capsBoxFont} - addonAfter={ - onSetCapabilityParam((await getLocalFilePath()) || cap.value)} - /> - } - /> -
- ); default: throw new Error(t('invalidCapType', {type: cap.type})); } diff --git a/app/common/components/Session/CapabilityEditor.jsx b/app/common/components/Session/CapabilityEditor.jsx index ab1bc6f3b3..d8c1d6252b 100644 --- a/app/common/components/Session/CapabilityEditor.jsx +++ b/app/common/components/Session/CapabilityEditor.jsx @@ -42,9 +42,6 @@ const handleSetType = (setCapabilityParam, caps, index, type) => { case 'object': translatedValue = translatedValue + ''; break; - case 'file': - translatedValue = ''; - break; default: break; } @@ -120,7 +117,6 @@ const CapabilityEditor = (props) => { {t('boolean')} {t('number')} {t('JSON object')} - {t('filepath')} diff --git a/app/common/components/Session/Session.module.css b/app/common/components/Session/Session.module.css index 2aac272253..32b1d1302a 100644 --- a/app/common/components/Session/Session.module.css +++ b/app/common/components/Session/Session.module.css @@ -184,10 +184,6 @@ margin-left: 1em; } -.filepath-button { - cursor: pointer; -} - .capsFormCol { min-width: 420px; height: 100%; @@ -214,7 +210,6 @@ width: 142px; } -.fileControlWrapper :global(.ant-input-group), .capsValueControl textarea { max-width: 142px; } diff --git a/app/common/shared/polyfills.js b/app/common/shared/polyfills.js index b24f29bda2..eaa882e224 100644 --- a/app/common/shared/polyfills.js +++ b/app/common/shared/polyfills.js @@ -1,12 +1,4 @@ -let settings, - clipboard, - shell, - remote, - ipcRenderer, - i18NextBackend, - i18NextBackendOptions, - fs, - util; +let settings, clipboard, shell, ipcRenderer, i18NextBackend, i18NextBackendOptions, fs, util; function buildForBrowser() { if (process.env.BUILD_BROWSER) { @@ -25,7 +17,6 @@ if (buildForBrowser()) { settings, clipboard, shell, - remote, ipcRenderer, i18NextBackend, i18NextBackendOptions, @@ -37,7 +28,6 @@ if (buildForBrowser()) { settings, clipboard, shell, - remote, ipcRenderer, i18NextBackend, i18NextBackendOptions, @@ -46,14 +36,4 @@ if (buildForBrowser()) { } = require('../../electron/renderer/polyfills')); } -export { - clipboard, - shell, - remote, - ipcRenderer, - settings, - i18NextBackend, - i18NextBackendOptions, - fs, - util, -}; +export {settings, clipboard, shell, ipcRenderer, i18NextBackend, i18NextBackendOptions, fs, util}; diff --git a/app/electron/renderer/polyfills.js b/app/electron/renderer/polyfills.js index adb72a72c3..d113086ddc 100644 --- a/app/electron/renderer/polyfills.js +++ b/app/electron/renderer/polyfills.js @@ -1,4 +1,4 @@ -import {clipboard, ipcRenderer, remote, shell} from 'electron'; +import {clipboard, ipcRenderer, shell} from 'electron'; import settings from 'electron-settings'; import fs from 'fs'; import i18NextBackend from 'i18next-fs-backend'; @@ -11,14 +11,4 @@ const i18NextBackendOptions = { jsonIndent: 2, }; -export { - clipboard, - shell, - remote, - ipcRenderer, - settings, - i18NextBackend, - i18NextBackendOptions, - fs, - util, -}; +export {settings, clipboard, shell, ipcRenderer, i18NextBackend, i18NextBackendOptions, fs, util}; diff --git a/app/web/polyfills.js b/app/web/polyfills.js index bfee9fb131..31322dfffa 100644 --- a/app/web/polyfills.js +++ b/app/web/polyfills.js @@ -9,11 +9,6 @@ const browser = { shell: { openExternal: (url) => window.open(url, ''), }, - remote: { - getCurrentWindow: () => ({ - getSize: () => [window.innerWidth, window.innerHeight], - }), - }, ipcRenderer: { on: (evt) => { console.warn(`Cannot listen for IPC event ${evt} in browser context`); // eslint-disable-line no-console @@ -42,7 +37,7 @@ class BrowserSettings { } const settings = new BrowserSettings(); -const {clipboard, shell, remote, ipcRenderer} = browser; +const {clipboard, shell, ipcRenderer} = browser; const i18NextBackendOptions = { backends: [LocalStorageBackend, HttpApi], backendOptions: [ @@ -53,4 +48,4 @@ const i18NextBackendOptions = { ], }; -export {settings, clipboard, shell, remote, ipcRenderer, i18NextBackend, i18NextBackendOptions}; +export {settings, clipboard, shell, ipcRenderer, i18NextBackend, i18NextBackendOptions}; diff --git a/docs/session-builder/assets/images/capability-builder/capability-fields.png b/docs/session-builder/assets/images/capability-builder/capability-fields.png index cba40ec8c7..a1a4ae8bdf 100644 Binary files a/docs/session-builder/assets/images/capability-builder/capability-fields.png and b/docs/session-builder/assets/images/capability-builder/capability-fields.png differ diff --git a/docs/session-builder/capability-builder.md b/docs/session-builder/capability-builder.md index bef07a4cde..9d927f2f07 100644 --- a/docs/session-builder/capability-builder.md +++ b/docs/session-builder/capability-builder.md @@ -20,13 +20,12 @@ fields for specifying each capability in parts: its name, value type, and the va Changing the name or value of any capability will automatically adjust the contents of [the JSON structure](#capability-json-structure) on the right side of the Session Builder. -There are 5 options for the value type: +There are 4 options for the value type: - text - boolean - number - JSON object -- filepath Selecting a different option may change the value input field.