Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into wip/jtulach/Gc10211
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Jul 26, 2024
2 parents d96d615 + 340b22b commit 7566561
Show file tree
Hide file tree
Showing 434 changed files with 12,326 additions and 11,785 deletions.
6 changes: 4 additions & 2 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# .git-blame-ignore-revs
# Fix prettier config; run prettier
0aa7d7ee4d969ec8e8f9d376e72741dca324fdf6
# Update code style to use rust fmt (#3131)
c822256e6c531e56e894f9f92654654f63cfd6bc
# Fix prettier config; run prettier (#6132)
0aa7d7ee4d969ec8e8f9d376e72741dca324fdf6
# Change dashboard to use 2 spaces for indentation (#8798)
5f1333a519235b27fc04457de1fd07b1a0128073
# Consistent Prettier options (#10648)
c46262dfb5777fd17c246e1b39ec7039778a63a2
9 changes: 6 additions & 3 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ overrides:
- "*.m[j|t]s"
- "*.c[j|t]s"
options:
printWidth: 100
tabWidth: 4
plugins: ["prettier-plugin-organize-imports"]
semi: false
tabWidth: 2
singleQuote: true
trailingComma: "es5"
printWidth: 100
trailingComma: "all"
arrowParens: "avoid"
organizeImportsSkipDestructiveCodeActions: true
experimentalTernaries: true

- files: "*.md"
options:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
- [Warning messages do not obscure visualization buttons][10546].
- [Output component in collapsed function changed][10577]. It cannot be deleted
anymore, except by directily editing the code.
- [Improved handling of spacing around rounded node widgets][10599], added
support for widgets of arbitrary sizes.
- [Multiselect drop-down widget visuals are improved][10607].
- [Text displayed in monospace and whitespace rendered as symbols][10563].

Expand All @@ -28,6 +30,7 @@
[10509]: https://github.com/enso-org/enso/pull/10509
[10546]: https://github.com/enso-org/enso/pull/10546
[10577]: https://github.com/enso-org/enso/pull/10577
[10599]: https://github.com/enso-org/enso/pull/10599
[10607]: https://github.com/enso-org/enso/pull/10607
[10563]: https://github.com/enso-org/enso/pull/10563

Expand All @@ -43,13 +46,16 @@
- [Compare two objects with `Ordering.compare` and define comparator with
`Comparable.new`][10468]
- [Added `dec` construction function for creating `Decimal`s.][10517]
- [Implemented in-memory and database mixed `Decimal` column
comparisons.][10614]

[10434]: https://github.com/enso-org/enso/pull/10434
[10445]: https://github.com/enso-org/enso/pull/10445
[10466]: https://github.com/enso-org/enso/pull/10466
[10467]: https://github.com/enso-org/enso/pull/10467
[10474]: https://github.com/enso-org/enso/pull/10474
[10517]: https://github.com/enso-org/enso/pull/10517
[10614]: https://github.com/enso-org/enso/pull/10614

# Enso 2024.2

Expand Down
1 change: 1 addition & 0 deletions app/dashboard/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
playwright-report/
playwright/.cache/
test-results/
dist/
63 changes: 0 additions & 63 deletions app/dashboard/.prettierrc.cjs

This file was deleted.

11 changes: 11 additions & 0 deletions app/dashboard/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-tailwindcss"],
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "all",
"organizeImportsSkipDestructiveCodeActions": true,
"experimentalTernaries": true
}
4 changes: 1 addition & 3 deletions app/dashboard/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
<div id="enso-dashboard" class="enso-dashboard"></div>
<div id="enso-chat" class="enso-chat"></div>
<div id="enso-portal-root" class="enso-portal-root"></div>
<noscript>
This page requires JavaScript to run. Please enable it in your browser.
</noscript>
<noscript> This page requires JavaScript to run. Please enable it in your browser. </noscript>
</body>
</html>
14 changes: 7 additions & 7 deletions app/dashboard/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PROD=1 npm run test:e2e:debug -- e2e/file-name-here.spec.ts
## Getting started

```ts
test.test("test name here", ({ page }) =>
test.test('test name here', ({ page }) =>
actions.mockAllAndLogin({ page }).then(
// ONLY chain methods from `pageActions`.
// Using methods not in `pageActions` is UNDEFINED BEHAVIOR.
Expand All @@ -34,20 +34,20 @@ test.test("test name here", ({ page }) =>
// not `Promise`s, which causes Playwright to output a type error.
async ({ pageActions }) => await pageActions.goTo.drive(),
),
);
)
```

### Perform arbitrary actions (e.g. actions on the API)

```ts
test.test("test name here", ({ page }) =>
test.test('test name here', ({ page }) =>
actions.mockAllAndLogin({ page }).then(
async ({ pageActions, api }) =>
await pageActions.do(() => {
api.foo();
api.bar();
test.expect(api.baz()?.quux).toEqual("bar");
api.foo()
api.bar()
test.expect(api.baz()?.quux).toEqual('bar')
}),
),
);
)
```
20 changes: 10 additions & 10 deletions app/dashboard/e2e/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ export namespace settings {
* DO NOT assume the left side of the outer container will change. This means that it is NOT SAFE
* to do anything with the returned values other than comparing them. */
export function getAssetRowLeftPx(locator: test.Locator) {
return locator.evaluate(el => el.children[0]?.children[0]?.getBoundingClientRect().left ?? 0)
return locator.evaluate((el) => el.children[0]?.children[0]?.getBoundingClientRect().left ?? 0)
}

// ===================================
Expand All @@ -644,7 +644,7 @@ export async function expectOpacity0(locator: test.Locator) {
await test.test.step('Expect `opacity: 0`', async () => {
await test
.expect(async () => {
test.expect(await locator.evaluate(el => getComputedStyle(el).opacity)).toBe('0')
test.expect(await locator.evaluate((el) => getComputedStyle(el).opacity)).toBe('0')
})
.toPass()
})
Expand All @@ -655,7 +655,7 @@ export async function expectNotOpacity0(locator: test.Locator) {
await test.test.step('Expect not `opacity: 0`', async () => {
await test
.expect(async () => {
test.expect(await locator.evaluate(el => getComputedStyle(el).opacity)).not.toBe('0')
test.expect(await locator.evaluate((el) => getComputedStyle(el).opacity)).not.toBe('0')
})
.toPass()
})
Expand All @@ -667,13 +667,13 @@ export async function expectOnScreen(locator: test.Locator) {
await test
.expect(async () => {
const pageBounds = await locator.evaluate(() => document.body.getBoundingClientRect())
const bounds = await locator.evaluate(el => el.getBoundingClientRect())
const bounds = await locator.evaluate((el) => el.getBoundingClientRect())
test
.expect(
bounds.left < pageBounds.right &&
bounds.right > pageBounds.left &&
bounds.top < pageBounds.bottom &&
bounds.bottom > pageBounds.top
bounds.bottom > pageBounds.top,
)
.toBe(true)
})
Expand All @@ -687,13 +687,13 @@ export async function expectNotOnScreen(locator: test.Locator) {
await test
.expect(async () => {
const pageBounds = await locator.evaluate(() => document.body.getBoundingClientRect())
const bounds = await locator.evaluate(el => el.getBoundingClientRect())
const bounds = await locator.evaluate((el) => el.getBoundingClientRect())
test
.expect(
bounds.left >= pageBounds.right ||
bounds.right <= pageBounds.left ||
bounds.top >= pageBounds.bottom ||
bounds.bottom <= pageBounds.top
bounds.bottom <= pageBounds.top,
)
.toBe(true)
})
Expand Down Expand Up @@ -773,7 +773,7 @@ export async function login(
{ page, setupAPI }: MockParams,
email = '[email protected]',
password = VALID_PASSWORD,
first = true
first = true,
) {
await test.test.step('Login', async () => {
await page.goto('/')
Expand Down Expand Up @@ -812,7 +812,7 @@ export async function reload({ page }: MockParams) {
export async function relog(
{ page, setupAPI }: MockParams,
email = '[email protected]',
password = VALID_PASSWORD
password = VALID_PASSWORD,
) {
await test.test.step('Relog', async () => {
await page.getByAltText('User Settings').locator('visible=true').click()
Expand Down Expand Up @@ -901,7 +901,7 @@ export function mockAllAndLogin({ page, setupAPI }: MockParams) {
await mockApi({ page, setupAPI })
await mockDate({ page, setupAPI })
})
.do(thePage => login({ page: thePage, setupAPI }))
.do((thePage) => login({ page: thePage, setupAPI }))
}

// ===================================
Expand Down
18 changes: 9 additions & 9 deletions app/dashboard/e2e/actions/BaseActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class BaseActions implements Promise<void> {
/** Create a {@link BaseActions}. */
constructor(
protected readonly page: test.Page,
private readonly promise = Promise.resolve()
private readonly promise = Promise.resolve(),
) {}

/** Get the string name of the class of this instance. Required for this class to implement
Expand Down Expand Up @@ -71,7 +71,7 @@ export default class BaseActions implements Promise<void> {
// eslint-disable-next-line no-restricted-syntax
onfulfilled?: (() => PromiseLike<T> | T) | null | undefined,
// eslint-disable-next-line no-restricted-syntax
onrejected?: ((reason: unknown) => E | PromiseLike<E>) | null | undefined
onrejected?: ((reason: unknown) => E | PromiseLike<E>) | null | undefined,
) {
return await this.promise.then(onfulfilled, onrejected)
}
Expand Down Expand Up @@ -109,7 +109,7 @@ export default class BaseActions implements Promise<void> {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return new this.constructor(
this.page,
this.then(() => callback(this.page))
this.then(() => callback(this.page)),
)
}

Expand All @@ -121,18 +121,18 @@ export default class BaseActions implements Promise<void> {
/** Press a key, replacing the text `Mod` with `Meta` (`Cmd`) on macOS, and `Control`
* on all other platforms. */
press<Key extends string>(keyOrShortcut: inputBindings.AutocompleteKeybind<Key>) {
return this.do(page => BaseActions.press(page, keyOrShortcut))
return this.do((page) => BaseActions.press(page, keyOrShortcut))
}

/** Perform actions until a predicate passes. */
retry(
callback: (actions: this) => this,
predicate: (page: test.Page) => Promise<boolean>,
options: { retries?: number; delay?: number } = {}
options: { retries?: number; delay?: number } = {},
) {
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
const { retries = 3, delay = 1_000 } = options
return this.step('Perform actions with retries', async thePage => {
return this.step('Perform actions with retries', async (thePage) => {
for (let i = 0; i < retries; i += 1) {
await callback(this)
if (await predicate(thePage)) {
Expand All @@ -148,10 +148,10 @@ export default class BaseActions implements Promise<void> {
/** Perform actions with the "Mod" modifier key pressed. */
withModPressed<R extends BaseActions>(callback: (actions: this) => R) {
return callback(
this.step('Press "Mod"', async page => {
this.step('Press "Mod"', async (page) => {
await page.keyboard.down(await actions.modModifier(page))
})
).step('Release "Mod"', async page => {
}),
).step('Release "Mod"', async (page) => {
await page.keyboard.up(await actions.modModifier(page))
})
}
Expand Down
Loading

0 comments on commit 7566561

Please sign in to comment.