forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/intellica-tech/reporting-tool …
…into dev
- Loading branch information
Showing
11 changed files
with
334 additions
and
0 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions
34
superset-frontend/src/components/DvtDarkMode/dvt-dark-mode.module.tsx
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,34 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import { styled } from '@superset-ui/core'; | ||
|
||
const StyledDvtDarkMode = styled.div` | ||
display: inline-flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
gap: 16px; | ||
`; | ||
|
||
const DvtDarkModeLabel = styled.p` | ||
color: ${({ theme }) => theme.colors.dvt.text.label}; | ||
font-size: 14px; | ||
margin: 0; | ||
`; | ||
|
||
export { StyledDvtDarkMode, DvtDarkModeLabel }; |
37 changes: 37 additions & 0 deletions
37
superset-frontend/src/components/DvtDarkMode/dvt-dark-mode.stories.tsx
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,37 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import React from 'react'; | ||
import DvtDarkMode, { DvtDarkModeProps } from '.'; | ||
|
||
export default { | ||
title: 'Dvt-Components/DvtDarkMode', | ||
component: DvtDarkMode, | ||
}; | ||
|
||
export const Default = (args: DvtDarkModeProps) => <DvtDarkMode {...args} />; | ||
|
||
Default.args = { | ||
title: 'Dark Mode', | ||
}; | ||
|
||
Default.argTypes = { | ||
title: { | ||
control: { type: 'text' }, | ||
}, | ||
}; |
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,37 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import React from 'react'; | ||
import { Switch } from 'antd'; | ||
import moon from '../../assets/dvt-img/moon.png'; | ||
import { StyledDvtDarkMode, DvtDarkModeLabel } from './dvt-dark-mode.module'; | ||
|
||
export interface DvtDarkModeProps { | ||
title: string; | ||
darkMode: boolean; | ||
} | ||
|
||
const DvtDarkMode: React.FC<DvtDarkModeProps> = ({ title, darkMode }) => ( | ||
<StyledDvtDarkMode> | ||
<img src={moon} alt="moon" /> | ||
<DvtDarkModeLabel>{title}</DvtDarkModeLabel> | ||
<Switch checked={darkMode} /> | ||
</StyledDvtDarkMode> | ||
); | ||
|
||
export default DvtDarkMode; |
32 changes: 32 additions & 0 deletions
32
superset-frontend/src/components/DvtDotTitle/dvt-dot-title.module.tsx
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,32 @@ | ||
import { styled } from '@superset-ui/core'; | ||
|
||
const StyledDotTitle = styled.div` | ||
display: flex; | ||
align-items: center; | ||
`; | ||
|
||
const StyledTitle = styled.div` | ||
font-size: 18px; | ||
font-weight: 700; | ||
line-height: 140%; | ||
letter-spacing: 0.2px; | ||
`; | ||
|
||
const StyledDotIcon = styled.div` | ||
display: flex; | ||
height: 48px; | ||
width: 48px; | ||
background-color: ${({ theme }) => theme.colors.dvt.success.light2}; | ||
border-radius: 12px; | ||
margin-right: 16px; | ||
`; | ||
|
||
const StyledDot = styled.div` | ||
height: 16px; | ||
width: 16px; | ||
background-color: ${({ theme }) => theme.colors.dvt.success.base}; | ||
border-radius: 50px; | ||
margin: auto; | ||
`; | ||
|
||
export { StyledDotTitle, StyledDotIcon, StyledDot, StyledTitle }; |
17 changes: 17 additions & 0 deletions
17
superset-frontend/src/components/DvtDotTitle/dvt-dot-title.stories.tsx
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,17 @@ | ||
import React from 'react'; | ||
import DvtDotTitle, { DvtDotTitleProps } from '.'; | ||
|
||
export default { | ||
title: 'Dvt-Components/DvtDotTitle', | ||
component: DvtDotTitle, | ||
}; | ||
|
||
export const Default = (args: DvtDotTitleProps) => ( | ||
<DvtDotTitle label="Welcome Page" {...args} /> | ||
); | ||
export const Connection = (args: DvtDotTitleProps) => ( | ||
<DvtDotTitle label="Connection" {...args} /> | ||
); | ||
export const SQL = (args: DvtDotTitleProps) => ( | ||
<DvtDotTitle label="SQL" {...args} /> | ||
); |
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,22 @@ | ||
import React from 'react'; | ||
import { | ||
StyledDotTitle, | ||
StyledDotIcon, | ||
StyledDot, | ||
StyledTitle, | ||
} from './dvt-dot-title.module'; | ||
|
||
export interface DvtDotTitleProps { | ||
label?: string; | ||
} | ||
|
||
const DvtDotTitle = ({ label = '' }: DvtDotTitleProps) => ( | ||
<StyledDotTitle> | ||
<StyledDotIcon> | ||
<StyledDot /> | ||
</StyledDotIcon> | ||
<StyledTitle>{label}</StyledTitle> | ||
</StyledDotTitle> | ||
); | ||
|
||
export default DvtDotTitle; |
49 changes: 49 additions & 0 deletions
49
superset-frontend/src/components/DvtNavigation/dvt-navigation.module.tsx
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,49 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import { styled } from '@superset-ui/core'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
const StyledDvtNavigation = styled.div` | ||
display: inline-flex; | ||
flex-direction: column; | ||
gap: 23px; | ||
`; | ||
|
||
const DvtNavigationItem = styled.div` | ||
display: flex; | ||
align-items: center; | ||
height: 22px; | ||
cursor: pointer; | ||
gap: 16px; | ||
`; | ||
const DvtNavigationItemIcon = styled.div``; | ||
|
||
const DvtNavigationItemLabel = styled(Link)` | ||
color: ${({ theme }) => theme.colors.dvt.text.label}; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 500; | ||
`; | ||
|
||
export { | ||
StyledDvtNavigation, | ||
DvtNavigationItem, | ||
DvtNavigationItemIcon, | ||
DvtNavigationItemLabel, | ||
}; |
53 changes: 53 additions & 0 deletions
53
superset-frontend/src/components/DvtNavigation/dvt-navigation.stories.tsx
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,53 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import React from 'react'; | ||
import { MemoryRouter } from 'react-router-dom'; | ||
import DvtNavigation, { DvtNavigationProps } from '.'; | ||
|
||
export default { | ||
title: 'Dvt-Components/DvtNavigation', | ||
component: DvtNavigation, | ||
decorators: [ | ||
(Story: any) => ( | ||
<MemoryRouter> | ||
<Story /> | ||
</MemoryRouter> | ||
), | ||
], | ||
}; | ||
|
||
export const Default = (args: DvtNavigationProps) => ( | ||
<DvtNavigation {...args} /> | ||
); | ||
|
||
Default.args = { | ||
data: [ | ||
{ title: 'Connections', url: '', fileName: 'calendar' }, | ||
{ title: 'Dataset', url: '', fileName: 'database' }, | ||
{ title: 'Dashboard', url: '', fileName: 'grid' }, | ||
{ title: 'Report', url: '', fileName: 'code' }, | ||
{ title: 'Alert', url: '', fileName: 'alert' }, | ||
], | ||
}; | ||
|
||
Default.argTypes = { | ||
data: { | ||
control: { type: 'object ' }, | ||
}, | ||
}; |
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,52 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import React from 'react'; | ||
import Icon from '../Icons/Icon'; | ||
import { | ||
StyledDvtNavigation, | ||
DvtNavigationItem, | ||
DvtNavigationItemIcon, | ||
DvtNavigationItemLabel, | ||
} from './dvt-navigation.module'; | ||
|
||
export interface DvtNavigationProps { | ||
data: DataProps[]; | ||
} | ||
export interface DataProps { | ||
url: string; | ||
title: string; | ||
fileName: string; | ||
} | ||
|
||
const DvtNavigation: React.FC<DvtNavigationProps> = ({ data }) => ( | ||
<StyledDvtNavigation> | ||
{data.length > 0 && | ||
data.map((item, index) => ( | ||
<DvtNavigationItem key={index}> | ||
<DvtNavigationItemIcon> | ||
<Icon fileName={item.fileName} size={22} /> | ||
</DvtNavigationItemIcon> | ||
<DvtNavigationItemLabel to={item.url}> | ||
{item.title} | ||
</DvtNavigationItemLabel> | ||
</DvtNavigationItem> | ||
))} | ||
</StyledDvtNavigation> | ||
); | ||
export default DvtNavigation; |