@rancher/shell 3.0.5-rc.3 → 3.0.5-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/data/aws-regions.json +1 -0
- package/assets/images/icons/document.svg +3 -0
- package/assets/images/key.svg +17 -0
- package/assets/images/vendor/cognito.svg +1 -0
- package/assets/styles/app.scss +1 -0
- package/assets/styles/base/_basic.scss +10 -0
- package/assets/styles/base/_spacing.scss +29 -0
- package/assets/styles/global/_form.scss +1 -1
- package/assets/styles/global/_labeled-input.scss +1 -1
- package/assets/styles/global/_layout.scss +1 -1
- package/assets/styles/themes/_dark.scss +28 -0
- package/assets/styles/themes/_light.scss +68 -0
- package/assets/styles/vendor/vue-select.scss +1 -1
- package/assets/translations/en-us.yaml +721 -83
- package/assets/translations/zh-hans.yaml +11 -9
- package/cloud-credential/gcp.vue +9 -1
- package/components/AppModal.vue +2 -0
- package/components/Certificates.vue +5 -0
- package/components/CodeMirror.vue +1 -1
- package/components/ConfigMapSettings/Settings.vue +377 -0
- package/components/ConfigMapSettings/index.vue +354 -0
- package/components/CruResource.vue +1 -2
- package/components/DetailText.vue +61 -11
- package/components/Drawer/Chrome.vue +116 -0
- package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +61 -0
- package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +48 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/ConfigTab.test.ts +54 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/YamlTab.test.ts +80 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/composables.test.ts +82 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/helpers.test.ts +42 -0
- package/components/Drawer/ResourceDetailDrawer/composables.ts +50 -0
- package/components/Drawer/ResourceDetailDrawer/helpers.ts +10 -0
- package/components/Drawer/ResourceDetailDrawer/index.vue +110 -0
- package/components/FilterPanel.vue +156 -0
- package/components/{fleet/ForceDirectedTreeChart/index.vue → ForceDirectedTreeChart.vue} +47 -41
- package/components/GrowlManager.vue +16 -15
- package/components/IconOrSvg.vue +19 -35
- package/components/KeyValueView.vue +1 -1
- package/components/LocaleSelector.vue +9 -1
- package/components/ProgressBarMulti.vue +1 -0
- package/components/PromptModal.vue +6 -1
- package/components/PromptRemove.vue +5 -1
- package/components/RelatedResources.vue +4 -12
- package/components/Resource/Detail/Additional.vue +46 -0
- package/components/Resource/Detail/Card/PodsCard/Bubble.vue +13 -0
- package/components/Resource/Detail/Card/PodsCard/composable.ts +30 -0
- package/components/Resource/Detail/Card/PodsCard/index.vue +118 -0
- package/components/Resource/Detail/Card/ResourceUsageCard/composable.ts +51 -0
- package/components/Resource/Detail/Card/ResourceUsageCard/index.vue +79 -0
- package/components/Resource/Detail/Card/Scaler.vue +89 -0
- package/components/Resource/Detail/Card/StateCard/composables.ts +112 -0
- package/components/Resource/Detail/Card/StateCard/index.vue +39 -0
- package/components/Resource/Detail/Card/VerticalGap.vue +11 -0
- package/components/Resource/Detail/Card/__tests__/Card.test.ts +36 -0
- package/components/Resource/Detail/Card/__tests__/PodsCard.test.ts +84 -0
- package/components/Resource/Detail/Card/__tests__/ResourceUsageCard.test.ts +72 -0
- package/components/Resource/Detail/Card/__tests__/Scaler.test.ts +87 -0
- package/components/Resource/Detail/Card/__tests__/StateCard.test.ts +53 -0
- package/components/Resource/Detail/Card/__tests__/VerticalGap.test.ts +14 -0
- package/components/Resource/Detail/Card/__tests__/index.test.ts +36 -0
- package/components/Resource/Detail/Card/index.vue +56 -0
- package/components/Resource/Detail/Metadata/Annotations/__tests__/index.test.ts +19 -0
- package/components/Resource/Detail/Metadata/Annotations/composable.ts +12 -0
- package/components/Resource/Detail/Metadata/Annotations/index.vue +31 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/identifying-fields.test.ts +223 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/index.test.ts +103 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/composable.ts +64 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/identifying-fields.ts +298 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +133 -0
- package/components/Resource/Detail/Metadata/KeyValue.vue +138 -0
- package/components/Resource/Detail/Metadata/Labels/__tests__/index.test.ts +18 -0
- package/components/Resource/Detail/Metadata/Labels/composable.ts +12 -0
- package/components/Resource/Detail/Metadata/Labels/index.vue +31 -0
- package/components/Resource/Detail/Metadata/Rectangle.vue +32 -0
- package/components/Resource/Detail/Metadata/__tests__/KeyValue.test.ts +107 -0
- package/components/Resource/Detail/Metadata/__tests__/Rectangle.test.ts +24 -0
- package/components/Resource/Detail/Metadata/__tests__/composables.test.ts +75 -0
- package/components/Resource/Detail/Metadata/__tests__/index.test.ts +91 -0
- package/components/Resource/Detail/Metadata/composables.ts +78 -0
- package/components/Resource/Detail/Metadata/index.vue +73 -0
- package/components/Resource/Detail/Page.vue +37 -0
- package/components/Resource/Detail/PercentageBar.vue +40 -0
- package/components/Resource/Detail/ResourceRow.vue +138 -0
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/__tests__/composables.test.ts +29 -0
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/__tests__/index.test.ts +48 -0
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/composables.ts +31 -0
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/index.vue +50 -0
- package/components/Resource/Detail/ResourceTabs/KnownHostsTab/__tests__/composables.test.ts +66 -0
- package/components/Resource/Detail/ResourceTabs/KnownHostsTab/composables.ts +21 -0
- package/components/Resource/Detail/ResourceTabs/KnownHostsTab/index.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Basic.vue +45 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/BasicAuth.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Certificate.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Registry.vue +22 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/ServiceAccountToken.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Ssh.vue +32 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Basic.test.ts +40 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/BasicAuth.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Certificate.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Registry.test.ts +27 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/ServiceAccountToken.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Ssh.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/auth-types.test.ts +186 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/composables.test.ts +102 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/auth-types.ts +109 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/composeables.ts +52 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/index.vue +71 -0
- package/components/Resource/Detail/SpacedRow.vue +14 -0
- package/components/Resource/Detail/StatusBar.vue +59 -0
- package/components/Resource/Detail/StatusRow.vue +61 -0
- package/components/Resource/Detail/TitleBar/Title.vue +14 -0
- package/components/Resource/Detail/TitleBar/Top.vue +14 -0
- package/components/Resource/Detail/TitleBar/__tests__/Title.test.ts +17 -0
- package/components/Resource/Detail/TitleBar/__tests__/Top.test.ts +17 -0
- package/components/Resource/Detail/TitleBar/__tests__/composables.test.ts +63 -0
- package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +142 -0
- package/components/Resource/Detail/TitleBar/composables.ts +44 -0
- package/components/Resource/Detail/TitleBar/index.vue +196 -0
- package/components/Resource/Detail/Top/index.vue +34 -0
- package/components/Resource/Detail/__tests__/Page.test.ts +32 -0
- package/components/Resource/Detail/composables.ts +45 -0
- package/components/ResourceDetail/Masthead/__tests__/index.test.ts +70 -0
- package/components/ResourceDetail/{__tests__/Masthead.test.ts → Masthead/__tests__/legacy.test.ts} +3 -3
- package/components/ResourceDetail/Masthead/index.vue +65 -0
- package/components/ResourceDetail/Masthead/latest.vue +44 -0
- package/components/ResourceDetail/__tests__/index.test.ts +135 -0
- package/components/ResourceDetail/index.vue +73 -557
- package/components/ResourceDetail/legacy.vue +562 -0
- package/components/ResourceList/Masthead.vue +6 -0
- package/components/ResourceTable.vue +41 -7
- package/components/ResourceYaml.vue +14 -1
- package/components/SlideInPanelManager.vue +117 -10
- package/components/SortableTable/index.vue +13 -2
- package/components/SortableTable/selection.js +21 -8
- package/components/StateDot/index.vue +28 -0
- package/components/StatusBadge.vue +6 -4
- package/components/SubtleLink.vue +25 -0
- package/components/Tabbed/index.vue +11 -15
- package/components/Wizard.vue +16 -3
- package/components/YamlEditor.vue +1 -1
- package/components/__tests__/ConfigMapSettings.test.ts +376 -0
- package/components/__tests__/FilterPanel.test.ts +81 -0
- package/components/__tests__/GrowlManager.test.ts +0 -25
- package/components/auth/AuthBanner.vue +2 -3
- package/components/auth/RoleDetailEdit.vue +45 -3
- package/components/auth/login/ldap.vue +1 -1
- package/components/auth/login/oidc.vue +6 -1
- package/components/fleet/FleetApplications.vue +174 -0
- package/components/fleet/FleetClusterTargets/TargetsList.vue +66 -0
- package/components/fleet/FleetClusterTargets/index.vue +455 -0
- package/components/fleet/FleetClusters.vue +25 -6
- package/components/fleet/FleetGitRepoPaths.vue +476 -0
- package/components/fleet/FleetHelmOps.vue +123 -0
- package/components/fleet/FleetIntro.vue +58 -28
- package/components/fleet/FleetNoWorkspaces.vue +5 -1
- package/components/fleet/FleetOCIStorageSecret.vue +171 -0
- package/components/fleet/FleetRepos.vue +37 -80
- package/components/fleet/FleetResources.vue +53 -26
- package/components/fleet/FleetSummary.vue +26 -51
- package/components/fleet/FleetValuesFrom.vue +295 -0
- package/components/fleet/__tests__/FleetClusterTargets.test.ts +1224 -0
- package/components/fleet/__tests__/FleetGitRepoPaths.test.ts +265 -0
- package/components/fleet/__tests__/FleetOCIStorageSecret.test.ts +213 -0
- package/components/fleet/__tests__/FleetSummary.test.ts +39 -39
- package/components/fleet/__tests__/FleetValuesFrom.test.ts +300 -0
- package/components/fleet/dashboard/Empty.vue +73 -0
- package/components/fleet/dashboard/ResourceCard.vue +184 -0
- package/components/fleet/dashboard/ResourceCardSummary.vue +195 -0
- package/components/fleet/dashboard/ResourceDetails.vue +194 -0
- package/components/fleet/dashboard/ResourcePanel.vue +383 -0
- package/components/form/ArrayList.vue +19 -2
- package/components/form/ChangePassword.vue +3 -1
- package/components/form/Footer.vue +10 -4
- package/components/form/KeyValue.vue +81 -43
- package/components/form/LabeledSelect.vue +56 -16
- package/components/form/Labels.vue +90 -17
- package/components/form/MatchExpressions.vue +46 -5
- package/components/form/NameNsDescription.vue +1 -1
- package/components/form/ResourceSelector.vue +1 -0
- package/components/form/ResourceTabs/index.vue +5 -0
- package/components/form/SecretSelector.vue +9 -2
- package/components/form/Select.vue +57 -19
- package/components/form/SimpleSecretSelector.vue +17 -4
- package/components/form/Taints.vue +21 -2
- package/components/form/UnitInput.vue +8 -0
- package/components/form/ValueFromResource.vue +31 -19
- package/components/form/__tests__/LabeledSelect.test.ts +8 -4
- package/components/form/__tests__/Labels.test.ts +360 -0
- package/components/form/__tests__/MatchExpressions.test.ts +16 -13
- package/components/form/__tests__/Select.test.ts +5 -2
- package/components/formatter/FleetApplicationClustersReady.vue +77 -0
- package/components/formatter/FleetApplicationSource.vue +71 -0
- package/components/formatter/FleetSummaryGraph.vue +7 -0
- package/components/formatter/WorkloadHealthScale.vue +1 -1
- package/components/google/AccountAccess.vue +211 -0
- package/components/google/types/gcp.d.ts +136 -0
- package/components/google/types/index.d.ts +101 -0
- package/components/google/util/__mocks__/gcp.ts +465 -0
- package/components/google/util/formatter.ts +82 -0
- package/components/google/util/gcp.ts +134 -0
- package/components/google/util/index.d.ts +11 -0
- package/components/nav/Favorite.vue +1 -1
- package/components/nav/Group.vue +70 -47
- package/components/nav/Header.vue +13 -8
- package/components/nav/NamespaceFilter.vue +13 -1
- package/components/nav/NotificationCenter/Notification.vue +510 -0
- package/components/nav/NotificationCenter/NotificationHeader.vue +112 -0
- package/components/nav/NotificationCenter/index.vue +148 -0
- package/components/nav/TopLevelMenu.helper.ts +55 -34
- package/components/nav/TopLevelMenu.vue +11 -0
- package/components/nav/Type.vue +4 -1
- package/composables/drawer.ts +26 -0
- package/composables/resources.test.ts +63 -0
- package/composables/resources.ts +38 -0
- package/composables/useI18n.ts +12 -11
- package/composables/useIsNewDetailPageEnabled.ts +17 -0
- package/config/labels-annotations.js +20 -11
- package/config/product/auth.js +17 -1
- package/config/product/{cis.js → compliance.js} +23 -26
- package/config/product/explorer.js +5 -1
- package/config/product/fleet.js +77 -17
- package/config/product/settings.js +22 -11
- package/config/query-params.js +6 -1
- package/config/roles.ts +2 -1
- package/config/router/navigation-guards/authentication.js +51 -2
- package/config/router/routes.js +45 -31
- package/config/secret.ts +15 -0
- package/config/settings.ts +24 -5
- package/config/store.js +2 -0
- package/config/system-namespaces.js +1 -1
- package/config/table-headers.js +53 -23
- package/config/types.js +17 -6
- package/core/plugin-helpers.ts +3 -2
- package/core/plugin.ts +32 -7
- package/core/types.ts +18 -1
- package/detail/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +22 -18
- package/detail/fleet.cattle.io.cluster.vue +28 -15
- package/detail/fleet.cattle.io.gitrepo.vue +10 -1
- package/detail/fleet.cattle.io.helmop.vue +157 -0
- package/detail/management.cattle.io.fleetworkspace.vue +18 -27
- package/detail/management.cattle.io.oidcclient.vue +369 -0
- package/detail/node.vue +2 -2
- package/detail/pod.vue +2 -2
- package/detail/service.vue +10 -1
- package/detail/workload/index.vue +8 -2
- package/dialog/ExtensionCatalogUninstallDialog.vue +7 -4
- package/dialog/GenericPrompt.vue +1 -1
- package/dialog/HelmOpForceUpdateDialog.vue +132 -0
- package/dialog/ImportDialog.vue +8 -8
- package/dialog/OidcClientSecretDialog.vue +117 -0
- package/dialog/RedeployWorkloadDialog.vue +164 -0
- package/edit/__tests__/cis.cattle.io.clusterscan.test.ts +3 -3
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +60 -68
- package/edit/auth/oidc.vue +159 -93
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +4 -1
- package/edit/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +30 -31
- package/edit/{cis.cattle.io.clusterscanbenchmark.vue → compliance.cattle.io.clusterscanbenchmark.vue} +4 -4
- package/edit/{cis.cattle.io.clusterscanprofile.vue → compliance.cattle.io.clusterscanprofile.vue} +5 -5
- package/edit/configmap.vue +4 -1
- package/edit/constraints.gatekeeper.sh.constraint/index.vue +1 -0
- package/edit/fleet.cattle.io.gitrepo.vue +70 -255
- package/edit/fleet.cattle.io.helmop.vue +772 -0
- package/edit/helm.cattle.io.projecthelmchart.vue +1 -0
- package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +1 -0
- package/edit/logging-flow/index.vue +1 -0
- package/edit/logging.banzaicloud.io.output/index.vue +1 -0
- package/edit/management.cattle.io.fleetworkspace.vue +44 -10
- package/edit/management.cattle.io.oidcclient.vue +162 -0
- package/edit/management.cattle.io.project.vue +4 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +5 -0
- package/edit/monitoring.coreos.com.prometheusrule/index.vue +1 -0
- package/edit/monitoring.coreos.com.receiver/auth.vue +30 -30
- package/edit/monitoring.coreos.com.receiver/index.vue +1 -0
- package/edit/monitoring.coreos.com.receiver/types/email.vue +1 -1
- package/edit/monitoring.coreos.com.route.vue +1 -0
- package/edit/namespace.vue +1 -0
- package/edit/networking.istio.io.destinationrule/index.vue +4 -1
- package/edit/networking.k8s.io.ingress/index.vue +4 -1
- package/edit/networking.k8s.io.networkpolicy/PolicyRules.vue +7 -2
- package/edit/networking.k8s.io.networkpolicy/index.vue +6 -2
- package/edit/node.vue +1 -0
- package/edit/persistentvolume/index.vue +4 -1
- package/edit/provisioning.cattle.io.cluster/rke2.vue +418 -382
- package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +27 -27
- package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +5 -0
- package/edit/resources.cattle.io.restore.vue +1 -1
- package/edit/secret/index.vue +1 -0
- package/edit/service.vue +4 -1
- package/edit/serviceaccount.vue +4 -1
- package/edit/storage.k8s.io.storageclass/index.vue +4 -1
- package/edit/workload/index.vue +5 -0
- package/list/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +2 -2
- package/list/fleet.cattle.io.gitrepo.vue +1 -1
- package/list/fleet.cattle.io.helmop.vue +108 -0
- package/list/management.cattle.io.oidcclient.vue +108 -0
- package/list/namespace.vue +5 -2
- package/list/node.vue +2 -0
- package/machine-config/amazonec2.vue +3 -24
- package/machine-config/components/GCEImage.vue +374 -0
- package/machine-config/google.vue +617 -0
- package/mixins/__tests__/brand.spec.ts +170 -0
- package/mixins/auth-config.js +8 -1
- package/mixins/brand.js +16 -17
- package/mixins/create-edit-view/index.js +5 -0
- package/mixins/preset.js +100 -0
- package/mixins/resource-fetch-api-pagination.js +18 -0
- package/mixins/resource-fetch.js +1 -1
- package/mixins/resource-table-watch.js +45 -0
- package/mixins/vue-select-overrides.js +1 -0
- package/models/__tests__/chart.test.ts +273 -0
- package/models/__tests__/fleet.cattle.io.gitrepo.test.ts +1 -1
- package/models/chart.js +144 -2
- package/models/{cis.cattle.io.clusterscan.js → compliance.cattle.io.clusterscan.js} +8 -8
- package/models/{cis.cattle.io.clusterscanbenchmark.js → compliance.cattle.io.clusterscanbenchmark.js} +1 -1
- package/models/{cis.cattle.io.clusterscanprofile.js → compliance.cattle.io.clusterscanprofile.js} +5 -5
- package/models/{cis.cattle.io.clusterscanreport.js → compliance.cattle.io.clusterscanreport.js} +1 -1
- package/models/fleet-application.js +314 -0
- package/models/fleet.cattle.io.bundle.js +9 -8
- package/models/fleet.cattle.io.cluster.js +11 -0
- package/models/fleet.cattle.io.gitrepo.js +41 -365
- package/models/fleet.cattle.io.helmop.js +198 -0
- package/models/management.cattle.io.authconfig.js +1 -0
- package/models/management.cattle.io.fleetworkspace.js +14 -1
- package/models/management.cattle.io.oidcclient.js +18 -0
- package/models/management.cattle.io.registration.js +3 -0
- package/models/provisioning.cattle.io.cluster.js +5 -5
- package/models/service.js +4 -0
- package/models/workload.js +19 -18
- package/package.json +2 -1
- package/pages/about.vue +4 -58
- package/pages/auth/login.vue +1 -1
- package/pages/auth/verify.vue +13 -1
- package/pages/c/_cluster/apps/charts/AddRepoLink.vue +36 -0
- package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +80 -0
- package/pages/c/_cluster/apps/charts/AppChartCardSubHeader.vue +54 -0
- package/pages/c/_cluster/apps/charts/StatusLabel.vue +33 -0
- package/pages/c/_cluster/apps/charts/index.vue +487 -465
- package/pages/c/_cluster/auth/user.retention/index.vue +87 -78
- package/pages/c/_cluster/explorer/EventsTable.vue +1 -1
- package/pages/c/_cluster/explorer/index.vue +3 -3
- package/pages/c/_cluster/explorer/tools/pages/_page.vue +0 -1
- package/pages/c/_cluster/fleet/__tests__/index.test.ts +426 -0
- package/pages/c/_cluster/fleet/application/_resource/_id.vue +14 -0
- package/pages/c/_cluster/fleet/application/_resource/create.vue +14 -0
- package/pages/c/_cluster/fleet/application/create.vue +341 -0
- package/pages/c/_cluster/fleet/application/index.vue +139 -0
- package/pages/c/_cluster/fleet/graph/config.js +277 -0
- package/pages/c/_cluster/fleet/index.vue +809 -329
- package/pages/c/_cluster/fleet/settings/index.vue +229 -0
- package/pages/c/_cluster/longhorn/index.vue +5 -2
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +16 -1
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +2 -2
- package/pages/explorer/resource/detail/configmap.vue +42 -0
- package/pages/explorer/resource/detail/secret.vue +50 -0
- package/pages/home.vue +9 -55
- package/pages/support/index.vue +4 -6
- package/plugins/dashboard-store/actions.js +50 -14
- package/plugins/dashboard-store/getters.js +38 -21
- package/plugins/dashboard-store/mutations.js +51 -7
- package/plugins/dashboard-store/resource-class.js +30 -4
- package/plugins/steve/__tests__/subscribe.spec.ts +66 -1
- package/plugins/steve/actions.js +3 -0
- package/plugins/steve/steve-pagination-utils.ts +17 -8
- package/plugins/steve/subscribe.js +235 -43
- package/rancher-components/BadgeState/BadgeState.vue +3 -1
- package/rancher-components/Banner/Banner.vue +13 -0
- package/rancher-components/Form/Checkbox/Checkbox.vue +11 -6
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +1 -1
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +1 -0
- package/rancher-components/RcItemCard/RcItemCard.test.ts +189 -0
- package/rancher-components/RcItemCard/RcItemCard.vue +430 -0
- package/rancher-components/RcItemCard/RcItemCardAction.vue +24 -0
- package/rancher-components/RcItemCard/index.ts +2 -0
- package/store/auth.js +3 -0
- package/store/catalog.js +85 -25
- package/store/growl.js +97 -8
- package/store/index.js +39 -14
- package/store/notifications.ts +426 -0
- package/store/prefs.js +0 -1
- package/store/slideInPanel.ts +6 -0
- package/store/type-map.js +19 -15
- package/store/uiplugins.ts +15 -1
- package/types/fleet.d.ts +59 -0
- package/types/notifications/index.ts +74 -0
- package/types/resources/settings.d.ts +19 -1
- package/types/shell/index.d.ts +388 -307
- package/types/store/dashboard-store.types.ts +33 -3
- package/types/store/pagination.types.ts +6 -1
- package/types/store/subscribe.types.ts +50 -0
- package/utils/__tests__/fleet.test.ts +148 -0
- package/utils/__tests__/object.test.ts +54 -1
- package/utils/__tests__/string.test.ts +273 -1
- package/utils/__tests__/time.test.ts +31 -0
- package/utils/auth.js +41 -5
- package/utils/crypto/encryption.ts +103 -0
- package/utils/cspAdaptor.ts +51 -0
- package/utils/fleet-types.ts +0 -0
- package/utils/fleet.ts +190 -2
- package/utils/object.js +36 -0
- package/utils/pagination-utils.ts +27 -2
- package/utils/pagination-wrapper.ts +132 -50
- package/utils/release-notes.ts +48 -0
- package/utils/selector-typed.ts +7 -2
- package/utils/settings.ts +4 -1
- package/utils/string.js +24 -0
- package/utils/style.ts +39 -0
- package/utils/{time.js → time.ts} +25 -6
- package/utils/uiplugins.ts +22 -0
- package/utils/validators/formRules/__tests__/index.test.ts +36 -3
- package/utils/validators/formRules/index.ts +13 -3
- package/utils/window.js +11 -7
- package/components/__tests__/ApplicationCard.test.ts +0 -27
- package/components/cards/ApplicationCard.vue +0 -145
- package/components/fleet/ForceDirectedTreeChart/chartIcons.js +0 -17
- package/config/product/legacy.js +0 -62
- package/config/secret.js +0 -14
- package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +0 -249
- package/pages/c/_cluster/legacy/pages/_page.vue +0 -29
- package/pages/c/_cluster/legacy/project/_page.vue +0 -57
- package/pages/c/_cluster/legacy/project/index.vue +0 -32
- package/pages/c/_cluster/legacy/project/pipelines.vue +0 -96
- /package/components/ResourceDetail/{Masthead.vue → Masthead/legacy.vue} +0 -0
- /package/{components/form/SSHKnownHosts → dialog}/__tests__/KnownHostsEditDialog.test.ts +0 -0
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import ConfigMapSettings, { Setting } from '@shell/components/ConfigMapSettings/index.vue';
|
|
4
|
+
import { _EDIT } from '@shell/config/query-params';
|
|
5
|
+
import { CONFIG_MAP } from '@shell/config/types';
|
|
6
|
+
import jsyaml from 'js-yaml';
|
|
7
|
+
|
|
8
|
+
const mockedStore = () => {
|
|
9
|
+
return {
|
|
10
|
+
getters: {
|
|
11
|
+
'cluster/schemaFor': jest.fn(),
|
|
12
|
+
'management/schemaFor': jest.fn(),
|
|
13
|
+
'i18n/t': (text: string, v = {}) => {
|
|
14
|
+
return `${ text }${ Object.values(v) }`;
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const mockedRoute = { query: {} };
|
|
21
|
+
|
|
22
|
+
const requiredSetup = () => {
|
|
23
|
+
return {
|
|
24
|
+
global: {
|
|
25
|
+
mocks: {
|
|
26
|
+
$store: mockedStore(),
|
|
27
|
+
$route: mockedRoute,
|
|
28
|
+
$fetchState: {},
|
|
29
|
+
},
|
|
30
|
+
stubs: { AsyncButton: true }
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const settings = {
|
|
36
|
+
garbageCollectionInterval: {
|
|
37
|
+
weight: 0,
|
|
38
|
+
type: 'string',
|
|
39
|
+
path: 'garbageCollectionInterval',
|
|
40
|
+
default: '15m',
|
|
41
|
+
},
|
|
42
|
+
garbageCollectionIntervalNumber: {
|
|
43
|
+
weight: 0,
|
|
44
|
+
type: 'number',
|
|
45
|
+
handler: 'UnitInput',
|
|
46
|
+
path: 'garbageCollectionIntervalNumber',
|
|
47
|
+
default: '15m',
|
|
48
|
+
},
|
|
49
|
+
gitClientTimeout: {
|
|
50
|
+
weight: 1,
|
|
51
|
+
type: 'string',
|
|
52
|
+
path: 'gitClientTimeout',
|
|
53
|
+
default: '30s',
|
|
54
|
+
},
|
|
55
|
+
gitClientTimeoutNumber: {
|
|
56
|
+
weight: 1,
|
|
57
|
+
type: 'number',
|
|
58
|
+
handler: 'UnitInput',
|
|
59
|
+
path: 'gitClientTimeoutNumber',
|
|
60
|
+
default: '30s',
|
|
61
|
+
},
|
|
62
|
+
gitjobReplicas: {
|
|
63
|
+
weight: 1,
|
|
64
|
+
type: 'number',
|
|
65
|
+
path: 'gitjob.replicas',
|
|
66
|
+
default: 1,
|
|
67
|
+
},
|
|
68
|
+
multiSelect: {
|
|
69
|
+
weight: 4,
|
|
70
|
+
type: 'array',
|
|
71
|
+
path: 'multiSelect',
|
|
72
|
+
default: 'foo',
|
|
73
|
+
items: [{
|
|
74
|
+
type: 'string',
|
|
75
|
+
value: 'foo'
|
|
76
|
+
}, {
|
|
77
|
+
type: 'string',
|
|
78
|
+
value: 'bar'
|
|
79
|
+
}],
|
|
80
|
+
},
|
|
81
|
+
singleSelect: {
|
|
82
|
+
weight: 1,
|
|
83
|
+
type: 'string',
|
|
84
|
+
items: [{
|
|
85
|
+
type: 'string',
|
|
86
|
+
value: 'strict'
|
|
87
|
+
}, {
|
|
88
|
+
type: 'string',
|
|
89
|
+
value: 'system-store'
|
|
90
|
+
}],
|
|
91
|
+
path: 'agentTLSMode',
|
|
92
|
+
default: 'system-store',
|
|
93
|
+
},
|
|
94
|
+
nodeSelector: {
|
|
95
|
+
weight: 1,
|
|
96
|
+
type: 'object',
|
|
97
|
+
handler: 'Textarea',
|
|
98
|
+
path: 'nodeSelector',
|
|
99
|
+
default: {},
|
|
100
|
+
},
|
|
101
|
+
nodeSelectorKeyValue: {
|
|
102
|
+
weight: 1,
|
|
103
|
+
type: 'object',
|
|
104
|
+
handler: 'KeyValue',
|
|
105
|
+
path: 'nodeSelectorKeyValue',
|
|
106
|
+
default: { foo: 'val' },
|
|
107
|
+
},
|
|
108
|
+
debug: {
|
|
109
|
+
weight: 1,
|
|
110
|
+
type: 'boolean',
|
|
111
|
+
path: 'debug',
|
|
112
|
+
default: false,
|
|
113
|
+
},
|
|
114
|
+
tolerationsTaints: {
|
|
115
|
+
weight: 2,
|
|
116
|
+
type: 'object',
|
|
117
|
+
handler: 'Taints',
|
|
118
|
+
path: 'tolerationsTaints',
|
|
119
|
+
default: [{
|
|
120
|
+
key: 'foo1',
|
|
121
|
+
value: 'bar1',
|
|
122
|
+
effect: 'PreferNoSchedule'
|
|
123
|
+
}],
|
|
124
|
+
},
|
|
125
|
+
} as Record<string, Setting>;
|
|
126
|
+
|
|
127
|
+
const groups = [{
|
|
128
|
+
name: 'general',
|
|
129
|
+
children: [
|
|
130
|
+
'garbageCollectionInterval',
|
|
131
|
+
'gitClientTimeout'
|
|
132
|
+
],
|
|
133
|
+
expanded: true,
|
|
134
|
+
weight: 0
|
|
135
|
+
}];
|
|
136
|
+
|
|
137
|
+
const configMap = {
|
|
138
|
+
type: CONFIG_MAP,
|
|
139
|
+
metadata: {
|
|
140
|
+
namespace: 'ns',
|
|
141
|
+
name: 'name'
|
|
142
|
+
},
|
|
143
|
+
data: {
|
|
144
|
+
fleet: jsyaml.dump({
|
|
145
|
+
foo: 'bar',
|
|
146
|
+
garbageCollectionInterval: '1h',
|
|
147
|
+
gitjob: { replicas: 5 },
|
|
148
|
+
debug: true,
|
|
149
|
+
nodeSelector: { key: 'value1' },
|
|
150
|
+
garbageCollectionIntervalNumber: '14m',
|
|
151
|
+
gitClientTimeoutNumber: '3m',
|
|
152
|
+
nodeSelectorKeyValue: { foo: 'bar' },
|
|
153
|
+
tolerationsTaints: [{
|
|
154
|
+
key: 'foo',
|
|
155
|
+
value: 'bar',
|
|
156
|
+
effect: 'PreferNoSchedule'
|
|
157
|
+
}]
|
|
158
|
+
}),
|
|
159
|
+
foo: { bar: 'value' }
|
|
160
|
+
},
|
|
161
|
+
save: () => {},
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
describe('component: ConfigMapSettings', () => {
|
|
165
|
+
it('should init values from settings descriptor default values, having ConfigMap === null', async() => {
|
|
166
|
+
const wrapper = mount(ConfigMapSettings, {
|
|
167
|
+
...requiredSetup(),
|
|
168
|
+
props: {
|
|
169
|
+
settings,
|
|
170
|
+
groups,
|
|
171
|
+
name: 'cm-name',
|
|
172
|
+
namespace: 'cm-namespace',
|
|
173
|
+
dataKey: 'fleet'
|
|
174
|
+
},
|
|
175
|
+
computed: {
|
|
176
|
+
mode: () => _EDIT,
|
|
177
|
+
canEdit: () => true,
|
|
178
|
+
fetchState: () => ({ $fetchState: false }),
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
wrapper.vm.initValues();
|
|
183
|
+
|
|
184
|
+
await wrapper.vm.$nextTick();
|
|
185
|
+
|
|
186
|
+
const generalGroup = wrapper.find('[data-testid="cm-settings-group-body-general"]');
|
|
187
|
+
|
|
188
|
+
const garbageCollectionInterval = wrapper.find('[data-testid="cm-settings-field-string-garbageCollectionInterval"]').element as HTMLInputElement;
|
|
189
|
+
const garbageCollectionIntervalNumber = wrapper.find('[data-testid="cm-settings-field-number-UnitInput-garbageCollectionIntervalNumber"]').element as HTMLInputElement;
|
|
190
|
+
const gitClientTimeout = wrapper.find('[data-testid="cm-settings-field-string-gitClientTimeout"]').element as HTMLInputElement;
|
|
191
|
+
const gitClientTimeoutNumber = wrapper.find('[data-testid="cm-settings-field-number-UnitInput-gitClientTimeoutNumber"]').element as HTMLInputElement;
|
|
192
|
+
const gitjobReplicas = wrapper.find('[data-testid="cm-settings-field-number-gitjobReplicas"]').element as HTMLInputElement;
|
|
193
|
+
const multiSelect = wrapper.find('[data-testid="cm-settings-field-array-multiSelect"]').element as HTMLInputElement;
|
|
194
|
+
const nodeSelector = wrapper.find('[data-testid="cm-settings-field-object-Textarea-nodeSelector"]').element as HTMLInputElement;
|
|
195
|
+
const nodeSelectorKeyValue = wrapper.find('[data-testid="cm-settings-field-object-KeyValue-nodeSelectorKeyValue"]').find('[data-testid="input-kv-item-key-0"]').element as HTMLInputElement;
|
|
196
|
+
const tolerationsTaints = wrapper.find('[data-testid="cm-settings-field-object-Taints-tolerationsTaints"]').find('[data-testid="input-kv-item-key-0"]').element as HTMLInputElement;
|
|
197
|
+
const singleSelect = wrapper.find('[data-testid="cm-settings-field-string-singleSelect"]').element as HTMLInputElement;
|
|
198
|
+
const debug = wrapper.find('[data-testid="cm-settings-field-boolean-debug"]').find('input[type="checkbox"]').element as HTMLInputElement;
|
|
199
|
+
|
|
200
|
+
expect(generalGroup.exists()).toBe(true);
|
|
201
|
+
expect(garbageCollectionInterval.value).toBe('15m');
|
|
202
|
+
expect(garbageCollectionIntervalNumber.value).toBe('900');
|
|
203
|
+
expect(gitClientTimeout.value).toBe('30s');
|
|
204
|
+
expect(gitClientTimeoutNumber.value).toBe('30');
|
|
205
|
+
expect(multiSelect.textContent).toContain('foo');
|
|
206
|
+
expect(singleSelect.textContent).toContain('system-store');
|
|
207
|
+
expect(nodeSelector.value).toBe('{}');
|
|
208
|
+
expect(nodeSelectorKeyValue.value).toBe('foo');
|
|
209
|
+
expect(tolerationsTaints.value).toBe('foo1');
|
|
210
|
+
expect(gitjobReplicas.value).toBe('1');
|
|
211
|
+
expect(debug.checked).toBe(false);
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
it('should display error when parsing malformed values', async() => {
|
|
215
|
+
const wrapper = mount(ConfigMapSettings, {
|
|
216
|
+
...requiredSetup(),
|
|
217
|
+
props: {
|
|
218
|
+
settings,
|
|
219
|
+
groups,
|
|
220
|
+
name: 'cm-name',
|
|
221
|
+
namespace: 'cm-namespace',
|
|
222
|
+
dataKey: 'fleet'
|
|
223
|
+
},
|
|
224
|
+
computed: {
|
|
225
|
+
mode: () => _EDIT,
|
|
226
|
+
canEdit: () => true,
|
|
227
|
+
fetchState: () => ({ $fetchState: false }),
|
|
228
|
+
},
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
wrapper.setData({
|
|
232
|
+
configMap: {
|
|
233
|
+
type: CONFIG_MAP,
|
|
234
|
+
metadata: {
|
|
235
|
+
namespace: 'ns',
|
|
236
|
+
name: 'name'
|
|
237
|
+
},
|
|
238
|
+
data: {
|
|
239
|
+
fleet: { foo: 'bar' },
|
|
240
|
+
foo: { bar: 'value' }
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
wrapper.vm.initValues();
|
|
246
|
+
|
|
247
|
+
await wrapper.vm.$nextTick();
|
|
248
|
+
|
|
249
|
+
const error = wrapper.find('[data-testid="cm-settings-error"]');
|
|
250
|
+
|
|
251
|
+
expect(error.text()).toContain('parseError');
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
it('should merge settings descriptor default values with ConfigMap values', async() => {
|
|
255
|
+
const wrapper = mount(ConfigMapSettings, {
|
|
256
|
+
...requiredSetup(),
|
|
257
|
+
props: {
|
|
258
|
+
settings,
|
|
259
|
+
groups,
|
|
260
|
+
name: 'cm-name',
|
|
261
|
+
namespace: 'cm-namespace',
|
|
262
|
+
dataKey: 'fleet'
|
|
263
|
+
},
|
|
264
|
+
computed: {
|
|
265
|
+
mode: () => _EDIT,
|
|
266
|
+
canEdit: () => true,
|
|
267
|
+
fetchState: () => ({ $fetchState: false }),
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
wrapper.setData({ configMap });
|
|
272
|
+
|
|
273
|
+
wrapper.vm.initValues();
|
|
274
|
+
|
|
275
|
+
await wrapper.vm.$nextTick();
|
|
276
|
+
|
|
277
|
+
const garbageCollectionInterval = wrapper.find('[data-testid="cm-settings-field-string-garbageCollectionInterval"]').element as HTMLInputElement;
|
|
278
|
+
const gitClientTimeout = wrapper.find('[data-testid="cm-settings-field-string-gitClientTimeout"]').element as HTMLInputElement;
|
|
279
|
+
const gitjobReplicas = wrapper.find('[data-testid="cm-settings-field-number-gitjobReplicas"]').element as HTMLInputElement;
|
|
280
|
+
const multiSelect = wrapper.find('[data-testid="cm-settings-field-array-multiSelect"]').element as HTMLInputElement;
|
|
281
|
+
const nodeSelector = wrapper.find('[data-testid="cm-settings-field-object-Textarea-nodeSelector"]').element as HTMLInputElement;
|
|
282
|
+
const singleSelect = wrapper.find('[data-testid="cm-settings-field-string-singleSelect"]').element as HTMLInputElement;
|
|
283
|
+
const debug = wrapper.find('[data-testid="cm-settings-field-boolean-debug"]').find('input[type="checkbox"]').element as HTMLInputElement;
|
|
284
|
+
const garbageCollectionIntervalNumber = wrapper.find('[data-testid="cm-settings-field-number-UnitInput-garbageCollectionIntervalNumber"]').element as HTMLInputElement;
|
|
285
|
+
const gitClientTimeoutNumber = wrapper.find('[data-testid="cm-settings-field-number-UnitInput-gitClientTimeoutNumber"]').element as HTMLInputElement;
|
|
286
|
+
const nodeSelectorKeyValue = wrapper.find('[data-testid="cm-settings-field-object-KeyValue-nodeSelectorKeyValue"]').find('[data-testid="input-kv-item-key-0"]').element as HTMLInputElement;
|
|
287
|
+
const tolerationsTaints = wrapper.find('[data-testid="cm-settings-field-object-Taints-tolerationsTaints"]').find('[data-testid="input-kv-item-key-0"]').element as HTMLInputElement;
|
|
288
|
+
|
|
289
|
+
expect(garbageCollectionInterval.value).toBe('1h');
|
|
290
|
+
expect(gitClientTimeout.value).toBe('30s');
|
|
291
|
+
expect(multiSelect.textContent).toContain('foo');
|
|
292
|
+
expect(singleSelect.textContent).toContain('system-store');
|
|
293
|
+
expect(nodeSelector.value).toBe('{\"key\":\"value1\"}');
|
|
294
|
+
expect(gitjobReplicas.value).toBe('5');
|
|
295
|
+
expect(debug.checked).toBe(true);
|
|
296
|
+
expect(garbageCollectionIntervalNumber.value).toBe('840');
|
|
297
|
+
expect(gitClientTimeoutNumber.value).toBe('180');
|
|
298
|
+
expect(nodeSelectorKeyValue.value).toBe('foo');
|
|
299
|
+
expect(tolerationsTaints.value).toBe('foo');
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
it('should save ConfigMap values preserving extraneous values', async() => {
|
|
303
|
+
const wrapper = mount(ConfigMapSettings, {
|
|
304
|
+
...requiredSetup(),
|
|
305
|
+
props: {
|
|
306
|
+
settings,
|
|
307
|
+
groups,
|
|
308
|
+
name: 'cm-name',
|
|
309
|
+
namespace: 'cm-namespace',
|
|
310
|
+
dataKey: 'fleet'
|
|
311
|
+
},
|
|
312
|
+
computed: {
|
|
313
|
+
mode: () => _EDIT,
|
|
314
|
+
canEdit: () => true,
|
|
315
|
+
fetchState: () => ({ $fetchState: false }),
|
|
316
|
+
},
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
wrapper.setData({ configMap });
|
|
320
|
+
|
|
321
|
+
wrapper.vm.initValues();
|
|
322
|
+
|
|
323
|
+
await wrapper.vm.$nextTick();
|
|
324
|
+
|
|
325
|
+
await wrapper.vm.save(() => {});
|
|
326
|
+
|
|
327
|
+
const cm = wrapper.vm.configMap as any;
|
|
328
|
+
|
|
329
|
+
expect(cm.data).toStrictEqual({
|
|
330
|
+
fleet: 'foo: bar\ngarbageCollectionInterval: 1h\ngitjob:\n replicas: 5\ndebug: true\nnodeSelector:\n key: value1\ngarbageCollectionIntervalNumber: 840s\ngitClientTimeoutNumber: 180s\nnodeSelectorKeyValue:\n foo: bar\ntolerationsTaints:\n - key: foo\n value: bar\n effect: PreferNoSchedule\ngitClientTimeout: 30s\nmultiSelect: foo\nagentTLSMode: system-store\n',
|
|
331
|
+
foo: { bar: 'value' },
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
it('should show groups titles and hide body if group is collapsed', async() => {
|
|
336
|
+
const wrapper = mount(ConfigMapSettings, {
|
|
337
|
+
...requiredSetup(),
|
|
338
|
+
props: {
|
|
339
|
+
settings,
|
|
340
|
+
groups: [{
|
|
341
|
+
name: 'general',
|
|
342
|
+
children: [
|
|
343
|
+
'garbageCollectionInterval',
|
|
344
|
+
'gitClientTimeout'
|
|
345
|
+
],
|
|
346
|
+
expanded: false,
|
|
347
|
+
weight: 0
|
|
348
|
+
}],
|
|
349
|
+
name: 'cm-name',
|
|
350
|
+
namespace: 'cm-namespace',
|
|
351
|
+
dataKey: 'fleet'
|
|
352
|
+
},
|
|
353
|
+
computed: {
|
|
354
|
+
mode: () => _EDIT,
|
|
355
|
+
canEdit: () => true,
|
|
356
|
+
fetchState: () => ({ $fetchState: false }),
|
|
357
|
+
},
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
wrapper.vm.initValues();
|
|
361
|
+
|
|
362
|
+
await wrapper.vm.$nextTick();
|
|
363
|
+
|
|
364
|
+
const generalGroupRow = wrapper.find('[data-testid="cm-settings-row-general"]');
|
|
365
|
+
const generalGroupBody = wrapper.find('[data-testid="cm-settings-group-body-general"]');
|
|
366
|
+
|
|
367
|
+
const garbageCollectionInterval = wrapper.find('[data-testid="cm-settings-field-string-garbageCollectionInterval"]');
|
|
368
|
+
const gitClientTimeout = wrapper.find('[data-testid="cm-settings-field-string-gitClientTimeout"]');
|
|
369
|
+
|
|
370
|
+
expect(generalGroupRow.exists()).toBe(true);
|
|
371
|
+
expect(generalGroupBody.exists()).toBe(false);
|
|
372
|
+
|
|
373
|
+
expect(garbageCollectionInterval.exists()).toBe(false);
|
|
374
|
+
expect(gitClientTimeout.exists()).toBe(false);
|
|
375
|
+
});
|
|
376
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import FilterPanel from '@shell/components/FilterPanel.vue';
|
|
3
|
+
import Checkbox from '@components/Form/Checkbox/Checkbox.vue';
|
|
4
|
+
|
|
5
|
+
const filters = [
|
|
6
|
+
{
|
|
7
|
+
key: 'status',
|
|
8
|
+
title: 'Status',
|
|
9
|
+
options: [
|
|
10
|
+
{ label: 'Installed', value: 'installed' },
|
|
11
|
+
{ label: 'Deprecated', value: 'deprecated' }
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
key: 'repos',
|
|
16
|
+
title: 'Repository',
|
|
17
|
+
options: [
|
|
18
|
+
{ label: 'Repo A', value: 'repo-a' },
|
|
19
|
+
{ label: 'Repo B', value: 'repo-b' }
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
describe('component: FilterPanel', () => {
|
|
25
|
+
it('renders all filter groups and options with correct labels', () => {
|
|
26
|
+
const wrapper = mount(FilterPanel, {
|
|
27
|
+
props: {
|
|
28
|
+
modelValue: {},
|
|
29
|
+
filters
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
expect(wrapper.findAll('.filter-panel-filter-group-title')).toHaveLength(2);
|
|
34
|
+
expect(wrapper.text()).toContain('Status');
|
|
35
|
+
expect(wrapper.text()).toContain('Repository');
|
|
36
|
+
expect(wrapper.text()).toContain('Installed');
|
|
37
|
+
expect(wrapper.text()).toContain('Repo A');
|
|
38
|
+
expect(wrapper.text()).toContain('Repo B');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('emits update:modelValue when a new status is added via checkbox emit', async() => {
|
|
42
|
+
const wrapper = mount(FilterPanel, {
|
|
43
|
+
props: {
|
|
44
|
+
modelValue: { status: ['installed'] },
|
|
45
|
+
filters
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const checkboxes = wrapper.findAllComponents(Checkbox);
|
|
50
|
+
const deprecatedCheckbox = checkboxes.find((c) => c.props('label') === 'Deprecated');
|
|
51
|
+
|
|
52
|
+
expect(deprecatedCheckbox).toBeTruthy();
|
|
53
|
+
|
|
54
|
+
deprecatedCheckbox?.vm.$emit('update:value', ['installed', 'deprecated']);
|
|
55
|
+
await wrapper.vm.$nextTick();
|
|
56
|
+
|
|
57
|
+
const emitted = wrapper.emitted('update:modelValue');
|
|
58
|
+
|
|
59
|
+
expect(emitted).toBeTruthy();
|
|
60
|
+
expect(emitted?.[0][0].status).toStrictEqual(['installed', 'deprecated']);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('renders a custom component if provided in option', () => {
|
|
64
|
+
const CustomComponent = { template: '<div>Custom content</div>' };
|
|
65
|
+
|
|
66
|
+
const wrapper = mount(FilterPanel, {
|
|
67
|
+
props: {
|
|
68
|
+
modelValue: {},
|
|
69
|
+
filters: [
|
|
70
|
+
{
|
|
71
|
+
key: 'custom',
|
|
72
|
+
title: 'Custom Filters',
|
|
73
|
+
options: [{ component: CustomComponent }]
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
expect(wrapper.text()).toContain('Custom content');
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -43,7 +43,6 @@ describe('component: GrowlManager', () => {
|
|
|
43
43
|
const growlFirstItemTitle = wrapper.find('.growl-list [data-testid="growl-list-item-0"] .growl-text div');
|
|
44
44
|
const growlFirstItemMessage = wrapper.find('.growl-list [data-testid="growl-list-item-0"] .growl-text p');
|
|
45
45
|
const growlFirstItemClose = wrapper.find('.growl-list [data-testid="growl-list-item-0"] .close.icon');
|
|
46
|
-
const clearAllButton = wrapper.find('button[type="button"]');
|
|
47
46
|
|
|
48
47
|
expect(growlMainContainer.exists()).toBe(true);
|
|
49
48
|
expect(growlListContainer.exists()).toBe(true);
|
|
@@ -52,7 +51,6 @@ describe('component: GrowlManager', () => {
|
|
|
52
51
|
expect(growlFirstItemTitle.text()).toBe('growl1-title');
|
|
53
52
|
expect(growlFirstItemMessage.text()).toBe('growl1-message');
|
|
54
53
|
expect(growlFirstItemClose.exists()).toBe(true);
|
|
55
|
-
expect(clearAllButton.exists()).toBe(true);
|
|
56
54
|
});
|
|
57
55
|
|
|
58
56
|
it('clicking on individual growl close should dismiss the individual growl', async() => {
|
|
@@ -79,29 +77,6 @@ describe('component: GrowlManager', () => {
|
|
|
79
77
|
expect(spyDispatch).toHaveBeenCalledTimes(1);
|
|
80
78
|
});
|
|
81
79
|
|
|
82
|
-
it('clicking on clear all growls should dismiss all growls', async() => {
|
|
83
|
-
const mockStore = {
|
|
84
|
-
getters: { 'i18n/t': jest.fn() },
|
|
85
|
-
dispatch: () => jest.fn()
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const wrapper = shallowMount(GrowlManager, {
|
|
89
|
-
computed: { stack: () => stackMock },
|
|
90
|
-
global: { mocks: { $store: mockStore } }
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
const clearAllButton = wrapper.find('button[type="button"]');
|
|
94
|
-
const spyCloseAll = jest.spyOn(wrapper.vm, 'closeAll');
|
|
95
|
-
const spyDispatch = jest.spyOn(mockStore, 'dispatch');
|
|
96
|
-
|
|
97
|
-
clearAllButton.trigger('click');
|
|
98
|
-
|
|
99
|
-
await nextTick();
|
|
100
|
-
|
|
101
|
-
expect(spyCloseAll).toHaveBeenCalledTimes(1);
|
|
102
|
-
expect(spyDispatch).toHaveBeenCalledTimes(1);
|
|
103
|
-
});
|
|
104
|
-
|
|
105
80
|
it('growl should auto remove itself after set interval of 1 second', async() => {
|
|
106
81
|
jest.useFakeTimers();
|
|
107
82
|
|
|
@@ -98,9 +98,8 @@ export default {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
.values {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
101
|
+
border-spacing: 8px 8px; // Add spacing between columns and rows
|
|
102
|
+
margin-left: -8px; // Move the table back to the left, to compensate for the spacing from above on the left-hand column
|
|
104
103
|
}
|
|
105
104
|
|
|
106
105
|
</style>
|
|
@@ -18,6 +18,7 @@ import LabeledInput from '@components/Form/LabeledInput/LabeledInput.vue';
|
|
|
18
18
|
|
|
19
19
|
import { SUBTYPE_MAPPING, VERBS } from '@shell/models/management.cattle.io.roletemplate';
|
|
20
20
|
import Loading from '@shell/components/Loading';
|
|
21
|
+
import Banner from '@components/Banner/Banner.vue';
|
|
21
22
|
|
|
22
23
|
const GLOBAL = SUBTYPE_MAPPING.GLOBAL.key;
|
|
23
24
|
const CLUSTER = SUBTYPE_MAPPING.CLUSTER.key;
|
|
@@ -64,7 +65,8 @@ export default {
|
|
|
64
65
|
SortableTable,
|
|
65
66
|
Loading,
|
|
66
67
|
Error,
|
|
67
|
-
LabeledInput
|
|
68
|
+
LabeledInput,
|
|
69
|
+
Banner,
|
|
68
70
|
},
|
|
69
71
|
|
|
70
72
|
mixins: [CreateEditView, FormValidation],
|
|
@@ -497,7 +499,8 @@ export default {
|
|
|
497
499
|
index: i,
|
|
498
500
|
apiGroups: rule.apiGroups || [''],
|
|
499
501
|
resources: rule.resources || [],
|
|
500
|
-
nonResourceURLs: rule.nonResourceURLs || []
|
|
502
|
+
nonResourceURLs: rule.nonResourceURLs || [],
|
|
503
|
+
verbs: rule.verbs,
|
|
501
504
|
};
|
|
502
505
|
|
|
503
506
|
VERBS.forEach((verb) => {
|
|
@@ -531,6 +534,13 @@ export default {
|
|
|
531
534
|
|
|
532
535
|
return res;
|
|
533
536
|
},
|
|
537
|
+
|
|
538
|
+
showPsaWarning(grant) {
|
|
539
|
+
return this.value.subtype === NAMESPACE &&
|
|
540
|
+
grant.verbs?.includes('updatepsa') &&
|
|
541
|
+
grant.resources?.includes('projects') &&
|
|
542
|
+
grant.apiGroups?.includes('management.cattle.io');
|
|
543
|
+
}
|
|
534
544
|
}
|
|
535
545
|
};
|
|
536
546
|
</script>
|
|
@@ -558,7 +568,28 @@ export default {
|
|
|
558
568
|
:table-actions="false"
|
|
559
569
|
:row-actions="false"
|
|
560
570
|
:search="false"
|
|
561
|
-
|
|
571
|
+
:sub-rows="true"
|
|
572
|
+
>
|
|
573
|
+
<template #sub-row="{row, fullColspan, onRowMouseEnter, onRowMouseLeave}">
|
|
574
|
+
<tr
|
|
575
|
+
|
|
576
|
+
class="sub-row"
|
|
577
|
+
@mouseenter="onRowMouseEnter"
|
|
578
|
+
@mouseleave="onRowMouseLeave"
|
|
579
|
+
>
|
|
580
|
+
<td
|
|
581
|
+
v-if="showPsaWarning(row)"
|
|
582
|
+
:colspan="fullColspan"
|
|
583
|
+
>
|
|
584
|
+
<Banner
|
|
585
|
+
style="margin: 0px"
|
|
586
|
+
label-key="rbac.roletemplate.tabs.grantResources.psaWarning"
|
|
587
|
+
color="warning"
|
|
588
|
+
/>
|
|
589
|
+
</td>
|
|
590
|
+
</tr>
|
|
591
|
+
</template>
|
|
592
|
+
</SortableTable>
|
|
562
593
|
<div
|
|
563
594
|
v-for="(inherited, index) of inheritedRules"
|
|
564
595
|
:key="index"
|
|
@@ -732,6 +763,17 @@ export default {
|
|
|
732
763
|
</div>
|
|
733
764
|
</div>
|
|
734
765
|
</template>
|
|
766
|
+
<template #value-sub-row="{row}">
|
|
767
|
+
<div
|
|
768
|
+
v-if="showPsaWarning(row.value)"
|
|
769
|
+
class="mr-20"
|
|
770
|
+
>
|
|
771
|
+
<Banner
|
|
772
|
+
label-key="rbac.roletemplate.tabs.grantResources.psaWarning"
|
|
773
|
+
color="warning"
|
|
774
|
+
/>
|
|
775
|
+
</div>
|
|
776
|
+
</template>
|
|
735
777
|
</ArrayList>
|
|
736
778
|
</Tab>
|
|
737
779
|
<Tab
|
|
@@ -6,7 +6,12 @@ export default {
|
|
|
6
6
|
|
|
7
7
|
computed: {
|
|
8
8
|
uniqueDisplayName() {
|
|
9
|
-
|
|
9
|
+
switch (this.name) {
|
|
10
|
+
case 'cognito':
|
|
11
|
+
return this.t('model.authConfig.description.cognito');
|
|
12
|
+
default:
|
|
13
|
+
return this.t('model.authConfig.description.oidc');
|
|
14
|
+
}
|
|
10
15
|
},
|
|
11
16
|
},
|
|
12
17
|
|