Skip to content

Commit

Permalink
chore: move modal into the right folder and use alias for import
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Tagliabue committed Jun 21, 2024
1 parent c9c37ff commit 0d746da
Show file tree
Hide file tree
Showing 60 changed files with 43 additions and 42 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Tabs } from '@radicalbit/radicalbit-design-system';
import { useSearchParams } from 'react-router-dom';
import { METRICS_TABS } from '@Container/models/Details/constants';
import DataDriftMetrics from '../../data-drift-metrics';
import DataQualityMetrics from '../../data-quality-metrics';
import ModelQualityMetrics from '../../model-quality-metrics';
import DataQualityMetrics from '@Container/models/Details/reference/data-quality';
import ModelQualityMetrics from '@Container/models/Details/reference/model-quality';
import DataDriftMetrics from '@Container/models/Details/current/data-drift';

const tabs = [
{
Expand All @@ -23,7 +23,7 @@ const tabs = [
},
];

export default function CurrentDashboardModal() {
function Body() {
const [searchParams, setSearchParams] = useSearchParams();

const activeTab = searchParams.get('modal-tab-metrics') || METRICS_TABS.METRICS;
Expand All @@ -38,14 +38,17 @@ export default function CurrentDashboardModal() {
};

return (

<div className="px-4 pt-4 h-[99%]">
<Tabs
activeKey={activeTab}
fullHeight
items={tabs}
onChange={onChangeTab}
/>
<div className="flex flex-col gap-4 h-full">
<div className="px-4 pt-4 h-[99%]">
<Tabs
activeKey={activeTab}
fullHeight
items={tabs}
onChange={onChangeTab}
/>
</div>
</div>
);
}

export default Body;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import { memo } from 'react';
import { useParams } from 'react-router';
import { useSearchParams } from 'react-router-dom';
import CurrentDashboardModal from './current-dashboard-modal';
import Body from './body';

const { useGetModelByUUIDQuery } = modelsApiSlice;

Expand All @@ -38,9 +38,7 @@ function CurrentImportDetailModal() {
onCancel={handleOnCancel}
open
>
<div className="flex flex-col gap-4 h-full">
<CurrentDashboardModal />
</div>
<Body />
</RbitModal>
);
}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/modals/modals-provider.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ModalsEnum } from '@Src/constants';
import useModals from '@Src/hooks/use-modals';
import AddNewModel from './add-new-model';
import CurrentImportsDetailModal from '../../container/models/Details/current-dashboard/imports/current-import-detail-modal';
import CurrentImportsDetailModal from './current-import-detail-modal';

export default function ModalsProvider() {
const { modalPayload: { modalName } } = useModals();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { numberFormatter } from '@Src/constants';
import moment from 'moment';
import { CHART_COLOR } from '../../constants';
import { CHART_COLOR } from '@Container/models/Details/constants';

export default function lineChartOptions(title, color, currentDataset, referenceDataset) {
const series = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { modelsApiSlice } from '@Src/store/state/models/api';
import { ModelTypeEnum } from '@State/models/constants';
import { memo } from 'react';
import { useParams } from 'react-router';
import BinaryClassificationMetrics from './binary-classification-metrics';
import BinaryClassificationMetrics from './binary-classification';

const { useGetModelByUUIDQuery } = modelsApiSlice;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { modelsApiSlice } from '@Src/store/state/models/api';
import { ModelTypeEnum } from '@State/models/constants';
import { memo } from 'react';
import { useParams } from 'react-router';
import BinaryClassificationMetrics from './binary-classification-metrics';
import BinaryClassificationMetrics from './binary-classification';

const { useGetModelByUUIDQuery } = modelsApiSlice;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { JOB_STATUS } from '@Src/constants';
import { modelsApiSlice } from '@Src/store/state/models/api';
import { Tabs } from '@radicalbit/radicalbit-design-system';
import { useParams, useSearchParams } from 'react-router-dom';
import { METRICS_TABS } from '../constants';
import DataDriftMetrics from './data-drift-metrics/binary-classification-metrics';
import DataQualityMetrics from './data-quality-metrics';
import { METRICS_TABS } from '@Container/models/Details/constants';
import DataDriftMetrics from './data-drift/binary-classification';
import DataQualityMetrics from './data-quality';
import Imports from './imports';
import ModelQualityMetrics from './model-quality-metrics';
import ModelQualityMetrics from './model-quality';

const { useGetReferenceDataQualityQuery } = modelsApiSlice;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { modelsApiSlice } from '@Src/store/state/models/api';
import { ModelTypeEnum } from '@State/models/constants';
import { memo } from 'react';
import { useParams } from 'react-router';
import BinaryClassificationMetrics from './binary-classification-metrics';
import BinaryClassificationMetrics from './binary-classification';

const { useGetModelByUUIDQuery } = modelsApiSlice;

Expand Down
12 changes: 6 additions & 6 deletions ui/src/container/models/Details/index.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useParams, useSearchParams } from 'react-router-dom';
import { modelsApiSlice } from '@State/models/api';
import NotFound from '@Components/ErrorPage/not-found';
import { MODEL_TABS_ENUM } from './constants';
import CurrentDashboard from './current-dashboard';
import { modelsApiSlice } from '@State/models/api';
import { useParams, useSearchParams } from 'react-router-dom';
import { MODEL_TABS_ENUM } from '@Src/constants';
import Current from './current';
import Overview from './overview';
import ReferenceDashboard from './reference-dashboard';
import ReferenceDashboard from './reference';

const { useGetModelByUUIDQuery } = modelsApiSlice;

Expand All @@ -30,6 +30,6 @@ export function ModelDetails() {
}

if (activeKey === MODEL_TABS_ENUM.CURRENT_DASHBOARD) {
return (<CurrentDashboard />);
return (<Current />);
}
}
2 changes: 1 addition & 1 deletion ui/src/container/models/Details/overview/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
Tabs,
} from '@radicalbit/radicalbit-design-system';
import { useSearchParams } from 'react-router-dom';
import { MODEL_TABS_ENUM, OVERVIEW_TABS_ENUM } from '../constants';
import { MODEL_TABS_ENUM, OVERVIEW_TABS_ENUM } from '@Container/models/Details/constants';
import OutputsTab from './outputs-tab';
import SummaryTab from './summary-tab';
import VariablesTab from './variables-tab';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Tag } from '@radicalbit/radicalbit-design-system';
import { OVERVIEW_ROW_TYPE } from '../../constants';
import { OVERVIEW_ROW_TYPE } from '@Container/models/Details/constants';

const outputsColumns = (dataSource) => [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DataTable } from '@radicalbit/radicalbit-design-system';
import { memo } from 'react';
import { useParams } from 'react-router';
import { modelsApiSlice } from '@Store/state/models/api';
import { OVERVIEW_ROW_TYPE } from '../../constants';
import { OVERVIEW_ROW_TYPE } from '@Container/models/Details/constants';
import outputsColumns from './columns';

const { useGetModelByUUIDQuery } = modelsApiSlice;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { DataTable } from '@radicalbit/radicalbit-design-system';
import { useParams } from 'react-router';
import { memo } from 'react';
import { modelsApiSlice } from '@Store/state/models/api';
import { OVERVIEW_ROW_TYPE } from '@Container/models/Details/constants';
import featuresColumns from './columns';
import { OVERVIEW_ROW_TYPE } from '../../constants';

const { useGetModelByUUIDQuery } = modelsApiSlice;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { modelsApiSlice } from '@Src/store/state/models/api';
import { ModelTypeEnum } from '@State/models/constants';
import { memo } from 'react';
import { useParams } from 'react-router';
import BinaryClassificationMetrics from './binary-classification-metrics';
import BinaryClassificationMetrics from './binary-classification';

const { useGetModelByUUIDQuery } = modelsApiSlice;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { JOB_STATUS } from '@Src/constants';
import { modelsApiSlice } from '@Src/store/state/models/api';
import { Tabs } from '@radicalbit/radicalbit-design-system';
import { useParams, useSearchParams } from 'react-router-dom';
import { METRICS_TABS } from '../constants';
import DataQualityMetrics from './data-quality-metrics';
import { METRICS_TABS } from '@Container/models/Details/constants';
import DataQualityMetrics from './data-quality';
import Imports from './imports';
import ModelQualityMetrics from './model-quality-metrics';
import ModelQualityMetrics from './model-quality';

const { useGetReferenceDataQualityQuery } = modelsApiSlice;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { modelsApiSlice } from '@Src/store/state/models/api';
import { ModelTypeEnum } from '@State/models/constants';
import { memo } from 'react';
import { useParams } from 'react-router';
import BinaryClassificationMetrics from './binary-classification-metrics';
import BinaryClassificationMetrics from './binary-classification';

const { useGetModelByUUIDQuery } = modelsApiSlice;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useSelector } from 'react-redux';
import JobStatusPin from '@Components/JobStatus/job-status-pin';
import { selectors as contextConfigurationSelectors } from '@State/context-configuration';
import { NamespaceEnum } from '@Src/constants';
import { MODEL_TABS_ENUM } from '../constants';
import { MODEL_TABS_ENUM } from '@Container/models/Details/constants';

const { useGetModelsQuery } = modelsApiSlice;

Expand Down
2 changes: 1 addition & 1 deletion ui/src/store/state/notification/slice.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createSlice } from '@reduxjs/toolkit';
import { NotificationEnum } from './constants';
import { NotificationEnum } from '@State/notification/constants';

const initialState = {
showMessage: false,
Expand Down

0 comments on commit 0d746da

Please sign in to comment.