-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): implement WIP and alerts board (#172)
* feat: implement alerts <Board /> * feat: work in progress section * feat(ui): fix grid proportion * feat(ui): fix grid proportion * feat(ui): update axios version * fate(ui): add margin-left to right-column launchpad --------- Co-authored-by: Luca Tagliabue <[email protected]>
- Loading branch information
Showing
63 changed files
with
1,068 additions
and
915 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ui/src/components/modals/add-new-model/step-four/form-fields.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
ui/src/components/modals/current-import-detail-modal/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { Board, Skeleton } from '@radicalbit/radicalbit-design-system'; | ||
import SomethingWentWrong from '@Components/ErrorPage/something-went-wrong'; | ||
import { alertsApiSlice } from '@State/alerts/api'; | ||
|
||
const { useGetAlertsQuery } = alertsApiSlice; | ||
|
||
function Alerts() { | ||
const { data = [undefined, undefined], isLoading, isError } = useGetAlertsQuery(); | ||
console.debug(data); | ||
|
||
if (isLoading) { | ||
return ( | ||
<Board | ||
header="Alerts" | ||
main={( | ||
<div className="flex flex-col gap-2"> | ||
<Skeleton.Input active block /> | ||
|
||
<Skeleton.Input active block /> | ||
|
||
<Skeleton.Input active block /> | ||
</div> | ||
)} | ||
/> | ||
); | ||
} | ||
|
||
if (isError) { | ||
return ( | ||
<Board | ||
header="Alerts" | ||
main={<SomethingWentWrong size="small" />} | ||
size="small" | ||
/> | ||
); | ||
} | ||
|
||
return ( | ||
<Board | ||
header="Alerts" | ||
main={( | ||
<div className="flex flex-col gap-2"> | ||
{data.map((alert) => ( | ||
<Main alert={alert} /> | ||
))} | ||
</div> | ||
)} | ||
size="small" | ||
/> | ||
); | ||
} | ||
|
||
function Main({ alert }) { | ||
const alertType = alert?.alertType || 'Foo'; | ||
const fieldsInError = alert?.fieldsInError || 'Bar'; | ||
|
||
return ( | ||
<Board | ||
borderType="none" | ||
main={( | ||
<div> | ||
<strong>{alertType}</strong> | ||
|
||
<span>{fieldsInError}</span> | ||
</div> | ||
)} | ||
size="small" | ||
type="error" | ||
/> | ||
); | ||
} | ||
|
||
export default Alerts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Alerts from './alerts'; | ||
import WorkInProgress from './work-in-progress'; | ||
|
||
function Right() { | ||
return ( | ||
<div className="flex flex-col gap-4 ml-4"> | ||
<Alerts /> | ||
|
||
<WorkInProgress /> | ||
</div> | ||
); | ||
} | ||
|
||
export default Right; |
30 changes: 30 additions & 0 deletions
30
ui/src/container/launchpad/right/work-in-progress/columns.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import JobStatusPin from '@Components/JobStatus/job-status-pin'; | ||
import { columnFactory } from '@Src/components/smart-table/utils'; | ||
import { JOB_STATUS } from '@Src/constants'; | ||
|
||
const columns = [ | ||
columnFactory({ | ||
title: 'S', | ||
key: 'name', | ||
width: '3rem', | ||
align: 'center', | ||
render: ({ latestCurrentJobStatus, latestReferenceJobStatus }) => { | ||
const jobStatus = latestReferenceJobStatus === JOB_STATUS.SUCCEEDED | ||
? latestCurrentJobStatus | ||
: latestReferenceJobStatus; | ||
|
||
console.debug(jobStatus); | ||
return ( | ||
<JobStatusPin jobStatus={jobStatus} /> | ||
); | ||
}, | ||
}), | ||
columnFactory({ | ||
title: 'Name', | ||
key: 'name', | ||
width: 250, | ||
render: ({ name }) => (<div className="font-[var(--coo-font-weight-bold)]">{name}</div>), | ||
}), | ||
]; | ||
|
||
export default columns; |
65 changes: 65 additions & 0 deletions
65
ui/src/container/launchpad/right/work-in-progress/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import SomethingWentWrong from '@Components/ErrorPage/something-went-wrong'; | ||
import { useGetModelQueryWithPolling } from '@State/models/polling-hook'; | ||
import { Board, DataTable, Skeleton } from '@radicalbit/radicalbit-design-system'; | ||
import { useLocation, useNavigate } from 'react-router-dom'; | ||
import columns from './columns'; | ||
|
||
function WorkInProgress() { | ||
const navigate = useNavigate(); | ||
const { search } = useLocation(); | ||
|
||
const { data = [], isLoading, isError } = useGetModelQueryWithPolling(); | ||
const models = data.items || []; | ||
const wipModels = models.filter(({ latestCurrentUuid, latestReferenceUuid }) => !latestCurrentUuid || !latestReferenceUuid); | ||
|
||
if (isLoading) { | ||
return ( | ||
<Board | ||
header="Work in progress" | ||
main={( | ||
<div className="flex flex-col gap-2"> | ||
<Skeleton.Input active block /> | ||
|
||
<Skeleton.Input active block /> | ||
|
||
<Skeleton.Input active block /> | ||
</div> | ||
)} | ||
/> | ||
); | ||
} | ||
|
||
if (isError) { | ||
return ( | ||
<Board | ||
header="Work in progress" | ||
main={<SomethingWentWrong size="small" />} | ||
size="small" | ||
/> | ||
); | ||
} | ||
|
||
return ( | ||
<Board | ||
header="Work in progress" | ||
height="300px" | ||
main={( | ||
<DataTable | ||
clickable | ||
columns={columns} | ||
dataSource={wipModels} | ||
onRow={({ uuid }) => ({ | ||
onClick: () => navigate({ pathname: `/models/${uuid}`, search }), | ||
})} | ||
pagination={false} | ||
rowKey={({ uuid }) => uuid} | ||
scroll={{ y: '16rem' }} | ||
size="small" | ||
/> | ||
)} | ||
size="small" | ||
/> | ||
); | ||
} | ||
|
||
export default WorkInProgress; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ui/src/container/models/Details/binary-classification/current/data-drift/header/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...container/models/Details/binary-classification/current/data-drift/search-filter/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...dels/Details/binary-classification/current/data-quality/data-point-distribution/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ntainer/models/Details/binary-classification/current/data-quality/search-filter/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...er/models/Details/binary-classification/current/data-quality/use-get-filtered-features.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ui/src/container/models/Details/binary-classification/current/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ui/src/container/models/Details/binary-classification/current/model-quality/charts.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ontainer/models/Details/binary-classification/overview/variables-tab/useHandleOnSubmit.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ls/Details/binary-classification/reference/data-quality/data-point-distribution/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.