Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 6 additions & 2 deletions superset-frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/

// Register TypeScript require hook so ESLint can load .ts plugin files
require('tsx/cjs');

const packageConfig = require('./package.json');

const importCoreModules = [];
Expand Down Expand Up @@ -148,7 +152,7 @@ module.exports = {
// Custom Superset rules
'theme-colors/no-literal-colors': 'error',
'icons/no-fa-icons-usage': 'error',
'i18n-strings/no-template-vars': ['error', true],
'i18n-strings/no-template-vars': 'error',

// Core ESLint overrides for Superset
'no-console': 'warn',
Expand Down Expand Up @@ -195,7 +199,7 @@ module.exports = {
'**/jest.setup.js',
'**/webpack.config.js',
'**/webpack.config.*.js',
'**/.eslintrc.js',
'**/.eslintrc*.js',
],
optionalDependencies: false,
},
Expand Down
5 changes: 4 additions & 1 deletion superset-frontend/.eslintrc.minimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
* under the License.
*/

// Register TypeScript require hook so ESLint can load .ts plugin files
require('tsx/cjs');

/**
* MINIMAL ESLint config - ONLY for rules OXC doesn't support
* This config is designed to be run alongside OXC linter
Expand Down Expand Up @@ -66,7 +69,7 @@ module.exports = {
// Custom Superset plugins
'theme-colors/no-literal-colors': 'error',
'icons/no-fa-icons-usage': 'error',
'i18n-strings/no-template-vars': ['error', true],
'i18n-strings/no-template-vars': 'error',
'file-progress/activate': 1,

// Explicitly turn off all other rules to avoid conflicts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const InteractiveButton = (args: ButtonProps & { children: string }) => (
);

InteractiveButton.args = {
buttonStyle: 'default',
buttonStyle: 'primary',
buttonSize: 'default',
children: 'Button!',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@ import type {
OnClickHandler,
} from './types';

const BUTTON_STYLE_MAP: Record<
ButtonStyle,
{
type?: ButtonType;
variant?: ButtonVariantType;
color?: ButtonColorType;
}
> = {
primary: { type: 'primary', variant: 'solid', color: 'primary' },
secondary: { variant: 'filled', color: 'primary' },
tertiary: { variant: 'outlined', color: 'default' },
dashed: { type: 'dashed', variant: 'dashed', color: 'primary' },
danger: { variant: 'solid', color: 'danger' },
link: { type: 'link' },
};

export function Button(props: ButtonProps) {
const {
tooltip,
Expand Down Expand Up @@ -62,27 +78,11 @@ export function Button(props: ButtonProps) {
padding = 4;
}

let antdType: ButtonType = 'default';
let variant: ButtonVariantType = 'solid';
let color: ButtonColorType = 'primary';

if (!buttonStyle || buttonStyle === 'primary') {
variant = 'solid';
antdType = 'primary';
} else if (buttonStyle === 'secondary') {
variant = 'filled';
color = 'primary';
} else if (buttonStyle === 'tertiary') {
variant = 'outlined';
color = 'default';
} else if (buttonStyle === 'dashed') {
variant = 'dashed';
antdType = 'dashed';
} else if (buttonStyle === 'danger') {
color = 'danger';
} else if (buttonStyle === 'link') {
variant = 'link';
}
const {
type: antdType = 'default',
variant,
color,
} = BUTTON_STYLE_MAP[buttonStyle ?? 'primary'];

const element = children as ReactElement;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,14 @@ const DatasourceEditor = AsyncEsmComponent(
);

const StyledDatasourceModal = styled(Modal)`
.modal-content {
&& .ant-modal-content {
height: 900px;
display: flex;
flex-direction: column;
align-items: stretch;
}

.modal-header {
flex: 0 1 auto;
}
.modal-body {
&& .ant-modal-body {
flex: 1 1 auto;
overflow: auto;
}

.modal-footer {
flex: 0 1 auto;
display: flex;
flex-direction: column;
}

.ant-tabs-top {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const FoldersContainer = styled.div`
display: flex;
flex-direction: column;
position: relative;
height: 70vh;
height: 100%;
gap: ${({ theme }) => theme.paddingMD}px;
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ interface OwnersSelectorProps {
}

const DatasourceContainer = styled.div`
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;

.change-warning {
margin: 16px 10px 0;
color: ${({ theme }) => theme.colorWarning};
Expand Down Expand Up @@ -347,9 +352,23 @@ const FlexRowContainer = styled.div`
`;

const StyledTableTabs = styled(Tabs)`
overflow: visible;
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;

.ant-tabs-content-holder {
overflow: visible;
flex: 1;
min-height: 0;
overflow: auto;
}

.ant-tabs-content {
height: 100%;
}

.ant-tabs-tabpane-active {
height: 100%;
}
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,6 @@ test('displays chart data correctly in table rows', async () => {
within(chartRow).getByText(testChart.changed_on_delta_humanized),
).toBeInTheDocument();

// Check actions column within the specific row
const actionsContainer = chartRow.querySelector('.actions');
expect(actionsContainer).toBeInTheDocument();

// Verify action buttons exist within the specific row
expect(within(chartRow).getByTestId('delete')).toBeInTheDocument();
expect(within(chartRow).getByTestId('upload')).toBeInTheDocument();
Expand Down
Loading
Loading