Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: only pagination tables in storage #1745

Merged
merged 8 commits into from
Dec 12, 2024

Conversation

astandrik
Copy link
Collaborator

@astandrik astandrik commented Dec 9, 2024

This pull request includes several changes to the src/containers directory to replace the usage of StorageWrapper with PaginatedStorage and make viewContext optional. Additionally, it removes the Storage component and updates related utility functions and types accordingly.

  • Replacement of StorageWrapper with PaginatedStorage
  • Removal of Storage component
  • Making viewContext optional
  • Removal of StorageWrapper component
  • Added pagination tests

Closes #1693

CI Results

Test Status: ✅ PASSED

📊 Full Report

Total Passed Failed Flaky Skipped
222 222 0 0 0
Test Changes Summary ✨5

✨ New Tests (5)

  1. loads data in chunks when scrolling (paginatedTable/paginatedTable.test.ts)
  2. loads data when scrolling to middle of table (paginatedTable/paginatedTable.test.ts)
  3. displays empty state when no data is present (paginatedTable/paginatedTable.test.ts)
  4. handles 10 pages of data correctly (paginatedTable/paginatedTable.test.ts)
  5. handles 100 pages of data correctly (paginatedTable/paginatedTable.test.ts)

Bundle Size: 🔽

Current: 65.85 MB | Main: 65.88 MB
Diff: 0.02 MB (-0.03%)

✅ Bundle size decreased.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 19 changed files in this pull request and generated 1 suggestion.

Files not reviewed (14)
  • src/containers/UserSettings/i18n/en.json: Language not supported
  • src/containers/Storage/Storage.tsx: Evaluated as low risk
  • src/containers/Storage/StorageWrapper.tsx: Evaluated as low risk
  • src/containers/Storage/StorageNodes/StorageNodesTable.tsx: Evaluated as low risk
  • src/containers/VDiskPage/VDiskPage.tsx: Evaluated as low risk
  • src/containers/Storage/PaginatedStorage.tsx: Evaluated as low risk
  • src/containers/Cluster/Cluster.tsx: Evaluated as low risk
  • src/containers/UserSettings/settings.tsx: Evaluated as low risk
  • src/containers/StorageGroupPage/StorageGroupPage.tsx: Evaluated as low risk
  • src/containers/Storage/PaginatedStorageGroups.tsx: Evaluated as low risk
  • src/containers/Tenant/Diagnostics/Diagnostics.tsx: Evaluated as low risk
  • src/services/settings.ts: Evaluated as low risk
  • src/utils/constants.ts: Evaluated as low risk
  • src/containers/PDiskPage/PDiskPage.tsx: Evaluated as low risk
Comments skipped due to low confidence (1)

tests/suites/paginatedTable/paginatedTable.ts:193

  • The value 'instant' for the 'behavior' property is invalid. It should be 'auto' or 'smooth'.
top: Math.floor(container.scrollHeight / 2), behavior: 'instant'

tests/suites/paginatedTable/paginatedTable.ts Show resolved Hide resolved
@astandrik astandrik changed the title chore!: only pagination tables in storage chore!: only pagination tables in storage Dec 9, 2024
Comment on lines 117 to 128
await page.route(`${backend}/api/settings`, async (route) => {
await new Promise((resolve) => setTimeout(resolve, MOCK_DELAY));

await route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({
theme: 'light',
language: 'en',
autoRefreshInterval: 10000,
}),
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please clarify, why do we need such mock? Our settings is stored in LS only, currently we don't have any api to store settings

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think we really need it

@@ -31,6 +32,7 @@ export class PaginatedTable {
'.g-tree-select.g-table-column-setup button',
);
this.columnSetupPopup = page.locator('.g-popup .g-select-popup.g-tree-select__popup');
this.scrollContainer = '.ydb-cluster';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for future: current PaginatedTable class is not really reusable, it's actually cluster table with set of controls, that is typical for nodes and storage tables. So, for example, you cannot use it to test table on disks pages. Also I had some difficulties with using it inside table groups - class is set up for one table and one set of controls. I suggest splitting it in the future, so it will be PaginatedTable, TableControls and some PagePaginatedTable for every page or particular component.

Example for scrollContainer property:

class PaginatedTable {
  constructor(page: Page, scrollContainer: string) {}
}

class ClusterNodesTable extends PaginatedTable {
  constructor(page: Page){
    super(page, '.ydb-cluster')
    // some code
  }
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@astandrik astandrik added this pull request to the merge queue Dec 12, 2024
Merged via the queue into main with commit b12599e Dec 12, 2024
7 checks passed
@astandrik astandrik deleted the astandrik.move-storage-tables-to-paginated-1693-2 branch December 12, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

move storage tables to paginated
2 participants