-
Notifications
You must be signed in to change notification settings - Fork 18
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
Test suite page #68
Open
parthasarathygopu
wants to merge
28
commits into
orcaci:main
Choose a base branch
from
parthasarathygopu:testSuite
base: main
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
Test suite page #68
Changes from 9 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
a3d1b4b
bug fix
203a5b2
Merge branch 'main' of https://github.com/orcaci/orca
956e4cb
new dropdown and added service list
f560882
new dropdown and added service list
85f8743
new dropdown and added service list
4d9d1bd
new dropdown and added service list
5a25d01
added changes
3cdeb3a
added changes
ed2a2c4
added delete actions
d368154
bug api fix
6aede08
Fixed the insert and test_suite and update
itsparser f8ef4a7
Added redirect code
itsparser d3bfa6f
code cleanup
13fdfc9
Added relocation for the application
itsparser af33b54
Added Response with the complete data of the get ref
itsparser 9521b3e
code clean
3e58e9d
code clean
6082edc
added dry run changes
faf6402
Added the dry run for the Suite
itsparser ce69a76
merged with vasanth
4d18bcf
test suite issue
36723e1
test case fixed issue
2b81cb7
resolved react flow
30ce189
Added the new endpoint for the log and other information
itsparser 51dec3f
Merge branch 'testSuite' of github.com:parthasarathygopu/orca into v4
itsparser 30b4581
Fixed the headless for the application
itsparser f244f4b
Commented the If condition seed data
itsparser 89f679d
Added changes
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
.dropdown { | ||
position: relative; | ||
color: #333; | ||
cursor: default; | ||
} | ||
|
||
.dropdown .arrow { | ||
border-color: #999 transparent transparent; | ||
border-style: solid; | ||
border-width: 5px 5px 0; | ||
content: " "; | ||
display: block; | ||
height: 0; | ||
margin-top: 0.3rem; | ||
position: absolute; | ||
right: 10px; | ||
top: 14px; | ||
width: 0; | ||
} | ||
|
||
.dropdown .arrow.open { | ||
border-color: transparent transparent #999; | ||
border-width: 0 5px 5px; | ||
} | ||
|
||
.input { | ||
line-height: 1.5; | ||
font-size: 1rem; | ||
background-color: #fff; | ||
border: 1px solid #ccc; | ||
border-radius: 2px; | ||
box-sizing: border-box; | ||
cursor: default; | ||
outline: none; | ||
padding: 8px 52px 8px 10px; | ||
transition: all 200ms ease; | ||
width: 100%; | ||
} | ||
|
||
.dropdown .options { | ||
display: none; | ||
background-color: #fff; | ||
border: 1px solid #ccc; | ||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); | ||
box-sizing: border-box; | ||
margin-top: -1px; | ||
max-height: 200px; | ||
overflow-y: auto; | ||
position: absolute; | ||
top: 100%; | ||
width: 100%; | ||
z-index: 1000; | ||
-webkit-overflow-scrolling: touch; | ||
} | ||
|
||
.dropdown .options.open { | ||
display: block; | ||
} | ||
|
||
.dropdown .option { | ||
box-sizing: border-box; | ||
color: rgba(51, 51, 51, 0.8); | ||
cursor: pointer; | ||
display: block; | ||
padding: 8px 10px; | ||
} | ||
|
||
.dropdown .option.selected, | ||
.dropdown .option:hover { | ||
background-color: #f2f9fc; | ||
color: #333; | ||
} | ||
|
||
.close { | ||
position: absolute; | ||
right: 40px; | ||
top: 14px; | ||
width: 16px; | ||
height: 16px; | ||
opacity: 0.3; | ||
} | ||
.close:hover { | ||
opacity: 1; | ||
} | ||
.close:before, .close:after { | ||
position: absolute; | ||
left: 15px; | ||
content: ' '; | ||
height: 16px; | ||
width: 2px; | ||
background-color: #333; | ||
} | ||
.close:before { | ||
transform: rotate(45deg); | ||
} | ||
.close:after { | ||
transform: rotate(-45deg); | ||
} | ||
|
||
|
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,97 @@ | ||
import { useEffect, useRef, useState } from "react"; | ||
import PropTypes from "prop-types"; | ||
import "./dropdown.css"; | ||
|
||
|
||
|
||
export const SearchableDropdown = ({ | ||
options, | ||
label, | ||
id, | ||
selectedValue, | ||
handleChange | ||
}) => { | ||
const [query, setQuery] = useState(""); | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const inputRef = useRef(null); | ||
|
||
useEffect(() => { | ||
document.addEventListener("click", toggle); | ||
return () => document.removeEventListener("click", toggle); | ||
}, []); | ||
|
||
const selectOption = (option) => { | ||
setQuery(() => ""); | ||
handleChange(option); | ||
setIsOpen((isOpen) => !isOpen); | ||
}; | ||
|
||
function toggle(e) { | ||
setIsOpen(e && e.target === inputRef.current); | ||
} | ||
|
||
const getDisplayValue = () => { | ||
if (query) return query; | ||
if (selectedValue) return selectedValue[label] || ""; | ||
|
||
return ""; | ||
}; | ||
|
||
const filter = (options) => { | ||
return options.filter( | ||
(option) => option[label].toLowerCase().indexOf(query.toLowerCase()) > -1 | ||
); | ||
}; | ||
|
||
return ( | ||
<div className="dropdown"> | ||
<div className="control"> | ||
<div className="selected-value"> | ||
<input | ||
ref={inputRef} | ||
className="input" | ||
type="text" | ||
value={getDisplayValue()} | ||
name="searchTerm" | ||
onChange={(e) => { | ||
setQuery(e.target.value); | ||
handleChange(null); | ||
}} | ||
onClick={toggle} | ||
/> | ||
</div> | ||
{selectedValue[label] && <div className="close" onClick={() => handleChange({})}/>} | ||
<div className={`arrow ${isOpen ? "open" : ""}`}></div> | ||
</div> | ||
|
||
<div className={`options ${isOpen ? "open" : ""}`}> | ||
{filter(options).map((option, index) => { | ||
return ( | ||
<div | ||
role="option" | ||
onClick={() => selectOption(option)} | ||
className={`option ${ | ||
option === selectedValue ? "selected" : "" | ||
}`} | ||
key={`${id}-${index}`} | ||
> | ||
{option[label]} | ||
</div> | ||
); | ||
})} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
SearchableDropdown.propTypes = { | ||
options: PropTypes.arrayOf(PropTypes.object), | ||
label: PropTypes.string, | ||
id: PropTypes.string, | ||
selectedValue: PropTypes.object, | ||
handleChange: PropTypes.func | ||
}; | ||
|
||
|
||
|
||
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
Oops, something went wrong.
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.
Consider improving the click outside logic for closing the dropdown to be more robust and not solely rely on a specific ref comparison. Additionally, enhance accessibility by adding appropriate ARIA roles and supporting keyboard navigation to ensure the component is usable by everyone.