-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from sebjulliand/fix/exampleLoadLoop
Examples browser cleanup
- Loading branch information
Showing
4 changed files
with
80 additions
and
70 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import { SQLExample } from "../views/examples"; | ||
import { JobManager } from "../config"; | ||
import { SQLExample } from "../views/examples"; | ||
import Statement from "./statement"; | ||
|
||
export async function getServiceInfo(): Promise<SQLExample[]|undefined> { | ||
export async function getServiceInfo(): Promise<SQLExample[]> { | ||
// The reason we check for a selection is because we don't want it to prompt the user to start one here | ||
if (JobManager.getSelection()) { | ||
const resultSet = await JobManager.runSQL<{SERVICE_NAME: string, EXAMPLE: string}>(`select SERVICE_NAME, EXAMPLE from qsys2.services_info`); | ||
const resultSet = await JobManager.runSQL<{ SERVICE_NAME: string, EXAMPLE: string }>(`select SERVICE_NAME, EXAMPLE from qsys2.services_info`); | ||
|
||
return resultSet.map(r => ({ | ||
name: Statement.prettyName(r.SERVICE_NAME), | ||
content: [r.EXAMPLE], | ||
})) | ||
} else { | ||
return undefined; | ||
return [{ name: "Please start an SQL job to load the examples", 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
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