2024-03-18 11:47:01 +03:00
|
|
|
/** @file Test the drive view. */
|
|
|
|
import * as test from '@playwright/test'
|
|
|
|
|
|
|
|
import * as actions from './actions'
|
|
|
|
|
2024-06-19 18:24:11 +03:00
|
|
|
const PASS_TIMEOUT = 5_000
|
|
|
|
|
2024-07-16 12:55:45 +03:00
|
|
|
test.test('extra columns should stick to right side of assets table', ({ page }) =>
|
|
|
|
actions
|
|
|
|
.mockAllAndLogin({ page })
|
|
|
|
.withAssetsTable(async (table) => {
|
|
|
|
await table.evaluate((element) => {
|
|
|
|
let scrollableParent: HTMLElement | SVGElement | null = element
|
|
|
|
while (
|
|
|
|
scrollableParent != null &&
|
|
|
|
scrollableParent.scrollWidth <= scrollableParent.clientWidth
|
|
|
|
) {
|
|
|
|
scrollableParent = scrollableParent.parentElement
|
|
|
|
}
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
|
|
scrollableParent?.scrollTo({ left: 999999, behavior: 'instant' })
|
|
|
|
})
|
2024-03-18 11:47:01 +03:00
|
|
|
})
|
2024-07-16 12:55:45 +03:00
|
|
|
.do(async (thePage) => {
|
|
|
|
const extraColumns = actions.locateExtraColumns(thePage)
|
|
|
|
const assetsTable = actions.locateAssetsTable(thePage)
|
|
|
|
await test
|
|
|
|
.expect(async () => {
|
|
|
|
const extraColumnsRight = await extraColumns.evaluate(
|
|
|
|
(element) => element.getBoundingClientRect().right,
|
|
|
|
)
|
|
|
|
const assetsTableRight = await assetsTable.evaluate(
|
|
|
|
(element) => element.getBoundingClientRect().right,
|
|
|
|
)
|
|
|
|
test.expect(extraColumnsRight).toEqual(assetsTableRight)
|
|
|
|
})
|
|
|
|
.toPass({ timeout: PASS_TIMEOUT })
|
|
|
|
}),
|
|
|
|
)
|
2024-03-18 11:47:01 +03:00
|
|
|
|
|
|
|
test.test('extra columns should stick to top of scroll container', async ({ page }) => {
|
2024-07-16 12:55:45 +03:00
|
|
|
await actions.mockAllAndLogin({
|
|
|
|
page,
|
|
|
|
setupAPI: (api) => {
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
|
|
for (let i = 0; i < 100; i += 1) {
|
|
|
|
api.addFile('a')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
})
|
2024-03-18 11:47:01 +03:00
|
|
|
|
|
|
|
await actions.locateAssetsTable(page).evaluate((element) => {
|
|
|
|
let scrollableParent: HTMLElement | SVGElement | null = element
|
|
|
|
while (
|
|
|
|
scrollableParent != null &&
|
Dashboard improvements (from 24 September 2024 + 30 September 2024) (#11219)
- Close https://github.com/enso-org/cloud-v2/issues/1508
- :warning: Labels modal - add selection indicator where user can (de)select multiple labels
- Checkboxes currently still cause the dialog to (incorrectly) close
- Edit datalink -> select enso secret -> options are too narrow for enso path. Strip enso://Users(Teams), if possible make the options list longer on the left side
- Added (or rather, re-enabled via CSS) horizontal scroll instead
- Make Versions, Sessions, Settings as tabs similar to documentation panel in graph editor
- Edit description in context menu should open asset panel with description input active
- Edit secret should be moved to asset panel (same like datalink)
- Dim background when "edit description", "edit secret", or "edit datalink" are clicked/triggered via shortcut to highlight input
- Hide unused (= no backend support) columns and icons: accessed by projects and accessed data
- *Partial* frontend fixes for https://github.com/enso-org/cloud-v2/issues/1529
- (1) Fix settings title being horizontally centered and split on multiple lines
- (2) :x: backend issue
- (3) :x: out of scope
- (4) :x: backend issue
- (5) :x: out of scope
- (6) :x: out of scope
- (7) :x: backend issue
- (8) :x: already fixed in #11126
- (9) :x: out of scope (potentially requires a way to trigger a tooltip on a disabled button)
- (10) :x: out of scope
- (11) :x: out of scope
- (12) :x: out of scope
- (13) URL encode `enso://` URLs in "copy as path"
- (14) Double click on datalink make asset open and close (not sure if this has already been fixed)
- (15) Clicking anywhere on Asset Panel no longer deselects assets (not sure if this has already been fixed)
- (16) :x: addressed in #11268
- (17) Make list of labels in Asset Panel (right sidebar) horizontal instead of (incorrectly) vertical
- (18) Only show "Billing" settings tab for organization admins
- Use "workspace" instead of "network" icon for project tabs
- Other fixes:
- Fix Asset Panel (right sidebar) not being able to be toggled off if it is temporarily open (when triggered from editing description, or editing secret, or editing datalink)
- Make "cancel" and "reset" buttons default to outline variant, instead of ghost variant
- Fix style of dropdown
- Change Datalink editor dialog so that object keys are above inputs, not beside them. This gives inputs much more horizontal space for children of deeply nested objects.
Issues left to fix:
- Checkboxes currently still cause the dialog to (incorrectly) close
- "Edit description" actions etc. do not properly focus inputs
Issues left to do (out of scope):
- Show username of user currently using a project (possibly as tooltip?) if the project is currently disabled.
- Dropdown and autocomplete entries should be in their own dialog, so that they can escape the parent dialog if they are too long
# Important Notes
None
2024-10-09 12:10:49 +03:00
|
|
|
scrollableParent.scrollHeight <= scrollableParent.clientHeight
|
2024-03-18 11:47:01 +03:00
|
|
|
) {
|
|
|
|
scrollableParent = scrollableParent.parentElement
|
|
|
|
}
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
|
|
scrollableParent?.scrollTo({ top: 999999, behavior: 'instant' })
|
|
|
|
})
|
|
|
|
const extraColumns = actions.locateExtraColumns(page)
|
|
|
|
const assetsTable = actions.locateAssetsTable(page)
|
|
|
|
await test
|
|
|
|
.expect(async () => {
|
|
|
|
const extraColumnsTop = await extraColumns.evaluate(
|
|
|
|
(element) => element.getBoundingClientRect().top,
|
|
|
|
)
|
|
|
|
const assetsTableTop = await assetsTable.evaluate((element) => {
|
|
|
|
let scrollableParent: HTMLElement | SVGElement | null = element
|
|
|
|
while (
|
|
|
|
scrollableParent != null &&
|
Dashboard improvements (from 24 September 2024 + 30 September 2024) (#11219)
- Close https://github.com/enso-org/cloud-v2/issues/1508
- :warning: Labels modal - add selection indicator where user can (de)select multiple labels
- Checkboxes currently still cause the dialog to (incorrectly) close
- Edit datalink -> select enso secret -> options are too narrow for enso path. Strip enso://Users(Teams), if possible make the options list longer on the left side
- Added (or rather, re-enabled via CSS) horizontal scroll instead
- Make Versions, Sessions, Settings as tabs similar to documentation panel in graph editor
- Edit description in context menu should open asset panel with description input active
- Edit secret should be moved to asset panel (same like datalink)
- Dim background when "edit description", "edit secret", or "edit datalink" are clicked/triggered via shortcut to highlight input
- Hide unused (= no backend support) columns and icons: accessed by projects and accessed data
- *Partial* frontend fixes for https://github.com/enso-org/cloud-v2/issues/1529
- (1) Fix settings title being horizontally centered and split on multiple lines
- (2) :x: backend issue
- (3) :x: out of scope
- (4) :x: backend issue
- (5) :x: out of scope
- (6) :x: out of scope
- (7) :x: backend issue
- (8) :x: already fixed in #11126
- (9) :x: out of scope (potentially requires a way to trigger a tooltip on a disabled button)
- (10) :x: out of scope
- (11) :x: out of scope
- (12) :x: out of scope
- (13) URL encode `enso://` URLs in "copy as path"
- (14) Double click on datalink make asset open and close (not sure if this has already been fixed)
- (15) Clicking anywhere on Asset Panel no longer deselects assets (not sure if this has already been fixed)
- (16) :x: addressed in #11268
- (17) Make list of labels in Asset Panel (right sidebar) horizontal instead of (incorrectly) vertical
- (18) Only show "Billing" settings tab for organization admins
- Use "workspace" instead of "network" icon for project tabs
- Other fixes:
- Fix Asset Panel (right sidebar) not being able to be toggled off if it is temporarily open (when triggered from editing description, or editing secret, or editing datalink)
- Make "cancel" and "reset" buttons default to outline variant, instead of ghost variant
- Fix style of dropdown
- Change Datalink editor dialog so that object keys are above inputs, not beside them. This gives inputs much more horizontal space for children of deeply nested objects.
Issues left to fix:
- Checkboxes currently still cause the dialog to (incorrectly) close
- "Edit description" actions etc. do not properly focus inputs
Issues left to do (out of scope):
- Show username of user currently using a project (possibly as tooltip?) if the project is currently disabled.
- Dropdown and autocomplete entries should be in their own dialog, so that they can escape the parent dialog if they are too long
# Important Notes
None
2024-10-09 12:10:49 +03:00
|
|
|
scrollableParent.scrollHeight <= scrollableParent.clientHeight
|
2024-03-18 11:47:01 +03:00
|
|
|
) {
|
|
|
|
scrollableParent = scrollableParent.parentElement
|
|
|
|
}
|
|
|
|
return scrollableParent?.getBoundingClientRect().top
|
|
|
|
})
|
|
|
|
test.expect(extraColumnsTop).toEqual(assetsTableTop)
|
|
|
|
})
|
2024-06-19 18:24:11 +03:00
|
|
|
.toPass({ timeout: PASS_TIMEOUT })
|
2024-03-18 11:47:01 +03:00
|
|
|
})
|
|
|
|
|
2024-07-16 12:55:45 +03:00
|
|
|
test.test('can drop onto root directory dropzone', ({ page }) =>
|
|
|
|
actions
|
|
|
|
.mockAllAndLogin({ page })
|
|
|
|
.createFolder()
|
|
|
|
.uploadFile('b', 'testing')
|
|
|
|
.driveTable.doubleClickRow(0)
|
2024-08-12 13:25:18 +03:00
|
|
|
.driveTable.withRows(async (rows, nonAssetRows) => {
|
2024-07-16 12:55:45 +03:00
|
|
|
const parentLeft = await actions.getAssetRowLeftPx(rows.nth(0))
|
2024-08-12 13:25:18 +03:00
|
|
|
const childLeft = await actions.getAssetRowLeftPx(nonAssetRows.nth(0))
|
2024-07-16 12:55:45 +03:00
|
|
|
test.expect(childLeft, 'Child is indented further than parent').toBeGreaterThan(parentLeft)
|
|
|
|
})
|
|
|
|
.driveTable.dragRow(1, actions.locateRootDirectoryDropzone(page))
|
|
|
|
.driveTable.withRows(async (rows) => {
|
|
|
|
const firstLeft = await actions.getAssetRowLeftPx(rows.nth(0))
|
2024-08-12 13:25:18 +03:00
|
|
|
const secondLeft = await actions.getAssetRowLeftPx(rows.nth(1))
|
2024-07-16 12:55:45 +03:00
|
|
|
test.expect(firstLeft, 'Siblings have same indentation').toEqual(secondLeft)
|
|
|
|
}),
|
|
|
|
)
|