Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 29 additions & 28 deletions ngui/ui/src/components/CleanExpensesTable/CleanExpensesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const CleanExpensesTable = ({
},
cell: ({ row: { original } }) => {
const metadataTags = MetadataNodes(original).getTags();
return <CollapsableTableCell maxRows={5} tags={metadataTags} sorted={false} limit={33} />;
return <CollapsableTableCell maxRows={2} tags={metadataTags} sorted={false} limit={33} />;
}
},
resourcePoolOwner({
Expand Down Expand Up @@ -284,33 +284,34 @@ const CleanExpensesTable = ({
}
];

if (typeof downloadResources === "function") {
actionBarItems.push({
key: "download",
startIcon: <CloudDownloadOutlinedIcon />,
messageId: "download",
type: "dropdown",
action: downloadResources,
isLoading: isDownloadingResources,
menu: {
items: [
{
key: "xlsx",
messageId: "xlsxFile",
action: () => downloadResources(DOWNLOAD_FILE_FORMATS.XLSX),
dataTestId: "btn_download_xlsx"
},
{
key: "json",
messageId: "jsonFile",
action: () => downloadResources(DOWNLOAD_FILE_FORMATS.JSON),
dataTestId: "btn_download_json"
}
]
},
dataTestId: "btn_download"
});
}
// KU_TODO: Disabled download
// if (typeof downloadResources === "function") {
// actionBarItems.push({
// key: "download",
// startIcon: <CloudDownloadOutlinedIcon />,
// messageId: "download",
// type: "dropdown",
// action: downloadResources,
// isLoading: isDownloadingResources,
// menu: {
// items: [
// {
// key: "xlsx",
// messageId: "xlsxFile",
// action: () => downloadResources(DOWNLOAD_FILE_FORMATS.XLSX),
// dataTestId: "btn_download_xlsx"
// },
// {
// key: "json",
// messageId: "jsonFile",
// action: () => downloadResources(DOWNLOAD_FILE_FORMATS.JSON),
// dataTestId: "btn_download_json"
// }
// ]
// },
// dataTestId: " btn_download"
// });
// }

if (assignmentRuleCreationLinkParameters) {
actionBarItems.push({
Expand Down
50 changes: 25 additions & 25 deletions ngui/ui/src/components/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import Link from "@mui/material/Link";
import { FormattedMessage } from "react-intl";
import { GET_DATA_SOURCES } from "api/restapi/actionTypes";
import {FormattedMessage} from "react-intl";
import {GET_DATA_SOURCES} from "api/restapi/actionTypes";
import AlertDialog from "components/AlertDialog";
import DashboardGridLayout from "components/DashboardGridLayout";
import MailTo from "components/MailTo";
import Mocked, { MESSAGE_TYPES } from "components/Mocked";
import Mocked, {MESSAGE_TYPES} from "components/Mocked";
import PageContentWrapper from "components/PageContentWrapper";
import { PRODUCT_TOUR, useProductTour, useStartTour } from "components/Tour";
import {PRODUCT_TOUR, useProductTour, useStartTour} from "components/Tour";
import OrganizationConstraintsCardContainer from "containers/OrganizationConstraintsCardContainer";
import OrganizationExpensesContainer from "containers/OrganizationExpensesContainer";
import PoolsRequiringAttentionCardContainer from "containers/PoolsRequiringAttentionCardContainer";
import RecentModelsCardContainer from "containers/RecentModelsCardContainer";
import RecentTasksCardContainer from "containers/RecentTasksCardContainer";
import RecommendationsCardContainer from "containers/RecommendationsCardContainer";
import TopResourcesExpensesCardContainer from "containers/TopResourcesExpensesCardContainer";
import { useApiData } from "hooks/useApiData";
import { useIsUpMediaQuery } from "hooks/useMediaQueries";
import { EMAIL_SUPPORT, DOCS_HYSTAX_OPTSCALE, SHOW_POLICY_QUERY_PARAM } from "urls";
import { ENVIRONMENT } from "utils/constants";
import { getQueryParams, removeQueryParam } from "utils/network";
import {useApiData} from "hooks/useApiData";
import {useIsUpMediaQuery} from "hooks/useMediaQueries";
import {EMAIL_SUPPORT, DOCS_HYSTAX_OPTSCALE, SHOW_POLICY_QUERY_PARAM} from "urls";
import {ENVIRONMENT} from "utils/constants";
import {getQueryParams, removeQueryParam} from "utils/network";
import DashboardMocked from "./DashboardMocked";

const Dashboard = () => {
Expand All @@ -27,14 +27,14 @@ const Dashboard = () => {
const startTour = useStartTour();

const {
apiData: { cloudAccounts = [] }
apiData: {cloudAccounts = []}
} = useApiData(GET_DATA_SOURCES);

const thereAreOnlyEnvironmentDataSources = cloudAccounts.every(({ type }) => type === ENVIRONMENT);
const thereAreOnlyEnvironmentDataSources = cloudAccounts.every(({type}) => type === ENVIRONMENT);

const { isFinished } = useProductTour(PRODUCT_TOUR);
const {isFinished} = useProductTour(PRODUCT_TOUR);

const { showPolicy } = getQueryParams();
const {showPolicy} = getQueryParams();
const firstTimeOpen = !!showPolicy;

const closeAlert = (queryParams) => {
Expand All @@ -46,18 +46,18 @@ const Dashboard = () => {
};

const dashboardGridItems = {
topResourcesExpensesCard: thereAreOnlyEnvironmentDataSources ? null : <TopResourcesExpensesCardContainer />,
policiesCard: <OrganizationConstraintsCardContainer />,
organizationExpenses: thereAreOnlyEnvironmentDataSources ? null : <OrganizationExpensesContainer />,
recommendationsCard: <RecommendationsCardContainer />,
// poolsRequiringAttentionCard: <PoolsRequiringAttentionCardContainer />,
recentTasksCard: <RecentTasksCardContainer />,
recentModelsCard: <RecentModelsCardContainer />
topResourcesExpensesCard: thereAreOnlyEnvironmentDataSources ? null : <TopResourcesExpensesCardContainer/>,
policiesCard: <OrganizationConstraintsCardContainer/>,
organizationExpenses: thereAreOnlyEnvironmentDataSources ? null : <OrganizationExpensesContainer/>,
recommendationsCard: <RecommendationsCardContainer/>,
poolsRequiringAttentionCard: <PoolsRequiringAttentionCardContainer/>,
recentTasksCard: <RecentTasksCardContainer/>,
recentModelsCard: <RecentModelsCardContainer/>
};

return (
<>
<Mocked mock={<DashboardMocked />} backdropMessageType={MESSAGE_TYPES.DASHBOARD}>
<Mocked mock={<DashboardMocked/>} backdropMessageType={MESSAGE_TYPES.DASHBOARD}>
<PageContentWrapper>
<DashboardGridLayout {...dashboardGridItems} />
</PageContentWrapper>
Expand All @@ -69,22 +69,22 @@ const Dashboard = () => {
paper: "window_privacy_policy",
button: "btn_proceed"
}}
header={<FormattedMessage id="optScalePrivacyPolicy" />}
header={<FormattedMessage id="optScalePrivacyPolicy"/>}
message={
<FormattedMessage
id="privacyWarning"
values={{
email: <MailTo email={EMAIL_SUPPORT} text={EMAIL_SUPPORT} />,
email: <MailTo email={EMAIL_SUPPORT} text={EMAIL_SUPPORT}/>,
docs: (chunks) => (
<Link target="_blank" href={DOCS_HYSTAX_OPTSCALE} data-test-id="link_documentation">
{chunks}
</Link>
),
p: (chunks) => <p>{chunks}</p>,
ul: (chunks) => <ul style={{ marginTop: 0 }}>{chunks}</ul>,
ul: (chunks) => <ul style={{marginTop: 0}}>{chunks}</ul>,
li: (chunks) => <li>{chunks}</li>,
strong: (chunks) => <strong>{chunks}</strong>,
br: <br />
br: <br/>
}}
/>
}
Expand Down
19 changes: 10 additions & 9 deletions ngui/ui/src/components/HeaderButtons/HeaderButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,16 @@ const HeaderButtons = () => {
value: <FormattedMessage id="productTour" />
}}
/>
<IconButton
icon={isCommunityDocsOpened ? <SchoolIcon /> : <SchoolOutlinedIcon />}
onClick={setIsCommunityDocsOpened}
color="info"
tooltip={{
show: true,
value: <FormattedMessage id="communityDocs" />
}}
/>
{ /* TODO_KU: disabled because it doesn't not exist in documentation */ }
{/*<IconButton*/}
{/* icon={isCommunityDocsOpened ? <SchoolIcon /> : <SchoolOutlinedIcon />}*/}
{/* onClick={setIsCommunityDocsOpened}*/}
{/* color="info"*/}
{/* tooltip={{*/}
{/* show: true,*/}
{/* value: <FormattedMessage id="communityDocs" />*/}
{/* }}*/}
{/*/>*/}
<Popover
label={
<IconButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const useStyles = makeStyles()((theme) => {
flexWrap: "wrap",
margin: `-${gap} -${halfGap} 0 -${halfGap}`,
"& > *": {
margin: `${gap} ${halfGap} 0 ${halfGap}`
margin: `${halfGap}`
},
minHeight: "40px"
},
Expand Down
14 changes: 9 additions & 5 deletions ngui/ui/src/components/LinearSelector/LinearSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { useState } from "react";
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
import ArrowDropUpIcon from "@mui/icons-material/ArrowDropUp";

// KU_TODO: Changed icons
// import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
// import ArrowDropUpIcon from "@mui/icons-material/ArrowDropUp";
import KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';
import KeyboardArrowUpOutlined from '@mui/icons-material/KeyboardArrowUpOutlined';
import DeleteOutlinedIcon from "@mui/icons-material/DeleteOutlined";
import Box from "@mui/material/Box";
import Checkbox from "@mui/material/Checkbox";
Expand Down Expand Up @@ -147,7 +151,7 @@ const MultiPopoverItem = ({ name, items, label, handleApply, values }) => {
const PopoverLabelExpandIcon = ({ isOpen }) => {
const { classes } = useStyles();

const Icon = isOpen ? ArrowDropUpIcon : ArrowDropDownIcon;
const Icon = isOpen ? KeyboardArrowUpOutlined : KeyboardArrowDownOutlinedIcon;

return <Icon className={classes.labelIcon} />;
};
Expand Down Expand Up @@ -324,13 +328,13 @@ const LinearSelector = ({ value, label, items, onClear, onClearAll, onChange, on
return (
<Box className={classes.wrapper}>
{label && (
<Typography component="div" data-test-id={labelDataTestId}>
<Typography variant={'fontWeightBold'} component="div" data-test-id={labelDataTestId}>
{label}
{": "}
</Typography>
)}
{valuesArray.length === 0 ? (
<Typography component="span">
<Typography variant={'fontWeightBold'} component="span">
<FormattedMessage id={NONE} />
</Typography>
) : (
Expand Down
Loading
Loading