Skip to content

Commit

Permalink
Pull request update/240911
Browse files Browse the repository at this point in the history
34e7a20 OS-7826. Remove wrapping cards for certain UI elements in the interface
f4e4dc7 OS-7810. Add micromatch override to fix a vulnerability
ffb3d9e OS-7833: Request updated leaderboards after a leaderboard is deleted
8997ff9 OS-7833. Always re-request leaderboard data when opening the Leaderboards tab
a7d3cea OS-7830. Make Metrics Library a standalone page
  • Loading branch information
stanfra authored Sep 11, 2024
2 parents 42c6623 + 34e7a20 commit 078568d
Show file tree
Hide file tree
Showing 80 changed files with 535 additions and 530 deletions.
3 changes: 2 additions & 1 deletion ngui/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
},
"pnpm": {
"overrides": {
"braces@<3.0.3": ">=3.0.3"
"braces@<3.0.3": ">=3.0.3",
"micromatch@<4.0.8": ">=4.0.8"
}
}
}
21 changes: 7 additions & 14 deletions ngui/server/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
20 changes: 10 additions & 10 deletions ngui/ui/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ import {
createMlDataset,
updateMlDataset,
deleteMlDataset,
getMlGlobalMetrics,
createGlobalMetric,
getMlGlobalMetric,
updateGlobalMetric,
deleteGlobalMetric,
getMlMetrics,
createMlMetric,
getMlMetric,
updateMlMetric,
deleteMlMetric,
createMlTask,
getProfilingToken,
getMlExecutors,
Expand Down Expand Up @@ -381,17 +381,17 @@ export {
getMlTasks,
getMlLeaderboardTemplate,
createMlLeaderboardTemplate,
getMlGlobalMetrics,
getMlMetrics,
getMlLeaderboardCandidates,
getMlDataset,
getMlDatasets,
createMlDataset,
updateMlDataset,
deleteMlDataset,
createGlobalMetric,
getMlGlobalMetric,
updateGlobalMetric,
deleteGlobalMetric,
createMlMetric,
getMlMetric,
updateMlMetric,
deleteMlMetric,
createMlTask,
getProfilingToken,
getMlExecutors,
Expand Down
24 changes: 12 additions & 12 deletions ngui/ui/src/api/restapi/actionCreators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ import {
SET_ML_DATASET,
UPDATE_ML_DATASET,
DELETE_ML_DATASET,
GET_ML_GLOBAL_METRICS,
SET_ML_GLOBAL_METRICS,
GET_ML_METRICS,
SET_ML_METRICS,
GET_ML_GLOBAL_METRIC,
SET_ML_GLOBAL_METRIC,
CREATE_GLOBAL_METRIC,
Expand Down Expand Up @@ -2352,18 +2352,18 @@ export const updateMlModelVersion = (organizationId, modelId, runId, params) =>
affectedRequests: [GET_ML_MODEL, GET_ML_MODELS]
});

export const getMlGlobalMetrics = (organizationId) =>
export const getMlMetrics = (organizationId) =>
apiAction({
url: `${API_URL}/organizations/${organizationId}/metrics`,
method: "GET",
label: GET_ML_GLOBAL_METRICS,
label: GET_ML_METRICS,
ttl: 5 * MINUTE,
hash: hashParams({ organizationId }),
errorHandlerType: ERROR_HANDLER_TYPE_LOCAL,
onSuccess: handleSuccess(SET_ML_GLOBAL_METRICS)
onSuccess: handleSuccess(SET_ML_METRICS)
});

export const getMlGlobalMetric = (organizationId, metricId) =>
export const getMlMetric = (organizationId, metricId) =>
apiAction({
url: `${API_URL}/organizations/${organizationId}/metrics/${metricId}`,
method: "GET",
Expand All @@ -2373,30 +2373,30 @@ export const getMlGlobalMetric = (organizationId, metricId) =>
onSuccess: handleSuccess(SET_ML_GLOBAL_METRIC)
});

export const createGlobalMetric = (organizationId, params) =>
export const createMlMetric = (organizationId, params) =>
apiAction({
url: `${API_URL}/organizations/${organizationId}/metrics`,
method: "POST",
label: CREATE_GLOBAL_METRIC,
params,
affectedRequests: [GET_ML_GLOBAL_METRICS]
affectedRequests: [GET_ML_METRICS]
});

export const updateGlobalMetric = (organizationId, metricId, params) =>
export const updateMlMetric = (organizationId, metricId, params) =>
apiAction({
url: `${API_URL}/organizations/${organizationId}/metrics/${metricId}`,
method: "PATCH",
label: UPDATE_GLOBAL_METRIC,
affectedRequests: [GET_ML_GLOBAL_METRICS],
affectedRequests: [GET_ML_METRICS],
params
});

export const deleteGlobalMetric = (organizationId, metricId) =>
export const deleteMlMetric = (organizationId, metricId) =>
apiAction({
url: `${API_URL}/organizations/${organizationId}/metrics/${metricId}`,
method: "DELETE",
label: DELETE_GLOBAL_METRIC,
affectedRequests: [GET_ML_GLOBAL_METRICS]
affectedRequests: [GET_ML_METRICS]
});

export const getProfilingToken = (organizationId) =>
Expand Down
4 changes: 2 additions & 2 deletions ngui/ui/src/api/restapi/actionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ export const SET_ML_RUN_DETAILS = "SET_ML_RUN_DETAILS";
export const GET_ML_RUN_DETAILS_BREAKDOWN = "GET_ML_RUN_DETAILS_BREAKDOWN";
export const SET_ML_RUN_DETAILS_BREAKDOWN = "SET_ML_RUN_DETAILS_BREAKDOWN";

export const GET_ML_GLOBAL_METRICS = "GET_ML_GLOBAL_METRICS";
export const SET_ML_GLOBAL_METRICS = "SET_ML_GLOBAL_METRICS";
export const GET_ML_METRICS = "GET_ML_METRICS";
export const SET_ML_METRICS = "SET_ML_METRICS";

export const CREATE_GLOBAL_METRIC = "CREATE_GLOBAL_METRIC";
export const UPDATE_GLOBAL_METRIC = "UPDATE_GLOBAL_METRIC";
Expand Down
20 changes: 10 additions & 10 deletions ngui/ui/src/api/restapi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ import {
updateMlDataset,
deleteMlDataset,
createMlTask,
getMlGlobalMetrics,
createGlobalMetric,
getMlGlobalMetric,
updateGlobalMetric,
deleteGlobalMetric,
getMlMetrics,
createMlMetric,
getMlMetric,
updateMlMetric,
deleteMlMetric,
getProfilingToken,
getMlExecutors,
getMlExecutorsBreakdown,
Expand Down Expand Up @@ -362,11 +362,11 @@ export {
updateMlDataset,
deleteMlDataset,
createMlTask,
getMlGlobalMetrics,
createGlobalMetric,
getMlGlobalMetric,
updateGlobalMetric,
deleteGlobalMetric,
getMlMetrics,
createMlMetric,
getMlMetric,
updateMlMetric,
deleteMlMetric,
getProfilingToken,
getMlExecutors,
getMlExecutorsBreakdown,
Expand Down
4 changes: 2 additions & 2 deletions ngui/ui/src/api/restapi/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ import {
SET_ML_LEADERBOARD_CANDIDATES,
SET_ML_DATASETS,
SET_ML_DATASET,
SET_ML_GLOBAL_METRICS,
SET_ML_METRICS,
SET_ML_GLOBAL_METRIC,
SET_PROFILING_TOKEN,
SET_ML_EXECUTORS,
Expand Down Expand Up @@ -748,7 +748,7 @@ const reducer = (state = {}, action) => {
[action.label]: action.payload
};
}
case SET_ML_GLOBAL_METRICS: {
case SET_ML_METRICS: {
return {
...state,
[action.label]: action.payload
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Box, Stack } from "@mui/material";
import { FormattedMessage } from "react-intl";
import Selector, { Item, ItemContent } from "components/Selector";
import WrapperCard from "components/WrapperCard";
import { useSyncQueryParamWithState } from "hooks/useSyncQueryParamWithState";
import { DAILY_EXPENSES_SPLIT_PARAMETER_NAME } from "urls";
import { AXIS_FORMATS } from "utils/charts";
Expand All @@ -19,32 +18,30 @@ const ExpensesDailyBreakdownBy = ({ breakdown, breakdownByValue, onBreakdownByCh
});

return (
<WrapperCard>
<Stack spacing={SPACING_1}>
<Box display="flex" gap={1}>
<BreakdownBy value={breakdownByValue} onChange={onBreakdownByChange} />
<Selector id="expenses-split-selector" labelMessageId="expenses" value={split} onChange={setSplit}>
{SPLITS.map((splitValue) => (
<Item key={splitValue} value={splitValue}>
<ItemContent>
<FormattedMessage id={splitValue} />
</ItemContent>
</Item>
))}
</Selector>
</Box>
<div>
<ExpensesDailyBreakdownByBarChart
dataTestId="expenses_breakdown_chart"
breakdown={breakdown}
breakdownBy={breakdownByValue}
isLoading={isLoading}
split={split}
axisFormat={AXIS_FORMATS.MONEY}
/>
</div>
</Stack>
</WrapperCard>
<Stack spacing={SPACING_1}>
<Box display="flex" gap={1}>
<BreakdownBy value={breakdownByValue} onChange={onBreakdownByChange} />
<Selector id="expenses-split-selector" labelMessageId="expenses" value={split} onChange={setSplit}>
{SPLITS.map((splitValue) => (
<Item key={splitValue} value={splitValue}>
<ItemContent>
<FormattedMessage id={splitValue} />
</ItemContent>
</Item>
))}
</Selector>
</Box>
<Box>
<ExpensesDailyBreakdownByBarChart
dataTestId="expenses_breakdown_chart"
breakdown={breakdown}
breakdownBy={breakdownByValue}
isLoading={isLoading}
split={split}
axisFormat={AXIS_FORMATS.MONEY}
/>
</Box>
</Stack>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Table from "components/Table";
import TextWithDataTestId from "components/TextWithDataTestId";
import Tooltip from "components/Tooltip";
import { useOrganizationInfo } from "hooks/useOrganizationInfo";
import { ML_TASK_METRICS } from "urls";
import { ML_METRICS } from "urls";
import { tendency, text } from "utils/columns";
import aggregateFunction from "utils/columns/aggregateFunction";

Expand All @@ -22,7 +22,7 @@ const tableActionBar = {
messageId: "manageMetricsLibrary",
variant: "text",
type: "button",
link: ML_TASK_METRICS
link: ML_METRICS
}
]
}
Expand Down
Loading

0 comments on commit 078568d

Please sign in to comment.