Skip to content

Commit

Permalink
Merge branch 'develop' into i-1604-resource-deployment-ux
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroEsquivel authored Nov 23, 2023
2 parents 17e0674 + 3bcebff commit 2a77ae4
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 56 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Changed code at line 218 in covalent/_shared_files/utils.py
- Fixed usage of deprecated pydantic validation methods
- Fixed qelectron_db retrieval in result object
- Fixed editability of Qelectron on settings page - UI changes

### Operations

Expand All @@ -43,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved error handling in generate_docs.py
- [Significant Changes] Migrated core server-side code to new data access layer.
- Changed the way UI was accessing the qelectron database to access it directly from the mdb file in object store
- Update version of browserverify-sign

### Added

Expand Down
104 changes: 63 additions & 41 deletions covalent_ui/webapp/src/components/settings/SettingsCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const SettingsCard = () => {
const [serverDetail, setServerDetail] = useState(null)
const [tempData, setTempData] = useState(null)
const [tempDataServer, setTempDataServer] = useState(null)
const [openMenuKey, setOpenMenuKey] = useState(null)

useEffect(() => {
dispatch(settingsResults())
Expand Down Expand Up @@ -169,7 +170,8 @@ const SettingsCard = () => {
return childIsObject
}

const handleClick = (item) => {
const handleClick = (item, args) => {
openMenuKey === args ? setOpenMenuKey(null) : setOpenMenuKey(args)
_.map(item, function (value, _key) {
if (_.isObject(value)) {
setOpen(!open)
Expand Down Expand Up @@ -314,13 +316,19 @@ const SettingsCard = () => {
setSubMenu(Object.values(settings_result)[0].executors)
}

const handleSubmenuClick = (value, key) => {
const handleSubmenuClick = (value, key, args) => {

setIsDisabled(false)
if (resultKey !== 'executors') {
setResultKey(args)

if (!key) {
setValueChange(false)
setResultKey('executors')
setResultOutput(value)
setRestoreData(value)
// Check if the key is 'qelectron' and scroll into view
if (key) {
document.getElementById(key).scrollIntoView({ behavior: 'smooth' })
}
} else {
document.getElementById(key).scrollIntoView({ behavior: 'smooth' })
}
Expand Down Expand Up @@ -443,7 +451,7 @@ const SettingsCard = () => {
data-testid="openMenu"
onClick={
isChildHasList
? () => handleClick(menuValue)
? () => handleClick(menuValue, menuKey)
: () => {}
}
sx={{
Expand All @@ -452,8 +460,13 @@ const SettingsCard = () => {
}}
>
{isChildHasList(menuValue) && (
<ListItemIcon sx={{ minWidth: '45px', pl: 1 }}>
{open ? (
<ListItemIcon
sx={{ minWidth: '45px', pl: 1 }}
onClick={() =>
menuClick(menuValue, menuKey, accName)
}
>
{menuKey === openMenuKey && menuKey !== 'sdk' ? (
<ExpandMore />
) : (
<KeyboardArrowRightIcon />
Expand Down Expand Up @@ -483,51 +496,60 @@ const SettingsCard = () => {
/>
</ListItemButton>
</ListItem>
{openMenuKey && (
<Collapse
in={menuKey === openMenuKey && menuKey !== 'sdk'}
timeout="auto"
unmountOnExit
>
<List component="div" disablePadding>
{_.map(subMenu, function (value, key) {
return (
<StyledList sx={{ pb: 0, pt: 0 }} key={key}>
<ListItem
disablePadding
sx={{ lineHeight: '18px' }}
>
<ListItemButton
sx={{ pl: 7, pt: 0.3, pb: 0.3 }}
onClick={() =>
handleSubmenuClick(
subMenu,
key,
menuKey
)
}
>
<ListItemText
inset
primary={formatUnderscoreConcatenatedString(
key
)}
disableTypography
sx={{ pl: '0px', fontSize: '14px' }}
/>
</ListItemButton>
</ListItem>
</StyledList>
)
})}
</List>
</Collapse>
)}
</StyledList>
)
})}

{open && (
<Collapse in={open} timeout="auto" unmountOnExit>
<List component="div" disablePadding>
{_.map(subMenu, function (value, key) {
return (
<StyledList sx={{ pb: 0, pt: 0 }} key={key}>
<ListItem
disablePadding
sx={{ lineHeight: '18px' }}
>
<ListItemButton
sx={{ pl: 7, pt: 0.3, pb: 0.3 }}
onClick={() => handleSubmenuClick(subMenu, key)}
>
<ListItemText
inset
primary={formatUnderscoreConcatenatedString(
key
)}
disableTypography
sx={{ pl: '0px', fontSize: '14px' }}
/>
</ListItemButton>
</ListItem>
</StyledList>
)
})}
</List>
</Collapse>
)}
</Box>

<Box>
{_.map(serverDetail, function (menuValue, menuKey) {
{_.map(serverDetail, function (menuValue, menuKey, index) {
return (
<StyledList sx={{ pb: 0, pt: 0 }} key={menuKey}>
<StyledList sx={{ pb: 0, pt: 0 }} key={index}>
<ListItem disablePadding sx={{ lineHeight: '18px' }}>
<ListItemButton
onClick={
isChildHasList
? () => handleClick(menuValue)
? () => handleClick(menuValue, menuKey)
: () => {}
}
sx={{
Expand Down
66 changes: 51 additions & 15 deletions covalent_ui/webapp/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3128,11 +3128,16 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9:
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88"
integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==

bn.js@^5.0.0, bn.js@^5.1.1:
bn.js@^5.0.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002"
integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==

bn.js@^5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70"
integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==

[email protected]:
version "1.19.2"
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.2.tgz#4714ccd9c157d44797b8b5607d72c0b89952f26e"
Expand Down Expand Up @@ -3238,7 +3243,7 @@ browserify-des@^1.0.0:
inherits "^2.0.1"
safe-buffer "^5.1.2"

browserify-rsa@^4.0.0, browserify-rsa@^4.0.1:
browserify-rsa@^4.0.0, browserify-rsa@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.1.0.tgz#b2fd06b5b75ae297f7ce2dc651f918f5be158c8d"
integrity sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==
Expand All @@ -3247,19 +3252,19 @@ browserify-rsa@^4.0.0, browserify-rsa@^4.0.1:
randombytes "^2.0.1"

browserify-sign@^4.0.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.1.tgz#eaf4add46dd54be3bb3b36c0cf15abbeba7956c3"
integrity sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==
version "4.2.2"
resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.2.tgz#e78d4b69816d6e3dd1c747e64e9947f9ad79bc7e"
integrity sha512-1rudGyeYY42Dk6texmv7c4VcQ0EsvVbLwZkA+AQB7SxvXxmcD93jcHie8bzecJ+ChDlmAm2Qyu0+Ccg5uhZXCg==
dependencies:
bn.js "^5.1.1"
browserify-rsa "^4.0.1"
bn.js "^5.2.1"
browserify-rsa "^4.1.0"
create-hash "^1.2.0"
create-hmac "^1.1.7"
elliptic "^6.5.3"
elliptic "^6.5.4"
inherits "^2.0.4"
parse-asn1 "^5.1.5"
readable-stream "^3.6.0"
safe-buffer "^5.2.0"
parse-asn1 "^5.1.6"
readable-stream "^3.6.2"
safe-buffer "^5.2.1"

browserify-zlib@^0.2.0:
version "0.2.0"
Expand Down Expand Up @@ -3644,6 +3649,11 @@ cliui@^6.0.0:
strip-ansi "^6.0.0"
wrap-ansi "^6.2.0"

clsx@^1.0.4:
version "1.2.1"
resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12"
integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==

clsx@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.1.1.tgz#98b3134f9abbdf23b2663491ace13c5c03a73188"
Expand Down Expand Up @@ -4590,7 +4600,7 @@ dom-converter@^0.2.0:
dependencies:
utila "~0.4"

dom-helpers@^5.0.1:
dom-helpers@^5.0.1, dom-helpers@^5.1.3:
version "5.2.1"
resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.2.1.tgz#d9400536b2bf8225ad98fe052e029451ac40e902"
integrity sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==
Expand Down Expand Up @@ -4721,7 +4731,7 @@ elkjs@^0.7.1:
resolved "https://registry.yarnpkg.com/elkjs/-/elkjs-0.7.1.tgz#4751c5e918a4988139baf7f214e010aea22de969"
integrity sha512-lD86RWdh480/UuRoHhRcnv2IMkIcK6yMDEuT8TPBIbO3db4HfnVF+1lgYdQi99Ck0yb+lg5Eb46JCHI5uOsmAw==

elliptic@^6.5.3:
elliptic@^6.5.3, elliptic@^6.5.4:
version "6.5.4"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb"
integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==
Expand Down Expand Up @@ -8502,7 +8512,7 @@ parent-module@^1.0.0:
dependencies:
callsites "^3.0.0"

parse-asn1@^5.0.0, parse-asn1@^5.1.5:
parse-asn1@^5.0.0, parse-asn1@^5.1.6:
version "5.1.6"
resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4"
integrity sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==
Expand Down Expand Up @@ -9774,6 +9784,11 @@ react-is@^17.0.1, react-is@^17.0.2:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

react-lifecycles-compat@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==

react-redux@^7.2.6:
version "7.2.8"
resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.8.tgz#a894068315e65de5b1b68899f9c6ee0923dd28de"
Expand Down Expand Up @@ -9901,6 +9916,18 @@ react-transition-group@^4.4.2:
loose-envify "^1.4.0"
prop-types "^15.6.2"

react-virtualized@^9.22.5:
version "9.22.5"
resolved "https://registry.yarnpkg.com/react-virtualized/-/react-virtualized-9.22.5.tgz#bfb96fed519de378b50d8c0064b92994b3b91620"
integrity sha512-YqQMRzlVANBv1L/7r63OHa2b0ZsAaDp1UhVNEdUaXI8A5u6hTpA5NYtUueLH2rFuY/27mTGIBl7ZhqFKzw18YQ==
dependencies:
"@babel/runtime" "^7.7.2"
clsx "^1.0.4"
dom-helpers "^5.1.3"
loose-envify "^1.4.0"
prop-types "^15.7.2"
react-lifecycles-compat "^3.0.4"

react@^17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
Expand Down Expand Up @@ -9950,6 +9977,15 @@ readable-stream@^3.0.6, readable-stream@^3.6.0:
string_decoder "^1.1.1"
util-deprecate "^1.0.1"

readable-stream@^3.6.2:
version "3.6.2"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967"
integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
dependencies:
inherits "^2.0.3"
string_decoder "^1.1.1"
util-deprecate "^1.0.1"

readdirp@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525"
Expand Down Expand Up @@ -10354,7 +10390,7 @@ [email protected], safe-buffer@~5.1.0, safe-buffer@~5.1.1:
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==

[email protected], safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0:
[email protected], safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
Expand Down

0 comments on commit 2a77ae4

Please sign in to comment.