Merge master.
This commit is contained in:
commit
03a702e765
|
@ -1 +1 @@
|
|||
Subproject commit 7f388799c023c37b9e13663819f3ee402ade4adf
|
||||
Subproject commit 6465dc9c2a38e1380b32204cad4ae0c1f33e065a
|
|
@ -24,6 +24,13 @@
|
|||
navigationStore,
|
||||
} from "stores/builder"
|
||||
import { DefaultAppTheme } from "constants"
|
||||
import BarButtonList from "/src/components/design/settings/controls/BarButtonList.svelte"
|
||||
|
||||
$: alignmentOptions = [
|
||||
{ value: "Left", barIcon: "TextAlignLeft" },
|
||||
{ value: "Center", barIcon: "TextAlignCenter" },
|
||||
{ value: "Right", barIcon: "TextAlignRight" },
|
||||
]
|
||||
|
||||
$: screenRouteOptions = $screenStore.screens
|
||||
.map(screen => screen.routing?.route)
|
||||
|
@ -46,6 +53,10 @@
|
|||
notifications.error("Error updating navigation settings")
|
||||
}
|
||||
}
|
||||
|
||||
const updateTextAlign = textAlignValue => {
|
||||
navigationStore.syncAppNavigation({ textAlign: textAlignValue })
|
||||
}
|
||||
</script>
|
||||
|
||||
<Panel
|
||||
|
@ -133,6 +144,15 @@
|
|||
on:change={e => update("title", e.detail)}
|
||||
updateOnChange={false}
|
||||
/>
|
||||
|
||||
<div class="label">
|
||||
<Label size="M">Text align</Label>
|
||||
</div>
|
||||
<BarButtonList
|
||||
options={alignmentOptions}
|
||||
value={$navigationStore.textAlign}
|
||||
onChange={updateTextAlign}
|
||||
/>
|
||||
{/if}
|
||||
<div class="label">
|
||||
<Label>Background</Label>
|
||||
|
|
|
@ -11,6 +11,7 @@ export const INITIAL_NAVIGATION_STATE = {
|
|||
hideLogo: null,
|
||||
logoUrl: null,
|
||||
hideTitle: null,
|
||||
textAlign: "Left",
|
||||
navBackground: null,
|
||||
navWidth: null,
|
||||
navTextColor: null,
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
export let pageWidth
|
||||
export let logoLinkUrl
|
||||
export let openLogoLinkInNewTab
|
||||
export let textAlign
|
||||
|
||||
export let embedded = false
|
||||
|
||||
|
@ -226,7 +227,7 @@
|
|||
{/if}
|
||||
{/if}
|
||||
{#if !hideTitle && title}
|
||||
<Heading size="S">{title}</Heading>
|
||||
<Heading size="S" {textAlign}>{title}</Heading>
|
||||
{/if}
|
||||
</div>
|
||||
{#if !embedded}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 4f183993af024e5ddec1b90981fb9049a3c6c412
|
||||
Subproject commit 993b9f010f619b7f8b50c89105c645e3d874929e
|
|
@ -1,8 +1,5 @@
|
|||
module AirtableMock {
|
||||
const Airtable = () => {
|
||||
// @ts-ignore
|
||||
this.base = jest.fn()
|
||||
}
|
||||
|
||||
module.exports = Airtable
|
||||
class Airtable {
|
||||
base = jest.fn()
|
||||
}
|
||||
|
||||
module.exports = Airtable
|
||||
|
|
|
@ -1,25 +1,19 @@
|
|||
import fs from "fs"
|
||||
import { join } from "path"
|
||||
|
||||
module AwsMock {
|
||||
const aws: any = {}
|
||||
|
||||
const response = (body: any, extra?: any) => () => ({
|
||||
const response = (body: any, extra?: any) => () => ({
|
||||
promise: () => body,
|
||||
...extra,
|
||||
})
|
||||
})
|
||||
|
||||
const DocumentClient = () => {
|
||||
// @ts-ignore
|
||||
this.put = jest.fn(response({}))
|
||||
// @ts-ignore
|
||||
this.query = jest.fn(
|
||||
class DocumentClient {
|
||||
put = jest.fn(response({}))
|
||||
query = jest.fn(
|
||||
response({
|
||||
Items: [],
|
||||
})
|
||||
)
|
||||
// @ts-ignore
|
||||
this.scan = jest.fn(
|
||||
scan = jest.fn(
|
||||
response({
|
||||
Items: [
|
||||
{
|
||||
|
@ -28,57 +22,41 @@ module AwsMock {
|
|||
],
|
||||
})
|
||||
)
|
||||
// @ts-ignore
|
||||
this.get = jest.fn(response({}))
|
||||
// @ts-ignore
|
||||
this.update = jest.fn(response({}))
|
||||
// @ts-ignore
|
||||
this.delete = jest.fn(response({}))
|
||||
}
|
||||
get = jest.fn(response({}))
|
||||
update = jest.fn(response({}))
|
||||
delete = jest.fn(response({}))
|
||||
}
|
||||
|
||||
const S3 = () => {
|
||||
// @ts-ignore
|
||||
this.listObjects = jest.fn(
|
||||
class S3 {
|
||||
listObjects = jest.fn(
|
||||
response({
|
||||
Contents: [],
|
||||
})
|
||||
)
|
||||
|
||||
// @ts-ignore
|
||||
this.createBucket = jest.fn(
|
||||
createBucket = jest.fn(
|
||||
response({
|
||||
Contents: {},
|
||||
})
|
||||
)
|
||||
|
||||
// @ts-ignore
|
||||
this.deleteObjects = jest.fn(
|
||||
deleteObjects = jest.fn(
|
||||
response({
|
||||
Contents: {},
|
||||
})
|
||||
)
|
||||
|
||||
// @ts-ignore
|
||||
this.getSignedUrl = (operation, params) => {
|
||||
getSignedUrl = jest.fn((operation, params) => {
|
||||
return `http://example.com/${params.Bucket}/${params.Key}`
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
this.headBucket = jest.fn(
|
||||
})
|
||||
headBucket = jest.fn(
|
||||
response({
|
||||
Contents: {},
|
||||
})
|
||||
)
|
||||
|
||||
// @ts-ignore
|
||||
this.upload = jest.fn(
|
||||
upload = jest.fn(
|
||||
response({
|
||||
Contents: {},
|
||||
})
|
||||
)
|
||||
|
||||
// @ts-ignore
|
||||
this.getObject = jest.fn(
|
||||
getObject = jest.fn(
|
||||
response(
|
||||
{
|
||||
Body: "",
|
||||
|
@ -86,17 +64,18 @@ module AwsMock {
|
|||
{
|
||||
createReadStream: jest
|
||||
.fn()
|
||||
.mockReturnValue(
|
||||
fs.createReadStream(join(__dirname, "aws-sdk.ts"))
|
||||
),
|
||||
.mockReturnValue(fs.createReadStream(join(__dirname, "aws-sdk.ts"))),
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
aws.DynamoDB = { DocumentClient }
|
||||
aws.S3 = S3
|
||||
aws.config = { update: jest.fn() }
|
||||
|
||||
module.exports = aws
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
DynamoDB: {
|
||||
DocumentClient,
|
||||
},
|
||||
S3,
|
||||
config: {
|
||||
update: jest.fn(),
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,24 +1,17 @@
|
|||
module MsSqlMock {
|
||||
const mssql: any = {}
|
||||
|
||||
mssql.query = jest.fn(() => ({
|
||||
module.exports = {
|
||||
ConnectionPool: jest.fn(() => ({
|
||||
connect: jest.fn(() => ({
|
||||
request: jest.fn(() => ({
|
||||
query: jest.fn(sql => ({ recordset: [sql] })),
|
||||
})),
|
||||
})),
|
||||
})),
|
||||
query: jest.fn(() => ({
|
||||
recordset: [
|
||||
{
|
||||
a: "string",
|
||||
b: 1,
|
||||
},
|
||||
],
|
||||
}))
|
||||
|
||||
// mssql.connect = jest.fn(() => ({ recordset: [] }))
|
||||
|
||||
mssql.ConnectionPool = jest.fn(() => ({
|
||||
connect: jest.fn(() => ({
|
||||
request: jest.fn(() => ({
|
||||
query: jest.fn(sql => ({ recordset: [sql] })),
|
||||
})),
|
||||
})),
|
||||
}))
|
||||
|
||||
module.exports = mssql
|
||||
}
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
module MySQLMock {
|
||||
const mysql: any = {}
|
||||
|
||||
const client = {
|
||||
const client = {
|
||||
connect: jest.fn(),
|
||||
query: jest.fn((query, bindings, fn) => {
|
||||
fn(null, [])
|
||||
}),
|
||||
}
|
||||
|
||||
mysql.createConnection = jest.fn(() => client)
|
||||
|
||||
module.exports = mysql
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
createConnection: jest.fn(() => client),
|
||||
client,
|
||||
}
|
||||
|
|
|
@ -1,31 +1,21 @@
|
|||
module OracleDbMock {
|
||||
// mock execute
|
||||
const execute = jest.fn(() => ({
|
||||
const executeMock = jest.fn(() => ({
|
||||
rows: [
|
||||
{
|
||||
a: "string",
|
||||
b: 1,
|
||||
},
|
||||
],
|
||||
}))
|
||||
}))
|
||||
|
||||
const close = jest.fn()
|
||||
const closeMock = jest.fn()
|
||||
|
||||
// mock connection
|
||||
const Connection = () => {}
|
||||
Connection.prototype.execute = execute
|
||||
Connection.prototype.close = close
|
||||
|
||||
// mock oracledb
|
||||
const oracleDb: any = {}
|
||||
oracleDb.getConnection = jest.fn(() => {
|
||||
// @ts-ignore
|
||||
return new Connection()
|
||||
})
|
||||
|
||||
// expose mocks
|
||||
oracleDb.executeMock = execute
|
||||
oracleDb.closeMock = close
|
||||
|
||||
module.exports = oracleDb
|
||||
class Connection {
|
||||
execute = executeMock
|
||||
close = closeMock
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getConnection: jest.fn(() => new Connection()),
|
||||
executeMock,
|
||||
closeMock,
|
||||
}
|
||||
|
|
|
@ -1,29 +1,25 @@
|
|||
module PgMock {
|
||||
const pg: any = {}
|
||||
|
||||
const query = jest.fn(() => ({
|
||||
const query = jest.fn(() => ({
|
||||
rows: [
|
||||
{
|
||||
a: "string",
|
||||
b: 1,
|
||||
},
|
||||
],
|
||||
}))
|
||||
}))
|
||||
|
||||
// constructor
|
||||
const Client = () => {}
|
||||
Client.prototype.query = query
|
||||
Client.prototype.end = jest.fn(cb => {
|
||||
class Client {
|
||||
query = query
|
||||
end = jest.fn(cb => {
|
||||
if (cb) cb()
|
||||
})
|
||||
Client.prototype.connect = jest.fn()
|
||||
Client.prototype.release = jest.fn()
|
||||
|
||||
const on = jest.fn()
|
||||
|
||||
pg.Client = Client
|
||||
pg.queryMock = query
|
||||
pg.on = on
|
||||
|
||||
module.exports = pg
|
||||
connect = jest.fn()
|
||||
release = jest.fn()
|
||||
}
|
||||
|
||||
const on = jest.fn()
|
||||
|
||||
module.exports = {
|
||||
Client,
|
||||
queryMock: query,
|
||||
on,
|
||||
}
|
||||
|
|
|
@ -330,6 +330,7 @@ describe("/queries", () => {
|
|||
],
|
||||
},
|
||||
]
|
||||
|
||||
pg.queryMock.mockImplementation(() => ({
|
||||
rows,
|
||||
}))
|
||||
|
|
|
@ -294,7 +294,7 @@ describe("Captures of real examples", () => {
|
|||
type: "datasource",
|
||||
isSQL: false,
|
||||
})
|
||||
).toEqual(true)
|
||||
).toEqual(false)
|
||||
})
|
||||
|
||||
it("should disable when no fields", () => {
|
||||
|
|
Loading…
Reference in New Issue