Commit Graph

86 Commits

Author SHA1 Message Date
Alexandre Alves 6637583874
remove "process." mentions from Dashboard and adjust code (#10119)
* remove process.client and process.server mentions and adjust code

* fix a couple of missing conditions for process.server

* remove commented line

* remove process.static

* fix lint errors

* uncomment code

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MacBook-Pro.local>
2023-12-13 08:41:26 +00:00
Evgeniya Vashkevich e2149a4798
[INT] Removed vue-meta library (#9952)
* [INT] Removed vue-meta library
2023-12-05 09:42:23 -08:00
Richard Cox 48d0807181 Revert "App upgrade notification shown for incorrect app (#9806)"
This reverts commit eec4a46fdb.
2023-10-20 15:13:52 +01:00
Giuseppe Leo eec4a46fdb
App upgrade notification shown for incorrect app (#9806)
* Heavy code cleanup: move function to utils, config and types to their own file

* Add fallback and tests for version comparison not retrieving values

* Fix refactoring

* Add partial case of array filterBy

* Replace multiple functions handling the same case with single getter; add covering tests

* Add no parameter case to be correctly handled

* Add case with different chart values, e.g. Epinio issue case

* Prevent issues if retrieved version is undefined; Add unit tests for upgrade cases

* Filter out charts if lack parameters
2023-10-10 11:14:24 +02:00
richa 3389ed6c4d
Fixed ui-brand value automatically reverted issue (#9769)
* Fixed ui-brand value automatically reverted issue

* Don't reset brand if csp adapter is removed

---------

Co-authored-by: Neil MacDougall <nmacdougall@suse.com>
2023-09-28 14:10:11 +01:00
Richard Cox a70fe1b431
Merge pull request #9598 from richard-cox/fix-modified-resource
Fix resource modified handler
2023-09-27 17:36:49 +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
Richard Cox 68930d7820
Merge pull request #9543 from richard-cox/fix-error-in-prod
Fix white page errors in prod
2023-09-06 11:28:00 +01:00
momesgin dd7aa9d2d0
Added deprecation warning for OPA gatekeeper (#9528)
* added deprecation warning for OPA gatekeeper

* unit tests

---------

Co-authored-by: Mo Mesgin <mmesgin@Mos-M2-MacBook-Pro.local>
2023-08-28 08:54:14 -07:00
Richard Cox f9aa1f38bb Fix resource modified handler
- fixes issue in handleConflict that meant
  - conflicts were not detected
  - non-conflicting changes were not applied to users resource
- see #9597 issue description for more detail
2023-08-25 18:41:04 +01:00
Richard Cox 7ec8626ee6 Fix white page errors in prod
- white page errors should not be visible in prod
- these were were enabled in all envs via the port of shell/initialize/client.js after nuxt
- that came from the output of a template
- the template has some features on via debug state when built
- we now disable these features in prod
- Additionally..
  - set some process values that were being skipped but still used
  - always log uncaught errors in `fetch`s. in theory we should be monitoring $fetchState.error but we never do. this has led to some painful debugging with customers
2023-08-15 16:08:51 +01:00
Giuseppe Leo 0208645b0f
(SURE-5538) Persistent Volume is not having CSI driver as vol plugin which is current default for latest versions of AKS (#9386)
* Move persistent volume constants and configurations away from model

* Add fallback for drivers with name only

* Enable support for CSI volume

* Prevent errors if no name is provided for route in CRUResource method

* Update test to check plugin options and value

* Update i18n
2023-07-20 23:31:50 +02:00
Guang Yee 0e996c7fa3
Add support for Pay-As-You-Go (PAYG) CSP billing adapter (#9092)
* Add support for Pay-As-You-Go (PAYG) CSP billing adapter

Also check for the `rancher-csp-billing-adapter` for PAYG offering.

* Only run through apps list once, fix fresh install issue
- Make the check for csp app common
- only loop through apps once
- fixed an issue where new users with no v3/settings/ui-brand value would not get their suse brand
- tested by checking for `ui-plugin-operator` app

* Fixes following merge conflict

* Only run through apps list once, fix fresh install issue
- Make the check for csp app common
- only loop through apps once
- fixed an issue where new users with no v3/settings/ui-brand value would not get their suse brand
- tested by checking for `ui-plugin-operator` app

* Only run through apps list once, fix fresh install issue
- Make the check for csp app common
- only loop through apps once
- fixed an issue where new users with no v3/settings/ui-brand value would not get their suse brand
- tested by checking for `ui-plugin-operator` app

* Fix excpetion thrown during setup flow

* e2e: improve user avatar toggle

* revert force click change

* Beef up home page goToAndWaitForGet

* Beef up home page goToAndWaitForGet

* Revert "Beef up home page goToAndWaitForGet"

This reverts commit 125a478daf.

* Revert "Beef up home page goToAndWaitForGet"

This reverts commit d771f88b7d.

* Revert "revert force click change"

This reverts commit ca57ae6768.

* Revert "e2e: improve user avatar toggle"

This reverts commit 90fa05dc9e.

* Revert "Fix excpetion thrown during setup flow"

This reverts commit 8bad76b99e.

* Fixes after merge

* Fixes after merge

---------

Co-authored-by: Richard Cox <richard.cox@suse.com>
2023-07-12 18:29:14 +01:00
Richard Cox c16c746fa8 Fix following review
- if we have the brand and that brand value is not what we want it to be... set it
- if we use brandSetting?.value a falsy brandSetting would result in the code below triggering
2023-07-12 13:12:40 +01:00
Richard Cox 3b4fa5176a Fix issue where adding branding --> removing branding always resulted in setting brand 2023-07-12 12:38:29 +01:00
Richard Cox 215d4c11a7 Updates / Fixes to Automatically setting ui brand
- ui-brand setting comes from the existence of a helm app
- this was broken for the initial case (there is a brand... but no brand setting
  -  cause by a computed property not re-running given change after `fetch`
- fixing this reactivity exposed some other scenarios where we need to be safe
  - for instance when logged out, or in the process thereof
2023-07-12 12:38:29 +01:00
Neil MacDougall c9e1a19396
Extension support for custom provisioning (#9246)
* Extension support for custom provisioning

* FIx lint issues

* Discovery / Tweaks
- fix issue where namespacesOverride was lost
- tidy up PROVIDER
- try to handle missing provider=type url param (could be missing extension-params)
- added a few comments to comments to come back to

* Names and typings
- change param --> customParam to make it clearer it's not url params
- add labels-annotations to shell types

* Wire in provider detailTabs
- as per original readme this should be made generic (extension point working directly with ResourceTabs)

* Update IClusterProvisioner & docs

* Improvements / Changes to support proving out DO extension
- cluster hooks optional
- buff up save hook (and pass in cluster when calling apply fn)
- move normalizeName into generic place
- bring back async create machine config
- hack for do extension (map example provider to do provider)

* updates, add optional saveCluster, add missing kube file
- saveCluster complements hooks, doesn't skip handling of addons, etc
- ensure register hooks take the `this` context in all worlds

* Adding docs

* Updates
- location config based changes
  - change customParams to context
  - add query param
- add new extention point to add tabs to cluster create cluster config section
- fixed some typing
- fixed issue where cluster was not passed to before / after hooks (only important if 'this' changes

* Changes following review, fix `t` in plugins

* Fix linting

* Docs updates, pass through more edit/view things

* Conditionally show the namespace grouping in the cluster list
- means users can differentiate between clusters with same name in different namespaces
- useful when clusters created via extension provisioner where ns can be selected

* docs tweaks, actually include the provisioning page in docs

---------

Co-authored-by: Richard Cox <richard.cox@suse.com>
2023-07-11 22:17:57 +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 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 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
Jordon Leach 0431dac875
Fix import for clone from utils/object - Bump 0.3.9 (#8838)
* Fix import for clone from utils/object

* Bump 0.3.9
2023-05-11 14:08:12 -04:00
Giuseppe Leo 2ff7945107
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
2023-04-26 21:45:21 +02: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
Nancy 039bf00d67
Ensure CRDs are always installed with the same global values as the main chart (#8636)
* during chart installation only apply crd values that have been customized

* rm unused import in install.vue
2023-04-05 14:32:04 -07:00
Nancy b059eaa6de
respect prerelease preference when auto-selecting helm chart version; retain version query param when cancelling chart install (#8514) 2023-03-27 12:47:23 -07:00
Nancy ecfd035751
Add enableDefaultSeccompProfile option to the Gatekeeper chart install ui (#8381)
* fetch auto-install chart info; pass associated chart values to custom chart ui components; allow configuring enable default seccomp profile during gatekeeper install

* fix gatekeeper localization path
2023-03-13 09:15:57 -07:00
Richard Cox 55327395fd Add additional comments 2023-02-27 15:17:48 +00:00
Alexandre Alves 84e260d95e
Manual Refresh Performance Option (#7904)
* update resource fetching on list views so that secondary resources follow the logic of manual refres
h and/or incremental loading if the main resource defines it

* Update resource-fetch logic to take into consideration the storeType for each individual request + fix logic regarding namespace for fetching resources + update missing resources logic (nodes and prov clusters)

* fix tipo

* reinstate hash system to handle requests for nodes and prov cluster lists

* revert mutation code + add check to register type if it doesnt exist on loadDataPage action

* fix issue with timeout that wasnt working properly for the update of live and delayed cols after manual refresh

* Take in to account the per resource count when calculating `limit`
- This means primary resources with a smaller amount don't restrict secondary resources with larger amounts

Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
Co-authored-by: Richard Cox <richard.cox@suse.com>
2023-01-27 14:32:42 +00:00
Giuseppe Leo 8497f587d7
Add PSA custom resource in Cluster Manager (#7678)
* Add PSA resource model, edit, list, types, config, utils and navigation

* Remove controls sorting from config file in PSA form due unnecessary added logic

* Add missing type to exemptions

* Remove component specific grid alignment styling

* Add meaningful values on PSA form tests

* Add prefix for the namespace PSA form

* Correct PSA form test

* Revert RKE cluster erroneous changes

* Rename all the PSA form values to match specification and avoid issues

* Create function to convert array to dictionary

* Add types and replace function with utility in PSA form

* Trim exemptions values for PSA form

* Correct util test and function

* Enable YAML editor for PSA resource
2023-01-20 16:26:43 +01:00
Catherine Luse 87174680c5 Avoid saving duplicate Helm chart versions 2023-01-19 03:19:09 -07:00
Richard Cox b88ceb6e5a Fix project/namespace --> cluster manager blank page bug
- caused by circular dependency of
  - index.vue --> resource-fetch mixin --> resource-fetch-namespaced mixin --> index.vue
- not sure why the works on most pages... but bugs out for this one... but the fix makes sense
2022-12-23 11:34:12 +00:00
Alexandre Alves c6a790929d
add disable auth provider prompt modal (#7729)
* working on disable auth provider prompt modal

* finish adding modal for confirming disable of auth provider

* cleanup

* address PR comments

Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
2022-12-22 15:34:32 +00:00
Francesco Torchia 07683d34a6
Merge pull request #7639 from torchiaf/fix/7484
fix Delete button when trying to delete users
2022-12-12 09:48:47 +01:00
Cody Jackson 90ca1209f4 This fixes an issue where catalog/charts were stale after a repo was updated
The catalog.cattle.io.clusterrepos/{repo} resource doesn't subscribe to updates. We now force a full request in the areas where it's appropriate to do so.

fixes #7668
2022-12-09 08:38:28 -07:00
Francesco Torchia 2740af2df5
visibilityChange, replace findAll to bypass wss subscribe
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2022-12-07 12:43:25 +01:00
Francesco Torchia 208d306b31
setTabVisibilityListener, refactoring
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2022-12-07 12:40:41 +01:00
Richard Cox 762b3e4163 Updates following review
- Tweak settings text
- Use new filter icon
- Tweak "too many" text
- Allow only selecting a single namespace when in 'too many' mode
2022-12-02 12:37:35 +00:00
Richard Cox 8924b34888 Disable ns filtering for fleet / workspace world
- This might be possible (as fleet workspaces are similar to namespaces
- To address though would need to re-fetch resources when workspace changes
  - Currently when ns changes we always go to an invalid state first
  - Single NS (show list & fetch resources) --> Multiple NS (hide list) --> Single NS (show list & fetch resources)
  - For workspace we skip the middle part and don't fetch with latest
2022-12-02 12:30:13 +00:00
Richard Cox e448505b3c Fixes following review
- Ensure that the correct threshold if fetched from config (was previously always enabled)
- Don't pass additional `namespace` value to `loadDataPage`
2022-12-02 12:30:13 +00:00
Richard Cox 75aa51fab9 Enforce Namespace Filter
- When there are over a configurable amount of resources to display in a list force the user to select a single namespace and use it to fetch resources related to the list
- Disabled by default, this can be enabled via the usual Global Settings --> Performance setting as usual

Functional Comments
- Gates for forcing the filter (count, resource type is namespaced, etc) apply only to the resources shown in the list.
  - For example PV's aren't namespaced, so no enforced filtering. However they fetch PVC's which are namespaced
  - For example we could have 10 resources to show in the list, but the resource types list component fetches 10000 other resources. The secondary resources are not taken in to account
- If we're under the threshold and have fetched all resources, if in that session we go over the threshold we won't fetch NS specific resources (because we have them all already)
- If we're over the threshold and have fetched namespaced resources, if in that session we go under the threshold we will fetch all resources
- If we're over the threshold and have fetched namespaced resources, going to a page that needs them all will result in us fetching them all (for instance from `events` to `cluster dashboard`)
- Deselecting a namespace and selecting it again should not kick off another http request

General Commit Comments
- The threshold to enforce the filter is set at 1500 as per manual fresh and incremental loading
- Optimised some code in ResourceList, resource-fetch and $loadingResources
2022-12-02 12:30:13 +00:00
Alexandre Alves 1a9fea755c
update url for namespaced requests for secondary data (#7365)
* update url for namespaced requests for secondary data

* remove unnecessary type and id setting on resource-manager as for all requests now come from Steve api + fix issue where changing namespace on workload creation would cause an error on PVC because of undefined value

Co-authored-by: Alexandre Alves <aalves@Alexandres-MacBook-Pro.local>
Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
2022-11-25 16:51:57 +00: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 75c01c7ab7
Validation for the minimum length requirement for user password setting (#6897)
* Convert Rancher settings into Typescript and add interface

* Allow Rancher settings to be validated

* Add Rancher Settings min password length validation

* Replace settings number input with labeled input of type number for validation; Added missing required, focus, locale and labels attributes

* Add min/max/between value/length cases to global validation cases

* Correct validation syntax

* Add tests for the global settings

* Correct naming and assign directly rules to the inputs

* Create initial tests for CreateEditView

* Prevent Settings view to break if no setting is found for given ID

* Add max password length validation

* Add i18n to settings validation

* Add form validation to the CRUD component

* Prevent form to fail for resource types without validation

* Add test for no validation cases

* Remove form validation in favor of local view logic, due complexity issues

* Correct validator linting issue

* Correct i18n; Add types; Correct min/max/between validations i18n and combine the last

* Add translation type

* Correct validation translation types and definitions

* Replace custom validations with predefined rules

* Reintroduce form validation in abstracted configuration to pass settings through

* Add tests for new generic form validations

* Correct between values and length validation

* Split tests to use pre-existing rulesets due complexity and different cases

* Cleanup jsdoc in form validation

* Cleanup form validation mixin

* Add global settings test for generating rules from config

* Replace value.value with value for validating the resource

* Correct validation call and test instantiation

* Add note about value.value exception

* Disable faulty test due lacks of information

* Replace min/max value validation with between

* Add missing type for settings getter

* Move type folder within shell

* Move settings logic from config to utils
2022-11-15 15:32:02 +01:00
Neil MacDougall 6d15349c45
Fix brand for csp (#7428) 2022-11-14 16:28:41 +00:00
Neil MacDougall fcbdf97706
Fix issue where brand is not set on authenticated pages (#7311) 2022-11-01 11:24:37 +00:00
Alexandre Alves df41dc2f58
store 'type' prop before overwriting it for classify (#7225)
Co-authored-by: Alexandre Alves <aalves@Alexandres-MacBook-Pro.local>
2022-10-19 11:59:33 +01:00