Commit Graph

141 Commits

Author SHA1 Message Date
Francesco Torchia 705394319a
AI extension, compatibility enhancements
- Bump icons
- improve ui-context, support empty context and store input
- add tables and details page hooks

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2025-10-23 12:45:51 +02:00
Richard Cox f60c2c07be V3 2025-10-10 16:26:47 +01:00
Richard Cox 4e45ae640e version 2
- show toggle (persist over reloads) to use full list
- adds sortabletable sub-header-row slot
- uses preset to persist component settings to local storage
2025-10-10 13:27:46 +01:00
Richard Cox da2484b0cb Sort Improvements + Fix Events SSP sort
- Apply SSP sort order with generic `:desc` notation,
- Allow headers to provide default sort order
- Ensure SSP first seen and last seen column sorts behave the same
2025-09-11 11:16:46 +01:00
Cody Jackson eeef60ba2a An alternative narrower scope implementation 2025-08-21 01:43:41 -07:00
Cody Jackson 63eafb9fe7 Adding tab counts to our detail page resource tabs
Addresses a part of #13328
2025-08-21 01:43:41 -07:00
Phillip Rak 123d9f5d94
Merge pull request #14805 from rak-phillip/bugfix/14791-sortable-table-key
Use row key instead of index key in v-for
2025-07-30 09:20:11 -06:00
Richard Cox 0d21048c6b Reverts features that revolve and work around expiring harvester credentials
- Given harvester tokens will now not expire revert features around expiring tokens
  - https://github.com/SUSE/rancher-architecture/pull/4
- Warn users when creating harvester tokens that they expires
  - https://github.com/rancher/dashboard/pull/11313
- Warn users that an existing harvester token is about to/has expired and let them renew it
  - https://github.com/rancher/dashboard/pull/12157
2025-07-25 10:20:30 +01:00
Richard Cox eb1c08032f
Project Scoped Secrets (#14772)
* rename variables

* change button names + fix import

* apply pagination to secrets

* Major Changes

- secrets and project scoped secrets are now two pages
  - this fixes the issue where resource-fetch and associated mixins just fail with two of the same type on page
    - incremental loading would have been broken for both
- project scoped secrets
  - now correct lists upstream secrets that a project scoped based and on the target cluster
    - lots of work to get CRUD for management secrets in explore/cluster world
    - also includes a specific page to override the store for create/edit/view
  - these are now correctly grouped by project
  - updated to work with SSP enabled
- secrets list
  - shows if the secrets comes from a project
  - shows if the secret is a project scoped secret (only used on upstream cluster)
  - updated to work with SSP enabled
  - disabled update/delete of secrets created from project scoped (these just reset when sync runs again)
- disabled new detail view
  - this is broken, it ignores both storeOverride and currentStore, always going to `cluster` store


TODO:
- mostly testing
- blocked on some BE issues (bugs, additional indexed field)

* ... progress. will update commit message

* Revert "Merge pull request #14748 from richard-cox/revert-project-secrets"

This reverts commit be3962261d, reversing
changes made to 62d80084d9.

* tidy, and remove e2e

* test fixes

* fix vai group by

* Fix for grouping (secrets --> group by namespace --> pss --> table is incorrectly grouped but toggle is correct

* fix warning

* fix clone/yaml, fix default/system pss

* don't fetch projects, it wipes out header. this means in upstream we won't show project names for pss downstream

* fix lint

* fix ts complain

* Tweak column tooltips

* Add cypress logs for failing tests

* pipe in `inStore`

* tweaks to cypress logs process
- better name
- log http requests
- only create logs if run failed

* Secret selector improvements and test fixes
- don't cache or watch secrets if we're showing multiple selectors on a page
- ensure we classify secrets (make it into an instance of a model)

---------

Co-authored-by: Mo Mesgin <mmesgin@Mos-M2-MacBook-Pro.local>
Co-authored-by: momesgin <mo.mesgin@suse.com>
2025-07-15 08:27:26 +01:00
Phillip Rak 1c5187ba86 Use row key instead of index key in v-for
This uses the `row.key` as the key in the v-for directive to ensure that each row is uniquely identified by its data. Using a key as an identifier ensures that the local data in the iterated component will sync correctly with the new data.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-07-14 13:19:16 -07:00
Phillip Rak d562255387 Remove `preventDefault` when right clicking sortable table content
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-07-14 10:52:03 -07:00
Richard Cox 75afc17979
Handle new vai-on updates to resources (#13150)
* port of wip

* asdassad

* Update vai / sql cache based api filtering to match latest changes

* Revert "Pin Rancher version to v2.11-2053ce644a31cd8053d1f58e2487154b0b8513b6-head for e2e tests"

This reverts commit 60f62107e7.

* sdfdsf

* dsfdsf

* asdsad

* fix dynamic hide local cluster changes

* improvements

* aaaa

* Working through todo's/tidys

* Remove debug / tidy up

* resolving todos

* remove some debug

* Tidying up #1

* Make manual refresh and auto-refresh visible on perf setting, disabled by default

* Remove dev stuff

* Fix some e2e tests

* Updated comment

* Wire in resource.changes debounce, clearer label for feature `listAutoRefreshToggle`

* Temporarily disable all watches when vai enable
- remove once rancher/rancher#40773 is resolved, which will then finally fix #12734

* Revert "Temporarily disable all watches when vai enable"

This reverts commit c708f468e4.

* Fix nextResourceVersion
- Ensure it handles resource revisions (in both LIST or individual resources) that are strings
- add unit tests

* Update after review
2025-06-11 18:11:35 +01:00
Richard Cox 45bc0b0b82
Merge pull request #14424 from richard-cox/fix-cert-refresh-button
Don't show invalid `Refresh` button in cluster certificates list
2025-06-06 08:54:29 +01:00
Richard Cox 9c12c8ad5e Ensure SortableTable clearSelection works, and is called on manual refresh 2025-06-03 14:59:15 +01:00
Richard Cox f707d5bd01 Ensure two list views of events and certs don't get muddled with singleton isTooManyItemsToAutoUpdate flag 2025-05-29 16:48:13 +01:00
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