Skip to content

Commit

Permalink
Hit frontend code with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Jan 20, 2025
1 parent 392e0fd commit e0eb2ed
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ class TabbedSqlEditors extends PureComponent<TabbedSqlEditorsProps> {
this.newQueryEditor();

if (isNewQuery) {
window.history.replaceState({}, document.title, ensureBasePath(SQL_LAB_URL));
window.history.replaceState(
{},
document.title,
ensureBasePath(SQL_LAB_URL),
);
}
} else {
const qe = this.activeQueryEditor();
Expand Down
4 changes: 2 additions & 2 deletions superset-frontend/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ export const SLOW_DEBOUNCE = 500;
export const NULL_DISPLAY = t('N/A');

export const DEFAULT_COMMON_BOOTSTRAP_DATA: CommonBootstrapData = {
application_root: "/",
static_assets_prefix: "",
application_root: '/',
static_assets_prefix: '',
flash_messages: [],
conf: {},
locale: 'en',
Expand Down
8 changes: 5 additions & 3 deletions superset-frontend/src/dashboard/components/SliceAdder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const Controls = styled.div`
`}
`;

const StyledSelect = styled(Select) <{ id?: string }>`
const StyledSelect = styled(Select)<{ id?: string }>`
margin-left: ${({ theme }) => theme.gridUnit * 2}px;
min-width: 150px;
`;
Expand Down Expand Up @@ -233,7 +233,7 @@ class SliceAdder extends Component<SliceAdderProps, SliceAdderState> {
.filter(slice =>
showOnlyMyCharts
? slice?.owners?.find(owner => owner.id === this.props.userId) ||
slice?.created_by?.id === this.props.userId
slice?.created_by?.id === this.props.userId
: true,
)
.filter(createFilter(searchTerm, KEYS_TO_FILTERS))
Expand Down Expand Up @@ -361,7 +361,9 @@ class SliceAdder extends Component<SliceAdderProps, SliceAdderState> {
buttonSize="xsmall"
onClick={() =>
window.open(
ensureBasePath(`/chart/add?dashboard_id=${this.props.dashboardId}`),
ensureBasePath(
`/chart/add?dashboard_id=${this.props.dashboardId}`,
),
'_blank',
'noopener noreferrer',
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const FilterBar: FC<FiltersBarProps> = ({
// filterState.value === undefined - means that value not initialized
dataMask.filterState?.value !== undefined &&
dataMaskSelectedRef.current[filter.id]?.filterState?.value ===
undefined &&
undefined &&
filter.requiredFirst
) {
dispatch(updateDataMask(filter.id, dataMask));
Expand Down
4 changes: 3 additions & 1 deletion superset-frontend/src/features/home/RightMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,9 @@ const RightMenu = ({
{isFrontendRoute(child.url) ? (
<Link to={child.url || ''}>{menuItemDisplay}</Link>
) : (
<a href={ensureBasePath(child.url || '')}>{menuItemDisplay}</a>
<a href={ensureBasePath(child.url || '')}>
{menuItemDisplay}
</a>
)}
</Menu.Item>
);
Expand Down
6 changes: 4 additions & 2 deletions superset-frontend/src/features/home/SavedQueries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const QueryContainer = styled.div`
height: ${({ theme }) => theme.gridUnit * 40}px;
border: none !important;
background-color: ${({ theme }) =>
theme.colors.grayscale.light5} !important;
theme.colors.grayscale.light5} !important;
overflow: hidden;
padding: ${({ theme }) => theme.gridUnit * 4}px !important;
}
Expand Down Expand Up @@ -279,7 +279,9 @@ const SavedQueries = ({
imgURL=""
url={ensureBasePath(`/sqllab?savedQueryId=${q.id}`)}
title={q.label}
imgFallbackURL={assetUrl("/static/assets/images/empty-query.svg")}
imgFallbackURL={assetUrl(
'/static/assets/images/empty-query.svg',
)}
description={t('Modified %s', q.changed_on_delta_humanized)}
cover={
q?.sql?.length && showThumbnails && featureFlag ? (
Expand Down
1 change: 0 additions & 1 deletion superset-frontend/src/utils/assetUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import getBootstrapData from 'src/utils/getBootstrapData';
// eslint-disable-next-line import/no-mutable-exports
const BOOTSTRAP_DATA = getBootstrapData();


/**
* Takes a string path to a static asset and prefixes it with the defined static asset prefix
* defined in the bootstrap data
Expand Down
6 changes: 3 additions & 3 deletions superset-frontend/src/utils/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export default function handleResourceExport(
interval = 200,
): void {
const token = nanoid();
const url = ensureBasePath(`/api/v1/${resource}/export/?q=${rison.encode(
ids,
)}&token=${token}`);
const url = ensureBasePath(
`/api/v1/${resource}/export/?q=${rison.encode(ids)}&token=${token}`,
);

// create new iframe for export
const iframe = document.createElement('iframe');
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/utils/pathUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const APPLICATION_ROOT = getBootstrapData().common.application_root;
/**
* @returns The configured application root
*/
export function applicationRoot() : string {
export function applicationRoot(): string {
return APPLICATION_ROOT;
}

Expand Down
4 changes: 1 addition & 3 deletions superset-frontend/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ const plugins = [
const entryFiles = {};
Object.entries(entrypoints).forEach(([entry, chunks]) => {
entryFiles[entry] = {
css: chunks
.filter(x => x.endsWith('.css'))
.map(x => `${x}`),
css: chunks.filter(x => x.endsWith('.css')).map(x => `${x}`),
js: chunks
.filter(x => x.endsWith('.js') && x.match(/(?<!hot-update).js$/))
.map(x => `${x}`),
Expand Down

0 comments on commit e0eb2ed

Please sign in to comment.