Commit Graph

143 Commits

Author SHA1 Message Date
Richard Cox 6f32ed0df2
Merge pull request #9412 from WuJun2016/circular-dependency
fix circular dependency
2023-07-27 11:39:53 +01:00
Shavindra e11a73d6be
Fix fleet cluster labels and annotations save via YAML view. (#9383)
* Fix fleet cluster labels and annotations save via YAML view.
2023-07-26 13:25:31 +02:00
wujun f4856ffccc fix circular dependency 2023-07-26 17:45:27 +08:00
Sean-McQ 2c81742693
add "exludeFields" option on findAll, unit tests. (#9300)
* add "exludeFields" option on findAll, unit tests.

* fix e2e

* lint fix and e2e test

* updated action unit test and fixed cy.intercepts

* deleted urloptions and test, converted unit tests to ts, removed lodash

* deleted unused urloptions and test
* converted unit tests to ts
* removed lodash

* lint fix

* Added comment with issue for updating query parameters for steve

* Updated based on feedback

* added partial flag to mutations

* pulled out partial flag, excludeOptions logic now entirely within getter

* fixed tests after ripping out partial flag

* Fixed e2e test as 'find' action behavior changed but is still valid
2023-07-18 09:23:26 -04:00
Alexandre Alves 43ca333bdf
Table actions 'enabled' function not working correctly (#9331)
* fix bug

* fix lint issues

* fix lint issues + remove pkg folder

* address PR comments

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
2023-07-17 16:07:24 +01:00
momesgin 7e77ec7d5e
remove error icon when the condition is Ready and Waiting (#9309)
* remove error icon when the condition is Ready and Waiting

* fixed importing clean tooltip directive

* change testing component name

* use replace instead of replaceAll to fix node version support issue on GH's unit test action

* added more unit tests

* import replaceAll polyfill and clean tooltip directive to jest setup

---------

Co-authored-by: Mo Mesgin <mmesgin@Mos-M2-MacBook-Pro.local>
2023-07-14 13:09:04 -07:00
Giuseppe Leo 11f7cfe9f1
[RKE2] Cluster unable to provision after switching back to Back to Form from Edit as YAML (#9264)
* Cleanup code

* Prevent to JSON clone agent config if undefined

* Add clean-tooltip directive to jest configuration

* Remove agent cleanup from the before hook

* Split fetch methods in parts

* Move condition to parent

* Add tests for agent configuration

* SKip test till resolved extra setup

* Updated code comment based on changes
2023-07-13 19:52:49 +02:00
codyrancher cc086ee953 Switch safemode to use the query param
Making this switch because using the path can lead to undefined routes and some confusion on wildcard routes.

https://github.com/rancher/dashboard/pull/9135#discussion_r1232391119
2023-07-09 09:07:42 -07:00
Richard Cox bbbad1d2aa
Merge pull request #9030 from richard-cox/log-validation-warnings
Log validation warnings when creating/editing resources
2023-06-27 11:34:23 +01:00
Richard Cox 0245a8cb93 Merge remote-tracking branch 'upstream/master' into epinio/resolve-conflicts-with-master 2023-06-23 18:00:14 +01:00
Alexandre Alves e84c8979b7
improve dev experience for extensions where builtin extensions will prevent external extension with the same name to load (#9147)
Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
2023-06-23 17:27:51 +01: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
Richard Cox ed9ee99980 Fix failing e2e test
- caused by EXCLUDE_OPERATOR_PKG defaulting to truthy
- which meant no plugins were loaded by the ui
- which meant button to reload ui given changes to plugins was always shown
- when meant extension e2e test that removed plugin immediately used it to reload without waiting for remove to finish
2023-06-09 15:40:06 +01:00
Richard Cox 9eea1852c3 Merge remote-tracking branch 'upstream/master' into master-epinio-dev 2023-06-08 14:54:40 +01:00
Richard Cox b07f8914bc Fix lint warnings 2023-06-05 09:40:26 +01:00
Jordon Leach d94e78c24a
Add extension image load dialog (#9010)
Update dialog with repo creation - update docs

Add uninstall for custom images

Add extension images list view

Add image load dialog and uninstall within extension image view

Update publish and bundle scripts for image load - move image page to tab

Add extension container build workflow file to pkg creator

Move plugin server template into extension build scripts

Fix publish script for multiple asset packages

Move ImageList view to separate page - add crd metadata for custom images

Update docs - fix references to images with catalog

Fix wording, cache state badge, masthead breadcrumb, when deleteing resources check for namespaces

Update docs - fix delete repo resource - default cache state

Trim image whitespace - populate extensionUrl

Add experimental badge
2023-06-02 08:28:47 -04:00
Richard Cox f5a5595f23 Log validation warnings when creating/editing resources
- on by default in 1.25
- in dev world these are warnings, in prod they're debug
- see https://kubernetes.io/docs/reference/using-api/api-concepts/#validation-for-unrecognized-or-duplicate-fields-setting-the-field-validation-level
2023-06-02 11:15:09 +01:00
Richard Cox bfa27646aa operator pkgs --> pkg 2023-06-01 18:24:04 +01:00
Richard Cox 1e8c6cb13d remove EXCLUDES_NUXT_PLUGINS, replace with EXCLUDE_OPERATOR_PKGS (to avoid loading operator plugins) 2023-05-26 16:17:28 +01:00
Richard Cox d5c5e6aa7c Fix log in --> redirect to log out
- This occurred because..
  - The user tries to access resource with 401 --> onLogout dispatched
  - onLogout unbsubscribes to all stores
  - stores are waiting for mgmt stores to be ready
  - user still redirected to log in page
  - user logs in
  - mgmt stores ready
  - stores now unblocked from waiting for mgmt --> continue in original onLogOut action
- Fix is to ensure we exit the wait early if we get the call to unsubscribe
2023-05-23 12:09:37 +01:00
Phillip Rak 93be844701 Create a `v-clean-tooltip` directive
Update `VCleanTooltip`
Only purify if `value.content` is string

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2023-05-18 15:39:14 -07:00
Richard Cox aa34bd3e29 Fix churn issue
- Moving the store setting to enable/disable filtering in the store to a function in a computed property caused havoc for churn
- Make this much neater by moving flag to the setup stage for both ns filter
2023-05-18 14:28:28 +01:00
Richard Cox 9fada7f0b6 Remove richards-logger 2023-05-18 14:28:28 +01:00
Richard Cox 6fffc0d36a Fix linting 2023-05-18 14:28:28 +01:00
Richard Cox 281fb6672c Simplify forced filtering setting
- Given forced filtering is now not resource dependent have a high level utils function to determine if enabled
- This should have opened up the door to setting a nicer default then ALL_USER, however it's actually initially applied somewhere other than ns filter
- Fixed a bug where the all option [] was valid
2023-05-18 14:28:28 +01:00
Richard Cox 1708b4d5c3 Update after BE changes
- Filtering is now no longer done via `resources.project.cattle.io.`
- No need to update the URL anywhere or massage resources fetched via endpoint
- Also no need to make the planned change to remove `resources.project.cattle.io.` from side nav
2023-05-18 14:28:28 +01:00
Richard Cox 15bc1cd036 Changes following BE update and testing 2023-05-18 14:28:28 +01:00
Richard Cox 7e5ad5de34 Expand enforced namespace filtering to multiple namespaces and projects
> This uses a new endpoint that has yet to merge. See https://github.com/rancher/rancher/issues/40140

WIP
- Contains console.warns (via custom logger, can be disabled)
- Waiting for final BE endpoint changes to merge
- Contains TODOs to resolve on final enpoint changes delivered

Pertinent Points
- Incompatible with incremental loading / manual refresh
  - Harder to get counts (need to sum up from different namespaces)
  - Requires use of new steve pagination
- Enforced NS threshold has been removed
  - The threshold only applies to the primary resource. This has issues when loading a low count primary (daemon sets) which depends on a very high count secondary (pods)
  - Fixing this would involve knowing all secondary resources a list uses, which isn't currently possible (each resource is requested individually, need to know them all first)
- There is no way to subscribe to multiple namespaces (one or all)
  - We mock this in subscribe by only persisting changes to resources from within target namespaces
- Everything should work with Advanced Worker enabled
2023-05-18 14:28:28 +01:00
Sean-McQ e256669e74
cluster and rancher stores now use advanced worker (#8717)
* cluster and rancher stores now use advanced worker

* Addressing feedback

* addressing PR feedback and unit tests

* Fixed sticky footer in Helm Chart Install Yaml (#8497)

* Remove dependency: nuxt

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Remove dependency @nuxt/types

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* fix lint

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Remove dependency: @nuxt/typescript-build

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Remove dependency: @nuxtjs/eslint-module
Remove dependency: @nuxtjs/proxy
Remove dependency: @nuxtjs/style-resources

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* align package.log

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Storybook, add vue-loader dependency

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Added placeholder in url input (#8036)

* Added placeholder in url input

* Added format checker for Url input

* Update test

* Fixed lint

* Fixed breaking for other providers

* Fixed lint

* Update vue options to preserve whitespace (#8742)

* Update vue options to preserve whitespace

* Bug fix with tidy-up

* Fix response times for multiple clusters (#8720)

* Update extensions publish workflow for assets in gh-pages branch (#8618)

* Update extensions workflow to move assets into gh-pages branch

Fix gh-pages check

* Move bundle execution - add default basename and ext version

* Fix basename op

* PR changes

* [v2.7] Update Chinese translation (#8731)

* Upgrade to Vue 2.7 (#8654)

* upgrade @vue/cli-xxx

* Update Vue to latest 2.7

* Update eslint-plugin-vue

* Disable new linting rules

* Remove linting issue

* Pin Dom purify library version

* Add resolution to avoid conflicts with packages

* Update yarn/lock after the enforced resolution

* Exclude node 16 types resolution

* Fixed extra space bug in the generic cluster-page (#8626)

* Fixed extra space bug in the generic cluster-page

* Fixed space issue in banner

* Revert changes

* Removed extra div

* Fixed selected rows counter (#8419)

* Fixed selected rows counter

* Fixed lint

* Fixed counter in selection.js

* Small fix in toAdd condition

* Lints

* Fixed condition for selected row counter

* Changes in focusAdjacent function

* Fixed lints

* Improve OPA Gatekeeper constraint detail page (#8586)

This adds the following functionality to the violations list on the OPA Gatekeeper constraint detail page:

* Add a namespace column to the violations
* Make the violations list searchable
* Allow to download the violations as a CSV, similar to CIS scanner violations

Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>

* Increase memory on build (#8751)

* Remove extension autoLoad functionality (#8700)

* fix(BrandImage): remove async fetch method (#8432)

* Removed hasClass method (#8752)

* Removed hasClass method

* Clean code

* Two minor tweaks
- supported store types now a const
- WORKERMODES --> WORKER_MODES

* Fix two bugs
- Ensure advanced worker runs in cluster manager with no current cluster context
- Ensure `resource.stop` from advanced worker successfully kicks off watch


Also
- make rancher, managment and cluster store names a const

* Tweaks
- Fix some comments (jsdoc --> standard, todos)
- Made the web worker redispatch requirement clearer

* Fix unit tests

* Fix resource.stop / resource.error TOO_OLD bugs

- Persist watcher error state after resource.stop
  - this will ensure the resource.stop given alongside the resource.error TOO_OLD is ignored
- Ensure any errors are cleared when we succesfully connect (given above)
  - Should fix the next resource.stop being ignored after recovering from TOO_OLD
- Fix resync watch params
  - these weren't correct, so the resync after TOO_OLD never worked
  - the format could be slimmer, but i thinkg it matches how other socket's data works

Note - I manufactored the TOO_OLD by setting a revision of 1 in subscribe resource.stop if it came from the advanced worker

---------

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>
Co-authored-by: richa <richa.bisht@suse.com>
Co-authored-by: Francesco Torchia <francesco.torchia@suse.com>
Co-authored-by: Neil MacDougall <nwmac@users.noreply.github.com>
Co-authored-by: Jordon Leach <40806497+jordojordo@users.noreply.github.com>
Co-authored-by: vickyhella <vickyhella@hotmail.com>
Co-authored-by: Giuseppe Leo <giuseppe.leo@suse.com>
Co-authored-by: Bastian Hofmann <mail@bastianhofmann.de>
Co-authored-by: LiuYan <361112237@qq.com>
Co-authored-by: Richard Cox <richard.cox@suse.com>
2023-05-17 03:48:10 -04:00
Neil MacDougall c215920391
Extensions: Reduce error logging when operator not installed (#8847) 2023-05-13 18:26:03 +01:00
Francesco Torchia 0ae05b59a9
Merge pull request #8552 from torchiaf/fix/5958
`ConfigMap`, handle chomping
2023-05-10 12:42:58 +02:00
Neil MacDougall c628c5a91d
Remove extension autoLoad functionality (#8700) 2023-04-28 11:27:11 +01:00
Francesco Torchia 98c91ce5a3
improve code comments
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2023-04-28 09:48:13 +02:00
Francesco Torchia d91e79b5b4
move text area css into CodeMirror component
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2023-04-28 09:22:08 +02:00
Sean-McQ bc2d5e1abd
Fix calls into question a lot of other code and if it's still needed (#8706) 2023-04-21 10:10:37 -04:00
Cody Jackson 487cf0d6a4 Migrating all of the files out of the nuxt directory into reasonable places within shell 2023-04-20 11:56:58 +02:00
Neil MacDougall 380be76307
Fix the v-clean-html directive (#8617) 2023-04-05 12:04:29 +01:00
Nancy 27967af51a
Update fleet ui for users with fewer permissions (#8490)
* fix fleet ui when user does not have permission to greate gitrepo or gitreporestrictions

* remove permission  check from gitrepo norepos view

* re-load gitreporestriction schema before attempting to save

* rm unused fleet translation strings
fix fleet workspace banner translation rendering
2023-03-29 14:22:50 -07:00
Francesco Torchia d5c53cd5b8
CodeMirror, enable line breaks and space markdowns
- add 'showMarkdownLineBreaks' codemirror.js option and 'cm-markdown-line-breaks' class to display markdowns
- add 'styleSelectedText' to highlight selected text.

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2023-03-29 15:59:27 +02:00
Phillip Rak 29c05d0c4e Extract `clean-html` directive
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2023-03-22 08:30:17 -07:00
Phillip Rak 4cd4cfeba3 Create `v-clean-html` directive
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
Update list of allowed tags

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2023-03-22 08:27:54 -07:00
codyrancher 6e7e593c47
Merge pull request #7211 from codyrancher/nuxt-removal
Nuxt removal
2023-03-08 10:08:25 -07:00
Richard Cox e3e72aef90 Fix edit of PSACT description
- Use `SteveDescriptionModel` as base of PodSecurityAdmissionTemplate model
- Provide a generic mechanism for model save to tweak the object that's saved
- In SteveDescriptionModel ensure the object that's saved has the correct description
  - Save worked for other users of class ... as they saved via norman rather than steve

Tweaks
- Removed duplicate PSACT definition
- Fixed width of PSACT table name / description columns
2023-03-08 13:29:57 +00:00
Cody Jackson bbb7eebc90 Removing nuxt 2023-03-03 11:49:26 +00:00
Richard Cox 248e6d9c94
Merge pull request #8257 from richard-cox/persist-collection-revision
Persist http response collection revision
2023-02-28 10:37:07 +00:00
Richard Cox 55327395fd Add additional comments 2023-02-27 15:17:48 +00:00
Sean 3a414723f9 Sockets subscribe with namespaces and other filters and also unsubscribe 2023-02-27 10:10:04 +00:00
Richard Cox 6a5f976080 Persist http response collection revision
- Normally we fetch resources and then watch using the revision in that responce
- If we get a resource.stop event we'll then try to find the current revision from the store
- This looks at the type cache's revision and revisions in each resource
- Bug
  - the type cache's revision is set updated, which leads to very old revisions being used
  - This can cause a `too old` error... which is handeld by refetchin the whole list
- Fix
  - Ensure we set the collection's revision when we're likely to need it again
- Tested
  - the different find/load store actions/mutations
  - this includes incremental loading
2023-02-24 15:14:31 +00:00
Richard Cox 855dc131ab Avoid suprious console.error
- when we recieve a `too old` socket watch error we kick off a resync which will watch with a valid revision
- we'll get a resource.stop event following the previous error. socket is in error though so we correctly abort
- the error for this was misleading


Can be trigger with a fake revision on cluster list
In subscription `watch`
```
    if (!trigger && type === 'management.cattle.io.fleetworkspace') {
      trigger = true;
      revision = 1;
    }
```
2023-02-24 11:54:52 +00: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