-
-
Notifications
You must be signed in to change notification settings - Fork 768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add StoredVars tab #220
Open
Jongkeun
wants to merge
122
commits into
SeleniumHQ:trunk
Choose a base branch
from
Jongkeun:StoredVars
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add StoredVars tab #220
Changes from all commits
Commits
Show all changes
122 commits
Select commit
Hold shift + click to select a range
7397715
add StoredVarList and enable console to change.
Jongkeun 52f8bcb
add StoredVarList
Jongkeun 5fcca39
add StoredVar row proto type
Jongkeun 07329b0
make storedVar table
Jongkeun 360e63e
change the edit button to ActionButton
Jongkeun 20d66a5
add Edit Button
Jongkeun 22bf8cb
add propTypes
Jongkeun 7d5018c
add array key at consoleBox
Jongkeun ddbe71e
seperated the children column under the values
Jongkeun 91dccdf
Merge branch 'master' into StoredVars
Jongkeun cfa2a65
make 'setStoredVar' enable
Jongkeun 1bf9642
modify edit process
Jongkeun 0a37fb7
Merge branch 'StoredVars' of https://github.com/Jongkeun/selenium-ide…
Jongkeun bcd0fac
remove index parameter and set default consle.tab
Jongkeun b8c9152
change the button name from 'Edit' to 'Delete'
Jongkeun c49ddb1
add delete icon
Jongkeun 592edd7
apply delete button
Jongkeun 5361e90
make deleteBtn show only when hover the row
Jongkeun 97091de
add padding at the console bottom
Jongkeun a2ac3bb
delete classnames at row
Jongkeun f8bd438
add refesh Button
Jongkeun 01ae49f
apply Refresh Button
Jongkeun 99793d2
remove observer
Jongkeun 2f1ffb8
add delete storedVar function
Jongkeun 5b02588
add storedVar add function and UI
Jongkeun a039510
fixed multiline at ContentEditable component
Jongkeun 80560e6
reorganize css of StoredValList
Jongkeun f22421f
modify indent
Jongkeun e7fbea7
modify css of StoredVar
Jongkeun 22ceeb6
refresh when clicking the tab
Jongkeun 215df3e
fixed css
Jongkeun 4d8a91e
remove index parameter at tabChanged
Jongkeun 5084b98
Merge branch 'master' into StoredVars
Jongkeun 34ab9b5
remerge confilct
Jongkeun c83c71c
remove the buttonBox
Jongkeun 9f5ecfe
change the tab name to Variables
Jongkeun e2f7f86
add the tab parameter at tabClick func
Jongkeun 32fe96d
changed the state name from add to addingVariable
Jongkeun 8cc2ab8
change the values to state
Jongkeun f1d4f7c
add semicolon and rename the css
Jongkeun b6e30ba
create new Varaibles store as Observable
Jongkeun b5857a8
yarn lint and remove the unnecessary code
Jongkeun 053507d
add tooltip at clear button
Jongkeun 382f301
Merge branch 'master' into StoredVars
Jongkeun 6b8c95b
the part declared variables is moved to formatCommand
Jongkeun afd3f3a
remove unncessary refresh variable and file
Jongkeun 2fbec41
add test case Variables.spec.js
Jongkeun 2d3c2ff
remove refresh icon form the font and the ttf
Jongkeun 6c77ea7
add a variable beforehand.
Jongkeun 04d7c5e
fix spell
Jongkeun b5c03de
change clearVariable to afterEach
Jongkeun be6b8af
rename StoredVarList to VariableList
Jongkeun 5c824ba
rename StoredVar to Variable
Jongkeun 90ca479
remove index column at Variables
Jongkeun 4c051e5
remove zebra the table
Jongkeun f1d44e5
Move the plus next to the clear button
Jongkeun 8fc4eb0
Allow changing the variable name
Jongkeun 124cf5b
add validation before the delete
Jongkeun 14668c4
add sort of variables
Jongkeun dc383bb
Align everything to the left
Jongkeun 8c8a1e2
modify mas-width
Jongkeun 73af006
move test case directory
Jongkeun b8bf1be
fixed the path in the test case
Jongkeun fcb0695
fixed indent
Jongkeun f078116
remove border-radius
Jongkeun e4b61c3
temp commit to keep working at home
Jongkeun c1a3541
Merge branch 'master' into StoredVars
Jongkeun 595ea29
move the addingVariable to component
Jongkeun 63f2056
add isRunning computed
Jongkeun 0479728
Don't let users edit anything unless they are on a breakpoint
Jongkeun ec2a3db
commit yarn.lock file
Jongkeun ff0bc3d
add the isAddingVariable state
Jongkeun fb8fac2
make Add Variable work properly
Jongkeun 08703dc
set focus on the input when clicking add button
Jongkeun 64ab9cc
if there is no input text, make the add variables component disappea…
Jongkeun cd0dd7d
remove padding and change font-size of deleteBtn
Jongkeun 2c974a2
change the header css
Jongkeun 6c157ad
prevent delete, add, clear while playing the script
Jongkeun cd30364
add validation when called onBlur
Jongkeun 34c200a
add the edit function
Jongkeun 3400bac
make the focus lost when typing a enter key
Jongkeun 95eb981
remove title of variableList
Jongkeun 0944601
Merge branch 'master' into StoredVars
Jongkeun 90282de
add Variables at the tab on Console
Jongkeun d8f027c
modify css
Jongkeun e0b8b8a
remove column
Jongkeun 364d03e
modify css of the Variables
Jongkeun fd9aa81
removed spell checking whenever fouse out
Jongkeun c338056
modify css of the Variables for the css name
Jongkeun ca3d734
removed div hell and changed to ul and li
Jongkeun 31bd3ec
removed unnecessary css
Jongkeun e7463a2
add header on Variables
Jongkeun 3e1487a
make a hover on header inoperatived
Jongkeun 45c1f76
make header shown if there is stored variables
Jongkeun ee9d96b
validation check for restoreSize
Jongkeun bae774a
add variables tab on Console test case
Jongkeun 91a3e05
remove ContentEditable
Jongkeun 57c263a
add margin
Jongkeun a2aa1d7
set row color when hover
Jongkeun d4057ed
fixed the situation which it couldn't modify the value
Jongkeun e7afab8
make the background color to white when running the script
Jongkeun 11a27c4
fixed the case which a clear log is not working
Jongkeun ac14f23
resolved a font conflict
Jongkeun 9542ed2
replace the font.css to master's
Jongkeun 3922396
Merge branch 'master' into StoredVars
Jongkeun 219a869
keep the input background white when editing
Jongkeun 27cb4d7
Keep an invisible border around the inputs at all time
Jongkeun f79aa49
change the padding
Jongkeun 156e804
Add margin around the last input
Jongkeun 6178d3c
fixed for eslint
Jongkeun 5003d93
add getEntries computed function
Jongkeun cd88f7e
remove isStop at variables.
Jongkeun c3b7459
set the header to show up always.
Jongkeun 58a139c
change state of VariableList to be similar to TestRow
Jongkeun 8012491
change input to Input component.
Jongkeun 43146ef
change the name isValidKey to validKey, and using only state on input…
Jongkeun 5c90bb2
remove deleteBtn on pristin row
Jongkeun 35fd7a3
Modify a case that is not deleted correctly when modifying a variable…
Jongkeun 90e6cf4
change the key of Variable components
Jongkeun c1dce17
remove handlekeydown event and replaced to onSubmit event
Jongkeun 9014d69
prevent deleting while running a script.
Jongkeun 0fb9ed9
add propTypes and end line
Jongkeun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/selenium-ide/src/neo/components/ActionButtons/Delete/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Licensed to the Software Freedom Conservancy (SFC) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The SFC licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
import React from "react"; | ||
import ActionButton from "../ActionButton"; | ||
import classNames from "classnames"; | ||
|
||
export default class DeleteButton extends React.Component { | ||
render() { | ||
return ( | ||
<ActionButton data-tip="<p>Delete</p>" {...this.props} className={classNames("si-delete", this.props.className)} />// eslint-disable-line react/prop-types | ||
); | ||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
packages/selenium-ide/src/neo/components/Variable/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// Licensed to the Software Freedom Conservancy (SFC) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The SFC licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import classNames from "classnames"; | ||
import { observer } from "mobx-react"; | ||
import DeleteButton from "../ActionButtons/Delete"; | ||
import Input from "../FormInput"; | ||
import "./style.css"; | ||
|
||
@observer | ||
export default class Variable extends React.Component { | ||
constructor(props){ | ||
super(props); | ||
this.handleChanged = this.handleChanged.bind(this); | ||
this.keyChanged = this.keyChanged.bind(this); | ||
this.valueChanged = this.valueChanged.bind(this); | ||
this.delete = this.delete.bind(this); | ||
this.edit = this.edit.bind(this); | ||
this.state = { key: this.props.keyVar || "", value: this.props.value || undefined }; | ||
} | ||
|
||
handleChanged() { | ||
this.edit(); | ||
} | ||
delete() { | ||
this.props.delete(this.props.keyVar); | ||
} | ||
edit(){ | ||
const validKey = this.state.key; | ||
if (validKey && this.state.value != undefined) { | ||
this.delete(); | ||
this.props.add(validKey, this.state.value); | ||
} | ||
} | ||
keyChanged(key) { | ||
this.setState({ key: key }); | ||
} | ||
valueChanged(value) { | ||
this.setState({ value: value }); | ||
} | ||
render() { | ||
return ( | ||
<li className="variable"> | ||
<Input | ||
name={classNames("name", { "editable": !this.props.readOnly }, { "isAdding": this.props.isPristine })} | ||
label="" | ||
width={0} | ||
disabled={this.props.readOnly ? true : false} | ||
onChange={this.keyChanged} | ||
value={this.state.key} | ||
onBlur={this.handleChanged} /> | ||
<Input | ||
name={classNames("value", { "editable": !this.props.readOnly }, { "isAdding": this.props.isPristine })} | ||
label="" | ||
width={0} | ||
disabled={this.props.readOnly ? true : false} | ||
onChange={this.valueChanged} | ||
value={this.state.value || ""} | ||
onBlur={this.handleChanged} /> | ||
{ this.props.isPristine ? null : <DeleteButton className="deleteBtn" data-place="left" onClick={this.delete} disabled={this.props.readOnly}/> } | ||
</li> | ||
); | ||
} | ||
static propTypes = { | ||
keyVar: PropTypes.string, | ||
value: PropTypes.string, | ||
delete: PropTypes.func, | ||
add: PropTypes.func, | ||
isPristine: PropTypes.bool, | ||
readOnly: PropTypes.bool | ||
}; | ||
} |
39 changes: 39 additions & 0 deletions
39
packages/selenium-ide/src/neo/components/Variable/style.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
.variable { | ||
font-size: 12px; | ||
word-break: break-all; | ||
display: flex; | ||
} | ||
|
||
.variable .form-input { | ||
float: left; | ||
width: 48%; | ||
text-align: left; | ||
border: 1px transparent solid; | ||
} | ||
|
||
.variable:not(.value-header):hover { | ||
background-color: #f3f3f3; | ||
} | ||
|
||
.variable .deleteBtn { | ||
width: 4%; | ||
opacity: 0; | ||
height: 100%; | ||
} | ||
|
||
.variable:hover .deleteBtn { | ||
opacity: 1; | ||
} | ||
|
||
.variable .form-input input, | ||
.variable .form-input input:disabled { | ||
background-color: transparent; | ||
border: 1px transparent solid; | ||
margin: 0; | ||
} | ||
|
||
.variable .form-input input:focus { | ||
border: 1px #4ea1ff solid; | ||
outline: 0; | ||
background-color: white; | ||
} |
81 changes: 81 additions & 0 deletions
81
packages/selenium-ide/src/neo/components/VariableList/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// Licensed to the Software Freedom Conservancy (SFC) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The SFC licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import Variable from "../Variable"; | ||
import { observer } from "mobx-react"; | ||
import "./style.css"; | ||
|
||
@observer | ||
export default class VariableList extends React.Component { | ||
constructor(props){ | ||
super(props); | ||
this.deleteVariable = this.deleteVariable.bind(this); | ||
this.addVariable = this.addVariable.bind(this); | ||
this._OnSubmit = this._OnSubmit.bind(this); | ||
} | ||
deleteVariable(key){ | ||
this.props.variables.deleteVariable(key); | ||
} | ||
addVariable(key, value){ | ||
this.props.variables.addVariable(key, value); | ||
} | ||
_OnSubmit(e) { | ||
e.preventDefault(); | ||
// This set focus at deleteBtn for calling onBlur event that is to save value. | ||
e.target[e.target.length - 1].focus(); | ||
} | ||
render() { | ||
const variables = this.props.variables; | ||
const pristineID = Math.random(); | ||
return ( | ||
<form onSubmit={this._OnSubmit}> | ||
<ul className="value-list"> | ||
<li className="value-header variable"> | ||
<strong className="name">Name</strong> | ||
<strong className="value">Value</strong> | ||
<div className="deleteBtn"/> | ||
</li> | ||
{variables.getEntries.map((storedMap) => ( | ||
<Variable | ||
key={storedMap} | ||
keyVar={storedMap[0]} | ||
value={storedMap[1]} | ||
add={this.addVariable} | ||
delete={this.deleteVariable} | ||
readOnly={this.props.readOnly} | ||
isPristine={false} | ||
/> | ||
)).concat( | ||
<Variable | ||
key={pristineID} | ||
add={this.addVariable} | ||
delete={this.deleteVariable} | ||
isPristine={true} | ||
readOnly={this.props.readOnly} | ||
/>)} | ||
<input tabIndex="-1" type="submit"/> | ||
</ul> | ||
</form> | ||
); | ||
} | ||
static propTypes = { | ||
variables: PropTypes.object, | ||
readOnly: PropTypes.bool | ||
}; | ||
} |
28 changes: 28 additions & 0 deletions
28
packages/selenium-ide/src/neo/components/VariableList/style.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.value-list { | ||
text-align: left; | ||
overflow-y: auto; | ||
overflow-x: hidden; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.variable .name, | ||
.variable .value { | ||
float: left; | ||
padding: 4px 5px; | ||
width: 48%; | ||
text-align: left; | ||
border: 1px transparent solid; | ||
} | ||
|
||
.value-list li:last-child { | ||
margin-bottom: 3px; | ||
} | ||
|
||
.value-list input[type="submit"] { | ||
position: absolute; | ||
width: 0; | ||
height: 0; | ||
padding: 0; | ||
border: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good, let's test this.
Add a spec file here
packages/selenium-ide/src/neo/__test__/stores/domain/view/Variables.spec.js
.Have a look here for ideas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did.
Let me know if it has correction points.