Skip to content
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

Merged
merged 7 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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,
};
183 changes: 183 additions & 0 deletions superset-frontend/src/pages/DvtDashboardList/index.tsx
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 },
];

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ı


function DvtDashboardList() {
const [selectedRows, setSelectedRows] = useState<any[]>([]);
const [currentPage, setCurrentPage] = useState<number>(1);

return (
<StyledDashboardList>
<StyledDashboardListButtons>
<StyledDvtSelectButtons>
<DvtButton
label="Unselect All"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unselect? figmadaki Deselect yazıyor. bu ne işe yarayacağı function gerekiyor

Choose a reason for hiding this comment

The 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={() => {}}
/>

Choose a reason for hiding this comment

The 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"

Choose a reason for hiding this comment

The 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);
4 changes: 3 additions & 1 deletion superset-frontend/src/views/dvt-routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ const CssTemplateList = lazy(

const DashboardList = lazy(
() =>
import(/* webpackChunkName: "DashboardList" */ 'src/pages/DashboardList'),
import(
/* webpackChunkName: "DashboardList" */ 'src/pages/DvtDashboardList'
),
);

const Dashboard = lazy(
Expand Down
Loading