Skip to content

Commit

Permalink
fix build errors?
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnuttandrew committed Aug 29, 2023
1 parent 1409a42 commit 3c5bd1e
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 18 deletions.
4 changes: 3 additions & 1 deletion src/components/encoding-column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ export default function EncodingColumn(props: EncodingColumnProps): JSX.Element
{editMode && template && (
<div className="flex">
<div className="flex full-width space-between">
{/* @ts-ignore */}
<IgnoreKeys style={{height: '100%'}}>
<AddLabelToWidget label={'Name'}>
<OnBlurInput
Expand All @@ -235,7 +236,7 @@ export default function EncodingColumn(props: EncodingColumnProps): JSX.Element
<AddLabelToWidget label={'Description'}>
<OnBlurInput
label="Template Description"
initialValue={template.templateDescription}
initialValue={template.templateDescription || ''}
update={(value): any =>
modifyValueOnTemplate({
value,
Expand Down Expand Up @@ -263,6 +264,7 @@ export default function EncodingColumn(props: EncodingColumnProps): JSX.Element
</AddLabelToWidget>
<AddLabelToWidget label={'Disallow Fan Out'}>
<span className="flex">
{/* @ts-ignore */}
<Switch
{...switchCommon}
checked={!!template.disallowFanOut}
Expand Down
2 changes: 2 additions & 0 deletions src/components/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function DateFilter({filter, updateFilter}: Props): JSX.Element {
} = filter;
return (
<div className="flex-down">
{/* @ts-ignore */}
<IgnoreKeys style={{height: '100%'}}>
<div className="flex">
<span>Start</span>
Expand All @@ -44,6 +45,7 @@ function MeasureFilter({filter, column, updateFilter}: Props): JSX.Element {
const {domain} = column;
return (
<div className="flex-down">
{/* @ts-ignore */}
<IgnoreKeys style={{height: '100%'}}>
<div className="grid">
<span className="grid-col-1">min</span>
Expand Down
7 changes: 4 additions & 3 deletions src/components/modals/data-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ interface Props {

export default function DataModal(props: Props): JSX.Element {
const {changeSelectedFile, loadCustomDataset, setModalState} = props;
const [searchTerm, setSearchTerm] = useState(null);
const [searchTerm, setSearchTerm] = useState<string | null>(null);
const [sortMode, setSortMode] = useState('FAVORITES');
const [favs, setFavs] = useState(new Set([]));
const [favs, setFavs] = useState<Set<string>>(new Set([]));
useEffect(() => {
getFavoriteDatasets().then((x) => {
const entries = x && x.length ? x : ['cars.json', 'penguins.json'];
Expand All @@ -35,7 +35,7 @@ export default function DataModal(props: Props): JSX.Element {
const file = acceptedFiles[0];
const reader = new FileReader();
reader.onload = (event): void => {
loadCustomDataset({fileName: file.name, data: event.target.result as any});
loadCustomDataset({fileName: file.name, data: event!.target?.result as any});
setModalState(null);
};

Expand All @@ -53,6 +53,7 @@ export default function DataModal(props: Props): JSX.Element {
<div className="flex space-between">
<h3>Predefined Datasets</h3>
<div>
{/* @ts-ignore */}
<IgnoreKeys style={{height: '100%'}}>
<input
type="text"
Expand Down
4 changes: 2 additions & 2 deletions src/components/monaco-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default class CodeEditor extends React.Component<Props, State> {
return oldMode !== newMode ? this.editor.getScrollTop() : null;
}

componentDidUpdate(prevProps: Props, prevState: State, currentTop: number): void {
componentDidUpdate(prevProps: Props, _: State, currentTop: number): void {
const oldMode = prevProps.codeMode;
const newMode = this.props.codeMode;
if (oldMode !== newMode) {
Expand All @@ -75,7 +75,7 @@ export default class CodeEditor extends React.Component<Props, State> {
setEditMode,
} = this.props;
return (
/*eslint-disable react/no-string-refs*/
// @ts-ignore
<IgnoreKeys style={{height: '100%'}}>
<MonacoEditor
key={codeMode}
Expand Down
1 change: 1 addition & 0 deletions src/components/prong-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function CodeEditor(props: Props) {
const {editMode, setEditMode, handleCodeUpdate, setCodeMode, codeMode, currentCode, height} = props;

return (
// @ts-ignore
<IgnoreKeys style={{height: '100%'}}>
<Editor
height={`${height}px`}
Expand Down
1 change: 1 addition & 0 deletions src/components/split-pane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {getHeight, writeHeight} from '../utils/local-storage';
export default function SplitPaneWrapper(props: any): JSX.Element {
if (props.showProgrammaticMode && props.showGUIView) {
return (
// @ts-ignore
<SplitPane
split="horizontal"
minSize={60}
Expand Down
2 changes: 1 addition & 1 deletion src/components/template-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function fullMatch(): JSX.Element {
export function countSymbol(symbol: string): JSX.Element {
return (
<div className="count-symbol">
{symbol.split('-').map((key, idx, arr) => {
{symbol.split('-').map((key, _, arr) => {
const circType = arr.length === 1 ? 'full' : arr.length === 2 ? 'half' : 'third';
return (
<div
Expand Down
1 change: 1 addition & 0 deletions src/components/view-controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function viewOption(props: ViewOptionProps): JSX.Element {
overlay={
<div>
<div>View Controls</div>
{/* @ts-ignore */}
<IgnoreKeys style={{height: '100%'}}>
<input
aria-label={`Set view name`}
Expand Down
2 changes: 2 additions & 0 deletions src/components/widgets/free-text-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function FreeTextWidgetConfiguration(props: GeneralWidget<FreeTextWidget>): JSX.
<EditParameterName widget={widget} idx={idx} setWidgetValue={setWidgetValue} />
<EditDisplayName widget={widget} idx={idx} setWidgetValue={setWidgetValue} />
<AddLabelToWidget label="use paragraph mode">
{/* @ts-ignore */}
<Switch
{...switchCommon}
checked={!!widget.config.useParagraph}
Expand All @@ -35,6 +36,7 @@ function FreeTextWidgetComponent(props: GeneralWidget<FreeTextWidget>): JSX.Elem
return (
<div className="flex free-text-widget">
<div className="widget-title">{widgetName(widget, editMode)}</div>
{/* @ts-ignore */}
<IgnoreKeys style={{height: '100%'}}>
{!widget.config.useParagraph && <input aria-label={`${widget.name} text box`} {...inputProps} />}
{widget.config.useParagraph && <textarea aria-label={`${widget.name} text box`} {...inputProps} />}
Expand Down
1 change: 1 addition & 0 deletions src/components/widgets/general-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ const GenericMaterializationMenu = (props: GenericMaterializationMenuProps): nul
return (
<div key={idx} className="flex space-between">
<span>{name}</span>
{/* @ts-ignore */}
<Switch
{...switchCommon}
checked={checked}
Expand Down
2 changes: 2 additions & 0 deletions src/components/widgets/list-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function optionRow(
</div>
<div className="flex">
<AddLabelToWidget label="Option Value">
{/* @ts-ignore */}
<IgnoreKeys style={{height: '100%'}}>
<input
aria-label={`allow value set`}
Expand All @@ -66,6 +67,7 @@ function optionRow(
</AddLabelToWidget>
{usingDisplayValueFormat && (
<AddLabelToWidget label="Option Display Name">
{/* @ts-ignore */}
<IgnoreKeys style={{height: '100%'}}>
<input
aria-label={`allow value set`}
Expand Down
4 changes: 2 additions & 2 deletions src/components/widgets/section-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import {SectionWidget, Widget} from '../../types';
import {GeneralWidget, WidgetBuilder} from './general-widget';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function SectionWidgetConfiguration(props: GeneralWidget<SectionWidget>): JSX.Element {
function SectionWidgetConfiguration(_: GeneralWidget<SectionWidget>): JSX.Element {
return <div />;
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function SectionWidgetComponent(props: GeneralWidget<SectionWidget>): JSX.Element {
function SectionWidgetComponent(_: GeneralWidget<SectionWidget>): JSX.Element {
return <div className="section-widget" />;
}

Expand Down
4 changes: 4 additions & 0 deletions src/components/widgets/switch-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function SwitchWidgetConfiguration(props: GeneralWidget<SwitchWidget>): JSX.Elem
</div>
<div className="flex">
<AddLabelToWidget label={'Default'}>
{/* @ts-ignore */}
<Switch
{...switchCommon}
checked={!!config.defaultsToActive}
Expand All @@ -28,6 +29,7 @@ function SwitchWidgetConfiguration(props: GeneralWidget<SwitchWidget>): JSX.Elem
/>
</AddLabelToWidget>
<AddLabelToWidget label={'Active Value'}>
{/* @ts-ignore */}
<IgnoreKeys style={{height: '100%'}}>
<input
aria-label={`Inactive value`}
Expand All @@ -38,6 +40,7 @@ function SwitchWidgetConfiguration(props: GeneralWidget<SwitchWidget>): JSX.Elem
</IgnoreKeys>
</AddLabelToWidget>
<AddLabelToWidget label={'Inactive Value'}>
{/* @ts-ignore */}
<IgnoreKeys style={{height: '100%'}}>
<input
aria-label={`Inactive value`}
Expand All @@ -62,6 +65,7 @@ function SwitchWidgetComponent(props: GeneralWidget<SwitchWidget>): JSX.Element
<div className="flex-down">
<div className="flex space-between">
<div className="widget-title">{widgetName(widget, editMode)}</div>
{/* @ts-ignore */}
<Switch
{...switchCommon}
checked={isActive}
Expand Down
2 changes: 2 additions & 0 deletions src/components/widgets/widget-common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function EditParameterName(props: EditParameterNameProps): JSX.Element {
const {widget, setWidgetValue, idx} = props;
return (
<AddLabelToWidget label={'Parameter Name'}>
{/* @ts-ignore */}
<IgnoreKeys style={{height: '100%'}}>
<input
aria-label={`Parameter name`}
Expand All @@ -35,6 +36,7 @@ export function EditDisplayName(props: EditDisplayNameProps): JSX.Element {
const {widget, setWidgetValue, idx} = props;
return (
<AddLabelToWidget label={'Display Name'}>
{/* @ts-ignore */}
<IgnoreKeys style={{height: '100%'}}>
<input
aria-label={`Display name`}
Expand Down
1 change: 1 addition & 0 deletions src/components/widgets/widget-configuration-controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function ConditionBuilder(props: ConditionBuilderProps): JSX.Element {
/>
</AddLabelToWidget>
<AddLabelToWidget label="Query">
{/* @ts-ignore */}
<IgnoreKeys style={{height: '100%'}}>
<OnBlurInput
initialValue={condition.query}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/chart-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function materializeWrapper(props: MaterializeWrapperProps): JSX.Element {
const keySet = Object.entries(templateMap.systemValues.viewsToMaterialize)
.filter((d) => d[1].length)
.reduce((acc, d: [string, string[]]) => acc.add(d[0]), new Set());
function removeButton(name: string, key: string, value: string): JSX.Element {
function removeButton(_: string, key: string, value: string): JSX.Element {
return (
<div
className="cursor-pointer"
Expand Down
3 changes: 2 additions & 1 deletion src/containers/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function maybeAdjustTemplateInstanceFromParams(
const fullHref = window.location.href;
const suburl = `${templateAuthor}/${templateName}/${templateInstance}`.trim();
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [left, right] = fullHref.split(suburl);
const [_, right] = fullHref.split(suburl);
if (right && right.length) {
return `${templateInstance.trim()}${right}`;
} else {
Expand Down Expand Up @@ -158,6 +158,7 @@ function EditorContainer(props: RootProps): JSX.Element {
/>
<div className="flex main-content-container relative">
<DndProvider backend={HTML5Backend}>
{/* @ts-ignore */}
<SplitPane
split="vertical"
minSize={610}
Expand Down
1 change: 1 addition & 0 deletions src/containers/hot-key-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function HotKeyProvider(props: RootProps): JSX.Element {
func();
};
return (
// @ts-ignore
<GlobalHotKeys
keyMap={{...HOT_KEYS, USER_PANEL: 'u+p'}}
handlers={{
Expand Down
2 changes: 1 addition & 1 deletion src/languages/sample-language.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const BLANK_TEMPLATE: Template = {
};

// eslint-disable-next-line
function ExampleRenderer(props: RendererProps): JSX.Element {
function ExampleRenderer(_: RendererProps): JSX.Element {
// const {spec, data, onError} = props;
return <div />;
}
Expand Down
2 changes: 1 addition & 1 deletion src/languages/vega.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {LanguageExtension} from '../types';
import * as stringify from 'json-stringify-pretty-compact';
import * as x from 'vega-projection-extended';
// necessary footwork to force the projections to be imported
// eslint-disable-next-line
// @ts-ignore
const yx = x;

import React from 'react';
Expand Down
3 changes: 3 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export default defineConfig({
},
assetsInclude: ['**/*.md'],
plugins: [react()],
build: {
minify: false
},
define: {
// By default, Vite doesn't include shims for NodeJS/
// necessary for segment analytics lib to work
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6133,11 +6133,6 @@ dom-to-image-more@^3.1.6:
resolved "https://registry.yarnpkg.com/dom-to-image-more/-/dom-to-image-more-3.1.6.tgz#a8afd83fe90fac72d72159f2fe618c8a45281cde"
integrity sha512-VMO0jNme32T06mWtkOC9QXfj+1npoJxkaTFW0DCwBLguwBKMjqwndiDANxDnbZ0kvNEecwxkv0Zmgdr96cGtAA==

dom-to-image@^2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/dom-to-image/-/dom-to-image-2.6.0.tgz#8a503608088c87b1c22f9034ae032e1898955867"
integrity sha512-Dt0QdaHmLpjURjU7Tnu3AgYSF2LuOmksSGsUcE6ItvJoCWTBEmiMXcqBdNSAm9+QbbwD7JMoVsuuKX6ZVQv1qA==

[email protected], dot-prop@^7.0.0, dot-prop@^7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-7.2.0.tgz#468172a3529779814d21a779c1ba2f6d76609809"
Expand Down

0 comments on commit 3c5bd1e

Please sign in to comment.