Commit Graph

126 Commits

Author SHA1 Message Date
Francesco Torchia 0fbaa8ee4c
Make paging reactive to rowsPerPage input prop updates
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2025-04-30 11:02:22 +02:00
Phillip Rak 03293573c1
Remove right-click context menu from tables (#14156)
Right-click context menus were initially implemented to provide quick access to table-related actions. Review of the context menus indicates that these menus are not intuitive and are often overlooked. This lack of discoverability impacts user experience, especially for users who rely on keyboard navigation or screen readers.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-04-28 08:49:59 -07:00
momesgin 9ac0af5f68
Fix table headers word break (#14130)
* no word break on table headers

* fix failing e2e test

---------

Co-authored-by: Mo Mesgin <mmesgin@Mos-M2-MacBook-Pro.local>
2025-04-24 12:38:40 -07:00
Phillip Rak e59f6cc07e
Replace ActionDropdown with RcDropdown (#14137)
* Create ActionDropdownShell component

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>

* Update displayType for ActionDropdown to `inline-flex`

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>

* Fix e2e tests

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>

* Add prevent modifiers to up/down keydown events

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>

---------

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-04-16 08:33:53 -07:00
Phillip Rak f44e014bba Rename `useFeatureFlag` to `useRuntimeFlag`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-04-09 12:44:41 -07:00
Phillip Rak 9746cb1f8d Create a `useFeatureFlag` composable
This composable is intended to be used for any feature flags that we may need to specify for maintaining backwards compatibility with previous versions of Rancher Shell. At the moment, this composable contains a feature flag for toggling the new dropdown menu.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-04-09 11:00:18 -07:00
Cody Jackson a6a8ad1332 Prevent formatterOpts.getCustomDetailLink from being overridden
Fixes #9884
2025-04-03 11:49:08 -07:00
Phillip Rak 6b863a63c2
Revert Vue 3.5 features added to dashboard to maintain compatibility with Vue 3.2 (#13880)
* Replace `useTemplateRef` with `ref` for Vue 3.2.47 compatibility

`useTemplateRef` was added to Vue 3.5, but cannot be used in extensions that might be installed in Rancher 2.10 because that has a dependency on Vue 3.2.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>

* Replace Reactive Props Destructure with `withDefaults` macro

Reactive Props Destructure was added to Vue 3.5, but cannot be used in extensions that might be installed in Rancher 2.10 because that has a dependency on Vue 3.2.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>

* Add feature flag to conditionally render dropdown menu in tables

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>

---------

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-03-27 11:18:56 +00:00
Alexandre Alves d40cacdd3f
add missing aria labels and roles for pagination of sortable tables (#13796) 2025-03-23 18:04:23 +00:00
Alexandre Alves 76e92a803e
fix unclear functionality for filter inputs for a11y (#13836) 2025-03-23 18:03:37 +00:00
Alexandre Alves a00b86cfdd
add missing alt to sorting icons (#13797) 2025-03-20 17:03:35 +00:00
Alexandre Alves d669a7cc2a
small sortable table a11y fixes (#13448)
* adds small fixes to sortable table a11y

* make screen readers ignore the icons to get sorting indication as its present in th element

* address pr comments

* address pr comments
2025-02-21 08:52:51 +00:00
Phillip Rak ea176eb358 Fix data-testid usage in RcDropdownMenu
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>

Fix

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-02-18 17:18:36 -07:00
Phillip Rak 55a3ba5e3d Add missing aria label to table action menu button
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-02-14 16:45:38 -07:00
Phillip Rak 620e75ec1f Fix failing e2e tests
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-02-14 15:11:51 -07:00
Phillip Rak 5b415c1a5d Create ActionMenuShell component
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-02-14 09:08:17 -07:00
Phillip Rak 8f8a6994be Replace table actions with dropdown menu
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-02-14 08:03:07 -07:00
Phillip Rak 828ec858a2 Create a SortableTable ActionMenu component
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-02-14 08:03:07 -07:00
Alexandre Alves 8f9913c5ad
fix missing textual description on image buttons (#13382) 2025-02-13 12:05:32 +00:00
Phillip Rak f09d98a3f2 SortableTable: Stop propagation of the enter key
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-02-12 14:30:29 -07:00
Phillip Rak 5b049986cd SortableTable: Emit an `enter` event for table selection
This refactors the event listener that was attached to the window so that it is now attached the sortable table. The table needs to listen to the keyup event and the row needs to receive focus in order for this to work; the row's tabindex is set to -1 so that it is not navigable via keyboard.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-02-12 14:30:29 -07:00
Phillip Rak 5a00f4ed2f Add aria label to table filter input
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-02-05 10:58:52 -07:00
Cody Jackson 728bc64cef Resolving some issues around rendering pagination loading on resource list pages
fixes https://github.com/rancher/dashboard/issues/12748
2025-01-08 16:28:39 -07:00
Richard Cox f980283813
Add server-side pagination to cluster explorer lists (#11672)
* cluster list now uses resource table

* New PaginatedResourceTable

* WIP

* add context to pag setting

* tidying up

* Add server-side pagination to cluster explorer events and general events list

* Servier-side pagination for catalog apps, cluster repo and operation

* Servier-side pagination for Service --> HPA, inmgress, services

* Server-side pagination for home page clusters list and side bar clusters

- Functional Changes
  - SSP now works after vue3 bump
  - Home Page Clusters list now uses server-side pagination
  - Side Bar clusters list now uses server-side pagination
  - Wire in now supported sorting / filtering by id and name used for table columns
  - Allow pagination to be enabled given a specific context
  - Call findPage without persisting to store

- New Pagination Tools
  - PaginatedResourceTable - Convenience Component, wraps ResourceTable with pagination specific props
  - PaginationWrapper - Convenience class to handle requests for resources and updates to them (avoiding store)

- Regressions
  - Side Nav menu ready state was `mgmtCluster.isReady && !pCluster?.hasError`, now ???

* fixes after merge. apply PagResTable to node list, vue3 fixes

* - Fix issue where list components containing PaginatedResourceTables would incorrectly fetch all resources anyway
- convert reminaing storage lists

* policy section

* fix async button in manual refresh mode

* fgh

* aaaaa

* Server-side pagination for home page clusters list and side bar clusters

- Functional Changes
  - SSP now works after vue3 bump
  - Home Page Clusters list now uses server-side pagination
  - Side Bar clusters list now uses server-side pagination
  - Wire in now supported sorting / filtering by id and name used for table columns
  - Allow pagination to be enabled given a specific context
  - Call findPage without persisting to store

- New Pagination Tools
  - PaginatedResourceTable - Convenience Component, wraps ResourceTable with pagination specific props
  - PaginationWrapper - Convenience class to handle requests for resources and updates to them (avoiding store)

- Regressions
  - Side Nav menu ready state was `mgmtCluster.isReady && !pCluster?.hasError`, now ???

* Iteration

Note - prov clusters is broken (only fetches local) due to blocking pr. breals
- notPinned list

* Fix dupe inStore
- remove from resource list, put in resource-fetch (used also by pag res table)

* Fix dupe inStore
- remove from resource list, put in resource-fetch (used also by pag res table)

* Two fixes
- changes namespaces kicked of side nav cluster requests (thought pinnedIds changed)
- fix generic lists re-fetching given ns filter changes (they don't have namespaced arg)

* fixes / updates

* testing/tidying

* WIP - Rest of workload lists

* finish off workloads

* tidying up

* fix non-generic list filtering by namespace

* remove comment, backport fix

* test fixes

* E2E: Ensure we wait for cluster entries to exist before clicking on them

* backport fix for local/api filtering

* Remove debug code

* Changes after review

* e2e fixes / debugging

* More e2e fixes

* More e2e fixes

* More e2e fixes

* Fix generic pages that filter on pagination

* Attempt to fix flaky vai test

* Fix after merge from master

* Updates following new indexed files

* Fix lint and test

* Changes given real cluster tests
- general fixes
- correct issue were sorting prov clusters on mgmt cluster props (issue in master as well...)
- bit the bullet, we now don't fetch all mgmt clusters on dashboard visit.
  - there could be knock on affects, but we'd need to remove it sometime in 2.11....

* Fix issues with diplaying rke1 data in home page
- includes https://github.com/rancher/dashboard/pull/12881

* Fix unit tests

* remove invalid sort/filter type

* Running through new indexed fields

* fix unit tests

* lint fixes

* Fixes after small review

* lint

* Test for check-plugin-gates pkg build from shell

* e2e fixes

* Testing new indexed fields with dev image

* tidyuing up imports in hope to fix ts error in check-plugins gate

* Fix failing check-plugin-gates
- caused by shell/scripts/test-plugins-build.sh importing list/catalog.cattle.io.clusterrepo.vue
- the component had been updated to a TS component
- check-plugin build outputs TS errors for a component file imports
- vs code shows no errors for imported file

* tidying up a smidge

* Many tweaks
- Remove final todo's
  - includes fix for service type clusterip/headless overlap
- Removed ununused ENDPOINT column (note ENDPOINT formatter used in other columns)
- Testing freshly added index fields

* Improve location of new place where componentWillFetch is set

* fix lint, comment updated

* Fix failing e2e tests
- fix cluster dashboard events test
- fix and greatly improve flaky events test
- fix hpa test
- functional fixes
  - fix sorting/filtering events by object type
  - fix hpa columns
2025-01-07 15:13:42 -07:00
Alexandre Alves 9553614394
fix keyboard nav for home page (#12966)
* fix keyboard nav for home page

* minor fixes based on another PR comment

* add aria-sort to table column headers + remove space key bindings for links

* revert small change on Checkbox

* revert small change on Checkbox

* clear key space to trigger links

* change role for links that are in fact buttons + keep space key
2025-01-07 17:19:09 +00:00
Richard Cox b614082ce1
Add server-side pagination to home page cluster list (#11663)
* Server-side pagination for home page clusters list and side bar clusters

- Functional Changes
  - SSP now works after vue3 bump
  - Home Page Clusters list now uses server-side pagination
  - Side Bar clusters list now uses server-side pagination
  - Wire in now supported sorting / filtering by id and name used for table columns
  - Allow pagination to be enabled given a specific context
  - Call findPage without persisting to store

- New Pagination Tools
  - PaginatedResourceTable - Convenience Component, wraps ResourceTable with pagination specific props
  - PaginationWrapper - Convenience class to handle requests for resources and updates to them (avoiding store)

- Regressions
  - Side Nav menu ready state was `mgmtCluster.isReady && !pCluster?.hasError`, now ???

* Iteration

Note - prov clusters is broken (only fetches local) due to blocking pr. breals
- notPinned list

* Fix dupe inStore
- remove from resource list, put in resource-fetch (used also by pag res table)

* Two fixes
- changes namespaces kicked of side nav cluster requests (thought pinnedIds changed)
- fix generic lists re-fetching given ns filter changes (they don't have namespaced arg)

* remove comment, backport fix

* test fixes

* E2E: Ensure we wait for cluster entries to exist before clicking on them

* backport fix for local/api filtering

* Remove debug code

* Changes after review

* e2e fixes / debugging

* More e2e fixes

* More e2e fixes

* More e2e fixes

* Fix generic pages that filter on pagination

* Attempt to fix flaky vai test

* Fix after merge from master

* Updates following new indexed files

* Fix lint and test

* Changes given real cluster tests
- general fixes
- correct issue were sorting prov clusters on mgmt cluster props (issue in master as well...)
- bit the bullet, we now don't fetch all mgmt clusters on dashboard visit.
  - there could be knock on affects, but we'd need to remove it sometime in 2.11....

* Fix issues with diplaying rke1 data in home page
- includes https://github.com/rancher/dashboard/pull/12881

* Fix unit tests
2025-01-03 15:34:28 +00:00
andy.lee 6701ce2546
fix table header align not work
Signed-off-by: andy.lee <andy.lee@suse.com>
2024-11-29 14:32:20 +08:00
Richard Cox 33876135ca
Ensure lists update when switching between workspaces with the same number of rows (#12449) 2024-10-31 17:16:04 -07:00
Phillip Rak 63e3ce2432 Replace `beforeDestroy` lifecycle option with `beforeUnmount`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-10-18 13:12:54 -07:00
Phillip Rak 997da50f44 Replace instances of "Borderless" multi action buttons
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-09-26 15:57:48 -07:00
Cody Jackson 0b4208ef5f Adding missing emits values to sortable table
These emits were being done within the selection.js mixin. I looked through all the other mixins and didn't find additional emits.

I noticed this while working on harvester.
2024-09-24 09:22:06 -07:00
Cody Jackson 5052c2a8e8 Enabling `vue/require-explicit-emits` linting rule
https://github.com/rancher/dashboard/issues/11961
2024-09-19 09:58:53 -07:00
Cody Jackson a2a16e1440 Fixes for harvester 2024-09-13 09:43:38 -07:00
Phillip Rak b68adb3833 Revert "Refactoring the plain element <input> data bindings"
This reverts commit 7f1536d9cf.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-08-27 15:39:02 -07:00
Cody Jackson d1ccb6c91e Fix sortable table search bar filter
We were just handling the input event wrong. Probably a typo either in our script or when preparing for our script
2024-08-22 16:09:54 -07:00
Cody Jackson 0666d4f1a8 Changing how we evaluate if a slot is present in sortable table. Length was 0 even when the slot was being used. 2024-08-22 16:09:54 -07:00
Phillip Rak 7f52a60490 Resolve error: `TypeError: this.slots['header-left'] is not a function`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-08-22 16:09:54 -07:00
cnotv ff08d80e0e Lint: Manually fixed issues related to vueApp variable added by the script 2024-08-22 16:07:03 -07:00
Cody Jackson eae4e13866 We had duplicate :key attributes which was preventing us from rendering THead and yielded console errors 2024-08-22 16:07:03 -07:00
Phillip Rak 399696ae73 Upgrade `v-tooltip` to `floating-vue`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-08-22 16:05:37 -07:00
Phillip Rak 0c9361a024 render the login page
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-08-22 16:05:37 -07:00
Cody Jackson 9b829c55ea Ran `yarn lint --fix` 2024-08-22 16:05:36 -07:00
Cody Jackson d5ce4fff2e Run the vue3 migration script
Commands run:

➤ yarn migrate
➤ git clean -fdx
➤ nvm use 20
➤ yarn
2024-08-22 16:05:36 -07:00
Cody Jackson 7f1536d9cf Refactoring the plain element <input> data bindings
Performing this change so the vue3 migration script can modify all @input, @v-model of components without changing plain elements. This will reduce the number of vue3 compiler errors.
2024-08-22 16:04:52 -07:00
Giuseppe Leo a2304f462e
Remove or replace all the @nuxt libraries (#11302)
* Update checkout to v4 and bump Node to 16

* Update GHA workflow migration paths

* Removed named exports from Vue files

* Move code outside of the Vue app element

* Remove @nuxtjs/eslint-config-typescript

* Remove @nuxt/types and @nuxt/typescript-build

* Fix import issue with http-proxy-middleware

* Replace @nuxtjs/axios with axios and axios-retry

* Remove @nuxtjs/webpack-profile

* Fix linting issues after Nuxt webpack removal

* Pin resolution for glob after rebase

* Update yarn.lock after rebase

* Fix issue with rancher-components

* Bump rancher-component GHA config to match rebase changes

* Generate yarn file

* Add dependency

* Remove nuxt global var in app template

* Pin version for babel/plugin-proposal-private-methods
2024-08-08 15:31:44 +02:00
Izaac Zavaleta fa80996a04 Use testid locators rather than positionl on pagination 2024-06-15 10:13:56 -07:00
Richard Cox 53544f5d19
Add an alternative List loading indicator for use with server-side paginated (#11129)
* Changes for new design
- New visuals
- Pagination controls --> load more
- finished testing of label select with pagination off

# Conflicts:
#	shell/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts

* Changes following review

* Update Node list to support server-side pagination
- Setup pagination headers for the node type
- Define a pattern for fetching custom list secondary resources
- Major improvements to the way pagination settings are defined and created
- Lots of docs improvements
- Handle calling fetch again once fetch is in progress (nuxt caches running request)
- Validate filter fields (not all are supported by the vai cache
- General pagination fixes

* Lint / test / fixes

* Improvements to configmap e2e test & Improve pagination disabled

* Beef up validation

* Fix missing name column in non-server-side paginated node list

* Fix PR automation actions
- fix syntax
- catch scenario where a pr has no fixed issue

> There's duplication between files, see https://github.com/rancher/dashboard/pull/10534

* CI bump

* Fixes post merge

* Wire in 2.9.0 settings for server-side pagination
- Everything is gated on `on-disk-steve-cache` feature flag
  - There's a backend in progress item to resolve a `revision` issue, until then disable watching a resource given it
- Global Settings - Performance
  - Added new setting to enable server side pagination
  - this is incompatible with two other performance settings

* Integrate pagination with configmaps in cis clusterscanbenchmark edit form
Also
- improved labeled select pagination
- gate label select pagination functinality on steve cache being enabled

* - harvester machine-config
- project monitoring (and bug fixes)

* Disable workload screen if vai cache is on
- temp step until we get new overview

* TODOs and TEST

* Conditionally remove fetch of all secrets from SelectOrCreateAuthSecret

* TODOs and TEST

* Update SimpleSecretSelector
- only used in monitoring.coreos.com.alertmanagerconfig context

* View and Edit ingress - secrets

* node detail page - pods list

* Backup/Restore: Secrets (WIP)

* Backup/Restore: Secrets, and other usages of SimpleSecretSelector / SelectOrCreateAuthSecret

* Edit: Service account

* Add comments for remaining items

* Paginate Secret selection for logging providers
- Allow `None` option in Paginationed LabelSelect
- Optionally classify pagination response

* WIP

* fixes arfter merge

* Don't suggest container names, not practical
- previously all pods were fetched... and we scrapped all container names from them
- this is a scaling nightmare, user now must just enter the name/s to match

* Avoid findAll secrets in SimpleSecretSelector

* tidying up

* Move LabeledSelect/index.vue back to LabeledSelect.vue to not break extensions

* changes after self review... 1

* changes after self review... 2

* ooof

* changes after self review... 3

* fix formatting

* Link new paginated label select with pagination setting

* Work around failing kubewarden unit tests in check-plugins gate

* Fix backup.spec e2e test

* fix formatting, paginationUtils.isSteveCacheEnabled --> paginationUtils.isEnabled

* Don't fetch all secrets on cloud creds page

* Fix backup.spec e2e test

* TODO tidying / tracking

* don't getch ALL workloads for hacky way to get a link to a service's workload

* Fix bad merge

* Updates after working with vai cache image

* test fixes

* Create a convienence wrapper called ResourceLabelSelector that hides most of the complexity

* fix unit test

* Add alt-loading indicator to sortable table, use for pagination

* Updates following review

* Remove workload health until #10417 is resolved

* Updates following review

* changes following self review

* Fix bottom bar of edit backup, edit restore pages

* revert temp change

* changes following self review

* Workaround for kubewarden unit tests in check plugin gate

* bump

* Fix e2e

* Fix linting

* type fixing

* fix standard loading indicator

* - improve filtering without pagination
- update allowed fields given latest backend changes
- enable on by default exact filter string matches (disable for lists

* remove temp code

* fix linting

* Changes following review

* Fixes for vai cache feature flag
- name was changed from on-disk-steve-cache to ui-sql-cache
- fix timing issue - don't watch resources until we know the vai cache feature flag

* Changes following review

* Fix two sketchy tests
- new exception in docs page
- don't nav to page via button click and then goto same page

* More test improvement
- force user to go to tab which is source of route guard issue
- move setup stuff to a test for cypress to re-retry

* changes following review
2024-06-11 20:08:29 +01:00
Mo Mesgin a4dc21b20c make thead vertically top aligned when a column with sub-label exists 2024-05-13 15:43:02 -07:00
Neil MacDougall f5431cbbaf
Add i18n string usage checker script (#10805)
* Add i18n string usage checker script

* Fix lint issues

* Add i18n check to GH Action workflow

* Update to node 16

* Update workflow to run script properly

* Allow script to return okay if when there are errors

* Add documentation

* Remove commented code
2024-05-02 20:52:15 +01:00
Richard Cox f0c397c001 Update Node list to support server-side pagination
- Setup pagination headers for the node type
- Define a pattern for fetching custom list secondary resources
- Major improvements to the way pagination settings are defined and created
- Lots of docs improvements
- Handle calling fetch again once fetch is in progress (nuxt caches running request)
- Validate filter fields (not all are supported by the vai cache
- General pagination fixes
2024-04-30 11:04:06 +01:00