Commit Graph

56 Commits

Author SHA1 Message Date
Francesco Torchia e925219387
Remove duplicate errors
- Hide errors in ResourceYaml and display them only in CruResource component to avoid duplicate
- Stick errors on top of the page
- Filter out duplicate errors

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2025-07-08 17:07:51 +02:00
Alexandre Alves aebde5c25f
Rancher as an OIDC provider (#14475)
* Rancher as an OIDC provider (interface and flow)

---------

Co-authored-by: Richard Cox <ricox@suse.com>
2025-06-26 10:39:26 +01:00
Evgeniya Vashkevich c68a7da9da
Separated creating new namespace from createNamespace check (#14463) 2025-06-04 15:50:48 -07:00
Evgeniya Vashkevich 258ccb4578
Fixed error message when received from Norman (#14413) 2025-05-29 14:31:03 -07:00
Alexandre Alves cb7cb52dbe
add role 'none' to hr elements in TopLevelMenu (#14121)
* add role 'none' to hr elements in TopLevelMenu

* add missing role and label to SideNav

* add aria-label to show/hide button in the Password component

* add role 'none' to hr elements

* add missing alt to user avatar image
2025-04-16 10:23:38 +01:00
Mo Mesgin df28603120 footer css variable 2025-04-11 12:31:56 -07:00
Alexandre Alves 2fe8146523
fix issue with secrets create options not being key nav accessible (#13414) 2025-02-17 09:29:45 +00:00
Francesco Torchia 9aac7ecbe3
component CruResource: add stepsOptions prop
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2025-01-20 18:39:53 +01: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
Phillip Rak dd8b8256c7 Remove invalid footer slot fragment from Wizard
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-09-11 16:22:07 -07:00
Phillip Rak 7ebfb1d940 Update slot syntax
Updates the slot syntax to be more consistent with `CruResource.vue`. This should help with accurately rendering slot content when we iterate over component slots.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-09-04 08:54:33 -07:00
Phillip Rak 5e1629356f Don't provide default slot to `CruResourceFooter`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-08-30 10:25:23 -07:00
Cody Jackson 86bb0d97a8 Fixing a warning we se with CruResource regarding the `resource` prop type. 2024-08-22 16:09:55 -07:00
Cody Jackson b3e35acf3f Fixing the remaining compiler errors.
- Moved key to be on the for loop
- Made the default template present conditionally
2024-08-22 16:09:54 -07:00
Phillip Rak aedd334803 Fix issue with rendering footer content in cru resource
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-08-22 16:07:03 -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
Giuseppe Leo 793f7c6023
Initial migration of Vue3 for compatible fixes (#10858)
* Correct file naming and small TS issues

Correct TS related issues

* Manual replacement of :is on standard HTML tags

* Add missing required in the code dependencies

* Correct SCSS import

* Correct test file naming

* Correct typo in markup

* Use alias for types import
2024-04-23 20:16:46 +02:00
Alexandre Alves cfa8f469d5
4600: add e2e test (#10739)
* add e2e test

* simplify logic around generating an Opa-Gatekeeper app for e2e
2024-04-08 09:55:12 +01:00
Phillip Rak de3e9517ce Replace `createNamespace` with store in `CruResource`
This replaces the current method of managing the `createNamespace` state with something that will be Vue3 compatible.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-03-22 15:45:52 -07:00
Richard Cox b464d15ee0
Integrate new schemaDefinitions endpoint (#10141)
* resource edit AS yaml

* fix cruresource (yaml from form)
- lazy load the schemaDefinitions when needed, avoids sync all to createYaml before we have an async chance to fetch schemaDefinitions

* Fix questions
- there are only four places we use questions, none of which use schema, this is just to be safe

* cluster scan, plugins/fieldsForDriver, defaultFor, validationErrors

* pathExistsInSchema
- used to optionally show conditions tab/list in resource detail view
- logs of things in ingress list/edit

* createPopulated / defaultFor
defaultFor requires resourceFields, it's only used by createPopulated in one place to support machine configs without components

* wip

* WIP MONITORING.SPOOFED
- these aren't spoofed types, but secondary schemas
- testing fix blocked, primary schema's have resourceFields

* Move steve specific (resourceField) code to steve models
- create models for steve schemas and apply to cluster and management stores
- move resoureField based validationto steve model
- move pathExistsInSchema to steve store getter
- don't fetch schemaDefinitions on start up when saving prefs (not needed and blocking)

* comments / improvements

* (untested) refactoring

* Fix alertmanager definitions, add retry definition fetch

* Fix pathExistsInSchema for path length > 2

* Fix questions that accept schemas
- tested by adding Questions to random page and the node schema

* Fix to saving configmap part 1
- the save works but doesn't show data. the yaml is the same as before. debug info added

* Validation by resourceFields is a norman specific thing, so make it such

* small refactor

* Tidying up

* Remove rebase junk

* fix linting and unit tests

* fix unit tests

* fix linting from fix for test....

* Tidying up, fix alertmanagerconfig

* Remove unit test todos

* add unit tests for resource fields

* sdssdf

* Add unit tests for pathExistsInSchema

* JS --> TS

* Store schemas in local singleton cache to avoid hitting store

* fix minor changes from review

* cruresource changes following review
- improvement - remove spurious canDiff
- createResourceYaml - pass in resource to use instead of calc in code

* WIP changes to parseType

* Fix generic cloud credential and node driver forms

* handle missing reactivity given schema definitions not in store

* fix and add unit tests for `parseType`

* Fix create-yaml test

* Changes following review
- improved comments
- SchemaDefinitionCache is now per store (and is reset as such)
- typeRef now uses parseType

* Fix dep loop by moving route based helps in auth out to utils file

* fix unit tests

* Changes following review
2024-02-28 17:08:35 +00:00
Alexandre Alves 74467e9399
add retry logic for failing user creation network request (#10261)
* add retry logic for failing user creation network request

* add failing network request to retry logic + remove commented code

* fix lint issue

* address scenario where global role binding fails and we need to delete the user created to retry

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MacBook-Pro.local>
2024-01-15 08:49:18 +00:00
Richard Cox b433198cad Fix typo, update modal text 2023-09-29 14:21:49 +01:00
Richard Cox 211222c0cf Updates to how we handle Machine Configurations on edit of Cluster YAML
- This change basically reverts https://github.com/rancher/dashboard/pull/9678
  and instead shows a warning
- That PR spawned the issue https://github.com/rancher/dashboard/issues/9724
- That issue created some interest
- Efforts to fix that issue described in https://github.com/rancher/dashboard/issues/9724#issuecomment-1738959640
- For 2.8.0 we're going back to how we were pre-2.8.0 and fix post-2.8.0
2023-09-28 15:07:55 +01:00
Phillip Rak 83e68f0fd1 Allow hooks to be omitted from application
There are certain scenarios where we want to apply hooks, but it might not make sense to apply all of them. For instance, we have `_beforeSaveHooks` hooks that we want to apply when the "Edit as YAML" button is clicked on a form, but it doesn't make sense to apply the `save-machine-pools` hook at this point; we are only changing the mode of editing so we should not be saving changes at this point. However, we still would want to apply the `set-registry-config` hook.

Co-authored-by: Richard Cox <richard-cox@users.noreply.github.com>
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2023-09-15 08:02:55 -07:00
momesgin 033993b0c5
fixed duplicate warnings on PrometheusRules create page (#9140)
* fixed duplicate warnings on PrometheusRules create page

* fix eslint warning

* added tests for prometheuserule monitoring

* eslint fix

* reset closedErrorMessages after create/save

---------

Co-authored-by: Mo Mesgin <mmesgin@Mos-M2-MacBook-Pro.local>
2023-06-28 15:45:08 -07:00
Giuseppe Leo 01eeb0548f
Add recommended lint rules globally (#8997)
* Update configuration

* Create default config for eslint

* Restore plugin:vue/recommended

* Add exceptions and overrides

* Correct manually remaining issues

* Adding further picked exceptions groupped up

* Fix or disable specific cases manually and singularly

* Add naming linting exception

* Remove unused variable in component

* Move rules to default

* Autocorrect rancher/components linting issues

* Configure VSCode to use multiple files, to display linting for rancher components

* Disable jest lint hook restriction for string list component

* Autofix
2023-06-23 17:02:55 +02:00
richa 65fc1d2dad
Automation preventdefault on press enter (#9088)
* Added test for preventDefault

* Added test for prevent default event on keypress Enter in CruResource component

* Removed test console log

* Fixed lint

* Added data-testid to form

* Fixed lint
2023-06-16 14:16:00 +02:00
Francesco Torchia 0ae05b59a9
Merge pull request #8552 from torchiaf/fix/5958
`ConfigMap`, handle chomping
2023-05-10 12:42:58 +02:00
Francesco Torchia ac2c9633fd
Merge pull request #8551 from torchiaf/fix/8470-8550
CruResource, make preventSubmit optional
2023-05-08 14:56:36 +02:00
Francesco Torchia c3eedb3b31
Handle block styles in yaml files
- add the possibility to specify what Scalar Style to use in the yaml blocks ('|' or '>') and what Chomping style ('+' , '-' or empty)
  see https://yaml-multiline.info
- set default to style to '|+' (keep all newlines)
- adapt CruResource to get in input the new yaml options

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2023-03-29 15:59:42 +02:00
Francesco Torchia 66b4be8ae9
CruResource, make preventSubmit as optional
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2023-03-29 15:42:23 +02:00
Phillip Rak 7cecbc0f62 Replace all instances of `v-html` with `v-clean-html`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2023-03-22 08:30:15 -07:00
Shavindra e12939115e
Allow basic fleet user to manage fleet without cluster permissions. (#7446)
* Allow basic fleet user to manage fleet without cluster permissions.

* Handle no workspaces.

* Add Fleet bundle namespace mapping - fleet.cattle.io.bundlenamespacemapping

* Add git repo restrictions.

* Handle auth errors for checkSchemasForFindAllHash.

* Fix workspace switcher and handle fleetworkspaces 401 issues.

* Update workspace switcher.

* Fix Gitrepo restriction creation from the Workspace create

* Disable workspace creation
* Fix workspace loading after creation

* Fix Bundle creation error.

* Remove redudant FLEET.TOKEN request.
2023-02-23 14:15:32 +00:00
Phillip Rak fe58a9075c
Merge pull request #7990 from catherineluse/ingress-service-text
Add text to help with Services and Ingresses
2023-01-27 15:45:10 -07:00
Catherine Luse aa8514d8b2
Avoid showing YAML in form mode (#7924) 2023-01-27 12:40:40 +00:00
Catherine Luse 1d885b8588 Add text to help with Services and Ingresses 2023-01-21 22:51:28 -07:00
Giuseppe Leo e03f28358d
Add support for Pod Security Admission in the Clusters and Workloads (#7787)
* Add PSA template dropdown to RKE2 cluster editor

* Add tests for RKE2 custom cluster editor to display options for PSA

* Remove TODO and hardcoded value for k8s PSA 1.25+

* Allow CRU editor to have error maps

* Fix linting on destructured arrays for unused values in Workloads erorr map

* Allow to change PSP and reset values accordingly

* Correct banner HTML for reprovisioning

* Replace default term with none in cluster creation policies

* Replace PSA ID with Name for the template in the cluster creation

* Remove extra condition for PSA options

* Add i18n with separated values for RKE default optins

* Restore default option for no PSP template in RKE2
2023-01-20 16:27:30 +01:00
Francesco Torchia 2b1efa3583
Merge pull request #7267 from torchiaf/fix/7112
component: CruResource
2022-11-18 15:09:24 +01:00
Phillip Rak 3d410d0974 Apply linter auto-fixes
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2022-11-16 18:38:20 -07:00
Giuseppe Leo d2d4122bc0
Review HTML formatting rules (#6805)
* Prevent ESLint to format generated paths

* Add HTML ESLint Rules

* Format all the Vue HTML templates except Harvester

* Exclude Harvester package from linting HTML, keeping old formatting rules
2022-11-11 17:04:22 +01:00
Francesco Torchia a07cf76224
component: CruResource
- disable Enter key to submit form

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2022-10-24 14:56:21 +02:00
Catherine Luse e20de14f51 Only attempt to create namespace if it does not already exist 2022-09-13 01:54:57 -07:00
Giuseppe Leo 698194fea3
Create E2E tests for cluster CRUD operations (#6284)
* Set data test id and allow complex component to have default and inherited values for all the actions

* Create cluster tests with steps; Create cluster E2E test

* Extend command to use selector matchers

* Create test for cluster navigation and deletion

* Extend commands to find by id as in get method

* Extend documentation with guidelines and info about E2E

* Correct cluster delete and details tests to get menu within speciftc cluster row

* Add remaining E2E tests for the cluster

* Add baseUrl to the paths

* Add RKE2 selection on cluster creation for CI

* Add E2E debugging information

* Rename clluster manager E2E for consistency

* Correct data test ID after rebase

* Prevent cluster provider errors if no management parameter is provided

* Prevent accessing objects in mutation if none is provided

* Remove imported cluster sample due discarded logic

* Reset RKE2 switch on cluster creation

* Adjust test naming for cluster manager

* Group tests under scoped cases
2022-08-17 20:48:20 +02:00
wujun 7f7bea94a7 HARVESTER: delete displayName RFC1123 validations 2022-07-27 16:15:57 +08:00
Shavindra 33bc3d6449
Fleet add repository form update - #5197 (#5625)
* Fleet add repository form update.

* Refactor CruResoruce.
2022-07-18 17:55:18 +01:00
Richard Cox b2cac564e0
Merge pull request #6157 from richard-cox/update-ns-create-process
NameNsDescription Updates
2022-06-15 09:31:59 +01:00
Richard Cox 750256a0f5 NameNsDescription Updates
- Cancel cross should be a standard colour rather than red
- Ensure CruResource `namespaceKey` works for paths
  - align CruResource `namespaceKey` with NameNsDescription `namespaceKey`
  - reduce complexity
  - This follows on from the conversation in https://github.com/rancher/dashboard/pull/6084
2022-06-13 11:42:58 +01:00
Catherine Luse 773e7c62a5 Pass data when emitting finish event 2022-06-11 12:46:02 -07:00
Catherine Luse ddc5a6f783 Add namespaceKey prop to CruResource 2022-06-10 13:08:32 -07:00