-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: started dasboard page dvt60/dashboards-page #96
Changes from 1 commit
44c6199
36fa512
635c54e
832e7b4
8e5571e
0e92d62
7c325c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { styled } from '@superset-ui/core'; | ||
|
||
const StyledDashboardList = styled.div` | ||
flex: 1; | ||
`; | ||
const StyledDvtSelectButtons = styled.div` | ||
display: flex; | ||
`; | ||
const StyledDashboardButtons = styled.div` | ||
display: flex; | ||
gap: 16px; | ||
flex-direction: row; | ||
justify-content: flex-end; | ||
`; | ||
const StyledDashboardListButtons = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
background-color: ${({ theme }) => theme.colors.grayscale.light5}; | ||
`; | ||
const StyledDashboardTable = styled.div``; | ||
|
||
const StyledDashboardPagination = styled.div` | ||
display: flex; | ||
justify-content: flex-end; | ||
`; | ||
|
||
const StyledDashboardCreateDashboard = styled.div` | ||
display: flex; | ||
justify-content: flex-start; | ||
`; | ||
|
||
const StyledDashboardBottom = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: center; | ||
`; | ||
|
||
export { | ||
StyledDashboardList, | ||
StyledDvtSelectButtons, | ||
StyledDashboardButtons, | ||
StyledDashboardListButtons, | ||
StyledDashboardTable, | ||
StyledDashboardPagination, | ||
StyledDashboardCreateDashboard, | ||
StyledDashboardBottom, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
import React, { useState } from 'react'; | ||
import DvtButton from 'src/components/DvtButton'; | ||
import DvtPagination from 'src/components/DvtPagination'; | ||
import DvtTable from 'src/components/DvtTable'; | ||
import withToasts from 'src/components/MessageToasts/withToasts'; | ||
import { | ||
StyledDashboardBottom, | ||
StyledDashboardButtons, | ||
StyledDashboardCreateDashboard, | ||
StyledDashboardList, | ||
StyledDashboardListButtons, | ||
StyledDashboardPagination, | ||
StyledDashboardTable, | ||
StyledDvtSelectButtons, | ||
} from './dvtdashboardlist.module'; | ||
|
||
const dummyData = [ | ||
{ | ||
id: 1, | ||
name: 'arac', | ||
type: 'Pysical', | ||
database: 'PostgreSQL', | ||
schema: 'Dwh', | ||
date: '10.03.2023 12:45:00', | ||
modifiedBy: 'Admin', | ||
owners: 'A', | ||
}, | ||
{ | ||
id: 2, | ||
name: 'hrrr2', | ||
type: 'Pysical', | ||
database: 'PostgreSQL', | ||
schema: 'Public', | ||
date: '10.03.2023 12:45:00', | ||
modifiedBy: 'Admin', | ||
owners: 'A', | ||
}, | ||
{ | ||
id: 3, | ||
name: 'channel_members', | ||
type: 'Pysical', | ||
database: 'Examples', | ||
schema: 'Public', | ||
date: '10.03.2023 12:45:00', | ||
modifiedBy: 'Admin', | ||
owners: 'A', | ||
}, | ||
{ | ||
id: 4, | ||
name: 'channel', | ||
type: 'Pysical', | ||
database: 'Examples', | ||
schema: 'Public', | ||
date: '10.03.2023 12:45:00', | ||
modifiedBy: 'Admin', | ||
owners: 'A', | ||
}, | ||
{ | ||
id: 5, | ||
name: 'cleaned_sales_data', | ||
type: 'Pysical', | ||
database: 'Examples', | ||
schema: 'Public', | ||
date: '10.03.2023 12:45:00', | ||
modifiedBy: 'Admin', | ||
owners: 'A', | ||
}, | ||
{ | ||
id: 6, | ||
name: 'covid_vaccines', | ||
type: 'Pysical', | ||
database: 'Examples', | ||
schema: 'Public', | ||
date: '10.03.2023 12:45:00', | ||
modifiedBy: 'Admin', | ||
owners: 'A', | ||
}, | ||
{ | ||
id: 7, | ||
name: 'exported_stats', | ||
type: 'Pysical', | ||
database: 'Examples', | ||
schema: 'Public', | ||
date: '10.03.2023 12:45:00', | ||
modifiedBy: 'Admin', | ||
owners: 'A', | ||
}, | ||
{ | ||
id: 8, | ||
name: 'members_channels_2', | ||
type: 'Pysical', | ||
database: 'Examples', | ||
schema: 'Public', | ||
date: '10.03.2023 12:45:00', | ||
modifiedBy: 'Admin', | ||
owners: 'A', | ||
}, | ||
{ | ||
id: 9, | ||
name: 'Fcc 2018 Survey', | ||
type: 'Pysical', | ||
database: 'Examples', | ||
schema: 'Public', | ||
date: '10.03.2023 12:45:00', | ||
modifiedBy: 'Admin', | ||
owners: 'A', | ||
}, | ||
]; | ||
|
||
const dummyHeader = [ | ||
{ id: 1, title: 'ID', field: 'id', flex: 1, checkbox: true }, | ||
{ id: 2, title: 'Title', field: 'title', flex: 2 }, | ||
{ id: 3, title: 'Date', field: 'date', flex: 2 }, | ||
]; | ||
|
||
function DvtDashboardList() { | ||
const [selectedRows, setSelectedRows] = useState<any[]>([]); | ||
const [currentPage, setCurrentPage] = useState<number>(1); | ||
|
||
return ( | ||
<StyledDashboardList> | ||
<StyledDashboardListButtons> | ||
<StyledDvtSelectButtons> | ||
<DvtButton | ||
label="Unselect All" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unselect? figmadaki Deselect yazıyor. bu ne işe yarayacağı function gerekiyor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tablodaki seçilmiş olursa sayısı "10 Selected" falan olması lazım. figmadaki yanısı olmalı |
||
bold | ||
colour="primary" | ||
typeColour="outline" | ||
onClick={() => {}} | ||
/> | ||
</StyledDvtSelectButtons> | ||
<StyledDashboardButtons> | ||
<DvtButton | ||
label="Delete" | ||
icon="dvt-delete" | ||
iconToRight | ||
colour="error" | ||
onClick={() => {}} | ||
/> | ||
<DvtButton | ||
label="Export" | ||
icon="dvt-export" | ||
iconToRight | ||
colour="primary" | ||
bold | ||
typeColour="powder" | ||
onClick={() => {}} | ||
/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. StyledDashboardListButtons height 56px kalmalı figmadaki height aynısı olmalı boşlukları eşit düzeltmeli |
||
</StyledDashboardButtons> | ||
</StyledDashboardListButtons> | ||
<StyledDashboardTable> | ||
<DvtTable | ||
data={dummyData} | ||
header={dummyHeader} | ||
selected={selectedRows} | ||
setSelected={setSelectedRows} | ||
checkboxActiveField="id" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. senin ki data checkboxActiveField="id" olan data içinde id bulamadıysa sorun olur. Data içinde tek bir unique varsa o olmalı |
||
/> | ||
</StyledDashboardTable> | ||
<StyledDashboardBottom> | ||
<StyledDashboardCreateDashboard> | ||
<DvtButton | ||
label="Create a New Dashboard" | ||
colour="grayscale" | ||
bold | ||
typeColour="basic" | ||
onClick={() => {}} | ||
/> | ||
</StyledDashboardCreateDashboard> | ||
<StyledDashboardPagination> | ||
<DvtPagination | ||
page={currentPage} | ||
setPage={setCurrentPage} | ||
itemSize={dummyData.length} | ||
pageItemSize={10} | ||
/> | ||
</StyledDashboardPagination> | ||
</StyledDashboardBottom> | ||
</StyledDashboardList> | ||
); | ||
} | ||
|
||
export default withToasts(DvtDashboardList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dummyHeader dummy değil aslında gerçek başlıklar kodluyoruz "dummy" kaldırabilirsin sadece header ya da headerData olur, bu başlık 3 tane var ama figmadaki aynısı 7 tane başlık kalmalı