Skip to content

Commit

Permalink
merged development
Browse files Browse the repository at this point in the history
  • Loading branch information
mariana-furyk committed Oct 30, 2023
2 parents 8ab8302 + f2e6453 commit 128f20a
Show file tree
Hide file tree
Showing 64 changed files with 1,133 additions and 1,002 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"final-form-arrays": "^3.0.2",
"fs-extra": "^10.0.0",
"identity-obj-proxy": "^3.0.0",
"iguazio.dashboard-react-controls": "1.5.1",
"iguazio.dashboard-react-controls": "1.7.0",
"is-wsl": "^1.1.0",
"js-base64": "^2.5.2",
"js-yaml": "^3.13.1",
Expand Down
4 changes: 4 additions & 0 deletions src/actions/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
FETCH_MODEL_FEATURE_VECTOR_SUCCESS,
REMOVE_INFO_CONTENT,
REMOVE_JOB_PODS,
REMOVE_MODEL_ENDPOINT,
REMOVE_MODEL_FEATURE_VECTOR,
RESET_CHANGES,
SET_CHANGES,
Expand Down Expand Up @@ -124,6 +125,9 @@ const detailsActions = {
removeInfoContent: () => ({
type: REMOVE_INFO_CONTENT
}),
removeModelEndpoint: () => ({
type: REMOVE_MODEL_ENDPOINT
}),
removeModelFeatureVector: () => ({
type: REMOVE_MODEL_FEATURE_VECTOR
}),
Expand Down
18 changes: 3 additions & 15 deletions src/common/Accordion/Accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,9 @@ const Accordion = ({
!alwaysOpened && setOpen(state => !state)
}

const accordionClassNames = classnames(
'accordion__container',
open && 'open',
accordionClassName
)
const accordionClassNames = classnames('accordion__container', open && 'open', accordionClassName)

const iconClassNames = classnames(
'accordion__icon',
iconClassName,
open && 'open'
)
const iconClassNames = classnames('accordion__icon', iconClassName, open && 'open')

return (
<div
Expand All @@ -83,11 +75,7 @@ const Accordion = ({
ref={accordionRef}
>
{icon && (
<RoundedIcon
data-testid="accordion-btn"
onClick={handleOpenAccordion}
className={iconClassNames}
>
<RoundedIcon id="accordion-btn" onClick={handleOpenAccordion} className={iconClassNames}>
{icon}
</RoundedIcon>
)}
Expand Down
8 changes: 7 additions & 1 deletion src/common/ActionsMenu/ActionsMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ const ActionsMenu = ({ dataItem, menu, time, withQuickActions }) => {
{actionMenu[1].map(mainAction => (
<RoundedIcon
disabled={mainAction.disabled}
id={`quick-link-${mainAction.id}`}
onClick={() => mainAction.onClick(dataItem)}
tooltipText={mainAction.label}
key={mainAction.label}
Expand All @@ -135,7 +136,12 @@ const ActionsMenu = ({ dataItem, menu, time, withQuickActions }) => {
))}
</div>
)}
<RoundedIcon isActive={isShowMenu} onClick={showActionsList} ref={actionMenuBtnRef}>
<RoundedIcon
isActive={isShowMenu}
id="actions-menu"
onClick={showActionsList}
ref={actionMenuBtnRef}
>
<ActionMenuIcon />
</RoundedIcon>
{renderMenu &&
Expand Down
5 changes: 2 additions & 3 deletions src/common/ActionsMenu/actionsMenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

&_extended {
position: absolute;
right: 0;
right: 5px;
display: none;
align-items: center;
justify-content: center;
Expand All @@ -22,14 +22,13 @@
position: absolute;
display: block;
left: -30px;
background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(245,247,255,1) 100%);
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(245, 247, 255, 1) 100%);
}
}

&-active {
display: flex;
}

}

&__main-actions-wrapper {
Expand Down
2 changes: 1 addition & 1 deletion src/common/Breadcrumbs/Breadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ const Breadcrumbs = ({ onClick, projectStore, fetchProjectsNames }) => {
<li key={i} className="breadcrumbs__item">
<RoundedIcon
className={separatorClassNames}
data-testid="separator"
id="separator"
ref={separatorRef}
onClick={() => handleSeparatorClick(urlItems.pathItems[i + 1], separatorRef)}
>
Expand Down
6 changes: 6 additions & 0 deletions src/common/KeyValueTable/KeyValueTableView.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,15 @@ const KeyValueTableView = ({
(selectedItem.newKey !== selectedItem.key &&
isKeyNotUnique(selectedItem.newKey, content)))
}
id="key-value-table-apply"
onClick={handleEditItem}
tooltipText="Apply"
>
<Checkmark />
</RoundedIcon>
<RoundedIcon
className="key-value-table__btn"
id="key-value-table-close"
onClick={handleResetForm}
tooltipText="Discard changes"
>
Expand Down Expand Up @@ -218,6 +220,7 @@ const KeyValueTableView = ({
<div className="table-cell table-cell__actions">
<RoundedIcon
className="key-value-table__btn"
id="key-value-table-edit"
onClick={event => {
event.preventDefault()
}}
Expand All @@ -228,6 +231,7 @@ const KeyValueTableView = ({

<RoundedIcon
className="key-value-table__btn"
id="key-value-table-delete"
onClick={event => {
event.stopPropagation()
deleteItem(index, contentItem)
Expand Down Expand Up @@ -297,6 +301,7 @@ const KeyValueTableView = ({
<RoundedIcon
className="btn-add"
disabled={isKeyNotUnique(keyValue, content)}
id="key-value-table-apply"
onClick={saveItem}
tooltipText="Apply"
>
Expand All @@ -305,6 +310,7 @@ const KeyValueTableView = ({

<RoundedIcon
className="btn-add"
id="key-value-table-discard"
onClick={handleResetForm}
tooltipText="Discard changes"
>
Expand Down
4 changes: 2 additions & 2 deletions src/common/ProjectDetailsHeader/ProjectDetailsHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ const ProjectDetailsHeader = ({ projectData, projectName }) => {
<li>
{location.pathname.includes(PROJECT_MONITOR) ? (
<Link to={`/projects/${projectName}/${PROJECT_QUICK_ACTIONS_PAGE}`} className="link">
Project Quick Actions
Project quick actions
</Link>
) : (
<Link to={`/projects/${projectName}/${PROJECT_MONITOR}`} className="link">
Project Monitoring
Project monitoring
</Link>
)}
</li>
Expand Down
95 changes: 19 additions & 76 deletions src/components/ArtifactInfoSources/ArtifactInfoSources.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,90 +17,34 @@ illegal under applicable law, and the grant of the foregoing license
under the Apache 2.0 license is conditioned upon your compliance with
such restriction.
*/
import React, { useState, useEffect, useMemo } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'

import { Tooltip, TextTooltipTemplate } from 'igz-controls/components'

import { artifactInfoSourcesHeaders } from './artifactInfoSources.utils'

import './artifactInfoSources.scss'

import { ReactComponent as Arrow } from 'igz-controls/images/arrow.svg'

const ArtifactInfoSources = ({ header, sources }) => {
const [isExpanded, setIsExpanded] = useState(false)

const sourcesLength = useMemo(() => {
return Object.values(sources).length
}, [sources])

const sourcesClassNames = classnames(
'info-sources',
isExpanded && 'info-sources_expanded'
)
const sourcesRowClassNames = classnames(
'info-sources-row',
sourcesLength === 0 && 'info-sources-row_empty'
)

useEffect(() => {
if (sourcesLength === 0) {
setIsExpanded(false)
}
}, [sourcesLength, isExpanded])
const ArtifactInfoSources = ({ sources }) => {
return (
<div className={sourcesClassNames}>
<div
className={sourcesRowClassNames}
onClick={() => {
if (sourcesLength !== 0) setIsExpanded(prevState => !prevState)
}}
>
{sourcesLength !== 0 && (
<Arrow className={isExpanded ? 'expanded' : 'collapsed'} />
)}

<div className="info-sources-row__header">{header}</div>
<div className="info-sources-row__data">
{`${Object.values(sources).length} ${
Object.values(sources).length <= 1 ? 'item' : 'items'
}`}
</div>
</div>

{isExpanded && (
<div className="info-sources-table">
<div className="info-sources-table__header">
{artifactInfoSourcesHeaders.map(({ label, id, className }) => {
const tableItemClassNames = classnames(
'info-sources-table__header-item',
className
)

return (
<div key={id} className={tableItemClassNames}>
{label}
</div>
)
})}
<div className="info-sources" data-testid="sources">
<h3 className="item-info__header">Sources</h3>
{Object.entries(sources).map(([key, value], index) => (
<div className="info-sources__table" key={key + value}>
<h5 className="info-sources__table-header">Source {index + 1}</h5>
<div className="info-sources__table-row">
<div className="info-sources__table-key">Name</div>
<div className="info-sources__table-value">
<Tooltip template={<TextTooltipTemplate text={key} />}>{key}</Tooltip>
</div>
</div>
{Object.entries(sources).map(([key, value], index) => (
<div
key={`${key}-${index}`}
className="info-sources-table__content"
>
<div className="info-sources-table__content-key">
<Tooltip template={<TextTooltipTemplate text={key} />}>
{key}
</Tooltip>
</div>
<div className="info-sources-table__content-value">{value}</div>
<div className="info-sources__table-row">
<div className="info-sources__table-key">Path</div>
<div className="info-sources__table-value">
<Tooltip template={<TextTooltipTemplate text={value} />}>{value}</Tooltip>
</div>
))}
</div>
</div>
)}
))}
</div>
)
}
Expand All @@ -110,8 +54,7 @@ ArtifactInfoSources.defaultProps = {
}

ArtifactInfoSources.propTypes = {
header: PropTypes.string.isRequired,
sources: PropTypes.shape({})
sources: PropTypes.shape({}).isRequired
}

export default ArtifactInfoSources
Loading

0 comments on commit 128f20a

Please sign in to comment.