-
Notifications
You must be signed in to change notification settings - Fork 14k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(explore): UI changes in dataset panel on Explore page (#19394)
* feat(explore): Implement new design for dataset panel * Fixes * Replace drag handle in dashboard builder * Add missing types * Type fix * Fix tests * Fix non-dnd version * Fix test * Replace margin with height
- Loading branch information
Showing
27 changed files
with
384 additions
and
217 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
58 changes: 0 additions & 58 deletions
58
superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnTypeLabel.tsx
This file was deleted.
Oops, something went wrong.
71 changes: 71 additions & 0 deletions
71
...nd/packages/superset-ui-chart-controls/src/components/ColumnTypeLabel/ColumnTypeLabel.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,71 @@ | ||
/* eslint-disable no-nested-ternary */ | ||
/** | ||
* 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, { ReactNode } from 'react'; | ||
import { css, GenericDataType, styled, t } from '@superset-ui/core'; | ||
import { ClockCircleOutlined, QuestionOutlined } from '@ant-design/icons'; | ||
// TODO: move all icons to superset-ui/core | ||
import FunctionSvg from './type-icons/field_derived.svg'; | ||
import BooleanSvg from './type-icons/field_boolean.svg'; | ||
import StringSvg from './type-icons/field_abc.svg'; | ||
import NumSvg from './type-icons/field_num.svg'; | ||
|
||
export type ColumnLabelExtendedType = 'expression' | ''; | ||
|
||
export type ColumnTypeLabelProps = { | ||
type?: ColumnLabelExtendedType | GenericDataType; | ||
}; | ||
|
||
const TypeIconWrapper = styled.div` | ||
${({ theme }) => css` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: ${theme.gridUnit * 6}px; | ||
height: ${theme.gridUnit * 6}px; | ||
margin-right: ${theme.gridUnit}px; | ||
&& svg { | ||
margin-right: 0; | ||
margin-left: 0; | ||
} | ||
`}; | ||
`; | ||
|
||
export function ColumnTypeLabel({ type }: ColumnTypeLabelProps) { | ||
let typeIcon: ReactNode = ( | ||
<QuestionOutlined aria-label={t('unknown type icon')} /> | ||
); | ||
|
||
if (type === '' || type === 'expression') { | ||
typeIcon = <FunctionSvg aria-label={t('function type icon')} />; | ||
} else if (type === GenericDataType.STRING) { | ||
typeIcon = <StringSvg aria-label={t('string type icon')} />; | ||
} else if (type === GenericDataType.NUMERIC) { | ||
typeIcon = <NumSvg aria-label={t('numeric type icon')} />; | ||
} else if (type === GenericDataType.BOOLEAN) { | ||
typeIcon = <BooleanSvg aria-label={t('boolean type icon')} />; | ||
} else if (type === GenericDataType.TEMPORAL) { | ||
typeIcon = <ClockCircleOutlined aria-label={t('temporal type icon')} />; | ||
} | ||
|
||
return <TypeIconWrapper>{typeIcon}</TypeIconWrapper>; | ||
} | ||
|
||
export default ColumnTypeLabel; |
21 changes: 21 additions & 0 deletions
21
...erset-ui-chart-controls/src/components/ColumnTypeLabel/type-icons/field_abc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
...t-ui-chart-controls/src/components/ColumnTypeLabel/type-icons/field_boolean.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
...rset-ui-chart-controls/src/components/ColumnTypeLabel/type-icons/field_date.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
...t-ui-chart-controls/src/components/ColumnTypeLabel/type-icons/field_derived.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
...erset-ui-chart-controls/src/components/ColumnTypeLabel/type-icons/field_num.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
...ackages/superset-ui-chart-controls/src/components/ColumnTypeLabel/type-icons/svgType.d.ts
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 @@ | ||
/** | ||
* 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. | ||
*/ | ||
declare module '*.svg' { | ||
const content: any; | ||
export default content; | ||
} |
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.