Skip to content

Commit

Permalink
Format and add fake tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eatonphil committed Jun 28, 2023
1 parent daaa838 commit 0d95f80
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 24 deletions.
4 changes: 2 additions & 2 deletions desktop/crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class GenericCrud<T extends { id: string }> {
this.entity
}" WHERE id = ${stubMaker()}`
);
const row = stmt.get(id) as { data_json: string, position: number };
const row = stmt.get(id) as { data_json: string; position: number };
if (!row) {
return [null, -1];
}
Expand Down Expand Up @@ -130,7 +130,7 @@ export const exportDestination = {};
export const metadataCrud = {
get(db: sqlite3.Database) {
const stmt = db.prepare('SELECT * FROM ds_metadata');
const rows = stmt.all() as Array<{key: string; value: string}>;
const rows = stmt.all() as Array<{ key: string; value: string }>;
const metadata: Record<string, string> = {};
for (const row of rows) {
metadata[row.key] = row.value;
Expand Down
7 changes: 5 additions & 2 deletions desktop/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class Store {
validateSQLiteDriver() {
const memdb = new sqlite3.default(':memory:');
const stmt = memdb.prepare('SELECT sqlite_version() AS version');
const row = stmt.get() as {version: string};
const row = stmt.get() as { version: string };
if (!minSemver(row.version, '3.38.1')) {
throw new Error(
'Unsupported SQLite driver version: ' + JSON.stringify(row)
Expand Down Expand Up @@ -361,7 +361,10 @@ SELECT
FROM ds_result o
GROUP BY panel_id
`);
const results = stmt.all() as Array<{panel_id: string; data_json: string}>;
const results = stmt.all() as Array<{
panel_id: string;
data_json: string;
}>;

const resultPanelMap: Record<string, PanelResult> = {};
for (const result of results) {
Expand Down
2 changes: 2 additions & 0 deletions integration/mongo.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,6 @@ if (false) {
}
);
});
} else {
test('ok', function() {});
}
2 changes: 2 additions & 0 deletions integration/oracle.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,6 @@ if (false) {
DEFAULT_TIMEOUT * 10
);
});
} else {
test('ok', function() {});
}
2 changes: 2 additions & 0 deletions integration/sqlserver.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,6 @@ if (false) {
);
}
});
} else {
test('ok', function() {});
}
5 changes: 3 additions & 2 deletions ui/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ export function Navigation<View extends string = DefaultView>({
{pages.map((page) => (
<div
key={page.title}
className={`navigation-item ${view === page.endpoint ? 'navigation-item--active' : ''
}`}
className={`navigation-item ${
view === page.endpoint ? 'navigation-item--active' : ''
}`}
title={page.title}
>
<Button
Expand Down
12 changes: 6 additions & 6 deletions ui/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (MODE === 'browser') {
Object.values(LANGUAGES).map(function processLanguageInit(l) {
if (l.inMemoryInit) {
// These can be really big, so run it out of band
setTimeout(function() {
setTimeout(function () {
l.inMemoryInit();
});
}
Expand Down Expand Up @@ -84,11 +84,11 @@ export function defaultRoutes(): Routes {
},
MODE === 'server'
? {
endpoint: 'projects',
view: MakeSelectProject,
title: 'Switch project',
icon: IconFiles,
}
endpoint: 'projects',
view: MakeSelectProject,
title: 'Switch project',
icon: IconFiles,
}
: null,
{
endpoint: 'settings',
Expand Down
27 changes: 15 additions & 12 deletions ui/panels/ProgramPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -656,12 +656,12 @@ export function builtinCompletions(
...(language === 'sql'
? []
: [
{
value: 'DM_setPanel(result)',
meta: 'Set results of this DataStation panel',
score: 1000,
},
]),
{
value: 'DM_setPanel(result)',
meta: 'Set results of this DataStation panel',
score: 1000,
},
]),
];
}

Expand All @@ -683,11 +683,11 @@ export function panelNameCompletions(
) {
return panels.map(
(panel) =>
({
value: panel.name,
meta: 'Panel',
score: 1000,
} as Ace.Completion)
({
value: panel.name,
meta: 'Panel',
score: 1000,
} as Ace.Completion)
);
}

Expand Down Expand Up @@ -771,7 +771,10 @@ export function makeAutocomplete(
.flat()
.filter(
// TODO: Make sure autocomplete is still working.
(c) => c && (c as any).value && (c as any).value.toLowerCase().startsWith(prefix.toLowerCase())
(c) =>
c &&
(c as any).value &&
(c as any).value.toLowerCase().startsWith(prefix.toLowerCase())
);
};
}
Expand Down

0 comments on commit 0d95f80

Please sign in to comment.