This commit is contained in:
Martin McKeaveney 2022-01-19 12:42:11 +01:00
parent 3d5a3e7902
commit c25c88ae58
3 changed files with 23 additions and 20 deletions

View File

@ -430,13 +430,14 @@ Cypress.Commands.add("addDatasourceConfig", (datasource, skipFetch) => {
// Click to fetch tables
if (skipFetch) {
cy.get(".spectrum-Dialog-grid").within(() => {
cy.get(".spectrum-Button").contains("Skip table fetch")
cy.get(".spectrum-Button")
.contains("Skip table fetch")
.click({ force: true })
})
}
else {
} else {
cy.get(".spectrum-Dialog-grid").within(() => {
cy.get(".spectrum-Button").contains("Save and fetch tables")
cy.get(".spectrum-Button")
.contains("Save and fetch tables")
.click({ force: true })
cy.wait(1000)
})

View File

@ -1,12 +1,13 @@
// eslint-disable-next-line
const breweries = data
const totals = {}
for (let brewery of breweries)
{const state = brewery.state
if (totals[state] == null)
{totals[state] = 1
} else
{totals[state]++
for (let brewery of breweries) {
const state = brewery.state
if (totals[state] == null) {
totals[state] = 1
} else {
totals[state]++
}
}
const entries = Object.entries(totals)

View File

@ -1,15 +1,16 @@
// eslint-disable-next-line
const breweries = data
const totals = {}
for (let brewery of breweries)
{const state = brewery.state
if (totals[state] == null)
{totals[state] = 1
} else
{totals[state]++
for (let brewery of breweries) {
const state = brewery.state
if (totals[state] == null) {
totals[state] = 1
} else {
totals[state]++
}
}
const stateCodes =
{texas: "tx",
const stateCodes = {
texas: "tx",
colorado: "co",
florida: "fl",
iwoa: "ia",
@ -24,7 +25,7 @@ const stateCodes =
ohio: "oh",
}
const entries = Object.entries(totals)
return entries.map(([state, count]) =>
{stateCodes[state.toLowerCase()]
return entries.map(([state, count]) => {
stateCodes[state.toLowerCase()]
return { state, count, flag: "http://flags.ox3.in/svg/us/${stateCode}.svg" }
})