Skip to content

Commit

Permalink
making prettier happy
Browse files Browse the repository at this point in the history
Co-authored-by: Saikrishna321 <[email protected]>
  • Loading branch information
SrinivasanTarget and saikrishna321 committed Jan 6, 2025
1 parent f8d5a9c commit 2343535
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
8 changes: 4 additions & 4 deletions app/common/renderer/actions/Session.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,17 @@ export function newSession(caps, attachSessId = null) {

// Get capabilities and interpolate environment variables
let desiredCapabilities = caps ? getCapsObject(caps) : {};

// Modify this section to handle W3C capabilities format
if (desiredCapabilities.alwaysMatch) {
desiredCapabilities.alwaysMatch = interpolateEnvironmentVariables(
desiredCapabilities.alwaysMatch,
environmentVariables
environmentVariables,
);
} else {
desiredCapabilities = interpolateEnvironmentVariables(
desiredCapabilities,
environmentVariables
environmentVariables,
);
}

Expand Down Expand Up @@ -1225,7 +1225,7 @@ export function setEnvironmentVariables(envVars) {

export function loadEnvironmentVariables() {
return async (dispatch) => {
const envVars = await getSetting(ENVIRONMENT_VARIABLES) || [];
const envVars = (await getSetting(ENVIRONMENT_VARIABLES)) || [];
dispatch({type: SET_ENVIRONMENT_VARIABLES, envVars});
};
}
Expand Down
15 changes: 10 additions & 5 deletions app/common/renderer/components/Session/EnvironmentVariables.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {DeleteOutlined, PlusOutlined, SettingOutlined} from '@ant-design/icons';

Check failure on line 1 in app/common/renderer/components/Session/EnvironmentVariables.jsx

View workflow job for this annotation

GitHub Actions / Lint & Format

Run autofix to sort these imports!
import {Button, Card, Input, Popconfirm, Space, Table, Tooltip} from 'antd';
import {useState} from 'react';
import SessionStyles from '../Session/Session.module.css';
import styles from './Session.module.css';
import SessionStyles from './Session.module.css';

const EnvironmentVariables = ({t, envVars, addVariable, deleteVariable}) => {
const [newVar, setNewVar] = useState({key: '', value: ''});
Expand Down Expand Up @@ -63,8 +62,8 @@ const EnvironmentVariables = ({t, envVars, addVariable, deleteVariable}) => {
}
className={SessionStyles['interaction-tab-card']}
>
<div className={styles.container}>
<div className={styles.addForm}>
<div className={SessionStyles.container}>
<div className={SessionStyles.addForm}>
<Space.Compact style={{width: '100%'}}>
<Input
placeholder={t('Variable Name')}
Expand All @@ -86,7 +85,13 @@ const EnvironmentVariables = ({t, envVars, addVariable, deleteVariable}) => {
</Button>
</Space.Compact>
</div>
<Table columns={columns} dataSource={tableData} pagination={false} rowKey="key" size="small" />
<Table
columns={columns}
dataSource={tableData}
pagination={false}
rowKey="key"
size="small"
/>
</div>
</Card>
);
Expand Down
6 changes: 3 additions & 3 deletions app/common/renderer/components/Session/Session.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {LinkOutlined, SettingOutlined} from '@ant-design/icons';
import {Badge, Button, Card, Spin, Tabs} from 'antd';
import {LinkOutlined} from '@ant-design/icons';
import {Badge, Button, Spin, Tabs} from 'antd';
import _ from 'lodash';
import {useEffect} from 'react';
import {useNavigate} from 'react-router';
Expand All @@ -13,12 +13,12 @@ import {
} from '../../constants/session-builder';
import {ipcRenderer, openLink} from '../../polyfills';
import {log} from '../../utils/logger';
import EnvironmentVariables from './EnvironmentVariables.jsx';
import AdvancedServerParams from './AdvancedServerParams.jsx';
import AttachToSession from './AttachToSession.jsx';
import CapabilityEditor from './CapabilityEditor.jsx';
import CloudProviders from './CloudProviders.jsx';
import CloudProviderSelector from './CloudProviderSelector.jsx';
import EnvironmentVariables from './EnvironmentVariables.jsx';
import SavedSessions from './SavedSessions.jsx';
import ServerTabCustom from './ServerTabCustom.jsx';
import SessionStyles from './Session.module.css';
Expand Down
8 changes: 3 additions & 5 deletions app/common/renderer/reducers/Inspector.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import _ from 'lodash';

Check failure on line 1 in app/common/renderer/reducers/Inspector.js

View workflow job for this annotation

GitHub Actions / Lint & Format

Run autofix to sort these imports!

import {
ADD_ASSIGNED_VAR_CACHE,
CANCEL_PENDING_COMMAND,
Expand Down Expand Up @@ -86,9 +85,9 @@ import {
UNSELECT_TICK_ELEMENT,
} from '../actions/Inspector';
import {
SET_ENVIRONMENT_VARIABLES,
ADD_ENVIRONMENT_VARIABLE,
DELETE_ENVIRONMENT_VARIABLE,
SET_ENVIRONMENT_VARIABLES,
} from '../actions/Session';
import {SCREENSHOT_INTERACTION_MODE} from '../constants/screenshot';
import {APP_MODE, INSPECTOR_TABS, NATIVE_APP} from '../constants/session-inspector';
Expand Down Expand Up @@ -141,7 +140,6 @@ let nextState;

export default function inspector(state = INITIAL_STATE, action) {
switch (action.type) {

case SET_SOURCE_AND_SCREENSHOT:
return {
...state,
Expand Down Expand Up @@ -677,15 +675,15 @@ export default function inspector(state = INITIAL_STATE, action) {
...state,
environmentVariables: [
...(state.environmentVariables || []),
{key: action.key, value: action.value}
{key: action.key, value: action.value},
],
};

case DELETE_ENVIRONMENT_VARIABLE:
return {
...state,
environmentVariables: (state.environmentVariables || []).filter(
(envVar) => envVar.key !== action.key
(envVar) => envVar.key !== action.key,
),
};

Expand Down
7 changes: 4 additions & 3 deletions app/common/renderer/reducers/Session.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import {
ABORT_DESIRED_CAPS_EDITOR,
ABORT_DESIRED_CAPS_NAME_EDITOR,
ADD_CAPABILITY,
ADD_ENVIRONMENT_VARIABLE,
CHANGE_SERVER_TYPE,
DELETE_ENVIRONMENT_VARIABLE,
DELETE_SAVED_SESSION_DONE,
DELETE_SAVED_SESSION_REQUESTED,
ENABLE_DESIRED_CAPS_EDITOR,
Expand All @@ -30,6 +32,7 @@ import {
SET_CAPABILITY_PARAM,
SET_CAPS_AND_SERVER,
SET_DESIRED_CAPS_NAME,
SET_ENVIRONMENT_VARIABLES,
SET_PROVIDERS,
SET_RAW_DESIRED_CAPS,
SET_SAVE_AS_TEXT,
Expand All @@ -39,10 +42,8 @@ import {
SET_STATE_FROM_URL,
SHOW_DESIRED_CAPS_JSON_ERROR,
SWITCHED_TABS,
SET_ENVIRONMENT_VARIABLES,
ADD_ENVIRONMENT_VARIABLE,
DELETE_ENVIRONMENT_VARIABLE
} from '../actions/Session';

import {SERVER_TYPES, SESSION_BUILDER_TABS} from '../constants/session-builder';

const visibleProviders = []; // Pull this from the VISIBLE_PROVIDERS setting
Expand Down

0 comments on commit 2343535

Please sign in to comment.